@opengis/surveyor 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +175 -33
  3. package/dist/chunks/BaseModal-SQXvRRNW.js +90 -0
  4. package/dist/chunks/{RegistryForm-pvIcFR-V.js → RegistryForm-wG-c8GKf.js} +1 -1
  5. package/dist/chunks/{RegistryFormModal-BjGu7Upv.js → RegistryFormModal-R_iZYqGE.js} +2 -2
  6. package/dist/chunks/{RegistryToolbar-CiUgsjpU.js → RegistryToolbar-322DKUXi.js} +3 -3
  7. package/dist/chunks/SurveyorTeleport-CnSF0Ptl.js +23 -0
  8. package/dist/chunks/{VerifiedBadge-B6droMOf.js → VerifiedBadge-bk0n-rlC.js} +1 -1
  9. package/dist/chunks/{buildSchema-nkA4Y0YG.js → buildSchema-CccjX9TJ.js} +1 -1
  10. package/dist/chunks/card-B_SfARf7.js +1190 -0
  11. package/dist/chunks/card-C3y-j2TA.js +298 -0
  12. package/dist/chunks/{card--DHsMNBd.js → card-CWqi1K-x.js} +107 -106
  13. package/dist/chunks/card-DWpAv92l.js +539 -0
  14. package/dist/chunks/{card-BZn5CDw9.js → card-X9UVFgdR.js} +254 -248
  15. package/dist/chunks/{certificates-DueBDDvc.js → certificates-Cwch72-o.js} +131 -130
  16. package/dist/chunks/{create-l28e-bWl.js → create-DTP9x2uS.js} +278 -265
  17. package/dist/chunks/dom-BSjFG3O0.js +7 -0
  18. package/dist/chunks/{filterQuery-B9XNx1f1.js → filterQuery-CvfZrkTC.js} +1 -1
  19. package/dist/chunks/{form-CdGS1nVO.js → form-Bh6i5n1U.js} +1 -1
  20. package/dist/chunks/{form-QTkkzwbC.js → form-DDjELqZ9.js} +1 -1
  21. package/dist/chunks/{map-layers-qxWjos2V.js → map-layers-sT-gTiD_.js} +130 -125
  22. package/dist/chunks/{map-BW3iOhQg.js → map-qXQe_qam.js} +643 -630
  23. package/dist/chunks/{organizations-CZOINYMq.js → organizations-ByVE2f0c.js} +129 -124
  24. package/dist/chunks/requests-BTpLXrNj.js +233 -0
  25. package/dist/chunks/{resendSurveyorRegistration-DopjOHaM.js → resendSurveyorRegistration-BHTTVIw1.js} +1 -1
  26. package/dist/chunks/{resources-Cl_EvaIy.js → resources-2e8RFqWR.js} +1 -1
  27. package/dist/chunks/{surveyorAccount-BceNQypZ.js → surveyorAccount-C7UiiIYg.js} +1 -1
  28. package/dist/chunks/useEntityPath-C5Owtidc.js +98 -0
  29. package/dist/chunks/{users-DlaogjC_.js → users-U1P6xCP4.js} +106 -100
  30. package/dist/index.css +1 -1
  31. package/dist/index.js +215 -98
  32. package/package.json +83 -77
  33. package/plugin.d.ts +15 -0
  34. package/plugin.js +8 -10
  35. package/server/app.ts +2 -1
  36. package/server/resources/surveyor-admin/application_comments.ts +3 -3
  37. package/server/suggests/index.ts +17 -0
  38. package/surveyor-types.d.ts +5 -0
  39. package/README.npm.md +0 -51
  40. package/dist/chunks/AppIcon-C-4QykTP.js +0 -85
  41. package/dist/chunks/BaseModal-DrTTkLmR.js +0 -85
  42. package/dist/chunks/card-9LaB42Ol.js +0 -538
  43. package/dist/chunks/card-CNqXSyqX.js +0 -297
  44. package/dist/chunks/card-CgGOgGyd.js +0 -973
  45. package/dist/chunks/requests-DQJIhz00.js +0 -232
  46. package/server/embed.ts +0 -49
@@ -0,0 +1,539 @@
1
+ import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
+ import { n as t, t as n } from "./useEntityPath-C5Owtidc.js";
3
+ import { a as r, o as i } from "./resources-2e8RFqWR.js";
4
+ import { t as a } from "./UserTypeBadge-LvnMuKGo.js";
5
+ import { n as o, t as s } from "./AppealDetailField-DNRGpnyD.js";
6
+ import { a as ee, i as te, n as ne, r as c, t as re } from "./surveyorAccount-C7UiiIYg.js";
7
+ import { n as l, t as ie } from "./resendSurveyorRegistration-BHTTVIw1.js";
8
+ import { Fragment as u, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createTextVNode as g, createVNode as _, defineComponent as v, normalizeClass as y, onMounted as ae, onUnmounted as oe, openBlock as b, ref as x, renderList as S, toDisplayString as C, vModelText as w, watch as T, withCtx as E, withDirectives as D, withModifiers as O } from "vue";
9
+ import { RouterLink as se, useRoute as ce } from "vue-router";
10
+ import { confirm as k, notify as A } from "@opengis/core";
11
+ //#region admin/src/pages/users/card.vue?vue&type=script&setup=true&lang.ts
12
+ var j = "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm text-slate-700 outline-none transition-colors focus:border-brand-400 focus:ring-1 focus:ring-brand-400", M = /*@__PURE__*/ v({
13
+ __name: "card",
14
+ setup(e, { expose: u }) {
15
+ u();
16
+ let f = ce(), { listPath: p } = n(), m = x(null), h = x(!1), g = x(!1), _ = x(!1), v = x(""), y = x(!1), b = x(!1), S = x({
17
+ last_name: "",
18
+ first_name: "",
19
+ middle_name: "",
20
+ email: "",
21
+ phone: ""
22
+ }), C = d(() => {
23
+ let e = m.value?.certificate;
24
+ return Array.isArray(e) ? e[0] ?? null : e ?? null;
25
+ }), w = d(() => m.value?.organizations ?? []), E = d(() => w.value.length > 1), D = x([]);
26
+ function O(e) {
27
+ return !E.value || D.value.includes(e);
28
+ }
29
+ function M(e) {
30
+ D.value = D.value.includes(e) ? D.value.filter((t) => t !== e) : [...D.value, e];
31
+ }
32
+ function N(e) {
33
+ return e.membership_enabled !== !1;
34
+ }
35
+ let P = d(() => m.value?.applications ?? []);
36
+ function F(e) {
37
+ return [
38
+ e.last_name,
39
+ e.first_name,
40
+ e.middle_name
41
+ ].filter(Boolean).join(" ") || "—";
42
+ }
43
+ let I = d(() => y.value ? F(S.value) : m.value ? F(m.value) : ""), L = d(() => String(C.value?.certificate_type ?? "")), R = d(() => m.value ? ie(m.value) : !1), z = d(() => m.value ? re(m.value) : !1), B = d(() => !m.value || ee(m.value));
44
+ function V(e) {
45
+ if (!e) return "";
46
+ let t = e.match(/^(\d{4})-(\d{2})-(\d{2})/);
47
+ return t ? `${t[3]}.${t[2]}.${t[1]}` : e;
48
+ }
49
+ function H(e) {
50
+ return e.address_id_data?.text || e.location || "—";
51
+ }
52
+ function U(e) {
53
+ S.value = {
54
+ last_name: e.last_name ?? "",
55
+ first_name: e.first_name ?? "",
56
+ middle_name: e.middle_name ?? "",
57
+ email: e.email ?? "",
58
+ phone: e.phone ?? ""
59
+ };
60
+ }
61
+ function W() {
62
+ m.value && (U(m.value), b.value = !1, y.value = !0);
63
+ }
64
+ function G() {
65
+ m.value && U(m.value), y.value = !1;
66
+ }
67
+ async function K() {
68
+ if (!m.value || g.value) return;
69
+ let e = {
70
+ last_name: S.value.last_name.trim(),
71
+ first_name: S.value.first_name.trim(),
72
+ middle_name: S.value.middle_name.trim(),
73
+ email: S.value.email.trim().toLowerCase(),
74
+ phone: S.value.phone.trim()
75
+ };
76
+ if (!e.last_name || !e.first_name || !e.email) {
77
+ A({
78
+ type: "warning",
79
+ title: "Перевірте поля",
80
+ message: "Прізвище, імʼя та email обовʼязкові"
81
+ });
82
+ return;
83
+ }
84
+ g.value = !0;
85
+ try {
86
+ await i("surveyors", m.value.surveyor_id, e), m.value = {
87
+ ...m.value,
88
+ ...e
89
+ }, y.value = !1;
90
+ } catch (e) {
91
+ A({
92
+ type: "error",
93
+ title: "Помилка збереження",
94
+ message: e instanceof Error ? e.message : "Не вдалося зберегти користувача"
95
+ });
96
+ } finally {
97
+ g.value = !1;
98
+ }
99
+ }
100
+ async function q() {
101
+ if (m.value && !_.value && R.value) {
102
+ b.value = !1, _.value = !0;
103
+ try {
104
+ await l(m.value.surveyor_id);
105
+ } finally {
106
+ _.value = !1;
107
+ }
108
+ }
109
+ }
110
+ function J() {
111
+ if (!m.value || !z.value) return;
112
+ let e = m.value.surveyor_id, t = F(m.value);
113
+ b.value = !1, k({
114
+ title: "Зміна пароля",
115
+ type: "warning",
116
+ message: `Згенерувати новий пароль для «${t}»? Поточний пароль перестане діяти, новий буде надіслано на email.`,
117
+ confirmButtonText: "Згенерувати",
118
+ cancelButtonText: "Скасувати",
119
+ onConfirm: () => c(e)
120
+ });
121
+ }
122
+ function Y() {
123
+ if (!m.value) return;
124
+ let e = m.value.surveyor_id;
125
+ b.value = !1, ne(m.value, F(m.value), (t) => {
126
+ m.value?.surveyor_id === e && (m.value = {
127
+ ...m.value,
128
+ enabled: t
129
+ });
130
+ });
131
+ }
132
+ function X(e) {
133
+ if (!m.value) return;
134
+ let t = m.value.surveyor_id, n = e.org_id, r = e.name || "—", i = F(m.value), a = !N(e);
135
+ k({
136
+ title: a ? "Активація" : "Деактивація",
137
+ type: a ? "warning" : "error",
138
+ message: a ? `Активувати користувача «${i}» в організації «${r}»?` : `Деактивувати користувача «${i}» в організації «${r}»? Доступ до заявок цієї організації буде вимкнено.`,
139
+ confirmButtonText: a ? "Активувати" : "Деактивувати",
140
+ cancelButtonText: "Скасувати",
141
+ onConfirm: async () => {
142
+ await te(t, n, a) && m.value?.surveyor_id === t && (m.value = {
143
+ ...m.value,
144
+ organizations: (m.value.organizations ?? []).map((e) => e.org_id === n ? {
145
+ ...e,
146
+ membership_enabled: a
147
+ } : e)
148
+ });
149
+ }
150
+ });
151
+ }
152
+ function Z(e) {
153
+ let t = e?.target;
154
+ t instanceof Element && t.closest("[data-user-header-menu]") || (b.value = !1);
155
+ }
156
+ async function Q(e) {
157
+ h.value = !0, v.value = "", m.value = null, b.value = !1, y.value = !1, D.value = [];
158
+ try {
159
+ m.value = await r(`/api/resource/surveyors/${encodeURIComponent(e)}?include=certificate,organizations,applications&limit=100`);
160
+ } catch (e) {
161
+ m.value = null, v.value = e instanceof Error ? e.message : "Не вдалося завантажити користувача";
162
+ } finally {
163
+ h.value = !1;
164
+ }
165
+ }
166
+ T(() => String(f.params.id), (e) => {
167
+ e && Q(e);
168
+ }, { immediate: !0 }), ae(() => document.addEventListener("click", Z)), oe(() => document.removeEventListener("click", Z));
169
+ let $ = {
170
+ fieldClass: j,
171
+ route: f,
172
+ listPath: p,
173
+ surveyor: m,
174
+ loading: h,
175
+ saving: g,
176
+ resending: _,
177
+ error: v,
178
+ editing: y,
179
+ menuOpen: b,
180
+ draft: S,
181
+ certificate: C,
182
+ organizations: w,
183
+ organizationsAccordion: E,
184
+ openOrganizations: D,
185
+ organizationOpen: O,
186
+ toggleOrganization: M,
187
+ membershipEnabled: N,
188
+ applications: P,
189
+ personName: F,
190
+ fullName: I,
191
+ registryType: L,
192
+ showResendRegistration: R,
193
+ showResetPassword: z,
194
+ accountEnabled: B,
195
+ formatDate: V,
196
+ appealAddress: H,
197
+ fillDraft: U,
198
+ startEdit: W,
199
+ cancelEdit: G,
200
+ saveEdit: K,
201
+ resendRegistrationInvite: q,
202
+ resetPassword: J,
203
+ toggleAccountBlock: Y,
204
+ toggleMembership: X,
205
+ closeMenu: Z,
206
+ loadSurveyor: Q,
207
+ AppIcon: t,
208
+ get RouterLink() {
209
+ return se;
210
+ },
211
+ AppealDetailSection: o,
212
+ AppealDetailField: s,
213
+ UserTypeBadge: a
214
+ };
215
+ return Object.defineProperty($, "__isScriptSetup", {
216
+ enumerable: !1,
217
+ value: !0
218
+ }), $;
219
+ }
220
+ }), N = {
221
+ key: 0,
222
+ class: "px-4 py-16 text-center text-sm text-slate-400"
223
+ }, P = {
224
+ key: 1,
225
+ class: "pl-0"
226
+ }, F = { class: "mb-6" }, I = { class: "mb-4 flex items-center gap-1.5 text-sm" }, L = { class: "font-medium text-slate-700" }, R = { class: "flex items-start justify-between gap-4" }, z = { class: "flex min-w-0 flex-wrap items-center gap-3" }, B = { class: "text-xl font-bold tracking-tight text-slate-900" }, V = {
227
+ key: 1,
228
+ class: "inline-flex items-center rounded-full border border-slate-200 bg-slate-50 px-2 py-0.5 text-xs font-medium text-slate-600"
229
+ }, H = {
230
+ class: "relative shrink-0",
231
+ "data-user-header-menu": ""
232
+ }, U = ["aria-expanded"], W = {
233
+ key: 0,
234
+ class: "absolute right-0 top-11 z-20 w-64 overflow-hidden rounded-lg border border-slate-200 bg-white py-1 text-left shadow-card-hover"
235
+ }, G = ["disabled"], K = { class: "flex flex-col gap-5" }, q = {
236
+ key: 0,
237
+ class: "grid grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2"
238
+ }, J = { class: "block" }, Y = { class: "block" }, X = { class: "block" }, Z = { class: "block" }, Q = { class: "block sm:col-span-2" }, $ = {
239
+ key: 1,
240
+ class: "grid grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2"
241
+ }, le = { class: "grid grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2" }, ue = {
242
+ key: 0,
243
+ class: "py-6 text-center text-sm text-slate-400"
244
+ }, de = ["aria-expanded", "onClick"], fe = { class: "flex min-w-0 flex-wrap items-center gap-2" }, pe = { class: "break-words text-sm font-semibold text-slate-800" }, me = {
245
+ key: 0,
246
+ class: "text-xs font-medium text-amber-700"
247
+ }, he = { class: "flex flex-wrap items-center gap-3" }, ge = ["onClick"], _e = {
248
+ key: 0,
249
+ class: "py-6 text-center text-sm text-slate-400"
250
+ }, ve = {
251
+ key: 1,
252
+ class: "overflow-x-auto"
253
+ }, ye = { class: "min-w-full table-fixed text-left text-[13px]" }, be = { class: "divide-y divide-slate-100" }, xe = { class: "px-1 py-3" }, Se = { class: "px-1 py-3 text-slate-600" }, Ce = { class: "px-1 py-3 text-slate-600" }, we = {
254
+ key: 0,
255
+ class: "flex justify-end gap-3 rounded-xl border border-slate-200 bg-white px-5 py-4 shadow-card"
256
+ }, Te = ["disabled"], Ee = ["disabled"], De = {
257
+ key: 2,
258
+ class: "rounded-xl border border-slate-200 bg-white px-6 py-16 text-center shadow-card"
259
+ }, Oe = { class: "text-sm text-slate-500" };
260
+ function ke(e, t, n, r, i, a) {
261
+ return r.loading ? (b(), m("div", N, " Завантаження… ")) : r.surveyor ? (b(), m("div", P, [h("header", F, [h("nav", I, [
262
+ _(r.RouterLink, {
263
+ to: r.listPath,
264
+ class: "flex items-center gap-1 text-slate-400 transition-colors hover:text-brand-600"
265
+ }, {
266
+ default: E(() => [_(r.AppIcon, {
267
+ name: "home",
268
+ class: "h-3.5 w-3.5"
269
+ }), t[6] ||= g(" Реєстр користувачів ", -1)]),
270
+ _: 1
271
+ }, 8, ["to"]),
272
+ t[7] ||= h("span", { class: "text-slate-300" }, "/", -1),
273
+ h("span", L, C(r.fullName), 1)
274
+ ]), h("div", R, [h("div", z, [h("h1", B, C(r.fullName), 1), r.registryType ? (b(), f(r.UserTypeBadge, {
275
+ key: 0,
276
+ type: r.registryType
277
+ }, null, 8, ["type"])) : r.certificate?.certificate_type_data?.text ? (b(), m("span", V, C(r.certificate.certificate_type_data.text), 1)) : p("", !0)]), h("div", H, [h("button", {
278
+ type: "button",
279
+ class: "inline-flex h-9 w-9 items-center justify-center rounded-lg border border-slate-200 bg-white text-slate-600 transition-colors hover:border-brand-300 hover:text-brand-700",
280
+ "aria-label": "Дії",
281
+ "aria-expanded": r.menuOpen,
282
+ onClick: t[0] ||= O((e) => r.menuOpen = !r.menuOpen, ["stop"])
283
+ }, [_(r.AppIcon, {
284
+ name: "more-vertical",
285
+ class: "h-4 w-4"
286
+ })], 8, U), r.menuOpen ? (b(), m("div", W, [
287
+ h("button", {
288
+ type: "button",
289
+ class: "flex w-full items-center gap-2 whitespace-nowrap px-3 py-2.5 text-sm text-slate-700 transition-colors hover:bg-slate-50",
290
+ onClick: r.startEdit
291
+ }, [_(r.AppIcon, {
292
+ name: "pencil",
293
+ class: "h-4 w-4 shrink-0 text-slate-400"
294
+ }), t[8] ||= g(" Редагувати ", -1)]),
295
+ r.showResendRegistration ? (b(), m("button", {
296
+ key: 0,
297
+ type: "button",
298
+ class: "flex w-full items-center gap-2 whitespace-nowrap px-3 py-2.5 text-sm text-slate-700 transition-colors hover:bg-slate-50 disabled:opacity-60",
299
+ disabled: r.resending,
300
+ onClick: r.resendRegistrationInvite
301
+ }, [_(r.AppIcon, {
302
+ name: "send",
303
+ class: "h-4 w-4 shrink-0 text-slate-400"
304
+ }), g(" " + C(r.resending ? "Надсилання…" : "Надіслати лист повторно"), 1)], 8, G)) : p("", !0),
305
+ r.showResetPassword ? (b(), m("button", {
306
+ key: 1,
307
+ type: "button",
308
+ class: "flex w-full items-center gap-2 whitespace-nowrap px-3 py-2.5 text-sm text-slate-700 transition-colors hover:bg-slate-50",
309
+ onClick: r.resetPassword
310
+ }, [_(r.AppIcon, {
311
+ name: "key-round",
312
+ class: "h-4 w-4 shrink-0 text-slate-400"
313
+ }), t[9] ||= g(" Згенерувати новий пароль ", -1)])) : p("", !0),
314
+ h("button", {
315
+ type: "button",
316
+ class: y(["flex w-full items-center gap-2 whitespace-nowrap px-3 py-2.5 text-sm transition-colors", r.accountEnabled ? "text-red-600 hover:bg-red-50" : "text-slate-700 hover:bg-slate-50"]),
317
+ onClick: r.toggleAccountBlock
318
+ }, [_(r.AppIcon, {
319
+ name: r.accountEnabled ? "ban" : "power",
320
+ class: y(["h-4 w-4 shrink-0", r.accountEnabled ? "" : "text-slate-400"])
321
+ }, null, 8, ["name", "class"]), g(" " + C(r.accountEnabled ? "Заблокувати повністю" : "Розблокувати"), 1)], 2)
322
+ ])) : p("", !0)])])]), h("div", K, [
323
+ _(r.AppealDetailSection, { title: "Інформація про користувача" }, {
324
+ icon: E(() => [_(r.AppIcon, {
325
+ name: "user",
326
+ class: "h-[18px] w-[18px]"
327
+ })]),
328
+ default: E(() => [r.editing ? (b(), m("dl", q, [
329
+ h("label", J, [t[10] ||= h("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Прізвище", -1), D(h("input", {
330
+ "onUpdate:modelValue": t[1] ||= (e) => r.draft.last_name = e,
331
+ type: "text",
332
+ class: y(r.fieldClass)
333
+ }, null, 512), [[w, r.draft.last_name]])]),
334
+ h("label", Y, [t[11] ||= h("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Імʼя", -1), D(h("input", {
335
+ "onUpdate:modelValue": t[2] ||= (e) => r.draft.first_name = e,
336
+ type: "text",
337
+ class: y(r.fieldClass)
338
+ }, null, 512), [[w, r.draft.first_name]])]),
339
+ h("label", X, [t[12] ||= h("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "По батькові", -1), D(h("input", {
340
+ "onUpdate:modelValue": t[3] ||= (e) => r.draft.middle_name = e,
341
+ type: "text",
342
+ class: y(r.fieldClass)
343
+ }, null, 512), [[w, r.draft.middle_name]])]),
344
+ h("label", Z, [t[13] ||= h("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Електронна пошта спеціаліста", -1), D(h("input", {
345
+ "onUpdate:modelValue": t[4] ||= (e) => r.draft.email = e,
346
+ type: "email",
347
+ class: y(r.fieldClass)
348
+ }, null, 512), [[w, r.draft.email]])]),
349
+ h("label", Q, [t[14] ||= h("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Номер телефону спеціаліста", -1), D(h("input", {
350
+ "onUpdate:modelValue": t[5] ||= (e) => r.draft.phone = e,
351
+ type: "text",
352
+ class: y(r.fieldClass)
353
+ }, null, 512), [[w, r.draft.phone]])])
354
+ ])) : (b(), m("dl", $, [
355
+ _(r.AppealDetailField, {
356
+ label: "ПІБ",
357
+ highlight: ""
358
+ }, {
359
+ default: E(() => [g(C(r.fullName), 1)]),
360
+ _: 1
361
+ }),
362
+ _(r.AppealDetailField, { label: "Електронна пошта спеціаліста" }, {
363
+ default: E(() => [g(C(r.surveyor.email || "—"), 1)]),
364
+ _: 1
365
+ }),
366
+ _(r.AppealDetailField, { label: "Номер телефону спеціаліста" }, {
367
+ default: E(() => [g(C(r.surveyor.phone || "—"), 1)]),
368
+ _: 1
369
+ }),
370
+ r.showResendRegistration ? (b(), f(r.AppealDetailField, {
371
+ key: 0,
372
+ label: "Статус реєстрації"
373
+ }, {
374
+ default: E(() => [...t[15] ||= [h("span", { class: "text-amber-700" }, "Очікує завершення", -1)]]),
375
+ _: 1
376
+ })) : p("", !0),
377
+ _(r.AppealDetailField, { label: "Доступ до кабінету" }, {
378
+ default: E(() => [h("span", { class: y(r.accountEnabled ? "text-emerald-700" : "text-red-600") }, C(r.accountEnabled ? "Активний" : "Заблоковано"), 3)]),
379
+ _: 1
380
+ })
381
+ ]))]),
382
+ _: 1
383
+ }),
384
+ _(r.AppealDetailSection, { title: "Інформація про сертифікат" }, {
385
+ icon: E(() => [_(r.AppIcon, {
386
+ name: "award",
387
+ class: "h-[18px] w-[18px]"
388
+ })]),
389
+ default: E(() => [h("dl", le, [
390
+ _(r.AppealDetailField, { label: "Дата видачі кваліфікаційного сертифіката" }, {
391
+ default: E(() => [g(C(r.formatDate(r.certificate?.date_certificate) || "—"), 1)]),
392
+ _: 1
393
+ }),
394
+ _(r.AppealDetailField, { label: "Номер кваліфікаційного сертифіката" }, {
395
+ default: E(() => [g(C(r.certificate?.number_certificate || "—"), 1)]),
396
+ _: 1
397
+ }),
398
+ _(r.AppealDetailField, {
399
+ label: "Назва навчального закладу",
400
+ full: ""
401
+ }, {
402
+ default: E(() => [g(C(r.certificate?.name_school || "—"), 1)]),
403
+ _: 1
404
+ }),
405
+ _(r.AppealDetailField, { label: "Реєстр" }, {
406
+ default: E(() => [g(C(r.certificate?.certificate_type_data?.text || "—"), 1)]),
407
+ _: 1
408
+ }),
409
+ _(r.AppealDetailField, { label: "Місце роботи інженера-геодезиста" }, {
410
+ default: E(() => [g(C(r.certificate?.work_place || "—"), 1)]),
411
+ _: 1
412
+ })
413
+ ])]),
414
+ _: 1
415
+ }),
416
+ _(r.AppealDetailSection, { title: "Інформація про організацію" }, {
417
+ icon: E(() => [_(r.AppIcon, {
418
+ name: "building-2",
419
+ class: "h-[18px] w-[18px]"
420
+ })]),
421
+ default: E(() => [r.organizations.length === 0 ? (b(), m("p", ue, "Організацію не вказано.")) : (b(), m("div", {
422
+ key: 1,
423
+ class: y(r.organizationsAccordion ? "flex flex-col gap-2" : "")
424
+ }, [(b(!0), m(u, null, S(r.organizations, (e) => (b(), m("div", {
425
+ key: e.org_id,
426
+ class: y(r.organizationsAccordion ? "overflow-hidden rounded-lg border border-slate-200" : "")
427
+ }, [r.organizationsAccordion ? (b(), m("button", {
428
+ key: 0,
429
+ type: "button",
430
+ class: "flex w-full cursor-pointer items-center justify-between gap-3 bg-slate-50/60 px-4 py-3 text-left transition-colors hover:bg-slate-50",
431
+ "aria-expanded": r.organizationOpen(e.org_id),
432
+ onClick: (t) => r.toggleOrganization(e.org_id)
433
+ }, [h("span", fe, [h("span", pe, C(e.name || "—"), 1), r.membershipEnabled(e) ? p("", !0) : (b(), m("span", me, "Вимкнено в організації"))]), _(r.AppIcon, {
434
+ name: "chevron-down",
435
+ class: y(["h-4 w-4 shrink-0 text-slate-400 transition-transform", r.organizationOpen(e.org_id) ? "rotate-180" : ""])
436
+ }, null, 8, ["class"])], 8, de)) : p("", !0), r.organizationOpen(e.org_id) ? (b(), m("dl", {
437
+ key: 1,
438
+ class: y(["grid grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2", r.organizationsAccordion ? "border-t border-slate-100 px-4 py-4" : ""])
439
+ }, [
440
+ _(r.AppealDetailField, {
441
+ label: "Назва організації",
442
+ highlight: ""
443
+ }, {
444
+ default: E(() => [_(r.RouterLink, {
445
+ to: `/organizations/${e.org_id}`,
446
+ class: "text-brand-600 transition-colors hover:text-brand-800 hover:underline"
447
+ }, {
448
+ default: E(() => [g(C(e.name || "—"), 1)]),
449
+ _: 2
450
+ }, 1032, ["to"])]),
451
+ _: 2
452
+ }, 1024),
453
+ _(r.AppealDetailField, {
454
+ label: "Юридична адреса",
455
+ full: ""
456
+ }, {
457
+ default: E(() => [g(C(e.legal_address || "—"), 1)]),
458
+ _: 2
459
+ }, 1024),
460
+ _(r.AppealDetailField, { label: "Email організації" }, {
461
+ default: E(() => [g(C(e.email || "—"), 1)]),
462
+ _: 2
463
+ }, 1024),
464
+ _(r.AppealDetailField, { label: "Телефон організації" }, {
465
+ default: E(() => [g(C(e.phone || "—"), 1)]),
466
+ _: 2
467
+ }, 1024),
468
+ _(r.AppealDetailField, {
469
+ label: "Доступ до організації",
470
+ full: ""
471
+ }, {
472
+ default: E(() => [h("span", he, [h("span", { class: y(r.membershipEnabled(e) ? "text-emerald-700" : "text-red-600") }, C(r.membershipEnabled(e) ? "Активний" : "Деактивовано"), 3), h("button", {
473
+ type: "button",
474
+ class: y(["inline-flex cursor-pointer items-center gap-1.5 rounded-lg border px-2.5 py-1 text-xs font-medium transition-colors", r.membershipEnabled(e) ? "border-red-200 text-red-600 hover:bg-red-50" : "border-slate-200 text-slate-700 hover:bg-slate-50"]),
475
+ onClick: (t) => r.toggleMembership(e)
476
+ }, [_(r.AppIcon, {
477
+ name: r.membershipEnabled(e) ? "user-x" : "power",
478
+ class: "h-3.5 w-3.5"
479
+ }, null, 8, ["name"]), g(" " + C(r.membershipEnabled(e) ? "Деактивувати" : "Активувати"), 1)], 10, ge)])]),
480
+ _: 2
481
+ }, 1024)
482
+ ], 2)) : p("", !0)], 2))), 128))], 2))]),
483
+ _: 1
484
+ }),
485
+ _(r.AppealDetailSection, { title: "Заявки користувача" }, {
486
+ icon: E(() => [_(r.AppIcon, {
487
+ name: "clipboard-list",
488
+ class: "h-[18px] w-[18px]"
489
+ })]),
490
+ default: E(() => [r.applications.length === 0 ? (b(), m("p", _e, "Заявок не знайдено.")) : (b(), m("div", ve, [h("table", ye, [
491
+ t[16] ||= h("colgroup", null, [
492
+ h("col", { class: "w-[20%]" }),
493
+ h("col", { class: "w-[25%]" }),
494
+ h("col", { class: "w-[55%]" })
495
+ ], -1),
496
+ t[17] ||= h("thead", { class: "text-xs font-semibold text-slate-500" }, [h("tr", { class: "border-b border-slate-100" }, [
497
+ h("th", { class: "px-1 py-2.5" }, "Номер"),
498
+ h("th", { class: "px-1 py-2.5" }, "Статус"),
499
+ h("th", { class: "px-1 py-2.5" }, "Адреса")
500
+ ])], -1),
501
+ h("tbody", be, [(b(!0), m(u, null, S(r.applications, (e) => (b(), m("tr", {
502
+ key: e.app_id,
503
+ class: "transition-colors hover:bg-brand-50/40"
504
+ }, [
505
+ h("td", xe, [_(r.RouterLink, {
506
+ to: `/requests/${e.app_id}`,
507
+ class: "font-semibold text-brand-700 hover:text-brand-900 hover:underline"
508
+ }, {
509
+ default: E(() => [g(C(e.number || "—"), 1)]),
510
+ _: 2
511
+ }, 1032, ["to"])]),
512
+ h("td", Se, C(e.status_data?.text || e.status || "—"), 1),
513
+ h("td", Ce, C(r.appealAddress(e)), 1)
514
+ ]))), 128))])
515
+ ])]))]),
516
+ _: 1
517
+ }),
518
+ r.editing ? (b(), m("div", we, [h("button", {
519
+ type: "button",
520
+ class: "inline-flex h-10 items-center rounded-lg bg-slate-100 px-4 text-sm font-semibold text-slate-600 transition-colors hover:bg-slate-200",
521
+ disabled: r.saving,
522
+ onClick: r.cancelEdit
523
+ }, " Скасувати ", 8, Te), h("button", {
524
+ type: "button",
525
+ class: "inline-flex h-10 items-center rounded-lg bg-brand-600 px-4 text-sm font-semibold text-white transition-colors hover:bg-brand-700 disabled:opacity-60",
526
+ disabled: r.saving,
527
+ onClick: r.saveEdit
528
+ }, C(r.saving ? "Збереження…" : "Зберегти зміни"), 9, Ee)])) : p("", !0)
529
+ ])])) : (b(), m("div", De, [h("p", Oe, C(r.error || "Користувача не знайдено."), 1), _(r.RouterLink, {
530
+ to: r.listPath,
531
+ class: "mt-3 inline-block text-sm font-medium text-brand-600 hover:text-brand-700"
532
+ }, {
533
+ default: E(() => [...t[18] ||= [g(" Повернутися до реєстру ", -1)]]),
534
+ _: 1
535
+ }, 8, ["to"])]));
536
+ }
537
+ var Ae = /*#__PURE__*/ e(M, [["render", ke], ["__file", "C:/softpro/surveyor/admin/src/pages/users/card.vue"]]);
538
+ //#endregion
539
+ export { Ae as default };