@openrails/contentkit-ui 0.85.1 → 0.87.0-rc.1

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 (211) hide show
  1. package/README.md +28 -7
  2. package/dist/client/beacons.d.ts +13 -4
  3. package/dist/client/beacons.js +14 -7
  4. package/dist/client/beacons.js.map +1 -1
  5. package/dist/client/client.d.ts +3 -0
  6. package/dist/client/client.js +29 -27
  7. package/dist/client/client.js.map +1 -1
  8. package/dist/client/codes.d.ts +6 -1
  9. package/dist/client/codes.js +4 -1
  10. package/dist/client/codes.js.map +1 -1
  11. package/dist/client/content/types.d.ts +4 -2
  12. package/dist/client/content/types.js.map +1 -1
  13. package/dist/client/discovery.js +3 -0
  14. package/dist/client/discovery.js.map +1 -1
  15. package/dist/client/errors.d.ts +6 -0
  16. package/dist/client/errors.js +6 -2
  17. package/dist/client/errors.js.map +1 -1
  18. package/dist/client/gallery.d.ts +3 -5
  19. package/dist/client/gallery.js +16 -20
  20. package/dist/client/gallery.js.map +1 -1
  21. package/dist/client/generated/error-codes.d.ts +1 -1
  22. package/dist/client/generated/error-codes.js +9 -1
  23. package/dist/client/generated/error-codes.js.map +1 -1
  24. package/dist/client/generated/routes.d.ts +29 -3
  25. package/dist/client/generated/routes.js +44 -3
  26. package/dist/client/generated/routes.js.map +1 -1
  27. package/dist/client/generated/wire.d.ts +60 -10
  28. package/dist/client/generated/wire.js.map +1 -1
  29. package/dist/client/index.d.ts +2 -1
  30. package/dist/client/media/queue.d.ts +4 -2
  31. package/dist/client/media/queue.js +18 -12
  32. package/dist/client/media/queue.js.map +1 -1
  33. package/dist/client/media/rules.d.ts +7 -1
  34. package/dist/client/media/rules.js +27 -21
  35. package/dist/client/media/rules.js.map +1 -1
  36. package/dist/client/media/windows.js +1 -1
  37. package/dist/client/media/windows.js.map +1 -1
  38. package/dist/client/stats.d.ts +32 -0
  39. package/dist/client/stats.js +35 -0
  40. package/dist/client/stats.js.map +1 -0
  41. package/dist/client/versions.d.ts +6 -4
  42. package/dist/client/versions.js +24 -26
  43. package/dist/client/versions.js.map +1 -1
  44. package/dist/client.js +30 -29
  45. package/dist/components/admin/content-manager.js +206 -206
  46. package/dist/components/admin/content-manager.js.map +1 -1
  47. package/dist/components/admin/group-manager.js +71 -70
  48. package/dist/components/admin/group-manager.js.map +1 -1
  49. package/dist/components/admin/media-item-panel.d.ts +24 -7
  50. package/dist/components/admin/media-item-panel.js +209 -197
  51. package/dist/components/admin/media-item-panel.js.map +1 -1
  52. package/dist/components/admin/poll-manager.js +25 -25
  53. package/dist/components/admin/stats-dashboard.d.ts +22 -0
  54. package/dist/components/admin/stats-dashboard.js +257 -0
  55. package/dist/components/admin/stats-dashboard.js.map +1 -0
  56. package/dist/components/content/card.d.ts +5 -3
  57. package/dist/components/content/card.js +155 -133
  58. package/dist/components/content/card.js.map +1 -1
  59. package/dist/components/content/download-button.d.ts +26 -0
  60. package/dist/components/content/download-button.js +51 -0
  61. package/dist/components/content/download-button.js.map +1 -0
  62. package/dist/components/content/editors.js +455 -427
  63. package/dist/components/content/editors.js.map +1 -1
  64. package/dist/components/content/grid.d.ts +8 -1
  65. package/dist/components/content/grid.js +153 -104
  66. package/dist/components/content/grid.js.map +1 -1
  67. package/dist/components/content/index.d.ts +4 -2
  68. package/dist/components/content/listing.d.ts +3 -1
  69. package/dist/components/content/listing.js +34 -34
  70. package/dist/components/content/listing.js.map +1 -1
  71. package/dist/components/content/paywall.d.ts +17 -5
  72. package/dist/components/content/paywall.js +115 -100
  73. package/dist/components/content/paywall.js.map +1 -1
  74. package/dist/components/content/reader-stats.d.ts +12 -0
  75. package/dist/components/content/reader-stats.js +47 -0
  76. package/dist/components/content/reader-stats.js.map +1 -0
  77. package/dist/components/groups/banner.js +33 -33
  78. package/dist/components/groups/directory.js +11 -11
  79. package/dist/components/groups/editor.js +293 -293
  80. package/dist/components/groups/editor.js.map +1 -1
  81. package/dist/components/groups/header.js +27 -27
  82. package/dist/components/groups/header.js.map +1 -1
  83. package/dist/components/groups/memberships.js +180 -180
  84. package/dist/components/groups/parts.d.ts +0 -2
  85. package/dist/components/groups/parts.js +9 -27
  86. package/dist/components/groups/parts.js.map +1 -1
  87. package/dist/components/media-folder-editor.js +239 -189
  88. package/dist/components/media-folder-editor.js.map +1 -1
  89. package/dist/components/media-gallery.d.ts +1 -4
  90. package/dist/components/media-gallery.js +19 -34
  91. package/dist/components/media-gallery.js.map +1 -1
  92. package/dist/components/notifications.js +17 -17
  93. package/dist/components/slot-upload.d.ts +2 -2
  94. package/dist/components/slot-upload.js +84 -79
  95. package/dist/components/slot-upload.js.map +1 -1
  96. package/dist/components/social/bans.js +34 -34
  97. package/dist/components/social/comments.js +1 -1
  98. package/dist/components/social/comments.js.map +1 -1
  99. package/dist/components/social/engagement.d.ts +2 -1
  100. package/dist/components/social/engagement.js +5 -3
  101. package/dist/components/social/engagement.js.map +1 -1
  102. package/dist/components/social/moderation.js +52 -48
  103. package/dist/components/social/moderation.js.map +1 -1
  104. package/dist/components/video-player.d.ts +2 -0
  105. package/dist/components/video-player.js +318 -314
  106. package/dist/components/video-player.js.map +1 -1
  107. package/dist/i18n/context.d.ts +2 -0
  108. package/dist/i18n/context.js +23 -5
  109. package/dist/i18n/context.js.map +1 -1
  110. package/dist/index.d.ts +2 -1
  111. package/dist/index.js +13 -10
  112. package/dist/locales/admin/de.js +27 -0
  113. package/dist/locales/admin/de.js.map +1 -1
  114. package/dist/locales/admin/en.d.ts +27 -0
  115. package/dist/locales/admin/en.js +27 -0
  116. package/dist/locales/admin/en.js.map +1 -1
  117. package/dist/locales/admin/es.js +27 -0
  118. package/dist/locales/admin/es.js.map +1 -1
  119. package/dist/locales/admin/ja.js +27 -0
  120. package/dist/locales/admin/ja.js.map +1 -1
  121. package/dist/locales/admin/ko.js +27 -0
  122. package/dist/locales/admin/ko.js.map +1 -1
  123. package/dist/locales/admin/zh.js +27 -0
  124. package/dist/locales/admin/zh.js.map +1 -1
  125. package/dist/locales/content/de.js +6 -0
  126. package/dist/locales/content/de.js.map +1 -1
  127. package/dist/locales/content/en.d.ts +6 -0
  128. package/dist/locales/content/en.js +6 -0
  129. package/dist/locales/content/en.js.map +1 -1
  130. package/dist/locales/content/es.js +6 -0
  131. package/dist/locales/content/es.js.map +1 -1
  132. package/dist/locales/content/ja.js +6 -0
  133. package/dist/locales/content/ja.js.map +1 -1
  134. package/dist/locales/content/ko.js +6 -0
  135. package/dist/locales/content/ko.js.map +1 -1
  136. package/dist/locales/content/zh.js +6 -0
  137. package/dist/locales/content/zh.js.map +1 -1
  138. package/dist/locales/de.js +14 -2
  139. package/dist/locales/de.js.map +1 -1
  140. package/dist/locales/discovery/de.js +3 -0
  141. package/dist/locales/discovery/de.js.map +1 -1
  142. package/dist/locales/discovery/en.d.ts +3 -0
  143. package/dist/locales/discovery/en.js +3 -0
  144. package/dist/locales/discovery/en.js.map +1 -1
  145. package/dist/locales/discovery/es.js +3 -0
  146. package/dist/locales/discovery/es.js.map +1 -1
  147. package/dist/locales/discovery/ja.js +3 -0
  148. package/dist/locales/discovery/ja.js.map +1 -1
  149. package/dist/locales/discovery/ko.js +3 -0
  150. package/dist/locales/discovery/ko.js.map +1 -1
  151. package/dist/locales/discovery/zh.js +3 -0
  152. package/dist/locales/discovery/zh.js.map +1 -1
  153. package/dist/locales/en.d.ts +50 -2
  154. package/dist/locales/en.js +14 -2
  155. package/dist/locales/en.js.map +1 -1
  156. package/dist/locales/es.js +14 -2
  157. package/dist/locales/es.js.map +1 -1
  158. package/dist/locales/ja.js +14 -2
  159. package/dist/locales/ja.js.map +1 -1
  160. package/dist/locales/ko.js +14 -2
  161. package/dist/locales/ko.js.map +1 -1
  162. package/dist/locales/zh.js +14 -2
  163. package/dist/locales/zh.js.map +1 -1
  164. package/dist/react/admin.js +22 -23
  165. package/dist/react/admin.js.map +1 -1
  166. package/dist/react/canonical.d.ts +4 -3
  167. package/dist/react/canonical.js +34 -33
  168. package/dist/react/canonical.js.map +1 -1
  169. package/dist/react/comments.d.ts +1 -1
  170. package/dist/react/comments.js +3 -2
  171. package/dist/react/comments.js.map +1 -1
  172. package/dist/react/contents.js +144 -144
  173. package/dist/react/contents.js.map +1 -1
  174. package/dist/react/context.d.ts +1 -1
  175. package/dist/react/context.js.map +1 -1
  176. package/dist/react/detail.d.ts +12 -6
  177. package/dist/react/detail.js +31 -24
  178. package/dist/react/detail.js.map +1 -1
  179. package/dist/react/discovery.d.ts +11 -0
  180. package/dist/react/discovery.js +49 -30
  181. package/dist/react/discovery.js.map +1 -1
  182. package/dist/react/engagement.d.ts +6 -2
  183. package/dist/react/engagement.js +2 -6
  184. package/dist/react/engagement.js.map +1 -1
  185. package/dist/react/folder.d.ts +7 -2
  186. package/dist/react/folder.js +165 -147
  187. package/dist/react/folder.js.map +1 -1
  188. package/dist/react/groups.d.ts +0 -1
  189. package/dist/react/groups.js +13 -12
  190. package/dist/react/groups.js.map +1 -1
  191. package/dist/react/index.d.ts +6 -4
  192. package/dist/react/location.d.ts +11 -0
  193. package/dist/react/location.js +18 -0
  194. package/dist/react/location.js.map +1 -0
  195. package/dist/react/public.d.ts +8 -0
  196. package/dist/react/public.js +32 -27
  197. package/dist/react/public.js.map +1 -1
  198. package/dist/react/stats.d.ts +24 -0
  199. package/dist/react/stats.js +28 -0
  200. package/dist/react/stats.js.map +1 -0
  201. package/dist/react/use-resource.js +8 -7
  202. package/dist/react/use-resource.js.map +1 -1
  203. package/dist/react/versions.d.ts +25 -5
  204. package/dist/react/versions.js +61 -40
  205. package/dist/react/versions.js.map +1 -1
  206. package/dist/react.js +26 -24
  207. package/dist/styles.css +1 -1
  208. package/dist/urls/index.d.ts +35 -10
  209. package/dist/urls.js +100 -70
  210. package/dist/urls.js.map +1 -1
  211. package/package.json +1 -1
@@ -1,19 +1,19 @@
1
1
  import { toContentKitError as e } from "../../client/errors.js";
2
- import { useMessages as t } from "../../i18n/context.js";
3
- import { ContentKitUiRoot as n } from "../../scope.js";
4
- import { useContentKitClient as r } from "../../react/context.js";
5
- import { Button as i } from "../../ui/button.js";
6
- import { Dialog as a, DialogContent as o, DialogDescription as s, DialogFooter as c, DialogHeader as l, DialogTitle as u } from "../../ui/dialog.js";
7
- import { Badge as d } from "../../ui/badge.js";
8
- import { Input as f } from "../../ui/input.js";
9
- import { Label as p } from "../../ui/label.js";
10
- import { Select as m, SelectContent as h, SelectItem as g, SelectTrigger as _, SelectValue as v } from "../../ui/select.js";
11
- import { Skeleton as y } from "../../ui/skeleton.js";
12
- import { Textarea as b } from "../../ui/textarea.js";
13
- import { ErrorLine as x, contentError as S, useAction as C } from "../social/parts.js";
14
- import { parseAttributes as w, slugify as T } from "../../client/group-fields.js";
15
- import { useGroup as E, useKinds as D } from "../../react/groups.js";
16
- import { GroupPicker as O, labelOf as k, useGroupNames as A, useLanguageName as j } from "./parts.js";
2
+ import { useLanguageName as t, useMessages as n } from "../../i18n/context.js";
3
+ import { ContentKitUiRoot as r } from "../../scope.js";
4
+ import { useContentKitClient as i } from "../../react/context.js";
5
+ import { useGroup as a, useKinds as o } from "../../react/groups.js";
6
+ import { Button as s } from "../../ui/button.js";
7
+ import { Dialog as c, DialogContent as l, DialogDescription as u, DialogFooter as d, DialogHeader as f, DialogTitle as p } from "../../ui/dialog.js";
8
+ import { Badge as m } from "../../ui/badge.js";
9
+ import { Input as h } from "../../ui/input.js";
10
+ import { Label as g } from "../../ui/label.js";
11
+ import { Select as _, SelectContent as v, SelectItem as y, SelectTrigger as b, SelectValue as x } from "../../ui/select.js";
12
+ import { Skeleton as S } from "../../ui/skeleton.js";
13
+ import { Textarea as C } from "../../ui/textarea.js";
14
+ import { ErrorLine as w, contentError as T, useAction as E } from "../social/parts.js";
15
+ import { parseAttributes as D, slugify as O } from "../../client/group-fields.js";
16
+ import { GroupPicker as k, labelOf as A, useGroupNames as j } from "./parts.js";
17
17
  import { OfferFields as M } from "../content/offer-fields.js";
18
18
  import { AttributeFields as N, formOf as P } from "./fields.js";
19
19
  import { GroupImageEditor as F } from "./banner.js";
@@ -22,45 +22,45 @@ import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
22
22
  import { cn as W } from "cn";
23
23
  //#region src/components/groups/editor.tsx
24
24
  function G(e) {
25
- let { t: r } = t(), { kinds: a, loading: o } = D({ client: e.client }), s = E(e.id, { client: e.client }), c = e.languages ?? a?.languages ?? ["en"], l = s.group?.kind ?? e.kind, u = a?.group_kinds?.[l] ?? {}, d = (t) => /* @__PURE__ */ H(n, {
25
+ let { t } = n(), { kinds: i, loading: c } = o({ client: e.client }), l = a(e.id, { client: e.client }), u = e.languages ?? i?.languages ?? ["en"], d = l.group?.kind ?? e.kind, f = i?.group_kinds?.[d] ?? {}, p = (t) => /* @__PURE__ */ H(r, {
26
26
  appearance: e.appearance,
27
27
  className: W("grid gap-6 text-sm", e.className),
28
28
  "data-ckui": "group-editor",
29
- "data-kind": l,
29
+ "data-kind": d,
30
30
  children: t
31
31
  });
32
- if (o) return d(/* @__PURE__ */ H(y, { className: "h-40 w-full" }));
33
- if (!e.id && !s.group && !s.loading) return d(/* @__PURE__ */ H(Q, {
32
+ if (c) return p(/* @__PURE__ */ H(S, { className: "h-40 w-full" }));
33
+ if (!e.id && !l.group && !l.loading) return p(/* @__PURE__ */ H(Q, {
34
34
  ...e,
35
- kind: l,
36
- spec: u,
37
- languages: c,
38
- g: s
35
+ kind: d,
36
+ spec: f,
37
+ languages: u,
38
+ g: l
39
39
  }));
40
- if (s.deleted) return d(/* @__PURE__ */ H(J, {
41
- group: s.deleted,
42
- onRestore: () => s.restore(),
40
+ if (l.deleted) return p(/* @__PURE__ */ H(J, {
41
+ group: l.deleted,
42
+ onRestore: () => l.restore(),
43
43
  onError: e.onError,
44
- name: s.deleted.slug
44
+ name: l.deleted.slug
45
45
  }));
46
- if (!s.group) return s.error ? d(/* @__PURE__ */ U("div", {
46
+ if (!l.group) return l.error ? p(/* @__PURE__ */ U("div", {
47
47
  role: "alert",
48
48
  className: "grid justify-items-start gap-2",
49
49
  children: [/* @__PURE__ */ H("p", {
50
50
  className: "text-destructive",
51
- children: r("groupEditor.loadFailed")
52
- }), /* @__PURE__ */ H(i, {
51
+ children: t("groupEditor.loadFailed")
52
+ }), /* @__PURE__ */ H(s, {
53
53
  size: "sm",
54
54
  variant: "outline",
55
- onClick: s.reload,
56
- children: r("common.retry")
55
+ onClick: l.reload,
56
+ children: t("common.retry")
57
57
  })]
58
- })) : d(/* @__PURE__ */ H(y, { className: "h-40 w-full" }));
59
- let f = s.group;
60
- return d(/* @__PURE__ */ U(V, { children: [
58
+ })) : p(/* @__PURE__ */ H(S, { className: "h-40 w-full" }));
59
+ let m = l.group;
60
+ return p(/* @__PURE__ */ U(V, { children: [
61
61
  /* @__PURE__ */ H(Y, {
62
- group: f,
63
- g: s,
62
+ group: m,
63
+ g: l,
64
64
  labels: e.labels,
65
65
  onMerged: e.onMerged,
66
66
  onDeleted: e.onDeleted,
@@ -68,45 +68,45 @@ function G(e) {
68
68
  client: e.client
69
69
  }),
70
70
  /* @__PURE__ */ H($, {
71
- group: f,
72
- spec: u,
73
- g: s,
71
+ group: m,
72
+ spec: f,
73
+ g: l,
74
74
  labels: e.labels,
75
75
  onError: e.onError,
76
76
  client: e.client
77
- }, f.id),
77
+ }, m.id),
78
78
  /* @__PURE__ */ H(ee, {
79
- group: f,
80
- g: s,
81
- languages: c,
79
+ group: m,
80
+ g: l,
81
+ languages: u,
82
82
  onError: e.onError
83
83
  }),
84
84
  /* @__PURE__ */ H(te, {
85
- group: f,
86
- g: s,
87
- languages: c,
85
+ group: m,
86
+ g: l,
87
+ languages: u,
88
88
  onError: e.onError
89
- }, f.id),
89
+ }, m.id),
90
90
  /* @__PURE__ */ H(ne, {
91
- group: f,
92
- spec: u,
91
+ group: m,
92
+ spec: f,
93
93
  onError: e.onError,
94
94
  client: e.client
95
95
  }),
96
- u.sellable && /* @__PURE__ */ H(re, {
97
- group: f,
96
+ f.sellable && /* @__PURE__ */ H(re, {
97
+ group: m,
98
98
  onError: e.onError,
99
99
  client: e.client
100
100
  }),
101
101
  /* @__PURE__ */ H(ae, {
102
- group: f,
103
- g: s,
104
- kinds: a,
102
+ group: m,
103
+ g: l,
104
+ kinds: i,
105
105
  labels: e.labels,
106
106
  onError: e.onError,
107
107
  client: e.client
108
108
  }),
109
- e.children?.(f)
109
+ e.children?.(m)
110
110
  ] }));
111
111
  }
112
112
  function K(e, t) {
@@ -136,27 +136,27 @@ function q({ title: e, children: t, ckui: n, action: r }) {
136
136
  }), t]
137
137
  });
138
138
  }
139
- function J({ group: e, name: n, onRestore: r, onError: a }) {
140
- let { t: o } = t(), s = C("group.save", a);
139
+ function J({ group: e, name: t, onRestore: r, onError: i }) {
140
+ let { t: a } = n(), o = E("group.save", i);
141
141
  return /* @__PURE__ */ U("div", {
142
142
  className: "grid justify-items-start gap-2",
143
143
  "data-ckui": "group-deleted",
144
144
  "data-state": e.state,
145
145
  children: [
146
- /* @__PURE__ */ H("p", { children: o("groupEditor.deletedNotice", { name: n }) }),
147
- /* @__PURE__ */ H(i, {
146
+ /* @__PURE__ */ H("p", { children: a("groupEditor.deletedNotice", { name: t }) }),
147
+ /* @__PURE__ */ H(s, {
148
148
  size: "sm",
149
149
  variant: "outline",
150
- disabled: s.pending,
151
- onClick: () => void s.run(r),
152
- children: o("groupEditor.restore")
150
+ disabled: o.pending,
151
+ onClick: () => void o.run(r),
152
+ children: a("groupEditor.restore")
153
153
  }),
154
- /* @__PURE__ */ H(x, { error: s.error })
154
+ /* @__PURE__ */ H(w, { error: o.error })
155
155
  ]
156
156
  });
157
157
  }
158
- function Y({ group: e, g: n, labels: r, onMerged: f, onDeleted: p, onError: m, client: h }) {
159
- let { t: g } = t(), [_, v] = B(!1), [y, b] = B(!1), S = C("group.save", m);
158
+ function Y({ group: e, g: t, labels: r, onMerged: i, onDeleted: a, onError: o, client: h }) {
159
+ let { t: g } = n(), [_, v] = B(!1), [y, b] = B(!1), x = E("group.save", o);
160
160
  return /* @__PURE__ */ U("div", {
161
161
  className: "flex flex-wrap items-center gap-2",
162
162
  "data-ckui": "group-head",
@@ -165,27 +165,27 @@ function Y({ group: e, g: n, labels: r, onMerged: f, onDeleted: p, onError: m, c
165
165
  className: "text-base font-semibold break-words",
166
166
  children: e.name || e.slug
167
167
  }),
168
- /* @__PURE__ */ H(d, {
168
+ /* @__PURE__ */ H(m, {
169
169
  variant: "outline",
170
- children: k(r, e.kind)
170
+ children: A(r, e.kind)
171
171
  }),
172
172
  /* @__PURE__ */ U("div", {
173
173
  className: "ms-auto flex flex-wrap gap-2",
174
- children: [/* @__PURE__ */ H(i, {
174
+ children: [/* @__PURE__ */ H(s, {
175
175
  size: "sm",
176
176
  variant: "outline",
177
177
  onClick: () => v(!0),
178
178
  children: g("groupEditor.merge")
179
- }), /* @__PURE__ */ H(i, {
179
+ }), /* @__PURE__ */ H(s, {
180
180
  size: "sm",
181
181
  variant: "destructive",
182
- disabled: S.pending,
182
+ disabled: x.pending,
183
183
  onClick: () => b(!0),
184
184
  children: g("groupEditor.delete")
185
185
  })]
186
186
  }),
187
- /* @__PURE__ */ H(x, {
188
- error: S.error,
187
+ /* @__PURE__ */ H(w, {
188
+ error: x.error,
189
189
  className: "basis-full"
190
190
  }),
191
191
  /* @__PURE__ */ H(X, {
@@ -194,24 +194,24 @@ function Y({ group: e, g: n, labels: r, onMerged: f, onDeleted: p, onError: m, c
194
194
  group: e,
195
195
  client: h,
196
196
  onMerge: async (e) => {
197
- let t = await n.merge(e.id);
198
- return f?.(t), t;
197
+ let n = await t.merge(e.id);
198
+ return i?.(n), n;
199
199
  }
200
200
  }),
201
- /* @__PURE__ */ H(a, {
201
+ /* @__PURE__ */ H(c, {
202
202
  open: y,
203
203
  onOpenChange: b,
204
- children: /* @__PURE__ */ U(o, {
204
+ children: /* @__PURE__ */ U(l, {
205
205
  "data-ckui": "group-delete-dialog",
206
- children: [/* @__PURE__ */ U(l, { children: [/* @__PURE__ */ H(u, { children: g("groupEditor.deleteTitle", { name: e.name || e.slug }) }), /* @__PURE__ */ H(s, { children: g("groupEditor.deleteBody") })] }), /* @__PURE__ */ U(c, { children: [/* @__PURE__ */ H(i, {
206
+ children: [/* @__PURE__ */ U(f, { children: [/* @__PURE__ */ H(p, { children: g("groupEditor.deleteTitle", { name: e.name || e.slug }) }), /* @__PURE__ */ H(u, { children: g("groupEditor.deleteBody") })] }), /* @__PURE__ */ U(d, { children: [/* @__PURE__ */ H(s, {
207
207
  variant: "outline",
208
208
  onClick: () => b(!1),
209
209
  children: g("common.cancel")
210
- }), /* @__PURE__ */ H(i, {
210
+ }), /* @__PURE__ */ H(s, {
211
211
  variant: "destructive",
212
- disabled: S.pending,
212
+ disabled: x.pending,
213
213
  onClick: () => {
214
- b(!1), S.run(n.remove).then((e) => e && p?.(e));
214
+ b(!1), x.run(t.remove).then((e) => e && a?.(e));
215
215
  },
216
216
  children: g("groupEditor.delete")
217
217
  })] })]
@@ -220,62 +220,62 @@ function Y({ group: e, g: n, labels: r, onMerged: f, onDeleted: p, onError: m, c
220
220
  ]
221
221
  });
222
222
  }
223
- function X({ open: n, onOpenChange: r, group: d, onMerge: m, language: h, client: g }) {
224
- let _ = t(), { t: v } = _, y = R(), [b, C] = B(null), [w, T] = B(""), [E, D] = B(!1), [k, A] = B(null);
223
+ function X({ open: t, onOpenChange: r, group: i, onMerge: a, language: o, client: m }) {
224
+ let _ = n(), { t: v } = _, y = R(), [b, x] = B(null), [S, C] = B(""), [E, D] = B(!1), [O, A] = B(null);
225
225
  L(() => {
226
- n && (C(null), T(""), A(null));
227
- }, [n]);
228
- let j = v("groupEditor.mergeWord"), M = !!b && w.trim().toLowerCase() === j.toLowerCase(), N = d.name || d.slug;
229
- return /* @__PURE__ */ H(a, {
230
- open: n,
226
+ t && (x(null), C(""), A(null));
227
+ }, [t]);
228
+ let j = v("groupEditor.mergeWord"), M = !!b && S.trim().toLowerCase() === j.toLowerCase(), N = i.name || i.slug;
229
+ return /* @__PURE__ */ H(c, {
230
+ open: t,
231
231
  onOpenChange: r,
232
- children: /* @__PURE__ */ U(o, {
232
+ children: /* @__PURE__ */ U(l, {
233
233
  "data-ckui": "group-merge-dialog",
234
234
  children: [
235
- /* @__PURE__ */ U(l, { children: [/* @__PURE__ */ H(u, { children: v("groupEditor.mergeTitle", { name: N }) }), /* @__PURE__ */ H(s, { children: v("groupEditor.mergeBody") })] }),
235
+ /* @__PURE__ */ U(f, { children: [/* @__PURE__ */ H(p, { children: v("groupEditor.mergeTitle", { name: N }) }), /* @__PURE__ */ H(u, { children: v("groupEditor.mergeBody") })] }),
236
236
  b ? /* @__PURE__ */ U("div", {
237
237
  className: "flex flex-wrap items-center gap-2",
238
238
  "data-ckui": "merge-target",
239
- children: [/* @__PURE__ */ H("span", { children: v("groupEditor.mergeInto", { name: b.name || b.slug }) }), /* @__PURE__ */ H(i, {
239
+ children: [/* @__PURE__ */ H("span", { children: v("groupEditor.mergeInto", { name: b.name || b.slug }) }), /* @__PURE__ */ H(s, {
240
240
  size: "xs",
241
241
  variant: "ghost",
242
- onClick: () => C(null),
242
+ onClick: () => x(null),
243
243
  children: v("groupEditor.change")
244
244
  })]
245
- }) : /* @__PURE__ */ H(O, {
246
- kind: d.kind,
247
- language: h,
248
- exclude: [d.id],
245
+ }) : /* @__PURE__ */ H(k, {
246
+ kind: i.kind,
247
+ language: o,
248
+ exclude: [i.id],
249
249
  label: v("groupEditor.mergeTarget"),
250
- onPick: C,
251
- client: g,
250
+ onPick: x,
251
+ client: m,
252
252
  autoFocus: !0
253
253
  }),
254
254
  /* @__PURE__ */ U("div", {
255
255
  className: "grid gap-1.5",
256
- children: [/* @__PURE__ */ H(p, {
256
+ children: [/* @__PURE__ */ H(g, {
257
257
  htmlFor: `${y}-typed`,
258
258
  children: v("admin.typeToConfirm", { word: j })
259
- }), /* @__PURE__ */ H(f, {
259
+ }), /* @__PURE__ */ H(h, {
260
260
  id: `${y}-typed`,
261
- value: w,
261
+ value: S,
262
262
  autoComplete: "off",
263
- onChange: (e) => T(e.target.value)
263
+ onChange: (e) => C(e.target.value)
264
264
  })]
265
265
  }),
266
- k && /* @__PURE__ */ H(x, { children: S(_, k) }),
267
- /* @__PURE__ */ U(c, { children: [/* @__PURE__ */ H(i, {
266
+ O && /* @__PURE__ */ H(w, { children: T(_, O) }),
267
+ /* @__PURE__ */ U(d, { children: [/* @__PURE__ */ H(s, {
268
268
  variant: "outline",
269
269
  onClick: () => r(!1),
270
270
  children: v("common.cancel")
271
- }), /* @__PURE__ */ H(i, {
271
+ }), /* @__PURE__ */ H(s, {
272
272
  variant: "destructive",
273
273
  disabled: !M || E,
274
274
  onClick: async () => {
275
275
  if (b) {
276
276
  D(!0), A(null);
277
277
  try {
278
- await m(b), r(!1);
278
+ await a(b), r(!1);
279
279
  } catch (t) {
280
280
  A(e(t));
281
281
  } finally {
@@ -289,14 +289,14 @@ function X({ open: n, onOpenChange: r, group: d, onMerge: m, language: h, client
289
289
  })
290
290
  });
291
291
  }
292
- function Z({ label: e, kind: n, value: r, onChange: a, exclude: o, required: s, client: c }) {
293
- let { t: l } = t();
292
+ function Z({ label: e, kind: t, value: r, onChange: i, exclude: a, required: o, client: c }) {
293
+ let { t: l } = n();
294
294
  return /* @__PURE__ */ U("div", {
295
295
  className: "grid gap-1.5",
296
296
  "data-ckui": "group-field",
297
297
  children: [/* @__PURE__ */ U("span", {
298
298
  className: "text-sm font-medium",
299
- children: [e, s && /* @__PURE__ */ H("span", {
299
+ children: [e, o && /* @__PURE__ */ H("span", {
300
300
  "aria-hidden": !0,
301
301
  children: " *"
302
302
  })]
@@ -306,50 +306,50 @@ function Z({ label: e, kind: n, value: r, onChange: a, exclude: o, required: s,
306
306
  className: "rounded-md border border-border px-2 py-0.5",
307
307
  "data-ckui": "group-field-value",
308
308
  children: r.name || r.slug
309
- }), /* @__PURE__ */ H(i, {
309
+ }), /* @__PURE__ */ H(s, {
310
310
  type: "button",
311
311
  size: "xs",
312
312
  variant: "ghost",
313
- onClick: () => a(null),
313
+ onClick: () => i(null),
314
314
  "aria-label": l("groupEditor.clearField", { field: e }),
315
- children: l(s ? "groupEditor.change" : "common.remove")
315
+ children: l(o ? "groupEditor.change" : "common.remove")
316
316
  })]
317
- }) : /* @__PURE__ */ H(O, {
318
- kind: n,
317
+ }) : /* @__PURE__ */ H(k, {
318
+ kind: t,
319
319
  label: e,
320
- exclude: o,
321
- onPick: a,
320
+ exclude: a,
321
+ onPick: i,
322
322
  client: c
323
323
  })]
324
324
  });
325
325
  }
326
- function Q({ kind: e, spec: n, languages: r, labels: a, g: o, onCreated: s, onError: c, client: l }) {
327
- let u = t(), { t: d } = u, m = R(), h = j(), [g, _] = B({}), [v, y] = B(""), [b, E] = B(!1), [D, O] = B(null), [A, M] = B(null), F = n.attributes ?? {}, [I, z] = B(() => P(F, {})), [V, W] = B(null), G = C("group.save", c), K = g[r[0]] ?? "";
326
+ function Q({ kind: e, spec: r, languages: i, labels: a, g: o, onCreated: c, onError: l, client: u }) {
327
+ let d = n(), { t: f } = d, p = R(), m = t(), [_, v] = B({}), [y, b] = B(""), [x, S] = B(!1), [C, k] = B(null), [j, M] = B(null), F = r.attributes ?? {}, [I, z] = B(() => P(F, {})), [V, W] = B(null), G = E("group.save", l), K = _[i[0]] ?? "";
328
328
  L(() => {
329
- b || y(T(K));
330
- }, [K, b]);
329
+ x || b(O(K));
330
+ }, [K, x]);
331
331
  let q = async () => {
332
332
  W(null);
333
333
  let t;
334
334
  try {
335
- t = w(F, I);
335
+ t = D(F, I);
336
336
  } catch (e) {
337
337
  W(e.message);
338
338
  return;
339
339
  }
340
- let n = r.filter((e) => g[e]?.trim()).map((e) => ({
340
+ let n = i.filter((e) => _[e]?.trim()).map((e) => ({
341
341
  language: e,
342
342
  kind: "name",
343
- name: g[e].trim()
344
- })), i = await G.run(() => o.create({
343
+ name: _[e].trim()
344
+ })), r = await G.run(() => o.create({
345
345
  kind: e,
346
- slug: v.trim(),
346
+ slug: y.trim(),
347
347
  names: n,
348
- parent_id: D?.id,
349
- scope_id: A?.id,
348
+ parent_id: C?.id,
349
+ scope_id: j?.id,
350
350
  attributes: Object.keys(t).length ? t : void 0
351
351
  }));
352
- i && s?.(i);
352
+ r && c?.(r);
353
353
  };
354
354
  return /* @__PURE__ */ U("form", {
355
355
  className: "grid gap-4",
@@ -360,20 +360,20 @@ function Q({ kind: e, spec: n, languages: r, labels: a, g: o, onCreated: s, onEr
360
360
  children: [
361
361
  /* @__PURE__ */ H("h2", {
362
362
  className: "text-base font-semibold",
363
- children: d("groupEditor.newTitle", { kind: k(a, e) })
363
+ children: f("groupEditor.newTitle", { kind: A(a, e) })
364
364
  }),
365
- r.map((e, t) => /* @__PURE__ */ U("div", {
365
+ i.map((e, t) => /* @__PURE__ */ U("div", {
366
366
  className: "grid gap-1.5",
367
- children: [/* @__PURE__ */ H(p, {
368
- htmlFor: `${m}-${e}`,
369
- children: d("groupEditor.nameIn", { language: h(e) })
370
- }), /* @__PURE__ */ H(f, {
371
- id: `${m}-${e}`,
367
+ children: [/* @__PURE__ */ H(g, {
368
+ htmlFor: `${p}-${e}`,
369
+ children: f("groupEditor.nameIn", { language: m(e) })
370
+ }), /* @__PURE__ */ H(h, {
371
+ id: `${p}-${e}`,
372
372
  className: "h-8",
373
373
  lang: e,
374
374
  required: t === 0,
375
- value: g[e] ?? "",
376
- onChange: (t) => _((n) => ({
375
+ value: _[e] ?? "",
376
+ onChange: (t) => v((n) => ({
377
377
  ...n,
378
378
  [e]: t.target.value
379
379
  }))
@@ -381,33 +381,33 @@ function Q({ kind: e, spec: n, languages: r, labels: a, g: o, onCreated: s, onEr
381
381
  }, e)),
382
382
  /* @__PURE__ */ U("div", {
383
383
  className: "grid gap-1.5",
384
- children: [/* @__PURE__ */ H(p, {
385
- htmlFor: `${m}-slug`,
386
- children: d("groupEditor.slug")
387
- }), /* @__PURE__ */ H(f, {
388
- id: `${m}-slug`,
384
+ children: [/* @__PURE__ */ H(g, {
385
+ htmlFor: `${p}-slug`,
386
+ children: f("groupEditor.slug")
387
+ }), /* @__PURE__ */ H(h, {
388
+ id: `${p}-slug`,
389
389
  className: "h-8",
390
390
  required: !0,
391
- value: v,
391
+ value: y,
392
392
  onChange: (e) => {
393
- E(!0), y(e.target.value);
393
+ S(!0), b(e.target.value);
394
394
  }
395
395
  })]
396
396
  }),
397
- n.scoped_by && /* @__PURE__ */ H(Z, {
398
- label: k(a, n.scoped_by),
399
- kind: n.scoped_by,
400
- value: A,
397
+ r.scoped_by && /* @__PURE__ */ H(Z, {
398
+ label: A(a, r.scoped_by),
399
+ kind: r.scoped_by,
400
+ value: j,
401
401
  onChange: M,
402
402
  required: !0,
403
- client: l
403
+ client: u
404
404
  }),
405
- n.parent && /* @__PURE__ */ H(Z, {
406
- label: d("groupEditor.parent"),
407
- kind: n.parent,
408
- value: D,
409
- onChange: O,
410
- client: l
405
+ r.parent && /* @__PURE__ */ H(Z, {
406
+ label: f("groupEditor.parent"),
407
+ kind: r.parent,
408
+ value: C,
409
+ onChange: k,
410
+ client: u
411
411
  }),
412
412
  /* @__PURE__ */ H(N, {
413
413
  declared: F,
@@ -418,43 +418,43 @@ function Q({ kind: e, spec: n, languages: r, labels: a, g: o, onCreated: s, onEr
418
418
  })),
419
419
  labels: a
420
420
  }),
421
- V && /* @__PURE__ */ H(x, { children: V }),
422
- G.error && /* @__PURE__ */ H(x, { children: S(u, G.error) }),
423
- /* @__PURE__ */ H(i, {
421
+ V && /* @__PURE__ */ H(w, { children: V }),
422
+ G.error && /* @__PURE__ */ H(w, { children: T(d, G.error) }),
423
+ /* @__PURE__ */ H(s, {
424
424
  type: "submit",
425
425
  className: "justify-self-start",
426
- disabled: G.pending || !K.trim() || !v.trim() || !!n.scoped_by && !A,
427
- children: G.pending ? d("common.saving") : d("groupEditor.create")
426
+ disabled: G.pending || !K.trim() || !y.trim() || !!r.scoped_by && !j,
427
+ children: G.pending ? f("common.saving") : f("groupEditor.create")
428
428
  })
429
429
  ]
430
430
  });
431
431
  }
432
- function $({ group: e, spec: n, g: r, labels: a, onError: o, client: s }) {
433
- let { t: c } = t(), l = R(), u = n.attributes ?? {}, [d, m, h] = K(() => ({
432
+ function $({ group: e, spec: t, g: r, labels: i, onError: a, client: o }) {
433
+ let { t: c } = n(), l = R(), u = t.attributes ?? {}, [d, f, p] = K(() => ({
434
434
  slug: e.slug,
435
435
  parent: e.parent ?? null,
436
436
  scope: e.scope ?? null,
437
437
  attrs: P(u, e.attributes)
438
- }), e.revision), { slug: g, parent: _, scope: v, attrs: y } = d, b = (e) => {
439
- M(!1), m((t) => ({
438
+ }), e.revision), { slug: m, parent: _, scope: v, attrs: y } = d, b = (e) => {
439
+ M(!1), f((t) => ({
440
440
  ...t,
441
441
  ...e
442
442
  }));
443
- }, S = (e) => b({ slug: e }), T = (e) => b({ parent: e }), E = (e) => b({ scope: e }), D = (e) => b({ attrs: e(y) }), [O, A] = B(null), [j, M] = B(!1), F = C("group.save", o), I = async () => {
444
- A(null), M(!1);
443
+ }, x = (e) => b({ slug: e }), S = (e) => b({ parent: e }), C = (e) => b({ scope: e }), T = (e) => b({ attrs: e(y) }), [O, k] = B(null), [j, M] = B(!1), F = E("group.save", a), I = async () => {
444
+ k(null), M(!1);
445
445
  let e;
446
446
  try {
447
- e = w(u, y);
447
+ e = D(u, y);
448
448
  } catch (e) {
449
- A(e.message);
449
+ k(e.message);
450
450
  return;
451
451
  }
452
452
  await F.run(() => r.update({
453
- slug: g.trim(),
453
+ slug: m.trim(),
454
454
  attributes: e,
455
- ...n.parent ? { parent_id: _?.id ?? "" } : {},
456
- ...n.scoped_by && v ? { scope_id: v.id } : {}
457
- })) && (h(), M(!0));
455
+ ...t.parent ? { parent_id: _?.id ?? "" } : {},
456
+ ...t.scoped_by && v ? { scope_id: v.id } : {}
457
+ })) && (p(), M(!0));
458
458
  };
459
459
  return /* @__PURE__ */ H(q, {
460
460
  title: c("groupEditor.details"),
@@ -467,50 +467,50 @@ function $({ group: e, spec: n, g: r, labels: a, onError: o, client: s }) {
467
467
  children: [
468
468
  /* @__PURE__ */ U("div", {
469
469
  className: "grid gap-1.5",
470
- children: [/* @__PURE__ */ H(p, {
470
+ children: [/* @__PURE__ */ H(g, {
471
471
  htmlFor: `${l}-slug`,
472
472
  children: c("groupEditor.slug")
473
- }), /* @__PURE__ */ H(f, {
473
+ }), /* @__PURE__ */ H(h, {
474
474
  id: `${l}-slug`,
475
475
  className: "h-8",
476
476
  required: !0,
477
- value: g,
478
- onChange: (e) => S(e.target.value)
477
+ value: m,
478
+ onChange: (e) => x(e.target.value)
479
479
  })]
480
480
  }),
481
- n.scoped_by && /* @__PURE__ */ H(Z, {
482
- label: k(a, n.scoped_by),
483
- kind: n.scoped_by,
481
+ t.scoped_by && /* @__PURE__ */ H(Z, {
482
+ label: A(i, t.scoped_by),
483
+ kind: t.scoped_by,
484
484
  value: v,
485
- onChange: E,
485
+ onChange: C,
486
486
  required: !0,
487
- client: s
487
+ client: o
488
488
  }),
489
- n.parent && /* @__PURE__ */ H(Z, {
489
+ t.parent && /* @__PURE__ */ H(Z, {
490
490
  label: c("groupEditor.parent"),
491
- kind: n.parent,
491
+ kind: t.parent,
492
492
  value: _,
493
- onChange: T,
493
+ onChange: S,
494
494
  exclude: [e.id],
495
- client: s
495
+ client: o
496
496
  }),
497
497
  /* @__PURE__ */ H(N, {
498
498
  declared: u,
499
499
  form: y,
500
- onChange: (e, t) => D((n) => ({
500
+ onChange: (e, t) => T((n) => ({
501
501
  ...n,
502
502
  [e]: t
503
503
  })),
504
- labels: a
504
+ labels: i
505
505
  }),
506
- O && /* @__PURE__ */ H(x, { children: O }),
507
- /* @__PURE__ */ H(x, { error: F.error }),
506
+ O && /* @__PURE__ */ H(w, { children: O }),
507
+ /* @__PURE__ */ H(w, { error: F.error }),
508
508
  /* @__PURE__ */ U("div", {
509
509
  className: "flex items-center gap-3",
510
- children: [/* @__PURE__ */ H(i, {
510
+ children: [/* @__PURE__ */ H(s, {
511
511
  type: "submit",
512
512
  size: "sm",
513
- disabled: F.pending || !g.trim() || !!n.scoped_by && !v,
513
+ disabled: F.pending || !m.trim() || !!t.scoped_by && !v,
514
514
  children: F.pending ? c("common.saving") : c("common.save")
515
515
  }), j && /* @__PURE__ */ H("span", {
516
516
  role: "status",
@@ -522,23 +522,23 @@ function $({ group: e, spec: n, g: r, labels: a, onError: o, client: s }) {
522
522
  })
523
523
  });
524
524
  }
525
- function ee({ group: e, g: n, languages: r, onError: a }) {
526
- let { t: o } = t(), s = R(), c = j(), [l, u] = B(r[0]), [y, b] = B("alias"), [S, w] = B(""), T = C("group.save", a), E = [...e.names].sort((e, t) => e.language.localeCompare(t.language) || (e.kind === t.kind ? e.name.localeCompare(t.name) : e.kind === "name" ? -1 : 1)), D = [.../* @__PURE__ */ new Set([...r, ...e.names.map((e) => e.language)])];
525
+ function ee({ group: e, g: r, languages: i, onError: a }) {
526
+ let { t: o } = n(), c = R(), l = t(), [u, d] = B(i[0]), [f, p] = B("alias"), [S, C] = B(""), T = E("group.save", a), D = [...e.names].sort((e, t) => e.language.localeCompare(t.language) || (e.kind === t.kind ? e.name.localeCompare(t.name) : e.kind === "name" ? -1 : 1)), O = [.../* @__PURE__ */ new Set([...i, ...e.names.map((e) => e.language)])];
527
527
  return /* @__PURE__ */ U(q, {
528
528
  title: o("groupEditor.names"),
529
529
  ckui: "group-names-editor",
530
530
  children: [
531
- E.length ? /* @__PURE__ */ H("ul", {
531
+ D.length ? /* @__PURE__ */ H("ul", {
532
532
  className: "grid divide-y divide-border rounded-lg border border-border",
533
- children: E.map((e) => /* @__PURE__ */ U("li", {
533
+ children: D.map((e) => /* @__PURE__ */ U("li", {
534
534
  className: "flex flex-wrap items-center gap-2 p-2.5",
535
535
  "data-ckui": "group-name",
536
536
  "data-kind": e.kind,
537
537
  "data-language": e.language,
538
538
  children: [
539
- /* @__PURE__ */ H(d, {
539
+ /* @__PURE__ */ H(m, {
540
540
  variant: "outline",
541
- children: c(e.language)
541
+ children: l(e.language)
542
542
  }),
543
543
  /* @__PURE__ */ H("span", {
544
544
  className: "min-w-0 flex-1 break-words",
@@ -549,22 +549,22 @@ function ee({ group: e, g: n, languages: r, onError: a }) {
549
549
  className: "text-xs text-muted-foreground",
550
550
  children: o(e.kind === "name" ? "groupEditor.canonical" : "groupEditor.alias")
551
551
  }),
552
- e.kind === "alias" && /* @__PURE__ */ H(i, {
552
+ e.kind === "alias" && /* @__PURE__ */ H(s, {
553
553
  size: "xs",
554
554
  variant: "ghost",
555
555
  disabled: T.pending,
556
- onClick: () => void T.run(() => n.names("add", [{
556
+ onClick: () => void T.run(() => r.names("add", [{
557
557
  ...e,
558
558
  kind: "name"
559
559
  }])),
560
560
  children: o("groupEditor.makeCanonical")
561
561
  }),
562
- /* @__PURE__ */ H(i, {
562
+ /* @__PURE__ */ H(s, {
563
563
  size: "xs",
564
564
  variant: "ghost",
565
565
  disabled: T.pending,
566
566
  "aria-label": o("groupEditor.removeName", { name: e.name }),
567
- onClick: () => void T.run(() => n.names("remove", [e])),
567
+ onClick: () => void T.run(() => r.names("remove", [e])),
568
568
  children: o("common.remove")
569
569
  })
570
570
  ]
@@ -578,54 +578,54 @@ function ee({ group: e, g: n, languages: r, onError: a }) {
578
578
  onSubmit: (e) => {
579
579
  e.preventDefault();
580
580
  let t = S.trim();
581
- t && T.run(() => n.names("add", [{
582
- language: l,
583
- kind: y,
581
+ t && T.run(() => r.names("add", [{
582
+ language: u,
583
+ kind: f,
584
584
  name: t
585
- }])).then((e) => e && w(""));
585
+ }])).then((e) => e && C(""));
586
586
  },
587
587
  children: [
588
- D.length > 1 && /* @__PURE__ */ U(m, {
589
- value: l,
590
- onValueChange: (e) => u(String(e)),
591
- children: [/* @__PURE__ */ H(_, {
588
+ O.length > 1 && /* @__PURE__ */ U(_, {
589
+ value: u,
590
+ onValueChange: (e) => d(String(e)),
591
+ children: [/* @__PURE__ */ H(b, {
592
592
  size: "sm",
593
593
  "aria-label": o("groupEditor.language"),
594
- children: /* @__PURE__ */ H(v, { children: (e) => c(e) })
595
- }), /* @__PURE__ */ H(h, { children: D.map((e) => /* @__PURE__ */ H(g, {
594
+ children: /* @__PURE__ */ H(x, { children: (e) => l(e) })
595
+ }), /* @__PURE__ */ H(v, { children: O.map((e) => /* @__PURE__ */ H(y, {
596
596
  value: e,
597
- children: c(e)
597
+ children: l(e)
598
598
  }, e)) })]
599
599
  }),
600
- /* @__PURE__ */ U(m, {
601
- value: y,
602
- onValueChange: (e) => b(e),
603
- children: [/* @__PURE__ */ H(_, {
600
+ /* @__PURE__ */ U(_, {
601
+ value: f,
602
+ onValueChange: (e) => p(e),
603
+ children: [/* @__PURE__ */ H(b, {
604
604
  size: "sm",
605
605
  "aria-label": o("groupEditor.nameKind"),
606
- children: /* @__PURE__ */ H(v, { children: (e) => o(e === "name" ? "groupEditor.canonical" : "groupEditor.alias") })
607
- }), /* @__PURE__ */ U(h, { children: [/* @__PURE__ */ H(g, {
606
+ children: /* @__PURE__ */ H(x, { children: (e) => o(e === "name" ? "groupEditor.canonical" : "groupEditor.alias") })
607
+ }), /* @__PURE__ */ U(v, { children: [/* @__PURE__ */ H(y, {
608
608
  value: "alias",
609
609
  children: o("groupEditor.alias")
610
- }), /* @__PURE__ */ H(g, {
610
+ }), /* @__PURE__ */ H(y, {
611
611
  value: "name",
612
612
  children: o("groupEditor.canonical")
613
613
  })] })]
614
614
  }),
615
- /* @__PURE__ */ H(p, {
616
- htmlFor: `${s}-name`,
615
+ /* @__PURE__ */ H(g, {
616
+ htmlFor: `${c}-name`,
617
617
  className: "sr-only",
618
618
  children: o("groupEditor.newName")
619
619
  }),
620
- /* @__PURE__ */ H(f, {
621
- id: `${s}-name`,
620
+ /* @__PURE__ */ H(h, {
621
+ id: `${c}-name`,
622
622
  className: "h-8 min-w-40 flex-1",
623
- lang: l,
623
+ lang: u,
624
624
  value: S,
625
625
  placeholder: o("groupEditor.newName"),
626
- onChange: (e) => w(e.target.value)
626
+ onChange: (e) => C(e.target.value)
627
627
  }),
628
- /* @__PURE__ */ H(i, {
628
+ /* @__PURE__ */ H(s, {
629
629
  type: "submit",
630
630
  size: "sm",
631
631
  variant: "outline",
@@ -634,13 +634,13 @@ function ee({ group: e, g: n, languages: r, onError: a }) {
634
634
  })
635
635
  ]
636
636
  }),
637
- /* @__PURE__ */ H(x, { error: T.error })
637
+ /* @__PURE__ */ H(w, { error: T.error })
638
638
  ]
639
639
  });
640
640
  }
641
- function te({ group: e, g: n, languages: r, onError: a }) {
642
- let { t: o } = t(), s = R(), c = j(), l = [.../* @__PURE__ */ new Set([...r, ...e.text.map((e) => e.language)])], [u, d, m] = K(() => Object.fromEntries(l.map((t) => [t, e.text.find((e) => e.language === t) ?? { language: t }])), e.revision), [h, g] = B(!1), _ = C("group.save", a), v = (e, t) => {
643
- g(!1), d((n) => ({
641
+ function te({ group: e, g: r, languages: i, onError: a }) {
642
+ let { t: o } = n(), c = R(), l = t(), u = [.../* @__PURE__ */ new Set([...i, ...e.text.map((e) => e.language)])], [d, f, p] = K(() => Object.fromEntries(u.map((t) => [t, e.text.find((e) => e.language === t) ?? { language: t }])), e.revision), [m, _] = B(!1), v = E("group.save", a), y = (e, t) => {
643
+ _(!1), f((n) => ({
644
644
  ...n,
645
645
  [e]: {
646
646
  ...n[e],
@@ -655,61 +655,61 @@ function te({ group: e, g: n, languages: r, onError: a }) {
655
655
  className: "grid gap-4",
656
656
  onSubmit: (e) => {
657
657
  e.preventDefault();
658
- let t = Object.values(u).map((e) => ({
658
+ let t = Object.values(d).map((e) => ({
659
659
  language: e.language,
660
660
  description: e.description?.trim() || void 0,
661
661
  sort_key: e.sort_key?.trim() || void 0
662
662
  })).filter((e) => e.description || e.sort_key);
663
- _.run(() => n.update({ text: t })).then((e) => {
664
- e && (m(), g(!0));
663
+ v.run(() => r.update({ text: t })).then((e) => {
664
+ e && (p(), _(!0));
665
665
  });
666
666
  },
667
667
  children: [
668
- l.map((e) => /* @__PURE__ */ U("fieldset", {
668
+ u.map((e) => /* @__PURE__ */ U("fieldset", {
669
669
  className: "grid gap-2",
670
670
  "data-language": e,
671
671
  children: [
672
672
  /* @__PURE__ */ H("legend", {
673
673
  className: "mb-1 text-xs font-medium text-muted-foreground",
674
- children: c(e)
674
+ children: l(e)
675
675
  }),
676
- /* @__PURE__ */ H(p, {
677
- htmlFor: `${s}-${e}-d`,
676
+ /* @__PURE__ */ H(g, {
677
+ htmlFor: `${c}-${e}-d`,
678
678
  className: "sr-only",
679
- children: o("groupEditor.descriptionIn", { language: c(e) })
679
+ children: o("groupEditor.descriptionIn", { language: l(e) })
680
680
  }),
681
- /* @__PURE__ */ H(b, {
682
- id: `${s}-${e}-d`,
681
+ /* @__PURE__ */ H(C, {
682
+ id: `${c}-${e}-d`,
683
683
  lang: e,
684
684
  rows: 3,
685
685
  placeholder: o("groupEditor.description"),
686
- value: u[e]?.description ?? "",
687
- onChange: (t) => v(e, { description: t.target.value })
686
+ value: d[e]?.description ?? "",
687
+ onChange: (t) => y(e, { description: t.target.value })
688
688
  }),
689
- /* @__PURE__ */ H(p, {
690
- htmlFor: `${s}-${e}-s`,
689
+ /* @__PURE__ */ H(g, {
690
+ htmlFor: `${c}-${e}-s`,
691
691
  className: "sr-only",
692
- children: o("groupEditor.sortKeyIn", { language: c(e) })
692
+ children: o("groupEditor.sortKeyIn", { language: l(e) })
693
693
  }),
694
- /* @__PURE__ */ H(f, {
695
- id: `${s}-${e}-s`,
694
+ /* @__PURE__ */ H(h, {
695
+ id: `${c}-${e}-s`,
696
696
  className: "h-8",
697
697
  lang: e,
698
698
  placeholder: o("groupEditor.sortKey"),
699
- value: u[e]?.sort_key ?? "",
700
- onChange: (t) => v(e, { sort_key: t.target.value })
699
+ value: d[e]?.sort_key ?? "",
700
+ onChange: (t) => y(e, { sort_key: t.target.value })
701
701
  })
702
702
  ]
703
703
  }, e)),
704
- /* @__PURE__ */ H(x, { error: _.error }),
704
+ /* @__PURE__ */ H(w, { error: v.error }),
705
705
  /* @__PURE__ */ U("div", {
706
706
  className: "flex items-center gap-3",
707
- children: [/* @__PURE__ */ H(i, {
707
+ children: [/* @__PURE__ */ H(s, {
708
708
  type: "submit",
709
709
  size: "sm",
710
- disabled: _.pending,
711
- children: _.pending ? o("common.saving") : o("common.save")
712
- }), h && /* @__PURE__ */ H("span", {
710
+ disabled: v.pending,
711
+ children: v.pending ? o("common.saving") : o("common.save")
712
+ }), m && /* @__PURE__ */ H("span", {
713
713
  role: "status",
714
714
  className: "text-muted-foreground",
715
715
  children: o("groupEditor.saved")
@@ -719,10 +719,10 @@ function te({ group: e, g: n, languages: r, onError: a }) {
719
719
  })
720
720
  });
721
721
  }
722
- function ne({ group: e, spec: n, onError: r, client: i }) {
723
- let { t: a } = t(), o = e.cover, s = o?.image ? "image" : o?.content_id && !o.auto ? "content" : "auto";
722
+ function ne({ group: e, spec: t, onError: r, client: i }) {
723
+ let { t: a } = n(), o = e.cover, s = o?.image ? "image" : o?.content_id && !o.auto ? "content" : "auto";
724
724
  return /* @__PURE__ */ U(q, {
725
- title: a(n.owner === "user" ? "groupEditor.images" : "groupEditor.cover"),
725
+ title: a(t.owner === "user" ? "groupEditor.images" : "groupEditor.cover"),
726
726
  ckui: "group-cover-editor",
727
727
  children: [
728
728
  /* @__PURE__ */ H("p", {
@@ -736,7 +736,7 @@ function ne({ group: e, spec: n, onError: r, client: i }) {
736
736
  client: i,
737
737
  onError: r
738
738
  }),
739
- n.owner === "user" && /* @__PURE__ */ H(F, {
739
+ t.owner === "user" && /* @__PURE__ */ H(F, {
740
740
  group: e,
741
741
  slot: "avatar",
742
742
  client: i,
@@ -745,8 +745,8 @@ function ne({ group: e, spec: n, onError: r, client: i }) {
745
745
  ]
746
746
  });
747
747
  }
748
- function re({ group: e, onError: n, client: i }) {
749
- let { t: a } = t(), o = r(i), s = C("offer.save", n);
748
+ function re({ group: e, onError: t, client: r }) {
749
+ let { t: a } = n(), o = i(r), s = E("offer.save", t);
750
750
  return /* @__PURE__ */ U(q, {
751
751
  title: a("groupEditor.membershipPrice"),
752
752
  ckui: "group-offer",
@@ -755,53 +755,53 @@ function re({ group: e, onError: n, client: i }) {
755
755
  pending: s.pending,
756
756
  onSell: (t) => void s.run(() => o.offers.sellGroup(e.id, t)),
757
757
  onWithdraw: () => void s.run(() => o.offers.withdrawGroup(e.id))
758
- }, e.offer?.revision), /* @__PURE__ */ H(x, { error: s.error })]
758
+ }, e.offer?.revision), /* @__PURE__ */ H(w, { error: s.error })]
759
759
  });
760
760
  }
761
761
  var ie = /^[a-z][a-z0-9_]*$/;
762
- function ae({ group: e, g: n, kinds: r, labels: a, onError: o, client: s }) {
763
- let { t: c } = t(), l = R(), u = C("group.save", o), y = A(e.edges.map((t) => t.from === e.id ? t.to : t.from), { client: s }), b = Object.keys(r?.group_kinds ?? {}).sort(), [S, w] = B(""), [T, E] = B(b[0] ?? e.kind), D = e.edges.filter((t) => t.from === e.id), j = e.edges.filter((t) => t.to === e.id), M = (e) => {
764
- let t = y.get(e);
762
+ function ae({ group: e, g: t, kinds: r, labels: i, onError: a, client: o }) {
763
+ let { t: c } = n(), l = R(), u = E("group.save", a), d = j(e.edges.map((t) => t.from === e.id ? t.to : t.from), { client: o }), f = Object.keys(r?.group_kinds ?? {}).sort(), [p, S] = B(""), [C, T] = B(f[0] ?? e.kind), D = e.edges.filter((t) => t.from === e.id), O = e.edges.filter((t) => t.to === e.id), M = (e) => {
764
+ let t = d.get(e);
765
765
  return t ? t.name || t.slug : e;
766
- }, N = ie.test(S.trim());
766
+ }, N = ie.test(p.trim());
767
767
  return /* @__PURE__ */ U(q, {
768
768
  title: c("groupEditor.edges"),
769
769
  ckui: "group-edges",
770
770
  children: [
771
- D.length + j.length ? /* @__PURE__ */ U("ul", {
771
+ D.length + O.length ? /* @__PURE__ */ U("ul", {
772
772
  className: "grid gap-1.5",
773
773
  children: [D.map((e) => /* @__PURE__ */ U("li", {
774
774
  className: "flex flex-wrap items-center gap-2",
775
775
  "data-ckui": "group-edge",
776
776
  "data-relation": e.relation,
777
777
  children: [
778
- /* @__PURE__ */ H(d, {
778
+ /* @__PURE__ */ H(m, {
779
779
  variant: "secondary",
780
- children: k(a, e.relation)
780
+ children: A(i, e.relation)
781
781
  }),
782
782
  /* @__PURE__ */ H("span", { children: M(e.to) }),
783
- /* @__PURE__ */ H(i, {
783
+ /* @__PURE__ */ H(s, {
784
784
  size: "xs",
785
785
  variant: "ghost",
786
786
  disabled: u.pending,
787
787
  "aria-label": c("groupEditor.removeEdge", { name: M(e.to) }),
788
- onClick: () => void u.run(() => n.edges("remove", [{
788
+ onClick: () => void u.run(() => t.edges("remove", [{
789
789
  relation: e.relation,
790
790
  to: e.to
791
791
  }])),
792
792
  children: c("common.remove")
793
793
  })
794
794
  ]
795
- }, `${e.relation}:${e.to}`)), j.map((e) => /* @__PURE__ */ U("li", {
795
+ }, `${e.relation}:${e.to}`)), O.map((e) => /* @__PURE__ */ U("li", {
796
796
  className: "flex flex-wrap items-center gap-2 text-muted-foreground",
797
797
  "data-ckui": "group-edge",
798
798
  "data-relation": `inverse:${e.relation}`,
799
799
  children: [/* @__PURE__ */ H("span", {
800
800
  className: "text-foreground",
801
801
  children: M(e.from)
802
- }), /* @__PURE__ */ H(d, {
802
+ }), /* @__PURE__ */ H(m, {
803
803
  variant: "outline",
804
- children: k(a, e.relation)
804
+ children: A(i, e.relation)
805
805
  })]
806
806
  }, `in:${e.relation}:${e.from}`))]
807
807
  }) : /* @__PURE__ */ H("p", {
@@ -813,44 +813,44 @@ function ae({ group: e, g: n, kinds: r, labels: a, onError: o, client: s }) {
813
813
  children: [
814
814
  /* @__PURE__ */ U("div", {
815
815
  className: "grid gap-1",
816
- children: [/* @__PURE__ */ H(p, {
816
+ children: [/* @__PURE__ */ H(g, {
817
817
  htmlFor: `${l}-rel`,
818
818
  className: "text-xs text-muted-foreground",
819
819
  children: c("groupEditor.relation")
820
- }), /* @__PURE__ */ H(f, {
820
+ }), /* @__PURE__ */ H(h, {
821
821
  id: `${l}-rel`,
822
822
  className: "h-8 w-40",
823
- value: S,
823
+ value: p,
824
824
  placeholder: "member_of",
825
- "aria-invalid": !!S && !N,
826
- onChange: (e) => w(e.target.value)
825
+ "aria-invalid": !!p && !N,
826
+ onChange: (e) => S(e.target.value)
827
827
  })]
828
828
  }),
829
- b.length > 1 && /* @__PURE__ */ U(m, {
830
- value: T,
831
- onValueChange: (e) => E(String(e)),
832
- children: [/* @__PURE__ */ H(_, {
829
+ f.length > 1 && /* @__PURE__ */ U(_, {
830
+ value: C,
831
+ onValueChange: (e) => T(String(e)),
832
+ children: [/* @__PURE__ */ H(b, {
833
833
  size: "sm",
834
834
  "aria-label": c("groupEditor.edgeKind"),
835
- children: /* @__PURE__ */ H(v, { children: (e) => k(a, e) })
836
- }), /* @__PURE__ */ H(h, { children: b.map((e) => /* @__PURE__ */ H(g, {
835
+ children: /* @__PURE__ */ H(x, { children: (e) => A(i, e) })
836
+ }), /* @__PURE__ */ H(v, { children: f.map((e) => /* @__PURE__ */ H(y, {
837
837
  value: e,
838
- children: k(a, e)
838
+ children: A(i, e)
839
839
  }, e)) })]
840
840
  }),
841
- N && /* @__PURE__ */ H(O, {
842
- kind: T,
841
+ N && /* @__PURE__ */ H(k, {
842
+ kind: C,
843
843
  label: c("groupEditor.edgeTarget"),
844
844
  exclude: [e.id],
845
- client: s,
846
- onPick: (e) => void u.run(() => n.edges("add", [{
847
- relation: S.trim(),
845
+ client: o,
846
+ onPick: (e) => void u.run(() => t.edges("add", [{
847
+ relation: p.trim(),
848
848
  to: e.id
849
- }])).then((e) => e && w(""))
850
- }, T)
849
+ }])).then((e) => e && S(""))
850
+ }, C)
851
851
  ]
852
852
  }),
853
- /* @__PURE__ */ H(x, { error: u.error })
853
+ /* @__PURE__ */ H(w, { error: u.error })
854
854
  ]
855
855
  });
856
856
  }