import { _ as __nuxt_component_0 } from './nuxt-link-1NBbHb-h.mjs'; import { defineComponent, ref, unref, withCtx, createTextVNode, toDisplayString, openBlock, createBlock, createVNode, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrInterpolate, ssrIncludeBooleanAttr, ssrLooseContain, ssrLooseEqual, ssrRenderList, ssrRenderAttr, ssrRenderComponent, ssrRenderClass } from 'vue/server-renderer'; import { u as useFormatter } from './useFormatter-hycy3urM.mjs'; import { a as useI18n } from './server.mjs'; import '../nitro/nitro.mjs'; import 'node:http'; import 'node:https'; import 'node:events'; import 'node:buffer'; import 'node:fs'; import 'node:path'; import 'node:crypto'; import 'vue-router'; import 'node:url'; import './region-0mvXqaMM.mjs'; import 'pinia'; import '../routes/renderer.mjs'; import 'vue-bundle-renderer/runtime'; import 'unhead/server'; import 'devalue'; import 'unhead/utils'; import 'unhead/plugins'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "index", __ssrInlineRender: true, setup(__props) { const { t } = useI18n(); const { formatNumber, formatDate } = useFormatter(); const loading = ref(false); const error = ref(false); const users = ref([]); const totalCount = ref(0); const offset = ref(0); const limit = ref(50); const filters = ref({ level: "", min_xp: null, max_xp: null, has_penalty: "" }); function restrictionLabel(level) { switch (level) { case 1: return t("gamification.users.restriction_mild"); case 2: return t("gamification.users.restriction_moderate"); case 3: return t("gamification.users.restriction_severe"); default: return `${level}. ${t("gamification.users.restriction_level")}`; } } return (_ctx, _push, _parent, _attrs) => { const _component_NuxtLink = __nuxt_component_0; _push(`

${ssrInterpolate(unref(t)("gamification.users.title"))}

${ssrInterpolate(unref(t)("gamification.users.subtitle"))}

${ssrInterpolate(unref(t)("gamification.users.total_count", { count: unref(totalCount) }))}
`); if (unref(loading)) { _push(`
${ssrInterpolate(unref(t)("gamification.users.loading"))}
`); } else if (unref(error)) { _push(`

${ssrInterpolate(unref(t)("gamification.users.load_error"))}

`); } else if (unref(users).length === 0) { _push(`

${ssrInterpolate(unref(t)("gamification.users.empty"))}

`); } else { _push(`
`); ssrRenderList(unref(users), (user) => { _push(``); }); _push(`
${ssrInterpolate(unref(t)("gamification.users.col_user_id"))}${ssrInterpolate(unref(t)("gamification.users.col_xp"))}${ssrInterpolate(unref(t)("gamification.users.col_level"))}${ssrInterpolate(unref(t)("gamification.users.col_points"))}${ssrInterpolate(unref(t)("gamification.users.col_penalty"))}${ssrInterpolate(unref(t)("gamification.users.col_restriction"))}${ssrInterpolate(unref(t)("gamification.users.col_services"))}${ssrInterpolate(unref(t)("gamification.users.col_discoveries"))}${ssrInterpolate(unref(t)("gamification.users.col_updated"))}${ssrInterpolate(unref(t)("gamification.users.col_actions"))}
#${ssrInterpolate(user.user_id)}${ssrInterpolate(unref(formatNumber)(user.total_xp))}${ssrInterpolate(user.current_level)}${ssrInterpolate(unref(formatNumber)(user.total_points))}`); if (user.penalty_points > 0) { _push(` -${ssrInterpolate(user.penalty_points)}`); } else { _push(`\u2014`); } _push(``); if (user.restriction_level > 0) { _push(`${ssrInterpolate(restrictionLabel(user.restriction_level))}`); } else { _push(`${ssrInterpolate(unref(t)("gamification.users.none"))}`); } _push(`${ssrInterpolate(user.services_submitted)}${ssrInterpolate(user.places_discovered)}${ssrInterpolate(user.updated_at ? unref(formatDate)(user.updated_at) : "\u2014")}`); _push(ssrRenderComponent(_component_NuxtLink, { to: `/gamification/users/${user.user_id}`, class: "inline-flex items-center gap-1.5 px-3 py-1.5 bg-indigo-600/10 hover:bg-indigo-600/20 text-indigo-400 text-xs font-medium rounded-lg transition" }, { default: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { _push2(`${ssrInterpolate(unref(t)("gamification.users.details"))} `); } else { return [ createTextVNode(toDisplayString(unref(t)("gamification.users.details")) + " ", 1), (openBlock(), createBlock("svg", { class: "w-3.5 h-3.5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" }, [ createVNode("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M9 5l7 7-7 7" }) ])) ]; } }), _: 2 }, _parent)); _push(`
${ssrInterpolate(unref(t)("gamification.users.prev"))}${ssrInterpolate(unref(offset) + 1)}\u2013${ssrInterpolate(Math.min(unref(offset) + unref(limit), unref(totalCount)))} / ${ssrInterpolate(unref(totalCount))}= unref(totalCount)) ? " disabled" : ""} class="${ssrRenderClass([unref(offset) + unref(limit) >= unref(totalCount) ? "text-slate-600 cursor-not-allowed" : "text-slate-300 hover:bg-slate-700", "px-3 py-1.5 text-sm rounded-lg transition"])}">${ssrInterpolate(unref(t)("gamification.users.next"))}
`); } _push(``); }; } }); const _sfc_setup = _sfc_main.setup; _sfc_main.setup = (props, ctx) => { const ssrContext = useSSRContext(); (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/gamification/users/index.vue"); return _sfc_setup ? _sfc_setup(props, ctx) : void 0; }; export { _sfc_main as default }; //# sourceMappingURL=index-B4tBHEvj.mjs.map