import { defineComponent, ref, reactive, unref, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrInterpolate, ssrRenderList, ssrRenderAttr, ssrRenderClass, 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: "point-rules", __ssrInlineRender: true, setup(__props) { const { t } = useI18n(); const loading = ref(true); const error = ref(false); const rules = ref([]); const showModal = ref(false); const showDeleteModal = ref(false); const editingRule = ref(null); const deletingRule = ref(null); const saving = ref(false); const formError = ref(""); const toast = ref(""); const editingCell = ref(null); const editValue = ref(""); ref(null); ref(false); const form = reactive({ action_key: "", points: 0, description: "", is_active: true }); function isEditing(ruleId, field) { var _a, _b; return ((_a = editingCell.value) == null ? void 0 : _a.id) === ruleId && ((_b = editingCell.value) == null ? void 0 : _b.field) === field; } return (_ctx, _push, _parent, _attrs) => { var _a; _push(`
${ssrInterpolate(unref(t)("gamification.point_rules.subtitle"))}
${ssrInterpolate(unref(t)("gamification.point_rules.error"))}
| ${ssrInterpolate(unref(t)("gamification.point_rules.id"))} | ${ssrInterpolate(unref(t)("gamification.point_rules.action_key"))} | ${ssrInterpolate(unref(t)("gamification.point_rules.points"))} | ${ssrInterpolate(unref(t)("gamification.point_rules.description"))} | ${ssrInterpolate(unref(t)("gamification.point_rules.status"))} | ${ssrInterpolate(unref(t)("gamification.point_rules.actions"))} |
|---|---|---|---|---|---|
| ${ssrInterpolate(rule.id)} | `);
if (isEditing(rule.id, "action_key")) {
_push(``);
} else {
_push(`${ssrInterpolate(rule.action_key)}`);
}
_push(` | `); if (isEditing(rule.id, "points")) { _push(``); } else { _push(`${ssrInterpolate(rule.points >= 0 ? "+" : "")}${ssrInterpolate(rule.points)}`); } _push(` | `); if (isEditing(rule.id, "description")) { _push(``); } else { _push(`${ssrInterpolate(rule.description || "\u2014")}`); } _push(` | `); if (isEditing(rule.id, "is_active")) { _push(``); } else { _push(`${ssrInterpolate(rule.is_active ? unref(t)("gamification.point_rules.active") : unref(t)("gamification.point_rules.inactive"))}`); } _push(` | |
| ${ssrInterpolate(unref(t)("gamification.point_rules.no_items"))} | |||||
${ssrInterpolate(unref(t)("gamification.point_rules.delete_confirm", { name: (_a = deletingRule.value) == null ? void 0 : _a.action_key }))}