import { defineComponent, ref, reactive, computed, unref, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrInterpolate, ssrRenderList, ssrRenderClass, ssrRenderAttr, ssrIncludeBooleanAttr, ssrLooseContain } from 'vue/server-renderer'; import { a as useI18n } from './server.mjs'; import { _ as _export_sfc } from './_plugin-vue_export-helper-1tPrXgE0.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 '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: "levels", __ssrInlineRender: true, setup(__props) { const { t } = useI18n(); const loading = ref(true); const error = ref(false); const saving = ref(false); const levels2 = ref([]); const showModal = ref(false); const editingLevel = ref(null); const formError = ref(""); const form = reactive({ level_number: 1, rank_name: "", min_points: 0, is_penalty: false }); const sortedLevels = computed(() => { return [...levels2.value].sort((a, b) => a.level_number - b.level_number); }); return (_ctx, _push, _parent, _attrs) => { _push(`

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

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

`); if (unref(loading)) { _push(`
${ssrInterpolate(unref(t)("gamification.levels.loading"))}
`); } else if (unref(error)) { _push(`

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

`); } else { _push(`
`); ssrRenderList(unref(levels2), (level) => { _push(``); }); _push(``); if (unref(levels2).length === 0) { _push(``); } else { _push(``); } _push(`
${ssrInterpolate(unref(t)("gamification.levels.col_level"))}${ssrInterpolate(unref(t)("gamification.levels.col_rank"))}${ssrInterpolate(unref(t)("gamification.levels.col_min_points"))}${ssrInterpolate(unref(t)("gamification.levels.col_type"))}${ssrInterpolate(unref(t)("gamification.levels.col_actions"))}
${ssrInterpolate(level.level_number)}${ssrInterpolate(level.rank_name)}${ssrInterpolate(level.min_points.toLocaleString())}`); if (level.is_penalty) { _push(`${ssrInterpolate(unref(t)("gamification.levels.penalty"))}`); } else { _push(`${ssrInterpolate(unref(t)("gamification.levels.normal"))}`); } _push(`
${ssrInterpolate(unref(t)("gamification.levels.no_levels"))}

${ssrInterpolate(unref(t)("gamification.levels.tree_diagram"))}

`); if (unref(levels2).length === 0) { _push(`
${ssrInterpolate(unref(t)("gamification.levels.no_tree"))}
`); } else { _push(`
`); ssrRenderList(unref(sortedLevels), (level) => { _push(`
Lv.${ssrInterpolate(level.level_number)}${ssrInterpolate(level.rank_name)}`); if (!level.is_penalty) { _push(`(${ssrInterpolate(level.min_points.toLocaleString())} pts)`); } else { _push(``); } _push(`
`); }); _push(`
`); } _push(`
`); } if (unref(showModal)) { _push(`

${ssrInterpolate(unref(editingLevel) ? unref(t)("gamification.levels.edit_title") : unref(t)("gamification.levels.create_title"))}

`); if (unref(formError)) { _push(`

${ssrInterpolate(unref(formError))}

`); } else { _push(``); } _push(`
${ssrInterpolate(unref(saving) ? unref(t)("gamification.levels.saving") : unref(t)("gamification.levels.save"))}
`); } else { _push(``); } _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/levels.vue"); return _sfc_setup ? _sfc_setup(props, ctx) : void 0; }; const levels = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5fa877fc"]]); export { levels as default }; //# sourceMappingURL=levels-D2gwg9KO.mjs.map