Files
service-finder/frontend_admin/.nuxt/dist/server/_nuxt/levels-D2gwg9KO.js
2026-06-30 08:56:55 +00:00

108 lines
12 KiB
JavaScript

import { defineComponent, ref, reactive, computed, unref, useSSRContext } from "vue";
import { ssrRenderAttrs, ssrInterpolate, ssrRenderList, ssrRenderClass, ssrRenderAttr, ssrIncludeBooleanAttr, ssrLooseContain } from "vue/server-renderer";
import "/app/node_modules/hookable/dist/index.mjs";
import "/app/node_modules/klona/dist/index.mjs";
import { a as useI18n } from "../server.mjs";
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js";
import "/app/node_modules/ofetch/dist/node.mjs";
import "#internal/nuxt/paths";
import "/app/node_modules/unctx/dist/index.mjs";
import "/app/node_modules/h3/dist/index.mjs";
import "pinia";
import "/app/node_modules/defu/dist/defu.mjs";
import "vue-router";
import "/app/node_modules/ufo/dist/index.mjs";
import "/app/node_modules/cookie-es/dist/index.mjs";
import "/app/node_modules/destr/dist/index.mjs";
import "/app/node_modules/ohash/dist/index.mjs";
import "/app/node_modules/@unhead/vue/dist/index.mjs";
import "@vue/devtools-api";
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(`<div${ssrRenderAttrs(_attrs)} data-v-5fa877fc><div class="mb-8" data-v-5fa877fc><h1 class="text-2xl font-bold text-white" data-v-5fa877fc>${ssrInterpolate(unref(t)("gamification.levels.title"))}</h1><p class="text-slate-400 mt-1" data-v-5fa877fc>${ssrInterpolate(unref(t)("gamification.levels.subtitle"))}</p></div>`);
if (unref(loading)) {
_push(`<div class="flex items-center justify-center py-20" data-v-5fa877fc><div class="text-slate-400 flex items-center gap-3" data-v-5fa877fc><svg class="w-5 h-5 animate-spin" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-5fa877fc><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" data-v-5fa877fc></path></svg><span data-v-5fa877fc>${ssrInterpolate(unref(t)("gamification.levels.loading"))}</span></div></div>`);
} else if (unref(error)) {
_push(`<div class="bg-rose-500/10 border border-rose-500/30 rounded-xl p-6 mb-8" data-v-5fa877fc><p class="text-rose-400" data-v-5fa877fc>${ssrInterpolate(unref(t)("gamification.levels.load_error"))}</p><button class="mt-3 text-sm text-rose-300 hover:text-rose-200 underline" data-v-5fa877fc>${ssrInterpolate(unref(t)("gamification.levels.retry"))}</button></div>`);
} else {
_push(`<!--[--><div class="mb-6 flex items-center justify-between" data-v-5fa877fc><div data-v-5fa877fc></div><button class="px-4 py-2 bg-indigo-600 hover:bg-indigo-500 text-white rounded-lg text-sm font-medium transition flex items-center gap-2" data-v-5fa877fc><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-5fa877fc><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" data-v-5fa877fc></path></svg> ${ssrInterpolate(unref(t)("gamification.levels.create"))}</button></div><div class="bg-slate-800 rounded-xl border border-slate-700 overflow-hidden mb-8" data-v-5fa877fc><div class="overflow-x-auto" data-v-5fa877fc><table class="w-full" data-v-5fa877fc><thead data-v-5fa877fc><tr class="border-b border-slate-700" data-v-5fa877fc><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider" data-v-5fa877fc>${ssrInterpolate(unref(t)("gamification.levels.col_level"))}</th><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider" data-v-5fa877fc>${ssrInterpolate(unref(t)("gamification.levels.col_rank"))}</th><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider" data-v-5fa877fc>${ssrInterpolate(unref(t)("gamification.levels.col_min_points"))}</th><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider" data-v-5fa877fc>${ssrInterpolate(unref(t)("gamification.levels.col_type"))}</th><th class="text-right px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider" data-v-5fa877fc>${ssrInterpolate(unref(t)("gamification.levels.col_actions"))}</th></tr></thead><tbody class="divide-y divide-slate-700/50" data-v-5fa877fc><!--[-->`);
ssrRenderList(unref(levels2), (level) => {
_push(`<tr class="hover:bg-slate-700/30 transition" data-v-5fa877fc><td class="px-4 py-3" data-v-5fa877fc><span class="inline-flex items-center justify-center w-8 h-8 rounded-lg bg-indigo-500/10 text-indigo-400 text-sm font-bold" data-v-5fa877fc>${ssrInterpolate(level.level_number)}</span></td><td class="px-4 py-3" data-v-5fa877fc><span class="text-sm font-medium text-white" data-v-5fa877fc>${ssrInterpolate(level.rank_name)}</span></td><td class="px-4 py-3 text-sm text-slate-300" data-v-5fa877fc>${ssrInterpolate(level.min_points.toLocaleString())}</td><td class="px-4 py-3" data-v-5fa877fc>`);
if (level.is_penalty) {
_push(`<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-rose-500/10 text-rose-400 border border-rose-500/20" data-v-5fa877fc>${ssrInterpolate(unref(t)("gamification.levels.penalty"))}</span>`);
} else {
_push(`<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-emerald-500/10 text-emerald-400 border border-emerald-500/20" data-v-5fa877fc>${ssrInterpolate(unref(t)("gamification.levels.normal"))}</span>`);
}
_push(`</td><td class="px-4 py-3 text-right" data-v-5fa877fc><button 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" data-v-5fa877fc><svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-5fa877fc><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" data-v-5fa877fc></path></svg> ${ssrInterpolate(unref(t)("gamification.levels.edit"))}</button></td></tr>`);
});
_push(`<!--]-->`);
if (unref(levels2).length === 0) {
_push(`<tr data-v-5fa877fc><td colspan="5" class="px-4 py-12 text-center text-slate-500 text-sm" data-v-5fa877fc>${ssrInterpolate(unref(t)("gamification.levels.no_levels"))}</td></tr>`);
} else {
_push(`<!---->`);
}
_push(`</tbody></table></div></div><div class="bg-slate-800 rounded-xl border border-slate-700 p-6" data-v-5fa877fc><h2 class="text-lg font-semibold text-white mb-4" data-v-5fa877fc>${ssrInterpolate(unref(t)("gamification.levels.tree_diagram"))}</h2>`);
if (unref(levels2).length === 0) {
_push(`<div class="text-sm text-slate-500 text-center py-8" data-v-5fa877fc>${ssrInterpolate(unref(t)("gamification.levels.no_tree"))}</div>`);
} else {
_push(`<div class="flex flex-wrap gap-3" data-v-5fa877fc><!--[-->`);
ssrRenderList(unref(sortedLevels), (level) => {
_push(`<div class="${ssrRenderClass([level.is_penalty ? "bg-rose-500/5 border-rose-500/20" : "bg-emerald-500/5 border-emerald-500/20", "flex items-center gap-2 px-4 py-2 rounded-lg border transition"])}" data-v-5fa877fc><span class="${ssrRenderClass([level.is_penalty ? "text-rose-400" : "text-emerald-400", "text-sm font-bold"])}" data-v-5fa877fc> Lv.${ssrInterpolate(level.level_number)}</span><span class="text-xs text-slate-400" data-v-5fa877fc>${ssrInterpolate(level.rank_name)}</span>`);
if (!level.is_penalty) {
_push(`<span class="text-xs text-slate-500" data-v-5fa877fc>(${ssrInterpolate(level.min_points.toLocaleString())} pts)</span>`);
} else {
_push(`<!---->`);
}
_push(`</div>`);
});
_push(`<!--]--></div>`);
}
_push(`</div><!--]-->`);
}
if (unref(showModal)) {
_push(`<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/60" data-v-5fa877fc><div class="bg-slate-800 rounded-xl border border-slate-700 w-full max-w-md mx-4 p-6" data-v-5fa877fc><h3 class="text-lg font-semibold text-white mb-6" data-v-5fa877fc>${ssrInterpolate(unref(editingLevel) ? unref(t)("gamification.levels.edit_title") : unref(t)("gamification.levels.create_title"))}</h3><div class="space-y-4" data-v-5fa877fc><div data-v-5fa877fc><label class="block text-sm font-medium text-slate-300 mb-1" data-v-5fa877fc>${ssrInterpolate(unref(t)("gamification.levels.form_level_number"))}</label><input${ssrRenderAttr("value", unref(form).level_number)} type="number" min="1" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-indigo-500/50" data-v-5fa877fc></div><div data-v-5fa877fc><label class="block text-sm font-medium text-slate-300 mb-1" data-v-5fa877fc>${ssrInterpolate(unref(t)("gamification.levels.form_rank_name"))}</label><input${ssrRenderAttr("value", unref(form).rank_name)} type="text" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-indigo-500/50" data-v-5fa877fc></div><div data-v-5fa877fc><label class="block text-sm font-medium text-slate-300 mb-1" data-v-5fa877fc>${ssrInterpolate(unref(t)("gamification.levels.form_min_points"))}</label><input${ssrRenderAttr("value", unref(form).min_points)} type="number" min="0" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-indigo-500/50" data-v-5fa877fc></div><div class="flex items-center gap-2" data-v-5fa877fc><input${ssrIncludeBooleanAttr(Array.isArray(unref(form).is_penalty) ? ssrLooseContain(unref(form).is_penalty, null) : unref(form).is_penalty) ? " checked" : ""} type="checkbox" id="is_penalty" class="rounded bg-slate-700 border-slate-600 text-indigo-600 focus:ring-indigo-500" data-v-5fa877fc><label for="is_penalty" class="text-sm text-slate-300" data-v-5fa877fc>${ssrInterpolate(unref(t)("gamification.levels.form_is_penalty"))}</label></div></div>`);
if (unref(formError)) {
_push(`<div class="mt-4 bg-rose-500/10 border border-rose-500/30 rounded-lg p-3" data-v-5fa877fc><p class="text-sm text-rose-400" data-v-5fa877fc>${ssrInterpolate(unref(formError))}</p></div>`);
} else {
_push(`<!---->`);
}
_push(`<div class="flex items-center justify-end gap-3 mt-6" data-v-5fa877fc><button class="px-4 py-2 bg-slate-700 hover:bg-slate-600 text-slate-300 text-sm font-medium rounded-lg transition" data-v-5fa877fc>${ssrInterpolate(unref(t)("gamification.levels.cancel"))}</button><button${ssrIncludeBooleanAttr(unref(saving)) ? " disabled" : ""} class="px-4 py-2 bg-indigo-600 hover:bg-indigo-500 disabled:bg-indigo-600/50 text-white text-sm font-medium rounded-lg transition" data-v-5fa877fc>${ssrInterpolate(unref(saving) ? unref(t)("gamification.levels.saving") : unref(t)("gamification.levels.save"))}</button></div></div></div>`);
} else {
_push(`<!---->`);
}
_push(`</div>`);
};
}
});
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.js.map