@qodalis/console-kit 0.0.0-stage → 1.0.0-beta.33

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 (60) hide show
  1. package/README.md +251 -2
  2. package/dist/components/Badge.d.ts +14 -0
  3. package/dist/components/ButtonGroup.d.ts +35 -0
  4. package/dist/components/ChipList.d.ts +53 -0
  5. package/dist/components/ConfirmDialog.d.ts +28 -0
  6. package/dist/components/DataTable.d.ts +29 -0
  7. package/dist/components/DropdownMenu.d.ts +32 -0
  8. package/dist/components/ErrorBoundary.d.ts +29 -0
  9. package/dist/components/Modal.d.ts +30 -0
  10. package/dist/components/MonoPanel.d.ts +9 -0
  11. package/dist/components/PageHeader.d.ts +7 -0
  12. package/dist/components/Pagination.d.ts +11 -0
  13. package/dist/components/Select.d.ts +54 -0
  14. package/dist/components/Skeleton.d.ts +66 -0
  15. package/dist/components/Spinner.d.ts +9 -0
  16. package/dist/components/StatCard.d.ts +9 -0
  17. package/dist/components/States.d.ts +33 -0
  18. package/dist/components/Tooltip.d.ts +24 -0
  19. package/dist/components/actionIcons.d.ts +6 -0
  20. package/dist/components/charts/ColumnChart.d.ts +37 -0
  21. package/dist/components/charts/LineChart.d.ts +28 -0
  22. package/dist/components/charts/chartParts.d.ts +31 -0
  23. package/dist/components/charts/chartUtils.d.ts +14 -0
  24. package/dist/components/componentText.d.ts +3 -0
  25. package/dist/components/drawerGestures.d.ts +15 -0
  26. package/dist/components/errorText.d.ts +31 -0
  27. package/dist/components/overlay.d.ts +51 -0
  28. package/dist/components/paging.d.ts +16 -0
  29. package/dist/components/sortRows.d.ts +10 -0
  30. package/dist/components/useConfirm.d.ts +18 -0
  31. package/dist/extension/ExtensionLink.d.ts +10 -0
  32. package/dist/extension/defineExtension.d.ts +96 -0
  33. package/dist/extension/serverPlugin.d.ts +18 -0
  34. package/dist/extension/serverPluginApi.d.ts +42 -0
  35. package/dist/extension/types.d.ts +247 -0
  36. package/dist/extension/useQueryParams.d.ts +5 -0
  37. package/dist/format.d.ts +4 -0
  38. package/dist/hooks/liveReload.d.ts +28 -0
  39. package/dist/hooks/useAsync.d.ts +10 -0
  40. package/dist/hooks/usePaging.d.ts +10 -0
  41. package/dist/hooks/useStoredState.d.ts +9 -0
  42. package/dist/i18n/locales.d.ts +60 -0
  43. package/dist/i18n/messages.d.ts +3 -0
  44. package/dist/i18n/text.d.ts +21 -0
  45. package/dist/i18n/translations.d.ts +32 -0
  46. package/dist/index.d.ts +64 -0
  47. package/dist/index.js +2735 -0
  48. package/dist/index.js.map +1 -0
  49. package/dist/styles.css +1 -0
  50. package/dist/tailwind-preset.js +35 -0
  51. package/dist/tailwind-preset.js.map +1 -0
  52. package/dist/testing.d.ts +35 -0
  53. package/dist/testing.js +70 -0
  54. package/dist/testing.js.map +1 -0
  55. package/dist/theme/tagColors.d.ts +27 -0
  56. package/dist/theme/tailwind-preset.d.ts +46 -0
  57. package/dist/theme/tokens.d.ts +33 -0
  58. package/dist/tokens-3WNFc3gU.js +82 -0
  59. package/dist/tokens-3WNFc3gU.js.map +1 -0
  60. package/package.json +59 -4
package/dist/index.js ADDED
@@ -0,0 +1,2735 @@
1
+ var ht = Object.defineProperty;
2
+ var ft = (e, t, n) => t in e ? ht(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var Ne = (e, t, n) => ft(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { useMemo as ee, useContext as Ve, createContext as Ze, useRef as E, useEffect as B, useCallback as V, useState as T, useLayoutEffect as ke, useId as de, Component as gt } from "react";
5
+ import { jsx as o, jsxs as m, Fragment as W } from "react/jsx-runtime";
6
+ import { createRoot as Xe } from "react-dom/client";
7
+ import { D as Tr, a as Or, L as $r, T as Ir, c as Dr } from "./tokens-3WNFc3gU.js";
8
+ import { createPortal as xe } from "react-dom";
9
+ const bt = [
10
+ { code: "en", name: "English" },
11
+ { code: "es", name: "Español" },
12
+ { code: "fr", name: "Français" },
13
+ { code: "de", name: "Deutsch" },
14
+ { code: "pt", name: "Português" },
15
+ { code: "it", name: "Italiano" },
16
+ { code: "ja", name: "日本語" },
17
+ { code: "ko", name: "한국어" },
18
+ { code: "zh", name: "中文" },
19
+ { code: "ru", name: "Русский" },
20
+ { code: "ro", name: "Română" }
21
+ ];
22
+ function In(e) {
23
+ return e;
24
+ }
25
+ function xt(e) {
26
+ return bt.some((t) => t.code === e);
27
+ }
28
+ const Oe = {
29
+ en: {
30
+ serverPluginMissing: "This page needs the server plugin {title}",
31
+ serverPluginMissingHint: "{title} is not installed on this server, so this page has nothing to show. Install it, then restart the server.",
32
+ serverPluginOpen: "Open it in the marketplace",
33
+ serverPluginFromCode: "Add it in the server’s code:",
34
+ paletteSearchIn: "Search {page} for “{query}”",
35
+ autoScrollOn: "Auto-scroll ON",
36
+ autoScrollOff: "Auto-scroll OFF",
37
+ breadcrumb: "Path",
38
+ root: "Root directory",
39
+ paletteOpen: "Search…",
40
+ paletteTitle: "Go to",
41
+ palettePlaceholder: "Go to a page, a job or a command, or search…",
42
+ paletteEmpty: "Nothing found.",
43
+ palettePages: "Pages",
44
+ paletteSearchGroup: "Search",
45
+ paletteSearchLogs: "Search logs for “{query}”",
46
+ paletteMove: "move",
47
+ paletteOpenItem: "open",
48
+ paletteClose: "close",
49
+ pagination: "Pages",
50
+ rowsPerPage: "Rows per page",
51
+ pageRange: "{from}–{to} of {total}",
52
+ previousPage: "Previous",
53
+ nextPage: "Next",
54
+ pageOf: "Page {page} of {pages}",
55
+ selectSearch: "Search…",
56
+ selectNoMatches: "No matches",
57
+ selectClear: "Clear",
58
+ selectMore: "+{count}",
59
+ dialogClose: "Close",
60
+ confirmOk: "Confirm",
61
+ confirmCancel: "Cancel",
62
+ confirmBusy: "Working…",
63
+ moreActions: "More actions",
64
+ rowActions: "Actions for {name}",
65
+ noData: "No data",
66
+ sortBy: "Sort by {column}",
67
+ table: "Table",
68
+ pageFailed: "This page failed to load",
69
+ retry: "Retry",
70
+ loading: "Loading…",
71
+ loadFailed: "Could not load the data",
72
+ noAccess: "You don't have access to this page",
73
+ noAccessPermission: "It needs the permission {permission}. Ask an administrator to grant it.",
74
+ noAccessHint: "Ask an administrator to give you access.",
75
+ missingPermission: "Missing permission: {permission}",
76
+ sectionFailed: "{label} failed to render",
77
+ thisSection: "This section",
78
+ panel: "Panel",
79
+ chipListMore: "+{count} more",
80
+ chipListShowAll: "Show all {count}",
81
+ chipListTitle: "All items ({count})",
82
+ chipListSearch: "Search the list",
83
+ chipListMatches: "{shown} of {total}"
84
+ },
85
+ es: {
86
+ serverPluginMissing: "Esta página necesita el plugin de servidor {title}",
87
+ serverPluginMissingHint: "{title} no está instalado en este servidor, así que esta página no tiene nada que mostrar. Instálalo y reinicia el servidor.",
88
+ serverPluginOpen: "Abrirlo en el marketplace",
89
+ serverPluginFromCode: "Añádelo en el código del servidor:",
90
+ paletteClose: "cerrar",
91
+ paletteOpenItem: "abrir",
92
+ paletteMove: "mover",
93
+ paletteSearchIn: "Buscar «{query}» en {page}",
94
+ paletteSearchLogs: "Buscar «{query}» en los registros",
95
+ paletteSearchGroup: "Buscar",
96
+ palettePages: "Páginas",
97
+ paletteEmpty: "No se encontró nada.",
98
+ palettePlaceholder: "Ir a una página, una tarea o un comando, o buscar…",
99
+ paletteTitle: "Ir a",
100
+ paletteOpen: "Buscar…",
101
+ autoScrollOn: "Desplazamiento auto: SÍ",
102
+ autoScrollOff: "Desplazamiento auto: NO",
103
+ breadcrumb: "Ruta",
104
+ root: "Directorio raíz",
105
+ pagination: "Páginas",
106
+ rowsPerPage: "Filas por página",
107
+ pageRange: "{from}–{to} de {total}",
108
+ previousPage: "Anterior",
109
+ nextPage: "Siguiente",
110
+ pageOf: "Página {page} de {pages}",
111
+ selectSearch: "Buscar…",
112
+ selectNoMatches: "Sin coincidencias",
113
+ selectClear: "Borrar",
114
+ selectMore: "+{count}",
115
+ dialogClose: "Cerrar",
116
+ confirmOk: "Confirmar",
117
+ confirmCancel: "Cancelar",
118
+ confirmBusy: "Procesando…",
119
+ moreActions: "Más acciones",
120
+ rowActions: "Acciones de {name}",
121
+ noData: "Sin datos",
122
+ sortBy: "Ordenar por {column}",
123
+ table: "Tabla",
124
+ pageFailed: "No se pudo cargar esta página",
125
+ retry: "Reintentar",
126
+ loading: "Cargando…",
127
+ loadFailed: "No se pudieron cargar los datos",
128
+ noAccess: "No tienes acceso a esta página",
129
+ noAccessPermission: "Necesita el permiso {permission}. Pide a un administrador que te lo conceda.",
130
+ noAccessHint: "Pide acceso a un administrador.",
131
+ missingPermission: "Falta el permiso: {permission}",
132
+ sectionFailed: "No se pudo mostrar {label}",
133
+ thisSection: "Esta sección",
134
+ panel: "Panel",
135
+ chipListMore: "+{count} más",
136
+ chipListShowAll: "Mostrar los {count}",
137
+ chipListTitle: "Todos los elementos ({count})",
138
+ chipListSearch: "Buscar en la lista",
139
+ chipListMatches: "{shown} de {total}"
140
+ },
141
+ fr: {
142
+ serverPluginMissing: "Cette page a besoin du plugin serveur {title}",
143
+ serverPluginMissingHint: "{title} n’est pas installé sur ce serveur : cette page n’a rien à afficher. Installez-le, puis redémarrez le serveur.",
144
+ serverPluginOpen: "L’ouvrir dans le marketplace",
145
+ serverPluginFromCode: "Ajoutez-le dans le code du serveur :",
146
+ paletteClose: "fermer",
147
+ paletteOpenItem: "ouvrir",
148
+ paletteMove: "déplacer",
149
+ paletteSearchIn: "Rechercher « {query} » dans {page}",
150
+ paletteSearchLogs: "Rechercher « {query} » dans les journaux",
151
+ paletteSearchGroup: "Rechercher",
152
+ palettePages: "Pages",
153
+ paletteEmpty: "Aucun résultat.",
154
+ palettePlaceholder: "Aller à une page, une tâche ou une commande, ou rechercher…",
155
+ paletteTitle: "Aller à",
156
+ paletteOpen: "Rechercher…",
157
+ autoScrollOn: "Défilement auto : ON",
158
+ autoScrollOff: "Défilement auto : OFF",
159
+ breadcrumb: "Chemin",
160
+ root: "Répertoire racine",
161
+ pagination: "Pages",
162
+ rowsPerPage: "Lignes par page",
163
+ pageRange: "{from}–{to} sur {total}",
164
+ previousPage: "Précédent",
165
+ nextPage: "Suivant",
166
+ pageOf: "Page {page} sur {pages}",
167
+ selectSearch: "Rechercher…",
168
+ selectNoMatches: "Aucun résultat",
169
+ selectClear: "Effacer",
170
+ selectMore: "+{count}",
171
+ dialogClose: "Fermer",
172
+ confirmOk: "Confirmer",
173
+ confirmCancel: "Annuler",
174
+ confirmBusy: "En cours…",
175
+ moreActions: "Plus d’actions",
176
+ rowActions: "Actions pour {name}",
177
+ noData: "Aucune donnée",
178
+ sortBy: "Trier par {column}",
179
+ table: "Tableau",
180
+ pageFailed: "Impossible de charger cette page",
181
+ retry: "Réessayer",
182
+ loading: "Chargement…",
183
+ loadFailed: "Impossible de charger les données",
184
+ noAccess: "Vous n’avez pas accès à cette page",
185
+ noAccessPermission: "Elle nécessite la permission {permission}. Demandez-la à un administrateur.",
186
+ noAccessHint: "Demandez l’accès à un administrateur.",
187
+ missingPermission: "Permission manquante : {permission}",
188
+ sectionFailed: "Impossible d’afficher {label}",
189
+ thisSection: "Cette section",
190
+ panel: "Panneau",
191
+ chipListMore: "+{count} de plus",
192
+ chipListShowAll: "Tout afficher ({count})",
193
+ chipListTitle: "Tous les éléments ({count})",
194
+ chipListSearch: "Rechercher dans la liste",
195
+ chipListMatches: "{shown} sur {total}"
196
+ },
197
+ de: {
198
+ serverPluginMissing: "Diese Seite braucht das Server-Plugin {title}",
199
+ serverPluginMissingHint: "{title} ist auf diesem Server nicht installiert, daher hat diese Seite nichts anzuzeigen. Installieren Sie es und starten Sie den Server neu.",
200
+ serverPluginOpen: "Im Marketplace öffnen",
201
+ serverPluginFromCode: "Im Code des Servers hinzufügen:",
202
+ paletteClose: "schließen",
203
+ paletteOpenItem: "öffnen",
204
+ paletteMove: "bewegen",
205
+ paletteSearchIn: "„{query}“ in {page} suchen",
206
+ paletteSearchLogs: "„{query}“ in den Logs suchen",
207
+ paletteSearchGroup: "Suche",
208
+ palettePages: "Seiten",
209
+ paletteEmpty: "Nichts gefunden.",
210
+ palettePlaceholder: "Zu einer Seite, einem Job oder einem Befehl springen oder suchen…",
211
+ paletteTitle: "Gehe zu",
212
+ paletteOpen: "Suchen…",
213
+ autoScrollOn: "Auto-Scroll AN",
214
+ autoScrollOff: "Auto-Scroll AUS",
215
+ breadcrumb: "Pfad",
216
+ root: "Stammverzeichnis",
217
+ pagination: "Seiten",
218
+ rowsPerPage: "Zeilen pro Seite",
219
+ pageRange: "{from}–{to} von {total}",
220
+ previousPage: "Zurück",
221
+ nextPage: "Weiter",
222
+ pageOf: "Seite {page} von {pages}",
223
+ selectSearch: "Suchen…",
224
+ selectNoMatches: "Keine Treffer",
225
+ selectClear: "Leeren",
226
+ selectMore: "+{count}",
227
+ dialogClose: "Schließen",
228
+ confirmOk: "Bestätigen",
229
+ confirmCancel: "Abbrechen",
230
+ confirmBusy: "Wird ausgeführt…",
231
+ moreActions: "Weitere Aktionen",
232
+ rowActions: "Aktionen für {name}",
233
+ noData: "Keine Daten",
234
+ sortBy: "Nach {column} sortieren",
235
+ table: "Tabelle",
236
+ pageFailed: "Diese Seite konnte nicht geladen werden",
237
+ retry: "Erneut versuchen",
238
+ loading: "Wird geladen…",
239
+ loadFailed: "Die Daten konnten nicht geladen werden",
240
+ noAccess: "Sie haben keinen Zugriff auf diese Seite",
241
+ noAccessPermission: "Sie benötigt die Berechtigung {permission}. Bitten Sie einen Administrator, sie Ihnen zu erteilen.",
242
+ noAccessHint: "Bitten Sie einen Administrator um Zugriff.",
243
+ missingPermission: "Fehlende Berechtigung: {permission}",
244
+ sectionFailed: "{label} konnte nicht angezeigt werden",
245
+ thisSection: "Dieser Bereich",
246
+ panel: "Bereich",
247
+ chipListMore: "+{count} weitere",
248
+ chipListShowAll: "Alle {count} anzeigen",
249
+ chipListTitle: "Alle Einträge ({count})",
250
+ chipListSearch: "Liste durchsuchen",
251
+ chipListMatches: "{shown} von {total}"
252
+ },
253
+ pt: {
254
+ serverPluginMissing: "Esta página precisa do plugin de servidor {title}",
255
+ serverPluginMissingHint: "{title} não está instalado neste servidor, por isso esta página não tem nada para mostrar. Instale-o e reinicie o servidor.",
256
+ serverPluginOpen: "Abrir no marketplace",
257
+ serverPluginFromCode: "Adicione-o no código do servidor:",
258
+ paletteClose: "fechar",
259
+ paletteOpenItem: "abrir",
260
+ paletteMove: "mover",
261
+ paletteSearchIn: "Pesquisar “{query}” em {page}",
262
+ paletteSearchLogs: "Pesquisar “{query}” nos logs",
263
+ paletteSearchGroup: "Pesquisar",
264
+ palettePages: "Páginas",
265
+ paletteEmpty: "Nada encontrado.",
266
+ palettePlaceholder: "Ir para uma página, uma tarefa ou um comando, ou pesquisar…",
267
+ paletteTitle: "Ir para",
268
+ paletteOpen: "Pesquisar…",
269
+ autoScrollOn: "Rolagem automática: SIM",
270
+ autoScrollOff: "Rolagem automática: NÃO",
271
+ breadcrumb: "Caminho",
272
+ root: "Diretório raiz",
273
+ pagination: "Páginas",
274
+ rowsPerPage: "Linhas por página",
275
+ pageRange: "{from}–{to} de {total}",
276
+ previousPage: "Anterior",
277
+ nextPage: "Seguinte",
278
+ pageOf: "Página {page} de {pages}",
279
+ selectSearch: "Pesquisar…",
280
+ selectNoMatches: "Nenhum resultado",
281
+ selectClear: "Limpar",
282
+ selectMore: "+{count}",
283
+ dialogClose: "Fechar",
284
+ confirmOk: "Confirmar",
285
+ confirmCancel: "Cancelar",
286
+ confirmBusy: "Processando…",
287
+ moreActions: "Mais ações",
288
+ rowActions: "Ações de {name}",
289
+ noData: "Sem dados",
290
+ sortBy: "Ordenar por {column}",
291
+ table: "Tabela",
292
+ pageFailed: "Não foi possível carregar esta página",
293
+ retry: "Tentar novamente",
294
+ loading: "Carregando…",
295
+ loadFailed: "Não foi possível carregar os dados",
296
+ noAccess: "Você não tem acesso a esta página",
297
+ noAccessPermission: "Ela requer a permissão {permission}. Peça a um administrador para concedê-la.",
298
+ noAccessHint: "Peça acesso a um administrador.",
299
+ missingPermission: "Permissão ausente: {permission}",
300
+ sectionFailed: "Não foi possível exibir {label}",
301
+ thisSection: "Esta seção",
302
+ panel: "Painel",
303
+ chipListMore: "+{count} mais",
304
+ chipListShowAll: "Mostrar todos os {count}",
305
+ chipListTitle: "Todos os itens ({count})",
306
+ chipListSearch: "Pesquisar na lista",
307
+ chipListMatches: "{shown} de {total}"
308
+ },
309
+ it: {
310
+ serverPluginMissing: "Questa pagina richiede il plugin server {title}",
311
+ serverPluginMissingHint: "{title} non è installato su questo server, quindi questa pagina non ha nulla da mostrare. Installalo, poi riavvia il server.",
312
+ serverPluginOpen: "Aprilo nel marketplace",
313
+ serverPluginFromCode: "Aggiungilo nel codice del server:",
314
+ paletteClose: "chiudi",
315
+ paletteOpenItem: "apri",
316
+ paletteMove: "sposta",
317
+ paletteSearchIn: "Cerca “{query}” in {page}",
318
+ paletteSearchLogs: "Cerca “{query}” nei log",
319
+ paletteSearchGroup: "Cerca",
320
+ palettePages: "Pagine",
321
+ paletteEmpty: "Nessun risultato.",
322
+ palettePlaceholder: "Vai a una pagina, un job o un comando, o cerca…",
323
+ paletteTitle: "Vai a",
324
+ paletteOpen: "Cerca…",
325
+ autoScrollOn: "Scorrimento auto: ON",
326
+ autoScrollOff: "Scorrimento auto: OFF",
327
+ breadcrumb: "Percorso",
328
+ root: "Directory radice",
329
+ pagination: "Pagine",
330
+ rowsPerPage: "Righe per pagina",
331
+ pageRange: "{from}–{to} di {total}",
332
+ previousPage: "Precedente",
333
+ nextPage: "Successiva",
334
+ pageOf: "Pagina {page} di {pages}",
335
+ selectSearch: "Cerca…",
336
+ selectNoMatches: "Nessun risultato",
337
+ selectClear: "Cancella",
338
+ selectMore: "+{count}",
339
+ dialogClose: "Chiudi",
340
+ confirmOk: "Conferma",
341
+ confirmCancel: "Annulla",
342
+ confirmBusy: "In corso…",
343
+ moreActions: "Altre azioni",
344
+ rowActions: "Azioni per {name}",
345
+ noData: "Nessun dato",
346
+ sortBy: "Ordina per {column}",
347
+ table: "Tabella",
348
+ pageFailed: "Impossibile caricare questa pagina",
349
+ retry: "Riprova",
350
+ loading: "Caricamento…",
351
+ loadFailed: "Impossibile caricare i dati",
352
+ noAccess: "Non hai accesso a questa pagina",
353
+ noAccessPermission: "Richiede il permesso {permission}. Chiedi a un amministratore di concedertelo.",
354
+ noAccessHint: "Chiedi l’accesso a un amministratore.",
355
+ missingPermission: "Permesso mancante: {permission}",
356
+ sectionFailed: "Impossibile visualizzare {label}",
357
+ thisSection: "Questa sezione",
358
+ panel: "Pannello",
359
+ chipListMore: "+{count} altri",
360
+ chipListShowAll: "Mostra tutti i {count}",
361
+ chipListTitle: "Tutti gli elementi ({count})",
362
+ chipListSearch: "Cerca nell’elenco",
363
+ chipListMatches: "{shown} di {total}"
364
+ },
365
+ ja: {
366
+ serverPluginMissing: "このページにはサーバープラグイン {title} が必要です",
367
+ serverPluginMissingHint: "{title} がこのサーバーにインストールされていないため、このページには表示する内容がありません。インストールしてからサーバーを再起動してください。",
368
+ serverPluginOpen: "マーケットプレイスで開く",
369
+ serverPluginFromCode: "サーバーのコードに追加:",
370
+ paletteClose: "閉じる",
371
+ paletteOpenItem: "開く",
372
+ paletteMove: "移動",
373
+ paletteSearchIn: "{page}で「{query}」を検索",
374
+ paletteSearchLogs: "ログで「{query}」を検索",
375
+ paletteSearchGroup: "検索",
376
+ palettePages: "ページ",
377
+ paletteEmpty: "見つかりませんでした。",
378
+ palettePlaceholder: "ページ、ジョブ、コマンドへ移動、または検索…",
379
+ paletteTitle: "移動",
380
+ paletteOpen: "検索…",
381
+ autoScrollOn: "自動スクロール: オン",
382
+ autoScrollOff: "自動スクロール: オフ",
383
+ breadcrumb: "パス",
384
+ root: "ルートディレクトリ",
385
+ pagination: "ページ",
386
+ rowsPerPage: "1 ページの行数",
387
+ pageRange: "{total} 件中 {from}–{to}",
388
+ previousPage: "前へ",
389
+ nextPage: "次へ",
390
+ pageOf: "{page} / {pages} ページ",
391
+ selectSearch: "検索…",
392
+ selectNoMatches: "一致なし",
393
+ selectClear: "クリア",
394
+ selectMore: "+{count}",
395
+ dialogClose: "閉じる",
396
+ confirmOk: "確認",
397
+ confirmCancel: "キャンセル",
398
+ confirmBusy: "処理中…",
399
+ moreActions: "その他の操作",
400
+ rowActions: "{name} の操作",
401
+ noData: "データがありません",
402
+ sortBy: "{column} で並べ替え",
403
+ table: "テーブル",
404
+ pageFailed: "このページを読み込めませんでした",
405
+ retry: "再試行",
406
+ loading: "読み込み中…",
407
+ loadFailed: "データを読み込めませんでした",
408
+ noAccess: "このページにアクセスする権限がありません",
409
+ noAccessPermission: "権限 {permission} が必要です。管理者に付与を依頼してください。",
410
+ noAccessHint: "管理者にアクセスを依頼してください。",
411
+ missingPermission: "不足している権限: {permission}",
412
+ sectionFailed: "{label}を表示できませんでした",
413
+ thisSection: "このセクション",
414
+ panel: "パネル",
415
+ chipListMore: "+{count} 件",
416
+ chipListShowAll: "すべて表示 ({count})",
417
+ chipListTitle: "すべての項目 ({count})",
418
+ chipListSearch: "リストを検索",
419
+ chipListMatches: "{total} 件中 {shown} 件"
420
+ },
421
+ ko: {
422
+ serverPluginMissing: "이 페이지에는 서버 플러그인 {title}이(가) 필요합니다",
423
+ serverPluginMissingHint: "{title}이(가) 이 서버에 설치되어 있지 않아 이 페이지에 표시할 내용이 없습니다. 설치한 뒤 서버를 다시 시작하세요.",
424
+ serverPluginOpen: "마켓플레이스에서 열기",
425
+ serverPluginFromCode: "서버 코드에 추가:",
426
+ paletteClose: "닫기",
427
+ paletteOpenItem: "열기",
428
+ paletteMove: "이동",
429
+ paletteSearchIn: "{page}에서 “{query}” 검색",
430
+ paletteSearchLogs: "로그에서 “{query}” 검색",
431
+ paletteSearchGroup: "검색",
432
+ palettePages: "페이지",
433
+ paletteEmpty: "찾을 수 없습니다.",
434
+ palettePlaceholder: "페이지, 작업, 명령으로 이동하거나 검색…",
435
+ paletteTitle: "이동",
436
+ paletteOpen: "검색…",
437
+ autoScrollOn: "자동 스크롤 켜짐",
438
+ autoScrollOff: "자동 스크롤 꺼짐",
439
+ breadcrumb: "경로",
440
+ root: "루트 디렉터리",
441
+ pagination: "페이지",
442
+ rowsPerPage: "페이지당 행 수",
443
+ pageRange: "{total}개 중 {from}–{to}",
444
+ previousPage: "이전",
445
+ nextPage: "다음",
446
+ pageOf: "{pages}페이지 중 {page}페이지",
447
+ selectSearch: "검색…",
448
+ selectNoMatches: "일치 항목 없음",
449
+ selectClear: "지우기",
450
+ selectMore: "+{count}",
451
+ dialogClose: "닫기",
452
+ confirmOk: "확인",
453
+ confirmCancel: "취소",
454
+ confirmBusy: "처리 중…",
455
+ moreActions: "추가 작업",
456
+ rowActions: "{name} 작업",
457
+ noData: "데이터 없음",
458
+ sortBy: "{column} 기준 정렬",
459
+ table: "표",
460
+ pageFailed: "이 페이지를 불러오지 못했습니다",
461
+ retry: "다시 시도",
462
+ loading: "불러오는 중…",
463
+ loadFailed: "데이터를 불러오지 못했습니다",
464
+ noAccess: "이 페이지에 접근할 권한이 없습니다",
465
+ noAccessPermission: "{permission} 권한이 필요합니다. 관리자에게 권한을 요청하세요.",
466
+ noAccessHint: "관리자에게 접근 권한을 요청하세요.",
467
+ missingPermission: "누락된 권한: {permission}",
468
+ sectionFailed: "{label}을(를) 표시하지 못했습니다",
469
+ thisSection: "이 섹션",
470
+ panel: "패널",
471
+ chipListMore: "+{count}개 더 보기",
472
+ chipListShowAll: "{count}개 모두 보기",
473
+ chipListTitle: "전체 항목 ({count})",
474
+ chipListSearch: "목록 검색",
475
+ chipListMatches: "{total}개 중 {shown}개"
476
+ },
477
+ zh: {
478
+ serverPluginMissing: "此页面需要服务器插件 {title}",
479
+ serverPluginMissingHint: "此服务器未安装 {title},因此此页面没有内容可显示。请安装它,然后重启服务器。",
480
+ serverPluginOpen: "在市场中打开",
481
+ serverPluginFromCode: "在服务器代码中添加:",
482
+ paletteClose: "关闭",
483
+ paletteOpenItem: "打开",
484
+ paletteMove: "移动",
485
+ paletteSearchIn: "在{page}中搜索“{query}”",
486
+ paletteSearchLogs: "在日志中搜索“{query}”",
487
+ paletteSearchGroup: "搜索",
488
+ palettePages: "页面",
489
+ paletteEmpty: "未找到。",
490
+ palettePlaceholder: "转到页面、任务或命令,或搜索…",
491
+ paletteTitle: "转到",
492
+ paletteOpen: "搜索…",
493
+ autoScrollOn: "自动滚动:开",
494
+ autoScrollOff: "自动滚动:关",
495
+ breadcrumb: "路径",
496
+ root: "根目录",
497
+ pagination: "分页",
498
+ rowsPerPage: "每页行数",
499
+ pageRange: "第 {from}–{to} 条,共 {total} 条",
500
+ previousPage: "上一页",
501
+ nextPage: "下一页",
502
+ pageOf: "第 {page} / {pages} 页",
503
+ selectSearch: "搜索…",
504
+ selectNoMatches: "无匹配项",
505
+ selectClear: "清除",
506
+ selectMore: "+{count}",
507
+ dialogClose: "关闭",
508
+ confirmOk: "确认",
509
+ confirmCancel: "取消",
510
+ confirmBusy: "处理中…",
511
+ moreActions: "更多操作",
512
+ rowActions: "{name} 的操作",
513
+ noData: "暂无数据",
514
+ sortBy: "按 {column} 排序",
515
+ table: "表格",
516
+ pageFailed: "此页面加载失败",
517
+ retry: "重试",
518
+ loading: "加载中…",
519
+ loadFailed: "无法加载数据",
520
+ noAccess: "您无权访问此页面",
521
+ noAccessPermission: "需要权限 {permission}。请联系管理员授予。",
522
+ noAccessHint: "请联系管理员获取访问权限。",
523
+ missingPermission: "缺少权限:{permission}",
524
+ sectionFailed: "无法显示{label}",
525
+ thisSection: "此部分",
526
+ panel: "面板",
527
+ chipListMore: "+{count} 项",
528
+ chipListShowAll: "显示全部 {count} 项",
529
+ chipListTitle: "全部项目 ({count})",
530
+ chipListSearch: "搜索列表",
531
+ chipListMatches: "{shown} / {total}"
532
+ },
533
+ ru: {
534
+ serverPluginMissing: "Этой странице нужен серверный плагин {title}",
535
+ serverPluginMissingHint: "{title} не установлен на этом сервере, поэтому странице нечего показать. Установите его и перезапустите сервер.",
536
+ serverPluginOpen: "Открыть в маркетплейсе",
537
+ serverPluginFromCode: "Добавьте его в код сервера:",
538
+ paletteClose: "закрыть",
539
+ paletteOpenItem: "открыть",
540
+ paletteMove: "перейти",
541
+ paletteSearchIn: "Искать «{query}» в разделе {page}",
542
+ paletteSearchLogs: "Искать «{query}» в журналах",
543
+ paletteSearchGroup: "Поиск",
544
+ palettePages: "Страницы",
545
+ paletteEmpty: "Ничего не найдено.",
546
+ palettePlaceholder: "Перейти к странице, заданию или команде, или искать…",
547
+ paletteTitle: "Перейти",
548
+ paletteOpen: "Поиск…",
549
+ autoScrollOn: "Автопрокрутка: ВКЛ",
550
+ autoScrollOff: "Автопрокрутка: ВЫКЛ",
551
+ breadcrumb: "Путь",
552
+ root: "Корневой каталог",
553
+ pagination: "Страницы",
554
+ rowsPerPage: "Строк на странице",
555
+ pageRange: "{from}–{to} из {total}",
556
+ previousPage: "Назад",
557
+ nextPage: "Вперёд",
558
+ pageOf: "Страница {page} из {pages}",
559
+ selectSearch: "Поиск…",
560
+ selectNoMatches: "Нет совпадений",
561
+ selectClear: "Очистить",
562
+ selectMore: "+{count}",
563
+ dialogClose: "Закрыть",
564
+ confirmOk: "Подтвердить",
565
+ confirmCancel: "Отмена",
566
+ confirmBusy: "Выполняется…",
567
+ moreActions: "Другие действия",
568
+ rowActions: "Действия для {name}",
569
+ noData: "Нет данных",
570
+ sortBy: "Сортировать по «{column}»",
571
+ table: "Таблица",
572
+ pageFailed: "Не удалось загрузить страницу",
573
+ retry: "Повторить",
574
+ loading: "Загрузка…",
575
+ loadFailed: "Не удалось загрузить данные",
576
+ noAccess: "У вас нет доступа к этой странице",
577
+ noAccessPermission: "Нужно разрешение {permission}. Попросите администратора выдать его.",
578
+ noAccessHint: "Попросите администратора предоставить доступ.",
579
+ missingPermission: "Не хватает разрешения: {permission}",
580
+ sectionFailed: "Не удалось отобразить: {label}",
581
+ thisSection: "Этот раздел",
582
+ panel: "Панель",
583
+ chipListMore: "ещё {count}",
584
+ chipListShowAll: "Показать все ({count})",
585
+ chipListTitle: "Все элементы ({count})",
586
+ chipListSearch: "Поиск по списку",
587
+ chipListMatches: "{shown} из {total}"
588
+ },
589
+ ro: {
590
+ serverPluginMissing: "Această pagină are nevoie de pluginul de server {title}",
591
+ serverPluginMissingHint: "{title} nu este instalat pe acest server, așa că pagina nu are nimic de afișat. Instalează-l, apoi repornește serverul.",
592
+ serverPluginOpen: "Deschide-l în marketplace",
593
+ serverPluginFromCode: "Adaugă-l în codul serverului:",
594
+ paletteSearchIn: "Caută „{query}” în {page}",
595
+ autoScrollOn: "Derulare automată ACTIVĂ",
596
+ autoScrollOff: "Derulare automată OPRITĂ",
597
+ breadcrumb: "Cale",
598
+ root: "Directorul rădăcină",
599
+ paletteOpen: "Caută…",
600
+ paletteTitle: "Mergi la",
601
+ palettePlaceholder: "Mergi la o pagină, un job sau o comandă, ori caută…",
602
+ paletteEmpty: "Nu s-a găsit nimic.",
603
+ palettePages: "Pagini",
604
+ paletteSearchGroup: "Căutare",
605
+ paletteSearchLogs: "Caută „{query}” în jurnale",
606
+ paletteMove: "mută",
607
+ paletteOpenItem: "deschide",
608
+ paletteClose: "închide",
609
+ pagination: "Pagini",
610
+ rowsPerPage: "Rânduri pe pagină",
611
+ pageRange: "{from}–{to} din {total}",
612
+ previousPage: "Înapoi",
613
+ nextPage: "Înainte",
614
+ pageOf: "Pagina {page} din {pages}",
615
+ selectSearch: "Caută…",
616
+ selectNoMatches: "Niciun rezultat",
617
+ selectClear: "Golește",
618
+ selectMore: "+{count}",
619
+ dialogClose: "Închide",
620
+ confirmOk: "Confirmă",
621
+ confirmCancel: "Anulează",
622
+ confirmBusy: "Se lucrează…",
623
+ moreActions: "Mai multe acțiuni",
624
+ rowActions: "Acțiuni pentru {name}",
625
+ noData: "Nu există date",
626
+ sortBy: "Sortează după {column}",
627
+ table: "Tabel",
628
+ pageFailed: "Această pagină nu s-a putut încărca",
629
+ retry: "Reîncearcă",
630
+ loading: "Se încarcă…",
631
+ loadFailed: "Datele nu s-au putut încărca",
632
+ noAccess: "Nu ai acces la această pagină",
633
+ noAccessPermission: "Este nevoie de permisiunea {permission}. Cere unui administrator să ți-o acorde.",
634
+ noAccessHint: "Cere acces unui administrator.",
635
+ missingPermission: "Lipsește permisiunea: {permission}",
636
+ sectionFailed: "{label} nu a putut fi afișat",
637
+ thisSection: "Această secțiune",
638
+ panel: "Panou",
639
+ chipListMore: "încă {count}",
640
+ chipListShowAll: "Arată toate ({count})",
641
+ chipListTitle: "Toate elementele ({count})",
642
+ chipListSearch: "Caută în listă",
643
+ chipListMatches: "{shown} din {total}"
644
+ }
645
+ }, Qe = Ze("en");
646
+ function Je({ locale: e, children: t }) {
647
+ const n = e.toLowerCase().split("-")[0];
648
+ return /* @__PURE__ */ o(Qe.Provider, { value: xt(n) ? n : "en", children: t });
649
+ }
650
+ function Ye() {
651
+ return Ve(Qe);
652
+ }
653
+ function vt(e, t, n) {
654
+ const r = Oe[e];
655
+ return ((r == null ? void 0 : r[t]) ?? Oe.en[t]).replace(/\{(\w+)\}/g, (i, a) => n && a in n ? String(n[a]) : i);
656
+ }
657
+ function j() {
658
+ const e = Ye();
659
+ return ee(() => {
660
+ const t = new Intl.NumberFormat(e);
661
+ return { t: (n, r) => vt(e, n, r), formatNumber: (n) => t.format(n) };
662
+ }, [e]);
663
+ }
664
+ const yt = "qcli-extension";
665
+ let Pe = null, X = null;
666
+ function wt(e) {
667
+ Pe = e;
668
+ }
669
+ function ve() {
670
+ return Pe ? (X != null && X.isConnected || (X = document.createElement("div"), X.className = Pe, X.dataset.qcliOverlays = "", document.body.appendChild(X)), X) : document.body;
671
+ }
672
+ const ge = 4, ie = 8;
673
+ function et(e, t, n, r = "start") {
674
+ const [s, i] = T(null), a = V(() => {
675
+ if (!t || !n.current) return;
676
+ const l = t.getBoundingClientRect(), u = n.current.getBoundingClientRect(), c = window.innerHeight - l.bottom - ge - ie, p = l.top - ge - ie, d = u.height > c && p > c ? "top" : "bottom", S = Math.max(120, d === "bottom" ? c : p), k = Math.min(u.height, S), g = Math.max(u.width, l.width), v = r === "end" ? l.right - g : l.left, N = Math.min(Math.max(ie, v), Math.max(ie, window.innerWidth - g - ie)), C = d === "bottom" ? l.bottom + ge : l.top - ge - k;
677
+ i(
678
+ (b) => b && b.left === N && b.top === C && b.minWidth === l.width && b.maxHeight === S && b.placement === d ? b : { left: N, top: C, minWidth: l.width, maxHeight: S, placement: d }
679
+ );
680
+ }, [t, n, r]);
681
+ return ke(() => {
682
+ if (!e) return;
683
+ a(), window.addEventListener("resize", a);
684
+ const l = typeof ResizeObserver == "function" && n.current ? new ResizeObserver(a) : null;
685
+ return l && n.current && l.observe(n.current), () => {
686
+ window.removeEventListener("resize", a), l == null || l.disconnect();
687
+ };
688
+ }, [e, a, n]), e ? s : null;
689
+ }
690
+ function tt(e, t, n, r) {
691
+ const s = E(t), i = E(n), a = E(r);
692
+ B(() => {
693
+ s.current = t, i.current = n, a.current = r;
694
+ }), B(() => {
695
+ if (!e) return;
696
+ const l = (p) => p instanceof Node && s.current().some((d) => d == null ? void 0 : d.contains(p)), u = (p) => {
697
+ l(p.target) || i.current();
698
+ }, c = (p) => {
699
+ var d;
700
+ l(p.target) || (d = a.current) == null || d.call(a);
701
+ };
702
+ return document.addEventListener("pointerdown", u, !0), document.addEventListener("mousedown", u, !0), window.addEventListener("scroll", c, !0), () => {
703
+ document.removeEventListener("pointerdown", u, !0), document.removeEventListener("mousedown", u, !0), window.removeEventListener("scroll", c, !0);
704
+ };
705
+ }, [e]);
706
+ }
707
+ let $e = 0, Ie = "";
708
+ function Nt(e) {
709
+ B(() => {
710
+ if (e)
711
+ return $e++ === 0 && (Ie = document.body.style.overflow, document.body.style.overflow = "hidden"), () => {
712
+ --$e === 0 && (document.body.style.overflow = Ie);
713
+ };
714
+ }, [e]);
715
+ }
716
+ function ue(e, t, n) {
717
+ for (let r = t + n; r >= 0 && r < e.length; r += n) if (!e[r]) return r;
718
+ return t;
719
+ }
720
+ function Y(e) {
721
+ return e.findIndex((t) => !t);
722
+ }
723
+ function ae(e) {
724
+ for (let t = e.length - 1; t >= 0; t--) if (!e[t]) return t;
725
+ return -1;
726
+ }
727
+ function nt() {
728
+ const e = E(""), t = E(void 0);
729
+ return B(() => () => clearTimeout(t.current), []), V((n, r, s, i) => {
730
+ clearTimeout(t.current), t.current = setTimeout(() => {
731
+ e.current = "";
732
+ }, 500), e.current += n.toLowerCase();
733
+ const a = e.current, l = a.length > 1 && [...a].every((p) => p === a[0]), u = l ? a[0] : a, c = a.length === 1 || l ? i + 1 : i;
734
+ for (let p = 0; p < r.length; p++) {
735
+ const d = (Math.max(0, c) + p) % r.length;
736
+ if (!s[d] && r[d].toLowerCase().startsWith(u)) return d;
737
+ }
738
+ return i;
739
+ }, []);
740
+ }
741
+ function Se(e) {
742
+ return e.key.length === 1 && e.key !== " " && !e.ctrlKey && !e.metaKey && !e.altKey;
743
+ }
744
+ const Pt = 1500, Dn = 250;
745
+ function Rn(e, t) {
746
+ return t === "*" ? !0 : t.endsWith("*") ? e.startsWith(t.slice(0, -1)) : e === t;
747
+ }
748
+ function De(e, t, n) {
749
+ clearTimeout(e.current), e.current = setTimeout(() => {
750
+ e.current = void 0, t();
751
+ }, n);
752
+ }
753
+ function St(e, t, n, r = {}) {
754
+ const { filter: s, paused: i = !1, delay: a = Pt } = r, l = E(n), u = E(s), c = E(i), p = E(!1), d = E(void 0);
755
+ B(() => {
756
+ l.current = n, u.current = s;
757
+ });
758
+ const S = typeof t == "string" ? t : t.join(`
759
+ `);
760
+ B(() => {
761
+ const k = (v) => {
762
+ u.current && !u.current(v) || (c.current ? p.current = !0 : De(d, () => l.current(), a));
763
+ }, g = S.split(`
764
+ `).map((v) => e(v, k));
765
+ return () => {
766
+ clearTimeout(d.current), g.forEach((v) => v());
767
+ };
768
+ }, [S, a, e]), B(() => {
769
+ c.current = i, i ? d.current !== void 0 && (clearTimeout(d.current), d.current = void 0, p.current = !0) : p.current && (p.current = !1, De(d, () => l.current(), a));
770
+ }, [i, a]);
771
+ }
772
+ function rt(e) {
773
+ if (!e || typeof e != "object") return null;
774
+ const t = e;
775
+ for (const n of ["error", "message", "detail", "title"]) {
776
+ const r = t[n];
777
+ if (typeof r == "string" && r.trim()) return r;
778
+ if (r && typeof r == "object") {
779
+ const s = rt(r);
780
+ if (s) return s;
781
+ }
782
+ }
783
+ return null;
784
+ }
785
+ const Ct = {
786
+ 400: "Bad Request",
787
+ 401: "Unauthorized",
788
+ 403: "Forbidden",
789
+ 404: "Not Found",
790
+ 405: "Method Not Allowed",
791
+ 408: "Request Timeout",
792
+ 409: "Conflict",
793
+ 413: "Payload Too Large",
794
+ 429: "Too Many Requests",
795
+ 500: "Internal Server Error",
796
+ 501: "Not Implemented",
797
+ 502: "Bad Gateway",
798
+ 503: "Service Unavailable",
799
+ 504: "Gateway Timeout"
800
+ };
801
+ function Ce(e, t = "") {
802
+ const n = t.trim() || Ct[e] || "";
803
+ return `HTTP ${e}${n ? ` ${n}` : ""}`;
804
+ }
805
+ function kt(e) {
806
+ return /^\s*<(!doctype|html|head|body|\?xml|[a-z][\w-]*[\s>/])/i.test(e);
807
+ }
808
+ const Re = { amp: "&", lt: "<", gt: ">", quot: '"', apos: "'", nbsp: " ", "#39": "'" };
809
+ function Mt(e) {
810
+ return e.replace(/<[^>]*>/g, " ").replace(/&(#\d+|#x[\da-f]+|[a-z]+);/gi, (t, n) => Re[n.toLowerCase()] !== void 0 ? Re[n.toLowerCase()] : n.startsWith("#x") || n.startsWith("#X") ? String.fromCodePoint(parseInt(n.slice(2), 16)) : n.startsWith("#") ? String.fromCodePoint(Number(n.slice(1))) : t).replace(/\s+/g, " ").trim();
811
+ }
812
+ function At(e) {
813
+ for (const t of ["pre", "h1", "title"]) {
814
+ const n = new RegExp(`<${t}\\b[^>]*>([\\s\\S]*?)</${t}>`, "i").exec(e), r = n ? Mt(n[1]) : "";
815
+ if (r && !(t === "title" && /^error$/i.test(r))) return r;
816
+ }
817
+ return null;
818
+ }
819
+ function Me(e) {
820
+ const t = e instanceof Error ? e.message || String(e) : typeof e == "string" ? e : String(e), n = t.trim();
821
+ if (n.startsWith("{"))
822
+ try {
823
+ const r = rt(JSON.parse(n));
824
+ if (r) return r;
825
+ } catch {
826
+ }
827
+ if (kt(n)) {
828
+ const r = At(n);
829
+ if (r) return r;
830
+ const s = e, i = s && typeof s == "object" && typeof s.status == "number" ? s.status : 0;
831
+ return i ? Ce(i, typeof s.statusText == "string" ? s.statusText : "") : "HTTP error";
832
+ }
833
+ return t;
834
+ }
835
+ function Lt(e, t, n) {
836
+ const r = n.trim();
837
+ if (!r) return Ce(e, t);
838
+ const s = Me(Object.assign(new Error(r), { status: e, statusText: t }));
839
+ return s === r && r.startsWith("{") ? Ce(e, t) : s;
840
+ }
841
+ const Et = /(?:missing permissions?|permission denied:)\s*([\w.*-]+:[\w.*-]+(?:\s*,\s*[\w.*-]+:[\w.*-]+)*)/i;
842
+ function Tt(e) {
843
+ if (e == null || e === "") return null;
844
+ const t = e, n = typeof t == "object" && t !== null && typeof t.status == "number" ? t.status : 0, r = Me(e).trim(), s = Et.exec(r);
845
+ return n === 403 || s || /^(forbidden\b|HTTP 403\b)/i.test(r) ? { permission: s ? s[1].replace(/\s*,\s*/g, ", ") : null } : null;
846
+ }
847
+ function Ot(e, t) {
848
+ if (e !== 404) return !1;
849
+ const n = t.trim();
850
+ if (!n.startsWith("{")) return !0;
851
+ try {
852
+ const r = JSON.parse(n);
853
+ return typeof (r == null ? void 0 : r.error) != "string";
854
+ } catch {
855
+ return !0;
856
+ }
857
+ }
858
+ function Fe(e) {
859
+ const t = e.split(/[?#]/)[0], n = t.indexOf("/api/");
860
+ return (n === -1 ? t : t.slice(n)).replace(/\/+$/, "");
861
+ }
862
+ function $t(e, t, n) {
863
+ const r = Fe(t);
864
+ return async (s, i) => {
865
+ const a = await e(s, i);
866
+ if (a.status === 404 && Fe(s) === r) {
867
+ const l = await a.clone().text().catch(() => "");
868
+ Ot(a.status, l) && n();
869
+ }
870
+ return a;
871
+ };
872
+ }
873
+ function It(e, t = typeof window > "u" ? "" : window.location.pathname) {
874
+ const n = t.indexOf("/x/");
875
+ return `${n === -1 ? "" : t.slice(0, n)}/plugins?${new URLSearchParams({ tab: "marketplace", kind: "server", q: e })}`;
876
+ }
877
+ const Dt = [
878
+ ["node", "Node", (e) => `npm install ${e}`],
879
+ ["python", "Python", (e) => `pip install ${e}`],
880
+ ["dotnet", ".NET", (e) => `dotnet add package ${e}`]
881
+ ];
882
+ function Rt({ requirement: e }) {
883
+ const { t } = j(), n = Dt.filter(([r]) => e.packages[r]);
884
+ return /* @__PURE__ */ o("div", { className: "p-4 sm:p-6", children: /* @__PURE__ */ m("div", { role: "alert", "data-testid": "missing-server-plugin", className: "rounded-xl border border-warning/40 bg-warning/[0.06] p-4 sm:p-5 space-y-3 max-w-3xl", children: [
885
+ /* @__PURE__ */ m("div", { children: [
886
+ /* @__PURE__ */ o("h2", { className: "text-sm font-semibold text-heading", children: t("serverPluginMissing", { title: e.title }) }),
887
+ /* @__PURE__ */ o("p", { className: "text-xs text-muted mt-1", children: t("serverPluginMissingHint", { title: e.title }) })
888
+ ] }),
889
+ !e.codeOnly && /* @__PURE__ */ o(
890
+ "a",
891
+ {
892
+ href: It(e.id),
893
+ className: "inline-flex items-center px-3 py-1.5 text-xs rounded-lg bg-primary text-on-primary hover:bg-primary/90 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/60",
894
+ children: t("serverPluginOpen")
895
+ }
896
+ ),
897
+ n.length > 0 && /* @__PURE__ */ m("div", { className: "space-y-1", children: [
898
+ /* @__PURE__ */ o("p", { className: "text-xs text-subtle", children: t("serverPluginFromCode") }),
899
+ /* @__PURE__ */ o("ul", { className: "space-y-0.5", children: n.map(([r, s, i]) => /* @__PURE__ */ m("li", { className: "text-[11px] font-mono text-text break-all", children: [
900
+ /* @__PURE__ */ m("span", { className: "text-subtle", children: [
901
+ s,
902
+ ": "
903
+ ] }),
904
+ i(e.packages[r])
905
+ ] }, r)) })
906
+ ] })
907
+ ] }) });
908
+ }
909
+ function Ft({ requirement: e, fetcher: t, provide: n }) {
910
+ const [r, s] = T(!1), i = ee(() => $t(t, e.api, () => s(!0)), [t, e.api]);
911
+ return r ? /* @__PURE__ */ o(Rt, { requirement: e }) : /* @__PURE__ */ o(W, { children: n(i) });
912
+ }
913
+ const ye = Ze(null);
914
+ function Be(e) {
915
+ return (t, n) => {
916
+ var u;
917
+ const r = Xe(t);
918
+ let s = { ...n };
919
+ const i = () => r.render(
920
+ /* @__PURE__ */ o(ye.Provider, { value: s, children: /* @__PURE__ */ o(Je, { locale: s.language, children: /* @__PURE__ */ o(e, {}) }) })
921
+ ), a = (c) => {
922
+ s = { ...s, ...c }, i();
923
+ }, l = [
924
+ n.onThemeChange((c) => a({ theme: c })),
925
+ n.onLanguageChange((c) => a({ language: c })),
926
+ n.onPathChange((c) => a({ path: c })),
927
+ // Older Consoles have no settings
928
+ ((u = n.onConfigChange) == null ? void 0 : u.call(n, (c) => a({ config: c }))) ?? (() => {
929
+ })
930
+ ];
931
+ return i(), () => {
932
+ l.forEach((c) => c()), r.unmount();
933
+ };
934
+ };
935
+ }
936
+ function Bt(e) {
937
+ return (t, n, r) => {
938
+ const s = Xe(t), i = (a) => s.render(
939
+ /* @__PURE__ */ o(ye.Provider, { value: r, children: /* @__PURE__ */ o(Je, { locale: r.language, children: /* @__PURE__ */ o(e, { ...a }) }) })
940
+ );
941
+ return i(n), { update: i, unmount: () => s.unmount() };
942
+ };
943
+ }
944
+ function Fn(e, t = {}) {
945
+ wt(yt);
946
+ const n = t.overview, r = t.serverPlugin;
947
+ return {
948
+ mount: Be(r ? function() {
949
+ const a = Z();
950
+ return /* @__PURE__ */ o(
951
+ Ft,
952
+ {
953
+ requirement: r,
954
+ fetcher: a.fetch,
955
+ provide: (l) => /* @__PURE__ */ o(ye.Provider, { value: { ...a, fetch: l }, children: /* @__PURE__ */ o(e, {}) })
956
+ }
957
+ );
958
+ } : e),
959
+ ...n ? {
960
+ overview: {
961
+ cards: (n.cards ?? []).map((i) => ({ id: i.id, size: i.size, mount: Be(i.component) })),
962
+ ...n.attention ? { attention: n.attention } : {}
963
+ }
964
+ } : {},
965
+ ...t.palette ? { palette: t.palette } : {},
966
+ ...t.configEditors ? { configEditors: Object.fromEntries(Object.entries(t.configEditors).map(([i, a]) => [i, Bt(a)])) } : {}
967
+ };
968
+ }
969
+ function Z() {
970
+ const e = Ve(ye);
971
+ if (!e) throw new Error("useConsole() is only available inside defineExtension");
972
+ return e;
973
+ }
974
+ const Bn = Z;
975
+ function Hn() {
976
+ return Z().config;
977
+ }
978
+ class Ht extends Error {
979
+ constructor(t, n, r) {
980
+ super(n), this.status = t, this.error = n, this.body = r, this.name = "ApiError";
981
+ }
982
+ }
983
+ function qt(e) {
984
+ const t = async (n, r, s, i = {}) => {
985
+ const a = await e(r, {
986
+ method: n,
987
+ ...i.quiet ? { quiet: !0 } : {},
988
+ ...s === void 0 ? {} : { body: JSON.stringify(s), headers: { "Content-Type": "application/json" } }
989
+ }), l = await a.text();
990
+ let u;
991
+ if (l)
992
+ try {
993
+ u = JSON.parse(l);
994
+ } catch {
995
+ u = l;
996
+ }
997
+ if (!a.ok)
998
+ throw new Ht(a.status, Lt(a.status, a.statusText, l), u);
999
+ return u;
1000
+ };
1001
+ return {
1002
+ get: (n, r) => t("GET", n, void 0, r),
1003
+ post: (n, r) => t("POST", n, r),
1004
+ put: (n, r) => t("PUT", n, r),
1005
+ patch: (n, r) => t("PATCH", n, r),
1006
+ del: (n) => t("DELETE", n)
1007
+ };
1008
+ }
1009
+ function qn() {
1010
+ const { fetch: e } = Z();
1011
+ return ee(() => qt(e), [e]);
1012
+ }
1013
+ function zn(e, t, n = {}) {
1014
+ const { onServerEvent: r } = Z();
1015
+ St(r, e, t, n);
1016
+ }
1017
+ function Wn(e, t, n = 500) {
1018
+ const { onServerEvent: r } = Z(), s = E(t);
1019
+ B(() => {
1020
+ s.current = t;
1021
+ });
1022
+ const i = typeof e == "string" ? e : e.join(`
1023
+ `);
1024
+ B(() => {
1025
+ let a;
1026
+ const l = () => {
1027
+ clearTimeout(a), a = setTimeout(() => s.current(), n);
1028
+ }, u = i.split(`
1029
+ `).map((c) => r(c, l));
1030
+ return () => {
1031
+ clearTimeout(a), u.forEach((c) => c());
1032
+ };
1033
+ }, [r, i, n]);
1034
+ }
1035
+ function _n() {
1036
+ const { path: e, navigate: t } = Z(), n = e.includes("?") ? e.slice(e.indexOf("?") + 1).split("#")[0] : "", r = ee(() => new URLSearchParams(n), [n]), s = e.split(/[?#]/)[0] || "/";
1037
+ return [r, (a) => {
1038
+ const l = a(new URLSearchParams(n)).toString();
1039
+ t(l ? `${s}?${l}` : s, { replace: !0 });
1040
+ }];
1041
+ }
1042
+ function zt(e) {
1043
+ const { extension: t } = Z(), n = `/x/${t.id}`, r = typeof window > "u" ? "" : window.location.pathname, s = r.indexOf(n);
1044
+ return `${s === -1 ? n : r.slice(0, s + n.length)}${e === "/" ? "" : e}`;
1045
+ }
1046
+ function jn({ to: e, onClick: t, ...n }) {
1047
+ const { navigate: r } = Z(), s = zt(e);
1048
+ return /* @__PURE__ */ o("a", { href: s, onClick: (a) => {
1049
+ t == null || t(a), !(a.defaultPrevented || a.button !== 0 || a.metaKey || a.ctrlKey || a.shiftKey || a.altKey) && (a.preventDefault(), r(e));
1050
+ }, ...n });
1051
+ }
1052
+ function Gn(e, t = (n, r) => new Intl.NumberFormat(void 0, r).format(n)) {
1053
+ const n = ["B", "KB", "MB", "GB", "TB"];
1054
+ let r = e, s = 0;
1055
+ for (; r >= 1024 && s < n.length - 1; )
1056
+ r /= 1024, s++;
1057
+ return `${t(r, { maximumFractionDigits: s === 0 || r >= 10 ? 0 : 1 })} ${n[s]}`;
1058
+ }
1059
+ function Kn(e) {
1060
+ if (typeof e != "number" || !Number.isFinite(e) || e < 0) return "—";
1061
+ if (e < 1e3) return `${Math.round(e)}ms`;
1062
+ if (e < 6e4) return `${(e / 1e3).toFixed(e < 1e4 ? 1 : 0)}s`;
1063
+ const t = Math.round(e / 1e3), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), s = t % 60;
1064
+ return n > 0 ? `${n}h ${r}m` : `${r}m ${s}s`;
1065
+ }
1066
+ const U = (e, t, n, r, s, i) => ({
1067
+ name: e,
1068
+ dark: { fg: t, bg: `rgba(${i}, 0.16)`, border: `rgba(${i}, 0.5)`, solid: t, onSolid: "#111827" },
1069
+ light: { fg: r, bg: s, border: t, solid: n, onSolid: "#ffffff" }
1070
+ }), ot = [
1071
+ U("red", "#fca5a5", "#b91c1c", "#991b1b", "#fee2e2", "248, 113, 113"),
1072
+ U("orange", "#fdba74", "#c2410c", "#9a3412", "#ffedd5", "251, 146, 60"),
1073
+ U("amber", "#fcd34d", "#b45309", "#92400e", "#fef3c7", "251, 191, 36"),
1074
+ U("lime", "#bef264", "#4d7c0f", "#3f6212", "#ecfccb", "163, 230, 53"),
1075
+ U("emerald", "#6ee7b7", "#047857", "#065f46", "#d1fae5", "52, 211, 153"),
1076
+ U("cyan", "#67e8f9", "#0e7490", "#155e75", "#cffafe", "34, 211, 238"),
1077
+ U("sky", "#7dd3fc", "#0369a1", "#075985", "#e0f2fe", "56, 189, 248"),
1078
+ U("indigo", "#a5b4fc", "#4338ca", "#3730a3", "#e0e7ff", "129, 140, 248"),
1079
+ U("violet", "#c4b5fd", "#6d28d9", "#5b21b6", "#ede9fe", "167, 139, 250"),
1080
+ U("pink", "#f9a8d4", "#be185d", "#9d174d", "#fce7f3", "244, 114, 182")
1081
+ ];
1082
+ function Wt(e) {
1083
+ let t = 2166136261;
1084
+ for (const n of e.trim().toLowerCase())
1085
+ t ^= n.codePointAt(0), t = Math.imul(t, 16777619);
1086
+ return (t >>> 0) % ot.length;
1087
+ }
1088
+ const J = (e, t) => `--qcli-tag-${e}-${t.replace(/[A-Z]/g, (n) => `-${n.toLowerCase()}`)}`;
1089
+ function Un(e) {
1090
+ return ot.flatMap(
1091
+ (t, n) => Object.keys(t[e]).map((r) => ` ${J(n, r)}: ${t[e][r]};`)
1092
+ ).join(`
1093
+ `);
1094
+ }
1095
+ function Vn(e, t = !1) {
1096
+ const n = Wt(e);
1097
+ return t ? {
1098
+ color: `var(${J(n, "onSolid")})`,
1099
+ backgroundColor: `var(${J(n, "solid")})`,
1100
+ borderColor: `var(${J(n, "solid")})`,
1101
+ boxShadow: `0 0 0 2px var(--qcli-background), 0 0 0 4px var(${J(n, "solid")})`
1102
+ } : {
1103
+ color: `var(${J(n, "fg")})`,
1104
+ backgroundColor: `var(${J(n, "bg")})`,
1105
+ borderColor: `var(${J(n, "border")})`
1106
+ };
1107
+ }
1108
+ const _t = [
1109
+ ["year", 31536e3],
1110
+ ["month", 2592e3],
1111
+ ["week", 604800],
1112
+ ["day", 86400],
1113
+ ["hour", 3600],
1114
+ ["minute", 60]
1115
+ ];
1116
+ function Zn(e) {
1117
+ const t = Ye();
1118
+ return ee(() => jt(e, t), [e, t]);
1119
+ }
1120
+ function jt(e, t) {
1121
+ const n = new Intl.PluralRules(t), r = new Intl.NumberFormat(t), s = new Intl.RelativeTimeFormat(t, { numeric: "auto" }), i = (l, u) => {
1122
+ var p, d;
1123
+ const c = e[l];
1124
+ return ((p = c == null ? void 0 : c[t]) == null ? void 0 : p[u]) ?? ((d = c == null ? void 0 : c.en) == null ? void 0 : d[u]);
1125
+ };
1126
+ return {
1127
+ locale: t,
1128
+ t: (l, u) => {
1129
+ const c = l.indexOf("."), p = l.slice(0, c), d = l.slice(c + 1);
1130
+ if (u && "count" in u && typeof u.count != "number") {
1131
+ const k = Number(u.count);
1132
+ u = { ...u, count: Number.isFinite(k) ? k : 0 };
1133
+ }
1134
+ let S;
1135
+ return u && typeof u.count == "number" && (S = i(p, `${d}_${n.select(u.count)}`) ?? i(p, `${d}_other`)), S ?? (S = i(p, d) ?? i(p, `${d}_other`) ?? l), u ? S.replace(
1136
+ /\{(\w+)\}/g,
1137
+ (k, g) => u[g] != null ? typeof u[g] == "number" ? r.format(u[g]) : String(u[g]) : k
1138
+ ) : S;
1139
+ },
1140
+ formatDate: (l, u) => {
1141
+ const c = new Date(l);
1142
+ return Number.isNaN(c.getTime()) ? "—" : c.toLocaleString(t, u);
1143
+ },
1144
+ formatNumber: (l, u) => new Intl.NumberFormat(t, u).format(l),
1145
+ formatRelative: (l) => {
1146
+ const u = new Date(l).getTime();
1147
+ if (Number.isNaN(u)) return "—";
1148
+ const c = Math.round((u - Date.now()) / 1e3);
1149
+ for (const [p, d] of _t)
1150
+ if (Math.abs(c) >= d) return s.format(Math.round(c / d), p);
1151
+ return s.format(c, "second");
1152
+ }
1153
+ };
1154
+ }
1155
+ const Gt = {
1156
+ success: "bg-success/15 text-success border-success/30",
1157
+ warning: "bg-warning/15 text-warning border-warning/30",
1158
+ error: "bg-error/15 text-error border-error/30",
1159
+ info: "bg-info/15 text-info border-info/30",
1160
+ neutral: "bg-subtle/15 text-muted border-subtle/30"
1161
+ };
1162
+ function Xn({ variant: e, children: t, dot: n }) {
1163
+ return /* @__PURE__ */ m("span", { className: `inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[11px] font-medium border ${Gt[e]}`, children: [
1164
+ n && /* @__PURE__ */ o("span", { className: "w-1.5 h-1.5 rounded-full bg-current" }),
1165
+ t
1166
+ ] });
1167
+ }
1168
+ const He = "separator";
1169
+ function Kt({ items: e, children: t, label: n, align: r = "start", buttonClassName: s = "", header: i }) {
1170
+ const a = de(), [l, u] = T(!1), [c, p] = T(-1), [d, S] = T(null), k = E(null), g = E([]), v = nt(), N = e.filter((w) => w !== He), C = N.map((w) => !!w.disabled), b = et(l, d, k, r), y = (w = !0) => {
1171
+ u(!1), w && (d == null || d.focus());
1172
+ };
1173
+ tt(l, () => [d, k.current], () => y(!1), () => y(!1));
1174
+ function M(w) {
1175
+ p(w), u(!0);
1176
+ }
1177
+ B(() => {
1178
+ var w, f;
1179
+ l && (c >= 0 ? (w = g.current[c]) == null || w.focus() : (f = k.current) == null || f.focus());
1180
+ }, [l, c]);
1181
+ function L(w) {
1182
+ w.disabled || (y(), w.onSelect());
1183
+ }
1184
+ function P(w) {
1185
+ w.key === "ArrowDown" || w.key === "Enter" || w.key === " " ? (w.preventDefault(), M(Y(C))) : w.key === "ArrowUp" && (w.preventDefault(), M(ae(C)));
1186
+ }
1187
+ function x(w) {
1188
+ switch (w.key) {
1189
+ case "ArrowDown":
1190
+ w.preventDefault(), p((f) => {
1191
+ const A = ue(C, f, 1);
1192
+ return A === f ? Y(C) : A;
1193
+ });
1194
+ break;
1195
+ case "ArrowUp":
1196
+ w.preventDefault(), p((f) => {
1197
+ const A = ue(C, f, -1);
1198
+ return A === f ? ae(C) : A;
1199
+ });
1200
+ break;
1201
+ case "Home":
1202
+ w.preventDefault(), p(Y(C));
1203
+ break;
1204
+ case "End":
1205
+ w.preventDefault(), p(ae(C));
1206
+ break;
1207
+ case "Escape":
1208
+ w.preventDefault(), w.stopPropagation(), y();
1209
+ break;
1210
+ case "Tab":
1211
+ w.preventDefault(), y();
1212
+ break;
1213
+ default:
1214
+ Se(w) && p((f) => v(w.key, N.map((A) => A.label), C, f));
1215
+ }
1216
+ }
1217
+ let D = -1;
1218
+ return /* @__PURE__ */ m(W, { children: [
1219
+ /* @__PURE__ */ o(
1220
+ "button",
1221
+ {
1222
+ ref: S,
1223
+ type: "button",
1224
+ "aria-label": n,
1225
+ "aria-haspopup": "menu",
1226
+ "aria-expanded": l,
1227
+ "aria-controls": l ? a : void 0,
1228
+ onClick: () => l ? y() : M(-1),
1229
+ onKeyDown: P,
1230
+ className: s,
1231
+ children: t
1232
+ }
1233
+ ),
1234
+ l && xe(
1235
+ /* @__PURE__ */ m(
1236
+ "div",
1237
+ {
1238
+ ref: k,
1239
+ id: a,
1240
+ role: "menu",
1241
+ "aria-label": n,
1242
+ "data-placement": b == null ? void 0 : b.placement,
1243
+ onKeyDown: x,
1244
+ tabIndex: -1,
1245
+ style: b ? { left: b.left, top: b.top, maxHeight: b.maxHeight } : { left: 0, top: 0, visibility: "hidden" },
1246
+ className: "fixed z-[60] min-w-[11rem] max-w-[min(20rem,calc(100vw-1rem))] overflow-y-auto p-1 rounded-lg border border-border bg-popover shadow-xl focus:outline-none motion-safe:animate-pop-in",
1247
+ children: [
1248
+ i && /* @__PURE__ */ o("div", { className: "px-2.5 py-2 mb-1 border-b border-border/75 text-xs text-muted", children: i }),
1249
+ e.map((w, f) => {
1250
+ if (w === He) return /* @__PURE__ */ o("div", { role: "separator", className: "my-1 h-px bg-border/75" }, `sep-${f}`);
1251
+ const A = ++D;
1252
+ return /* @__PURE__ */ m(
1253
+ "button",
1254
+ {
1255
+ ref: (R) => {
1256
+ g.current[A] = R;
1257
+ },
1258
+ type: "button",
1259
+ role: "menuitem",
1260
+ tabIndex: A === c ? 0 : -1,
1261
+ "aria-disabled": w.disabled || void 0,
1262
+ onClick: () => L(w),
1263
+ onMouseMove: () => {
1264
+ !w.disabled && c !== A && p(A);
1265
+ },
1266
+ className: `w-full flex items-center gap-2 min-h-11 sm:min-h-8 px-2.5 py-1 rounded-md text-sm sm:text-xs text-left focus:outline-none focus:bg-control-hover ${w.disabled ? "opacity-40 cursor-not-allowed" : "hover:bg-control-hover"} ${w.tone === "danger" ? "text-error" : "text-text"}`,
1267
+ children: [
1268
+ w.icon && /* @__PURE__ */ o("span", { "aria-hidden": !0, className: "inline-flex w-4 justify-center shrink-0", children: w.icon }),
1269
+ /* @__PURE__ */ o("span", { className: "truncate", children: w.label })
1270
+ ]
1271
+ },
1272
+ w.key
1273
+ );
1274
+ })
1275
+ ]
1276
+ }
1277
+ ),
1278
+ ve()
1279
+ )
1280
+ ] });
1281
+ }
1282
+ function pe() {
1283
+ return j().t;
1284
+ }
1285
+ function at({ size: e = 14, label: t, className: n = "" }) {
1286
+ const r = /* @__PURE__ */ m("svg", { "aria-hidden": !0, width: e, height: e, viewBox: "0 0 24 24", className: `animate-spin motion-reduce:animate-none ${n}`, children: [
1287
+ /* @__PURE__ */ o("circle", { cx: "12", cy: "12", r: "9", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeOpacity: "0.3" }),
1288
+ /* @__PURE__ */ o("path", { d: "M21 12a9 9 0 0 0-9-9", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round" })
1289
+ ] });
1290
+ return t ? /* @__PURE__ */ m("span", { role: "status", "aria-live": "polite", className: "inline-flex items-center", children: [
1291
+ r,
1292
+ /* @__PURE__ */ o("span", { className: "sr-only", children: t })
1293
+ ] }) : r;
1294
+ }
1295
+ const qe = {
1296
+ default: "text-text hover:bg-control-hover",
1297
+ primary: "text-accent hover:bg-primary/15",
1298
+ success: "text-success hover:bg-success/15",
1299
+ warning: "text-warning hover:bg-warning/15",
1300
+ danger: "text-error hover:bg-error/15"
1301
+ }, ze = "inline-flex items-center justify-center gap-1.5 min-h-11 min-w-11 sm:min-h-8 sm:min-w-8 px-2.5 text-xs font-medium whitespace-nowrap transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary disabled:opacity-50 disabled:cursor-not-allowed", Ut = {
1302
+ always: "",
1303
+ sm: "sr-only sm:not-sr-only",
1304
+ xl: "sr-only xl:not-sr-only",
1305
+ never: "sr-only"
1306
+ };
1307
+ function Qn({ items: e, label: t, labels: n = "always", overflow: r = [], className: s = "" }) {
1308
+ const i = pe();
1309
+ return e.length === 0 && r.length === 0 ? null : /* @__PURE__ */ m(
1310
+ "div",
1311
+ {
1312
+ role: "group",
1313
+ "aria-label": t,
1314
+ className: `inline-flex items-stretch rounded-lg border border-border/75 bg-control divide-x divide-border/75 overflow-hidden ${s}`,
1315
+ children: [
1316
+ e.map((a) => {
1317
+ const l = a.disabled || a.loading;
1318
+ return /* @__PURE__ */ m(
1319
+ "button",
1320
+ {
1321
+ type: "button",
1322
+ onClick: a.onClick,
1323
+ disabled: l,
1324
+ "aria-busy": a.loading || void 0,
1325
+ "aria-pressed": a.pressed,
1326
+ "aria-label": a.ariaLabel ?? (n === "always" ? void 0 : a.label),
1327
+ title: n === "always" ? void 0 : a.label,
1328
+ className: `${ze} ${qe[a.tone ?? "default"]} ${a.pressed ? "bg-primary/15" : ""}`,
1329
+ children: [
1330
+ a.loading ? /* @__PURE__ */ o(at, {}) : a.icon && /* @__PURE__ */ o("span", { "aria-hidden": !0, className: "inline-flex", children: a.icon }),
1331
+ /* @__PURE__ */ o("span", { className: Ut[n], children: a.label })
1332
+ ]
1333
+ },
1334
+ a.key
1335
+ );
1336
+ }),
1337
+ r.length > 0 && /* @__PURE__ */ o(Kt, { items: r, label: i("moreActions"), align: "end", buttonClassName: `${ze} ${qe.default}`, children: /* @__PURE__ */ m("svg", { "aria-hidden": !0, width: "14", height: "14", viewBox: "0 0 24 24", fill: "currentColor", children: [
1338
+ /* @__PURE__ */ o("circle", { cx: "5", cy: "12", r: "2" }),
1339
+ /* @__PURE__ */ o("circle", { cx: "12", cy: "12", r: "2" }),
1340
+ /* @__PURE__ */ o("circle", { cx: "19", cy: "12", r: "2" })
1341
+ ] }) })
1342
+ ]
1343
+ }
1344
+ );
1345
+ }
1346
+ const Vt = 'a[href], button:not([disabled]), select:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
1347
+ function We(e) {
1348
+ return e ? Array.from(e.querySelectorAll(Vt)) : [];
1349
+ }
1350
+ function Zt(e, t, n) {
1351
+ if (e.length === 0) return null;
1352
+ const r = t ? e.indexOf(t) : -1;
1353
+ return r === -1 ? n ? e[e.length - 1] : e[0] : n && r === 0 ? e[e.length - 1] : !n && r === e.length - 1 ? e[0] : null;
1354
+ }
1355
+ const Xt = 60;
1356
+ function Jn(e, t) {
1357
+ const n = t.x - e.x, r = t.y - e.y;
1358
+ return n <= -Xt && Math.abs(n) > Math.abs(r);
1359
+ }
1360
+ const Qt = {
1361
+ sm: "sm:max-w-sm",
1362
+ md: "sm:max-w-md",
1363
+ lg: "sm:max-w-3xl",
1364
+ full: "sm:max-w-6xl sm:h-[90vh]"
1365
+ }, le = [];
1366
+ function st({
1367
+ open: e,
1368
+ onClose: t,
1369
+ title: n,
1370
+ children: r,
1371
+ actions: s,
1372
+ size: i = "md",
1373
+ closeOnEscape: a = !0,
1374
+ closeOnBackdrop: l = !0,
1375
+ showClose: u = !0,
1376
+ initialFocus: c,
1377
+ description: p
1378
+ }) {
1379
+ const d = pe(), S = de(), k = de(), g = E(null), v = E(null), N = E(!1), C = E({ onClose: t, closeOnEscape: a });
1380
+ if (B(() => {
1381
+ C.current = { onClose: t, closeOnEscape: a };
1382
+ }), Nt(e), B(() => {
1383
+ var P;
1384
+ if (!e) return;
1385
+ const y = Symbol("modal");
1386
+ le.push(y);
1387
+ const M = document.activeElement instanceof HTMLElement ? document.activeElement : null;
1388
+ if (!((P = g.current) != null && P.contains(document.activeElement))) {
1389
+ const x = (c == null ? void 0 : c.current) ?? We(v.current)[0] ?? g.current;
1390
+ x == null || x.focus();
1391
+ }
1392
+ const L = (x) => {
1393
+ if (le[le.length - 1] === y) {
1394
+ if (x.key === "Escape") {
1395
+ if (x.defaultPrevented || !C.current.closeOnEscape) return;
1396
+ x.preventDefault(), C.current.onClose();
1397
+ } else if (x.key === "Tab") {
1398
+ const D = Zt(We(g.current), document.activeElement, x.shiftKey);
1399
+ D && (x.preventDefault(), D.focus());
1400
+ }
1401
+ }
1402
+ };
1403
+ return document.addEventListener("keydown", L), () => {
1404
+ document.removeEventListener("keydown", L), le.splice(le.indexOf(y), 1), M != null && M.isConnected && M.focus();
1405
+ };
1406
+ }, [e]), !e) return null;
1407
+ const b = i === "full";
1408
+ return xe(
1409
+ /* @__PURE__ */ o(
1410
+ "div",
1411
+ {
1412
+ className: "fixed inset-0 z-50 flex items-end sm:items-center justify-center sm:p-4 bg-overlay motion-safe:animate-fade-in",
1413
+ onMouseDown: (y) => {
1414
+ N.current = y.target === y.currentTarget;
1415
+ },
1416
+ onClick: (y) => {
1417
+ l && N.current && y.target === y.currentTarget && t(), N.current = !1;
1418
+ },
1419
+ children: /* @__PURE__ */ m(
1420
+ "div",
1421
+ {
1422
+ ref: g,
1423
+ role: "dialog",
1424
+ "aria-modal": "true",
1425
+ "aria-labelledby": S,
1426
+ "aria-describedby": p ? k : void 0,
1427
+ tabIndex: -1,
1428
+ className: `relative flex flex-col w-full bg-popover border-border shadow-2xl focus:outline-none sm:border sm:rounded-xl sm:max-h-[90vh] ${Qt[i]} ${b ? "h-[100dvh] sm:h-[90vh] pt-[env(safe-area-inset-top)] sm:pt-0" : "max-h-[92dvh] border-t rounded-t-2xl motion-safe:animate-sheet-in sm:motion-safe:animate-pop-in"} pb-[env(safe-area-inset-bottom)] sm:pb-0 pl-[env(safe-area-inset-left)] pr-[env(safe-area-inset-right)] sm:px-0`,
1429
+ children: [
1430
+ !b && /* @__PURE__ */ o("div", { "aria-hidden": !0, className: "sm:hidden mx-auto mt-2 h-1 w-10 rounded-full bg-border" }),
1431
+ /* @__PURE__ */ m("div", { className: "flex items-start gap-3 px-5 py-4 border-b border-border/75", children: [
1432
+ /* @__PURE__ */ m("div", { className: "flex-1 min-w-0", children: [
1433
+ /* @__PURE__ */ o("h3", { id: S, className: "text-base font-semibold text-heading break-words", children: n }),
1434
+ p && /* @__PURE__ */ o("p", { id: k, className: "mt-1 text-xs text-muted", children: p })
1435
+ ] }),
1436
+ u && /* @__PURE__ */ o(
1437
+ "button",
1438
+ {
1439
+ type: "button",
1440
+ onClick: t,
1441
+ "aria-label": d("dialogClose"),
1442
+ title: d("dialogClose"),
1443
+ className: "-mr-2 -my-1 w-11 h-11 sm:w-8 sm:h-8 shrink-0 inline-flex items-center justify-center rounded-lg text-muted hover:text-text hover:bg-control-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-primary",
1444
+ children: /* @__PURE__ */ o("svg", { "aria-hidden": !0, width: "12", height: "12", viewBox: "0 0 12 12", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", children: /* @__PURE__ */ o("path", { d: "M2 2l8 8M10 2l-8 8" }) })
1445
+ }
1446
+ )
1447
+ ] }),
1448
+ /* @__PURE__ */ o("div", { ref: v, className: "flex-1 min-h-0 overflow-y-auto overscroll-contain px-5 py-4 text-sm text-text", children: r }),
1449
+ s && /* @__PURE__ */ o("div", { className: "px-5 py-3 border-t border-border/75 flex flex-wrap justify-end gap-2 [&>button]:min-h-11 sm:[&>button]:min-h-0", children: s })
1450
+ ]
1451
+ }
1452
+ )
1453
+ }
1454
+ ),
1455
+ ve()
1456
+ );
1457
+ }
1458
+ const Jt = "font-mono text-[11px] bg-control px-1.5 py-0.5 rounded", Yt = "hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/60", en = (e) => typeof e == "string" ? { label: e } : e, _e = (e) => e.stopPropagation();
1459
+ function Yn({
1460
+ items: e,
1461
+ max: t = 3,
1462
+ title: n,
1463
+ label: r,
1464
+ chipClassName: s = Jt,
1465
+ className: i = "",
1466
+ empty: a,
1467
+ searchThreshold: l = 10,
1468
+ renderLink: u
1469
+ }) {
1470
+ const c = pe(), [p, d] = T(!1), [S, k] = T(""), g = e.map(en), v = Math.max(0, t);
1471
+ if (g.length === 0) return /* @__PURE__ */ o("span", { className: "text-xs text-subtle", children: a ?? "—" });
1472
+ const N = g.length - v, C = N > 0 ? g.slice(0, v) : g, b = S.trim().toLowerCase(), y = b ? g.filter((P) => {
1473
+ var x;
1474
+ return P.label.toLowerCase().includes(b) || (((x = P.title) == null ? void 0 : x.toLowerCase().includes(b)) ?? !1);
1475
+ }) : g, M = () => {
1476
+ d(!1), k("");
1477
+ }, L = (P, x) => {
1478
+ const D = P.className ?? s, w = P.render ?? P.label;
1479
+ if (P.href) {
1480
+ const f = (R) => {
1481
+ R.stopPropagation(), x && M();
1482
+ }, A = `${D} ${Yt}`;
1483
+ return u ? u({ href: P.href, className: A, title: P.title, style: P.style, children: w, onClick: f }) : /* @__PURE__ */ o("a", { href: P.href, className: A, title: P.title, style: P.style, onClick: f, children: w });
1484
+ }
1485
+ return /* @__PURE__ */ o("span", { className: D, title: P.title, style: P.style, children: w });
1486
+ };
1487
+ return /* @__PURE__ */ m("ul", { className: `flex flex-wrap items-center gap-1 ${i}`, "aria-label": r, children: [
1488
+ C.map((P, x) => /* @__PURE__ */ o("li", { className: "inline-flex max-w-full", children: L(P, !1) }, P.key ?? `${P.label}:${x}`)),
1489
+ N > 0 && /* @__PURE__ */ m("li", { className: "inline-flex", onClick: _e, onKeyDown: _e, children: [
1490
+ /* @__PURE__ */ o(
1491
+ "button",
1492
+ {
1493
+ type: "button",
1494
+ onClick: () => d(!0),
1495
+ "aria-haspopup": "dialog",
1496
+ title: c("chipListShowAll", { count: g.length }),
1497
+ className: "text-[11px] font-medium text-accent px-1.5 py-0.5 rounded border border-border/75 bg-surface hover:bg-control-hover whitespace-nowrap focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/60",
1498
+ children: c("chipListMore", { count: N })
1499
+ }
1500
+ ),
1501
+ /* @__PURE__ */ m(
1502
+ st,
1503
+ {
1504
+ open: p,
1505
+ onClose: M,
1506
+ title: n ?? c("chipListTitle", { count: g.length }),
1507
+ actions: /* @__PURE__ */ o("button", { type: "button", onClick: M, className: "px-3 py-1.5 text-xs bg-control hover:bg-control-hover text-text rounded-lg", children: c("dialogClose") }),
1508
+ children: [
1509
+ g.length > l && /* @__PURE__ */ m("div", { className: "mb-3 space-y-1", children: [
1510
+ /* @__PURE__ */ o(
1511
+ "input",
1512
+ {
1513
+ type: "search",
1514
+ value: S,
1515
+ onChange: (P) => k(P.target.value),
1516
+ placeholder: c("selectSearch"),
1517
+ "aria-label": c("chipListSearch"),
1518
+ className: "w-full px-3 py-2 text-sm bg-control border border-border rounded-lg text-text placeholder:text-subtle focus:outline-none focus:border-primary/50"
1519
+ }
1520
+ ),
1521
+ b && /* @__PURE__ */ o("p", { role: "status", className: "text-xs text-subtle", children: c("chipListMatches", { shown: y.length, total: g.length }) })
1522
+ ] }),
1523
+ y.length > 0 ? /* @__PURE__ */ o("ul", { className: "flex flex-wrap gap-1.5", "aria-label": typeof n == "string" ? n : r, children: y.map((P, x) => /* @__PURE__ */ o("li", { className: "inline-flex max-w-full break-all", children: L(P, !0) }, P.key ?? `${P.label}:${x}`)) }) : /* @__PURE__ */ o("p", { className: "text-xs text-subtle", children: c("selectNoMatches") })
1524
+ ]
1525
+ }
1526
+ )
1527
+ ] })
1528
+ ] });
1529
+ }
1530
+ const je = "px-3 py-1.5 text-sm sm:text-xs rounded-lg transition-colors disabled:opacity-50 inline-flex items-center justify-center gap-1.5";
1531
+ function tn({
1532
+ open: e,
1533
+ title: t,
1534
+ message: n,
1535
+ confirmLabel: r,
1536
+ cancelLabel: s,
1537
+ busyLabel: i,
1538
+ tone: a = "default",
1539
+ onConfirm: l,
1540
+ onCancel: u,
1541
+ error: c,
1542
+ busy: p = !1,
1543
+ size: d = "sm"
1544
+ }) {
1545
+ const S = pe(), [k, g] = T(!1), [v, N] = T(null), C = E(null), b = E(null), y = k || p;
1546
+ async function M() {
1547
+ N(null), g(!0);
1548
+ try {
1549
+ await l();
1550
+ } catch (P) {
1551
+ N(P instanceof Error ? P.message : String(P));
1552
+ } finally {
1553
+ g(!1);
1554
+ }
1555
+ }
1556
+ const L = () => {
1557
+ y || (N(null), u());
1558
+ };
1559
+ return /* @__PURE__ */ o(
1560
+ st,
1561
+ {
1562
+ open: e,
1563
+ onClose: L,
1564
+ title: t,
1565
+ size: d,
1566
+ closeOnEscape: !y,
1567
+ closeOnBackdrop: !y,
1568
+ showClose: !1,
1569
+ initialFocus: a === "danger" ? C : b,
1570
+ actions: /* @__PURE__ */ m(W, { children: [
1571
+ /* @__PURE__ */ o("button", { ref: C, type: "button", onClick: L, disabled: y, className: `${je} bg-control hover:bg-control-hover text-text`, children: s ?? S("confirmCancel") }),
1572
+ /* @__PURE__ */ m(
1573
+ "button",
1574
+ {
1575
+ ref: b,
1576
+ type: "button",
1577
+ onClick: () => void M(),
1578
+ disabled: y,
1579
+ "aria-busy": y || void 0,
1580
+ className: `${je} ${a === "danger" ? "bg-error/20 hover:bg-error/30 text-error" : "bg-primary hover:bg-primary-hover text-on-primary"}`,
1581
+ children: [
1582
+ y && /* @__PURE__ */ o(at, { size: 12 }),
1583
+ y ? i ?? S("confirmBusy") : r ?? S("confirmOk")
1584
+ ]
1585
+ }
1586
+ )
1587
+ ] }),
1588
+ children: /* @__PURE__ */ m("div", { className: "space-y-2", children: [
1589
+ /* @__PURE__ */ o("div", { children: n }),
1590
+ (v || c) && /* @__PURE__ */ o("p", { role: "alert", className: "text-error text-xs", children: v ?? c })
1591
+ ] })
1592
+ }
1593
+ );
1594
+ }
1595
+ function er() {
1596
+ const [e, t] = T(null), n = V(
1597
+ (s) => new Promise((i) => t({ ...s, resolve: i })),
1598
+ []
1599
+ ), r = /* @__PURE__ */ o(
1600
+ tn,
1601
+ {
1602
+ open: e !== null,
1603
+ title: (e == null ? void 0 : e.title) ?? "",
1604
+ message: e == null ? void 0 : e.message,
1605
+ confirmLabel: e == null ? void 0 : e.confirmLabel,
1606
+ cancelLabel: e == null ? void 0 : e.cancelLabel,
1607
+ tone: e == null ? void 0 : e.tone,
1608
+ onCancel: () => {
1609
+ e == null || e.resolve(!1), t(null);
1610
+ },
1611
+ onConfirm: async () => {
1612
+ var s;
1613
+ e && (await ((s = e.onConfirm) == null ? void 0 : s.call(e)), e.resolve(!0), t(null));
1614
+ }
1615
+ }
1616
+ );
1617
+ return { confirm: n, dialog: r };
1618
+ }
1619
+ function nn(e = [], t = []) {
1620
+ return e.length !== t.length || e.some((n, r) => !Object.is(n, t[r]));
1621
+ }
1622
+ class Ae extends gt {
1623
+ constructor() {
1624
+ super(...arguments);
1625
+ Ne(this, "state", { error: null });
1626
+ Ne(this, "retry", () => this.setState({ error: null }));
1627
+ }
1628
+ static getDerivedStateFromError(n) {
1629
+ return { error: n };
1630
+ }
1631
+ componentDidCatch(n, r) {
1632
+ console.error(`[console] ${this.props.label ?? "section"} failed to render`, n, r.componentStack);
1633
+ }
1634
+ componentDidUpdate(n, r) {
1635
+ this.state.error && r.error && nn(n.resetKeys, this.props.resetKeys) && this.setState({ error: null });
1636
+ }
1637
+ render() {
1638
+ const { error: n } = this.state;
1639
+ return n ? /* @__PURE__ */ o(rn, { error: n, label: this.props.label, page: this.props.variant === "page", onRetry: this.retry }) : this.props.children;
1640
+ }
1641
+ }
1642
+ function rn({ error: e, label: t, page: n, onRetry: r }) {
1643
+ const { t: s } = j(), i = {
1644
+ page: s("pageFailed"),
1645
+ section: s("sectionFailed", { label: t ?? s("thisSection") }),
1646
+ retry: s("retry")
1647
+ };
1648
+ return /* @__PURE__ */ m(
1649
+ "div",
1650
+ {
1651
+ role: "alert",
1652
+ className: n ? "m-6 p-6 rounded-xl border border-error/30 bg-error/[0.06]" : "p-4 rounded-lg border border-error/30 bg-error/[0.06]",
1653
+ children: [
1654
+ /* @__PURE__ */ o("div", { className: "text-sm font-medium text-error", children: n ? i.page : i.section }),
1655
+ /* @__PURE__ */ o("div", { className: "mt-1 text-xs text-error/70 font-mono break-all", children: e.message || String(e) }),
1656
+ /* @__PURE__ */ o(
1657
+ "button",
1658
+ {
1659
+ onClick: r,
1660
+ className: "mt-3 text-xs px-3 py-1 rounded-md border border-border text-text hover:bg-control",
1661
+ children: i.retry
1662
+ }
1663
+ )
1664
+ ]
1665
+ }
1666
+ );
1667
+ }
1668
+ function on(e, t, n) {
1669
+ const r = n === "asc" ? 1 : -1, s = new Intl.Collator(void 0, { numeric: !0, sensitivity: "base" });
1670
+ return e.map((i, a) => ({ row: i, index: a, value: t(i) })).sort((i, a) => {
1671
+ const l = i.value === null || i.value === void 0 || i.value === "", u = a.value === null || a.value === void 0 || a.value === "";
1672
+ if (l || u) return l === u ? i.index - a.index : l ? 1 : -1;
1673
+ const c = typeof i.value == "number" && typeof a.value == "number" ? i.value - a.value : s.compare(String(i.value), String(a.value));
1674
+ return c !== 0 ? c * r : i.index - a.index;
1675
+ }).map((i) => i.row);
1676
+ }
1677
+ const be = [20, 50, 100, 200], an = be[0];
1678
+ function sn(e) {
1679
+ const t = Number(e);
1680
+ return be.includes(t) ? t : null;
1681
+ }
1682
+ function it(e, t) {
1683
+ return Math.max(1, Math.ceil(Math.max(0, e) / t));
1684
+ }
1685
+ function Le(e, t, n) {
1686
+ return Math.min(Math.max(0, e), it(t, n) - 1);
1687
+ }
1688
+ function ln(e, t, n) {
1689
+ if (n <= 0) return { from: 0, to: 0 };
1690
+ const r = Le(e, n, t) * t;
1691
+ return { from: r + 1, to: Math.min(n, r + t) };
1692
+ }
1693
+ function cn(e, t, n) {
1694
+ const r = Le(t, e.length, n) * n;
1695
+ return e.slice(r, r + n);
1696
+ }
1697
+ function un({ message: e, detail: t, action: n, className: r = "" }) {
1698
+ const { t: s } = j();
1699
+ return /* @__PURE__ */ m("div", { className: `px-4 py-8 text-center ${r}`, children: [
1700
+ /* @__PURE__ */ o("div", { className: "text-sm text-subtle", children: e ?? s("noData") }),
1701
+ t && /* @__PURE__ */ o("div", { className: "text-xs text-subtle/80 mt-1", children: t }),
1702
+ n && /* @__PURE__ */ o("div", { className: "mt-3", children: n })
1703
+ ] });
1704
+ }
1705
+ function dn({ permission: e, title: t, className: n = "" }) {
1706
+ const { t: r } = j();
1707
+ return /* @__PURE__ */ m("div", { role: "status", className: `rounded-lg border border-border bg-control/40 p-4 flex items-start gap-3 ${n}`, children: [
1708
+ /* @__PURE__ */ o("span", { "aria-hidden": !0, className: "text-lg leading-none text-subtle", children: "🔒" }),
1709
+ /* @__PURE__ */ m("div", { className: "min-w-0", children: [
1710
+ /* @__PURE__ */ o("div", { className: "text-sm font-medium text-heading", children: t ?? r("noAccess") }),
1711
+ /* @__PURE__ */ o("div", { className: "mt-0.5 text-xs text-muted", children: e ? pn(r("noAccessPermission", { permission: "\0" }), e) : r("noAccessHint") })
1712
+ ] })
1713
+ ] });
1714
+ }
1715
+ function pn(e, t) {
1716
+ const [n, r = ""] = e.split("\0");
1717
+ return /* @__PURE__ */ m(W, { children: [
1718
+ n,
1719
+ /* @__PURE__ */ o("code", { className: "font-mono text-text", children: t }),
1720
+ r
1721
+ ] });
1722
+ }
1723
+ function tr({ title: e, error: t, onRetry: n, compact: r = !1, className: s = "" }) {
1724
+ const { t: i } = j(), a = Tt(t);
1725
+ if (a && !r) return /* @__PURE__ */ o(dn, { permission: a.permission, className: s });
1726
+ const l = t == null || t === "" ? "" : a != null && a.permission ? i("missingPermission", { permission: a.permission }) : Me(t);
1727
+ return /* @__PURE__ */ m(
1728
+ "div",
1729
+ {
1730
+ role: "alert",
1731
+ className: `rounded-lg border border-error/30 bg-error/[0.06] ${r ? "px-3 py-2" : "p-4"} flex flex-wrap items-start justify-between gap-3 ${s}`,
1732
+ children: [
1733
+ /* @__PURE__ */ m("div", { className: "min-w-0", children: [
1734
+ /* @__PURE__ */ o("div", { className: "text-sm font-medium text-error", children: e ?? i("loadFailed") }),
1735
+ l && /* @__PURE__ */ o("div", { className: "mt-0.5 text-xs text-error/80 font-mono break-all", children: l })
1736
+ ] }),
1737
+ n && /* @__PURE__ */ o(
1738
+ "button",
1739
+ {
1740
+ type: "button",
1741
+ onClick: n,
1742
+ className: "shrink-0 px-3 py-1 text-xs rounded-md border border-error/40 text-error hover:bg-error/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-error/50",
1743
+ children: i("retry")
1744
+ }
1745
+ )
1746
+ ]
1747
+ }
1748
+ );
1749
+ }
1750
+ function mn({ columns: e, data: t, onRowClick: n, keyExtractor: r, defaultSort: s, page: i, emptyMessage: a, plain: l = !1 }) {
1751
+ const { t: u } = j(), [c, p] = T(s ?? null), d = c ? e.find((v) => v.key === c.key && v.sortValue) : void 0, S = d && c ? on(t, d.sortValue, c.direction) : t, k = i ? cn(S, i.index, i.size) : S;
1752
+ function g(v) {
1753
+ p((N) => (N == null ? void 0 : N.key) === v ? { key: v, direction: N.direction === "asc" ? "desc" : "asc" } : { key: v, direction: "asc" });
1754
+ }
1755
+ return /* @__PURE__ */ m("div", { className: l ? "overflow-x-auto" : "bg-surface border border-border rounded-xl overflow-x-auto", children: [
1756
+ /* @__PURE__ */ m("table", { className: "w-full text-sm", children: [
1757
+ /* @__PURE__ */ o("thead", { children: /* @__PURE__ */ o("tr", { className: "border-b border-border/75", children: e.map((v) => {
1758
+ const N = (c == null ? void 0 : c.key) === v.key && !!v.sortValue;
1759
+ return /* @__PURE__ */ o(
1760
+ "th",
1761
+ {
1762
+ "aria-sort": N ? c.direction === "asc" ? "ascending" : "descending" : void 0,
1763
+ className: `px-4 py-3 text-left text-xs text-subtle font-medium uppercase tracking-wide ${v.className ?? ""}`,
1764
+ children: v.sortValue ? /* @__PURE__ */ m(
1765
+ "button",
1766
+ {
1767
+ type: "button",
1768
+ onClick: () => g(v.key),
1769
+ title: u("sortBy", { column: v.header }),
1770
+ className: `inline-flex items-center gap-1 uppercase tracking-wide hover:text-text ${N ? "text-text" : ""}`,
1771
+ children: [
1772
+ v.header,
1773
+ /* @__PURE__ */ o("span", { "aria-hidden": !0, className: `text-[9px] ${N ? "" : "opacity-30"}`, children: N && c.direction === "desc" ? "▼" : "▲" })
1774
+ ]
1775
+ }
1776
+ ) : v.header
1777
+ },
1778
+ v.key
1779
+ );
1780
+ }) }) }),
1781
+ /* @__PURE__ */ o("tbody", { children: k.map((v) => /* @__PURE__ */ o(
1782
+ "tr",
1783
+ {
1784
+ onClick: n ? () => n(v) : void 0,
1785
+ onKeyDown: n ? (N) => {
1786
+ N.target !== N.currentTarget || N.key !== "Enter" && N.key !== " " || (N.preventDefault(), n(v));
1787
+ } : void 0,
1788
+ tabIndex: n ? 0 : void 0,
1789
+ className: `border-b border-border/50 last:border-0 ${n ? "cursor-pointer hover:bg-control focus-visible:bg-control focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/60" : ""}`,
1790
+ children: e.map((N) => /* @__PURE__ */ o("td", { className: `px-4 py-3 text-text ${N.className ?? ""}`, children: N.render ? N.render(v) : String(v[N.key] ?? "") }, N.key))
1791
+ },
1792
+ r(v)
1793
+ )) })
1794
+ ] }),
1795
+ t.length === 0 && (a ?? /* @__PURE__ */ o(un, {}))
1796
+ ] });
1797
+ }
1798
+ function nr(e) {
1799
+ const { t } = j();
1800
+ return /* @__PURE__ */ o(Ae, { label: t("table"), resetKeys: [e.data], children: /* @__PURE__ */ o(mn, { ...e }) });
1801
+ }
1802
+ const hn = { responsive: "w-full sm:w-auto", full: "w-full", auto: "w-auto" }, fn = {
1803
+ sm: "min-h-11 sm:min-h-0 px-2.5 py-1.5 text-xs",
1804
+ md: "min-h-11 sm:min-h-0 px-3 py-2 text-sm"
1805
+ };
1806
+ function gn(e) {
1807
+ const { value: t, onChange: n, onClear: r, ...s } = e;
1808
+ return /* @__PURE__ */ o(
1809
+ lt,
1810
+ {
1811
+ ...s,
1812
+ multiple: !1,
1813
+ selected: t === null ? [] : [t],
1814
+ onPick: (i) => n(i),
1815
+ onClear: r
1816
+ }
1817
+ );
1818
+ }
1819
+ function rr(e) {
1820
+ const { value: t, onChange: n, clearable: r, maxChips: s = 2, ...i } = e;
1821
+ return /* @__PURE__ */ o(
1822
+ lt,
1823
+ {
1824
+ ...i,
1825
+ multiple: !0,
1826
+ maxChips: s,
1827
+ selected: t,
1828
+ onPick: (a) => n(t.includes(a) ? t.filter((l) => l !== a) : [...t, a]),
1829
+ onClear: r ? () => n([]) : void 0
1830
+ }
1831
+ );
1832
+ }
1833
+ function lt({
1834
+ options: e,
1835
+ label: t,
1836
+ id: n,
1837
+ placeholder: r,
1838
+ searchable: s,
1839
+ disabled: i = !1,
1840
+ size: a = "sm",
1841
+ width: l = "responsive",
1842
+ className: u = "",
1843
+ multiple: c,
1844
+ selected: p,
1845
+ onPick: d,
1846
+ onClear: S,
1847
+ maxChips: k = 2
1848
+ }) {
1849
+ const g = pe(), v = de(), N = (h) => `${v}-o${h}`, [C, b] = T(!1), [y, M] = T(-1), [L, P] = T(""), [x, D] = T(null), w = E(null), f = E(null), A = E(null), R = nt(), q = s ?? e.length > 10, I = ee(() => {
1850
+ const h = L.trim().toLowerCase();
1851
+ return h ? e.filter(($) => $.label.toLowerCase().includes(h) || $.value.toLowerCase().includes(h)) : e;
1852
+ }, [e, L]), z = ee(() => I.map((h) => !!h.disabled), [I]), we = ee(() => I.map((h) => h.label), [I]), _ = et(C, x, w), G = (h = !0) => {
1853
+ b(!1), P(""), h && (x == null || x.focus());
1854
+ };
1855
+ tt(C, () => [x, w.current], () => G(!1), () => G(!1));
1856
+ function me(h) {
1857
+ if (i) return;
1858
+ const $ = e.findIndex((F) => p.includes(F.value) && !F.disabled), O = e.map((F) => !!F.disabled);
1859
+ P(""), M(h ?? ($ >= 0 ? $ : Y(O))), b(!0);
1860
+ }
1861
+ B(() => {
1862
+ var h;
1863
+ C && q && ((h = A.current) == null || h.focus());
1864
+ }, [C, q]), B(() => {
1865
+ var h, $;
1866
+ !C || y < 0 || ($ = (h = document.getElementById(`${v}-o${y}`)) == null ? void 0 : h.scrollIntoView) == null || $.call(h, { block: "nearest" });
1867
+ }, [C, y, v]);
1868
+ function he(h) {
1869
+ const $ = I[h];
1870
+ !$ || $.disabled || (d($.value), c || G());
1871
+ }
1872
+ function Ee(h) {
1873
+ const $ = h.currentTarget === A.current;
1874
+ if (!C) {
1875
+ if (h.key === "ArrowDown" || h.key === "ArrowUp" || h.key === "Enter" || h.key === " ")
1876
+ h.preventDefault(), me();
1877
+ else if (h.key === "Home" || h.key === "End") {
1878
+ h.preventDefault();
1879
+ const O = e.map((F) => !!F.disabled);
1880
+ me(h.key === "Home" ? Y(O) : ae(O));
1881
+ } else if (Se(h)) {
1882
+ const O = e.findIndex((K) => p.includes(K.value)), F = R(h.key, e.map((K) => K.label), e.map((K) => !!K.disabled), O);
1883
+ F !== O && F >= 0 && (c ? me(F) : d(e[F].value));
1884
+ }
1885
+ return;
1886
+ }
1887
+ switch (h.key) {
1888
+ case "ArrowDown":
1889
+ h.preventDefault(), M((O) => O < 0 ? Y(z) : ue(z, O, 1));
1890
+ break;
1891
+ case "ArrowUp":
1892
+ if (h.preventDefault(), h.altKey) {
1893
+ c || he(y), G();
1894
+ break;
1895
+ }
1896
+ M((O) => O < 0 ? ae(z) : ue(z, O, -1));
1897
+ break;
1898
+ case "Home":
1899
+ case "End":
1900
+ if ($ && !h.ctrlKey) break;
1901
+ h.preventDefault(), M(h.key === "Home" ? Y(z) : ae(z));
1902
+ break;
1903
+ case "PageDown":
1904
+ case "PageUp": {
1905
+ h.preventDefault();
1906
+ let O = y;
1907
+ for (let F = 0; F < 10; F++) O = ue(z, O, h.key === "PageDown" ? 1 : -1);
1908
+ M(O);
1909
+ break;
1910
+ }
1911
+ case "Enter":
1912
+ h.preventDefault(), he(y);
1913
+ break;
1914
+ case " ":
1915
+ if ($) break;
1916
+ h.preventDefault(), he(y);
1917
+ break;
1918
+ case "Escape":
1919
+ h.preventDefault(), h.stopPropagation(), G();
1920
+ break;
1921
+ case "Tab":
1922
+ $ ? (h.preventDefault(), G()) : G(!1);
1923
+ break;
1924
+ default:
1925
+ !$ && Se(h) && M((O) => R(h.key, we, z, O));
1926
+ }
1927
+ }
1928
+ const ne = e.filter((h) => p.includes(h.value)), fe = ne.length > 0, Te = !!S && fe && !i;
1929
+ return /* @__PURE__ */ m("div", { className: `relative inline-flex max-w-full ${hn[l]} ${u}`, children: [
1930
+ /* @__PURE__ */ o(
1931
+ "button",
1932
+ {
1933
+ ref: D,
1934
+ id: n,
1935
+ type: "button",
1936
+ role: "combobox",
1937
+ "aria-label": t,
1938
+ "aria-haspopup": "listbox",
1939
+ "aria-expanded": C,
1940
+ "aria-controls": C ? v : void 0,
1941
+ "aria-activedescendant": C && !q && y >= 0 ? N(y) : void 0,
1942
+ disabled: i,
1943
+ onClick: () => C ? G() : me(),
1944
+ onKeyDown: Ee,
1945
+ className: `flex-1 min-w-0 inline-flex items-center gap-2 bg-control border rounded-lg text-left text-text transition-colors hover:bg-control-hover focus:outline-none focus-visible:border-primary disabled:opacity-50 disabled:cursor-not-allowed ${C ? "border-primary" : "border-border/75"} ${fn[a]} ${Te ? "pr-16 sm:pr-12" : "pr-7"}`,
1946
+ children: /* @__PURE__ */ m("span", { className: "flex-1 min-w-0 flex items-center gap-1.5 truncate", children: [
1947
+ !fe && /* @__PURE__ */ o("span", { className: "truncate text-subtle", children: r ?? "—" }),
1948
+ fe && !c && /* @__PURE__ */ m(W, { children: [
1949
+ ne[0].icon && /* @__PURE__ */ o("span", { "aria-hidden": !0, className: "inline-flex shrink-0", children: ne[0].icon }),
1950
+ /* @__PURE__ */ o("span", { className: "truncate", children: ne[0].label })
1951
+ ] }),
1952
+ fe && c && /* @__PURE__ */ m(W, { children: [
1953
+ ne.slice(0, k).map((h) => /* @__PURE__ */ m("span", { className: "inline-flex items-center gap-1 max-w-[8rem] px-1.5 py-px rounded bg-primary/15 text-accent text-[11px] leading-4", children: [
1954
+ h.icon && /* @__PURE__ */ o("span", { "aria-hidden": !0, className: "inline-flex shrink-0", children: h.icon }),
1955
+ /* @__PURE__ */ o("span", { className: "truncate", children: h.label })
1956
+ ] }, h.value)),
1957
+ ne.length > k && /* @__PURE__ */ o("span", { className: "shrink-0 text-[11px] text-muted tabular-nums", children: g("selectMore", { count: ne.length - k }) })
1958
+ ] })
1959
+ ] })
1960
+ }
1961
+ ),
1962
+ /* @__PURE__ */ o(bn, { open: C }),
1963
+ Te && /* @__PURE__ */ o(
1964
+ "button",
1965
+ {
1966
+ type: "button",
1967
+ "aria-label": g("selectClear"),
1968
+ title: g("selectClear"),
1969
+ onClick: () => {
1970
+ S == null || S(), x == null || x.focus();
1971
+ },
1972
+ className: "absolute right-6 sm:right-5 top-1/2 -translate-y-1/2 w-8 h-8 sm:w-5 sm:h-5 inline-flex items-center justify-center rounded text-subtle hover:text-text hover:bg-control-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-primary",
1973
+ children: /* @__PURE__ */ o("svg", { "aria-hidden": !0, width: "10", height: "10", viewBox: "0 0 10 10", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: /* @__PURE__ */ o("path", { d: "M2 2l6 6M8 2l-6 6" }) })
1974
+ }
1975
+ ),
1976
+ C && xe(
1977
+ /* @__PURE__ */ m(
1978
+ "div",
1979
+ {
1980
+ ref: w,
1981
+ "data-placement": _ == null ? void 0 : _.placement,
1982
+ style: _ ? { left: _.left, top: _.top, minWidth: _.minWidth, maxHeight: _.maxHeight } : { left: 0, top: 0, visibility: "hidden" },
1983
+ className: "fixed z-[60] flex flex-col max-w-[min(24rem,calc(100vw-1rem))] rounded-lg border border-border bg-popover shadow-xl overflow-hidden motion-safe:animate-pop-in",
1984
+ children: [
1985
+ q && /* @__PURE__ */ o("div", { className: "p-1.5 border-b border-border/75", children: /* @__PURE__ */ o(
1986
+ "input",
1987
+ {
1988
+ ref: A,
1989
+ type: "text",
1990
+ role: "combobox",
1991
+ "aria-label": t ? `${t}: ${g("selectSearch")}` : g("selectSearch"),
1992
+ "aria-autocomplete": "list",
1993
+ "aria-expanded": !0,
1994
+ "aria-controls": v,
1995
+ "aria-activedescendant": y >= 0 && y < I.length ? N(y) : void 0,
1996
+ placeholder: g("selectSearch"),
1997
+ value: L,
1998
+ onChange: (h) => {
1999
+ const $ = h.target.value;
2000
+ P($);
2001
+ const O = $.trim().toLowerCase(), F = e.filter((K) => !O || K.label.toLowerCase().includes(O) || K.value.toLowerCase().includes(O)).map((K) => !!K.disabled);
2002
+ M(Y(F));
2003
+ },
2004
+ onKeyDown: Ee,
2005
+ className: "w-full min-h-11 sm:min-h-0 px-2.5 py-1.5 text-base sm:text-xs bg-control border border-border/75 rounded-md text-text placeholder:text-subtle focus:outline-none focus:border-primary"
2006
+ }
2007
+ ) }),
2008
+ /* @__PURE__ */ m(
2009
+ "ul",
2010
+ {
2011
+ ref: f,
2012
+ id: v,
2013
+ role: "listbox",
2014
+ "aria-label": t,
2015
+ "aria-multiselectable": c || void 0,
2016
+ tabIndex: -1,
2017
+ className: "flex-1 min-h-0 overflow-y-auto overscroll-contain p-1",
2018
+ children: [
2019
+ I.length === 0 && /* @__PURE__ */ o("li", { role: "presentation", className: "px-2.5 py-2 text-xs text-subtle", children: g("selectNoMatches") }),
2020
+ I.map((h, $) => {
2021
+ const O = p.includes(h.value);
2022
+ return /* @__PURE__ */ m(
2023
+ "li",
2024
+ {
2025
+ id: N($),
2026
+ role: "option",
2027
+ "aria-selected": O,
2028
+ "aria-disabled": h.disabled || void 0,
2029
+ onMouseMove: () => {
2030
+ !h.disabled && y !== $ && M($);
2031
+ },
2032
+ onMouseDown: (F) => F.preventDefault(),
2033
+ onClick: () => he($),
2034
+ className: `flex items-center gap-2 min-h-11 sm:min-h-8 px-2.5 py-1 rounded-md text-sm sm:text-xs select-none ${h.disabled ? "opacity-40 cursor-not-allowed" : "cursor-pointer"} ${$ === y ? "bg-control-hover" : ""} ${O ? "text-accent font-medium" : "text-text"}`,
2035
+ children: [
2036
+ /* @__PURE__ */ o(xn, { checked: O, box: c }),
2037
+ h.icon && /* @__PURE__ */ o("span", { "aria-hidden": !0, className: "inline-flex shrink-0", children: h.icon }),
2038
+ /* @__PURE__ */ m("span", { className: "min-w-0 flex-1", children: [
2039
+ /* @__PURE__ */ o("span", { className: "block truncate", children: h.label }),
2040
+ h.description && /* @__PURE__ */ o("span", { className: "block truncate text-[11px] font-normal text-subtle", children: h.description })
2041
+ ] })
2042
+ ]
2043
+ },
2044
+ h.value
2045
+ );
2046
+ })
2047
+ ]
2048
+ }
2049
+ )
2050
+ ]
2051
+ }
2052
+ ),
2053
+ ve()
2054
+ )
2055
+ ] });
2056
+ }
2057
+ function bn({ open: e }) {
2058
+ return /* @__PURE__ */ o("svg", { "aria-hidden": !0, width: "10", height: "10", viewBox: "0 0 10 10", className: `absolute right-2.5 top-1/2 -mt-[5px] pointer-events-none text-muted motion-safe:transition-transform ${e ? "rotate-180" : ""}`, children: /* @__PURE__ */ o("path", { d: "M2 3.5l3 3 3-3", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
2059
+ }
2060
+ function xn({ checked: e, box: t }) {
2061
+ return t ? /* @__PURE__ */ o("span", { "aria-hidden": !0, className: `inline-flex shrink-0 items-center justify-center w-4 h-4 rounded border ${e ? "bg-primary border-primary text-on-primary" : "border-border"}`, children: e && /* @__PURE__ */ o(Ge, {}) }) : /* @__PURE__ */ o("span", { "aria-hidden": !0, className: "inline-flex shrink-0 w-4 justify-center", children: e && /* @__PURE__ */ o(Ge, {}) });
2062
+ }
2063
+ function Ge() {
2064
+ return /* @__PURE__ */ o("svg", { width: "10", height: "10", viewBox: "0 0 10 10", children: /* @__PURE__ */ o("path", { d: "M1.5 5.5l2.5 2.5 4.5-5", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round" }) });
2065
+ }
2066
+ const Ke = "px-3 py-1.5 text-xs bg-control hover:bg-control-hover text-text rounded-lg transition-colors disabled:opacity-40";
2067
+ function or({ page: e, pageSize: t, total: n, onPage: r, onPageSize: s }) {
2068
+ const { t: i, formatNumber: a } = j();
2069
+ if (n <= be[0]) return null;
2070
+ const l = Le(e, n, t), u = it(n, t), { from: c, to: p } = ln(l, t, n);
2071
+ return /* @__PURE__ */ m("nav", { "aria-label": i("pagination"), className: "flex flex-wrap items-center justify-between gap-3 mt-3 text-xs text-subtle", children: [
2072
+ /* @__PURE__ */ m("label", { className: "flex items-center gap-2", children: [
2073
+ i("rowsPerPage"),
2074
+ /* @__PURE__ */ o(
2075
+ gn,
2076
+ {
2077
+ options: be.map((d) => ({ value: String(d), label: a(d) })),
2078
+ value: String(t),
2079
+ onChange: (d) => s(Number(d)),
2080
+ width: "auto"
2081
+ }
2082
+ )
2083
+ ] }),
2084
+ /* @__PURE__ */ m("div", { className: "flex items-center gap-3", children: [
2085
+ /* @__PURE__ */ o("span", { className: "tabular-nums", children: i("pageRange", { from: a(c), to: a(p), total: a(n) }) }),
2086
+ /* @__PURE__ */ o("button", { onClick: () => r(l - 1), disabled: l === 0, className: Ke, children: i("previousPage") }),
2087
+ /* @__PURE__ */ o("span", { className: "tabular-nums", children: i("pageOf", { page: a(l + 1), pages: a(u) }) }),
2088
+ /* @__PURE__ */ o("button", { onClick: () => r(l + 1), disabled: l >= u - 1, className: Ke, children: i("nextPage") })
2089
+ ] })
2090
+ ] });
2091
+ }
2092
+ function vn({ lines: e, maxLines: t = 500, title: n, className: r = "" }) {
2093
+ const { t: s } = j(), i = E(null), [a, l] = T(!0);
2094
+ B(() => {
2095
+ a && i.current && (i.current.scrollTop = i.current.scrollHeight);
2096
+ }, [e, a]);
2097
+ const u = () => {
2098
+ if (!i.current) return;
2099
+ const { scrollTop: p, scrollHeight: d, clientHeight: S } = i.current;
2100
+ l(d - p - S < 40);
2101
+ }, c = e.slice(-t);
2102
+ return /* @__PURE__ */ m("div", { className: `bg-surface border border-border rounded-xl overflow-hidden ${r}`, children: [
2103
+ n && /* @__PURE__ */ m("div", { className: "px-4 py-3 border-b border-border/75 flex items-center justify-between", children: [
2104
+ /* @__PURE__ */ o("span", { className: "text-sm font-medium text-heading", children: n }),
2105
+ /* @__PURE__ */ o(
2106
+ "button",
2107
+ {
2108
+ onClick: () => l(!a),
2109
+ className: `text-[10px] px-2 py-0.5 rounded ${a ? "bg-primary/20 text-accent" : "bg-control text-muted"}`,
2110
+ children: s(a ? "autoScrollOn" : "autoScrollOff")
2111
+ }
2112
+ )
2113
+ ] }),
2114
+ /* @__PURE__ */ o(
2115
+ "div",
2116
+ {
2117
+ ref: i,
2118
+ onScroll: u,
2119
+ className: "overflow-y-auto max-h-80 p-3 font-mono text-xs leading-5 text-text",
2120
+ children: c.map((p, d) => /* @__PURE__ */ o("div", { className: "whitespace-pre-wrap break-all", children: p }, d))
2121
+ }
2122
+ )
2123
+ ] });
2124
+ }
2125
+ function ar(e) {
2126
+ var n;
2127
+ const { t } = j();
2128
+ return /* @__PURE__ */ o(Ae, { label: e.title ?? t("panel"), resetKeys: [(n = e.lines) == null ? void 0 : n.length], children: /* @__PURE__ */ o(vn, { ...e }) });
2129
+ }
2130
+ function sr({ title: e, subtitle: t, actions: n }) {
2131
+ return /* @__PURE__ */ m("div", { className: "px-4 sm:px-6 py-4 border-b border-border/75 flex flex-wrap items-center justify-between gap-x-4 gap-y-2", children: [
2132
+ /* @__PURE__ */ m("div", { className: "min-w-0", children: [
2133
+ /* @__PURE__ */ o("h2", { className: "text-lg font-semibold text-heading", children: e }),
2134
+ t && /* @__PURE__ */ o("p", { className: "text-xs text-subtle mt-0.5", children: t })
2135
+ ] }),
2136
+ n && /* @__PURE__ */ o("div", { className: "flex flex-wrap items-center gap-2", children: n })
2137
+ ] });
2138
+ }
2139
+ function yn({ label: e, value: t, sub: n, subColor: r = "text-subtle" }) {
2140
+ return /* @__PURE__ */ m("div", { className: "flex-1 min-w-[140px] bg-surface border border-border rounded-xl p-4", children: [
2141
+ /* @__PURE__ */ o("div", { className: "text-[11px] text-subtle uppercase tracking-wide", children: e }),
2142
+ /* @__PURE__ */ o("div", { className: "text-2xl font-semibold text-heading mt-1", children: t }),
2143
+ n && /* @__PURE__ */ o("div", { className: `text-[11px] mt-0.5 ${r}`, children: n })
2144
+ ] });
2145
+ }
2146
+ function ir(e) {
2147
+ return /* @__PURE__ */ o(Ae, { label: e.label, resetKeys: [e.value], children: /* @__PURE__ */ o(yn, { ...e }) });
2148
+ }
2149
+ function H({ className: e = "", style: t }) {
2150
+ return /* @__PURE__ */ o("div", { "aria-hidden": !0, className: `rounded bg-control ${e}`, style: t });
2151
+ }
2152
+ function re({ label: e, className: t = "", children: n }) {
2153
+ const { t: r } = j();
2154
+ return /* @__PURE__ */ m("div", { role: "status", "aria-live": "polite", "aria-busy": "true", className: `animate-pulse motion-reduce:animate-none ${t}`, children: [
2155
+ /* @__PURE__ */ o("span", { className: "sr-only", children: e ?? r("loading") }),
2156
+ n
2157
+ ] });
2158
+ }
2159
+ const te = ["100%", "92%", "96%", "80%", "88%", "70%"];
2160
+ function lr({ lines: e = 3, label: t, className: n = "" }) {
2161
+ return /* @__PURE__ */ o(re, { label: t, className: `space-y-2 ${n}`, children: Array.from({ length: e }, (r, s) => /* @__PURE__ */ o(H, { className: "h-3.5", style: { width: s === e - 1 && e > 1 ? "60%" : te[s % te.length] } }, s)) });
2162
+ }
2163
+ function ct() {
2164
+ return /* @__PURE__ */ m(W, { children: [
2165
+ /* @__PURE__ */ o("div", { className: "h-4 flex items-center", children: /* @__PURE__ */ o(H, { className: "h-2.5 w-20" }) }),
2166
+ /* @__PURE__ */ o("div", { className: "h-8 mt-1 flex items-center", children: /* @__PURE__ */ o(H, { className: "h-6 w-16" }) }),
2167
+ /* @__PURE__ */ o("div", { className: "h-4 mt-0.5 flex items-center", children: /* @__PURE__ */ o(H, { className: "h-2.5 w-24" }) })
2168
+ ] });
2169
+ }
2170
+ const ut = "flex-1 min-w-[140px] bg-surface border border-border rounded-xl p-4";
2171
+ function cr({ count: e = 4, label: t, inRow: n = !1, className: r = "" }) {
2172
+ return /* @__PURE__ */ o(re, { label: t, className: `${n ? "contents" : "flex flex-wrap gap-4"} ${r}`, children: Array.from({ length: e }, (s, i) => /* @__PURE__ */ o("div", { className: ut, children: /* @__PURE__ */ o(ct, {}) }, i)) });
2173
+ }
2174
+ function ur({ label: e, className: t = "" }) {
2175
+ return /* @__PURE__ */ o(re, { label: e, className: `${ut} ${t}`, children: /* @__PURE__ */ o(ct, {}) });
2176
+ }
2177
+ function dr({ rows: e = 5, columns: t = 4, label: n, plain: r = !1, className: s = "" }) {
2178
+ const i = Array.from({ length: t }, (a, l) => l);
2179
+ return /* @__PURE__ */ m(re, { label: n, className: `${r ? "" : "bg-surface border border-border rounded-xl"} overflow-hidden ${s}`, children: [
2180
+ /* @__PURE__ */ o("div", { className: "flex gap-4 px-4 py-3.5 border-b border-border/75", children: i.map((a) => /* @__PURE__ */ o(H, { className: "h-2.5 flex-1", style: { maxWidth: a === 0 ? "7rem" : "5rem" } }, a)) }),
2181
+ Array.from({ length: e }, (a, l) => /* @__PURE__ */ o("div", { className: "flex gap-4 px-4 py-3.5 border-b border-border/50 last:border-0", children: i.map((u) => /* @__PURE__ */ o(H, { className: "h-3.5 flex-1", style: { maxWidth: u === 0 ? "12rem" : te[(l + u) % te.length] } }, u)) }, l))
2182
+ ] });
2183
+ }
2184
+ function pr({ height: e = 160, label: t, className: n = "" }) {
2185
+ return /* @__PURE__ */ m(re, { label: t, className: `bg-surface border border-border rounded-xl p-4 ${n}`, children: [
2186
+ /* @__PURE__ */ o(H, { className: "h-3.5 w-32" }),
2187
+ /* @__PURE__ */ o(H, { className: "h-2.5 w-48 mt-1.5 mb-3" }),
2188
+ /* @__PURE__ */ o(H, { className: "w-full rounded-md", style: { height: e } })
2189
+ ] });
2190
+ }
2191
+ function mr({ items: e = 4, label: t, className: n = "" }) {
2192
+ return /* @__PURE__ */ o(re, { label: t, className: `space-y-3 ${n}`, children: Array.from({ length: e }, (r, s) => /* @__PURE__ */ m("div", { className: "space-y-1.5", children: [
2193
+ /* @__PURE__ */ o(H, { className: "h-3.5", style: { width: te[(s + 2) % te.length] } }),
2194
+ /* @__PURE__ */ o(H, { className: "h-2.5 w-1/3" })
2195
+ ] }, s)) });
2196
+ }
2197
+ function hr({ label: e, columns: t = 4, rows: n = 6 }) {
2198
+ return /* @__PURE__ */ m(re, { label: e, className: "space-y-6", children: [
2199
+ /* @__PURE__ */ m("div", { className: "space-y-2", children: [
2200
+ /* @__PURE__ */ o(H, { className: "h-6 w-48" }),
2201
+ /* @__PURE__ */ o(H, { className: "h-3.5 w-72 max-w-full" })
2202
+ ] }),
2203
+ /* @__PURE__ */ m("div", { className: "bg-surface border border-border rounded-xl overflow-hidden", children: [
2204
+ /* @__PURE__ */ o("div", { className: "flex gap-4 px-4 py-3.5 border-b border-border/75", children: Array.from({ length: t }, (r, s) => /* @__PURE__ */ o(H, { className: "h-2.5 flex-1 max-w-[6rem]" }, s)) }),
2205
+ Array.from({ length: n }, (r, s) => /* @__PURE__ */ o("div", { className: "flex gap-4 px-4 py-3.5 border-b border-border/50 last:border-0", children: Array.from({ length: t }, (i, a) => /* @__PURE__ */ o(H, { className: "h-3.5 flex-1", style: { maxWidth: te[(s + a) % te.length] } }, a)) }, s))
2206
+ ] })
2207
+ ] });
2208
+ }
2209
+ const oe = 8;
2210
+ function fr({ content: e, children: t, className: n = "", openDelay: r = 200, longPress: s = 450 }) {
2211
+ const i = de(), [a, l] = T(!1), [u, c] = T(null), [p, d] = T(null), S = E(null), k = E(void 0), g = E(!1), v = () => clearTimeout(k.current), N = V(() => {
2212
+ clearTimeout(k.current), l(!1), c(null);
2213
+ }, []);
2214
+ B(() => () => clearTimeout(k.current), []), B(() => {
2215
+ if (!a) return;
2216
+ const b = (M) => {
2217
+ M.key === "Escape" && N();
2218
+ }, y = (M) => {
2219
+ p != null && p.contains(M.target) || N();
2220
+ };
2221
+ return document.addEventListener("keydown", b), document.addEventListener("touchstart", y), () => {
2222
+ document.removeEventListener("keydown", b), document.removeEventListener("touchstart", y);
2223
+ };
2224
+ }, [a, N, p]);
2225
+ const C = V(() => {
2226
+ if (!p || !S.current) return;
2227
+ const b = p.getBoundingClientRect(), y = S.current.getBoundingClientRect(), M = Math.min(Math.max(oe, b.left + b.width / 2 - y.width / 2), Math.max(oe, window.innerWidth - y.width - oe)), L = b.top - y.height - oe, P = L >= oe ? L : b.bottom + oe;
2228
+ c((x) => x && x.left === M && x.top === P ? x : { left: M, top: P });
2229
+ }, [p]);
2230
+ return ke(() => {
2231
+ if (!a) return;
2232
+ C(), window.addEventListener("scroll", C, !0), window.addEventListener("resize", C);
2233
+ const b = typeof ResizeObserver == "function" && S.current ? new ResizeObserver(C) : null;
2234
+ return b && S.current && b.observe(S.current), () => {
2235
+ window.removeEventListener("scroll", C, !0), window.removeEventListener("resize", C), b == null || b.disconnect();
2236
+ };
2237
+ }, [a, C]), /* @__PURE__ */ m(W, { children: [
2238
+ /* @__PURE__ */ o(
2239
+ "span",
2240
+ {
2241
+ ref: d,
2242
+ className: `inline-flex ${n}`,
2243
+ onPointerEnter: (b) => {
2244
+ b.pointerType !== "touch" && (v(), k.current = setTimeout(() => l(!0), r));
2245
+ },
2246
+ onPointerLeave: (b) => {
2247
+ b.pointerType !== "touch" && N();
2248
+ },
2249
+ onFocus: () => {
2250
+ v(), l(!0);
2251
+ },
2252
+ onBlur: N,
2253
+ onTouchStart: () => {
2254
+ g.current = !1, v(), k.current = setTimeout(() => {
2255
+ g.current = !0, l(!0);
2256
+ }, s);
2257
+ },
2258
+ onTouchMove: v,
2259
+ onTouchEnd: v,
2260
+ onClickCapture: (b) => {
2261
+ g.current && (g.current = !1, b.preventDefault(), b.stopPropagation());
2262
+ },
2263
+ children: t(a ? i : void 0)
2264
+ }
2265
+ ),
2266
+ a && xe(
2267
+ /* @__PURE__ */ o(
2268
+ "div",
2269
+ {
2270
+ ref: S,
2271
+ id: i,
2272
+ role: "tooltip",
2273
+ style: u ? { left: u.left, top: u.top } : { left: 0, top: 0, visibility: "hidden" },
2274
+ className: "fixed z-50 max-w-[min(20rem,calc(100vw-1rem))] px-3 py-2 rounded-lg border border-border bg-popover text-text text-xs shadow-xl pointer-events-none",
2275
+ children: e()
2276
+ }
2277
+ ),
2278
+ ve()
2279
+ )
2280
+ ] });
2281
+ }
2282
+ const se = (e) => /* @__PURE__ */ o("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: e }), gr = () => se(/* @__PURE__ */ m(W, { children: [
2283
+ /* @__PURE__ */ o("circle", { cx: "12", cy: "12", r: "9" }),
2284
+ /* @__PURE__ */ o("path", { d: "M12 11v5M12 8h.01" })
2285
+ ] })), br = () => se(/* @__PURE__ */ o("path", { d: "M4 6h16M4 10h16M4 14h10M4 18h7" })), xr = () => se(/* @__PURE__ */ m(W, { children: [
2286
+ /* @__PURE__ */ o("path", { d: "M3 12a9 9 0 1 0 3-6.7" }),
2287
+ /* @__PURE__ */ o("path", { d: "M3 4v5h5" })
2288
+ ] })), vr = () => se(/* @__PURE__ */ o(W, { children: /* @__PURE__ */ o("path", { d: "M4 7h16M10 11v6M14 11v6M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12M9 7V4h6v3" }) })), yr = () => se(/* @__PURE__ */ m(W, { children: [
2289
+ /* @__PURE__ */ o("path", { d: "M12 4v11M7 10l5 5 5-5" }),
2290
+ /* @__PURE__ */ o("path", { d: "M5 20h14" })
2291
+ ] })), wr = () => se(/* @__PURE__ */ m(W, { children: [
2292
+ /* @__PURE__ */ o("circle", { cx: "12", cy: "12", r: "9" }),
2293
+ /* @__PURE__ */ o("path", { d: "M5.6 5.6l12.8 12.8" })
2294
+ ] }));
2295
+ function dt() {
2296
+ const e = E(null), [t, n] = T(0);
2297
+ return ke(() => {
2298
+ const r = e.current;
2299
+ if (!r || (n(r.clientWidth), typeof ResizeObserver > "u")) return;
2300
+ const s = new ResizeObserver((i) => n(i[0].contentRect.width));
2301
+ return s.observe(r), () => s.disconnect();
2302
+ }, []), [e, t];
2303
+ }
2304
+ function wn(e, t, n, r, s = !0) {
2305
+ const i = s ? Math.min(4, n / 2, r) : 0, a = t + r;
2306
+ return `M${e},${a}V${t + i}Q${e},${t} ${e + i},${t}H${e + n - i}Q${e + n},${t} ${e + n},${t + i}V${a}Z`;
2307
+ }
2308
+ function pt(e, t = !1) {
2309
+ if (!(e > 0)) return { max: 1, ticks: [0, 1] };
2310
+ const n = 10 ** Math.floor(Math.log10(e)), r = [0.2, 0.25, 0.5, 1, 2, 2.5, 5, 10].map((a) => a * n).filter((a) => !t || Number.isInteger(a)).find((a) => e / a <= 4) ?? n * 10, s = Math.ceil(e / r) * r, i = [];
2311
+ for (let a = 0; a <= s + r / 2; a += r) i.push(Number(a.toPrecision(12)));
2312
+ return { max: s, ticks: i };
2313
+ }
2314
+ function Nr(e, t) {
2315
+ if (e <= 0) return [];
2316
+ const n = Math.max(1, Math.ceil(e / t)), r = [];
2317
+ for (let s = e - 1; s >= 0; s -= n) r.unshift(s);
2318
+ return r;
2319
+ }
2320
+ function Pr({ items: e }) {
2321
+ return /* @__PURE__ */ o("ul", { className: "flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted", children: e.map((t) => /* @__PURE__ */ m("li", { className: "flex items-center gap-1.5", children: [
2322
+ /* @__PURE__ */ o("span", { className: "inline-block w-2.5 h-2.5 rounded-sm", style: { background: t.color }, "aria-hidden": !0 }),
2323
+ /* @__PURE__ */ o("span", { children: t.label }),
2324
+ t.value !== void 0 && /* @__PURE__ */ o("span", { className: "text-text font-medium tabular-nums", children: t.value })
2325
+ ] }, t.label)) });
2326
+ }
2327
+ function mt({ x: e, y: t, width: n, title: r, rows: s }) {
2328
+ const i = e > n - 120, a = e < 120, l = i ? "translate(-100%, -100%)" : a ? "translate(0, -100%)" : "translate(-50%, -100%)";
2329
+ return /* @__PURE__ */ m(
2330
+ "div",
2331
+ {
2332
+ role: "status",
2333
+ className: "pointer-events-none absolute z-10 min-w-[120px] rounded-lg border border-border bg-popover px-3 py-2 text-xs shadow-lg",
2334
+ style: { left: e, top: t - 8, transform: l },
2335
+ children: [
2336
+ /* @__PURE__ */ o("div", { className: "text-subtle mb-1 whitespace-nowrap", children: r }),
2337
+ s.map((u) => /* @__PURE__ */ m("div", { className: "flex items-center gap-2 whitespace-nowrap", children: [
2338
+ u.color && /* @__PURE__ */ o("span", { className: "inline-block w-3 h-0.5 rounded", style: { background: u.color }, "aria-hidden": !0 }),
2339
+ /* @__PURE__ */ o("span", { className: "text-heading font-semibold tabular-nums", children: u.value }),
2340
+ /* @__PURE__ */ o("span", { className: "text-muted", children: u.label })
2341
+ ] }, u.label))
2342
+ ]
2343
+ }
2344
+ );
2345
+ }
2346
+ function Sr({ title: e, note: t, legend: n, actions: r, children: s }) {
2347
+ return /* @__PURE__ */ m("section", { className: "bg-surface border border-border rounded-xl p-4", children: [
2348
+ /* @__PURE__ */ m("div", { className: "flex flex-wrap items-start justify-between gap-2 mb-3", children: [
2349
+ /* @__PURE__ */ m("div", { children: [
2350
+ /* @__PURE__ */ o("h3", { className: "text-sm font-semibold text-heading", children: e }),
2351
+ t && /* @__PURE__ */ o("div", { className: "text-[11px] text-subtle mt-0.5", children: t })
2352
+ ] }),
2353
+ r
2354
+ ] }),
2355
+ n && /* @__PURE__ */ o("div", { className: "mb-2", children: n }),
2356
+ s
2357
+ ] });
2358
+ }
2359
+ const ce = 44, Nn = 18;
2360
+ function Cr({ times: e, series: t, formatValue: n, formatTime: r, formatTick: s, height: i = 120, minMax: a = 0, integer: l = !1, ariaLabel: u }) {
2361
+ const [c, p] = dt(), [d, S] = T(null), k = Math.max(0, p - ce - 8), g = i - Nn, v = t.flatMap((f) => f.values.filter((A) => A !== null)), { max: N, ticks: C } = pt(Math.max(a, ...v, 0), l), b = e[0] ?? 0, y = e[e.length - 1] ?? 1, M = Math.max(1, y - b), L = (f) => ce + (f - b) / M * k, P = (f) => g - f / N * g, x = (f) => {
2362
+ let A = "", R = !1;
2363
+ return f.forEach((q, I) => {
2364
+ if (q === null) {
2365
+ R = !1;
2366
+ return;
2367
+ }
2368
+ A += `${R ? "L" : "M"}${L(e[I]).toFixed(1)},${P(q).toFixed(1)}`, R = !0;
2369
+ }), A;
2370
+ }, D = (f) => {
2371
+ if (e.length === 0) return;
2372
+ const A = f.currentTarget.getBoundingClientRect(), R = b + (f.clientX - A.left) / Math.max(1, A.width) * M;
2373
+ let q = 0;
2374
+ e.forEach((I, z) => {
2375
+ Math.abs(I - R) < Math.abs(e[q] - R) && (q = z);
2376
+ }), S(q);
2377
+ }, w = e.length < 2 ? [] : M < 4 * 6e4 ? [b, y] : [0, 1, 2, 3].map((f) => b + M * f / 3);
2378
+ return /* @__PURE__ */ m("div", { ref: c, className: "relative select-none", onPointerLeave: () => S(null), children: [
2379
+ p > 0 && e.length > 0 && /* @__PURE__ */ m("svg", { width: p, height: i, role: "img", "aria-label": u, className: "block overflow-visible", children: [
2380
+ C.map((f) => /* @__PURE__ */ m("g", { children: [
2381
+ /* @__PURE__ */ o("line", { x1: ce, x2: p, y1: P(f), y2: P(f), stroke: "var(--qcli-border)", strokeWidth: 1, shapeRendering: "crispEdges" }),
2382
+ /* @__PURE__ */ o("text", { x: ce - 8, y: P(f), dy: "0.32em", textAnchor: "end", className: "fill-subtle text-[10px] tabular-nums", children: n(f) })
2383
+ ] }, f)),
2384
+ w.map((f, A) => /* @__PURE__ */ o(
2385
+ "text",
2386
+ {
2387
+ x: L(f),
2388
+ y: i - 3,
2389
+ textAnchor: A === 0 ? "start" : A === w.length - 1 ? "end" : "middle",
2390
+ className: "fill-subtle text-[10px]",
2391
+ children: s(f)
2392
+ },
2393
+ f
2394
+ )),
2395
+ t.length === 1 && x(t[0].values) && /* @__PURE__ */ o(
2396
+ "path",
2397
+ {
2398
+ d: `${x(t[0].values)}V${g}H${L(e.find((f, A) => t[0].values[A] !== null) ?? b)}Z`,
2399
+ fill: t[0].color,
2400
+ opacity: 0.1
2401
+ }
2402
+ ),
2403
+ t.filter((f) => x(f.values)).map((f) => /* @__PURE__ */ o("path", { d: x(f.values), fill: "none", stroke: f.color, strokeWidth: 2, strokeLinejoin: "round", strokeLinecap: "round" }, f.key)),
2404
+ t.map((f) => {
2405
+ const A = f.values.length - 1, R = f.values[A];
2406
+ return R == null ? null : /* @__PURE__ */ o("circle", { cx: L(e[A]), cy: P(R), r: 4, fill: f.color, stroke: "var(--qcli-background)", strokeWidth: 2 }, f.key);
2407
+ }),
2408
+ d !== null && /* @__PURE__ */ m("g", { children: [
2409
+ /* @__PURE__ */ o("line", { x1: L(e[d]), x2: L(e[d]), y1: 0, y2: g, stroke: "var(--qcli-muted)", strokeWidth: 1, shapeRendering: "crispEdges" }),
2410
+ t.map((f) => f.values[d] === null ? null : /* @__PURE__ */ o("circle", { cx: L(e[d]), cy: P(f.values[d]), r: 4, fill: f.color, stroke: "var(--qcli-background)", strokeWidth: 2 }, f.key))
2411
+ ] }),
2412
+ /* @__PURE__ */ o("rect", { x: ce, y: 0, width: k, height: g, fill: "transparent", onPointerMove: D, onPointerDown: D })
2413
+ ] }),
2414
+ d !== null && /* @__PURE__ */ o(
2415
+ mt,
2416
+ {
2417
+ x: L(e[d]),
2418
+ y: Math.min(...t.map((f) => f.values[d] === null ? g : P(f.values[d]))),
2419
+ width: p,
2420
+ title: r(e[d]),
2421
+ rows: t.map((f) => ({ label: f.label, value: f.values[d] === null ? "—" : n(f.values[d]), color: f.color }))
2422
+ }
2423
+ )
2424
+ ] });
2425
+ }
2426
+ const Q = 44, Pn = 20, Ue = 2, Sn = 24, Cn = 2;
2427
+ function kr({
2428
+ columns: e,
2429
+ xTicks: t,
2430
+ formatValue: n,
2431
+ integer: r = !1,
2432
+ height: s = 180,
2433
+ selectedKey: i = null,
2434
+ onSelect: a,
2435
+ stale: l = !1,
2436
+ ariaLabel: u
2437
+ }) {
2438
+ const [c, p] = dt(), [d, S] = T(null), k = Math.max(0, p - Q), g = s - Pn, v = e.map((x) => x.segments.reduce((D, w) => D + w.value, 0)), { max: N, ticks: C } = pt(Math.max(0, ...v), r), b = e.length ? k / e.length : 0, y = Math.max(1, Math.min(Sn, b - Ue)), M = (x) => g - x / N * g, L = d !== null ? e[d] : void 0, P = d !== null ? M(v[d]) : 0;
2439
+ return /* @__PURE__ */ m(
2440
+ "div",
2441
+ {
2442
+ ref: c,
2443
+ className: `relative select-none transition-opacity ${l ? "opacity-50" : ""}`,
2444
+ onPointerLeave: () => S(null),
2445
+ children: [
2446
+ p > 0 && /* @__PURE__ */ m("svg", { width: p, height: s, role: "group", "aria-label": u, className: "block overflow-visible", children: [
2447
+ C.map((x) => /* @__PURE__ */ m("g", { children: [
2448
+ /* @__PURE__ */ o(
2449
+ "line",
2450
+ {
2451
+ x1: Q,
2452
+ x2: p,
2453
+ y1: M(x),
2454
+ y2: M(x),
2455
+ stroke: "var(--qcli-border)",
2456
+ strokeWidth: 1,
2457
+ shapeRendering: "crispEdges"
2458
+ }
2459
+ ),
2460
+ /* @__PURE__ */ o(
2461
+ "text",
2462
+ {
2463
+ x: Q - 8,
2464
+ y: M(x),
2465
+ dy: "0.32em",
2466
+ textAnchor: "end",
2467
+ className: "fill-subtle text-[10px] tabular-nums",
2468
+ children: n(x)
2469
+ }
2470
+ )
2471
+ ] }, x)),
2472
+ e.map((x, D) => {
2473
+ const w = Q + D * b + (b - y) / 2, f = i === x.key, A = i !== null && !f;
2474
+ let R = g;
2475
+ const q = x.segments.filter((I) => I.value > 0);
2476
+ return /* @__PURE__ */ m(
2477
+ "g",
2478
+ {
2479
+ tabIndex: 0,
2480
+ role: "button",
2481
+ "aria-label": x.ariaLabel,
2482
+ "aria-pressed": a ? f : void 0,
2483
+ className: "outline-none focus-visible:[&>rect.hit]:stroke-[var(--qcli-primary)]",
2484
+ style: { cursor: a ? "pointer" : "default" },
2485
+ onPointerEnter: () => S(D),
2486
+ onFocus: () => S(D),
2487
+ onBlur: () => S(null),
2488
+ onClick: () => a == null ? void 0 : a(f ? null : x.key),
2489
+ onKeyDown: (I) => {
2490
+ (I.key === "Enter" || I.key === " ") && (I.preventDefault(), a == null || a(f ? null : x.key));
2491
+ },
2492
+ children: [
2493
+ /* @__PURE__ */ o(
2494
+ "rect",
2495
+ {
2496
+ className: "hit",
2497
+ x: Q + D * b,
2498
+ y: 0,
2499
+ width: b,
2500
+ height: g,
2501
+ fill: d === D || f ? "var(--qcli-control)" : "transparent",
2502
+ stroke: "transparent",
2503
+ strokeWidth: 1,
2504
+ rx: 4
2505
+ }
2506
+ ),
2507
+ q.map((I, z) => {
2508
+ const we = z === q.length - 1, _ = Math.max(Cn, I.value / N * g), G = Math.max(1, z > 0 ? _ - Ue : _);
2509
+ return R -= _, /* @__PURE__ */ o(
2510
+ "path",
2511
+ {
2512
+ d: wn(w, R, y, G, we),
2513
+ fill: I.color,
2514
+ opacity: A ? 0.35 : 1
2515
+ },
2516
+ I.key
2517
+ );
2518
+ })
2519
+ ]
2520
+ },
2521
+ x.key
2522
+ );
2523
+ }),
2524
+ /* @__PURE__ */ o(
2525
+ "line",
2526
+ {
2527
+ x1: Q,
2528
+ x2: p,
2529
+ y1: g,
2530
+ y2: g,
2531
+ stroke: "var(--qcli-border)",
2532
+ strokeWidth: 1,
2533
+ shapeRendering: "crispEdges"
2534
+ }
2535
+ ),
2536
+ t.map((x) => /* @__PURE__ */ o(
2537
+ "text",
2538
+ {
2539
+ x: Q + (x.index + 0.5) * b,
2540
+ y: s - 4,
2541
+ textAnchor: "middle",
2542
+ className: "fill-subtle text-[10px]",
2543
+ children: x.label
2544
+ },
2545
+ x.index
2546
+ ))
2547
+ ] }),
2548
+ L && /* @__PURE__ */ o(
2549
+ mt,
2550
+ {
2551
+ x: Q + (d + 0.5) * b,
2552
+ y: P,
2553
+ width: p,
2554
+ title: L.title,
2555
+ rows: L.rows
2556
+ }
2557
+ )
2558
+ ]
2559
+ }
2560
+ );
2561
+ }
2562
+ function kn(e) {
2563
+ try {
2564
+ return localStorage.getItem(e);
2565
+ } catch {
2566
+ return null;
2567
+ }
2568
+ }
2569
+ function Mn(e, t) {
2570
+ try {
2571
+ localStorage.setItem(e, t);
2572
+ } catch {
2573
+ }
2574
+ }
2575
+ function An(e, t, n) {
2576
+ const [r, s] = T(() => {
2577
+ const a = kn(e);
2578
+ return (a !== null ? t(a) : null) ?? n();
2579
+ }), i = V((a) => {
2580
+ s(a), Mn(e, String(a));
2581
+ }, [e]);
2582
+ return [r, i];
2583
+ }
2584
+ function Mr(e, t) {
2585
+ const [n, r] = An(e, sn, () => an), [s, i] = T(0), [a, l] = T(t);
2586
+ return a !== t && (l(t), i(0)), { page: a === t ? s : 0, setPage: i, pageSize: n, setPageSize: (c) => {
2587
+ r(c), i(0);
2588
+ } };
2589
+ }
2590
+ function Ar(e, t = []) {
2591
+ const [n, r] = T(null), [s, i] = T(!0), [a, l] = T(null), u = E(0), c = V(async (S) => {
2592
+ const k = ++u.current;
2593
+ S !== !0 && (i(!0), l(null));
2594
+ try {
2595
+ const g = await e();
2596
+ k === u.current && (r(g), l(null));
2597
+ } catch (g) {
2598
+ k === u.current && l(g instanceof Error ? g.message : "Failed to fetch");
2599
+ } finally {
2600
+ k === u.current && i(!1);
2601
+ }
2602
+ }, t);
2603
+ B(() => {
2604
+ c();
2605
+ }, [c]);
2606
+ const p = V(() => {
2607
+ c();
2608
+ }, [c]), d = V(() => {
2609
+ c(!0);
2610
+ }, [c]);
2611
+ return { data: n, loading: s, error: a, refetch: p, refresh: d };
2612
+ }
2613
+ export {
2614
+ Ht as ApiError,
2615
+ Xn as Badge,
2616
+ Qn as ButtonGroup,
2617
+ Jt as CHIP_CLASS,
2618
+ Sr as ChartCard,
2619
+ Pr as ChartLegend,
2620
+ mt as ChartTooltip,
2621
+ Yn as ChipList,
2622
+ kr as ColumnChart,
2623
+ tn as ConfirmDialog,
2624
+ Tr as DARK_COLORS,
2625
+ an as DEFAULT_PAGE_SIZE,
2626
+ Or as DEFAULT_THEME,
2627
+ nr as DataTable,
2628
+ vr as DeleteIcon,
2629
+ gr as DetailsIcon,
2630
+ yr as DownloadIcon,
2631
+ Kt as DropdownMenu,
2632
+ yt as EXTENSION_SCOPE,
2633
+ un as EmptyState,
2634
+ Ae as ErrorBoundary,
2635
+ tr as ErrorState,
2636
+ jn as ExtensionLink,
2637
+ Ct as HTTP_REASON_PHRASES,
2638
+ Dn as JOB_STATE_RELOAD_DELAY,
2639
+ Je as KitProvider,
2640
+ $r as LIGHT_COLORS,
2641
+ Pt as LIVE_RELOAD_DELAY,
2642
+ bt as LOCALES,
2643
+ Cr as LineChart,
2644
+ br as LogsIcon,
2645
+ He as MENU_SEPARATOR,
2646
+ Rt as MissingServerPlugin,
2647
+ st as Modal,
2648
+ ar as MonoPanel,
2649
+ rr as MultiSelect,
2650
+ dn as NoAccessState,
2651
+ be as PAGE_SIZES,
2652
+ sr as PageHeader,
2653
+ or as Pagination,
2654
+ Ft as RequireServerPlugin,
2655
+ wr as RevokeIcon,
2656
+ xr as RunAgainIcon,
2657
+ Xt as SWIPE_CLOSE_DISTANCE,
2658
+ gn as Select,
2659
+ H as Skeleton,
2660
+ pr as SkeletonChartCard,
2661
+ re as SkeletonGroup,
2662
+ mr as SkeletonList,
2663
+ hr as SkeletonPage,
2664
+ ur as SkeletonStatCard,
2665
+ cr as SkeletonStatCards,
2666
+ dr as SkeletonTable,
2667
+ lr as SkeletonText,
2668
+ at as Spinner,
2669
+ ir as StatCard,
2670
+ Ir as THEME_TOKENS,
2671
+ fr as Tooltip,
2672
+ Tt as accessDenied,
2673
+ Le as clampPage,
2674
+ qt as createApi,
2675
+ jt as createTranslations,
2676
+ Dr as cssVarName,
2677
+ Fn as defineExtension,
2678
+ In as defineMessages,
2679
+ Me as errorText,
2680
+ Y as firstEnabled,
2681
+ We as focusableIn,
2682
+ Gn as formatBytes,
2683
+ At as htmlErrorText,
2684
+ Ce as httpStatusText,
2685
+ kt as isHtml,
2686
+ xt as isLocale,
2687
+ Ot as isMissingApi,
2688
+ Jn as isSwipeLeft,
2689
+ Se as isTypeaheadKey,
2690
+ Oe as kitMessages,
2691
+ ae as lastEnabled,
2692
+ Rn as matchesEventPattern,
2693
+ Bt as mountConfigEditor,
2694
+ ue as nextEnabled,
2695
+ pt as niceScale,
2696
+ ve as overlayRoot,
2697
+ it as pageCount,
2698
+ ln as pageRange,
2699
+ cn as pageSlice,
2700
+ sn as parsePageSize,
2701
+ kn as readStored,
2702
+ Lt as responseErrorText,
2703
+ wt as scopeOverlays,
2704
+ It as serverPluginMarketplaceHref,
2705
+ Kn as shortDuration,
2706
+ on as sortRows,
2707
+ Nr as spreadTicks,
2708
+ Un as tagColorDeclarations,
2709
+ Vn as tagStyle,
2710
+ Zt as trapFocusTarget,
2711
+ qn as useApi,
2712
+ Ar as useAsync,
2713
+ Nt as useBodyScrollLock,
2714
+ er as useConfirm,
2715
+ Z as useConsole,
2716
+ Bn as useDashboard,
2717
+ tt as useDismiss,
2718
+ dt as useElementWidth,
2719
+ Hn as useExtensionConfig,
2720
+ zt as useExtensionHref,
2721
+ Ye as useKitLocale,
2722
+ j as useKitText,
2723
+ zn as useLiveReload,
2724
+ St as useLiveReloadFrom,
2725
+ Mr as usePaging,
2726
+ et as usePopoverPosition,
2727
+ _n as useQueryParams,
2728
+ Wn as useServerEvents,
2729
+ An as useStoredState,
2730
+ Zn as useTranslations,
2731
+ nt as useTypeahead,
2732
+ $t as watchMissingApi,
2733
+ Mn as writeStored
2734
+ };
2735
+ //# sourceMappingURL=index.js.map