import { defineComponent, ref, reactive, computed, unref, useSSRContext } from "vue"; import { ssrRenderAttrs, ssrInterpolate, ssrIncludeBooleanAttr, ssrRenderAttr, ssrRenderList, ssrRenderClass } 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: "config", __ssrInlineRender: true, setup(__props) { const { t } = useI18n(); const loading = ref(true); const error = ref(false); const saving = ref(false); const formError = ref(""); const toast = ref(""); const lastSaved = ref(""); const showRawJson = ref(false); const rawJson = ref(""); const rawJsonError = ref(""); const multiplierKeys = ["L0", "L1", "L2", "L3"]; const xpLogic = reactive({ baseXp: 500, exponent: 1.5 }); const penaltyLogic = reactive({ recoveryRate: 0.5, thresholds: { level1: 100, level2: 500, level3: 1e3 }, multipliers: { L0: 1, L1: 0.5, L2: 0.1, L3: 0 } }); const conversionLogic = reactive({ socialToCreditRate: 100 }); const levelRewards = reactive({ creditsPer10Levels: 50 }); const calculator = reactive({ level: 5, activities: 3, socialPoints: 50 }); const calculatedDailyXp = computed(() => { return Math.round(xpLogic.baseXp * Math.pow(calculator.activities, xpLogic.exponent)); }); const calculatedLevelUpXp = computed(() => { return calculator.level * 1e3; }); const calculatedSocialCredit = computed(() => { return conversionLogic.socialToCreditRate * calculator.socialPoints; }); const calculatedDaysToLevelUp = computed(() => { const daily = calculatedDailyXp.value; if (daily <= 0) return "∞"; return Math.ceil(calculatedLevelUpXp.value / daily) + " " + t("gamification.config.days"); }); function formatNumber(n) { return new Intl.NumberFormat("hu-HU").format(n); } return (_ctx, _push, _parent, _attrs) => { _push(`

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

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

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

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

`); } else { _push(`
${ssrInterpolate(unref(t)("gamification.config.last_saved"))} ${ssrInterpolate(unref(lastSaved) ? unref(lastSaved) : "—")}
`); if (unref(saving)) { _push(``); } else { _push(``); } _push(` ${ssrInterpolate(unref(saving) ? unref(t)("gamification.config.saving") : unref(t)("gamification.config.save_config"))}

${ssrInterpolate(unref(t)("gamification.config.xp_logic"))}

${ssrInterpolate(unref(t)("gamification.config.conversion_logic"))}

${ssrInterpolate(unref(t)("gamification.config.penalty_logic"))}

`); ssrRenderList(multiplierKeys, (key) => { _push(`
`); }); _push(`

${ssrInterpolate(unref(t)("gamification.config.level_rewards"))}

${ssrInterpolate(unref(t)("gamification.config.impact_calculator"))}

${ssrInterpolate(unref(t)("gamification.config.calculator_hint"))}

1100
120
0500

${ssrInterpolate(unref(t)("gamification.config.estimated_results"))}

${ssrInterpolate(unref(t)("gamification.config.daily_xp"))}${ssrInterpolate(formatNumber(unref(calculatedDailyXp)))}
${ssrInterpolate(unref(t)("gamification.config.level_up_xp"))}${ssrInterpolate(formatNumber(unref(calculatedLevelUpXp)))}
${ssrInterpolate(unref(t)("gamification.config.social_credit"))}${ssrInterpolate(formatNumber(unref(calculatedSocialCredit)))}
${ssrInterpolate(unref(t)("gamification.config.days_to_level_up"))}${ssrInterpolate(unref(calculatedDaysToLevelUp))}
`); if (unref(showRawJson)) { _push(`
`); if (unref(rawJsonError)) { _push(`

${ssrInterpolate(unref(rawJsonError))}

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