import { defineComponent, ref, computed, unref, useSSRContext } from "vue"; import { ssrRenderAttrs, ssrInterpolate, ssrRenderList, ssrRenderAttr, ssrRenderClass, ssrIncludeBooleanAttr } 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: "parameters", __ssrInlineRender: true, setup(__props) { const { t } = useI18n(); const loading = ref(true); const error = ref(false); const saving = ref(false); const params = ref([]); const showModal = ref(false); const editingParam = ref(null); const editValue = ref(""); const formError = ref(""); const toast = ref(""); const isJsonValue = computed(() => { if (!editValue.value) return false; const trimmed = editValue.value.trim(); return trimmed.startsWith("{") && trimmed.endsWith("}") || trimmed.startsWith("[") && trimmed.endsWith("]"); }); function formatValue(value) { if (value === null || value === void 0) return "—"; if (typeof value === "object") { try { return JSON.stringify(value); } catch { return String(value); } } return String(value); } function truncateValue(val, maxLen) { if (val.length <= maxLen) return val; return val.substring(0, maxLen) + "..."; } function scopeBadgeClass(scope) { switch (scope?.toLowerCase()) { case "global": return "bg-emerald-500/10 text-emerald-400"; case "country": return "bg-blue-500/10 text-blue-400"; case "region": return "bg-violet-500/10 text-violet-400"; case "user": return "bg-amber-500/10 text-amber-400"; default: return "bg-slate-500/10 text-slate-400"; } } return (_ctx, _push, _parent, _attrs) => { _push(`

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

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

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

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

`); } else { _push(`
`); ssrRenderList(unref(params), (param) => { _push(``); }); _push(``); if (unref(params).length === 0) { _push(``); } else { _push(``); } _push(`
${ssrInterpolate(unref(t)("gamification.params.col_key"))}${ssrInterpolate(unref(t)("gamification.params.col_value"))}${ssrInterpolate(unref(t)("gamification.params.col_category"))}${ssrInterpolate(unref(t)("gamification.params.col_scope"))}${ssrInterpolate(unref(t)("gamification.params.col_scope_id"))}${ssrInterpolate(unref(t)("gamification.params.col_actions"))}
${ssrInterpolate(param.key)}${ssrInterpolate(truncateValue(formatValue(param.value), 60))}${ssrInterpolate(param.category || "—")}${ssrInterpolate(param.scope_level)}${ssrInterpolate(param.scope_id || "—")}
${ssrInterpolate(unref(t)("gamification.params.empty"))}
`); } if (unref(showModal)) { _push(`

${ssrInterpolate(unref(t)("gamification.params.edit_title"))}

${ssrInterpolate(unref(editingParam)?.key)}

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

${ssrInterpolate(unref(t)("gamification.params.json_detected"))}

`); } else { _push(`

${ssrInterpolate(unref(t)("gamification.params.text_value"))}

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

${ssrInterpolate(unref(formError))}

`); } else { _push(``); } _push(`
`); } else { _push(``); } if (unref(toast)) { _push(`
${ssrInterpolate(unref(toast))}
`); } 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/parameters.vue"); return _sfc_setup ? _sfc_setup(props, ctx) : void 0; }; const parameters = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8222d5f7"]]); export { parameters as default }; //# sourceMappingURL=parameters-Clxz_NnY.js.map