import { _ as __nuxt_component_0 } from "./nuxt-link-1NBbHb-h.js";
import { defineComponent, ref, computed, mergeProps, useSSRContext, withCtx, createVNode, toDisplayString, unref, openBlock, createBlock, createTextVNode } from "vue";
import { ssrRenderAttrs, ssrInterpolate, ssrRenderClass, ssrRenderList, ssrRenderComponent, ssrRenderAttr, ssrRenderStyle, ssrRenderSlot } from "vue/server-renderer";
import "/app/node_modules/klona/dist/index.mjs";
import "/app/node_modules/hookable/dist/index.mjs";
import { a as useI18n, b as useRouter, c as useAuthStore } from "../server.mjs";
import { publicAssetsURL } from "#internal/nuxt/paths";
import { useRoute } from "vue-router";
import { u as useRegionStore } from "./region-0mvXqaMM.js";
import "/app/node_modules/ufo/dist/index.mjs";
import "/app/node_modules/defu/dist/defu.mjs";
import "/app/node_modules/ofetch/dist/node.mjs";
import "/app/node_modules/unctx/dist/index.mjs";
import "/app/node_modules/h3/dist/index.mjs";
import "pinia";
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$1 = /* @__PURE__ */ defineComponent({
__name: "LanguageSwitcher",
__ssrInlineRender: true,
setup(__props) {
const { locale, locales } = useI18n();
const dropdownOpen = ref(false);
const dropdownRef = ref(null);
const availableLocales = computed(() => locales.value);
const currentLocale = computed(() => locale.value);
const flagMap = {
hu: "🇭🇺",
en: "🇬🇧"
};
const labelMap = {
hu: "Magyar",
en: "English"
};
function flagFor(code) {
return flagMap[code] || "🌐";
}
function labelFor(code) {
return labelMap[code] || code.toUpperCase();
}
return (_ctx, _push, _parent, _attrs) => {
_push(`
`);
if (dropdownOpen.value) {
_push(`
`);
ssrRenderList(availableLocales.value, (loc) => {
_push(`
`);
});
_push(`
`);
} else {
_push(``);
}
_push(`
`);
};
}
});
const _sfc_setup$1 = _sfc_main$1.setup;
_sfc_main$1.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/LanguageSwitcher.vue");
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const _imports_0 = publicAssetsURL("/logo.svg");
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "default",
__ssrInlineRender: true,
setup(__props) {
const route = useRoute();
useRouter();
const authStore = useAuthStore();
useRegionStore();
const sidebarOpen = ref(false);
const sidebarCollapsed = ref(false);
const dropdownOpen = ref(false);
ref(null);
const expandedGroups = ref(/* @__PURE__ */ new Set(["Központ"]));
const userEmail = computed(() => authStore.userEmail || "Ismeretlen Felhasználó");
const userInitials = computed(() => {
const email = authStore.userEmail;
if (!email) return "??";
return email.split("@")[0].split(".").map((s) => s[0]).join("").toUpperCase().slice(0, 2);
});
const menuGroups = [
{
title: "Központ",
items: [
{
path: "/",
label: "Dashboard",
icon: ''
}
]
},
{
title: "Szolgáltatók",
items: [
{
label: "Szolgáltatók",
icon: '',
children: [
{
path: "/providers",
label: "Összes szolgáltató",
icon: ''
},
{
path: "/providers/pending",
label: "Jóváhagyásra váró",
icon: ''
}
]
}
]
},
{
title: "Felhasználók & Partnerek",
items: [
{
label: "Garázsok",
icon: '',
children: [
{
path: "/garages",
label: "Garázsok listája",
icon: ''
}
]
},
{
label: "Felhasználók",
icon: '',
children: [
{
path: "/users",
label: "Felhasználók listája",
icon: ''
},
{
path: "/persons",
label: "Személyek",
icon: ''
}
]
}
]
},
{
title: "Pénzügyek",
items: [
{
path: "/packages",
label: "Csomagok",
icon: ''
}
]
},
{
title: "Gamification",
items: [
{
label: "Játékmenet Beállítások",
icon: '',
children: [
{
path: "/gamification/point-rules",
label: "Pontszabályok",
icon: ''
},
{
path: "/gamification/levels",
label: "Szintek",
icon: ''
},
{
path: "/gamification/badges",
label: "Kitüntetések",
icon: ''
}
]
},
{
label: "Események & Szezonok",
icon: '',
children: [
{
path: "/gamification/seasons",
label: "Szezonok",
icon: ''
},
{
path: "/gamification/competitions",
label: "Versenyek",
icon: ''
}
]
},
{
label: "Felhasználói Adatok",
icon: '',
children: [
{
path: "/gamification/users",
label: "Statisztikák",
icon: ''
},
{
path: "/gamification/leaderboard",
label: "Ranglista",
icon: ''
},
{
path: "/gamification/ledger",
label: "Pontnapló",
icon: ''
}
]
},
{
path: "/gamification",
label: "Gamification HQ",
icon: ''
},
{
path: "/gamification/config",
label: "Rendszer Konfig",
icon: ''
},
{
path: "/gamification/parameters",
label: "Rendszerparaméterek",
icon: ''
}
]
},
{
title: "Rendszer",
items: [
{
path: "/permissions",
label: "Jogosultságok",
icon: ''
},
{
label: "Rendszernaplók",
icon: '',
children: [
{
path: "/",
/* P0 HOTFIX: placeholder until /logs page is built */
label: "Rendszernaplók",
icon: ''
}
]
}
]
}
];
const pageTitle = computed(() => {
if (route.path === "/") return "Dashboard";
if (route.path.startsWith("/permissions")) return "Jogosultság Kezelés";
if (route.path.startsWith("/garages")) return "Garázsok";
if (route.path.startsWith("/persons")) return "Személyek";
if (route.path.startsWith("/users")) return "Felhasználók";
if (route.path.startsWith("/logs")) return "Rendszernaplók";
if (route.path.startsWith("/packages")) return "Csomagok";
if (route.path.startsWith("/providers")) {
if (route.path === "/providers/pending") return "Jóváhagyásra váró szolgáltatók";
if (route.path.startsWith("/providers/")) return "Szolgáltató részletek";
return "Szolgáltatók";
}
if (route.path.startsWith("/gamification")) {
if (route.path === "/gamification") return "Gamification HQ";
if (route.path === "/gamification/point-rules") return "Pontszabályok";
if (route.path === "/gamification/levels") return "Szintek";
if (route.path === "/gamification/badges") return "Kitüntetések";
if (route.path === "/gamification/seasons") return "Szezonok";
if (route.path === "/gamification/competitions") return "Versenyek";
if (route.path === "/gamification/users") return "Gamification Felhasználók";
if (route.path.startsWith("/gamification/users/")) return "Felhasználó Gamification";
if (route.path === "/gamification/leaderboard") return "Ranglista";
if (route.path === "/gamification/config") return "Rendszer Konfig";
if (route.path === "/gamification/parameters") return "Rendszerparaméterek";
if (route.path === "/gamification/ledger") return "Pontnapló";
return "Gamification";
}
return "Admin Panel";
});
function isActive(path) {
if (path === "/") return route.path === "/";
return route.path.startsWith(path);
}
function isGroupActive(item) {
if (!item.children) return false;
return item.children.some((child) => isActive(child.path));
}
return (_ctx, _push, _parent, _attrs) => {
const _component_NuxtLink = __nuxt_component_0;
const _component_LanguageSwitcher = _sfc_main$1;
_push(``);
if (sidebarOpen.value) {
_push(`
`);
} else {
_push(``);
}
_push(`
${ssrInterpolate(pageTitle.value)}
`);
_push(ssrRenderComponent(_component_LanguageSwitcher, null, null, _parent));
_push(`
`);
if (dropdownOpen.value) {
_push(`
${ssrInterpolate(userEmail.value)}
${ssrInterpolate(unref(authStore).userRole === "SUPERADMIN" ? "Super Administrator" : unref(authStore).userRole || "Administrator")}
`);
_push(ssrRenderComponent(_component_NuxtLink, {
to: "/profile",
class: "flex items-center gap-3 px-4 py-2.5 text-sm text-slate-300 hover:bg-slate-700 hover:text-white transition",
onClick: ($event) => dropdownOpen.value = false
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`
Profile Settings `);
} else {
return [
(openBlock(), createBlock("svg", {
class: "w-4 h-4",
fill: "none",
stroke: "currentColor",
viewBox: "0 0 24 24"
}, [
createVNode("path", {
"stroke-linecap": "round",
"stroke-linejoin": "round",
"stroke-width": "2",
d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"
})
])),
createTextVNode(" Profile Settings ")
];
}
}),
_: 1
}, _parent));
_push(`
`);
} else {
_push(``);
}
_push(`
`);
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
_push(` `);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("layouts/default.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export {
_sfc_main as default
};
//# sourceMappingURL=default-BU4PyScw.js.map