@opengis/surveyor 0.0.0-stage → 0.0.1

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 (138) hide show
  1. package/README.md +46 -3
  2. package/README.npm.md +51 -0
  3. package/dist/chunks/AppIcon-C-4QykTP.js +85 -0
  4. package/dist/chunks/AppealDetailField-DNRGpnyD.js +58 -0
  5. package/dist/chunks/AppealStatusBadge-CefimzY3.js +132 -0
  6. package/dist/chunks/AppealStatusBadge-Cu-UzdzA.js +171 -0
  7. package/dist/chunks/ApplicationHistorySection-PwToBfej.js +769 -0
  8. package/dist/chunks/BaseModal-DrTTkLmR.js +85 -0
  9. package/dist/chunks/FormFilePicker-CKVdZJU9.js +76 -0
  10. package/dist/chunks/MapLayerMenu-AUeTqgEp.js +145 -0
  11. package/dist/chunks/RegistryForm-pvIcFR-V.js +99 -0
  12. package/dist/chunks/RegistryFormModal-BjGu7Upv.js +85 -0
  13. package/dist/chunks/RegistryToolbar-CiUgsjpU.js +452 -0
  14. package/dist/chunks/UserAccessBadge-DyZDv7Oo.js +44 -0
  15. package/dist/chunks/UserTypeBadge-LvnMuKGo.js +188 -0
  16. package/dist/chunks/VerifiedBadge-B6droMOf.js +34 -0
  17. package/dist/chunks/_plugin-vue_export-helper-B3ysoDQm.js +8 -0
  18. package/dist/chunks/account-types-Br7gx_D_.js +35 -0
  19. package/dist/chunks/account_types-DLL1w122.js +25 -0
  20. package/dist/chunks/appealMapLayers-CQMK3rrz.js +115 -0
  21. package/dist/chunks/application_status-BhNGiY2I.js +45 -0
  22. package/dist/chunks/applications-CsCsndMV.js +132 -0
  23. package/dist/chunks/buildSchema-nkA4Y0YG.js +37 -0
  24. package/dist/chunks/card--DHsMNBd.js +330 -0
  25. package/dist/chunks/card-9LaB42Ol.js +538 -0
  26. package/dist/chunks/card-BZn5CDw9.js +739 -0
  27. package/dist/chunks/card-CNqXSyqX.js +297 -0
  28. package/dist/chunks/card-CgGOgGyd.js +973 -0
  29. package/dist/chunks/card-DCyBFoDZ.js +607 -0
  30. package/dist/chunks/certificates-DueBDDvc.js +424 -0
  31. package/dist/chunks/create-l28e-bWl.js +1033 -0
  32. package/dist/chunks/filterQuery-B9XNx1f1.js +99 -0
  33. package/dist/chunks/form-CdGS1nVO.js +315 -0
  34. package/dist/chunks/form-QTkkzwbC.js +89 -0
  35. package/dist/chunks/geometry-DyhIVRcw.js +67 -0
  36. package/dist/chunks/map-BW3iOhQg.js +2763 -0
  37. package/dist/chunks/map-layers-qxWjos2V.js +400 -0
  38. package/dist/chunks/mapLayersApi-CWoQ2be-.js +251 -0
  39. package/dist/chunks/organizations-BtuMZ5s_.js +14 -0
  40. package/dist/chunks/organizations-CZOINYMq.js +476 -0
  41. package/dist/chunks/profile-CuxlkEev.js +243 -0
  42. package/dist/chunks/profile-DxZHxGum.js +164 -0
  43. package/dist/chunks/requests-Bt8fEdRc.js +530 -0
  44. package/dist/chunks/requests-DQJIhz00.js +232 -0
  45. package/dist/chunks/resendSurveyorRegistration-DopjOHaM.js +27 -0
  46. package/dist/chunks/resources-Cl_EvaIy.js +129 -0
  47. package/dist/chunks/rolldown-runtime-Dy4uBu1J.js +11 -0
  48. package/dist/chunks/surveyorAccount-BceNQypZ.js +78 -0
  49. package/dist/chunks/users-DlaogjC_.js +291 -0
  50. package/dist/chunks/work_types-Hwme-FEX.js +34 -0
  51. package/dist/index.css +3 -0
  52. package/dist/index.js +259 -0
  53. package/migrations/20260924120000_surveyor_schema.sql +450 -0
  54. package/migrations/20261008170000_address_lookup.sql +20 -0
  55. package/migrations/20261016120000_map_layers.sql +156 -0
  56. package/migrations/20261016150000_password_reset.sql +15 -0
  57. package/migrations/20261016170000_address_lookup_format.sql +37 -0
  58. package/migrations/20261016180000_settlement_lookup.sql +16 -0
  59. package/migrations/20261019170000_actor_lookup.sql +15 -0
  60. package/package.json +75 -4
  61. package/plugin.js +10 -0
  62. package/server/app.ts +50 -0
  63. package/server/dictionaries/index.ts +17 -0
  64. package/server/dictionaries/surveyor/account_types.ts +12 -0
  65. package/server/dictionaries/surveyor/application_status.ts +16 -0
  66. package/server/dictionaries/surveyor/map_layer_components.ts +11 -0
  67. package/server/dictionaries/surveyor/map_layer_groups.ts +10 -0
  68. package/server/dictionaries/surveyor/map_layer_types.ts +11 -0
  69. package/server/dictionaries/surveyor/work_types.ts +15 -0
  70. package/server/dictionaries/surveyor/yes_no.ts +11 -0
  71. package/server/embed.ts +49 -0
  72. package/server/fastify.d.ts +12 -0
  73. package/server/index.ts +23 -0
  74. package/server/modules/surveyor/route.ts +410 -0
  75. package/server/modules/surveyor/schema.ts +439 -0
  76. package/server/modules/surveyor/services/applicationTile.ts +53 -0
  77. package/server/modules/surveyor/services/cancelApplication.ts +74 -0
  78. package/server/modules/surveyor/services/changeSurveyorPassword.ts +52 -0
  79. package/server/modules/surveyor/services/changeSurveyorPasswordByAdmin.ts +41 -0
  80. package/server/modules/surveyor/services/completeApplication.ts +46 -0
  81. package/server/modules/surveyor/services/completeSurveyorRegistration.ts +48 -0
  82. package/server/modules/surveyor/services/createApplication.ts +169 -0
  83. package/server/modules/surveyor/services/geometryExport.ts +34 -0
  84. package/server/modules/surveyor/services/geometryImport.ts +66 -0
  85. package/server/modules/surveyor/services/getSurveyorUser.ts +56 -0
  86. package/server/modules/surveyor/services/identifyApplications.ts +82 -0
  87. package/server/modules/surveyor/services/issueSourceData.ts +55 -0
  88. package/server/modules/surveyor/services/loginSurveyor.ts +67 -0
  89. package/server/modules/surveyor/services/mapLayers.ts +61 -0
  90. package/server/modules/surveyor/services/rasterExport.ts +15 -0
  91. package/server/modules/surveyor/services/registerSurveyor.ts +161 -0
  92. package/server/modules/surveyor/services/requestPasswordReset.ts +49 -0
  93. package/server/modules/surveyor/services/resendRegistration.ts +42 -0
  94. package/server/modules/surveyor/services/resetSurveyorPassword.ts +53 -0
  95. package/server/modules/surveyor/services/searchApplications.ts +63 -0
  96. package/server/modules/surveyor/services/submitSurvey.ts +70 -0
  97. package/server/modules/surveyor/services/updateSurveyorAccountStatus.ts +52 -0
  98. package/server/modules/surveyor/services/updateSurveyorStatus.ts +53 -0
  99. package/server/modules/surveyor/services/vectorExport.ts +86 -0
  100. package/server/modules/surveyor/services/verifyApplication.ts +59 -0
  101. package/server/modules/surveyor/utils/accessibleApplication.ts +37 -0
  102. package/server/modules/surveyor/utils/application.ts +68 -0
  103. package/server/modules/surveyor/utils/export.ts +39 -0
  104. package/server/modules/surveyor/utils/firstBoundary.ts +48 -0
  105. package/server/modules/surveyor/utils/mail.ts +161 -0
  106. package/server/modules/surveyor/utils/permissions.ts +29 -0
  107. package/server/modules/surveyor/utils/registration.ts +33 -0
  108. package/server/modules/surveyor/utils/shared.ts +305 -0
  109. package/server/modules/surveyor/utils/templates/ds.surveyor_admin_password.pt.hbs +79 -0
  110. package/server/modules/surveyor/utils/templates/ds.surveyor_password_reset.pt.hbs +79 -0
  111. package/server/modules/surveyor/utils/templates/ds.surveyor_registration.pt.hbs +80 -0
  112. package/server/modules/surveyor/utils/templates/ds.surveyor_send_mail.pt.hbs +79 -0
  113. package/server/modules/surveyor/utils/vectorLayer.ts +41 -0
  114. package/server/plugins/convertVector.ts +74 -0
  115. package/server/plugins/proto/convertVector.proto +21 -0
  116. package/server/plugins/swagger.ts +54 -0
  117. package/server/plugins/vite.dev.ts +52 -0
  118. package/server/plugins/vite.prod.ts +55 -0
  119. package/server/resources/helpers/actor_lookup.ts +5 -0
  120. package/server/resources/helpers/address_lookup.ts +8 -0
  121. package/server/resources/helpers/settlement_lookup.ts +7 -0
  122. package/server/resources/helpers/user_lookup.ts +5 -0
  123. package/server/resources/index.ts +30 -0
  124. package/server/resources/surveyor-admin/application_comments.ts +24 -0
  125. package/server/resources/surveyor-admin/application_status_history.ts +46 -0
  126. package/server/resources/surveyor-admin/applications.ts +125 -0
  127. package/server/resources/surveyor-admin/certificates.ts +87 -0
  128. package/server/resources/surveyor-admin/map_layers.ts +69 -0
  129. package/server/resources/surveyor-admin/organization_surveyors.ts +32 -0
  130. package/server/resources/surveyor-admin/organizations.ts +61 -0
  131. package/server/resources/surveyor-admin/surveyors.ts +71 -0
  132. package/server/resources/surveyor-user/application_status_history.ts +52 -0
  133. package/server/resources/surveyor-user/applications.ts +131 -0
  134. package/server/resources/surveyor-user/certificates.ts +67 -0
  135. package/server/resources/surveyor-user/organizations.ts +40 -0
  136. package/server/resources/surveyor-user/surveyors.ts +69 -0
  137. package/server/tsconfig.json +3 -0
  138. package/surveyor-types.d.ts +30 -0
@@ -0,0 +1,34 @@
1
+ import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
+ import { t } from "./AppIcon-C-4QykTP.js";
3
+ import { createElementBlock as n, createTextVNode as r, createVNode as i, defineComponent as a, openBlock as o } from "vue";
4
+ //#region admin/src/components/ui/VerifiedBadge.vue?vue&type=script&setup=true&lang.ts
5
+ var s = /*@__PURE__*/ a({
6
+ __name: "VerifiedBadge",
7
+ props: { verified: {
8
+ type: Boolean,
9
+ required: !0
10
+ } },
11
+ setup(e, { expose: n }) {
12
+ n();
13
+ let r = { AppIcon: t };
14
+ return Object.defineProperty(r, "__isScriptSetup", {
15
+ enumerable: !1,
16
+ value: !0
17
+ }), r;
18
+ }
19
+ }), c = {
20
+ key: 0,
21
+ class: "inline-flex items-center gap-1.5 rounded-full bg-emerald-50 px-2.5 py-1 text-xs font-semibold text-emerald-700"
22
+ }, l = {
23
+ key: 1,
24
+ class: "inline-flex items-center rounded-full bg-slate-100 px-2.5 py-1 text-xs font-semibold text-slate-500"
25
+ };
26
+ function u(e, t, a, s, u, d) {
27
+ return a.verified ? (o(), n("span", c, [i(s.AppIcon, {
28
+ name: "check",
29
+ class: "h-3.5 w-3.5"
30
+ }), t[0] ||= r(" Так ", -1)])) : (o(), n("span", l, " Ні "));
31
+ }
32
+ var d = /*#__PURE__*/ e(s, [["render", u], ["__file", "C:/softpro/surveyor/admin/src/components/ui/VerifiedBadge.vue"]]);
33
+ //#endregion
34
+ export { d as t };
@@ -0,0 +1,8 @@
1
+ //#region \0plugin-vue:export-helper
2
+ var e = (e, t) => {
3
+ let n = e.__vccOpts || e;
4
+ for (let [e, r] of t) n[e] = r;
5
+ return n;
6
+ };
7
+ //#endregion
8
+ export { e as t };
@@ -0,0 +1,35 @@
1
+ import { t as e } from "./account_types-DLL1w122.js";
2
+ //#region admin/src/lib/account-types.ts
3
+ var t = {
4
+ 1: {
5
+ dot: "bg-emerald-500",
6
+ text: "text-emerald-700",
7
+ bg: "bg-emerald-50",
8
+ border: "border-emerald-200"
9
+ },
10
+ 2: {
11
+ dot: "bg-violet-500",
12
+ text: "text-violet-700",
13
+ bg: "bg-violet-50",
14
+ border: "border-violet-200"
15
+ },
16
+ 3: {
17
+ dot: "bg-indigo-500",
18
+ text: "text-indigo-700",
19
+ bg: "bg-indigo-50",
20
+ border: "border-indigo-200"
21
+ }
22
+ }, n = {
23
+ dot: "bg-slate-400",
24
+ text: "text-slate-600",
25
+ bg: "bg-slate-50",
26
+ border: "border-slate-200"
27
+ }, r = e.items.map((e) => e.code), i = e.items.map((e) => ({
28
+ id: e.code,
29
+ text: e.name
30
+ })), a = Object.fromEntries(e.items.map((e) => [e.code, {
31
+ label: e.name,
32
+ ...t[e.code] ?? n
33
+ }])), o = r[0] ?? "1";
34
+ //#endregion
35
+ export { o as n, a as r, i as t };
@@ -0,0 +1,25 @@
1
+ //#region server/dictionaries/surveyor/account_types.ts
2
+ var e = {
3
+ code: "account-types",
4
+ name: "Типи сертифікатів",
5
+ checked: !0,
6
+ items: [
7
+ {
8
+ code: "1",
9
+ name: "Реєстр геодезистів",
10
+ color: "#32a852"
11
+ },
12
+ {
13
+ code: "2",
14
+ name: "Реєстр землевпорядників",
15
+ color: "#570b99"
16
+ },
17
+ {
18
+ code: "3",
19
+ name: "Реєстр інженерів-проектувальників",
20
+ color: "#453ec9"
21
+ }
22
+ ]
23
+ };
24
+ //#endregion
25
+ export { e as t };
@@ -0,0 +1,115 @@
1
+ //#region shared/map/lib/appealMapLayers.ts
2
+ var e = "appeal-polygon", t = "appeal-polygon-fill", n = "appeal-polygon-line", r = 19, i = [
3
+ {
4
+ id: "osm",
5
+ label: "OSM",
6
+ tiles: ["https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png"],
7
+ attribution: "© OpenStreetMap Ukraine",
8
+ minzoom: 0,
9
+ maxzoom: 18
10
+ },
11
+ {
12
+ id: "visicom",
13
+ label: "Visicom",
14
+ tiles: ["https://tms3.visicom.ua/2.0.0/planet3,ngca/base/{z}/{x}/{y}.png"],
15
+ attribution: "© Visicom",
16
+ scheme: "tms",
17
+ maxzoom: r
18
+ },
19
+ {
20
+ id: "google",
21
+ label: "Google Map",
22
+ tiles: ["https://mt1.google.com/vt/lyrs=m&x={x}&y={y}&z={z}"],
23
+ attribution: "© Google",
24
+ maxzoom: 20
25
+ },
26
+ {
27
+ id: "ortho",
28
+ label: "Ортофото",
29
+ tiles: ["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],
30
+ attribution: "© Esri",
31
+ maxzoom: r
32
+ }
33
+ ], a = [
34
+ {
35
+ id: "appeals",
36
+ label: "Звернення",
37
+ kind: "applications",
38
+ tiles: ["/api/surveyor/vtile/applications/{z}/{x}/{y}"],
39
+ sourceLayer: "applications",
40
+ opacity: 1,
41
+ hasFilters: !1,
42
+ defaultVisible: !1
43
+ },
44
+ {
45
+ id: "red-lines",
46
+ label: "Червоні лінії",
47
+ kind: "raster",
48
+ tiles: [],
49
+ opacity: .8,
50
+ legendColor: "#ef4444",
51
+ legendLabel: "Червона лінія",
52
+ defaultVisible: !1
53
+ },
54
+ {
55
+ id: "genplan",
56
+ label: "Генплан",
57
+ kind: "raster",
58
+ tiles: [],
59
+ opacity: .65,
60
+ minzoom: 12,
61
+ legendColor: "#10b981",
62
+ legendLabel: "Межа генплану",
63
+ defaultVisible: !1
64
+ }
65
+ ], o = i[0]?.id ?? "osm", s = "basemap", c = "basemap";
66
+ function l(e) {
67
+ return e.kind !== "geometry" && e.tiles.some((e) => e.trim().length > 0);
68
+ }
69
+ function u(e) {
70
+ return e.kind === "geometry" ? 1 : e.opacity ?? 1;
71
+ }
72
+ function d(e) {
73
+ if (e.kind === "raster" || e.kind === "vector") return e.minzoom;
74
+ }
75
+ function f(e) {
76
+ if (e.legendColor) return e.legendColor;
77
+ if (e.kind === "vector") return e.lineColor || e.fillColor;
78
+ }
79
+ function p(e) {
80
+ return e.kind === "geometry" ? [t, n] : e.kind === "raster" ? [`${e.id}-raster`] : [`${e.id}-fill`, `${e.id}-line`];
81
+ }
82
+ var m = {
83
+ z: 10,
84
+ x: 580,
85
+ y: 347
86
+ };
87
+ function h(e) {
88
+ if (e.preview) return e.preview;
89
+ let t = e.tiles[0] ?? "", { z: n, x: r } = m, i = e.scheme === "tms" ? 2 ** n - 1 - m.y : m.y;
90
+ return t.replace("{z}", String(n)).replace("{x}", String(r)).replace("{y}", String(i));
91
+ }
92
+ function g(e) {
93
+ return {
94
+ version: 8,
95
+ sources: { [s]: _(e) },
96
+ layers: [{
97
+ id: c,
98
+ type: "raster",
99
+ source: s
100
+ }]
101
+ };
102
+ }
103
+ function _(e) {
104
+ return {
105
+ type: "raster",
106
+ tiles: e.tiles,
107
+ tileSize: 256,
108
+ ...e.attribution ? { attribution: e.attribution } : {},
109
+ ...e.scheme === "tms" ? { scheme: "tms" } : {},
110
+ ...e.minzoom == null ? {} : { minzoom: e.minzoom },
111
+ ...e.maxzoom == null ? {} : { maxzoom: e.maxzoom }
112
+ };
113
+ }
114
+ //#endregion
115
+ export { a, o as c, l as d, f, _ as g, p as h, e as i, h as l, u as m, t as n, c as o, d as p, n as r, s, i as t, g as u };
@@ -0,0 +1,45 @@
1
+ //#region server/dictionaries/surveyor/application_status.ts
2
+ var e = {
3
+ code: "application-status",
4
+ name: "Статуси заявок",
5
+ checked: !0,
6
+ items: [
7
+ {
8
+ code: "awaitingData",
9
+ name: "На видачу вихідних даних",
10
+ color: "#979da6"
11
+ },
12
+ {
13
+ code: "dataIssued",
14
+ name: "Видано вихідні дані",
15
+ color: "#ed8c15"
16
+ },
17
+ {
18
+ code: "reserve",
19
+ name: "Резерв",
20
+ color: "#800000"
21
+ },
22
+ {
23
+ code: "underReview",
24
+ name: "На перевірці",
25
+ color: "#861aeb"
26
+ },
27
+ {
28
+ code: "verified",
29
+ name: "Перевірено",
30
+ color: "#3687e3"
31
+ },
32
+ {
33
+ code: "completed",
34
+ name: "Внесено в ЄЦТО",
35
+ color: "#03800b"
36
+ },
37
+ {
38
+ code: "cancelled",
39
+ name: "Скасовано",
40
+ color: "#ff0000"
41
+ }
42
+ ]
43
+ };
44
+ //#endregion
45
+ export { e as t };
@@ -0,0 +1,132 @@
1
+ import { i as e } from "./geometry-DyhIVRcw.js";
2
+ import { a as t, r as n } from "./profile-DxZHxGum.js";
3
+ //#region cabinet/src/api/applications.ts
4
+ function r(e) {
5
+ let t = new URLSearchParams();
6
+ e.page !== void 0 && t.set("page", String(e.page)), e.limit !== void 0 && t.set("limit", String(e.limit)), e.search && t.set("search", e.search), e.sort && t.set("sort", e.sort);
7
+ for (let [n, r] of Object.entries(e.filters ?? {})) r && t.set(`filter[${n}]`, r);
8
+ let n = t.toString();
9
+ return n ? `?${n}` : "";
10
+ }
11
+ async function i(e = {}) {
12
+ let i = await fetch(n(`/api/resource/public_applications${r(e)}`), { credentials: "include" });
13
+ if (!i.ok) throw Error(t(await i.text(), i.status));
14
+ return i.json();
15
+ }
16
+ async function a(e) {
17
+ let r = await fetch(n(`/api/resource/public_applications/${encodeURIComponent(e)}?include=history`), { credentials: "include" });
18
+ if (r.status === 404) return null;
19
+ if (!r.ok) throw Error(t(await r.text(), r.status));
20
+ let i = await r.json();
21
+ return !i || typeof i != "object" || !i.app_id ? null : i;
22
+ }
23
+ function o(e) {
24
+ return /^\d{6,}$/.test(e);
25
+ }
26
+ async function s(e) {
27
+ let t = e.trim();
28
+ if (!t) throw Error("Звернення не знайдено");
29
+ if (o(t)) {
30
+ let e = (await i({
31
+ limit: 1,
32
+ filters: { number: t }
33
+ })).rows[0]?.app_id;
34
+ if (e) {
35
+ let t = await a(e);
36
+ if (t) return t;
37
+ }
38
+ throw Error("Звернення не знайдено");
39
+ }
40
+ let n = await a(t);
41
+ if (n) return n;
42
+ let r = (await i({
43
+ limit: 1,
44
+ filters: { number: t }
45
+ })).rows[0]?.app_id;
46
+ if (r) {
47
+ let e = await a(r);
48
+ if (e) return e;
49
+ }
50
+ throw Error("Звернення не знайдено");
51
+ }
52
+ function c(e) {
53
+ return n(`/api/file/${encodeURIComponent(e)}?download=true`);
54
+ }
55
+ function l(e) {
56
+ return n(`/api/surveyor/applications/${encodeURIComponent(e)}/export/geometry`);
57
+ }
58
+ function u(e, n) {
59
+ try {
60
+ let t = JSON.parse(e);
61
+ if (t.detail) return t.detail;
62
+ } catch {}
63
+ return t(e, n);
64
+ }
65
+ async function d(e) {
66
+ let t = await fetch(n("/api/surveyor/applications"), {
67
+ method: "POST",
68
+ credentials: "include",
69
+ headers: { "Content-Type": "application/json" },
70
+ body: JSON.stringify(e)
71
+ });
72
+ if (!t.ok) throw Error(u(await t.text(), t.status));
73
+ return t.json();
74
+ }
75
+ var f = 52428800, p = /* @__PURE__ */ new Set([
76
+ "zip",
77
+ "geojson",
78
+ "json"
79
+ ]);
80
+ function m(e) {
81
+ let t = e.split(/[/\\]/).pop() ?? e, n = t.lastIndexOf(".");
82
+ return n >= 0 ? t.slice(n + 1).toLowerCase() : "";
83
+ }
84
+ function h(e) {
85
+ return new Promise((t, n) => {
86
+ let r = new FileReader();
87
+ r.onload = () => {
88
+ if (typeof r.result != "string") {
89
+ n(/* @__PURE__ */ Error("Не вдалося прочитати файл"));
90
+ return;
91
+ }
92
+ let e = r.result.indexOf(",");
93
+ t((e >= 0 ? r.result.slice(e + 1) : r.result).replace(/\s/g, ""));
94
+ }, r.onerror = () => n(/* @__PURE__ */ Error("Не вдалося прочитати файл")), r.readAsDataURL(e);
95
+ });
96
+ }
97
+ async function g(t) {
98
+ let r = m(t.name);
99
+ if (!p.has(r)) throw Error("Підтримуються файли ZIP (Shapefile) та GeoJSON");
100
+ if (!t.size) throw Error("Файл порожній");
101
+ if (t.size > f) throw Error("Файл перевищує ліміт 50 МіБ");
102
+ let i = await h(t), a = await fetch(n("/api/surveyor/import/geometry"), {
103
+ method: "POST",
104
+ credentials: "include",
105
+ headers: { "Content-Type": "application/json" },
106
+ body: JSON.stringify({
107
+ file: i,
108
+ filename: t.name
109
+ })
110
+ });
111
+ if (!a.ok) throw Error(u(await a.text(), a.status));
112
+ let o = e(await a.json());
113
+ if (!o || o.type !== "Polygon") throw Error("Файл не містить полігональну геометрію");
114
+ return {
115
+ type: "Polygon",
116
+ coordinates: o.coordinates
117
+ };
118
+ }
119
+ function _(e) {
120
+ if (e.length < 3) return [];
121
+ let t = e.map(([e, t]) => [e, t]), [n, r] = t[0], [i, a] = t[t.length - 1];
122
+ return (n !== i || r !== a) && t.push([n, r]), t;
123
+ }
124
+ function v(e) {
125
+ let t = _(e);
126
+ return t.length < 4 ? null : {
127
+ type: "Polygon",
128
+ coordinates: [t]
129
+ };
130
+ }
131
+ //#endregion
132
+ export { s as a, d as i, l as n, i as o, v as r, g as s, c as t };
@@ -0,0 +1,37 @@
1
+ import { s as e } from "./resources-Cl_EvaIy.js";
2
+ //#region admin/src/components/registry/buildSchema.ts
3
+ function t(e) {
4
+ return e;
5
+ }
6
+ function n(t, n) {
7
+ let r = n?.trim() ? n.trim() : "0";
8
+ return e(`/api/resource/${encodeURIComponent(t)}/${encodeURIComponent(r)}/upload`);
9
+ }
10
+ function r(e, r, i, a, o, s) {
11
+ let c = {
12
+ ...typeof r.props == "function" ? r.props(a) : r.props,
13
+ key: e,
14
+ type: t(r.component),
15
+ label: r.label,
16
+ col: r.col ?? r.span ?? 12
17
+ };
18
+ return r.placeholder && (c.placeholder = r.placeholder), r.validators && (c.validators = r.validators), r.default !== void 0 && (c.default = r.default), r.info && (c.info = r.info), r.view && (c.view = r.view), r.api && (c.api = r.api), r.component === "file" && !c.api && (c.api = n(o, s)), r.format && (c.format = r.format), r.conditions && (c.conditions = r.conditions), (r.component === "select" || r.component === "autocomplete" || r.component === "checkbox") && (c.options = r.options ?? i[e] ?? []), c;
19
+ }
20
+ function i(e, t = {}, n = {}, i) {
21
+ return Object.entries(e.fields).map(([a, o]) => r(a, o, t, n, e.resource, i));
22
+ }
23
+ function a(e) {
24
+ return Object.entries(e.fields).map(([e, t]) => {
25
+ let n = {
26
+ name: e,
27
+ type: t.component,
28
+ label: t.label,
29
+ placeholder: t.placeholder,
30
+ width: t.width,
31
+ cleanable: !0
32
+ };
33
+ return t.api && (n.api = t.api), t.data && (n.data = t.data), t.dataKey && (n.dataKey = t.dataKey), t.options?.length && (n.options = t.options), n;
34
+ });
35
+ }
36
+ //#endregion
37
+ export { i as n, a as t };