424 lines
46 KiB
JavaScript
424 lines
46 KiB
JavaScript
import { _ as __nuxt_component_0 } from "./nuxt-link-Ci8vU-Yt.js";
|
|
import { defineComponent, ref, computed, withCtx, createTextVNode, toDisplayString, useSSRContext } from "vue";
|
|
import { ssrRenderAttrs, ssrInterpolate, ssrRenderClass, ssrRenderList, ssrRenderComponent, ssrRenderTeleport, ssrRenderAttr, ssrIncludeBooleanAttr, ssrLooseContain } from "vue/server-renderer";
|
|
import { useRoute, useRouter } from "vue-router";
|
|
import { c as useAuthStore } from "../server.mjs";
|
|
import "/app/node_modules/klona/dist/index.mjs";
|
|
import "/app/node_modules/hookable/dist/index.mjs";
|
|
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 "#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/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: "index",
|
|
__ssrInlineRender: true,
|
|
setup(__props) {
|
|
const route = useRoute();
|
|
useRouter();
|
|
const auth = useAuthStore();
|
|
route.params.id;
|
|
const loading = ref(true);
|
|
const error = ref(null);
|
|
const person = ref(null);
|
|
const activeTab = ref("profile");
|
|
const showEditModal = ref(false);
|
|
const saving = ref(false);
|
|
const editForm = ref({
|
|
last_name: "",
|
|
first_name: "",
|
|
phone: "",
|
|
mothers_last_name: "",
|
|
mothers_first_name: "",
|
|
birth_place: "",
|
|
birth_date: "",
|
|
is_active: true,
|
|
is_ghost: false,
|
|
is_sales_agent: false
|
|
});
|
|
const notification = ref({ show: false, type: "success", message: "" });
|
|
const tabs = [
|
|
{ key: "profile", label: "persons.details.profile_tab" },
|
|
{ key: "users", label: "persons.details.users_tab" },
|
|
{ key: "memberships", label: "persons.details.memberships_tab" },
|
|
{ key: "owned_orgs", label: "persons.details.owned_orgs_tab" },
|
|
{ key: "merge_history", label: "persons.details.merge_history_tab" }
|
|
];
|
|
const personDisplayName = computed(() => {
|
|
if (!person.value) return "";
|
|
const p = person.value;
|
|
if (p.last_name || p.first_name) {
|
|
return [p.last_name, p.first_name].filter(Boolean).join(" ");
|
|
}
|
|
return "Person #" + p.id;
|
|
});
|
|
const hasEditPermission = computed(() => {
|
|
if (auth.isAdmin) return true;
|
|
return !!auth.user?.system_capabilities?.["persons:edit"];
|
|
});
|
|
const hasIdentityDocs = computed(() => {
|
|
if (!person.value?.identity_docs) return false;
|
|
const docs = person.value.identity_docs;
|
|
if (typeof docs === "object" && Object.keys(docs).length > 0) return true;
|
|
return false;
|
|
});
|
|
const hasIceContact = computed(() => {
|
|
if (!person.value?.ice_contact) return false;
|
|
const ice = person.value.ice_contact;
|
|
if (typeof ice === "object" && Object.keys(ice).length > 0) return true;
|
|
return false;
|
|
});
|
|
function getInitials(name) {
|
|
if (!name) return "?";
|
|
return name.split(" ").map((w) => w[0]).join("").toUpperCase().slice(0, 2);
|
|
}
|
|
function getInitialsColor(name) {
|
|
const colors = [
|
|
"bg-red-500",
|
|
"bg-yellow-500",
|
|
"bg-green-500",
|
|
"bg-blue-500",
|
|
"bg-indigo-500",
|
|
"bg-purple-500",
|
|
"bg-pink-500",
|
|
"bg-teal-500"
|
|
];
|
|
let hash = 0;
|
|
for (let i = 0; i < (name || "").length; i++) {
|
|
hash = name.charCodeAt(i) + ((hash << 5) - hash);
|
|
}
|
|
return colors[Math.abs(hash) % colors.length];
|
|
}
|
|
function formatDate(date) {
|
|
if (!date) return "";
|
|
try {
|
|
return new Date(date).toLocaleDateString("en-GB", {
|
|
year: "numeric",
|
|
month: "short",
|
|
day: "numeric"
|
|
});
|
|
} catch {
|
|
return String(date);
|
|
}
|
|
}
|
|
function formatJson(data) {
|
|
if (!data) return "";
|
|
try {
|
|
return JSON.stringify(data, null, 2);
|
|
} catch {
|
|
return String(data);
|
|
}
|
|
}
|
|
function roleBadgeClass(role) {
|
|
const map = {
|
|
admin: "bg-purple-500/10 text-purple-400",
|
|
user: "bg-blue-500/10 text-blue-400",
|
|
staff: "bg-cyan-500/10 text-cyan-400",
|
|
superadmin: "bg-amber-500/10 text-amber-400"
|
|
};
|
|
return map[role?.toLowerCase()] || "bg-slate-500/10 text-slate-400";
|
|
}
|
|
function planBadgeClass(plan) {
|
|
const map = {
|
|
FREE: "bg-slate-500/10 text-slate-400",
|
|
PREMIUM: "bg-emerald-500/10 text-emerald-400",
|
|
ENTERPRISE: "bg-amber-500/10 text-amber-400"
|
|
};
|
|
return map[plan?.toUpperCase()] || "bg-slate-500/10 text-slate-400";
|
|
}
|
|
function orgRoleBadgeClass(role) {
|
|
const map = {
|
|
admin: "bg-purple-500/10 text-purple-400",
|
|
manager: "bg-blue-500/10 text-blue-400",
|
|
member: "bg-slate-500/10 text-slate-400",
|
|
owner: "bg-amber-500/10 text-amber-400"
|
|
};
|
|
return map[role?.toLowerCase()] || "bg-slate-500/10 text-slate-400";
|
|
}
|
|
function memberStatusBadgeClass(status) {
|
|
const map = {
|
|
active: "bg-emerald-500/10 text-emerald-400",
|
|
invited: "bg-blue-500/10 text-blue-400",
|
|
suspended: "bg-red-500/10 text-red-400",
|
|
inactive: "bg-slate-500/10 text-slate-400"
|
|
};
|
|
return map[status?.toLowerCase()] || "bg-slate-500/10 text-slate-400";
|
|
}
|
|
function memberStatusDotClass(status) {
|
|
const map = {
|
|
active: "bg-emerald-400",
|
|
invited: "bg-blue-400",
|
|
suspended: "bg-red-400",
|
|
inactive: "bg-slate-400"
|
|
};
|
|
return map[status?.toLowerCase()] || "bg-slate-400";
|
|
}
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
const _component_NuxtLink = __nuxt_component_0;
|
|
_push(`<div${ssrRenderAttrs(_attrs)}>`);
|
|
if (loading.value) {
|
|
_push(`<div class="flex items-center justify-center py-20"><div class="flex flex-col items-center gap-3"><svg class="w-8 h-8 text-indigo-400 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg><p class="text-slate-400 text-sm">${ssrInterpolate(_ctx.$t("persons.details.loading"))}</p></div></div>`);
|
|
} else if (error.value) {
|
|
_push(`<div class="flex flex-col items-center justify-center py-20 text-center"><svg class="w-12 h-12 text-red-500 mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"></path></svg><p class="text-red-400 text-sm mb-2">${ssrInterpolate(error.value)}</p><button class="px-4 py-2 text-sm bg-indigo-600/20 text-indigo-300 hover:bg-indigo-600/30 rounded-lg transition">${ssrInterpolate(_ctx.$t("persons.details.retry"))}</button></div>`);
|
|
} else if (person.value) {
|
|
_push(`<!--[--><div class="mb-8"><button class="inline-flex items-center gap-1.5 text-sm text-slate-400 hover:text-white transition mb-4"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path></svg> ${ssrInterpolate(_ctx.$t("persons.details.back"))}</button><div class="flex items-center justify-between"><div class="flex items-center gap-4"><div class="${ssrRenderClass([getInitialsColor(personDisplayName.value), "w-12 h-12 rounded-xl flex items-center justify-center text-lg font-bold text-white"])}">${ssrInterpolate(getInitials(personDisplayName.value))}</div><div><div class="flex items-center gap-3"><h1 class="text-2xl font-bold text-white">${ssrInterpolate(personDisplayName.value)}</h1><span class="${ssrRenderClass([person.value.is_active ? "bg-emerald-500/10 text-emerald-400" : "bg-amber-500/10 text-amber-400", "inline-flex items-center px-3 py-1 rounded-full text-xs font-medium"])}"><span class="${ssrRenderClass([person.value.is_active ? "bg-emerald-400" : "bg-amber-400", "w-1.5 h-1.5 rounded-full mr-1.5"])}"></span> ${ssrInterpolate(person.value.is_active ? _ctx.$t("persons.active") : _ctx.$t("persons.inactive"))}</span>`);
|
|
if (person.value.is_ghost) {
|
|
_push(`<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-purple-500/20 text-purple-300">${ssrInterpolate(_ctx.$t("persons.ghost"))}</span>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
if (person.value.merged_into_id) {
|
|
_push(`<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-500/20 text-red-300">${ssrInterpolate(_ctx.$t("persons.merged"))}</span>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
if (person.value.is_sales_agent) {
|
|
_push(`<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-amber-500/20 text-amber-300">${ssrInterpolate(_ctx.$t("persons.details.sales_agent"))}</span>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`</div><p class="text-sm text-slate-400 mt-0.5"> ID: ${ssrInterpolate(person.value.id)} `);
|
|
if (person.value.phone) {
|
|
_push(`<span class="ml-2 text-slate-500">· ${ssrInterpolate(person.value.phone)}</span>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`</p></div></div><div class="flex items-center gap-3">`);
|
|
if (hasEditPermission.value) {
|
|
_push(`<button class="inline-flex items-center gap-1.5 px-4 py-2 text-sm font-medium bg-indigo-600/20 text-indigo-300 hover:bg-indigo-600/30 rounded-lg transition"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><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"></path></svg> ${ssrInterpolate(_ctx.$t("persons.details.edit"))}</button>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`</div></div></div><div class="border-b border-slate-700 mb-6"><nav class="flex gap-6"><!--[-->`);
|
|
ssrRenderList(tabs, (tab) => {
|
|
_push(`<button class="${ssrRenderClass([activeTab.value === tab.key ? "text-indigo-400 border-indigo-400" : "text-slate-400 border-transparent hover:text-slate-300", "pb-3 text-sm font-medium transition border-b-2 -mb-px"])}">${ssrInterpolate(_ctx.$t(tab.label))}</button>`);
|
|
});
|
|
_push(`<!--]--></nav></div>`);
|
|
if (activeTab.value === "profile") {
|
|
_push(`<div class="space-y-6"><div class="bg-slate-800/50 border border-slate-700 rounded-xl p-6"><div class="flex items-center gap-3 mb-5"><div class="p-2 rounded-lg bg-indigo-500/10 text-indigo-400"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><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"></path></svg></div><h3 class="text-base font-semibold text-white">${ssrInterpolate(_ctx.$t("persons.details.personal_info"))}</h3></div><div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.person_id"))}</label><p class="text-sm text-white font-mono">${ssrInterpolate(person.value.id)}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.uuid"))}</label><p class="text-sm text-white font-mono text-xs">${ssrInterpolate(person.value.id_uuid)}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.last_name"))}</label><p class="text-sm text-white">${ssrInterpolate(person.value.last_name || "—")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.first_name"))}</label><p class="text-sm text-white">${ssrInterpolate(person.value.first_name || "—")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.phone"))}</label><p class="text-sm text-white">${ssrInterpolate(person.value.phone || "—")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.birth_place"))}</label><p class="text-sm text-white">${ssrInterpolate(person.value.birth_place || "—")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.birth_date"))}</label><p class="text-sm text-white">${ssrInterpolate(formatDate(person.value.birth_date) || "—")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.mothers_name"))}</label><p class="text-sm text-white">${ssrInterpolate([person.value.mothers_last_name, person.value.mothers_first_name].filter(Boolean).join(" ") || "—")}</p></div></div></div>`);
|
|
if (person.value.address) {
|
|
_push(`<div class="bg-slate-800/50 border border-slate-700 rounded-xl p-6"><div class="flex items-center gap-3 mb-5"><div class="p-2 rounded-lg bg-cyan-500/10 text-cyan-400"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"></path><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z"></path></svg></div><h3 class="text-base font-semibold text-white">${ssrInterpolate(_ctx.$t("persons.details.address"))}</h3></div><div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.zip"))}</label><p class="text-sm text-white">${ssrInterpolate(person.value.address.address_zip || "—")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.city"))}</label><p class="text-sm text-white">${ssrInterpolate(person.value.address.address_city || "—")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.street"))}</label><p class="text-sm text-white">${ssrInterpolate([person.value.address.address_street_type, person.value.address.address_street_name].filter(Boolean).join(" ") || "—")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.house_number"))}</label><p class="text-sm text-white">${ssrInterpolate(person.value.address.address_house_number || "—")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.stairwell"))}</label><p class="text-sm text-white">${ssrInterpolate(person.value.address.address_stairwell || "—")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.floor"))}</label><p class="text-sm text-white">${ssrInterpolate(person.value.address.address_floor || "—")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.door"))}</label><p class="text-sm text-white">${ssrInterpolate(person.value.address.address_door || "—")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.parcel_id"))}</label><p class="text-sm text-white">${ssrInterpolate(person.value.address.address_hrsz || "—")}</p></div>`);
|
|
if (person.value.address.full_address_text) {
|
|
_push(`<div class="lg:col-span-3"><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.full_address"))}</label><p class="text-sm text-white">${ssrInterpolate(person.value.address.full_address_text)}</p></div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`</div></div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`<div class="bg-slate-800/50 border border-slate-700 rounded-xl p-6"><div class="flex items-center gap-3 mb-5"><div class="p-2 rounded-lg bg-slate-500/10 text-slate-400"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path></svg></div><h3 class="text-base font-semibold text-white">${ssrInterpolate(_ctx.$t("persons.details.system_info"))}</h3></div><div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.is_sales_agent"))}</label><p class="text-sm text-white">${ssrInterpolate(person.value.is_sales_agent ? _ctx.$t("persons.details.yes") : _ctx.$t("persons.details.no"))}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.lifetime_xp"))}</label><p class="text-sm text-white">${ssrInterpolate(person.value.lifetime_xp)}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.penalty_points"))}</label><p class="text-sm text-white">${ssrInterpolate(person.value.penalty_points)}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.social_reputation"))}</label><p class="text-sm text-white">${ssrInterpolate(person.value.social_reputation.toFixed(2))}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.created_at"))}</label><p class="text-sm text-white">${ssrInterpolate(formatDate(person.value.created_at) || "—")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.updated_at"))}</label><p class="text-sm text-white">${ssrInterpolate(formatDate(person.value.updated_at) || "—")}</p></div>`);
|
|
if (person.value.deleted_at) {
|
|
_push(`<div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.deleted_at"))}</label><p class="text-sm text-red-400">${ssrInterpolate(formatDate(person.value.deleted_at))}</p></div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`</div></div>`);
|
|
if (hasIdentityDocs.value) {
|
|
_push(`<div class="bg-slate-800/50 border border-slate-700 rounded-xl p-6"><div class="flex items-center gap-3 mb-5"><div class="p-2 rounded-lg bg-amber-500/10 text-amber-400"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V8a2 2 0 00-2-2h-5m-4 0V5a2 2 0 114 0v1m-4 0a2 2 0 104 0m-5 8a2 2 0 100-4 2 2 0 000 4zm0 0c1.306 0 2.417.835 2.83 2M9 14a3.001 3.001 0 00-2.83 2M15 11h3m-3 4h2"></path></svg></div><h3 class="text-base font-semibold text-white">${ssrInterpolate(_ctx.$t("persons.details.identity_docs"))}</h3></div><pre class="text-xs text-slate-300 bg-slate-900/50 rounded-lg p-4 overflow-x-auto">${ssrInterpolate(formatJson(person.value.identity_docs))}</pre></div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
if (hasIceContact.value) {
|
|
_push(`<div class="bg-slate-800/50 border border-slate-700 rounded-xl p-6"><div class="flex items-center gap-3 mb-5"><div class="p-2 rounded-lg bg-red-500/10 text-red-400"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"></path></svg></div><h3 class="text-base font-semibold text-white">${ssrInterpolate(_ctx.$t("persons.details.ice_contact"))}</h3></div><pre class="text-xs text-slate-300 bg-slate-900/50 rounded-lg p-4 overflow-x-auto">${ssrInterpolate(formatJson(person.value.ice_contact))}</pre></div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`</div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
if (activeTab.value === "users") {
|
|
_push(`<div class="space-y-6"><div class="flex items-center justify-between"><div class="flex items-center gap-3"><div class="p-2 rounded-lg bg-blue-500/10 text-blue-400"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197m13.5-9a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0z"></path></svg></div><div><h3 class="text-base font-semibold text-white">${ssrInterpolate(_ctx.$t("persons.details.connected_users"))}</h3><p class="text-xs text-slate-400 mt-0.5">${ssrInterpolate(_ctx.$t("persons.details.users_count", { count: person.value.users.length }))}</p></div></div></div>`);
|
|
if (person.value.users.length === 0) {
|
|
_push(`<div class="bg-slate-800/50 border border-slate-700 rounded-xl p-12 text-center"><svg class="w-10 h-10 text-slate-600 mx-auto mb-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"></path></svg><p class="text-sm text-slate-400">${ssrInterpolate(_ctx.$t("persons.details.no_users"))}</p></div>`);
|
|
} else {
|
|
_push(`<div class="bg-slate-800/50 border border-slate-700 rounded-xl overflow-hidden"><div class="overflow-x-auto"><table class="w-full text-sm"><thead><tr class="border-b border-slate-700"><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider">ID</th><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("persons.details.email"))}</th><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("persons.details.role"))}</th><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("persons.details.status"))}</th><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("persons.details.plan"))}</th><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("persons.details.language"))}</th><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("persons.details.registered_at"))}</th></tr></thead><tbody><!--[-->`);
|
|
ssrRenderList(person.value.users, (u) => {
|
|
_push(`<tr class="border-b border-slate-700/50 last:border-b-0 hover:bg-slate-700/30 transition"><td class="px-4 py-3">`);
|
|
_push(ssrRenderComponent(_component_NuxtLink, {
|
|
to: "/users/" + u.id,
|
|
class: "text-sm font-mono text-indigo-400 hover:underline"
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`${ssrInterpolate(u.id)}`);
|
|
} else {
|
|
return [
|
|
createTextVNode(toDisplayString(u.id), 1)
|
|
];
|
|
}
|
|
}),
|
|
_: 2
|
|
}, _parent));
|
|
_push(`</td><td class="px-4 py-3">`);
|
|
_push(ssrRenderComponent(_component_NuxtLink, {
|
|
to: "/users/" + u.id,
|
|
class: "text-sm font-medium text-white hover:text-indigo-400 hover:underline transition-colors"
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`${ssrInterpolate(u.email)}`);
|
|
} else {
|
|
return [
|
|
createTextVNode(toDisplayString(u.email), 1)
|
|
];
|
|
}
|
|
}),
|
|
_: 2
|
|
}, _parent));
|
|
_push(`</td><td class="px-4 py-3"><span class="${ssrRenderClass([roleBadgeClass(u.role), "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium"])}">${ssrInterpolate(u.role || "—")}</span></td><td class="px-4 py-3"><span class="${ssrRenderClass([u.is_active ? "bg-emerald-500/10 text-emerald-400" : "bg-red-500/10 text-red-400", "inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-medium"])}"><span class="${ssrRenderClass([u.is_active ? "bg-emerald-400" : "bg-red-400", "w-1.5 h-1.5 rounded-full"])}"></span> ${ssrInterpolate(u.is_active ? _ctx.$t("persons.active") : _ctx.$t("persons.inactive"))}</span></td><td class="px-4 py-3"><span class="${ssrRenderClass([planBadgeClass(u.subscription_plan), "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium"])}">${ssrInterpolate(u.subscription_plan)}</span></td><td class="px-4 py-3 text-slate-300 text-xs">${ssrInterpolate(u.preferred_language?.toUpperCase() || "—")}</td><td class="px-4 py-3 text-slate-300 text-xs">${ssrInterpolate(formatDate(u.created_at) || "—")}</td></tr>`);
|
|
});
|
|
_push(`<!--]--></tbody></table></div></div>`);
|
|
}
|
|
_push(`</div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
if (activeTab.value === "memberships") {
|
|
_push(`<div class="space-y-6"><div class="flex items-center justify-between"><div class="flex items-center gap-3"><div class="p-2 rounded-lg bg-purple-500/10 text-purple-400"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16l3.5-2 3.5 2 3.5-2 3.5 2M10 8.5a.5.5 0 11-1 0 .5.5 0 011 0zm5 5a.5.5 0 11-1 0 .5.5 0 011 0z"></path></svg></div><div><h3 class="text-base font-semibold text-white">${ssrInterpolate(_ctx.$t("persons.details.memberships"))}</h3><p class="text-xs text-slate-400 mt-0.5">${ssrInterpolate(_ctx.$t("persons.details.memberships_count", { count: person.value.memberships.length }))}</p></div></div></div>`);
|
|
if (person.value.memberships.length === 0) {
|
|
_push(`<div class="bg-slate-800/50 border border-slate-700 rounded-xl p-12 text-center"><svg class="w-10 h-10 text-slate-600 mx-auto mb-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"></path></svg><p class="text-sm text-slate-400">${ssrInterpolate(_ctx.$t("persons.details.no_memberships"))}</p></div>`);
|
|
} else {
|
|
_push(`<div class="bg-slate-800/50 border border-slate-700 rounded-xl overflow-hidden"><div class="overflow-x-auto"><table class="w-full text-sm"><thead><tr class="border-b border-slate-700"><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("persons.details.org_name"))}</th><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("persons.details.org_type"))}</th><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("persons.details.org_role"))}</th><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("persons.details.member_status"))}</th><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("persons.details.verified"))}</th><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("persons.details.joined_at"))}</th></tr></thead><tbody><!--[-->`);
|
|
ssrRenderList(person.value.memberships, (m) => {
|
|
_push(`<tr class="border-b border-slate-700/50 last:border-b-0 hover:bg-slate-700/30 transition"><td class="px-4 py-3">`);
|
|
_push(ssrRenderComponent(_component_NuxtLink, {
|
|
to: "/garages/" + m.organization_id,
|
|
class: "text-sm font-medium text-white hover:text-indigo-400 hover:underline transition-colors"
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`${ssrInterpolate(m.organization_name)}`);
|
|
} else {
|
|
return [
|
|
createTextVNode(toDisplayString(m.organization_name), 1)
|
|
];
|
|
}
|
|
}),
|
|
_: 2
|
|
}, _parent));
|
|
_push(`</td><td class="px-4 py-3"><span class="text-xs text-slate-300">${ssrInterpolate(m.organization_type || "—")}</span></td><td class="px-4 py-3"><span class="${ssrRenderClass([orgRoleBadgeClass(m.role), "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium"])}">${ssrInterpolate(m.role)}</span></td><td class="px-4 py-3"><span class="${ssrRenderClass([memberStatusBadgeClass(m.status), "inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-medium"])}"><span class="${ssrRenderClass([memberStatusDotClass(m.status), "w-1.5 h-1.5 rounded-full"])}"></span> ${ssrInterpolate(m.status)}</span></td><td class="px-4 py-3">`);
|
|
if (m.is_verified) {
|
|
_push(`<span class="inline-flex items-center gap-1 text-xs text-emerald-400"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> ${ssrInterpolate(_ctx.$t("persons.details.verified_yes"))}</span>`);
|
|
} else {
|
|
_push(`<span class="text-xs text-slate-500">${ssrInterpolate(_ctx.$t("persons.details.verified_no"))}</span>`);
|
|
}
|
|
_push(`</td><td class="px-4 py-3 text-slate-300 text-xs">${ssrInterpolate(formatDate(m.created_at) || "—")}</td></tr>`);
|
|
});
|
|
_push(`<!--]--></tbody></table></div></div>`);
|
|
}
|
|
_push(`</div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
if (activeTab.value === "owned_orgs") {
|
|
_push(`<div class="space-y-6"><div class="flex items-center justify-between"><div class="flex items-center gap-3"><div class="p-2 rounded-lg bg-emerald-500/10 text-emerald-400"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16l3.5-2 3.5 2 3.5-2 3.5 2M10 8.5a.5.5 0 11-1 0 .5.5 0 011 0zm5 5a.5.5 0 11-1 0 .5.5 0 011 0z"></path></svg></div><div><h3 class="text-base font-semibold text-white">${ssrInterpolate(_ctx.$t("persons.details.owned_orgs"))}</h3><p class="text-xs text-slate-400 mt-0.5">${ssrInterpolate(_ctx.$t("persons.details.owned_orgs_count", { count: person.value.owned_organizations.length }))}</p></div></div></div>`);
|
|
if (person.value.owned_organizations.length === 0) {
|
|
_push(`<div class="bg-slate-800/50 border border-slate-700 rounded-xl p-12 text-center"><svg class="w-10 h-10 text-slate-600 mx-auto mb-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"></path></svg><p class="text-sm text-slate-400">${ssrInterpolate(_ctx.$t("persons.details.no_owned_orgs"))}</p></div>`);
|
|
} else {
|
|
_push(`<div class="bg-slate-800/50 border border-slate-700 rounded-xl overflow-hidden"><div class="overflow-x-auto"><table class="w-full text-sm"><thead><tr class="border-b border-slate-700"><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("persons.details.org_name"))}</th><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("persons.details.org_type"))}</th><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("persons.details.status"))}</th><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("persons.details.created_at"))}</th></tr></thead><tbody><!--[-->`);
|
|
ssrRenderList(person.value.owned_organizations, (o) => {
|
|
_push(`<tr class="border-b border-slate-700/50 last:border-b-0 hover:bg-slate-700/30 transition"><td class="px-4 py-3">`);
|
|
_push(ssrRenderComponent(_component_NuxtLink, {
|
|
to: "/garages/" + o.id,
|
|
class: "text-sm font-medium text-white hover:text-indigo-400 hover:underline transition-colors"
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`${ssrInterpolate(o.name)}`);
|
|
} else {
|
|
return [
|
|
createTextVNode(toDisplayString(o.name), 1)
|
|
];
|
|
}
|
|
}),
|
|
_: 2
|
|
}, _parent));
|
|
_push(`</td><td class="px-4 py-3"><span class="text-xs text-slate-300">${ssrInterpolate(o.org_type || "—")}</span></td><td class="px-4 py-3"><span class="${ssrRenderClass([o.is_active ? "bg-emerald-500/10 text-emerald-400" : "bg-slate-500/10 text-slate-400", "inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-medium"])}"><span class="${ssrRenderClass([o.is_active ? "bg-emerald-400" : "bg-slate-400", "w-1.5 h-1.5 rounded-full"])}"></span> ${ssrInterpolate(o.is_active ? _ctx.$t("persons.active") : _ctx.$t("persons.inactive"))}</span></td><td class="px-4 py-3 text-slate-300 text-xs">${ssrInterpolate(formatDate(o.created_at) || "—")}</td></tr>`);
|
|
});
|
|
_push(`<!--]--></tbody></table></div></div>`);
|
|
}
|
|
_push(`</div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
if (activeTab.value === "merge_history") {
|
|
_push(`<div class="space-y-6"><div class="flex items-center justify-between"><div class="flex items-center gap-3"><div class="p-2 rounded-lg bg-red-500/10 text-red-400"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><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"></path></svg></div><div><h3 class="text-base font-semibold text-white">${ssrInterpolate(_ctx.$t("persons.details.merge_history"))}</h3></div></div></div>`);
|
|
if (!person.value.merge_history) {
|
|
_push(`<div class="bg-slate-800/50 border border-slate-700 rounded-xl p-12 text-center"><svg class="w-10 h-10 text-slate-600 mx-auto mb-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg><p class="text-sm text-slate-400">${ssrInterpolate(_ctx.$t("persons.details.no_merge_history"))}</p></div>`);
|
|
} else {
|
|
_push(`<div class="bg-slate-800/50 border border-slate-700 rounded-xl p-6"><div class="flex items-center gap-4"><div class="p-3 rounded-lg bg-red-500/10 text-red-400"><svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"></path></svg></div><div><p class="text-sm text-slate-300">${ssrInterpolate(_ctx.$t("persons.details.merged_into"))} `);
|
|
_push(ssrRenderComponent(_component_NuxtLink, {
|
|
to: "/persons/" + person.value.merge_history.merged_into_id,
|
|
class: "text-indigo-400 hover:underline font-medium"
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`${ssrInterpolate(person.value.merge_history.merged_into_name || "#" + person.value.merge_history.merged_into_id)}`);
|
|
} else {
|
|
return [
|
|
createTextVNode(toDisplayString(person.value.merge_history.merged_into_name || "#" + person.value.merge_history.merged_into_id), 1)
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent));
|
|
_push(`</p><p class="text-xs text-slate-500 mt-1">${ssrInterpolate(_ctx.$t("persons.details.merged_at"))}: ${ssrInterpolate(formatDate(person.value.merge_history.merged_at))}</p></div></div></div>`);
|
|
}
|
|
_push(`</div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
ssrRenderTeleport(_push, (_push2) => {
|
|
if (showEditModal.value) {
|
|
_push2(`<div class="fixed inset-0 z-50 flex items-center justify-center"><div class="fixed inset-0 bg-black/60 backdrop-blur-sm"></div><div class="relative bg-slate-800 border border-slate-700 rounded-xl w-full max-w-2xl max-h-[90vh] overflow-y-auto shadow-2xl"><div class="sticky top-0 bg-slate-800 border-b border-slate-700 px-6 py-4 flex items-center justify-between"><h2 class="text-lg font-semibold text-white">${ssrInterpolate(_ctx.$t("persons.details.edit_title"))}</h2><button class="text-slate-400 hover:text-white transition"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg></button></div><div class="p-6 space-y-5"><div><h3 class="text-sm font-semibold text-slate-300 mb-3">${ssrInterpolate(_ctx.$t("persons.details.personal_info"))}</h3><div class="grid grid-cols-1 md:grid-cols-2 gap-4"><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.last_name"))}</label><input${ssrRenderAttr("value", editForm.value.last_name)} type="text" class="w-full px-3 py-2 text-sm bg-slate-900/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:border-indigo-500 transition"${ssrRenderAttr("placeholder", _ctx.$t("persons.details.last_name"))}></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.first_name"))}</label><input${ssrRenderAttr("value", editForm.value.first_name)} type="text" class="w-full px-3 py-2 text-sm bg-slate-900/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:border-indigo-500 transition"${ssrRenderAttr("placeholder", _ctx.$t("persons.details.first_name"))}></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.phone"))}</label><input${ssrRenderAttr("value", editForm.value.phone)} type="text" class="w-full px-3 py-2 text-sm bg-slate-900/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:border-indigo-500 transition"${ssrRenderAttr("placeholder", _ctx.$t("persons.phone"))}></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.birth_place"))}</label><input${ssrRenderAttr("value", editForm.value.birth_place)} type="text" class="w-full px-3 py-2 text-sm bg-slate-900/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:border-indigo-500 transition"${ssrRenderAttr("placeholder", _ctx.$t("persons.details.birth_place"))}></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.birth_date"))}</label><input${ssrRenderAttr("value", editForm.value.birth_date)} type="date" class="w-full px-3 py-2 text-sm bg-slate-900/50 border border-slate-600 rounded-lg text-white focus:outline-none focus:border-indigo-500 transition"></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.mothers_last_name"))}</label><input${ssrRenderAttr("value", editForm.value.mothers_last_name)} type="text" class="w-full px-3 py-2 text-sm bg-slate-900/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:border-indigo-500 transition"${ssrRenderAttr("placeholder", _ctx.$t("persons.details.mothers_last_name"))}></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("persons.details.mothers_first_name"))}</label><input${ssrRenderAttr("value", editForm.value.mothers_first_name)} type="text" class="w-full px-3 py-2 text-sm bg-slate-900/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:border-indigo-500 transition"${ssrRenderAttr("placeholder", _ctx.$t("persons.details.mothers_first_name"))}></div></div></div><div class="border-t border-slate-700 pt-5"><h3 class="text-sm font-semibold text-slate-300 mb-3">${ssrInterpolate(_ctx.$t("persons.details.status_section"))}</h3><div class="flex flex-wrap gap-6"><label class="flex items-center gap-2 cursor-pointer"><input${ssrIncludeBooleanAttr(Array.isArray(editForm.value.is_active) ? ssrLooseContain(editForm.value.is_active, null) : editForm.value.is_active) ? " checked" : ""} type="checkbox" class="w-4 h-4 rounded border-slate-600 bg-slate-900/50 text-indigo-500 focus:ring-indigo-500"><span class="text-sm text-slate-300">${ssrInterpolate(_ctx.$t("persons.details.is_active"))}</span></label><label class="flex items-center gap-2 cursor-pointer"><input${ssrIncludeBooleanAttr(Array.isArray(editForm.value.is_ghost) ? ssrLooseContain(editForm.value.is_ghost, null) : editForm.value.is_ghost) ? " checked" : ""} type="checkbox" class="w-4 h-4 rounded border-slate-600 bg-slate-900/50 text-purple-500 focus:ring-purple-500"><span class="text-sm text-slate-300">${ssrInterpolate(_ctx.$t("persons.details.is_ghost"))}</span></label><label class="flex items-center gap-2 cursor-pointer"><input${ssrIncludeBooleanAttr(Array.isArray(editForm.value.is_sales_agent) ? ssrLooseContain(editForm.value.is_sales_agent, null) : editForm.value.is_sales_agent) ? " checked" : ""} type="checkbox" class="w-4 h-4 rounded border-slate-600 bg-slate-900/50 text-amber-500 focus:ring-amber-500"><span class="text-sm text-slate-300">${ssrInterpolate(_ctx.$t("persons.details.is_sales_agent"))}</span></label></div></div></div><div class="sticky bottom-0 bg-slate-800 border-t border-slate-700 px-6 py-4 flex items-center justify-end gap-3"><button class="px-4 py-2 text-sm text-slate-400 hover:text-white transition">${ssrInterpolate(_ctx.$t("persons.details.cancel"))}</button><button${ssrIncludeBooleanAttr(saving.value) ? " disabled" : ""} class="inline-flex items-center gap-2 px-4 py-2 text-sm font-medium bg-indigo-600 text-white hover:bg-indigo-500 rounded-lg transition disabled:opacity-50 disabled:cursor-not-allowed">`);
|
|
if (saving.value) {
|
|
_push2(`<svg class="w-4 h-4 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg>`);
|
|
} else {
|
|
_push2(`<!---->`);
|
|
}
|
|
_push2(` ${ssrInterpolate(saving.value ? _ctx.$t("persons.details.saving") : _ctx.$t("persons.details.save"))}</button></div></div></div>`);
|
|
} else {
|
|
_push2(`<!---->`);
|
|
}
|
|
}, "body", false, _parent);
|
|
ssrRenderTeleport(_push, (_push2) => {
|
|
if (notification.value.show) {
|
|
_push2(`<div class="${ssrRenderClass([notification.value.type === "success" ? "bg-emerald-600 text-white" : "bg-red-600 text-white", "fixed bottom-6 right-6 z-50 flex items-center gap-3 px-5 py-3 rounded-lg shadow-xl transition-all duration-300"])}">`);
|
|
if (notification.value.type === "success") {
|
|
_push2(`<svg class="w-5 h-5 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>`);
|
|
} else {
|
|
_push2(`<svg class="w-5 h-5 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>`);
|
|
}
|
|
_push2(`<span class="text-sm font-medium">${ssrInterpolate(notification.value.message)}</span><button class="ml-2 text-white/70 hover:text-white transition"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg></button></div>`);
|
|
} else {
|
|
_push2(`<!---->`);
|
|
}
|
|
}, "body", false, _parent);
|
|
_push(`<!--]-->`);
|
|
} 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/persons/[id]/index.vue");
|
|
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
};
|
|
export {
|
|
_sfc_main as default
|
|
};
|
|
//# sourceMappingURL=index-DN4o4Z9u.js.map
|