import { o as vue_exports, r as link_default } from "../ssr.js";
import { n as server_renderer_exports, t } from "./i18n-CXLOYfyq.js";
import { n as Avatar_default } from "./AppLayout-DbhjYK6s.js";
import { t as CategoryIcon_default } from "./CategoryIcon-aPIi76aO.js";
//#region resources/js/Components/forum/TopicCard.vue?vue&type=script&setup=true&lang.ts
var TopicCard_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue_exports.defineComponent)({
	__name: "TopicCard",
	__ssrInlineRender: true,
	props: { topic: {} },
	setup(__props) {
		return (_ctx, _push, _parent, _attrs) => {
			_push((0, server_renderer_exports.ssrRenderComponent)((0, vue_exports.unref)(link_default), (0, vue_exports.mergeProps)({
				href: `/t/${__props.topic.slug}`,
				class: ["q-post relative flex gap-4 rounded-c border bg-surface p-4 shadow-sm transition hover:-translate-y-0.5 hover:border-primary/60 hover:shadow-md", __props.topic.isNew ? "border-primary/40" : "border-line"],
				style: __props.topic.category?.color ? {
					borderLeftWidth: "4px",
					borderLeftColor: __props.topic.category.color
				} : {}
			}, _attrs), {
				default: (0, vue_exports.withCtx)((_, _push, _parent, _scopeId) => {
					if (_push) {
						if (__props.topic.isNew) _push(`<span class="absolute -right-1.5 -top-1.5 z-10 inline-flex items-center rounded-full bg-primary px-2 py-0.5 text-[10px] font-bold uppercase tracking-wide text-white shadow-md shadow-primary/30"${(0, server_renderer_exports.ssrRenderAttr)("title", (0, vue_exports.unref)(t)("New posts since your last visit"))}${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("New"))}</span>`);
						else _push(`<!---->`);
						_push((0, server_renderer_exports.ssrRenderComponent)(Avatar_default, {
							avatar: __props.topic.author,
							size: 52
						}, null, _parent, _scopeId));
						_push(`<div class="min-w-0 flex-1"${_scopeId}><div class="flex items-center gap-2"${_scopeId}>`);
						if (__props.topic.isPinned) _push(`<svg width="14" height="14" viewBox="0 0 24 24" fill="#e8830c"${_scopeId}><path d="M12 2l3 7h7l-5.5 4 2 7L12 16l-6.5 4 2-7L2 9h7z"${_scopeId}></path></svg>`);
						else _push(`<!---->`);
						_push(`<h3 class="truncate text-base font-bold tracking-tight"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(__props.topic.title)}</h3>`);
						if (__props.topic.isLive) _push(`<span class="inline-flex shrink-0 items-center gap-1.5 rounded-full bg-rose-100 px-2.5 py-0.5 text-xs font-bold text-rose-600"${_scopeId}><span class="h-1.5 w-1.5 animate-pulse rounded-full bg-rose-500"${_scopeId}></span>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("LIVE"))}</span>`);
						else _push(`<!---->`);
						_push(`</div><p class="mt-1.5 line-clamp-2 text-sm text-ink-2"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(__props.topic.excerpt)}</p><div class="mt-2.5 flex flex-wrap items-center gap-x-3.5 gap-y-1.5 text-[13px] text-ink-muted"${_scopeId}>`);
						if (__props.topic.category) {
							_push(`<span class="inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-semibold" style="${(0, server_renderer_exports.ssrRenderStyle)({
								color: __props.topic.category.color,
								background: __props.topic.category.color + "22"
							})}"${_scopeId}>`);
							_push((0, server_renderer_exports.ssrRenderComponent)(CategoryIcon_default, { icon: __props.topic.category.icon }, null, _parent, _scopeId));
							_push(` ${(0, server_renderer_exports.ssrInterpolate)(__props.topic.category.name)}</span>`);
						} else _push(`<!---->`);
						_push(`<span class="font-semibold text-ink-2"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(__props.topic.author.name)}</span><span${_scopeId}>· ${(0, server_renderer_exports.ssrInterpolate)(__props.topic.lastActivity)}</span>`);
						if (__props.topic.reactionTotal) {
							_push(`<span class="flex items-center gap-1"${_scopeId}><!--[-->`);
							(0, server_renderer_exports.ssrRenderList)(__props.topic.reactions.slice(0, 3), (r) => {
								_push(`<span${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(r.emoji)}</span>`);
							});
							_push(`<!--]--><span class="font-semibold"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(__props.topic.reactionTotal)}</span></span>`);
						} else _push(`<!---->`);
						_push(`</div></div><div class="hidden shrink-0 flex-col items-end justify-center gap-2 sm:flex"${_scopeId}><div class="text-center"${_scopeId}><b class="block text-[15px]"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(__props.topic.replyCount)}</b><span class="text-[11px] uppercase tracking-wide text-ink-muted"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("replies"))}</span></div></div>`);
					} else return [
						__props.topic.isNew ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("span", {
							key: 0,
							class: "absolute -right-1.5 -top-1.5 z-10 inline-flex items-center rounded-full bg-primary px-2 py-0.5 text-[10px] font-bold uppercase tracking-wide text-white shadow-md shadow-primary/30",
							title: (0, vue_exports.unref)(t)("New posts since your last visit")
						}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("New")), 9, ["title"])) : (0, vue_exports.createCommentVNode)("", true),
						(0, vue_exports.createVNode)(Avatar_default, {
							avatar: __props.topic.author,
							size: 52
						}, null, 8, ["avatar"]),
						(0, vue_exports.createVNode)("div", { class: "min-w-0 flex-1" }, [
							(0, vue_exports.createVNode)("div", { class: "flex items-center gap-2" }, [
								__props.topic.isPinned ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("svg", {
									key: 0,
									width: "14",
									height: "14",
									viewBox: "0 0 24 24",
									fill: "#e8830c"
								}, [(0, vue_exports.createVNode)("path", { d: "M12 2l3 7h7l-5.5 4 2 7L12 16l-6.5 4 2-7L2 9h7z" })])) : (0, vue_exports.createCommentVNode)("", true),
								(0, vue_exports.createVNode)("h3", { class: "truncate text-base font-bold tracking-tight" }, (0, vue_exports.toDisplayString)(__props.topic.title), 1),
								__props.topic.isLive ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("span", {
									key: 1,
									class: "inline-flex shrink-0 items-center gap-1.5 rounded-full bg-rose-100 px-2.5 py-0.5 text-xs font-bold text-rose-600"
								}, [(0, vue_exports.createVNode)("span", { class: "h-1.5 w-1.5 animate-pulse rounded-full bg-rose-500" }), (0, vue_exports.createTextVNode)((0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("LIVE")), 1)])) : (0, vue_exports.createCommentVNode)("", true)
							]),
							(0, vue_exports.createVNode)("p", { class: "mt-1.5 line-clamp-2 text-sm text-ink-2" }, (0, vue_exports.toDisplayString)(__props.topic.excerpt), 1),
							(0, vue_exports.createVNode)("div", { class: "mt-2.5 flex flex-wrap items-center gap-x-3.5 gap-y-1.5 text-[13px] text-ink-muted" }, [
								__props.topic.category ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("span", {
									key: 0,
									class: "inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-semibold",
									style: {
										color: __props.topic.category.color,
										background: __props.topic.category.color + "22"
									}
								}, [(0, vue_exports.createVNode)(CategoryIcon_default, { icon: __props.topic.category.icon }, null, 8, ["icon"]), (0, vue_exports.createTextVNode)(" " + (0, vue_exports.toDisplayString)(__props.topic.category.name), 1)], 4)) : (0, vue_exports.createCommentVNode)("", true),
								(0, vue_exports.createVNode)("span", { class: "font-semibold text-ink-2" }, (0, vue_exports.toDisplayString)(__props.topic.author.name), 1),
								(0, vue_exports.createVNode)("span", null, "· " + (0, vue_exports.toDisplayString)(__props.topic.lastActivity), 1),
								__props.topic.reactionTotal ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("span", {
									key: 1,
									class: "flex items-center gap-1"
								}, [((0, vue_exports.openBlock)(true), (0, vue_exports.createBlock)(vue_exports.Fragment, null, (0, vue_exports.renderList)(__props.topic.reactions.slice(0, 3), (r) => {
									return (0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("span", { key: r.emoji }, (0, vue_exports.toDisplayString)(r.emoji), 1);
								}), 128)), (0, vue_exports.createVNode)("span", { class: "font-semibold" }, (0, vue_exports.toDisplayString)(__props.topic.reactionTotal), 1)])) : (0, vue_exports.createCommentVNode)("", true)
							])
						]),
						(0, vue_exports.createVNode)("div", { class: "hidden shrink-0 flex-col items-end justify-center gap-2 sm:flex" }, [(0, vue_exports.createVNode)("div", { class: "text-center" }, [(0, vue_exports.createVNode)("b", { class: "block text-[15px]" }, (0, vue_exports.toDisplayString)(__props.topic.replyCount), 1), (0, vue_exports.createVNode)("span", { class: "text-[11px] uppercase tracking-wide text-ink-muted" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("replies")), 1)])])
					];
				}),
				_: 1
			}, _parent));
		};
	}
});
//#endregion
//#region resources/js/Components/forum/TopicCard.vue
var _sfc_setup = TopicCard_vue_vue_type_script_setup_true_lang_default.setup;
TopicCard_vue_vue_type_script_setup_true_lang_default.setup = (props, ctx) => {
	const ssrContext = (0, vue_exports.useSSRContext)();
	(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("resources/js/Components/forum/TopicCard.vue");
	return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
var TopicCard_default = TopicCard_vue_vue_type_script_setup_true_lang_default;
//#endregion
export { TopicCard_default as t };
