import { a as usePage, n as head_default, o as vue_exports, r as link_default, s as router } from "../ssr.js";
import { n as server_renderer_exports, t } from "./i18n-CXLOYfyq.js";
import { i as convoro, n as useAuthModal, r as Slot_default } from "./AuthModal-BJdeGGae.js";
import { n as Avatar_default, t as AppLayout_default } from "./AppLayout-Cibl7rtt.js";
import { t as EmptyState_default } from "./EmptyState-DTbgInaI.js";
import { t as CategoryIcon_default } from "./CategoryIcon-aPIi76aO.js";
import { t as TopicCard_default } from "./TopicCard-B0vN1UVB.js";
//#region resources/js/Components/AskBar.vue?vue&type=script&setup=true&lang.ts
var AskBar_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue_exports.defineComponent)({
	__name: "AskBar",
	__ssrInlineRender: true,
	setup(__props) {
		const page = usePage();
		const siteName = (0, vue_exports.computed)(() => page.props.site?.name || "the community");
		const suggestions = (0, vue_exports.computed)(() => page.props.ask?.suggestions ?? []);
		const q = (0, vue_exports.ref)("");
		const loading = (0, vue_exports.ref)(false);
		const asked = (0, vue_exports.ref)(false);
		const answer = (0, vue_exports.ref)("");
		const citations = (0, vue_exports.ref)([]);
		return (_ctx, _push, _parent, _attrs) => {
			_push(`<section${(0, server_renderer_exports.ssrRenderAttrs)((0, vue_exports.mergeProps)({ class: "overflow-hidden rounded-c border border-line bg-surface shadow-sm" }, _attrs))}><div class="bg-gradient-to-r from-primary/10 via-primary/5 to-transparent p-5"><div class="flex items-center gap-2"><span class="grid h-7 w-7 place-items-center rounded-lg bg-primary text-white"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3l1.9 4.6L18.5 9l-4.6 1.9L12 15l-1.9-4.1L5.5 9l4.6-1.4z"></path><path d="M5 16l.9 2.1L8 19l-2.1.9L5 22l-.9-2.1L2 19l2.1-.9z"></path></svg></span><h2 class="text-base font-extrabold tracking-tight text-ink">${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Ask {site}", { site: siteName.value }))}</h2></div><p class="mt-1 text-sm text-ink-muted">Get an instant answer from the community&#39;s knowledge — with links to the threads it came from.</p><form class="mt-3 flex gap-2"><input${(0, server_renderer_exports.ssrRenderAttr)("value", q.value)} type="text"${(0, server_renderer_exports.ssrRenderAttr)("placeholder", (0, vue_exports.unref)(t)("Ask anything about {site}…", { site: siteName.value }))} class="flex-1 rounded-c border-line bg-surface-2 text-ink placeholder:text-ink-muted focus:border-primary focus:ring-primary"><button type="submit"${(0, server_renderer_exports.ssrIncludeBooleanAttr)(loading.value || q.value.trim().length < 3) ? " disabled" : ""} class="shrink-0 rounded-c bg-primary px-5 py-2.5 text-sm font-semibold text-white shadow-lg shadow-primary/30 hover:bg-primary-600 disabled:opacity-50">${(0, server_renderer_exports.ssrInterpolate)(loading.value ? (0, vue_exports.unref)(t)("Thinking…") : (0, vue_exports.unref)(t)("Ask"))}</button></form>`);
			if (!asked.value && suggestions.value.length) {
				_push(`<div class="mt-3 flex flex-wrap gap-2"><span class="self-center text-xs font-semibold text-ink-muted">${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Try:"))}</span><!--[-->`);
				(0, server_renderer_exports.ssrRenderList)(suggestions.value, (s, i) => {
					_push(`<button type="button" class="rounded-full border border-line bg-surface px-3 py-1 text-xs font-medium text-ink-2 hover:border-primary/40 hover:text-primary">${(0, server_renderer_exports.ssrInterpolate)(s)}</button>`);
				});
				_push(`<!--]--></div>`);
			} else _push(`<!---->`);
			_push(`</div>`);
			if (asked.value) {
				_push(`<div class="border-t border-line p-5">`);
				if (loading.value) _push(`<div class="flex items-center gap-2 text-sm text-ink-muted"><span class="h-2 w-2 animate-pulse rounded-full bg-primary"></span> Searching the community &amp; writing an answer… </div>`);
				else {
					_push(`<!--[--><div class="whitespace-pre-wrap text-[0.95rem] leading-relaxed text-ink">${(0, server_renderer_exports.ssrInterpolate)(answer.value)}</div>`);
					if (citations.value.length) {
						_push(`<div class="mt-4"><div class="mb-1.5 text-xs font-bold uppercase tracking-wide text-ink-muted">${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Sources"))}</div><ol class="space-y-1"><!--[-->`);
						(0, server_renderer_exports.ssrRenderList)(citations.value, (c) => {
							_push(`<li class="text-sm"><a${(0, server_renderer_exports.ssrRenderAttr)("href", c.url)} class="text-primary hover:underline">[${(0, server_renderer_exports.ssrInterpolate)(c.n)}] ${(0, server_renderer_exports.ssrInterpolate)(c.title)}</a></li>`);
						});
						_push(`<!--]--></ol></div>`);
					} else _push(`<!---->`);
					_push(`<div class="mt-4 flex items-center gap-3 text-xs text-ink-muted"><button type="button" class="font-semibold text-primary hover:underline">${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Ask another question"))}</button><span>· AI-generated — verify important details.</span></div><!--]-->`);
				}
				_push(`</div>`);
			} else _push(`<!---->`);
			_push(`</section>`);
		};
	}
});
//#endregion
//#region resources/js/Components/AskBar.vue
var _sfc_setup$1 = AskBar_vue_vue_type_script_setup_true_lang_default.setup;
AskBar_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/AskBar.vue");
	return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
var AskBar_default = AskBar_vue_vue_type_script_setup_true_lang_default;
//#endregion
//#region resources/js/Pages/Forum/Index.vue?vue&type=script&setup=true&lang.ts
var Index_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue_exports.defineComponent)({
	__name: "Index",
	__ssrInlineRender: true,
	props: {
		view: {},
		sort: {},
		activeCategory: {},
		categories: {},
		topics: {},
		stats: {},
		widgets: {},
		widgetData: {},
		aboutHtml: {},
		aboutTitle: {}
	},
	setup(__props) {
		const pg = usePage();
		const auth = useAuthModal();
		const loggedIn = (0, vue_exports.computed)(() => !!pg.props.auth?.user);
		const askEnabled = (0, vue_exports.computed)(() => !!pg.props.ask?.enabled);
		const barHasCompose = (0, vue_exports.computed)(() => {
			const m = pg.props.mobileNav;
			return !!m?.enabled && (m?.tabs ?? []).includes("compose");
		});
		function startTopic() {
			loggedIn.value ? router.visit("/new") : auth.open("register");
		}
		const search = (0, vue_exports.ref)("");
		function goSearch() {
			const q = search.value.trim();
			if (q) router.visit("/search?q=" + encodeURIComponent(q));
		}
		const props = __props;
		const initialLive = new Set(props.topics.data.filter((t) => t.isLive).map((t) => t.id));
		const liveSet = (0, vue_exports.ref)(new Set(initialLive));
		const withLive = (t) => ({
			...t,
			isLive: liveSet.value.has(t.id)
		});
		let liveTimer = null;
		async function pollLive() {
			const ids = props.topics.data.map((t) => t.id);
			if (!ids.length) return;
			try {
				const d = await (await fetch("/api/live-topics?ids=" + ids.join(","), { headers: { Accept: "application/json" } })).json();
				liveSet.value = new Set([...initialLive, ...d.live || []]);
			} catch {}
		}
		(0, vue_exports.onMounted)(() => {
			liveTimer = setInterval(pollLive, 2e4);
		});
		(0, vue_exports.onUnmounted)(() => {
			if (liveTimer) clearInterval(liveTimer);
		});
		const sidebarLayout = (0, vue_exports.computed)(() => {
			const arr = Array.isArray(props.widgets) ? props.widgets : [];
			return {
				order: arr.map((w) => w.key).filter(Boolean),
				disabled: arr.filter((w) => w && w.enabled === false).map((w) => w.key)
			};
		});
		convoro.setTranslator((k, p) => t(k, p ?? {}));
		(0, vue_exports.watchEffect)(() => {
			convoro.setData({
				stats: props.stats ?? {},
				online: props.widgetData?.onlineNow ?? 0,
				onlineGuests: props.widgetData?.onlineGuests ?? 0,
				onlineUsers: props.widgetData?.onlineUsers ?? [],
				newestMembers: props.widgetData?.newestMembers ?? [],
				topPosters: props.widgetData?.topPosters ?? [],
				trending: props.widgetData?.trending ?? [],
				categories: props.categories ?? [],
				aboutHtml: props.aboutHtml ?? "",
				aboutTitle: props.aboutTitle ?? ""
			});
			convoro.emit("convoro:data");
		});
		(0, vue_exports.watch)(sidebarLayout, (l) => convoro.setLayout("forum:sidebar", l), {
			immediate: true,
			deep: true
		});
		function go(params) {
			if (params.view === "feed" || params.view === "grid") document.cookie = `convoro_view=${params.view};path=/;max-age=31536000;samesite=lax`;
			router.get("/", {
				view: props.view,
				sort: props.sort,
				category: props.activeCategory,
				...params
			}, {
				preserveScroll: true,
				preserveState: true
			});
		}
		return (_ctx, _push, _parent, _attrs) => {
			_push(`<!--[-->`);
			_push((0, server_renderer_exports.ssrRenderComponent)((0, vue_exports.unref)(head_default), { title: "Community" }, null, _parent));
			_push((0, server_renderer_exports.ssrRenderComponent)(AppLayout_default, null, {
				default: (0, vue_exports.withCtx)((_, _push, _parent, _scopeId) => {
					if (_push) {
						_push(`<div class="grid grid-cols-1 gap-5 lg:grid-cols-[224px_1fr_268px]"${_scopeId}><aside class="hidden lg:block"${_scopeId}><button type="button" class="mb-3.5 flex w-full items-center justify-center gap-2 rounded-lg bg-primary px-4 py-2.5 text-sm font-semibold text-white shadow-lg shadow-primary/30 hover:bg-primary-600"${_scopeId}><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2"${_scopeId}><path d="M12 5v14M5 12h14"${_scopeId}></path></svg> ${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Start a topic"))}</button><div class="overflow-hidden rounded-c border border-line bg-surface shadow-sm"${_scopeId}><h4 class="border-b border-line px-4 py-3 text-xs font-semibold uppercase tracking-wide text-ink-muted"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Categories"))}</h4><nav class="flex flex-col gap-0.5 p-2"${_scopeId}><button class="${(0, server_renderer_exports.ssrRenderClass)([!__props.activeCategory ? "bg-primary/15 text-primary" : "text-ink-2 hover:bg-surface-2", "flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm font-semibold"])}"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("All topics"))}</button><!--[-->`);
						(0, server_renderer_exports.ssrRenderList)(__props.categories, (c) => {
							_push(`<button class="flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm font-semibold transition hover:bg-surface-2" style="${(0, server_renderer_exports.ssrRenderStyle)(__props.activeCategory === c.slug ? { background: (c.color || "") + "24" } : void 0)}"${_scopeId}>`);
							_push((0, server_renderer_exports.ssrRenderComponent)(CategoryIcon_default, {
								icon: c.icon,
								color: c.color
							}, null, _parent, _scopeId));
							_push(`<span style="${(0, server_renderer_exports.ssrRenderStyle)({ color: c.color })}"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(c.name)}</span><span class="ml-auto rounded-full bg-surface-2 px-2 py-0.5 text-xs text-ink-muted"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(c.count)}</span></button>`);
						});
						_push(`<!--]--></nav></div></aside><section${_scopeId}><form class="mb-4 flex items-center gap-2.5 rounded-c border border-line bg-surface px-4 py-2.5 shadow-sm focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/20"${_scopeId}><svg class="text-ink-muted" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"${_scopeId}><circle cx="11" cy="11" r="7"${_scopeId}></circle><path d="m21 21-4.3-4.3"${_scopeId}></path></svg><input${(0, server_renderer_exports.ssrRenderAttr)("value", search.value)} type="search" class="w-full border-0 bg-transparent p-0 text-sm text-ink placeholder:text-ink-muted focus:ring-0"${(0, server_renderer_exports.ssrRenderAttr)("placeholder", (0, vue_exports.unref)(t)("Search discussions…"))}${_scopeId}>`);
						if (search.value) _push(`<button type="submit" class="shrink-0 rounded-lg bg-primary px-3 py-1.5 text-xs font-semibold text-white hover:bg-primary-600"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Search"))}</button>`);
						else _push(`<!---->`);
						_push(`</form>`);
						if (askEnabled.value) _push((0, server_renderer_exports.ssrRenderComponent)(AskBar_default, { class: "mb-5" }, null, _parent, _scopeId));
						else _push(`<!---->`);
						_push(`<div class="mb-4 flex items-center gap-3"${_scopeId}><h1 class="text-2xl font-extrabold tracking-tight"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Community"))}</h1><div class="ml-auto flex rounded-[10px] border border-line bg-surface p-0.5 shadow-sm"${_scopeId}><button class="${(0, server_renderer_exports.ssrRenderClass)([__props.view === "feed" ? "bg-primary text-white" : "text-ink-2", "rounded-[7px] px-3 py-1.5 text-[13px] font-semibold"])}"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Feed"))}</button><button class="${(0, server_renderer_exports.ssrRenderClass)([__props.view === "grid" ? "bg-primary text-white" : "text-ink-2", "rounded-[7px] px-3 py-1.5 text-[13px] font-semibold"])}"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Grid"))}</button></div><select${(0, server_renderer_exports.ssrRenderAttr)("value", __props.sort)} class="rounded-lg border-line bg-surface py-1.5 text-[13px] font-semibold text-ink-2 shadow-sm focus:ring-primary"${_scopeId}><option value="recent"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Latest activity"))}</option><option value="popular"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Most viewed"))}</option><option value="title"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Title (A–Z)"))}</option></select></div>`);
						if (!__props.topics.data.length) _push((0, server_renderer_exports.ssrRenderComponent)(EmptyState_default, {
							icon: "💬",
							title: (0, vue_exports.unref)(t)("No topics yet"),
							description: (0, vue_exports.unref)(t)("This is the start of something. Be the first to post and get the conversation going.")
						}, {
							default: (0, vue_exports.withCtx)((_, _push, _parent, _scopeId) => {
								if (_push) _push(`<button type="button" class="rounded-c bg-primary px-5 py-2.5 text-sm font-bold text-white hover:bg-primary-600"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Start the first topic"))}</button>`);
								else return [(0, vue_exports.createVNode)("button", {
									type: "button",
									onClick: startTopic,
									class: "rounded-c bg-primary px-5 py-2.5 text-sm font-bold text-white hover:bg-primary-600"
								}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Start the first topic")), 1)];
							}),
							_: 1
						}, _parent, _scopeId));
						else if (__props.view === "feed") {
							_push(`<div class="flex flex-col gap-3"${_scopeId}><!--[-->`);
							(0, server_renderer_exports.ssrRenderList)(__props.topics.data, (t) => {
								_push((0, server_renderer_exports.ssrRenderComponent)(TopicCard_default, {
									key: t.id,
									topic: withLive(t)
								}, null, _parent, _scopeId));
							});
							_push(`<!--]--></div>`);
						} else {
							_push(`<div class="grid grid-cols-1 gap-3.5 sm:grid-cols-2"${_scopeId}><!--[-->`);
							(0, server_renderer_exports.ssrRenderList)(__props.topics.data, (t$1) => {
								_push((0, server_renderer_exports.ssrRenderComponent)((0, vue_exports.unref)(link_default), {
									key: t$1.id,
									href: `/t/${t$1.slug}`,
									class: ["relative flex flex-col overflow-hidden rounded-c border bg-surface shadow-sm transition hover:-translate-y-0.5 hover:shadow-md", t$1.isNew ? "border-primary/40" : "border-line"]
								}, {
									default: (0, vue_exports.withCtx)((_, _push, _parent, _scopeId) => {
										if (_push) {
											if (t$1.isNew) _push(`<span class="absolute right-2 top-2 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"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("New"))}</span>`);
											else _push(`<!---->`);
											_push(`<div class="aspect-[16/8] bg-surface-2"${_scopeId}>`);
											if (t$1.cover) _push(`<img${(0, server_renderer_exports.ssrRenderAttr)("src", t$1.cover)} class="h-full w-full object-cover" loading="lazy"${_scopeId}>`);
											else _push(`<!---->`);
											_push(`</div><div class="flex flex-1 flex-col p-4"${_scopeId}>`);
											if (t$1.category) {
												_push(`<span class="mb-2 inline-flex w-fit items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-semibold" style="${(0, server_renderer_exports.ssrRenderStyle)({
													color: t$1.category.color,
													background: t$1.category.color + "22"
												})}"${_scopeId}>`);
												_push((0, server_renderer_exports.ssrRenderComponent)(CategoryIcon_default, { icon: t$1.category.icon }, null, _parent, _scopeId));
												_push(` ${(0, server_renderer_exports.ssrInterpolate)(t$1.category.name)}</span>`);
											} else _push(`<!---->`);
											_push(`<h3 class="text-[15px] font-bold leading-snug"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(t$1.title)}</h3>`);
											if (t$1.excerpt) _push(`<p class="mt-1.5 line-clamp-3 text-[13px] leading-relaxed text-ink-2"${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(t$1.excerpt)}</p>`);
											else _push(`<!---->`);
											_push(`<div class="mt-auto flex items-center gap-2 pt-3 text-xs text-ink-muted"${_scopeId}>`);
											_push((0, server_renderer_exports.ssrRenderComponent)(Avatar_default, {
												avatar: t$1.author,
												size: 28
											}, null, _parent, _scopeId));
											_push(`<span${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)(t$1.author.name)}</span><span class="ml-auto"${_scopeId}>💬 ${(0, server_renderer_exports.ssrInterpolate)(t$1.replyCount)}</span></div></div>`);
										} else return [
											t$1.isNew ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("span", {
												key: 0,
												class: "absolute right-2 top-2 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, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("New")), 1)) : (0, vue_exports.createCommentVNode)("", true),
											(0, vue_exports.createVNode)("div", { class: "aspect-[16/8] bg-surface-2" }, [t$1.cover ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("img", {
												key: 0,
												src: t$1.cover,
												class: "h-full w-full object-cover",
												loading: "lazy"
											}, null, 8, ["src"])) : (0, vue_exports.createCommentVNode)("", true)]),
											(0, vue_exports.createVNode)("div", { class: "flex flex-1 flex-col p-4" }, [
												t$1.category ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("span", {
													key: 0,
													class: "mb-2 inline-flex w-fit items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-semibold",
													style: {
														color: t$1.category.color,
														background: t$1.category.color + "22"
													}
												}, [(0, vue_exports.createVNode)(CategoryIcon_default, { icon: t$1.category.icon }, null, 8, ["icon"]), (0, vue_exports.createTextVNode)(" " + (0, vue_exports.toDisplayString)(t$1.category.name), 1)], 4)) : (0, vue_exports.createCommentVNode)("", true),
												(0, vue_exports.createVNode)("h3", { class: "text-[15px] font-bold leading-snug" }, (0, vue_exports.toDisplayString)(t$1.title), 1),
												t$1.excerpt ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("p", {
													key: 1,
													class: "mt-1.5 line-clamp-3 text-[13px] leading-relaxed text-ink-2"
												}, (0, vue_exports.toDisplayString)(t$1.excerpt), 1)) : (0, vue_exports.createCommentVNode)("", true),
												(0, vue_exports.createVNode)("div", { class: "mt-auto flex items-center gap-2 pt-3 text-xs text-ink-muted" }, [
													(0, vue_exports.createVNode)(Avatar_default, {
														avatar: t$1.author,
														size: 28
													}, null, 8, ["avatar"]),
													(0, vue_exports.createVNode)("span", null, (0, vue_exports.toDisplayString)(t$1.author.name), 1),
													(0, vue_exports.createVNode)("span", { class: "ml-auto" }, "💬 " + (0, vue_exports.toDisplayString)(t$1.replyCount), 1)
												])
											])
										];
									}),
									_: 2
								}, _parent, _scopeId));
							});
							_push(`<!--]--></div>`);
						}
						if (__props.topics.next) {
							_push(`<div class="py-6 text-center"${_scopeId}>`);
							_push((0, server_renderer_exports.ssrRenderComponent)((0, vue_exports.unref)(link_default), {
								href: __props.topics.next,
								class: "rounded-c border border-line bg-surface px-5 py-2.5 text-sm font-semibold hover:bg-surface-2"
							}, {
								default: (0, vue_exports.withCtx)((_, _push, _parent, _scopeId) => {
									if (_push) _push(`${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Load more"))}`);
									else return [(0, vue_exports.createTextVNode)((0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Load more")), 1)];
								}),
								_: 1
							}, _parent, _scopeId));
							_push(`</div>`);
						} else _push(`<!---->`);
						_push(`</section><aside class="hidden lg:block"${_scopeId}><div class="flex flex-col gap-4"${_scopeId}>`);
						_push((0, server_renderer_exports.ssrRenderComponent)(Slot_default, { name: "forum:sidebar" }, null, _parent, _scopeId));
						_push(`</div></aside></div>`);
						(0, server_renderer_exports.ssrRenderTeleport)(_push, (_push) => {
							_push(`<button type="button" class="${(0, server_renderer_exports.ssrRenderClass)([barHasCompose.value ? "max-md:hidden" : "", "fixed bottom-5 right-5 z-40 flex items-center gap-2 rounded-full bg-primary px-5 py-3.5 text-sm font-semibold text-white shadow-xl shadow-primary/40 hover:bg-primary-600 lg:hidden"])}"${(0, server_renderer_exports.ssrRenderAttr)("aria-label", (0, vue_exports.unref)(t)("Start a topic"))}${_scopeId}><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4"${_scopeId}><path d="M12 5v14M5 12h14"${_scopeId}></path></svg><span${_scopeId}>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Start a topic"))}</span></button>`);
						}, "body", false, _parent);
					} else return [(0, vue_exports.createVNode)("div", { class: "grid grid-cols-1 gap-5 lg:grid-cols-[224px_1fr_268px]" }, [
						(0, vue_exports.createVNode)("aside", { class: "hidden lg:block" }, [(0, vue_exports.createVNode)("button", {
							type: "button",
							onClick: startTopic,
							class: "mb-3.5 flex w-full items-center justify-center gap-2 rounded-lg bg-primary px-4 py-2.5 text-sm font-semibold text-white shadow-lg shadow-primary/30 hover:bg-primary-600"
						}, [((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("svg", {
							width: "16",
							height: "16",
							viewBox: "0 0 24 24",
							fill: "none",
							stroke: "currentColor",
							"stroke-width": "2.2"
						}, [(0, vue_exports.createVNode)("path", { d: "M12 5v14M5 12h14" })])), (0, vue_exports.createTextVNode)(" " + (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Start a topic")), 1)]), (0, vue_exports.createVNode)("div", { class: "overflow-hidden rounded-c border border-line bg-surface shadow-sm" }, [(0, vue_exports.createVNode)("h4", { class: "border-b border-line px-4 py-3 text-xs font-semibold uppercase tracking-wide text-ink-muted" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Categories")), 1), (0, vue_exports.createVNode)("nav", { class: "flex flex-col gap-0.5 p-2" }, [(0, vue_exports.createVNode)("button", {
							onClick: ($event) => go({ category: null }),
							class: ["flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm font-semibold", !__props.activeCategory ? "bg-primary/15 text-primary" : "text-ink-2 hover:bg-surface-2"]
						}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("All topics")), 11, ["onClick"]), ((0, vue_exports.openBlock)(true), (0, vue_exports.createBlock)(vue_exports.Fragment, null, (0, vue_exports.renderList)(__props.categories, (c) => {
							return (0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("button", {
								key: c.slug,
								onClick: ($event) => go({ category: c.slug }),
								class: "flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm font-semibold transition hover:bg-surface-2",
								style: __props.activeCategory === c.slug ? { background: (c.color || "") + "24" } : void 0
							}, [
								(0, vue_exports.createVNode)(CategoryIcon_default, {
									icon: c.icon,
									color: c.color
								}, null, 8, ["icon", "color"]),
								(0, vue_exports.createVNode)("span", { style: { color: c.color } }, (0, vue_exports.toDisplayString)(c.name), 5),
								(0, vue_exports.createVNode)("span", { class: "ml-auto rounded-full bg-surface-2 px-2 py-0.5 text-xs text-ink-muted" }, (0, vue_exports.toDisplayString)(c.count), 1)
							], 12, ["onClick"]);
						}), 128))])])]),
						(0, vue_exports.createVNode)("section", null, [
							(0, vue_exports.createVNode)("form", {
								class: "mb-4 flex items-center gap-2.5 rounded-c border border-line bg-surface px-4 py-2.5 shadow-sm focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/20",
								onSubmit: (0, vue_exports.withModifiers)(goSearch, ["prevent"])
							}, [
								((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("svg", {
									class: "text-ink-muted",
									width: "18",
									height: "18",
									viewBox: "0 0 24 24",
									fill: "none",
									stroke: "currentColor",
									"stroke-width": "2"
								}, [(0, vue_exports.createVNode)("circle", {
									cx: "11",
									cy: "11",
									r: "7"
								}), (0, vue_exports.createVNode)("path", { d: "m21 21-4.3-4.3" })])),
								(0, vue_exports.withDirectives)((0, vue_exports.createVNode)("input", {
									"onUpdate:modelValue": ($event) => search.value = $event,
									type: "search",
									class: "w-full border-0 bg-transparent p-0 text-sm text-ink placeholder:text-ink-muted focus:ring-0",
									placeholder: (0, vue_exports.unref)(t)("Search discussions…")
								}, null, 8, ["onUpdate:modelValue", "placeholder"]), [[vue_exports.vModelText, search.value]]),
								search.value ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("button", {
									key: 0,
									type: "submit",
									class: "shrink-0 rounded-lg bg-primary px-3 py-1.5 text-xs font-semibold text-white hover:bg-primary-600"
								}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Search")), 1)) : (0, vue_exports.createCommentVNode)("", true)
							], 32),
							askEnabled.value ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)(AskBar_default, {
								key: 0,
								class: "mb-5"
							})) : (0, vue_exports.createCommentVNode)("", true),
							(0, vue_exports.createVNode)("div", { class: "mb-4 flex items-center gap-3" }, [
								(0, vue_exports.createVNode)("h1", { class: "text-2xl font-extrabold tracking-tight" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Community")), 1),
								(0, vue_exports.createVNode)("div", { class: "ml-auto flex rounded-[10px] border border-line bg-surface p-0.5 shadow-sm" }, [(0, vue_exports.createVNode)("button", {
									onClick: ($event) => go({ view: "feed" }),
									class: ["rounded-[7px] px-3 py-1.5 text-[13px] font-semibold", __props.view === "feed" ? "bg-primary text-white" : "text-ink-2"]
								}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Feed")), 11, ["onClick"]), (0, vue_exports.createVNode)("button", {
									onClick: ($event) => go({ view: "grid" }),
									class: ["rounded-[7px] px-3 py-1.5 text-[13px] font-semibold", __props.view === "grid" ? "bg-primary text-white" : "text-ink-2"]
								}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Grid")), 11, ["onClick"])]),
								(0, vue_exports.createVNode)("select", {
									value: __props.sort,
									onChange: ($event) => go({ sort: $event.target.value }),
									class: "rounded-lg border-line bg-surface py-1.5 text-[13px] font-semibold text-ink-2 shadow-sm focus:ring-primary"
								}, [
									(0, vue_exports.createVNode)("option", { value: "recent" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Latest activity")), 1),
									(0, vue_exports.createVNode)("option", { value: "popular" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Most viewed")), 1),
									(0, vue_exports.createVNode)("option", { value: "title" }, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Title (A–Z)")), 1)
								], 40, ["value", "onChange"])
							]),
							!__props.topics.data.length ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)(EmptyState_default, {
								key: 1,
								icon: "💬",
								title: (0, vue_exports.unref)(t)("No topics yet"),
								description: (0, vue_exports.unref)(t)("This is the start of something. Be the first to post and get the conversation going.")
							}, {
								default: (0, vue_exports.withCtx)(() => [(0, vue_exports.createVNode)("button", {
									type: "button",
									onClick: startTopic,
									class: "rounded-c bg-primary px-5 py-2.5 text-sm font-bold text-white hover:bg-primary-600"
								}, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Start the first topic")), 1)]),
								_: 1
							}, 8, ["title", "description"])) : __props.view === "feed" ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
								key: 2,
								class: "flex flex-col gap-3"
							}, [((0, vue_exports.openBlock)(true), (0, vue_exports.createBlock)(vue_exports.Fragment, null, (0, vue_exports.renderList)(__props.topics.data, (t) => {
								return (0, vue_exports.openBlock)(), (0, vue_exports.createBlock)(TopicCard_default, {
									key: t.id,
									topic: withLive(t)
								}, null, 8, ["topic"]);
							}), 128))])) : ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
								key: 3,
								class: "grid grid-cols-1 gap-3.5 sm:grid-cols-2"
							}, [((0, vue_exports.openBlock)(true), (0, vue_exports.createBlock)(vue_exports.Fragment, null, (0, vue_exports.renderList)(__props.topics.data, (t$2) => {
								return (0, vue_exports.openBlock)(), (0, vue_exports.createBlock)((0, vue_exports.unref)(link_default), {
									key: t$2.id,
									href: `/t/${t$2.slug}`,
									class: ["relative flex flex-col overflow-hidden rounded-c border bg-surface shadow-sm transition hover:-translate-y-0.5 hover:shadow-md", t$2.isNew ? "border-primary/40" : "border-line"]
								}, {
									default: (0, vue_exports.withCtx)(() => [
										t$2.isNew ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("span", {
											key: 0,
											class: "absolute right-2 top-2 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, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("New")), 1)) : (0, vue_exports.createCommentVNode)("", true),
										(0, vue_exports.createVNode)("div", { class: "aspect-[16/8] bg-surface-2" }, [t$2.cover ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("img", {
											key: 0,
											src: t$2.cover,
											class: "h-full w-full object-cover",
											loading: "lazy"
										}, null, 8, ["src"])) : (0, vue_exports.createCommentVNode)("", true)]),
										(0, vue_exports.createVNode)("div", { class: "flex flex-1 flex-col p-4" }, [
											t$2.category ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("span", {
												key: 0,
												class: "mb-2 inline-flex w-fit items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-semibold",
												style: {
													color: t$2.category.color,
													background: t$2.category.color + "22"
												}
											}, [(0, vue_exports.createVNode)(CategoryIcon_default, { icon: t$2.category.icon }, null, 8, ["icon"]), (0, vue_exports.createTextVNode)(" " + (0, vue_exports.toDisplayString)(t$2.category.name), 1)], 4)) : (0, vue_exports.createCommentVNode)("", true),
											(0, vue_exports.createVNode)("h3", { class: "text-[15px] font-bold leading-snug" }, (0, vue_exports.toDisplayString)(t$2.title), 1),
											t$2.excerpt ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("p", {
												key: 1,
												class: "mt-1.5 line-clamp-3 text-[13px] leading-relaxed text-ink-2"
											}, (0, vue_exports.toDisplayString)(t$2.excerpt), 1)) : (0, vue_exports.createCommentVNode)("", true),
											(0, vue_exports.createVNode)("div", { class: "mt-auto flex items-center gap-2 pt-3 text-xs text-ink-muted" }, [
												(0, vue_exports.createVNode)(Avatar_default, {
													avatar: t$2.author,
													size: 28
												}, null, 8, ["avatar"]),
												(0, vue_exports.createVNode)("span", null, (0, vue_exports.toDisplayString)(t$2.author.name), 1),
												(0, vue_exports.createVNode)("span", { class: "ml-auto" }, "💬 " + (0, vue_exports.toDisplayString)(t$2.replyCount), 1)
											])
										])
									]),
									_: 2
								}, 1032, ["href", "class"]);
							}), 128))])),
							__props.topics.next ? ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("div", {
								key: 4,
								class: "py-6 text-center"
							}, [(0, vue_exports.createVNode)((0, vue_exports.unref)(link_default), {
								href: __props.topics.next,
								class: "rounded-c border border-line bg-surface px-5 py-2.5 text-sm font-semibold hover:bg-surface-2"
							}, {
								default: (0, vue_exports.withCtx)(() => [(0, vue_exports.createTextVNode)((0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Load more")), 1)]),
								_: 1
							}, 8, ["href"])])) : (0, vue_exports.createCommentVNode)("", true)
						]),
						(0, vue_exports.createVNode)("aside", { class: "hidden lg:block" }, [(0, vue_exports.createVNode)("div", { class: "flex flex-col gap-4" }, [(0, vue_exports.createVNode)(Slot_default, { name: "forum:sidebar" })])])
					]), ((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)(vue_exports.Teleport, { to: "body" }, [(0, vue_exports.createVNode)("button", {
						type: "button",
						onClick: startTopic,
						class: ["fixed bottom-5 right-5 z-40 flex items-center gap-2 rounded-full bg-primary px-5 py-3.5 text-sm font-semibold text-white shadow-xl shadow-primary/40 hover:bg-primary-600 lg:hidden", barHasCompose.value ? "max-md:hidden" : ""],
						"aria-label": (0, vue_exports.unref)(t)("Start a topic")
					}, [((0, vue_exports.openBlock)(), (0, vue_exports.createBlock)("svg", {
						width: "18",
						height: "18",
						viewBox: "0 0 24 24",
						fill: "none",
						stroke: "currentColor",
						"stroke-width": "2.4"
					}, [(0, vue_exports.createVNode)("path", { d: "M12 5v14M5 12h14" })])), (0, vue_exports.createVNode)("span", null, (0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Start a topic")), 1)], 10, ["aria-label"])]))];
				}),
				_: 1
			}, _parent));
			_push(`<!--]-->`);
		};
	}
});
//#endregion
//#region resources/js/Pages/Forum/Index.vue
var _sfc_setup = Index_vue_vue_type_script_setup_true_lang_default.setup;
Index_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/Pages/Forum/Index.vue");
	return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
var Index_default = Index_vue_vue_type_script_setup_true_lang_default;
//#endregion
export { Index_default as default };
