@openrails/contentkit-ui 0.98.1 → 0.98.4

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.
@@ -1,40 +1,42 @@
1
1
  import { RenditionImg as e } from "../rendition-img.js";
2
- import { useLanguageName as t, useMessages as n } from "../../i18n/context.js";
3
- import { ContentKitContext as r } from "../../react/context.js";
4
- import { HoverPreview as i } from "../hover-preview.js";
5
- import { Badge as a } from "../../ui/badge.js";
6
- import { RelativeTime as o, formatDate as s } from "../social/parts.js";
7
- import { GroupAvatar as c, GroupLink as l, labelOf as u } from "../groups/parts.js";
8
- import { priceLabel as d } from "./paywall.js";
9
- import { useCallback as f, useContext as p, useState as m } from "react";
10
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
11
- import { cn as _ } from "cn";
12
- import { FavouriteIcon as v, LockIcon as y, ThumbsUpIcon as b } from "@hugeicons/core-free-icons";
13
- import { HugeiconsIcon as x } from "@hugeicons/react";
2
+ import { ratio as t } from "../../client/aspect.js";
3
+ import { useLanguageName as n, useMessages as r } from "../../i18n/context.js";
4
+ import { ContentKitContext as i } from "../../react/context.js";
5
+ import { usePresets as a } from "../../react/public.js";
6
+ import { HoverPreview as o } from "../hover-preview.js";
7
+ import { Badge as s } from "../../ui/badge.js";
8
+ import { RelativeTime as c, formatDate as l } from "../social/parts.js";
9
+ import { GroupAvatar as u, GroupLink as d, labelOf as f } from "../groups/parts.js";
10
+ import { priceLabel as p } from "./paywall.js";
11
+ import { useCallback as m, useContext as h, useState as g } from "react";
12
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
13
+ import { cn as y } from "cn";
14
+ import { FavouriteIcon as b, LockIcon as x, ThumbsUpIcon as S } from "@hugeicons/core-free-icons";
15
+ import { HugeiconsIcon as C } from "@hugeicons/react";
14
16
  //#region src/components/content/card.tsx
15
- function S({ card: e, decorate: t, aboveTitle: n }) {
17
+ function w({ card: e, decorate: t, aboveTitle: n }) {
16
18
  let r = t?.(e);
17
- return r == null || r === !1 ? null : /* @__PURE__ */ h("span", {
18
- className: _("pointer-events-none absolute inset-0", n && "z-20"),
19
+ return r == null || r === !1 ? null : /* @__PURE__ */ _("span", {
20
+ className: y("pointer-events-none absolute inset-0", n && "z-20"),
19
21
  "data-ckui": "card-decorations",
20
22
  children: r
21
23
  });
22
24
  }
23
- var C = (e, t) => new Intl.NumberFormat(t, {
25
+ var T = (e, t) => new Intl.NumberFormat(t, {
24
26
  notation: "compact",
25
27
  maximumFractionDigits: 1
26
28
  }).format(e);
27
- function w(e, t, n = [], r) {
29
+ function E(e, t, n = [], r) {
28
30
  if (t.allowed) return null;
29
31
  if (t.unknown) return e.t("contents.unknownAccess");
30
32
  let i = t.offers?.[0];
31
- if (i) return i.target.kind === "group" && Number(i.terms.amount) === 0 ? e.t("contents.joinFree") : d(e, i.terms);
33
+ if (i) return i.target.kind === "group" && Number(i.terms.amount) === 0 ? e.t("contents.joinFree") : p(e, i.terms);
32
34
  let a = t.sell?.find((e) => n.includes(e));
33
- return a ? u(r, a) : t.sell?.some((e) => e.includes(":group:")) ? e.t("contents.members") : t.sell?.length ? e.t("contents.forSale") : e.t("contents.locked");
35
+ return a ? f(r, a) : t.sell?.some((e) => e.includes(":group:")) ? e.t("contents.members") : t.sell?.length ? e.t("contents.forSale") : e.t("contents.locked");
34
36
  }
35
- function T(e, t) {
36
- let n = p(r)?.navigate;
37
- return f((r) => {
37
+ function D(e, t) {
38
+ let n = h(i)?.navigate;
39
+ return m((r) => {
38
40
  t?.(), !(!n || !e || r.defaultPrevented || r.button !== 0 || r.metaKey || r.ctrlKey || r.shiftKey || r.altKey) && (r.preventDefault(), n(e));
39
41
  }, [
40
42
  n,
@@ -42,273 +44,285 @@ function T(e, t) {
42
44
  t
43
45
  ]);
44
46
  }
45
- function E({ card: r, href: o, onOpen: c, shape: l = "portrait", aspectRatio: d, titlePosition: p = "below", loadMedia: E = !0, groupKinds: k, chips: A = 3, filterEntity: j, entityStyle: M = "chips", metadata: N, showCounts: P = !0, tiers: F, labels: I, owner: L = !0, ownerHref: R, decorate: ee, children: te, className: ne }) {
46
- let z = n(), { t: B } = z, re = t(), V = o ? o(r) : r.path, H = T(V, f(() => c?.(r), [c, r])), U = w(z, r.access, F, I), W = r.version, G = r.viewer && r.viewer.progress_max > 0 ? Math.min(1, r.viewer.progress / r.viewer.progress_max) : 0, K = (k ?? Object.keys(r.entities)).flatMap((e) => (r.entities[e] ?? []).filter((t) => !j || j(t, e)).slice(0, A).map((t) => ({
47
+ function O({ card: i, client: c, href: u, onOpen: d, shape: p = "portrait", aspectRatio: h, titlePosition: O = "below", loadMedia: j = !0, groupKinds: M, chips: ee = 3, filterEntity: N, entityStyle: P = "chips", entityLayout: te = "inline", metadata: F, showCounts: ne = !0, tiers: re, labels: I, owner: ie = !0, ownerHref: ae, decorate: oe, children: se, className: ce }) {
48
+ let L = r(), { presets: le } = a({ client: c }), R = h ?? t(le.find((e) => e.kind === i.kind && e.name === "cover")?.aspect), { t: z } = L, ue = n(), B = u ? u(i) : i.path, V = D(B, m(() => d?.(i), [d, i])), H = E(L, i.access, re, I), U = i.version, W = i.viewer && i.viewer.progress_max > 0 ? Math.min(1, i.viewer.progress / i.viewer.progress_max) : 0, G = (M ?? Object.keys(i.entities)).map((e) => ({
47
49
  kind: e,
48
- entity: t
49
- }))), q = W.duration_ms ? Math.round(W.duration_ms / 6e4) : 0, J = N?.traits, Y = J === !1 ? [] : Array.isArray(J) ? W.traits.filter((e) => J.includes(e)) : W.traits, X = [
50
- ...N?.languages === !1 ? [] : W.languages.map(re),
51
- N?.pages !== !1 && W.pages ? z.plural("contents.pages", W.pages) : null,
52
- N?.duration !== !1 && q ? z.plural("contents.minutes", q) : null
53
- ].filter(Boolean), Z = r.title || r.code, Q = K.length > 0 ? /* @__PURE__ */ h("ul", {
54
- className: _("flex flex-wrap", M === "text" ? "gap-x-2 gap-y-1" : "gap-1"),
50
+ entities: (i.entities[e] ?? []).filter((t) => !N || N(t, e)).slice(0, ee)
51
+ })).filter(({ entities: e }) => e.length > 0), K = U.duration_ms ? Math.round(U.duration_ms / 6e4) : 0, q = F?.traits, J = q === !1 ? [] : Array.isArray(q) ? U.traits.filter((e) => q.includes(e)) : U.traits, Y = [
52
+ ...F?.languages === !1 ? [] : U.languages.map(ue),
53
+ F?.pages !== !1 && U.pages ? L.plural("contents.pages", U.pages) : null,
54
+ F?.duration !== !1 && K ? L.plural("contents.minutes", K) : null
55
+ ].filter(Boolean), X = i.title || i.code, Z = y("flex flex-wrap", P === "text" ? "gap-x-2 gap-y-1" : "gap-1"), Q = (e, t) => t.map((t) => /* @__PURE__ */ _("li", {
56
+ "data-kind": e,
57
+ children: /* @__PURE__ */ _(A, {
58
+ url: t.path,
59
+ name: t.name || t.slug,
60
+ variant: P
61
+ })
62
+ }, `${e}:${t.id}`)), $ = G.length > 0 ? te === "rows" ? /* @__PURE__ */ _("div", {
63
+ className: "grid gap-1",
55
64
  "data-ckui": "card-groups",
56
- children: K.map(({ kind: e, entity: t }) => /* @__PURE__ */ h("li", {
65
+ "data-layout": "rows",
66
+ children: G.map(({ kind: e, entities: t }) => /* @__PURE__ */ _("ul", {
67
+ className: Z,
68
+ "aria-label": f(I, e),
69
+ "data-ckui": "card-group-row",
57
70
  "data-kind": e,
58
- children: /* @__PURE__ */ h(O, {
59
- url: t.path,
60
- name: t.name || t.slug,
61
- variant: M
62
- })
63
- }, `${e}:${t.id}`))
64
- }) : null, $ = /* @__PURE__ */ g("a", {
65
- href: V,
66
- onClick: H,
67
- className: _("text-lg leading-snug font-medium break-words focus-visible:underline sm:text-xl", p === "cover" ? "absolute inset-x-0 bottom-0 z-10 bg-linear-to-t from-black/90 via-black/60 to-transparent px-3 pt-10 pb-3 text-white hover:underline" : "hover:underline"),
71
+ children: Q(e, t)
72
+ }, e))
73
+ }) : /* @__PURE__ */ _("ul", {
74
+ className: Z,
75
+ "data-ckui": "card-groups",
76
+ "data-layout": "inline",
77
+ children: G.flatMap(({ kind: e, entities: t }) => Q(e, t))
78
+ }) : null, de = /* @__PURE__ */ v("a", {
79
+ href: B,
80
+ onClick: V,
81
+ className: y("text-lg leading-snug font-medium break-words focus-visible:underline sm:text-xl", O === "cover" ? "absolute inset-x-0 bottom-0 z-10 bg-linear-to-t from-black/90 via-black/60 to-transparent px-3 pt-10 pb-3 text-white hover:underline" : "hover:underline"),
68
82
  "data-ckui": "card-title",
69
- children: [/* @__PURE__ */ h("span", {
83
+ children: [/* @__PURE__ */ _("span", {
70
84
  className: "line-clamp-2",
71
- children: Z
72
- }), U && /* @__PURE__ */ g("span", {
85
+ children: X
86
+ }), H && /* @__PURE__ */ v("span", {
73
87
  className: "sr-only",
74
88
  children: [
75
89
  " (",
76
- U,
90
+ H,
77
91
  ")"
78
92
  ]
79
93
  })]
80
- }), [ie, ae] = m(null);
81
- return /* @__PURE__ */ g("article", {
82
- ref: ae,
83
- className: _("group/card grid content-start gap-2", ne),
94
+ }), [fe, pe] = g(null);
95
+ return /* @__PURE__ */ v("article", {
96
+ ref: pe,
97
+ className: y("group/card grid content-start gap-2", ce),
84
98
  "data-ckui": "content-card",
85
- "data-id": r.id,
86
- "data-locked": U ? "" : void 0,
87
- lang: r.language || void 0,
88
- children: [/* @__PURE__ */ g("div", {
99
+ "data-id": i.id,
100
+ "data-locked": H ? "" : void 0,
101
+ lang: i.language || void 0,
102
+ children: [/* @__PURE__ */ v("div", {
89
103
  className: "relative overflow-hidden rounded-lg",
90
104
  "data-ckui": "card-cover",
91
105
  children: [
92
- /* @__PURE__ */ g("a", {
93
- href: V,
94
- onClick: H,
106
+ /* @__PURE__ */ v("a", {
107
+ href: B,
108
+ onClick: V,
95
109
  className: "relative block overflow-hidden rounded-lg bg-muted",
96
110
  tabIndex: -1,
97
111
  "aria-hidden": !0,
98
112
  children: [
99
- /* @__PURE__ */ h("div", {
113
+ /* @__PURE__ */ _("div", {
100
114
  "data-ckui": "card-cover-frame",
101
- className: d === void 0 ? l === "landscape" ? "aspect-video" : "aspect-[3/4]" : void 0,
102
- style: d === void 0 ? void 0 : { aspectRatio: d },
103
- children: E ? /* @__PURE__ */ h(e, {
104
- outputs: r.cover,
115
+ className: R === void 0 ? p === "landscape" ? "aspect-video" : "aspect-[3/4]" : void 0,
116
+ style: R === void 0 ? void 0 : { aspectRatio: R },
117
+ children: j ? /* @__PURE__ */ _(e, {
118
+ outputs: i.cover,
105
119
  alt: "",
106
120
  fit: "cover",
107
121
  skeleton: !0,
108
122
  loading: "lazy",
109
123
  className: "size-full transition-transform group-hover/card:scale-[1.02]",
110
- fallback: /* @__PURE__ */ h("span", {
124
+ fallback: /* @__PURE__ */ _("span", {
111
125
  className: "grid size-full place-items-center text-2xl font-semibold text-muted-foreground",
112
- children: Z.charAt(0).toUpperCase()
126
+ children: X.charAt(0).toUpperCase()
113
127
  })
114
- }) : /* @__PURE__ */ h("span", {
128
+ }) : /* @__PURE__ */ _("span", {
115
129
  className: "block size-full bg-muted",
116
130
  "aria-hidden": !0
117
131
  })
118
132
  }),
119
- E && W.hls && /* @__PURE__ */ h(i, {
133
+ j && U.hls && /* @__PURE__ */ _(o, {
120
134
  item: {
121
- kind: r.kind,
122
- id: r.id,
123
- version: W.id
135
+ kind: i.kind,
136
+ id: i.id,
137
+ version: U.id
124
138
  },
125
- dir: W.hls,
126
- duration: W.duration_ms ? W.duration_ms / 1e3 : void 0,
127
- target: ie
139
+ dir: U.hls,
140
+ duration: U.duration_ms ? U.duration_ms / 1e3 : void 0,
141
+ target: fe
128
142
  }),
129
- U && /* @__PURE__ */ g("span", {
143
+ H && /* @__PURE__ */ v("span", {
130
144
  className: "absolute top-2 left-2 inline-flex items-center gap-1 rounded-md bg-background/85 px-1.5 py-0.5 text-xs font-medium text-foreground shadow-sm",
131
145
  "data-ckui": "card-lock",
132
- children: [/* @__PURE__ */ h(x, {
133
- icon: y,
146
+ children: [/* @__PURE__ */ _(C, {
147
+ icon: x,
134
148
  strokeWidth: 2,
135
149
  className: "size-3.5",
136
150
  "aria-hidden": !0
137
- }), U]
151
+ }), H]
138
152
  }),
139
- G > 0 && /* @__PURE__ */ h("span", {
140
- className: _("absolute inset-x-0 bottom-0 h-1 bg-background/60", p === "cover" && "z-20"),
153
+ W > 0 && /* @__PURE__ */ _("span", {
154
+ className: y("absolute inset-x-0 bottom-0 h-1 bg-background/60", O === "cover" && "z-20"),
141
155
  "data-ckui": "card-progress",
142
- children: /* @__PURE__ */ h("span", {
156
+ children: /* @__PURE__ */ _("span", {
143
157
  className: "block h-full bg-primary",
144
- style: { width: `${Math.round(G * 100)}%` }
158
+ style: { width: `${Math.round(W * 100)}%` }
145
159
  })
146
160
  })
147
161
  ]
148
162
  }),
149
- p === "cover" && $,
150
- E && /* @__PURE__ */ h(S, {
151
- card: r,
152
- decorate: ee,
153
- aboveTitle: p === "cover"
163
+ O === "cover" && de,
164
+ j && /* @__PURE__ */ _(w, {
165
+ card: i,
166
+ decorate: oe,
167
+ aboveTitle: O === "cover"
154
168
  })
155
169
  ]
156
- }), /* @__PURE__ */ g("div", {
170
+ }), /* @__PURE__ */ v("div", {
157
171
  className: "grid gap-1",
158
172
  children: [
159
- p === "below" && $,
160
- M === "text" && Q,
161
- L && r.owner && /* @__PURE__ */ h(D, {
162
- group: r.owner,
163
- href: R,
164
- loadMedia: E
173
+ O === "below" && de,
174
+ P === "text" && $,
175
+ ie && i.owner && /* @__PURE__ */ _(k, {
176
+ group: i.owner,
177
+ href: ae,
178
+ loadMedia: j
165
179
  }),
166
- Y.length > 0 && /* @__PURE__ */ h("div", {
180
+ J.length > 0 && /* @__PURE__ */ _("div", {
167
181
  className: "flex flex-wrap gap-1",
168
182
  "data-ckui": "card-traits",
169
- children: Y.map((e) => /* @__PURE__ */ h(a, {
183
+ children: J.map((e) => /* @__PURE__ */ _(s, {
170
184
  variant: "outline",
171
185
  className: "h-auto rounded-md text-sm text-muted-foreground",
172
186
  "data-ckui": "card-trait",
173
187
  "data-trait": e,
174
- children: u(I, e)
188
+ children: f(I, e)
175
189
  }, e))
176
190
  }),
177
- X.length > 0 && /* @__PURE__ */ h("p", {
191
+ Y.length > 0 && /* @__PURE__ */ _("p", {
178
192
  className: "text-xs text-muted-foreground",
179
- children: X.join(" · ")
193
+ children: Y.join(" · ")
180
194
  }),
181
- r.viewer?.completed && /* @__PURE__ */ h(a, {
195
+ i.viewer?.completed && /* @__PURE__ */ _(s, {
182
196
  variant: "secondary",
183
197
  className: "justify-self-start",
184
- children: B("contents.completed")
198
+ children: z("contents.completed")
185
199
  }),
186
- !r.access.allowed && r.access.free_after && /* @__PURE__ */ h("p", {
200
+ !i.access.allowed && i.access.free_after && /* @__PURE__ */ _("p", {
187
201
  className: "text-xs text-muted-foreground",
188
- children: B("contents.freeFrom", { date: s(z, r.access.free_after, !1) })
202
+ children: z("contents.freeFrom", { date: l(L, i.access.free_after, !1) })
189
203
  }),
190
- M === "chips" && Q,
191
- P && (r.counts.favorites !== void 0 || r.counts.likes !== void 0) && /* @__PURE__ */ g("p", {
204
+ P === "chips" && $,
205
+ ne && (i.counts.favorites !== void 0 || i.counts.likes !== void 0) && /* @__PURE__ */ v("p", {
192
206
  className: "flex items-center gap-3 text-xs text-muted-foreground tabular-nums",
193
207
  "data-ckui": "card-counts",
194
- children: [r.counts.favorites !== void 0 && /* @__PURE__ */ g("span", {
208
+ children: [i.counts.favorites !== void 0 && /* @__PURE__ */ v("span", {
195
209
  className: "inline-flex items-center gap-1",
196
- title: B("contents.favorites"),
210
+ title: z("contents.favorites"),
197
211
  children: [
198
- /* @__PURE__ */ h(x, {
199
- icon: v,
212
+ /* @__PURE__ */ _(C, {
213
+ icon: b,
200
214
  strokeWidth: 2,
201
- className: _("size-3.5", r.viewer?.favorited && "fill-current text-primary"),
215
+ className: y("size-3.5", i.viewer?.favorited && "fill-current text-primary"),
202
216
  "aria-hidden": !0
203
217
  }),
204
- /* @__PURE__ */ h("span", {
218
+ /* @__PURE__ */ _("span", {
205
219
  className: "sr-only",
206
- children: B("contents.favorites")
220
+ children: z("contents.favorites")
207
221
  }),
208
- C(r.counts.favorites, z.language)
222
+ T(i.counts.favorites, L.language)
209
223
  ]
210
- }), r.counts.likes !== void 0 && /* @__PURE__ */ g("span", {
224
+ }), i.counts.likes !== void 0 && /* @__PURE__ */ v("span", {
211
225
  className: "inline-flex items-center gap-1",
212
- title: B("contents.likes"),
226
+ title: z("contents.likes"),
213
227
  children: [
214
- /* @__PURE__ */ h(x, {
215
- icon: b,
228
+ /* @__PURE__ */ _(C, {
229
+ icon: S,
216
230
  strokeWidth: 2,
217
231
  className: "size-3.5",
218
232
  "aria-hidden": !0
219
233
  }),
220
- /* @__PURE__ */ h("span", {
234
+ /* @__PURE__ */ _("span", {
221
235
  className: "sr-only",
222
- children: B("contents.likes")
236
+ children: z("contents.likes")
223
237
  }),
224
- C(r.counts.likes, z.language)
238
+ T(i.counts.likes, L.language)
225
239
  ]
226
240
  })]
227
241
  }),
228
- te
242
+ se
229
243
  ]
230
244
  })]
231
245
  });
232
246
  }
233
- function D({ group: e, href: t, className: n, loadMedia: r = !0 }) {
234
- return /* @__PURE__ */ h("span", {
235
- className: _("flex min-w-0 text-xs text-muted-foreground", n),
247
+ function k({ group: e, href: t, className: n, loadMedia: r = !0 }) {
248
+ return /* @__PURE__ */ _("span", {
249
+ className: y("flex min-w-0 text-xs text-muted-foreground", n),
236
250
  "data-ckui": "card-owner",
237
251
  "data-id": e.id,
238
- children: /* @__PURE__ */ g(l, {
252
+ children: /* @__PURE__ */ v(d, {
239
253
  group: e,
240
254
  href: t,
241
255
  className: "inline-flex min-w-0 items-center gap-1.5 hover:text-foreground",
242
- children: [r ? /* @__PURE__ */ h(c, {
256
+ children: [r ? /* @__PURE__ */ _(u, {
243
257
  group: e,
244
258
  className: "size-5 shrink-0 text-[0.625rem]"
245
- }) : /* @__PURE__ */ h("span", {
259
+ }) : /* @__PURE__ */ _("span", {
246
260
  className: "size-5 shrink-0 rounded-full bg-muted",
247
261
  "aria-hidden": !0
248
- }), /* @__PURE__ */ h("span", {
262
+ }), /* @__PURE__ */ _("span", {
249
263
  className: "truncate",
250
264
  children: e.name || e.slug
251
265
  })]
252
266
  })
253
267
  });
254
268
  }
255
- function O({ url: e, name: t, variant: n = "chips" }) {
256
- let r = T(e), i = n === "text" ? "text-sm text-muted-foreground" : "inline-block rounded-md border border-border px-1.5 py-0.5 text-sm text-muted-foreground";
257
- return e ? /* @__PURE__ */ h("a", {
269
+ function A({ url: e, name: t, variant: n = "chips" }) {
270
+ let r = D(e), i = n === "text" ? "text-sm text-muted-foreground" : "inline-block rounded-md border border-border px-1.5 py-0.5 text-sm text-muted-foreground";
271
+ return e ? /* @__PURE__ */ _("a", {
258
272
  href: e,
259
273
  onClick: r,
260
- className: _(i, "hover:text-foreground", n === "text" ? "hover:underline" : "hover:bg-muted"),
274
+ className: y(i, "hover:text-foreground", n === "text" ? "hover:underline" : "hover:bg-muted"),
261
275
  children: t
262
- }) : /* @__PURE__ */ h("span", {
276
+ }) : /* @__PURE__ */ _("span", {
263
277
  className: i,
264
278
  children: t
265
279
  });
266
280
  }
267
- function k({ card: t, href: r, onOpen: i, tiers: a, labels: s, byline: c, owner: l = !0, ownerHref: u, loadMedia: d = !0, showCounts: p = !0, decorate: m, children: b, className: E }) {
268
- let O = n(), k = r ? r(t) : t.path, A = T(k, f(() => i?.(t), [i, t])), j = w(O, t.access, a, s), M = t.title || t.code;
269
- return /* @__PURE__ */ g("article", {
270
- className: _("grid gap-3 rounded-lg border border-border p-3", E),
281
+ function j({ card: t, href: n, onOpen: i, tiers: a, labels: o, byline: s, owner: l = !0, ownerHref: u, loadMedia: d = !0, showCounts: f = !0, decorate: p, children: h, className: g }) {
282
+ let S = r(), O = n ? n(t) : t.path, A = D(O, m(() => i?.(t), [i, t])), j = E(S, t.access, a, o), M = t.title || t.code;
283
+ return /* @__PURE__ */ v("article", {
284
+ className: y("grid gap-3 rounded-lg border border-border p-3", g),
271
285
  "data-ckui": "post-card",
272
286
  "data-id": t.id,
273
287
  "data-locked": j ? "" : void 0,
274
288
  lang: t.language || void 0,
275
289
  children: [
276
- c ?? (l && t.owner && /* @__PURE__ */ h(D, {
290
+ s ?? (l && t.owner && /* @__PURE__ */ _(k, {
277
291
  group: t.owner,
278
292
  href: u,
279
293
  loadMedia: d,
280
294
  className: "text-sm"
281
295
  })),
282
- /* @__PURE__ */ g("a", {
283
- href: k,
296
+ /* @__PURE__ */ v("a", {
297
+ href: O,
284
298
  onClick: A,
285
299
  className: "grid gap-2",
286
- children: [/* @__PURE__ */ h("span", {
300
+ children: [/* @__PURE__ */ _("span", {
287
301
  className: "font-medium break-words hover:underline",
288
302
  "data-ckui": "card-title",
289
303
  children: M
290
- }), t.cover.length > 0 && /* @__PURE__ */ g("span", {
304
+ }), t.cover.length > 0 && /* @__PURE__ */ v("span", {
291
305
  className: "relative block aspect-video overflow-hidden rounded-md bg-muted",
292
306
  children: [
293
- d && /* @__PURE__ */ h(e, {
307
+ d && /* @__PURE__ */ _(e, {
294
308
  outputs: t.cover,
295
309
  alt: "",
296
310
  fit: "cover",
297
311
  skeleton: !0,
298
312
  loading: "lazy",
299
- className: _("size-full", j && "blur-md")
313
+ className: y("size-full", j && "blur-md")
300
314
  }),
301
- d && /* @__PURE__ */ h(S, {
315
+ d && /* @__PURE__ */ _(w, {
302
316
  card: t,
303
- decorate: m
317
+ decorate: p
304
318
  }),
305
- j && /* @__PURE__ */ h("span", {
319
+ j && /* @__PURE__ */ _("span", {
306
320
  className: "absolute inset-0 grid place-items-center",
307
- children: /* @__PURE__ */ g("span", {
321
+ children: /* @__PURE__ */ v("span", {
308
322
  className: "inline-flex items-center gap-1 rounded-md bg-background/85 px-2 py-1 text-xs font-medium shadow-sm",
309
323
  "data-ckui": "card-lock",
310
- children: [/* @__PURE__ */ h(x, {
311
- icon: y,
324
+ children: [/* @__PURE__ */ _(C, {
325
+ icon: x,
312
326
  strokeWidth: 2,
313
327
  className: "size-3.5",
314
328
  "aria-hidden": !0
@@ -318,38 +332,38 @@ function k({ card: t, href: r, onOpen: i, tiers: a, labels: s, byline: c, owner:
318
332
  ]
319
333
  })]
320
334
  }),
321
- /* @__PURE__ */ g("p", {
335
+ /* @__PURE__ */ v("p", {
322
336
  className: "flex flex-wrap items-center gap-3 text-xs text-muted-foreground",
323
337
  children: [
324
- t.published_at && /* @__PURE__ */ h(o, { at: t.published_at }),
325
- !t.cover.length && j && /* @__PURE__ */ h("span", {
338
+ t.published_at && /* @__PURE__ */ _(c, { at: t.published_at }),
339
+ !t.cover.length && j && /* @__PURE__ */ _("span", {
326
340
  "data-ckui": "card-lock",
327
341
  children: j
328
342
  }),
329
- p && t.counts.favorites !== void 0 && /* @__PURE__ */ g("span", {
343
+ f && t.counts.favorites !== void 0 && /* @__PURE__ */ v("span", {
330
344
  className: "inline-flex items-center gap-1 tabular-nums",
331
345
  "data-ckui": "card-counts",
332
346
  children: [
333
- /* @__PURE__ */ h(x, {
334
- icon: v,
347
+ /* @__PURE__ */ _(C, {
348
+ icon: b,
335
349
  strokeWidth: 2,
336
- className: _("size-3.5", t.viewer?.favorited && "fill-current text-primary"),
350
+ className: y("size-3.5", t.viewer?.favorited && "fill-current text-primary"),
337
351
  "aria-hidden": !0
338
352
  }),
339
- /* @__PURE__ */ h("span", {
353
+ /* @__PURE__ */ _("span", {
340
354
  className: "sr-only",
341
- children: O.t("contents.favorites")
355
+ children: S.t("contents.favorites")
342
356
  }),
343
- C(t.counts.favorites, O.language)
357
+ T(t.counts.favorites, S.language)
344
358
  ]
345
359
  })
346
360
  ]
347
361
  }),
348
- b
362
+ h
349
363
  ]
350
364
  });
351
365
  }
352
366
  //#endregion
353
- export { E as ContentCard, D as OwnerChip, k as PostCard, w as lockLabel };
367
+ export { O as ContentCard, k as OwnerChip, j as PostCard, E as lockLabel };
354
368
 
355
369
  //# sourceMappingURL=card.js.map