@opengis/gis 0.2.187 → 0.2.189

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.
@@ -1,5 +1,5 @@
1
1
  import { openBlock as t, createElementBlock as n, createElementVNode as l } from "vue";
2
- import { _ as o } from "./index-Bd_JFn54.js";
2
+ import { _ as o } from "./index-CIwXf79s.js";
3
3
  const s = {}, a = {
4
4
  xmlns: "http://www.w3.org/2000/svg",
5
5
  width: "24",
@@ -3,7 +3,7 @@ import { RefreshCw as ie, Plus as ue } from "lucide-vue-next";
3
3
  import { useRoute as ce, useRouter as de } from "vue-router";
4
4
  import { VsPagination as fe, notify as Q } from "@opengis/core";
5
5
  import { FilterField as me, Filter as he } from "@opengis/filter";
6
- import { F as ge, _ as ve } from "./index-Bd_JFn54.js";
6
+ import { F as ge, _ as ve } from "./index-CIwXf79s.js";
7
7
  import { _ as pe } from "./TableFormHeader.vue_vue_type_script_setup_true_lang-Mci_tseM.js";
8
8
  const xe = { class: "flex-1 flex flex-col bg-gray-50 h-screen overflow-hidden p-0 m-0" }, be = {
9
9
  key: 0,
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as y, computed as f, watch as d, createCommentVNode as x } from "vue";
2
- import { f as C, u as b } from "./index-Bd_JFn54.js";
2
+ import { f as C, u as b } from "./index-CIwXf79s.js";
3
3
  const h = /* @__PURE__ */ y({
4
4
  __name: "ExtentOutlineLayer",
5
5
  props: {
@@ -5,7 +5,7 @@ import { confirm as H, notify as F } from "@opengis/core";
5
5
  import { _ as de } from "./TableFormHeader.vue_vue_type_script_setup_true_lang-Mci_tseM.js";
6
6
  import { _ as ue } from "./MapSettingsTabs.vue_vue_type_script_setup_true_lang-CKCK3NqY.js";
7
7
  import { VsInputArraySelect as ce } from "@opengis/form";
8
- import { v as me, _ as pe } from "./index-Bd_JFn54.js";
8
+ import { v as me, _ as pe } from "./index-CIwXf79s.js";
9
9
  import { _ as ye } from "./MonacoEditor.vue_vue_type_script_setup_true_lang-D3ZPeXMw.js";
10
10
  const fe = { class: "rounded-lg border border-gray-200 bg-[rgba(252,252,252,0.8)] p-6" }, ge = /* @__PURE__ */ I({
11
11
  __name: "GeneralSettings",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as s, createElementBlock as b, createElementVNode as a, defineComponent as I, normalizeClass as ee, createVNode as j, createBlock as J, unref as U, ref as h, computed as k, watch as ce, withDirectives as Me, vModelText as Ee, createCommentVNode as G, Fragment as X, renderList as K, createStaticVNode as Be, toDisplayString as $, defineAsyncComponent as re, createTextVNode as ye, withCtx as Q, nextTick as Te, onMounted as ne, onUnmounted as Le, withModifiers as we, Teleport as Ue, normalizeStyle as ke, renderSlot as Ce, onBeforeUnmount as je } from "vue";
2
- import { _ as Ne, f as de } from "./index-Bd_JFn54.js";
2
+ import { _ as Ne, f as de } from "./index-CIwXf79s.js";
3
3
  import { Settings as Ae, BrushCleaning as he, SquareCode as xe, Pencil as Re, ZoomIn as Fe, ZoomOut as Oe, Compass as Ie } from "lucide-vue-next";
4
4
  import { notify as W } from "@opengis/core";
5
5
  const De = {}, Pe = {
@@ -3,7 +3,7 @@ import { useRoute as ne, useRouter as oe } from "vue-router";
3
3
  import { VsPagination as le, notify as B } from "@opengis/core";
4
4
  import { FilterField as re, Filter as ie } from "@opengis/filter";
5
5
  import { RefreshCw as ue, Plus as ce } from "lucide-vue-next";
6
- import { F as de, _ as ve } from "./index-Bd_JFn54.js";
6
+ import { F as de, _ as ve } from "./index-CIwXf79s.js";
7
7
  import { _ as fe } from "./TableFormHeader.vue_vue_type_script_setup_true_lang-Mci_tseM.js";
8
8
  const ge = { class: "flex-1 flex flex-col bg-gray-50 h-screen overflow-hidden p-0 m-0" }, me = {
9
9
  href: "/api/gis-create-xml",
@@ -2,12 +2,12 @@ import { openBlock as x, createElementBlock as P, createElementVNode as l, defin
2
2
  import { useRouter as _t, useRoute as wt } from "vue-router";
3
3
  import { notify as D } from "@opengis/core";
4
4
  import { Minimize2 as kt, Maximize2 as Ct, Link2 as Mt, Ruler as St, Eye as $t, EyeOff as Lt } from "lucide-vue-next";
5
- import { _ as Ye, f as oe, o as Et, p as Vt, q as zt, M as Rt, i as Bt, j as qe, r as Pt, t as Tt, m as At } from "./index-Bd_JFn54.js";
6
- import { S as Ft, C as Nt } from "./CardIcon-C3cCdpvO.js";
7
- import { h as ve, _ as jt, a as Ot, b as Dt, c as Ut, d as qt, e as Zt, f as It, g as Qt } from "./MapToolbarRight.vue_vue_type_script_setup_true_lang-D5Q1QqS8.js";
5
+ import { _ as Ye, f as oe, o as Et, p as Vt, q as zt, M as Rt, i as Bt, j as qe, r as Pt, t as Tt, m as At } from "./index-CIwXf79s.js";
6
+ import { S as Ft, C as Nt } from "./CardIcon-Do73o95Y.js";
7
+ import { h as ve, _ as jt, a as Ot, b as Dt, c as Ut, d as qt, e as Zt, f as It, g as Qt } from "./MapToolbarRight.vue_vue_type_script_setup_true_lang-DUMEovEr.js";
8
8
  import { _ as He } from "./MonacoEditor.vue_vue_type_script_setup_true_lang-D3ZPeXMw.js";
9
- import { V as Yt } from "./vs-datatable-BvSBnibk.js";
10
- import { _ as Ze } from "./ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-8ervbwRu.js";
9
+ import { V as Yt } from "./vs-datatable-CBQJ_ERx.js";
10
+ import { _ as Ze } from "./ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-BwM91IsK.js";
11
11
  const Ht = {}, Jt = {
12
12
  xmlns: "http://www.w3.org/2000/svg",
13
13
  width: "24",
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as V, mergeModels as S, useModel as w, defineAsyncComponent as $, computed as h, openBlock as p, createBlock as A, unref as C, withCtx as T, createElementVNode as r, toDisplayString as y, createElementBlock as b, Fragment as D, renderList as E, normalizeClass as L, resolveDynamicComponent as N, createCommentVNode as f } from "vue";
2
- import { i as P, g as j } from "./vs-datatable-BvSBnibk.js";
2
+ import { i as P, g as j } from "./vs-datatable-CBQJ_ERx.js";
3
3
  const R = { class: "p-4 text-[13px]" }, U = { class: "grid grid-cols-2 gap-x-6 gap-y-2" }, q = ["id", "checked", "onChange"], G = { class: "ml-2 flex-1 min-w-0 flex items-center gap-2" }, H = { class: "font-medium text-gray-900 truncate" }, J = { class: "text-xs text-gray-500" }, O = {
4
4
  key: 0,
5
5
  class: "text-xs text-[#B2C9D6]"
@@ -35,12 +35,12 @@ const Ln = /* @__PURE__ */ Ae({
35
35
  __name: "RegistersWrapper",
36
36
  setup(e) {
37
37
  const t = it(
38
- () => import("./EntityTablePage-D0hDbacp.js")
38
+ () => import("./EntityTablePage-3kkO3blW.js")
39
39
  ), o = it(
40
40
  () => import("./EntityCreatePage-Da8XgBKU.js")
41
41
  ), r = it(
42
42
  () => import("./EntityEditPage-QktKEAxz.js")
43
- ), i = it(() => import("./register-ChSxZGlt.js")), c = {
43
+ ), i = it(() => import("./register-EYZtQc4R.js")), c = {
44
44
  table: t,
45
45
  create: o,
46
46
  edit: r,
@@ -86,12 +86,12 @@ const Ln = /* @__PURE__ */ Ae({
86
86
  __name: "DatasetsWrapper",
87
87
  setup(e) {
88
88
  const t = it(
89
- () => import("./EntityTablePage-D0hDbacp.js")
89
+ () => import("./EntityTablePage-3kkO3blW.js")
90
90
  ), o = it(
91
91
  () => import("./EntityCreatePage-Da8XgBKU.js")
92
92
  ), r = it(
93
93
  () => import("./EntityEditPage-QktKEAxz.js")
94
- ), i = it(() => import("./service-DB7wy37J.js")), c = {
94
+ ), i = it(() => import("./service-DGkhJQTK.js")), c = {
95
95
  table: t,
96
96
  create: o,
97
97
  edit: r,
@@ -154,12 +154,12 @@ const Ln = /* @__PURE__ */ Ae({
154
154
  __name: "RastersWrapper",
155
155
  setup(e) {
156
156
  const t = it(
157
- () => import("./RastersTablePage-DbiK7bD4.js")
157
+ () => import("./RastersTablePage-DnZ1-ONS.js")
158
158
  ), o = it(
159
159
  () => import("./EntityCreatePage-Da8XgBKU.js")
160
160
  ), r = it(
161
161
  () => import("./EntityEditPage-QktKEAxz.js")
162
- ), i = it(() => import("./raster-DzFKHCJf.js")), c = {
162
+ ), i = it(() => import("./raster-CHwWS22B.js")), c = {
163
163
  table: t,
164
164
  create: o,
165
165
  edit: r,
@@ -211,12 +211,12 @@ const Ln = /* @__PURE__ */ Ae({
211
211
  __name: "CartocssWrapper",
212
212
  setup(e) {
213
213
  const t = it(
214
- () => import("./EntityTablePage-D0hDbacp.js")
214
+ () => import("./EntityTablePage-3kkO3blW.js")
215
215
  ), o = it(
216
216
  () => import("./EntityCreatePage-Da8XgBKU.js")
217
217
  ), r = it(
218
218
  () => import("./EntityEditPage-QktKEAxz.js")
219
- ), i = it(() => import("./cartocss-H7PBnoyC.js")), c = {
219
+ ), i = it(() => import("./cartocss-Bwhr3eYK.js")), c = {
220
220
  table: t,
221
221
  create: o,
222
222
  edit: r,
@@ -321,12 +321,12 @@ const Gs = /* @__PURE__ */ tt(Ws, [["render", Zs]]), Ys = { class: "gap-2 inline
321
321
  __name: "MapsWrapper",
322
322
  setup(e) {
323
323
  const t = it(
324
- () => import("./EntityTablePage-D0hDbacp.js")
324
+ () => import("./EntityTablePage-3kkO3blW.js")
325
325
  ), o = it(
326
326
  () => import("./EntityCreatePage-Da8XgBKU.js")
327
327
  ), r = it(
328
328
  () => import("./EntityEditPage-QktKEAxz.js")
329
- ), i = it(() => import("./MapSettings-BQak-606.js")), c = {
329
+ ), i = it(() => import("./MapSettings-njh2QsQa.js")), c = {
330
330
  table: t,
331
331
  create: o,
332
332
  edit: r,
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { z as e, C as t, B as i, v as l, A as p, y as r, w as m, x as o, v as C, D as S, a as d, b as f, c as g, d as n, e as v } from "./index-Bd_JFn54.js";
1
+ import { z as e, C as t, B as i, v as l, A as p, y as r, w as m, x as o, v as C, D as S, a as d, b as f, c as g, d as n, e as v } from "./index-CIwXf79s.js";
2
2
  export {
3
3
  e as CartoCSS,
4
4
  t as Classifiers,
@@ -3,7 +3,7 @@
3
3
  `)});return}const f=await fetch("/api/table/"+l.value,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o.value)});if(!f.ok){Ce.notify({type:"error",title:"Error",message:`Error code: ${f.status}`});return}await f.json(),Ce.notify({title:"Success!",message:"Object created."}),s.back()}return e.onMounted(async()=>{const h=d.entityKey||String(i.name??"").split("-")[0],f=await fetch(`/api/form/gis.${h}.table`).then(b=>b.json());l.value=f.token,c.value=f.id,r.value=f.schema,document.title=g.value}),(h,f)=>{const b=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(sn,{variant:"form"},e.createSlots({breadcrumbs:e.withCtx(()=>[p.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(b,{to:p.value,class:"text-gray-500 hover:text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.value),1)]),_:1},8,["to"]),e.createElementVNode("span",Bb,[e.createVNode(e.unref(he.LucideChevronRight),{size:16,class:"shrink-0"})])],64)):e.createCommentVNode("",!0),f[2]||(f[2]=e.createElementVNode("span",{class:"text-gray-900 font-semibold"},"Створення",-1))]),title:e.withCtx(()=>[e.createElementVNode("div",$b,[e.createElementVNode("button",{type:"button",class:"p-0 m-0 border-0 bg-transparent cursor-pointer text-inherit hover:opacity-80",onClick:y,"aria-label":"Назад"},[e.createVNode(e.unref(he.ArrowLeft),{size:20,class:"shrink-0"})]),e.createElementVNode("span",null,e.toDisplayString(a.value||"Створення"),1)])]),actions:e.withCtx(()=>[e.createElementVNode("button",{class:"cursor-pointer flex items-center px-3 py-2 text-sm font-medium text-gray-800 duration-300 bg-white border border-gray-100 rounded-lg shadow gap-x-2 focus:outline-none hover:bg-gray-50 hover:border-gray-100",onClick:y}," Назад "),e.createElementVNode("button",{onClick:k,class:"cursor-pointer inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 hover:bg-blue-700 border border-transparent rounded-lg gap-x-2 hover:text-white"}," Зберегти ")]),_:2},[m.value?{name:"description",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value),1)]),key:"0"}:void 0]),1024),e.createElementVNode("div",Sb,[e.createElementVNode("div",vb,[e.createElementVNode("div",Lb,[e.createElementVNode("div",Tb,[r.value?(e.openBlock(),e.createBlock(e.unref(n),{key:0,values:o.value,"onUpdate:values":f[0]||(f[0]=x=>o.value=x),form:u.value,"onUpdate:form":f[1]||(f[1]=x=>u.value=x),schema:r.value,style:{primaryColor:"blue"},formId:c.value},null,8,["values","form","schema","formId"])):e.createCommentVNode("",!0)])])])])],64)}}})},Symbol.toStringTag,{value:"Module"})),Ab={class:"mx-1"},Mb={class:"mx-1"},Fb={class:"flex items-center gap-2 mt-[0.4rem]"},Db={class:"flex-1 px-4 sm:px-6 pb-4 overflow-y-auto"},Pb={class:"bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden"},zb={class:"w-full relative overflow-auto p-5 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},Ib={class:"vs-form w-full"},Mn=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"EntityEditPage",props:{entityKey:{default:""}},setup(t){const n=e.defineAsyncComponent(()=>import("@opengis/form")),o=e.ref({}),r=e.ref(null),l=e.ref(null),s=e.ref({}),i=e.ref(""),d=He.useRoute(),u=He.useRouter(),p=t.entityKey||String(d.name??"").split("-")[0],{id:a}=d.params,g=e.computed(()=>d.path.replace(/\/edit\/[^/]+$/,"").replace(/\/[^/]+\/edit$/,"")),m=e.computed(()=>a?`${g.value}/${a}`:g.value||"/"),y=e.computed(()=>{var b;return((b=u.resolve(g.value).meta)==null?void 0:b.title)??""}),k=e.computed(()=>{var b;return((b=d.meta)==null?void 0:b.description)??""});function h(){u.push(g.value||"/")}async function f(){const b=s.value.validate();if(b){Ce.notify({type:"warning",title:"Validation",message:Object.entries(b).map(([N,V])=>`${N}: ${V}`).join(`
4
4
  `)});return}if(!l.value){Ce.notify({type:"error",title:"Error",message:"Edit token is missing."});return}const x=await fetch(`/api/table/${l.value}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(o.value)});if(!x.ok){Ce.notify({type:"error",title:"Error",message:`Error code: ${x.status}`});return}await x.json(),Ce.notify({title:"Success!",message:"Your changes have been saved."}),u.back()}return e.onMounted(async()=>{const b=await fetch(`/api/form/gis.${p}.table/${a}`).then(N=>N.json());o.value=b.data,l.value=b.token,r.value=b.schema;const x=b.data;i.value=(x==null?void 0:x.name)||(x==null?void 0:x.title)||(x==null?void 0:x.register_key)||(x==null?void 0:x.map_key)||""}),(b,x)=>{const N=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(sn,{variant:"form"},e.createSlots({breadcrumbs:e.withCtx(()=>[g.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(N,{to:g.value,class:"text-gray-500 hover:text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y.value),1)]),_:1},8,["to"]),e.createElementVNode("span",Ab,[e.createVNode(e.unref(he.LucideChevronRight),{size:16,class:"shrink-0"})])],64)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(N,{to:m.value,class:"text-gray-500 hover:text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value),1)]),_:1},8,["to"]),e.createElementVNode("span",Mb,[e.createVNode(e.unref(he.LucideChevronRight),{size:16,class:"shrink-0"})])],64)):e.createCommentVNode("",!0),x[2]||(x[2]=e.createElementVNode("span",{class:"text-gray-900 font-semibold"},"Редагування",-1))]),title:e.withCtx(()=>[e.createElementVNode("div",Fb,[e.createElementVNode("button",{type:"button",class:"p-0 m-0 border-0 bg-transparent cursor-pointer text-inherit hover:opacity-80",onClick:h,"aria-label":"Назад"},[e.createVNode(e.unref(he.ArrowLeft),{size:20,class:"shrink-0"})]),e.createElementVNode("span",null,e.toDisplayString(i.value||y.value||"Редагування"),1)])]),actions:e.withCtx(()=>[e.createElementVNode("button",{class:"cursor-pointer flex items-center px-3 py-2 text-sm font-medium text-gray-800 duration-300 bg-white border border-gray-100 rounded-lg shadow gap-x-2 focus:outline-none hover:bg-gray-50 hover:border-gray-100",onClick:h}," Назад "),e.createElementVNode("button",{onClick:f,class:"cursor-pointer inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 hover:bg-blue-700 border border-transparent rounded-lg gap-x-2 hover:text-white"}," Зберегти ")]),_:2},[k.value?{name:"description",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k.value),1)]),key:"0"}:void 0]),1024),e.createElementVNode("div",Db,[e.createElementVNode("div",Pb,[e.createElementVNode("div",zb,[e.createElementVNode("div",Ib,[r.value?(e.openBlock(),e.createBlock(e.unref(n),{key:0,schema:r.value,values:o.value,"onUpdate:values":x[0]||(x[0]=V=>o.value=V),form:s.value,"onUpdate:form":x[1]||(x[1]=V=>s.value=V),style:{primaryColor:"blue"}},null,8,["schema","values","form"])):e.createCommentVNode("",!0)])])])])],64)}}})},Symbol.toStringTag,{value:"Module"})),Rb={class:"flex items-center justify-center col-span-3 gap-2"},jb={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},Ob=e.defineComponent({__name:"vs-datatable-controls",props:e.mergeModels({index:{},data:{},scheme:{}},{columns:{type:Array,default:()=>[]},columnsModifiers:{}}),emits:["update:columns"],setup(t){const n=e.defineAsyncComponent(()=>import("@opengis/form")),o=e.defineAsyncComponent(()=>import("@opengis/core").then(p=>p.VsModal)),r=t,l=e.useModel(t,"columns"),s=e.ref(!1),i=e.ref({}),d=e.ref({...r.data||{}});e.watch(()=>r.data,p=>{d.value={...p||{}}},{deep:!0});const u=()=>l.value=l.value.filter((p,a)=>a!==r.index),c=async()=>{const p=i.value.validate();if(p){Ce.notify({type:"warning",title:"Validation",message:Object.entries(p).map(([a,g])=>`${a}: ${g}`).join(`
5
5
  `)});return}l.value[r.index]=d.value,s.value=!1};return(p,a)=>(e.openBlock(),e.createElementBlock("div",Rb,[e.createElementVNode("button",{onClick:a[0]||(a[0]=g=>{s.value=!0}),class:"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:text-accent-foreground h-8 w-8 rounded-full hover:bg-gray-100"},[e.createVNode(e.unref(he.Edit),{class:"w-4 h-4"})]),e.createElementVNode("button",{onClick:u,class:"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 h-8 w-8 rounded-full hover:bg-red-100 text-red-600 hover:text-red-700"},[e.createVNode(e.unref(he.Trash),{class:"w-4 h-4"})]),e.createVNode(e.unref(o),{teleport:"#modal",size:"lg",visible:s.value,"onUpdate:visible":a[4]||(a[4]=g=>s.value=g),title:"Редагувати поле"},{footer:e.withCtx(()=>[e.createElementVNode("div",jb,[e.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border border-gray-200 rounded-lg hover:bg-gray-100 duration-300",onClick:a[3]||(a[3]=g=>s.value=!1)}," Скасувати "),e.createElementVNode("button",{class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300",onClick:c}," Зберегти ")])]),default:e.withCtx(()=>[e.createVNode(e.unref(n),{values:d.value,"onUpdate:values":a[1]||(a[1]=g=>d.value=g),schema:t.scheme,form:i.value,"onUpdate:form":a[2]||(a[2]=g=>i.value=g)},null,8,["values","schema","form"])]),_:1},8,["visible"])]))}}),Ub={mounted(t){setTimeout(()=>{t.scrollWidth>t.clientWidth?t.setAttribute("title",t.textContent):t.removeAttribute("title")})},updated(t){setTimeout(()=>{t.scrollWidth>t.clientWidth?t.setAttribute("title",t.textContent):t.removeAttribute("title")})}},qb={array:"purple",boolean:"red",date:"red",datetime:"purple",number:"green",text:"blue",file:"yellow",select:"yellow",slug:"green",image:"blue",badge:"orange",title:"blue",features:"green",status:"red",tags:"yellow",category:"purple",check:"green",range:"orange",autocomplete:"yellow",other:"gray","yes/no":"green"},Ql=t=>qb[t==null?void 0:t.toLowerCase()]||"gray",Hb=["array","boolean","date","datetime","number","text","file","select","slug","image","badge","title","features","status","tags","category","check","range","autocomplete"],ea=t=>{var n;return Hb.includes((n=t||"")==null?void 0:n.toLowerCase())},Wb={},Yb={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4 text-gray-700 lucide lucide-type",__v0_r:"0,5361,5384"};function Gb(t,n){return e.openBlock(),e.createElementBlock("svg",Yb,[...n[0]||(n[0]=[e.createElementVNode("polyline",{points:"4 7 4 4 20 4 20 7"},null,-1),e.createElementVNode("line",{x1:"9",x2:"15",y1:"20",y2:"20"},null,-1),e.createElementVNode("line",{x1:"12",x2:"12",y1:"4",y2:"20"},null,-1)])])}const Zb=Fe(Wb,[["render",Gb]]),Kb={},Xb={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4 text-gray-700 lucide lucide-hash",__v0_r:"0,5361,5384"};function Jb(t,n){return e.openBlock(),e.createElementBlock("svg",Xb,[...n[0]||(n[0]=[e.createElementVNode("line",{x1:"4",x2:"20",y1:"9",y2:"9"},null,-1),e.createElementVNode("line",{x1:"4",x2:"20",y1:"15",y2:"15"},null,-1),e.createElementVNode("line",{x1:"10",x2:"8",y1:"3",y2:"21"},null,-1),e.createElementVNode("line",{x1:"16",x2:"14",y1:"3",y2:"21"},null,-1)])])}const Qb=Fe(Kb,[["render",Jb]]),ex={},tx={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4 text-gray-700 lucide lucide-calendar",__v0_r:"0,5361,5384"};function nx(t,n){return e.openBlock(),e.createElementBlock("svg",tx,[...n[0]||(n[0]=[e.createElementVNode("path",{d:"M8 2v4"},null,-1),e.createElementVNode("path",{d:"M16 2v4"},null,-1),e.createElementVNode("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"},null,-1),e.createElementVNode("path",{d:"M3 10h18"},null,-1)])])}const ox=Fe(ex,[["render",nx]]),rx={},lx={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4 text-gray-700 lucide lucide-calendar",__v0_r:"0,5361,5384"};function ax(t,n){return e.openBlock(),e.createElementBlock("svg",lx,[...n[0]||(n[0]=[e.createElementVNode("path",{d:"M8 2v4"},null,-1),e.createElementVNode("path",{d:"M16 2v4"},null,-1),e.createElementVNode("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"},null,-1),e.createElementVNode("path",{d:"M3 10h18"},null,-1)])])}const sx=Fe(rx,[["render",ax]]),ix={},cx={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4 text-gray-700 lucide lucide-code",__v0_r:"0,5361,5384"};function dx(t,n){return e.openBlock(),e.createElementBlock("svg",cx,[...n[0]||(n[0]=[e.createElementVNode("polyline",{points:"16 18 22 12 16 6"},null,-1),e.createElementVNode("polyline",{points:"8 6 2 12 8 18"},null,-1)])])}const ux=Fe(ix,[["render",dx]]),fx={},mx={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4 text-gray-700 lucide lucide-toggle-left",__v0_r:"0,5361,5384"};function px(t,n){return e.openBlock(),e.createElementBlock("svg",mx,[...n[0]||(n[0]=[e.createElementVNode("rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6"},null,-1),e.createElementVNode("circle",{cx:"8",cy:"12",r:"2"},null,-1)])])}const gx=Fe(fx,[["render",px]]),yx={},hx={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4 text-gray-700 lucide lucide-file-text",__v0_r:"0,5361,5384"};function bx(t,n){return e.openBlock(),e.createElementBlock("svg",hx,[...n[0]||(n[0]=[e.createStaticVNode('<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><path d="M10 9H8"></path><path d="M16 13H8"></path><path d="M16 17H8"></path>',5)])])}const xx=Fe(yx,[["render",bx]]),kx={},wx={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4 text-gray-700 lucide lucide-image",__v0_r:"0,5361,5384"};function _x(t,n){return e.openBlock(),e.createElementBlock("svg",wx,[...n[0]||(n[0]=[e.createElementVNode("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"},null,-1),e.createElementVNode("circle",{cx:"9",cy:"9",r:"2"},null,-1),e.createElementVNode("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"},null,-1)])])}const Ex=Fe(kx,[["render",_x]]),Cx={},Nx={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4 text-gray-700 lucide lucide-list",__v0_r:"0,5361,5384"};function Vx(t,n){return e.openBlock(),e.createElementBlock("svg",Nx,[...n[0]||(n[0]=[e.createStaticVNode('<line x1="8" x2="21" y1="6" y2="6"></line><line x1="8" x2="21" y1="12" y2="12"></line><line x1="8" x2="21" y1="18" y2="18"></line><line x1="3" x2="3.01" y1="6" y2="6"></line><line x1="3" x2="3.01" y1="12" y2="12"></line><line x1="3" x2="3.01" y1="18" y2="18"></line>',6)])])}const Bx=Fe(Cx,[["render",Vx]]),$x={},Sx={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4 text-gray-700 lucide lucide-list",__v0_r:"0,5361,5384"};function vx(t,n){return e.openBlock(),e.createElementBlock("svg",Sx,[...n[0]||(n[0]=[e.createStaticVNode('<line x1="8" x2="21" y1="6" y2="6"></line><line x1="8" x2="21" y1="12" y2="12"></line><line x1="8" x2="21" y1="18" y2="18"></line><line x1="3" x2="3.01" y1="6" y2="6"></line><line x1="3" x2="3.01" y1="12" y2="12"></line><line x1="3" x2="3.01" y1="18" y2="18"></line>',6)])])}const Lx=Fe($x,[["render",vx]]),Tx={},Ax={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4 text-gray-700 lucide lucide-link2",__v0_r:"0,5361,5384"};function Mx(t,n){return e.openBlock(),e.createElementBlock("svg",Ax,[...n[0]||(n[0]=[e.createElementVNode("path",{d:"M9 17H7A5 5 0 0 1 7 7h2"},null,-1),e.createElementVNode("path",{d:"M15 7h2a5 5 0 1 1 0 10h-2"},null,-1),e.createElementVNode("line",{x1:"8",x2:"16",y1:"12",y2:"12"},null,-1)])])}const Fx=Fe(Tx,[["render",Mx]]),Dx={},Px={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4 text-gray-700 lucide lucide-list",__v0_r:"0,5361,5384"};function zx(t,n){return e.openBlock(),e.createElementBlock("svg",Px,[...n[0]||(n[0]=[e.createStaticVNode('<line x1="8" x2="21" y1="6" y2="6"></line><line x1="8" x2="21" y1="12" y2="12"></line><line x1="8" x2="21" y1="18" y2="18"></line><line x1="3" x2="3.01" y1="6" y2="6"></line><line x1="3" x2="3.01" y1="12" y2="12"></line><line x1="3" x2="3.01" y1="18" y2="18"></line>',6)])])}const Ix=Fe(Dx,[["render",zx]]),Rx={},jx={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4 text-gray-700 lucide lucide-link2",__v0_r:"0,5361,5384"};function Ox(t,n){return e.openBlock(),e.createElementBlock("svg",jx,[...n[0]||(n[0]=[e.createElementVNode("path",{d:"M9 17H7A5 5 0 0 1 7 7h2"},null,-1),e.createElementVNode("path",{d:"M15 7h2a5 5 0 1 1 0 10h-2"},null,-1),e.createElementVNode("line",{x1:"8",x2:"16",y1:"12",y2:"12"},null,-1)])])}const Ux=Fe(Rx,[["render",Ox]]),qx={},Hx={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4 text-gray-700 lucide lucide-list",__v0_r:"0,5361,5384"};function Wx(t,n){return e.openBlock(),e.createElementBlock("svg",Hx,[...n[0]||(n[0]=[e.createStaticVNode('<line x1="8" x2="21" y1="6" y2="6"></line><line x1="8" x2="21" y1="12" y2="12"></line><line x1="8" x2="21" y1="18" y2="18"></line><line x1="3" x2="3.01" y1="6" y2="6"></line><line x1="3" x2="3.01" y1="12" y2="12"></line><line x1="3" x2="3.01" y1="18" y2="18"></line>',6)])])}const Yx=Fe(qx,[["render",Wx]]),Gx={},Zx={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",height:"800px",width:"800px",version:"1.1",id:"_x32_",viewBox:"0 0 512 512","xml:space":"preserve"};function Kx(t,n){return e.openBlock(),e.createElementBlock("svg",Zx,[...n[0]||(n[0]=[e.createElementVNode("g",null,[e.createElementVNode("path",{class:"st0",d:"M511.989,292.396c0.021-16.486-6.344-33.136-18.945-45.703L273.605,27.242 C262.3,15.936,247.175,9.22,231.184,8.407L66.821,0.032l1.184,0.066C66.974,0.044,65.866,0,64.67,0 C47.58,0,31.105,6.783,18.944,18.955C6.783,31.106-0.001,47.58,0.011,64.67c0,1.076,0.034,2.172,0.078,3.27l8.297,163.254 c0.835,15.981,7.54,31.106,18.857,42.421l219.451,219.451c12.578,12.589,29.217,18.955,45.703,18.934 c16.496,0.021,33.124-6.356,45.703-18.934l154.956-154.945l-11.92-11.92l11.932,11.909 C505.645,325.521,512.011,308.881,511.989,292.396z M314.26,469.216c-6.08,6.08-13.895,9.044-21.864,9.067 c-7.969-0.023-15.783-2.986-21.864-9.067L51.082,249.765c-5.4-5.4-8.616-12.633-9.023-20.305L33.762,66.238l-0.034-1.569 c0-8.188,3.238-16.048,9.055-21.875c5.839-5.839,13.697-9.077,21.886-9.077l1.502,0.044l163.288,8.319 c7.683,0.396,14.904,3.6,20.305,9.012l219.45,219.45c6.059,6.069,9.033,13.884,9.056,21.853 c-0.023,7.968-2.986,15.794-9.067,21.886h0.011L314.26,469.216z"}),e.createElementVNode("path",{class:"st0",d:"M105.632,105.642c-15.366,15.378-15.366,40.27,0,55.636c15.366,15.366,40.259,15.366,55.625,0 c15.366-15.366,15.366-40.259,0-55.636C145.891,90.276,120.998,90.276,105.632,105.642z"})],-1)])])}const Xx=Fe(Gx,[["render",Kx]]),Jx={},Qx={xmlns:"http://www.w3.org/2000/svg",width:"800px",height:"800px",viewBox:"0 0 24 24",fill:"none"};function e1(t,n){return e.openBlock(),e.createElementBlock("svg",Qx,[...n[0]||(n[0]=[e.createElementVNode("path",{d:"M3 12C3 4.5885 4.5885 3 12 3C19.4115 3 21 4.5885 21 12C21 19.4115 19.4115 21 12 21C4.5885 21 3 19.4115 3 12Z",stroke:"#323232","stroke-width":"2"},null,-1),e.createElementVNode("path",{d:"M9 12L10.6828 13.6828V13.6828C10.858 13.858 11.142 13.858 11.3172 13.6828V13.6828L15 10",stroke:"#323232","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const ta={IconText:Zb,IconNumber:Qb,IconDate:ox,IconDatetime:sx,IconRichtext:ux,IconBoolean:gx,IconFile:xx,IconImage:Ex,IconArray:Bx,IconSelect:Lx,IconSlug:Fx,IconDatalist:Ix,IconReference:Ux,IconReferenceList:Yx,IconBadge:Xx,IconCheck:Fe(Jx,[["render",e1]])},t1={key:0,class:"flex items-center justify-between mb-6"},n1={class:"flex justify-end w-full"},o1={class:"overflow-hidden bg-white border border-gray-200 shadow-sm rounded-xl flex flex-col flex-1 min-h-0"},r1={class:"table-scroll-wrapper flex-1 overflow-y-auto min-h-0"},l1={class:"table-fixed w-full text-[13px]"},a1={class:"bg-gray-50 border-b border-gray-200"},s1={key:0},i1=["onDragstart","onDragover","onDrop"],c1={key:0,class:"flex w-fit items-center gap-2 text-left"},d1={class:"flex-1 min-w-0"},u1={class:"font-medium text-gray-900 truncate"},f1={class:"text-xs text-gray-500"},m1={key:1,class:"flex items-center justify-center"},p1={key:0,class:"inline-flex items-center px-2 py-1 h-fit text-[13px] font-medium rounded-md ring-1 ring-inset ring-gray-500/10 bg-gray-100"},g1={key:1,class:"text-gray-500 text-sm"},y1={key:3},h1={class:"px-6 py-4"},b1={key:1},x1=["colspan"],Pt=Fe(e.defineComponent({__name:"vs-datatable",props:e.mergeModels({columnsScheme:{},formScheme:{},addButton:{type:Boolean,default:!0},mainColWidth:{default:""}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t,{expose:n}){function o(_){return _.charAt(0).toUpperCase()+_.slice(1)}const r=e.defineAsyncComponent(()=>import("@opengis/core").then(_=>_.VsModal)),l=e.defineAsyncComponent(()=>import("@opengis/form")),s=e.useModel(t,"modelValue"),i=t,d=e.ref({}),u=e.ref(!1),c=e.ref({}),p=e.ref(null),a=e.useSlots(),g=_=>!!(_&&a[_]);n({openCreateDialog:()=>{u.value=!0}});const m=e.computed({get(){return Array.isArray(s.value)?s.value:s.value&&Array.isArray(s.value.columns)?s.value.columns:[]},set(_){Array.isArray(s.value)?s.value=_:s.value&&Array.isArray(s.value.columns)&&(s.value.columns=_)}}),y=e.computed(()=>{const _=i.columnsScheme.map(w=>w.key);return _.includes("name")&&_.includes("label")||_.includes("id")&&_.includes("label")?[{key:"main",label:"Назва",type:"main",width:"100%"},...i.columnsScheme.filter(w=>!["name","id","label"].includes(w.key))]:i.columnsScheme});function k(){u.value=!1,c.value={},p.value=null}async function h(){const _=d.value.validate();if(_){Ce.notify({type:"warning",title:"Validation",message:Object.entries(_).map(([w,B])=>`${w}: ${B}`).join(`
6
- `)});return}if(p.value===null)m.value=[...m.value,{...c.value}];else{const w=[...m.value];w[p.value]={...c.value},m.value=w}k()}const f=e.ref(null),b=e.ref(null),x=_=>{f.value=_},N=_=>{b.value=_},V=_=>{if(f.value===null||f.value===_){f.value=null,b.value=null;return}const w=[...m.value],[B]=w.splice(f.value,1);w.splice(_,0,B),m.value=w,f.value=null,b.value=null};return(_,w)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.addButton?(e.openBlock(),e.createElementBlock("div",t1,[e.createElementVNode("div",n1,[e.createElementVNode("button",{onClick:w[0]||(w[0]=B=>u.value=!0),class:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&_svg]:shrink-0 bg-primary hover:bg-primary/90 h-10 px-4 py-2 bg-gradient-to-r from-blue-600 to-blue-500 hover:from-blue-700 hover:to-blue-600 text-white"},[...w[4]||(w[4]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),e.createTextVNode(" Додати поле ",-1)])])])])):e.createCommentVNode("",!0),e.createElementVNode("div",o1,[e.createElementVNode("div",r1,[e.createElementVNode("table",l1,[e.createElementVNode("colgroup",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,B=>(e.openBlock(),e.createElementBlock("col",{key:B.key,style:e.normalizeStyle(B.type==="main"?`width: ${t.mainColWidth}`:B.width?`width: ${B.width}`:"auto")},null,4))),128)),w[5]||(w[5]=e.createElementVNode("col",null,null,-1))]),e.createElementVNode("thead",null,[e.createElementVNode("tr",a1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,B=>(e.openBlock(),e.createElementBlock("th",{key:B.key,class:"px-6 py-4"},e.toDisplayString(B.label),1))),128)),w[6]||(w[6]=e.createElementVNode("th",{class:"px-6 py-4"},"Дії",-1))])]),m.value.length?(e.openBlock(),e.createElementBlock("tbody",s1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(B,v)=>(e.openBlock(),e.createElementBlock("tr",{key:B.id||B.name||v,class:e.normalizeClass(["transition-colors hover:bg-gray-50/50 cursor-move",{"opacity-50":f.value===v,"border-t-2 border-b-2 border-blue-500 bg-blue-50":b.value===v}]),draggable:"true",onDragstart:K=>x(v),onDragover:e.withModifiers(K=>N(v),["prevent"]),onDrop:K=>V(v)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,K=>(e.openBlock(),e.createElementBlock("td",{key:K.key,class:"px-6 py-4 align-middle text-center"},[K.type==="main"?(e.openBlock(),e.createElementBlock("div",c1,[w[7]||(w[7]=e.createElementVNode("span",{class:"drag-handle cursor-move mr-2 text-gray-400"},"☰",-1)),e.unref(ea)(B.format==="yes/no"?"check":B.format||B.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["flex items-center justify-center p-1 rounded",`bg-${e.unref(Ql)(B.format==="yes/no"?"check":B.format||B.type)}-100`])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(B.format==="yes/no"?"icon-check":e.unref(ta)["Icon"+o(B.format||B.type)]||e.unref(ta).IconText),{class:"w-4 h-4"}))],2)):e.createCommentVNode("",!0),e.createElementVNode("div",d1,[e.withDirectives((e.openBlock(),e.createElementBlock("p",u1,[e.createTextVNode(e.toDisplayString(B.name||B.id),1)])),[[e.unref(Ub)]]),e.createElementVNode("p",f1,e.toDisplayString(B.ua||B.label||B.name||B.id),1)])])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[K.slot&&g(K.slot)?e.renderSlot(_.$slots,K.slot,{row:B,column:K,value:B[K.key],rowIndex:v},void 0,!0,0):K.type==="color"?(e.openBlock(),e.createElementBlock("div",m1,[e.createElementVNode("div",{class:e.normalizeClass(["w-4 h-4 rounded-full align-middle",`bg-[${B[K.key]}]`])},null,2)])):["format","type","meta"].includes(K.key)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[B[K.key]?(e.openBlock(),e.createElementBlock("span",p1,e.toDisplayString(B[K.key]),1)):(e.openBlock(),e.createElementBlock("span",g1,"Не вказано"))],64)):(e.openBlock(),e.createElementBlock("span",y1,e.toDisplayString(B[K.key]),1))],64))]))),128)),e.createElementVNode("td",h1,[e.createVNode(Ob,{columns:m.value,"onUpdate:columns":w[1]||(w[1]=K=>m.value=K),data:B,index:v,scheme:t.formScheme},null,8,["columns","data","index","scheme"])])],42,i1))),128))])):(e.openBlock(),e.createElementBlock("tr",b1,[e.createElementVNode("td",{colspan:y.value.length+1,class:"text-gray-500 text-center py-4"}," Поля не знайдені ",8,x1)]))])])]),e.createVNode(e.unref(r),{teleport:"#modal",title:"Створити поле",size:"lg",visible:u.value,"onUpdate:visible":w[3]||(w[3]=B=>u.value=B)},{footer:e.withCtx(()=>[e.createElementVNode("div",{class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},[e.createElementVNode("button",{type:"button",onClick:k,class:"px-4 py-2 rounded bg-gray-100 text-gray-700"}," Скасувати "),e.createElementVNode("button",{type:"button",onClick:h,class:"px-4 py-2 rounded bg-blue-600 text-white"}," Зберегти1 ")])]),default:e.withCtx(()=>[e.createVNode(e.unref(l),{ref_key:"form",ref:d,modelValue:c.value,"onUpdate:modelValue":w[2]||(w[2]=B=>c.value=B),schema:t.formScheme},null,8,["modelValue","schema"])]),_:1},8,["visible"])],64))}}),[["__scopeId","data-v-25566600"]]),k1={class:"p-4 text-[13px]"},w1={class:"grid grid-cols-2 gap-x-6 gap-y-2"},_1=["id","checked","onChange"],E1={class:"ml-2 flex-1 min-w-0 flex items-center gap-2"},C1={class:"font-medium text-gray-900 truncate"},N1={class:"text-xs text-gray-500"},V1={key:0,class:"text-xs text-[#B2C9D6]"},B1={class:"flex justify-end gap-2 p-4 border-t w-full"},cn=e.defineComponent({__name:"import-fields-dialog",props:e.mergeModels({fields:{default:()=>[]},title:{},idPrefix:{default:"import"},confirmText:{default:"Імпортувати"},cancelText:{default:"Скасувати"}},{visible:{type:Boolean,default:!1},visibleModifiers:{},selection:{default:[]},selectionModifiers:{}}),emits:e.mergeModels(["confirm","cancel"],["update:visible","update:selection"]),setup(t,{emit:n}){const o=e.useModel(t,"visible"),r=e.useModel(t,"selection"),l=t,s=n,i=e.defineAsyncComponent(()=>import("@opengis/core").then(x=>x.VsModal)),d=e.computed(()=>Array.isArray(l.fields)?l.fields.filter(Boolean):[]),u=x=>(x==null?void 0:x.name)??(x==null?void 0:x.id)??(x==null?void 0:x.key)??(x==null?void 0:x.code)??(x==null?void 0:x.field)??(x==null?void 0:x.value)??"",c=x=>String(u(x)??"").trim(),p=x=>(x==null?void 0:x.title)??(x==null?void 0:x.label)??c(x),a=x=>String((x==null?void 0:x.type)??"").trim(),g=e.computed(()=>new Set(r.value.map(x=>String(x??"").trim()))),m=x=>g.value.has(c(x)),y=x=>{const N=c(x);if(!N)return;const V=new Set(g.value);V.has(N)?V.delete(N):V.add(N),r.value=Array.from(V)},k=e.computed(()=>l.confirmText||"Імпортувати"),h=e.computed(()=>l.cancelText||"Скасувати"),f=()=>{o.value=!1,s("cancel")},b=()=>{s("confirm"),o.value=!1};return(x,N)=>(e.openBlock(),e.createBlock(e.unref(i),{visible:o.value,"onUpdate:visible":N[0]||(N[0]=V=>o.value=V),teleport:"#modal",title:t.title,size:"lg"},{footer:e.withCtx(()=>[e.createElementVNode("div",B1,[e.createElementVNode("button",{onClick:f,class:"px-4 py-2 rounded bg-gray-100 text-gray-700"},e.toDisplayString(h.value),1),e.createElementVNode("button",{onClick:b,class:"px-4 py-2 rounded bg-blue-600 text-white"},e.toDisplayString(k.value),1)])]),default:e.withCtx(()=>[e.createElementVNode("div",k1,[e.createElementVNode("div",w1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,V=>(e.openBlock(),e.createElementBlock("label",{key:c(V),class:"flex items-center hover:bg-gray-100 rounded p-2 cursor-pointer"},[e.createElementVNode("input",{type:"checkbox",id:`${t.idPrefix}-${c(V)}`,checked:m(V),onChange:_=>y(V)},null,40,_1),e.createElementVNode("div",E1,[e.unref(ea)(V.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(`bg-${e.unref(Ql)(V.type)}-100 p-1 rounded`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(`icon-${V.type}`),{class:"w-4 h-4"}))],2)):e.createCommentVNode("",!0),e.createElementVNode("div",null,[e.createElementVNode("p",C1,e.toDisplayString(c(V)),1),e.createElementVNode("p",N1,e.toDisplayString(p(V)),1),a(V)?(e.openBlock(),e.createElementBlock("p",V1,e.toDisplayString(a(V)),1)):e.createCommentVNode("",!0)])])]))),128))])])]),_:1},8,["visible","title"]))}});function dn(t){return t==null?"":String(t).trim()}function zt(t){return dn((t==null?void 0:t.name)??(t==null?void 0:t.id)??(t==null?void 0:t.key)??(t==null?void 0:t.code)??(t==null?void 0:t.field)??(t==null?void 0:t.value)??"")}function un(t,n,o){const r=Array.isArray(t)?[...t]:[],l=Array.isArray(n)?n:[],{selectedKeys:s,resolveKey:i}=o,d=new Set;for(const a of s){const g=dn(a);g&&d.add(g)}if(d.size===0)return[];const u=a=>dn(i(a)),c=[],p=new Set;for(const a of r){const g=u(a);!g||!d.has(g)||(c.push(a),p.add(g))}for(const a of l){const g=u(a);!g||p.has(g)||!d.has(g)||(c.push(a),p.add(g))}return c}const $1={class:"vs-form"},S1={class:"vs-form__body auto-rows-max container"},v1={class:"flex flex-wrap"},L1={class:"h-fit w-full mb-6 bg-white border border-gray-200 rounded-lg p-6"},T1={class:"h-fit w-full flex flex-wrap"},A1={class:"w-full"},M1=e.defineComponent({__name:"list-tab",props:e.mergeModels({fields:{}},{data:{default:{}},dataModifiers:{},form:{},formModifiers:{}}),emits:["update:data","update:form"],setup(t){const n=e.useModel(t,"data"),o=e.useModel(t,"form"),r=t,l=e.computed(()=>Array.isArray(r.fields)?r.fields:[]),s=b=>zt(b||{}),i=e.defineAsyncComponent(()=>import("@opengis/form")),d=e.ref(),u=e.ref(!1),c=e.ref([]),p=()=>{const b=g.value.map(x=>s(x)).filter(x=>x.length>0);c.value=[...b],u.value=!0},a=e.computed(()=>{var b,x;return((b=n.value)==null?void 0:b.token)||((x=n.value)==null?void 0:x.id)||"register-form"}),g=e.computed({get:()=>(n.value||(n.value={}),Array.isArray(n.value.columns)||(n.value.columns=[]),n.value.columns),set:b=>{n.value||(n.value={}),n.value.columns=Array.isArray(b)?b:[]}}),m=e.computed({get:()=>n.value||{},set:b=>{var N;const x=Array.isArray((N=n.value)==null?void 0:N.columns)?n.value.columns:[];n.value={...n.value,...b,columns:x}}});e.watch(()=>d.value,b=>{o.value=b||null},{immediate:!0}),e.watch(u,b=>{b||(c.value=[])});const y=()=>{const b=new Set(c.value.map(V=>dn(V)).filter(V=>V.length>0)),x=Array.isArray(g.value)?[...g.value]:[],N=l.value.filter(V=>b.has(s(V))).map(V=>{const _=s(V),w=V.title??V.label??_;return{...V,name:_,label:w,type:V.type||"text",meta:V.meta??"features"}});g.value=un(x,N,{selectedKeys:c.value,resolveKey:s}),u.value=!1,c.value=[]},k={table_name:{type:"select",label:"Таблиця",required:!0,data:"pg.table_name",placeholder:"Таблиця в БД",validators:["required"],col:6},name:{type:"text",label:"Назва",required:!0,placeholder:"Назва",validators:["required"],col:6},query:{type:"text",label:"Умова",placeholder:"Умова",col:6},order:{type:"text",label:"Сортування",placeholder:"Сортування",col:6},description:{type:"textarea",label:"Опис",placeholder:"Опис",col:12}},h=[{key:"name",label:"Name",type:"text"},{key:"label",label:"Назва",type:"text"},{key:"meta",label:"Мета",type:"text"}],f={name:{type:"text",label:"Назва колонки",validators:["required"],disabled:!0},ua:{type:"text",label:"Назва",validators:["required"]},format:{type:"radio",label:"Формат",position:"horizontal",options:[{text:"Text",id:"text"},{text:"Number",id:"number"},{text:"Date",id:"date"},{text:"File",id:"file"},{text:"Select",id:"select"},{text:"Badge",id:"badge"},{text:"Tags",id:"tags"}],validators:["required"]},is_export:{type:"switcher",label:"Експорт",info:"Чи експортувати дані колонки?",view:"switcher"},meta:{type:"combobox",label:"Мета",mode:"combo",options:[{text:"Title",id:"title"},{text:"Features",id:"features"},{text:"Status",id:"status"},{text:"Tags",id:"tags"},{text:"Category",id:"category"},{text:"Image",id:"image"}]},data:{type:"select",label:"Класифікатор",data:"admin.cls.name",conditions:["format","in",["select","badge","tags"]]}};return e.onBeforeUnmount(()=>{o.value=null}),(b,x)=>(e.openBlock(),e.createElementBlock("div",$1,[e.createElementVNode("div",S1,[e.createElementVNode("div",v1,[e.createElementVNode("div",L1,[(e.openBlock(),e.createBlock(e.unref(i),{ref_key:"formEl",ref:d,key:a.value,schema:k,modelValue:m.value,"onUpdate:modelValue":x[0]||(x[0]=N=>m.value=N)},null,8,["modelValue"]))]),e.createElementVNode("div",T1,[e.createElementVNode("div",{class:"flex justify-end mb-3 gap-2 w-full"},[e.createElementVNode("button",{onClick:p,class:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 bg-primary hover:bg-primary/90 h-10 px-4 py-2 bg-gradient-to-r from-blue-600 to-blue-500 hover:from-blue-700 hover:to-blue-600 text-white"},[...x[4]||(x[4]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2",class:"mr-1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4v16m8-8H4"})],-1),e.createTextVNode(" Імпорт ",-1)])])]),e.createElementVNode("div",A1,[e.createVNode(Pt,{modelValue:g.value,"onUpdate:modelValue":x[1]||(x[1]=N=>g.value=N),"columns-scheme":h,"form-scheme":f,"main-col-width":"250px","add-button":!1},null,8,["modelValue"])])])])]),e.createVNode(cn,{visible:u.value,"onUpdate:visible":x[2]||(x[2]=N=>u.value=N),selection:c.value,"onUpdate:selection":x[3]||(x[3]=N=>c.value=N),fields:l.value,title:"Імпорт колонок","id-prefix":"import-column",onConfirm:y},null,8,["visible","selection","fields"])]))}}),F1={class:"vs-form"},D1={class:"vs-form__body auto-rows-max container"},P1={class:"flex flex-wrap"},z1={class:"h-fit w-full flex flex-wrap"},I1={class:"w-full"},R1=e.defineComponent({__name:"filter-tab",props:e.mergeModels({fields:{}},{data:{default:{}},dataModifiers:{},form:{},formModifiers:{}}),emits:["update:data","update:form"],setup(t){const n=e.useModel(t,"data"),o=e.useModel(t,"form"),r=t,l=e.computed(()=>Array.isArray(r.fields)?r.fields:[]),s=m=>zt(m||{}),i=e.ref(!1),d=e.ref([]),u=()=>{const m=c.value.map(y=>s(y)).filter(y=>y.length>0);d.value=[...m],i.value=!0},c=e.computed({get:()=>(n.value||(n.value={}),Array.isArray(n.value.filters)||(n.value.filters=[]),n.value.filters),set:m=>{n.value||(n.value={}),n.value.filters=Array.isArray(m)?m:[]}});e.watch(i,m=>{m||(d.value=[])});const p=()=>{const m=new Set(d.value.map(h=>dn(h)).filter(h=>h.length>0)),y=Array.isArray(c.value)?[...c.value]:[],k=l.value.filter(h=>m.has(s(h))).map(h=>({name:s(h),label:h.title??h.label??s(h),type:h.type||"text"}));c.value=un(y,k,{selectedKeys:d.value,resolveKey:s}),i.value=!1,d.value=[]},a=[{key:"id",label:"Name"},{key:"label",label:"Назва"},{key:"type",label:"Тип"}],g={name:{type:"text",label:"Назва колонки",validators:["required"],disabled:!0},ua:{type:"text",label:"Назва",validators:["required"]},type:{type:"radio",label:"Тип",validators:["required"],position:"horizontal",options:[{text:"Check",id:"Check"},{text:"Range",id:"Range"},{text:"Date",id:"Date"},{text:"Text",id:"Text"},{text:"Select",id:"Select"}]},hidden:{label:"Приховати",type:"Switcher"},data:{type:"select",label:"Класифікатор",data:"admin.cls.name",conditions:["type","in",["Select","Autocomplete","Check"]]}};return e.onBeforeUnmount(()=>{o.value=null}),(m,y)=>(e.openBlock(),e.createElementBlock("div",F1,[e.createElementVNode("div",D1,[e.createElementVNode("div",P1,[y[4]||(y[4]=e.createElementVNode("div",{class:"h-fit w-full flex flex-wrap mb-6 px-2"},[e.createElementVNode("p",{class:"text-sm text-gray-600"}," Налаштуйте фільтри реєстру. Оберіть поля для імпорту або відредагуйте властивості вручну. ")],-1)),e.createElementVNode("div",z1,[e.createElementVNode("div",{class:"flex justify-end mb-3 gap-2 w-full"},[e.createElementVNode("button",{onClick:u,class:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 bg-primary hover:bg-primary/90 h-10 px-4 py-2 bg-gradient-to-r from-blue-600 to-blue-500 hover:from-blue-700 hover:to-blue-600 text-white"},[...y[3]||(y[3]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2",class:"mr-1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4v16m8-8H4"})],-1),e.createTextVNode(" Імпорт ",-1)])])]),e.createElementVNode("div",I1,[e.createVNode(Pt,{modelValue:c.value,"onUpdate:modelValue":y[0]||(y[0]=k=>c.value=k),"columns-scheme":a,"form-scheme":g,"main-col-width":"250px","add-button":!1},null,8,["modelValue"])])])])]),e.createVNode(cn,{visible:i.value,"onUpdate:visible":y[1]||(y[1]=k=>i.value=k),selection:d.value,"onUpdate:selection":y[2]||(y[2]=k=>d.value=k),fields:l.value,title:"Імпорт фільтрів","id-prefix":"import-filter",onConfirm:p},null,8,["visible","selection","fields"])]))}}),j1={class:"vs-form"},O1={class:"vs-form__body auto-rows-max container"},U1={class:"flex flex-wrap"},q1={class:"h-fit w-full flex flex-wrap"},H1={class:"w-full"},W1=e.defineComponent({__name:"card-tab",props:e.mergeModels({fields:{}},{data:{default:{}},dataModifiers:{},form:{},formModifiers:{}}),emits:["update:data","update:form"],setup(t){const n=e.useModel(t,"data"),o=e.useModel(t,"form"),r=t,l=e.computed(()=>Array.isArray(r.fields)?r.fields:[]),s=m=>zt(m||{}),i=e.ref(!1),d=e.ref([]),u=()=>{const m=c.value.map(y=>s(y)).filter(y=>y.length>0);d.value=[...m],i.value=!0},c=e.computed({get:()=>n.value.card,set:m=>{n.value||(n.value={}),n.value.card=Array.isArray(m)?m:[]}});e.watch(i,m=>{var y;if(m){const k=((y=c.value)==null?void 0:y.map(h=>h.name))||[];d.value=[...k]}});const p=()=>{const m=new Set(d.value.map(h=>dn(h)).filter(h=>h.length>0)),y=Array.isArray(c.value)?[...c.value]:[],k=l.value.filter(h=>m.has(s(h))).map(h=>{const f=s(h),b=h.title??h.label??f;return{...h,name:f,label:b,format:h.format||h.type||"text",meta:h.meta||"title"}});c.value=un(y,k,{selectedKeys:d.value,resolveKey:s}),i.value=!1,d.value=[]},a=[{key:"name",label:"Name",type:"text"},{key:"label",label:"Назва",type:"text"},{key:"format",label:"Формат",type:"text"}],g={name:{type:"text",label:"Назва колонки",validators:["required"],disabled:!0},ua:{type:"text",label:"Назва",validators:["required"]},format:{type:"radio",label:"Формат",position:"horizontal",options:[{text:"Text",id:"text"},{text:"Number",id:"number"},{text:"Date",id:"date"},{text:"File",id:"file"},{text:"Select",id:"select"},{text:"Badge",id:"badge"},{text:"Tags",id:"tags"}],validators:["required"]},data:{type:"select",label:"Класифікатор",data:"admin.cls.name",conditions:["format","in",["select","badge","tags"]]}};return e.onBeforeUnmount(()=>{o.value=null}),(m,y)=>(e.openBlock(),e.createElementBlock("div",j1,[e.createElementVNode("div",O1,[e.createElementVNode("div",U1,[y[4]||(y[4]=e.createElementVNode("div",{class:"h-fit w-full flex flex-wrap mb-6 px-2"},[e.createElementVNode("p",{class:"text-sm text-gray-600"}," Налаштуйте відображення картки. Оберіть потрібні поля та відредагуйте їхні властивості. ")],-1)),e.createElementVNode("div",q1,[e.createElementVNode("div",{class:"flex justify-end mb-3 gap-2 w-full"},[e.createElementVNode("button",{onClick:u,class:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 bg-primary hover:bg-primary/90 h-10 px-4 py-2 bg-gradient-to-r from-blue-600 to-blue-500 hover:from-blue-700 hover:to-blue-600 text-white"},[...y[3]||(y[3]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2",class:"mr-1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4v16m8-8H4"})],-1),e.createTextVNode(" Імпорт ",-1)])])]),e.createElementVNode("div",H1,[e.createVNode(Pt,{modelValue:c.value,"onUpdate:modelValue":y[0]||(y[0]=k=>c.value=k),"columns-scheme":a,"form-scheme":g,"main-col-width":"250px","add-button":!1},null,8,["modelValue"])])])])]),e.createVNode(cn,{visible:i.value,"onUpdate:visible":y[1]||(y[1]=k=>i.value=k),selection:d.value,"onUpdate:selection":y[2]||(y[2]=k=>d.value=k),fields:l.value,title:"Імпорт полів картки","id-prefix":"import-card",onConfirm:p},null,8,["visible","selection","fields"])]))}}),na={template1:Gl,template2:Zl,template3:Kl,template4:Xl,template5:Jl},Y1={class:"space-y-4"},G1={class:"flex items-center gap-4 bg-white border border-gray-200 rounded-lg px-6 py-4"},Z1={class:"text-lg font-semibold mb-4"},K1={class:"bg-white"},X1={key:1,class:"text-gray-400 text-center py-12"},J1={key:2,class:"text-gray-400 text-center py-12"},Q1=e.defineComponent({__name:"preview-tab",props:e.mergeModels({hideDetailsButton:{type:Boolean,default:!1}},{data:{default:{}},dataModifiers:{}}),emits:["update:data"],setup(t){const n=e.defineAsyncComponent(()=>import("@opengis/form")),o=e.useModel(t,"data"),r=[{text:"template1",id:"template1"},{text:"template2",id:"template2"},{text:"template3",id:"template3"},{text:"template4",id:"template4"},{text:"template5",id:"template5"}],l={view:{type:"radio",label:"Вигляд",position:"horizontal",required:!0,options:r,col:12}},s=e.computed(()=>{var p;return Array.isArray((p=o.value)==null?void 0:p.columns)?o.value.columns:[]}),i=e.computed(()=>{var p;return((p=o.value)==null?void 0:p.view)||"template1"}),d=e.computed(()=>na[i.value]||na.template1),u=e.computed(()=>{var g;const p=(g=o.value)==null?void 0:g.view;if(!p)return"template1";const a=r.find(m=>m.id===p);return(a==null?void 0:a.text)||p}),c=e.computed(()=>(Array.isArray(o.value.tableData)?o.value.tableData:[]).slice(0,5).map(a=>{var g,m;return{...a,service_id:(g=o.value)==null?void 0:g.service_id,is_map:(m=o.value)==null?void 0:m.is_map}}));return(p,a)=>(e.openBlock(),e.createElementBlock("div",Y1,[e.createElementVNode("div",G1,[(e.openBlock(),e.createBlock(e.unref(n),{key:o.value.id,schema:l,modelValue:o.value,"onUpdate:modelValue":a[0]||(a[0]=g=>o.value=g)},null,8,["modelValue"]))]),e.createElementVNode("h2",Z1," Превʼю таблиці ("+e.toDisplayString(u.value)+") ",1),e.createElementVNode("div",K1,[d.value&&c.value.length&&s.value.length?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.value),{items:c.value,columns:s.value,path:"#",id_key:"id","hide-details-button":t.hideDetailsButton,key:i.value},null,8,["items","columns","hide-details-button"])):c.value.length?(e.openBlock(),e.createElementBlock("div",J1," Додайте колонки та виберіть вигляд для перегляду ")):(e.openBlock(),e.createElementBlock("div",X1," Немає даних для превʼю "))])]))}}),ek={class:"w-full mb-6"},tk={class:"flex items-center w-full h-10 max-w-md p-1 bg-white border border-gray-200 rounded-md"},nk=["onClick"],oa=e.defineComponent({__name:"MapSettingsTabs",props:{tabs:{},activeTab:{}},emits:["update:activeTab"],setup(t,{emit:n}){const o=n,r=l=>{o("update:activeTab",l)};return(l,s)=>(e.openBlock(),e.createElementBlock("div",ek,[e.createElementVNode("div",tk,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.tabs,i=>(e.openBlock(),e.createElementBlock("button",{key:i.id,onClick:d=>r(i.id),class:e.normalizeClass(["inline-flex flex-1 items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium transition-all",i.id===t.activeTab?"bg-blue-50 text-blue-700":"text-gray-600 hover:bg-gray-50"])},e.toDisplayString(i.name),11,nk))),128))])]))}}),ok={class:"relative h-full flex flex-col flex-1 min-h-0 overflow-hidden mx-auto w-full"},rk={class:"mx-1"},lk={class:"text-gray-900 font-semibold"},ak={key:0,class:"text-center py-12 mt-6 px-[24px]"},sk={key:1,class:"px-[24px] overflow-y-auto"},ik={class:"space-y-6"},ck=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"register",props:{hideDetailsButton:{type:Boolean,default:!1}},setup(t){const n=He.useRoute(),o=He.useRouter(),r=e.computed(()=>n.path.replace(/\/[^/]+$/,"")),l=e.computed(()=>{var f;return((f=o.resolve(r.value).meta)==null?void 0:f.title)??""}),s=e.computed(()=>{var f;return((f=g.value)==null?void 0:f.name)||"Налаштування реєстру"}),i=e.ref("list"),d=e.ref(""),u=e.ref(!0),c=[{name:"Список",id:"list"},{name:"Фільтри",id:"filters"},{name:"Картка",id:"card"},{name:"Перегляд",id:"preview"}],p={list:M1,filters:R1,card:W1,preview:Q1},a=c.map(f=>f.id),g=e.ref({columns:[],filters:[],card:[],tableData:[]}),m=e.ref([]),y=async()=>{var b;if(!((b=g.value)==null?void 0:b.token)){Ce.notify({type:"error",title:"Помилка",message:"Відсутній токен для збереження"});return}try{const x=await fetch(`/api/gis-registry/${n.params.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(g.value)});if(!x.ok)throw new Error(`Failed to save content: ${x.status}`);Ce.notify({type:"success",title:"Успіх",message:"Контент збережено"})}catch(x){Ce.notify({type:"error",title:"Помилка",message:"Не вдалося зберегти контент"}),console.error(x)}},k=async f=>{try{const x=await(await fetch(`/api/gis-registry/${f}`)).json(),N=Array.isArray(x==null?void 0:x.rows)?x.rows:[];g.value.tableData=N.slice(0,3)}catch(b){console.error("Помилка завантаження превʼю:",b)}},h=async()=>{var f,b;try{u.value=!0;const N=await(await fetch(`/api/data/gis.registers.table/${n.params.id}`)).json(),V=((f=N==null?void 0:N.rows)==null?void 0:f[0])||{};d.value=V.register_key||"",g.value={...V,columns:Array.isArray(V.columns)?V.columns:[],filters:Array.isArray(V.filters)?V.filters:[],card:Array.isArray(V.card)?V.card:[],tableData:Array.isArray(V.tableData)?V.tableData:[]},(b=N==null?void 0:N.tokens)!=null&&b.edit&&(g.value.token=N.tokens.edit),m.value=Array.isArray(N==null?void 0:N.fields)?N.fields:[]}catch(x){console.error("Помилка завантаження даних:",x)}finally{u.value=!1}};return e.onMounted(async()=>{const f=n.query.tab;typeof f=="string"&&a.includes(f)&&(i.value=f),await h(),d.value&&await k(d.value)}),e.watch(i,f=>{n.query.tab!==f&&o.replace({query:{...n.query,tab:f}})}),e.watch(()=>n.query.tab,f=>{typeof f=="string"&&a.includes(f)&&i.value!==f&&(i.value=f)}),e.watch(()=>n.params.id,async(f,b)=>{!f||f===b||(await h(),d.value&&await k(d.value))}),(f,b)=>{const x=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",ok,[e.createVNode(sn,{variant:"form",title:s.value},{breadcrumbs:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(x,{to:r.value,class:"text-gray-500 hover:text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1},8,["to"]),e.createElementVNode("span",rk,[e.createVNode(e.unref(he.LucideChevronRight),{size:16,class:"shrink-0"})])],64)):e.createCommentVNode("",!0),e.createElementVNode("span",lk,e.toDisplayString(s.value),1)]),description:e.withCtx(()=>[...b[3]||(b[3]=[e.createTextVNode("Налаштування реєстру",-1)])]),actions:e.withCtx(()=>[e.createElementVNode("button",{onClick:b[0]||(b[0]=N=>e.unref(o).back()),class:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium border h-10 px-4 py-2 border-gray-300 text-gray-700 hover:bg-gray-50"}," Повернутися "),e.createElementVNode("button",{onClick:y,class:"inline-flex items-center justify-center gap-2 whitespace-nowrap text-white rounded-md text-sm font-medium h-10 px-4 py-2 bg-blue-600 hover:bg-blue-700"}," Зберегти ")]),_:1},8,["title"]),u.value?(e.openBlock(),e.createElementBlock("div",ak,[...b[4]||(b[4]=[e.createElementVNode("p",{class:"text-gray-500"},"Завантаження...",-1)])])):(e.openBlock(),e.createElementBlock("div",sk,[e.createVNode(oa,{tabs:c,activeTab:i.value,"onUpdate:activeTab":b[1]||(b[1]=N=>i.value=N)},null,8,["activeTab"]),e.createElementVNode("div",ik,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p[i.value]),{data:g.value,"onUpdate:data":b[2]||(b[2]=N=>g.value=N),fields:m.value,"hide-details-button":t.hideDetailsButton,key:i.value},null,40,["data","fields","hide-details-button"]))])]))])}}})},Symbol.toStringTag,{value:"Module"}));/*! js-yaml 5.2.1 https://github.com/nodeca/js-yaml @license MIT */var Ye=Symbol("NOT_RESOLVED"),pr=Symbol("MERGE_KEY");function ft(t,n){return{tagName:t,nodeKind:"scalar",implicit:n.implicit??!1,matchByTagPrefix:n.matchByTagPrefix??!1,implicitFirstChars:n.implicitFirstChars??null,resolve:n.resolve,identify:n.identify??null,represent:n.represent??(o=>String(o)),representTagName:n.representTagName??null}}function gr(t,n){const o=n.finalize===void 0;return{tagName:t,nodeKind:"sequence",implicit:!1,matchByTagPrefix:n.matchByTagPrefix??!1,create:n.create,addItem:n.addItem,finalize:n.finalize??(r=>r),carrierIsResult:o,identify:n.identify??null,represent:n.represent??(r=>r),representTagName:n.representTagName??null}}function Co(t,n){const o=n.finalize===void 0;return{tagName:t,nodeKind:"mapping",implicit:!1,matchByTagPrefix:n.matchByTagPrefix??!1,create:n.create,addPair:n.addPair,has:n.has,keys:n.keys,get:n.get,finalize:n.finalize??(r=>r),carrierIsResult:o,identify:n.identify??null,represent:n.represent??(r=>r),representTagName:n.representTagName??null}}var dk=ft("tag:yaml.org,2002:str",{resolve:t=>t,identify:t=>typeof t=="string"}),uk=["","~","null","Null","NULL"],fk=ft("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:t=>uk.indexOf(t)!==-1?null:Ye,identify:t=>t===null,represent:()=>"null"}),mk=ft("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["n"],resolve:(t,n)=>t==="null"||n&&t===""?null:Ye,identify:t=>t===null,represent:()=>"null"}),pk=["","~","null","Null","NULL"],gk=ft("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:t=>pk.indexOf(t)!==-1?null:Ye,identify:t=>t===null,represent:()=>"null"}),yk=["true","True","TRUE"],hk=["false","False","FALSE"],bk=ft("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","T","f","F"],resolve:t=>yk.indexOf(t)!==-1?!0:hk.indexOf(t)!==-1?!1:Ye,identify:t=>Object.prototype.toString.call(t)==="[object Boolean]",represent:t=>t?"true":"false"}),xk=["true"],kk=["false"],wk=ft("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","f"],resolve:t=>xk.indexOf(t)!==-1?!0:kk.indexOf(t)!==-1?!1:Ye,identify:t=>Object.prototype.toString.call(t)==="[object Boolean]",represent:t=>t?"true":"false"}),_k=["true","True","TRUE","y","Y","yes","Yes","YES","on","On","ON"],Ek=["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"],Ck=ft("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["y","Y","n","N","t","T","f","F","o","O"],resolve:t=>_k.indexOf(t)!==-1?!0:Ek.indexOf(t)!==-1?!1:Ye,identify:t=>Object.prototype.toString.call(t)==="[object Boolean]",represent:t=>t?"true":"false"}),Nk=new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"),Vk=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function Bk(t){let n=t,o=1;return(n[0]==="-"||n[0]==="+")&&(n[0]==="-"&&(o=-1),n=n.slice(1)),n.startsWith("0b")?o*parseInt(n.slice(2),2):n.startsWith("0o")?o*parseInt(n.slice(2),8):n.startsWith("0x")?o*parseInt(n.slice(2),16):o*parseInt(n,10)}function $k(t,n){if(n){if(!Vk.test(t))return Ye}else if(!Nk.test(t))return Ye;const o=Bk(t);return Number.isFinite(o)?o:Ye}var ra=ft("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:$k,identify:t=>Number.isInteger(t)&&!Object.is(t,-0)&&t.toString(10).indexOf("e")<0,represent:t=>t.toString(10)}),Sk=new RegExp("^-?(?:0|[1-9][0-9]*)$"),vk=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function Lk(t){let n=t,o=1;return(n[0]==="-"||n[0]==="+")&&(n[0]==="-"&&(o=-1),n=n.slice(1)),n.startsWith("0b")?o*parseInt(n.slice(2),2):n.startsWith("0o")?o*parseInt(n.slice(2),8):n.startsWith("0x")?o*parseInt(n.slice(2),16):o*parseInt(n,10)}function Tk(t,n){if(n){if(!vk.test(t))return Ye}else if(!Sk.test(t))return Ye;const o=Lk(t);return Number.isFinite(o)?o:Ye}var Ak=ft("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:Tk,identify:t=>Number.isInteger(t)&&!Object.is(t,-0)&&t.toString(10).indexOf("e")<0,represent:t=>t.toString(10)}),Mk=new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");function Fk(t){let n=t.replace(/_/g,""),o=1;if((n[0]==="-"||n[0]==="+")&&(n[0]==="-"&&(o=-1),n=n.slice(1)),n.startsWith("0b"))return o*parseInt(n.slice(2),2);if(n.startsWith("0x"))return o*parseInt(n.slice(2),16);if(n.includes(":")){let r=0;for(const l of n.split(":"))r=r*60+Number(l);return o*r}return n!=="0"&&n[0]==="0"?o*parseInt(n,8):o*parseInt(n,10)}function Dk(t){if(!Mk.test(t))return Ye;const n=Fk(t);return Number.isFinite(n)?n:Ye}var yr=ft("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:Dk,identify:t=>Number.isInteger(t)&&!Object.is(t,-0)&&t.toString(10).indexOf("e")<0,represent:t=>t.toString(10)}),Pk=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),zk=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Ik(t){if(!Pk.test(t))return Ye;let n=t.toLowerCase();const o=n[0]==="-"?-1:1;if("+-".includes(n[0])&&(n=n.slice(1)),n===".inf")return o===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(n===".nan")return NaN;const r=o*parseFloat(n);return Number.isFinite(r)||zk.test(t)?r:Ye}function Rk(t){if(isNaN(t))return".nan";if(t===Number.POSITIVE_INFINITY)return".inf";if(t===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(t,-0))return"-0.0";const n=t.toString(10);return/^[-+]?[0-9]+e/.test(n)?n.replace("e",".e"):n}var la=ft("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:Ik,identify:t=>typeof t=="number"&&(!Number.isInteger(t)||Object.is(t,-0)||t.toString(10).indexOf("e")>=0),represent:Rk}),jk=new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"),Ok=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Uk(t,n){if(n){if(!Ok.test(t))return Ye;let r=t.toLowerCase();const l=r[0]==="-"?-1:1;if("+-".includes(r[0])&&(r=r.slice(1)),r===".inf")return l===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(r===".nan")return NaN;const s=l*parseFloat(r);return Number.isFinite(s)?s:Ye}if(!jk.test(t))return Ye;const o=Number(t);return Number.isFinite(o)?o:Ye}function qk(t){if(isNaN(t))return".nan";if(t===Number.POSITIVE_INFINITY)return".inf";if(t===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(t,-0))return"-0.0";const n=t.toString(10);return/^[-+]?[0-9]+e/.test(n)?n.replace("e",".e"):n}var Hk=ft("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:Uk,identify:t=>typeof t=="number"&&(!Number.isInteger(t)||Object.is(t,-0)||t.toString(10).indexOf("e")>=0),represent:qk}),Wk=new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),Yk=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Gk(t){if(!Wk.test(t))return Ye;let n=t.toLowerCase().replace(/_/g,"");const o=n[0]==="-"?-1:1;if("+-".includes(n[0])&&(n=n.slice(1)),n===".inf")return o===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(n===".nan")return NaN;let r=0;if(n.includes(":")){for(const l of n.split(":"))r=r*60+Number(l);r*=o}else r=o*parseFloat(n);return Number.isFinite(r)||Yk.test(t)?r:Ye}function Zk(t){if(isNaN(t))return".nan";if(t===Number.POSITIVE_INFINITY)return".inf";if(t===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(t,-0))return"-0.0";const n=t.toString(10);return/^[-+]?[0-9]+e/.test(n)?n.replace("e",".e"):n}var hr=ft("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:Gk,identify:t=>typeof t=="number"&&(!Number.isInteger(t)||Object.is(t,-0)||t.toString(10).indexOf("e")>=0),represent:Zk}),Kk=ft("tag:yaml.org,2002:merge",{implicit:!0,implicitFirstChars:["<"],resolve:(t,n)=>t==="<<"||n&&t===""?pr:Ye}),Xk=/^[A-Za-z0-9+/]*={0,2}$/;function Jk(t){const n=t.replace(/\s/g,"");if(n.length%4!==0||!Xk.test(n))return Ye;const o=atob(n),r=new Uint8Array(o.length);for(let l=0;l<o.length;l++)r[l]=o.charCodeAt(l);return r}function Qk(t){let n="";for(let o=0;o<t.length;o++)n+=String.fromCharCode(t[o]);return btoa(n)}var ew=ft("tag:yaml.org,2002:binary",{resolve:Jk,identify:t=>Object.prototype.toString.call(t)==="[object Uint8Array]",represent:Qk}),tw=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),nw=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function ow(t){let n=tw.exec(t);if(n===null&&(n=nw.exec(t)),n===null)return Ye;const o=+n[1],r=+n[2]-1,l=+n[3];if(!n[4]){const p=new Date(Date.UTC(o,r,l));return p.getUTCFullYear()!==o||p.getUTCMonth()!==r||p.getUTCDate()!==l?Ye:p}const s=+n[4],i=+n[5],d=+n[6];let u=0;if(s>23||i>59||d>59)return Ye;if(n[7]){let p=n[7].slice(0,3);for(;p.length<3;)p+="0";u=+p}const c=new Date(Date.UTC(o,r,l,s,i,d,u));if(c.getUTCFullYear()!==o||c.getUTCMonth()!==r||c.getUTCDate()!==l)return Ye;if(n[9]){const p=+n[10],a=+(n[11]||0);if(p>23||a>59)return Ye;const g=(p*60+a)*6e4;c.setTime(c.getTime()-(n[9]==="-"?-g:g))}return c}var rw=ft("tag:yaml.org,2002:timestamp",{implicit:!0,implicitFirstChars:[..."0123456789"],resolve:ow,identify:t=>t instanceof Date,represent:t=>t.toISOString()}),lw=gr("tag:yaml.org,2002:seq",{create:()=>[],addItem:(t,n)=>{t.push(n)},identify:Array.isArray});function No(t){if(t===null||typeof t!="object"||Array.isArray(t))return!1;const n=Object.getPrototypeOf(t);return n===null||n===Object.prototype}function br(t,n){const o={};for(const r of n)t[r]!==void 0&&(o[r]=t[r]);return o}var aw=gr("tag:yaml.org,2002:omap",{create:()=>({list:[],seen:new Set}),addItem:(t,n)=>{let o;if(n instanceof Map){if(n.size!==1)return"cannot resolve an ordered map item";o=n.keys().next().value}else if(No(n)){const r=Object.keys(n);if(r.length!==1)return"cannot resolve an ordered map item";o=r[0]}else return"cannot resolve an ordered map item";return t.seen.has(o)?"duplicate key in ordered map":(t.seen.add(o),t.list.push(n),"")},finalize:t=>t.list}),sw=gr("tag:yaml.org,2002:pairs",{create:()=>[],addItem:(t,n)=>{if(n instanceof Map)return n.size!==1?"cannot resolve a pairs item":(t.push(n.entries().next().value),"");if(Object.prototype.toString.call(n)!=="[object Object]")return"cannot resolve a pairs item";const o=n,r=Object.keys(o);return r.length!==1?"cannot resolve a pairs item":(t.push([r[0],o[r[0]]]),"")}}),iw=Co("tag:yaml.org,2002:map",{create:()=>({}),identify:No,represent:t=>{const n=new Map;for(const o of Object.keys(t))n.set(o,t[o]);return n},addPair:(t,n,o)=>{if(n!==null&&typeof n=="object")return"object-based map does not support complex keys";const r=String(n);return r==="__proto__"?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,""},has:(t,n)=>n!==null&&typeof n=="object"?!1:Object.prototype.hasOwnProperty.call(t,String(n)),keys:t=>Object.keys(t),get:(t,n)=>t[String(n)]}),cw=Co("tag:yaml.org,2002:set",{create:()=>new Set,identify:t=>t instanceof Set,represent:t=>{const n=new Map;for(const o of t)n.set(o,null);return n},addPair:(t,n,o)=>o!==null?"cannot resolve a set item":(t.add(n),""),has:(t,n)=>t.has(n),keys:t=>t.keys(),get:()=>null});function dw(){return{scalar:{},sequence:{},mapping:{}}}function uw(){return{scalar:[],sequence:[],mapping:[]}}function fw(t){const n=[];for(const o of t){let r=n.length;for(let l=0;l<n.length;l++){const s=n[l];if(s.nodeKind===o.nodeKind&&s.tagName===o.tagName&&s.matchByTagPrefix===o.matchByTagPrefix){r=l;break}}n[r]=o}return n}var Vo=class ls{constructor(n){ut(this,"tags");ut(this,"implicitScalarTags");ut(this,"implicitScalarByFirstChar");ut(this,"implicitScalarAnyFirstChar");ut(this,"defaultScalarTag");ut(this,"defaultSequenceTag");ut(this,"defaultMappingTag");ut(this,"exact");ut(this,"prefix");const o=fw(n),r=[],l=dw(),s=uw();for(const p of o){if(p.nodeKind==="scalar"&&p.implicit){if(p.matchByTagPrefix)throw new Error("Implicit scalar tags cannot match by tag prefix");r.push(p)}switch(p.nodeKind){case"scalar":p.matchByTagPrefix?s.scalar.push(p):l.scalar[p.tagName]=p;break;case"sequence":p.matchByTagPrefix?s.sequence.push(p):l.sequence[p.tagName]=p;break;case"mapping":p.matchByTagPrefix?s.mapping.push(p):l.mapping[p.tagName]=p;break}}const i=r.filter(p=>p.implicitFirstChars===null),d=new Set;for(const p of r)if(p.implicitFirstChars!==null)for(const a of p.implicitFirstChars)d.add(a);const u=new Map;for(const p of d)u.set(p,r.filter(a=>a.implicitFirstChars===null||a.implicitFirstChars.indexOf(p)!==-1));const c=l.scalar["tag:yaml.org,2002:str"];if(!c)throw new Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");this.tags=o,this.implicitScalarTags=r,this.implicitScalarByFirstChar=u,this.implicitScalarAnyFirstChar=i,this.defaultScalarTag=c,this.defaultSequenceTag=l.sequence["tag:yaml.org,2002:seq"],this.defaultMappingTag=l.mapping["tag:yaml.org,2002:map"],this.exact=l,this.prefix=s}withTags(...n){let o=[];for(const r of n)o=o.concat(r);return new ls([...this.tags,...o])}},xr=new Vo([dk,lw,iw]);new Vo([...xr.tags,mk,wk,Ak,Hk]);var mw=new Vo([...xr.tags,fk,bk,ra,la]),pw=new Vo([...xr.tags,gk,Ck,yr,hr,rw,Kk,ew,aw,sw,cw]);Co("tag:yaml.org,2002:map",{create:()=>new Map,addPair:(t,n,o)=>(t.set(n,o),""),has:(t,n)=>t.has(n),keys:t=>t.keys(),get:(t,n)=>t.get(n),identify:t=>t instanceof Map||No(t),represent:t=>{if(t instanceof Map)return t;const n=new Map,o=t;for(const r of Object.keys(o))n.set(r,o[r]);return n}});function aa(t){if(Array.isArray(t)){const n=Array.prototype.slice.call(t);for(let o=0;o<n.length;o++){if(Array.isArray(n[o]))return null;typeof n[o]=="object"&&Object.prototype.toString.call(n[o])==="[object Object]"&&(n[o]="[object Object]")}return String(n)}return typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"?"[object Object]":String(t)}Co("tag:yaml.org,2002:map",{create:()=>({}),identify:No,represent:t=>{const n=new Map;for(const o of Object.keys(t))n.set(o,t[o]);return n},addPair:(t,n,o)=>{const r=aa(n);return r===null?"nested arrays are not supported inside keys":(r==="__proto__"?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,"")},has:(t,n)=>{const o=aa(n);return o!==null&&Object.prototype.hasOwnProperty.call(t,o)},keys:t=>Object.keys(t),get:(t,n)=>t[String(n)]});var gw={maxLength:79,indent:1,linesBefore:3,linesAfter:2};function kr(t,n,o,r,l){let s="",i="";const d=Math.floor(l/2)-1;return r-n>d&&(s=" ... ",n=r-d+s.length),o-r>d&&(i=" ...",o=r+d-i.length),{str:s+t.slice(n,o).replace(/\t/g,"→")+i,pos:r-n+s.length}}function wr(t,n){return" ".repeat(Math.max(n-t.length,0))+t}function yw(t,n){if(!t.buffer)return null;const o={...gw,...n},r=/\r?\n|\r|\0/g,l=[0],s=[];let i,d=-1;for(;i=r.exec(t.buffer);)s.push(i.index),l.push(i.index+i[0].length),t.position<=i.index&&d<0&&(d=l.length-2);d<0&&(d=l.length-1);let u="";const c=Math.min(t.line+o.linesAfter,s.length).toString().length,p=o.maxLength-(o.indent+c+3);for(let g=1;g<=o.linesBefore&&!(d-g<0);g++){const m=kr(t.buffer,l[d-g],s[d-g],t.position-(l[d]-l[d-g]),p);u=`${" ".repeat(o.indent)}${wr((t.line-g+1).toString(),c)} | ${m.str}
6
+ `)});return}if(p.value===null)m.value=[...m.value,{...c.value}];else{const w=[...m.value];w[p.value]={...c.value},m.value=w}k()}const f=e.ref(null),b=e.ref(null),x=_=>{f.value=_},N=_=>{b.value=_},V=_=>{if(f.value===null||f.value===_){f.value=null,b.value=null;return}const w=[...m.value],[B]=w.splice(f.value,1);w.splice(_,0,B),m.value=w,f.value=null,b.value=null};return(_,w)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.addButton?(e.openBlock(),e.createElementBlock("div",t1,[e.createElementVNode("div",n1,[e.createElementVNode("button",{onClick:w[0]||(w[0]=B=>u.value=!0),class:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&_svg]:shrink-0 bg-primary hover:bg-primary/90 h-10 px-4 py-2 bg-gradient-to-r from-blue-600 to-blue-500 hover:from-blue-700 hover:to-blue-600 text-white"},[...w[4]||(w[4]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),e.createTextVNode(" Додати поле ",-1)])])])])):e.createCommentVNode("",!0),e.createElementVNode("div",o1,[e.createElementVNode("div",r1,[e.createElementVNode("table",l1,[e.createElementVNode("colgroup",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,B=>(e.openBlock(),e.createElementBlock("col",{key:B.key,style:e.normalizeStyle(B.type==="main"?`width: ${t.mainColWidth}`:B.width?`width: ${B.width}`:"auto")},null,4))),128)),w[5]||(w[5]=e.createElementVNode("col",null,null,-1))]),e.createElementVNode("thead",null,[e.createElementVNode("tr",a1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,B=>(e.openBlock(),e.createElementBlock("th",{key:B.key,class:"px-6 py-4"},e.toDisplayString(B.label),1))),128)),w[6]||(w[6]=e.createElementVNode("th",{class:"px-6 py-4"},"Дії",-1))])]),m.value.length?(e.openBlock(),e.createElementBlock("tbody",s1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(B,v)=>(e.openBlock(),e.createElementBlock("tr",{key:B.id||B.name||v,class:e.normalizeClass(["transition-colors hover:bg-gray-50/50 cursor-move",{"opacity-50":f.value===v,"border-t-2 border-b-2 border-blue-500 bg-blue-50":b.value===v}]),draggable:"true",onDragstart:K=>x(v),onDragover:e.withModifiers(K=>N(v),["prevent"]),onDrop:K=>V(v)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,K=>(e.openBlock(),e.createElementBlock("td",{key:K.key,class:"px-6 py-4 align-middle text-center"},[K.type==="main"?(e.openBlock(),e.createElementBlock("div",c1,[w[7]||(w[7]=e.createElementVNode("span",{class:"drag-handle cursor-move mr-2 text-gray-400"},"☰",-1)),e.unref(ea)(B.format==="yes/no"?"check":B.format||B.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["flex items-center justify-center p-1 rounded",`bg-${e.unref(Ql)(B.format==="yes/no"?"check":B.format||B.type)}-100`])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(B.format==="yes/no"?"icon-check":e.unref(ta)["Icon"+o(B.format||B.type)]||e.unref(ta).IconText),{class:"w-4 h-4"}))],2)):e.createCommentVNode("",!0),e.createElementVNode("div",d1,[e.withDirectives((e.openBlock(),e.createElementBlock("p",u1,[e.createTextVNode(e.toDisplayString(B.name||B.id),1)])),[[e.unref(Ub)]]),e.createElementVNode("p",f1,e.toDisplayString(B.ua||B.label||B.name||B.id),1)])])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[K.slot&&g(K.slot)?e.renderSlot(_.$slots,K.slot,{row:B,column:K,value:B[K.key],rowIndex:v},void 0,!0,0):K.type==="color"?(e.openBlock(),e.createElementBlock("div",m1,[e.createElementVNode("div",{class:e.normalizeClass(["w-4 h-4 rounded-full align-middle",`bg-[${B[K.key]}]`])},null,2)])):["format","type","meta"].includes(K.key)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[B[K.key]?(e.openBlock(),e.createElementBlock("span",p1,e.toDisplayString(B[K.key]),1)):(e.openBlock(),e.createElementBlock("span",g1,"Не вказано"))],64)):(e.openBlock(),e.createElementBlock("span",y1,e.toDisplayString(B[K.key]),1))],64))]))),128)),e.createElementVNode("td",h1,[e.createVNode(Ob,{columns:m.value,"onUpdate:columns":w[1]||(w[1]=K=>m.value=K),data:B,index:v,scheme:t.formScheme},null,8,["columns","data","index","scheme"])])],42,i1))),128))])):(e.openBlock(),e.createElementBlock("tr",b1,[e.createElementVNode("td",{colspan:y.value.length+1,class:"text-gray-500 text-center py-4"}," Поля не знайдені ",8,x1)]))])])]),e.createVNode(e.unref(r),{teleport:"#modal",title:"Створити поле",size:"lg",visible:u.value,"onUpdate:visible":w[3]||(w[3]=B=>u.value=B)},{footer:e.withCtx(()=>[e.createElementVNode("div",{class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},[e.createElementVNode("button",{type:"button",onClick:k,class:"px-4 py-2 rounded bg-gray-100 text-gray-700"}," Скасувати "),e.createElementVNode("button",{type:"button",onClick:h,class:"px-4 py-2 rounded bg-blue-600 text-white"}," Зберегти1 ")])]),default:e.withCtx(()=>[e.createVNode(e.unref(l),{ref_key:"form",ref:d,modelValue:c.value,"onUpdate:modelValue":w[2]||(w[2]=B=>c.value=B),schema:t.formScheme},null,8,["modelValue","schema"])]),_:1},8,["visible"])],64))}}),[["__scopeId","data-v-25566600"]]),k1={class:"p-4 text-[13px]"},w1={class:"grid grid-cols-2 gap-x-6 gap-y-2"},_1=["id","checked","onChange"],E1={class:"ml-2 flex-1 min-w-0 flex items-center gap-2"},C1={class:"font-medium text-gray-900 truncate"},N1={class:"text-xs text-gray-500"},V1={key:0,class:"text-xs text-[#B2C9D6]"},B1={class:"flex justify-end gap-2 p-4 border-t w-full"},cn=e.defineComponent({__name:"import-fields-dialog",props:e.mergeModels({fields:{default:()=>[]},title:{},idPrefix:{default:"import"},confirmText:{default:"Імпортувати"},cancelText:{default:"Скасувати"}},{visible:{type:Boolean,default:!1},visibleModifiers:{},selection:{default:[]},selectionModifiers:{}}),emits:e.mergeModels(["confirm","cancel"],["update:visible","update:selection"]),setup(t,{emit:n}){const o=e.useModel(t,"visible"),r=e.useModel(t,"selection"),l=t,s=n,i=e.defineAsyncComponent(()=>import("@opengis/core").then(x=>x.VsModal)),d=e.computed(()=>Array.isArray(l.fields)?l.fields.filter(Boolean):[]),u=x=>(x==null?void 0:x.name)??(x==null?void 0:x.id)??(x==null?void 0:x.key)??(x==null?void 0:x.code)??(x==null?void 0:x.field)??(x==null?void 0:x.value)??"",c=x=>String(u(x)??"").trim(),p=x=>(x==null?void 0:x.title)??(x==null?void 0:x.label)??c(x),a=x=>String((x==null?void 0:x.type)??"").trim(),g=e.computed(()=>new Set(r.value.map(x=>String(x??"").trim()))),m=x=>g.value.has(c(x)),y=x=>{const N=c(x);if(!N)return;const V=new Set(g.value);V.has(N)?V.delete(N):V.add(N),r.value=Array.from(V)},k=e.computed(()=>l.confirmText||"Імпортувати"),h=e.computed(()=>l.cancelText||"Скасувати"),f=()=>{o.value=!1,s("cancel")},b=()=>{s("confirm"),o.value=!1};return(x,N)=>(e.openBlock(),e.createBlock(e.unref(i),{visible:o.value,"onUpdate:visible":N[0]||(N[0]=V=>o.value=V),teleport:"#modal",title:t.title,size:"lg"},{footer:e.withCtx(()=>[e.createElementVNode("div",B1,[e.createElementVNode("button",{onClick:f,class:"px-4 py-2 rounded bg-gray-100 text-gray-700"},e.toDisplayString(h.value),1),e.createElementVNode("button",{onClick:b,class:"px-4 py-2 rounded bg-blue-600 text-white"},e.toDisplayString(k.value),1)])]),default:e.withCtx(()=>[e.createElementVNode("div",k1,[e.createElementVNode("div",w1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,V=>(e.openBlock(),e.createElementBlock("label",{key:c(V),class:"flex items-center hover:bg-gray-100 rounded p-2 cursor-pointer"},[e.createElementVNode("input",{type:"checkbox",id:`${t.idPrefix}-${c(V)}`,checked:m(V),onChange:_=>y(V)},null,40,_1),e.createElementVNode("div",E1,[e.unref(ea)(V.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(`bg-${e.unref(Ql)(V.type)}-100 p-1 rounded`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(`icon-${V.type}`),{class:"w-4 h-4"}))],2)):e.createCommentVNode("",!0),e.createElementVNode("div",null,[e.createElementVNode("p",C1,e.toDisplayString(c(V)),1),e.createElementVNode("p",N1,e.toDisplayString(p(V)),1),a(V)?(e.openBlock(),e.createElementBlock("p",V1,e.toDisplayString(a(V)),1)):e.createCommentVNode("",!0)])])]))),128))])])]),_:1},8,["visible","title"]))}});function dn(t){return t==null?"":String(t).trim()}function zt(t){return dn((t==null?void 0:t.name)??(t==null?void 0:t.id)??(t==null?void 0:t.key)??(t==null?void 0:t.code)??(t==null?void 0:t.field)??(t==null?void 0:t.value)??"")}function un(t,n,o){const r=Array.isArray(t)?[...t]:[],l=Array.isArray(n)?n:[],{selectedKeys:s,resolveKey:i}=o,d=new Set;for(const a of s){const g=dn(a);g&&d.add(g)}if(d.size===0)return[];const u=a=>dn(i(a)),c=[],p=new Set;for(const a of r){const g=u(a);!g||!d.has(g)||(c.push(a),p.add(g))}for(const a of l){const g=u(a);!g||p.has(g)||!d.has(g)||(c.push(a),p.add(g))}return c}const $1={class:"vs-form"},S1={class:"vs-form__body auto-rows-max container"},v1={class:"flex flex-wrap"},L1={class:"h-fit w-full mb-6 bg-white border border-gray-200 rounded-lg p-6"},T1={class:"h-fit w-full flex flex-wrap"},A1={class:"w-full"},M1=e.defineComponent({__name:"list-tab",props:e.mergeModels({fields:{}},{data:{default:{}},dataModifiers:{},form:{},formModifiers:{}}),emits:["update:data","update:form"],setup(t){const n=e.useModel(t,"data"),o=e.useModel(t,"form"),r=t,l=e.computed(()=>Array.isArray(r.fields)?r.fields:[]),s=b=>zt(b||{}),i=e.defineAsyncComponent(()=>import("@opengis/form")),d=e.ref(),u=e.ref(!1),c=e.ref([]),p=()=>{const b=g.value.map(x=>s(x)).filter(x=>x.length>0);c.value=[...b],u.value=!0},a=e.computed(()=>{var b,x;return((b=n.value)==null?void 0:b.token)||((x=n.value)==null?void 0:x.id)||"register-form"}),g=e.computed({get:()=>(n.value||(n.value={}),Array.isArray(n.value.columns)||(n.value.columns=[]),n.value.columns),set:b=>{n.value||(n.value={}),n.value.columns=Array.isArray(b)?b:[]}}),m=e.computed({get:()=>n.value||{},set:b=>{var N;const x=Array.isArray((N=n.value)==null?void 0:N.columns)?n.value.columns:[];n.value={...n.value,...b,columns:x}}});e.watch(()=>d.value,b=>{o.value=b||null},{immediate:!0}),e.watch(u,b=>{b||(c.value=[])});const y=()=>{const b=new Set(c.value.map(V=>dn(V)).filter(V=>V.length>0)),x=Array.isArray(g.value)?[...g.value]:[],N=l.value.filter(V=>b.has(s(V))).map(V=>{const _=s(V),w=V.title??V.label??_;return{...V,name:_,label:w,type:V.type||"text",meta:V.meta??"features"}});g.value=un(x,N,{selectedKeys:c.value,resolveKey:s}),u.value=!1,c.value=[]},k={table_name:{type:"select",label:"Таблиця",required:!0,data:"pg.table_name",placeholder:"Таблиця в БД",validators:["required"],col:6},name:{type:"text",label:"Назва",required:!0,placeholder:"Назва",validators:["required"],col:6},query:{type:"text",label:"Умова",placeholder:"Умова",col:6},order:{type:"text",label:"Сортування",placeholder:"Сортування",col:6},description:{type:"textarea",label:"Опис",placeholder:"Опис",col:12}},h=[{key:"name",label:"Name",type:"text"},{key:"label",label:"Назва",type:"text"},{key:"meta",label:"Мета",type:"text"}],f={name:{type:"text",label:"Назва колонки",validators:["required"],disabled:!0},ua:{type:"text",label:"Назва",validators:["required"]},format:{type:"radio",label:"Формат",position:"horizontal",options:[{text:"Text",id:"text"},{text:"Number",id:"number"},{text:"Date",id:"date"},{text:"File",id:"file"},{text:"Select",id:"select"},{text:"Badge",id:"badge"},{text:"Tags",id:"tags"}],validators:["required"]},is_export:{type:"switcher",label:"Експорт",info:"Чи експортувати дані колонки?",view:"switcher"},meta:{type:"combobox",label:"Мета",mode:"combo",options:[{text:"Title",id:"title"},{text:"Features",id:"features"},{text:"Status",id:"status"},{text:"Tags",id:"tags"},{text:"Category",id:"category"},{text:"Image",id:"image"}]},data:{type:"select",label:"Класифікатор",data:"admin.cls.name",conditions:["format","in",["select","badge","tags"]]}};return e.onBeforeUnmount(()=>{o.value=null}),(b,x)=>(e.openBlock(),e.createElementBlock("div",$1,[e.createElementVNode("div",S1,[e.createElementVNode("div",v1,[e.createElementVNode("div",L1,[(e.openBlock(),e.createBlock(e.unref(i),{ref_key:"formEl",ref:d,key:a.value,schema:k,modelValue:m.value,"onUpdate:modelValue":x[0]||(x[0]=N=>m.value=N)},null,8,["modelValue"]))]),e.createElementVNode("div",T1,[e.createElementVNode("div",{class:"flex justify-end mb-3 gap-2 w-full"},[e.createElementVNode("button",{onClick:p,class:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 bg-primary hover:bg-primary/90 h-10 px-4 py-2 bg-gradient-to-r from-blue-600 to-blue-500 hover:from-blue-700 hover:to-blue-600 text-white"},[...x[4]||(x[4]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2",class:"mr-1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4v16m8-8H4"})],-1),e.createTextVNode(" Імпорт ",-1)])])]),e.createElementVNode("div",A1,[e.createVNode(Pt,{modelValue:g.value,"onUpdate:modelValue":x[1]||(x[1]=N=>g.value=N),"columns-scheme":h,"form-scheme":f,"main-col-width":"250px","add-button":!1},null,8,["modelValue"])])])])]),e.createVNode(cn,{visible:u.value,"onUpdate:visible":x[2]||(x[2]=N=>u.value=N),selection:c.value,"onUpdate:selection":x[3]||(x[3]=N=>c.value=N),fields:l.value,title:"Імпорт колонок","id-prefix":"import-column",onConfirm:y},null,8,["visible","selection","fields"])]))}}),F1={class:"vs-form"},D1={class:"vs-form__body auto-rows-max container"},P1={class:"flex flex-wrap"},z1={class:"h-fit w-full flex flex-wrap"},I1={class:"w-full"},R1=e.defineComponent({__name:"filter-tab",props:e.mergeModels({fields:{}},{data:{default:{}},dataModifiers:{},form:{},formModifiers:{}}),emits:["update:data","update:form"],setup(t){const n=e.useModel(t,"data"),o=e.useModel(t,"form"),r=t,l=e.computed(()=>Array.isArray(r.fields)?r.fields:[]),s=m=>zt(m||{}),i=e.ref(!1),d=e.ref([]),u=()=>{const m=c.value.map(y=>s(y)).filter(y=>y.length>0);d.value=[...m],i.value=!0},c=e.computed({get:()=>(n.value||(n.value={}),Array.isArray(n.value.filters)||(n.value.filters=[]),n.value.filters),set:m=>{n.value||(n.value={}),n.value.filters=Array.isArray(m)?m:[]}});e.watch(i,m=>{m||(d.value=[])});const p=()=>{const m=new Set(d.value.map(h=>dn(h)).filter(h=>h.length>0)),y=Array.isArray(c.value)?[...c.value]:[],k=l.value.filter(h=>m.has(s(h))).map(h=>({name:s(h),label:h.title??h.label??s(h),type:h.type||"text"}));c.value=un(y,k,{selectedKeys:d.value,resolveKey:s}),i.value=!1,d.value=[]},a=[{key:"id",label:"Name"},{key:"label",label:"Назва"},{key:"type",label:"Тип"}],g={name:{type:"text",label:"Назва колонки",validators:["required"],disabled:!0},label:{type:"text",label:"Назва",validators:["required"]},type:{type:"radio",label:"Тип",validators:["required"],position:"horizontal",options:[{text:"Check",id:"Check"},{text:"Range",id:"Range"},{text:"Date",id:"Date"},{text:"Text",id:"Text"},{text:"Select",id:"Select"}]},hidden:{label:"Приховати",type:"Switcher"},data:{type:"select",label:"Класифікатор",data:"admin.cls.name",conditions:["type","in",["Select","Autocomplete","Check"]]}};return e.onBeforeUnmount(()=>{o.value=null}),(m,y)=>(e.openBlock(),e.createElementBlock("div",F1,[e.createElementVNode("div",D1,[e.createElementVNode("div",P1,[y[4]||(y[4]=e.createElementVNode("div",{class:"h-fit w-full flex flex-wrap mb-6 px-2"},[e.createElementVNode("p",{class:"text-sm text-gray-600"}," Налаштуйте фільтри реєстру. Оберіть поля для імпорту або відредагуйте властивості вручну. ")],-1)),e.createElementVNode("div",z1,[e.createElementVNode("div",{class:"flex justify-end mb-3 gap-2 w-full"},[e.createElementVNode("button",{onClick:u,class:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 bg-primary hover:bg-primary/90 h-10 px-4 py-2 bg-gradient-to-r from-blue-600 to-blue-500 hover:from-blue-700 hover:to-blue-600 text-white"},[...y[3]||(y[3]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2",class:"mr-1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4v16m8-8H4"})],-1),e.createTextVNode(" Імпорт ",-1)])])]),e.createElementVNode("div",I1,[e.createVNode(Pt,{modelValue:c.value,"onUpdate:modelValue":y[0]||(y[0]=k=>c.value=k),"columns-scheme":a,"form-scheme":g,"main-col-width":"250px","add-button":!1},null,8,["modelValue"])])])])]),e.createVNode(cn,{visible:i.value,"onUpdate:visible":y[1]||(y[1]=k=>i.value=k),selection:d.value,"onUpdate:selection":y[2]||(y[2]=k=>d.value=k),fields:l.value,title:"Імпорт фільтрів","id-prefix":"import-filter",onConfirm:p},null,8,["visible","selection","fields"])]))}}),j1={class:"vs-form"},O1={class:"vs-form__body auto-rows-max container"},U1={class:"flex flex-wrap"},q1={class:"h-fit w-full flex flex-wrap"},H1={class:"w-full"},W1=e.defineComponent({__name:"card-tab",props:e.mergeModels({fields:{}},{data:{default:{}},dataModifiers:{},form:{},formModifiers:{}}),emits:["update:data","update:form"],setup(t){const n=e.useModel(t,"data"),o=e.useModel(t,"form"),r=t,l=e.computed(()=>Array.isArray(r.fields)?r.fields:[]),s=m=>zt(m||{}),i=e.ref(!1),d=e.ref([]),u=()=>{const m=c.value.map(y=>s(y)).filter(y=>y.length>0);d.value=[...m],i.value=!0},c=e.computed({get:()=>n.value.card,set:m=>{n.value||(n.value={}),n.value.card=Array.isArray(m)?m:[]}});e.watch(i,m=>{var y;if(m){const k=((y=c.value)==null?void 0:y.map(h=>h.name))||[];d.value=[...k]}});const p=()=>{const m=new Set(d.value.map(h=>dn(h)).filter(h=>h.length>0)),y=Array.isArray(c.value)?[...c.value]:[],k=l.value.filter(h=>m.has(s(h))).map(h=>{const f=s(h),b=h.title??h.label??f;return{...h,name:f,label:b,format:h.format||h.type||"text",meta:h.meta||"title"}});c.value=un(y,k,{selectedKeys:d.value,resolveKey:s}),i.value=!1,d.value=[]},a=[{key:"name",label:"Name",type:"text"},{key:"label",label:"Назва",type:"text"},{key:"format",label:"Формат",type:"text"}],g={name:{type:"text",label:"Назва колонки",validators:["required"],disabled:!0},ua:{type:"text",label:"Назва",validators:["required"]},format:{type:"radio",label:"Формат",position:"horizontal",options:[{text:"Text",id:"text"},{text:"Number",id:"number"},{text:"Date",id:"date"},{text:"File",id:"file"},{text:"Select",id:"select"},{text:"Badge",id:"badge"},{text:"Tags",id:"tags"}],validators:["required"]},data:{type:"select",label:"Класифікатор",data:"admin.cls.name",conditions:["format","in",["select","badge","tags"]]}};return e.onBeforeUnmount(()=>{o.value=null}),(m,y)=>(e.openBlock(),e.createElementBlock("div",j1,[e.createElementVNode("div",O1,[e.createElementVNode("div",U1,[y[4]||(y[4]=e.createElementVNode("div",{class:"h-fit w-full flex flex-wrap mb-6 px-2"},[e.createElementVNode("p",{class:"text-sm text-gray-600"}," Налаштуйте відображення картки. Оберіть потрібні поля та відредагуйте їхні властивості. ")],-1)),e.createElementVNode("div",q1,[e.createElementVNode("div",{class:"flex justify-end mb-3 gap-2 w-full"},[e.createElementVNode("button",{onClick:u,class:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 bg-primary hover:bg-primary/90 h-10 px-4 py-2 bg-gradient-to-r from-blue-600 to-blue-500 hover:from-blue-700 hover:to-blue-600 text-white"},[...y[3]||(y[3]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2",class:"mr-1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4v16m8-8H4"})],-1),e.createTextVNode(" Імпорт ",-1)])])]),e.createElementVNode("div",H1,[e.createVNode(Pt,{modelValue:c.value,"onUpdate:modelValue":y[0]||(y[0]=k=>c.value=k),"columns-scheme":a,"form-scheme":g,"main-col-width":"250px","add-button":!1},null,8,["modelValue"])])])])]),e.createVNode(cn,{visible:i.value,"onUpdate:visible":y[1]||(y[1]=k=>i.value=k),selection:d.value,"onUpdate:selection":y[2]||(y[2]=k=>d.value=k),fields:l.value,title:"Імпорт полів картки","id-prefix":"import-card",onConfirm:p},null,8,["visible","selection","fields"])]))}}),na={template1:Gl,template2:Zl,template3:Kl,template4:Xl,template5:Jl},Y1={class:"space-y-4"},G1={class:"flex items-center gap-4 bg-white border border-gray-200 rounded-lg px-6 py-4"},Z1={class:"text-lg font-semibold mb-4"},K1={class:"bg-white"},X1={key:1,class:"text-gray-400 text-center py-12"},J1={key:2,class:"text-gray-400 text-center py-12"},Q1=e.defineComponent({__name:"preview-tab",props:e.mergeModels({hideDetailsButton:{type:Boolean,default:!1}},{data:{default:{}},dataModifiers:{}}),emits:["update:data"],setup(t){const n=e.defineAsyncComponent(()=>import("@opengis/form")),o=e.useModel(t,"data"),r=[{text:"template1",id:"template1"},{text:"template2",id:"template2"},{text:"template3",id:"template3"},{text:"template4",id:"template4"},{text:"template5",id:"template5"}],l={view:{type:"radio",label:"Вигляд",position:"horizontal",required:!0,options:r,col:12}},s=e.computed(()=>{var p;return Array.isArray((p=o.value)==null?void 0:p.columns)?o.value.columns:[]}),i=e.computed(()=>{var p;return((p=o.value)==null?void 0:p.view)||"template1"}),d=e.computed(()=>na[i.value]||na.template1),u=e.computed(()=>{var g;const p=(g=o.value)==null?void 0:g.view;if(!p)return"template1";const a=r.find(m=>m.id===p);return(a==null?void 0:a.text)||p}),c=e.computed(()=>(Array.isArray(o.value.tableData)?o.value.tableData:[]).slice(0,5).map(a=>{var g,m;return{...a,service_id:(g=o.value)==null?void 0:g.service_id,is_map:(m=o.value)==null?void 0:m.is_map}}));return(p,a)=>(e.openBlock(),e.createElementBlock("div",Y1,[e.createElementVNode("div",G1,[(e.openBlock(),e.createBlock(e.unref(n),{key:o.value.id,schema:l,modelValue:o.value,"onUpdate:modelValue":a[0]||(a[0]=g=>o.value=g)},null,8,["modelValue"]))]),e.createElementVNode("h2",Z1," Превʼю таблиці ("+e.toDisplayString(u.value)+") ",1),e.createElementVNode("div",K1,[d.value&&c.value.length&&s.value.length?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.value),{items:c.value,columns:s.value,path:"#",id_key:"id","hide-details-button":t.hideDetailsButton,key:i.value},null,8,["items","columns","hide-details-button"])):c.value.length?(e.openBlock(),e.createElementBlock("div",J1," Додайте колонки та виберіть вигляд для перегляду ")):(e.openBlock(),e.createElementBlock("div",X1," Немає даних для превʼю "))])]))}}),ek={class:"w-full mb-6"},tk={class:"flex items-center w-full h-10 max-w-md p-1 bg-white border border-gray-200 rounded-md"},nk=["onClick"],oa=e.defineComponent({__name:"MapSettingsTabs",props:{tabs:{},activeTab:{}},emits:["update:activeTab"],setup(t,{emit:n}){const o=n,r=l=>{o("update:activeTab",l)};return(l,s)=>(e.openBlock(),e.createElementBlock("div",ek,[e.createElementVNode("div",tk,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.tabs,i=>(e.openBlock(),e.createElementBlock("button",{key:i.id,onClick:d=>r(i.id),class:e.normalizeClass(["inline-flex flex-1 items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium transition-all",i.id===t.activeTab?"bg-blue-50 text-blue-700":"text-gray-600 hover:bg-gray-50"])},e.toDisplayString(i.name),11,nk))),128))])]))}}),ok={class:"relative h-full flex flex-col flex-1 min-h-0 overflow-hidden mx-auto w-full"},rk={class:"mx-1"},lk={class:"text-gray-900 font-semibold"},ak={key:0,class:"text-center py-12 mt-6 px-[24px]"},sk={key:1,class:"px-[24px] overflow-y-auto"},ik={class:"space-y-6"},ck=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"register",props:{hideDetailsButton:{type:Boolean,default:!1}},setup(t){const n=He.useRoute(),o=He.useRouter(),r=e.computed(()=>n.path.replace(/\/[^/]+$/,"")),l=e.computed(()=>{var f;return((f=o.resolve(r.value).meta)==null?void 0:f.title)??""}),s=e.computed(()=>{var f;return((f=g.value)==null?void 0:f.name)||"Налаштування реєстру"}),i=e.ref("list"),d=e.ref(""),u=e.ref(!0),c=[{name:"Список",id:"list"},{name:"Фільтри",id:"filters"},{name:"Картка",id:"card"},{name:"Перегляд",id:"preview"}],p={list:M1,filters:R1,card:W1,preview:Q1},a=c.map(f=>f.id),g=e.ref({columns:[],filters:[],card:[],tableData:[]}),m=e.ref([]),y=async()=>{var b;if(!((b=g.value)==null?void 0:b.token)){Ce.notify({type:"error",title:"Помилка",message:"Відсутній токен для збереження"});return}try{const x=await fetch(`/api/gis-registry/${n.params.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(g.value)});if(!x.ok)throw new Error(`Failed to save content: ${x.status}`);Ce.notify({type:"success",title:"Успіх",message:"Контент збережено"})}catch(x){Ce.notify({type:"error",title:"Помилка",message:"Не вдалося зберегти контент"}),console.error(x)}},k=async f=>{try{const x=await(await fetch(`/api/gis-registry/${f}`)).json(),N=Array.isArray(x==null?void 0:x.rows)?x.rows:[];g.value.tableData=N.slice(0,3)}catch(b){console.error("Помилка завантаження превʼю:",b)}},h=async()=>{var f,b;try{u.value=!0;const N=await(await fetch(`/api/data/gis.registers.table/${n.params.id}`)).json(),V=((f=N==null?void 0:N.rows)==null?void 0:f[0])||{};d.value=V.register_key||"",g.value={...V,columns:Array.isArray(V.columns)?V.columns:[],filters:Array.isArray(V.filters)?V.filters:[],card:Array.isArray(V.card)?V.card:[],tableData:Array.isArray(V.tableData)?V.tableData:[]},(b=N==null?void 0:N.tokens)!=null&&b.edit&&(g.value.token=N.tokens.edit),m.value=Array.isArray(N==null?void 0:N.fields)?N.fields:[]}catch(x){console.error("Помилка завантаження даних:",x)}finally{u.value=!1}};return e.onMounted(async()=>{const f=n.query.tab;typeof f=="string"&&a.includes(f)&&(i.value=f),await h(),d.value&&await k(d.value)}),e.watch(i,f=>{n.query.tab!==f&&o.replace({query:{...n.query,tab:f}})}),e.watch(()=>n.query.tab,f=>{typeof f=="string"&&a.includes(f)&&i.value!==f&&(i.value=f)}),e.watch(()=>n.params.id,async(f,b)=>{!f||f===b||(await h(),d.value&&await k(d.value))}),(f,b)=>{const x=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",ok,[e.createVNode(sn,{variant:"form",title:s.value},{breadcrumbs:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(x,{to:r.value,class:"text-gray-500 hover:text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1},8,["to"]),e.createElementVNode("span",rk,[e.createVNode(e.unref(he.LucideChevronRight),{size:16,class:"shrink-0"})])],64)):e.createCommentVNode("",!0),e.createElementVNode("span",lk,e.toDisplayString(s.value),1)]),description:e.withCtx(()=>[...b[3]||(b[3]=[e.createTextVNode("Налаштування реєстру",-1)])]),actions:e.withCtx(()=>[e.createElementVNode("button",{onClick:b[0]||(b[0]=N=>e.unref(o).back()),class:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium border h-10 px-4 py-2 border-gray-300 text-gray-700 hover:bg-gray-50"}," Повернутися "),e.createElementVNode("button",{onClick:y,class:"inline-flex items-center justify-center gap-2 whitespace-nowrap text-white rounded-md text-sm font-medium h-10 px-4 py-2 bg-blue-600 hover:bg-blue-700"}," Зберегти ")]),_:1},8,["title"]),u.value?(e.openBlock(),e.createElementBlock("div",ak,[...b[4]||(b[4]=[e.createElementVNode("p",{class:"text-gray-500"},"Завантаження...",-1)])])):(e.openBlock(),e.createElementBlock("div",sk,[e.createVNode(oa,{tabs:c,activeTab:i.value,"onUpdate:activeTab":b[1]||(b[1]=N=>i.value=N)},null,8,["activeTab"]),e.createElementVNode("div",ik,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p[i.value]),{data:g.value,"onUpdate:data":b[2]||(b[2]=N=>g.value=N),fields:m.value,"hide-details-button":t.hideDetailsButton,key:i.value},null,40,["data","fields","hide-details-button"]))])]))])}}})},Symbol.toStringTag,{value:"Module"}));/*! js-yaml 5.2.1 https://github.com/nodeca/js-yaml @license MIT */var Ye=Symbol("NOT_RESOLVED"),pr=Symbol("MERGE_KEY");function ft(t,n){return{tagName:t,nodeKind:"scalar",implicit:n.implicit??!1,matchByTagPrefix:n.matchByTagPrefix??!1,implicitFirstChars:n.implicitFirstChars??null,resolve:n.resolve,identify:n.identify??null,represent:n.represent??(o=>String(o)),representTagName:n.representTagName??null}}function gr(t,n){const o=n.finalize===void 0;return{tagName:t,nodeKind:"sequence",implicit:!1,matchByTagPrefix:n.matchByTagPrefix??!1,create:n.create,addItem:n.addItem,finalize:n.finalize??(r=>r),carrierIsResult:o,identify:n.identify??null,represent:n.represent??(r=>r),representTagName:n.representTagName??null}}function Co(t,n){const o=n.finalize===void 0;return{tagName:t,nodeKind:"mapping",implicit:!1,matchByTagPrefix:n.matchByTagPrefix??!1,create:n.create,addPair:n.addPair,has:n.has,keys:n.keys,get:n.get,finalize:n.finalize??(r=>r),carrierIsResult:o,identify:n.identify??null,represent:n.represent??(r=>r),representTagName:n.representTagName??null}}var dk=ft("tag:yaml.org,2002:str",{resolve:t=>t,identify:t=>typeof t=="string"}),uk=["","~","null","Null","NULL"],fk=ft("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:t=>uk.indexOf(t)!==-1?null:Ye,identify:t=>t===null,represent:()=>"null"}),mk=ft("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["n"],resolve:(t,n)=>t==="null"||n&&t===""?null:Ye,identify:t=>t===null,represent:()=>"null"}),pk=["","~","null","Null","NULL"],gk=ft("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:t=>pk.indexOf(t)!==-1?null:Ye,identify:t=>t===null,represent:()=>"null"}),yk=["true","True","TRUE"],hk=["false","False","FALSE"],bk=ft("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","T","f","F"],resolve:t=>yk.indexOf(t)!==-1?!0:hk.indexOf(t)!==-1?!1:Ye,identify:t=>Object.prototype.toString.call(t)==="[object Boolean]",represent:t=>t?"true":"false"}),xk=["true"],kk=["false"],wk=ft("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","f"],resolve:t=>xk.indexOf(t)!==-1?!0:kk.indexOf(t)!==-1?!1:Ye,identify:t=>Object.prototype.toString.call(t)==="[object Boolean]",represent:t=>t?"true":"false"}),_k=["true","True","TRUE","y","Y","yes","Yes","YES","on","On","ON"],Ek=["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"],Ck=ft("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["y","Y","n","N","t","T","f","F","o","O"],resolve:t=>_k.indexOf(t)!==-1?!0:Ek.indexOf(t)!==-1?!1:Ye,identify:t=>Object.prototype.toString.call(t)==="[object Boolean]",represent:t=>t?"true":"false"}),Nk=new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"),Vk=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function Bk(t){let n=t,o=1;return(n[0]==="-"||n[0]==="+")&&(n[0]==="-"&&(o=-1),n=n.slice(1)),n.startsWith("0b")?o*parseInt(n.slice(2),2):n.startsWith("0o")?o*parseInt(n.slice(2),8):n.startsWith("0x")?o*parseInt(n.slice(2),16):o*parseInt(n,10)}function $k(t,n){if(n){if(!Vk.test(t))return Ye}else if(!Nk.test(t))return Ye;const o=Bk(t);return Number.isFinite(o)?o:Ye}var ra=ft("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:$k,identify:t=>Number.isInteger(t)&&!Object.is(t,-0)&&t.toString(10).indexOf("e")<0,represent:t=>t.toString(10)}),Sk=new RegExp("^-?(?:0|[1-9][0-9]*)$"),vk=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function Lk(t){let n=t,o=1;return(n[0]==="-"||n[0]==="+")&&(n[0]==="-"&&(o=-1),n=n.slice(1)),n.startsWith("0b")?o*parseInt(n.slice(2),2):n.startsWith("0o")?o*parseInt(n.slice(2),8):n.startsWith("0x")?o*parseInt(n.slice(2),16):o*parseInt(n,10)}function Tk(t,n){if(n){if(!vk.test(t))return Ye}else if(!Sk.test(t))return Ye;const o=Lk(t);return Number.isFinite(o)?o:Ye}var Ak=ft("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:Tk,identify:t=>Number.isInteger(t)&&!Object.is(t,-0)&&t.toString(10).indexOf("e")<0,represent:t=>t.toString(10)}),Mk=new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");function Fk(t){let n=t.replace(/_/g,""),o=1;if((n[0]==="-"||n[0]==="+")&&(n[0]==="-"&&(o=-1),n=n.slice(1)),n.startsWith("0b"))return o*parseInt(n.slice(2),2);if(n.startsWith("0x"))return o*parseInt(n.slice(2),16);if(n.includes(":")){let r=0;for(const l of n.split(":"))r=r*60+Number(l);return o*r}return n!=="0"&&n[0]==="0"?o*parseInt(n,8):o*parseInt(n,10)}function Dk(t){if(!Mk.test(t))return Ye;const n=Fk(t);return Number.isFinite(n)?n:Ye}var yr=ft("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:Dk,identify:t=>Number.isInteger(t)&&!Object.is(t,-0)&&t.toString(10).indexOf("e")<0,represent:t=>t.toString(10)}),Pk=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),zk=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Ik(t){if(!Pk.test(t))return Ye;let n=t.toLowerCase();const o=n[0]==="-"?-1:1;if("+-".includes(n[0])&&(n=n.slice(1)),n===".inf")return o===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(n===".nan")return NaN;const r=o*parseFloat(n);return Number.isFinite(r)||zk.test(t)?r:Ye}function Rk(t){if(isNaN(t))return".nan";if(t===Number.POSITIVE_INFINITY)return".inf";if(t===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(t,-0))return"-0.0";const n=t.toString(10);return/^[-+]?[0-9]+e/.test(n)?n.replace("e",".e"):n}var la=ft("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:Ik,identify:t=>typeof t=="number"&&(!Number.isInteger(t)||Object.is(t,-0)||t.toString(10).indexOf("e")>=0),represent:Rk}),jk=new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"),Ok=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Uk(t,n){if(n){if(!Ok.test(t))return Ye;let r=t.toLowerCase();const l=r[0]==="-"?-1:1;if("+-".includes(r[0])&&(r=r.slice(1)),r===".inf")return l===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(r===".nan")return NaN;const s=l*parseFloat(r);return Number.isFinite(s)?s:Ye}if(!jk.test(t))return Ye;const o=Number(t);return Number.isFinite(o)?o:Ye}function qk(t){if(isNaN(t))return".nan";if(t===Number.POSITIVE_INFINITY)return".inf";if(t===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(t,-0))return"-0.0";const n=t.toString(10);return/^[-+]?[0-9]+e/.test(n)?n.replace("e",".e"):n}var Hk=ft("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:Uk,identify:t=>typeof t=="number"&&(!Number.isInteger(t)||Object.is(t,-0)||t.toString(10).indexOf("e")>=0),represent:qk}),Wk=new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),Yk=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Gk(t){if(!Wk.test(t))return Ye;let n=t.toLowerCase().replace(/_/g,"");const o=n[0]==="-"?-1:1;if("+-".includes(n[0])&&(n=n.slice(1)),n===".inf")return o===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(n===".nan")return NaN;let r=0;if(n.includes(":")){for(const l of n.split(":"))r=r*60+Number(l);r*=o}else r=o*parseFloat(n);return Number.isFinite(r)||Yk.test(t)?r:Ye}function Zk(t){if(isNaN(t))return".nan";if(t===Number.POSITIVE_INFINITY)return".inf";if(t===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(t,-0))return"-0.0";const n=t.toString(10);return/^[-+]?[0-9]+e/.test(n)?n.replace("e",".e"):n}var hr=ft("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:Gk,identify:t=>typeof t=="number"&&(!Number.isInteger(t)||Object.is(t,-0)||t.toString(10).indexOf("e")>=0),represent:Zk}),Kk=ft("tag:yaml.org,2002:merge",{implicit:!0,implicitFirstChars:["<"],resolve:(t,n)=>t==="<<"||n&&t===""?pr:Ye}),Xk=/^[A-Za-z0-9+/]*={0,2}$/;function Jk(t){const n=t.replace(/\s/g,"");if(n.length%4!==0||!Xk.test(n))return Ye;const o=atob(n),r=new Uint8Array(o.length);for(let l=0;l<o.length;l++)r[l]=o.charCodeAt(l);return r}function Qk(t){let n="";for(let o=0;o<t.length;o++)n+=String.fromCharCode(t[o]);return btoa(n)}var ew=ft("tag:yaml.org,2002:binary",{resolve:Jk,identify:t=>Object.prototype.toString.call(t)==="[object Uint8Array]",represent:Qk}),tw=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),nw=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function ow(t){let n=tw.exec(t);if(n===null&&(n=nw.exec(t)),n===null)return Ye;const o=+n[1],r=+n[2]-1,l=+n[3];if(!n[4]){const p=new Date(Date.UTC(o,r,l));return p.getUTCFullYear()!==o||p.getUTCMonth()!==r||p.getUTCDate()!==l?Ye:p}const s=+n[4],i=+n[5],d=+n[6];let u=0;if(s>23||i>59||d>59)return Ye;if(n[7]){let p=n[7].slice(0,3);for(;p.length<3;)p+="0";u=+p}const c=new Date(Date.UTC(o,r,l,s,i,d,u));if(c.getUTCFullYear()!==o||c.getUTCMonth()!==r||c.getUTCDate()!==l)return Ye;if(n[9]){const p=+n[10],a=+(n[11]||0);if(p>23||a>59)return Ye;const g=(p*60+a)*6e4;c.setTime(c.getTime()-(n[9]==="-"?-g:g))}return c}var rw=ft("tag:yaml.org,2002:timestamp",{implicit:!0,implicitFirstChars:[..."0123456789"],resolve:ow,identify:t=>t instanceof Date,represent:t=>t.toISOString()}),lw=gr("tag:yaml.org,2002:seq",{create:()=>[],addItem:(t,n)=>{t.push(n)},identify:Array.isArray});function No(t){if(t===null||typeof t!="object"||Array.isArray(t))return!1;const n=Object.getPrototypeOf(t);return n===null||n===Object.prototype}function br(t,n){const o={};for(const r of n)t[r]!==void 0&&(o[r]=t[r]);return o}var aw=gr("tag:yaml.org,2002:omap",{create:()=>({list:[],seen:new Set}),addItem:(t,n)=>{let o;if(n instanceof Map){if(n.size!==1)return"cannot resolve an ordered map item";o=n.keys().next().value}else if(No(n)){const r=Object.keys(n);if(r.length!==1)return"cannot resolve an ordered map item";o=r[0]}else return"cannot resolve an ordered map item";return t.seen.has(o)?"duplicate key in ordered map":(t.seen.add(o),t.list.push(n),"")},finalize:t=>t.list}),sw=gr("tag:yaml.org,2002:pairs",{create:()=>[],addItem:(t,n)=>{if(n instanceof Map)return n.size!==1?"cannot resolve a pairs item":(t.push(n.entries().next().value),"");if(Object.prototype.toString.call(n)!=="[object Object]")return"cannot resolve a pairs item";const o=n,r=Object.keys(o);return r.length!==1?"cannot resolve a pairs item":(t.push([r[0],o[r[0]]]),"")}}),iw=Co("tag:yaml.org,2002:map",{create:()=>({}),identify:No,represent:t=>{const n=new Map;for(const o of Object.keys(t))n.set(o,t[o]);return n},addPair:(t,n,o)=>{if(n!==null&&typeof n=="object")return"object-based map does not support complex keys";const r=String(n);return r==="__proto__"?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,""},has:(t,n)=>n!==null&&typeof n=="object"?!1:Object.prototype.hasOwnProperty.call(t,String(n)),keys:t=>Object.keys(t),get:(t,n)=>t[String(n)]}),cw=Co("tag:yaml.org,2002:set",{create:()=>new Set,identify:t=>t instanceof Set,represent:t=>{const n=new Map;for(const o of t)n.set(o,null);return n},addPair:(t,n,o)=>o!==null?"cannot resolve a set item":(t.add(n),""),has:(t,n)=>t.has(n),keys:t=>t.keys(),get:()=>null});function dw(){return{scalar:{},sequence:{},mapping:{}}}function uw(){return{scalar:[],sequence:[],mapping:[]}}function fw(t){const n=[];for(const o of t){let r=n.length;for(let l=0;l<n.length;l++){const s=n[l];if(s.nodeKind===o.nodeKind&&s.tagName===o.tagName&&s.matchByTagPrefix===o.matchByTagPrefix){r=l;break}}n[r]=o}return n}var Vo=class ls{constructor(n){ut(this,"tags");ut(this,"implicitScalarTags");ut(this,"implicitScalarByFirstChar");ut(this,"implicitScalarAnyFirstChar");ut(this,"defaultScalarTag");ut(this,"defaultSequenceTag");ut(this,"defaultMappingTag");ut(this,"exact");ut(this,"prefix");const o=fw(n),r=[],l=dw(),s=uw();for(const p of o){if(p.nodeKind==="scalar"&&p.implicit){if(p.matchByTagPrefix)throw new Error("Implicit scalar tags cannot match by tag prefix");r.push(p)}switch(p.nodeKind){case"scalar":p.matchByTagPrefix?s.scalar.push(p):l.scalar[p.tagName]=p;break;case"sequence":p.matchByTagPrefix?s.sequence.push(p):l.sequence[p.tagName]=p;break;case"mapping":p.matchByTagPrefix?s.mapping.push(p):l.mapping[p.tagName]=p;break}}const i=r.filter(p=>p.implicitFirstChars===null),d=new Set;for(const p of r)if(p.implicitFirstChars!==null)for(const a of p.implicitFirstChars)d.add(a);const u=new Map;for(const p of d)u.set(p,r.filter(a=>a.implicitFirstChars===null||a.implicitFirstChars.indexOf(p)!==-1));const c=l.scalar["tag:yaml.org,2002:str"];if(!c)throw new Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");this.tags=o,this.implicitScalarTags=r,this.implicitScalarByFirstChar=u,this.implicitScalarAnyFirstChar=i,this.defaultScalarTag=c,this.defaultSequenceTag=l.sequence["tag:yaml.org,2002:seq"],this.defaultMappingTag=l.mapping["tag:yaml.org,2002:map"],this.exact=l,this.prefix=s}withTags(...n){let o=[];for(const r of n)o=o.concat(r);return new ls([...this.tags,...o])}},xr=new Vo([dk,lw,iw]);new Vo([...xr.tags,mk,wk,Ak,Hk]);var mw=new Vo([...xr.tags,fk,bk,ra,la]),pw=new Vo([...xr.tags,gk,Ck,yr,hr,rw,Kk,ew,aw,sw,cw]);Co("tag:yaml.org,2002:map",{create:()=>new Map,addPair:(t,n,o)=>(t.set(n,o),""),has:(t,n)=>t.has(n),keys:t=>t.keys(),get:(t,n)=>t.get(n),identify:t=>t instanceof Map||No(t),represent:t=>{if(t instanceof Map)return t;const n=new Map,o=t;for(const r of Object.keys(o))n.set(r,o[r]);return n}});function aa(t){if(Array.isArray(t)){const n=Array.prototype.slice.call(t);for(let o=0;o<n.length;o++){if(Array.isArray(n[o]))return null;typeof n[o]=="object"&&Object.prototype.toString.call(n[o])==="[object Object]"&&(n[o]="[object Object]")}return String(n)}return typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"?"[object Object]":String(t)}Co("tag:yaml.org,2002:map",{create:()=>({}),identify:No,represent:t=>{const n=new Map;for(const o of Object.keys(t))n.set(o,t[o]);return n},addPair:(t,n,o)=>{const r=aa(n);return r===null?"nested arrays are not supported inside keys":(r==="__proto__"?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,"")},has:(t,n)=>{const o=aa(n);return o!==null&&Object.prototype.hasOwnProperty.call(t,o)},keys:t=>Object.keys(t),get:(t,n)=>t[String(n)]});var gw={maxLength:79,indent:1,linesBefore:3,linesAfter:2};function kr(t,n,o,r,l){let s="",i="";const d=Math.floor(l/2)-1;return r-n>d&&(s=" ... ",n=r-d+s.length),o-r>d&&(i=" ...",o=r+d-i.length),{str:s+t.slice(n,o).replace(/\t/g,"→")+i,pos:r-n+s.length}}function wr(t,n){return" ".repeat(Math.max(n-t.length,0))+t}function yw(t,n){if(!t.buffer)return null;const o={...gw,...n},r=/\r?\n|\r|\0/g,l=[0],s=[];let i,d=-1;for(;i=r.exec(t.buffer);)s.push(i.index),l.push(i.index+i[0].length),t.position<=i.index&&d<0&&(d=l.length-2);d<0&&(d=l.length-1);let u="";const c=Math.min(t.line+o.linesAfter,s.length).toString().length,p=o.maxLength-(o.indent+c+3);for(let g=1;g<=o.linesBefore&&!(d-g<0);g++){const m=kr(t.buffer,l[d-g],s[d-g],t.position-(l[d]-l[d-g]),p);u=`${" ".repeat(o.indent)}${wr((t.line-g+1).toString(),c)} | ${m.str}
7
7
  ${u}`}const a=kr(t.buffer,l[d],s[d],t.position,p);u+=`${" ".repeat(o.indent)}${wr((t.line+1).toString(),c)} | ${a.str}
8
8
  `,u+=`${"-".repeat(o.indent+c+3+a.pos)}^
9
9
  `;for(let g=1;g<=o.linesAfter&&!(d+g>=s.length);g++){const m=kr(t.buffer,l[d+g],s[d+g],t.position-(l[d]-l[d+g]),p);u+=`${" ".repeat(o.indent)}${wr((t.line+g+1).toString(),c)} | ${m.str}
@@ -1,9 +1,9 @@
1
1
  import { defineComponent as te, resolveDirective as Xe, openBlock as u, createElementBlock as m, createElementVNode as n, Fragment as W, renderList as X, toDisplayString as d, withDirectives as $e, createTextVNode as Ke, normalizeClass as ae, ref as $, watch as I, computed as h, vModelText as Ye, onMounted as Ze, onBeforeUnmount as He, createCommentVNode as q, createVNode as k, withCtx as be, createBlock as F, resolveDynamicComponent as Je } from "vue";
2
2
  import { useRouter as et, useRoute as tt } from "vue-router";
3
3
  import { TooltipDirective as st, notify as S } from "@opengis/core";
4
- import { _ as nt, u as lt, f as rt, M as ot, i as it, j as he, F as at } from "./index-Bd_JFn54.js";
5
- import { _ as ut, a as ct, b as dt, c as ft, d as mt, e as pt, f as gt, g as yt } from "./MapToolbarRight.vue_vue_type_script_setup_true_lang-D5Q1QqS8.js";
6
- import { _ as _e } from "./ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-8ervbwRu.js";
4
+ import { _ as nt, u as lt, f as rt, M as ot, i as it, j as he, F as at } from "./index-CIwXf79s.js";
5
+ import { _ as ut, a as ct, b as dt, c as ft, d as mt, e as pt, f as gt, g as yt } from "./MapToolbarRight.vue_vue_type_script_setup_true_lang-DUMEovEr.js";
6
+ import { _ as _e } from "./ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-BwM91IsK.js";
7
7
  const xt = { class: "flex-1 overflow-y-auto p-4 sm:p-6" }, vt = { class: "space-y-3" }, bt = { class: "bg-white p-3 rounded-xl border border-gray-200 shadow-sm" }, ht = { class: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2" }, _t = { class: "text-xs text-gray-500 mb-1" }, wt = {
8
8
  key: 0,
9
9
  class: "text-base text-md font-semibold text-gray-900"
@@ -2,9 +2,9 @@ import { defineComponent as B, mergeModels as j, useModel as S, computed as h, d
2
2
  import { useRoute as Z, useRouter as ee } from "vue-router";
3
3
  import { notify as F } from "@opengis/core";
4
4
  import { _ as te } from "./TableFormHeader.vue_vue_type_script_setup_true_lang-Mci_tseM.js";
5
- import { V as N } from "./vs-datatable-BvSBnibk.js";
6
- import { _ as z, n as R, m as E, r as H } from "./import-utils-BYsmUngb.js";
7
- import { a as ae, b as le, c as se, d as oe, e as ie } from "./index-Bd_JFn54.js";
5
+ import { V as N } from "./vs-datatable-CBQJ_ERx.js";
6
+ import { _ as z, n as R, m as E, r as H } from "./import-utils-D7vwfAcw.js";
7
+ import { a as ae, b as le, c as se, d as oe, e as ie } from "./index-CIwXf79s.js";
8
8
  import { LucideChevronRight as re } from "lucide-vue-next";
9
9
  import { _ as ne } from "./MapSettingsTabs.vue_vue_type_script_setup_true_lang-CKCK3NqY.js";
10
10
  const ue = { class: "vs-form" }, de = { class: "vs-form__body auto-rows-max container" }, ce = { class: "flex flex-wrap" }, me = { class: "h-fit w-full mb-6 bg-white border border-gray-200 rounded-lg p-6" }, ve = { class: "h-fit w-full flex flex-wrap" }, pe = { class: "w-full" }, fe = /* @__PURE__ */ B({
@@ -277,7 +277,7 @@ const ue = { class: "vs-form" }, de = { class: "vs-form__body auto-rows-max cont
277
277
  validators: ["required"],
278
278
  disabled: !0
279
279
  },
280
- ua: {
280
+ label: {
281
281
  type: "text",
282
282
  label: "Назва",
283
283
  validators: ["required"]
@@ -4,12 +4,12 @@ var R = (e, n, t) => di(e, typeof n != "symbol" ? n + "" : n, t);
4
4
  import { openBlock as _, createElementBlock as q, createElementVNode as y, defineComponent as ae, ref as E, watch as L, createTextVNode as pi, createVNode as O, createBlock as U, createCommentVNode as W, defineAsyncComponent as mi, unref as ze, withCtx as Ge, withDirectives as fn, vModelText as dn, normalizeClass as Ee, Fragment as At, renderList as Ct, toDisplayString as fe, getCurrentInstance as wt, onBeforeUnmount as Tt, toRef as hi, computed as ve, onMounted as gi, resolveDynamicComponent as yi } from "vue";
5
5
  import { useRoute as vi, useRouter as bi } from "vue-router";
6
6
  import { notify as te } from "@opengis/core";
7
- import { _ as Ze, u as We, f as xi, M as Si, g as ki, h as Ai, i as Ci, j as it, k as wi, l as Ti, m as _i, s as rt, n as Ei } from "./index-Bd_JFn54.js";
8
- import { _ as Ii, a as Ni, b as $i, c as Li, d as Fi, e as Ri, f as Oi, g as Pi } from "./MapToolbarRight.vue_vue_type_script_setup_true_lang-D5Q1QqS8.js";
9
- import { S as Mi, C as Ui } from "./CardIcon-C3cCdpvO.js";
7
+ import { _ as Ze, u as We, f as xi, M as Si, g as ki, h as Ai, i as Ci, j as it, k as wi, l as Ti, m as _i, s as rt, n as Ei } from "./index-CIwXf79s.js";
8
+ import { _ as Ii, a as Ni, b as $i, c as Li, d as Fi, e as Ri, f as Oi, g as Pi } from "./MapToolbarRight.vue_vue_type_script_setup_true_lang-DUMEovEr.js";
9
+ import { S as Mi, C as Ui } from "./CardIcon-Do73o95Y.js";
10
10
  import { _ as _t } from "./MonacoEditor.vue_vue_type_script_setup_true_lang-D3ZPeXMw.js";
11
- import { V as en } from "./vs-datatable-BvSBnibk.js";
12
- import { _ as Nn, m as $n, r as Le } from "./import-utils-BYsmUngb.js";
11
+ import { V as en } from "./vs-datatable-CBQJ_ERx.js";
12
+ import { _ as Nn, m as $n, r as Le } from "./import-utils-D7vwfAcw.js";
13
13
  /*! js-yaml 5.2.1 https://github.com/nodeca/js-yaml @license MIT */
14
14
  var T = Symbol("NOT_RESOLVED"), Ln = Symbol("MERGE_KEY");
15
15
  function V(e, n) {
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as F, mergeModels as O, defineAsyncComponent as I, useModel as R, ref as y, watch as K, openBlock as o, createElementBlock as s, createElementVNode as e, createVNode as $, unref as x, withCtx as S, createStaticVNode as V, useSlots as P, computed as H, Fragment as b, createTextVNode as U, createCommentVNode as N, renderList as A, normalizeStyle as Q, toDisplayString as M, normalizeClass as z, withModifiers as X, createBlock as Y, resolveDynamicComponent as ee, withDirectives as te, renderSlot as ne } from "vue";
2
2
  import { notify as E } from "@opengis/core";
3
3
  import { Edit as le, Trash as oe } from "lucide-vue-next";
4
- import { _ as u } from "./index-Bd_JFn54.js";
4
+ import { _ as u } from "./index-CIwXf79s.js";
5
5
  const se = { class: "flex items-center justify-center col-span-3 gap-2" }, re = { class: "flex justify-end p-[20px] gap-[10px] border-t w-full" }, ie = /* @__PURE__ */ F({
6
6
  __name: "vs-datatable-controls",
7
7
  props: /* @__PURE__ */ O({
package/package.json CHANGED
@@ -1,79 +1,79 @@
1
- {
2
- "name": "@opengis/gis",
3
- "version": "0.2.187",
4
- "type": "module",
5
- "author": "Softpro",
6
- "main": "./dist/index.js",
7
- "files": [
8
- "dist/*",
9
- "module/*",
10
- "server/*",
11
- "plugin.js",
12
- "utils.js",
13
- "config.js",
14
- "README.md",
15
- "LICENSE"
16
- ],
17
- "scripts": {
18
- "dump": "bun ./node_modules/@opengis/fastify-table/dist/script/dump.js",
19
- "migrate": "MIGRATE=true bun ./node_modules/@opengis/fastify-table/dist/script/migrate.js",
20
- "start": "bun server",
21
- "start:kyiv-demo": "bun --env-file=.env.kyiv-demo server",
22
- "kamyanske": "bun --env-file=.env.kamyanske server",
23
- "start:kr": "bun --env-file=.env.kr server",
24
- "poltava": "bun --env-file=.env.poltava --hot server",
25
- "dev:kyiv-demo": "bun --env-file=.env.kyiv-demo --hot server",
26
- "dev:kamyanske": "bun --env-file=.env.kamyanske --hot server",
27
- "kr": "bun --env-file=.env.kr --hot server",
28
- "lint": "eslint src --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts",
29
- "fix": "eslint src --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix",
30
- "patch": "npm version patch && git push && npm publish",
31
- "dev": "bun --hot server",
32
- "front": "vite dev",
33
- "build-lib": "vite build",
34
- "build:admin": "vite build admin",
35
- "build": "vite build",
36
- "preview": "vite preview",
37
- "prod": "NODE_ENV=production node server",
38
- "docs:install": "npm install --prefix ./docs",
39
- "docs:dev": "npm run --prefix ./docs docs:dev",
40
- "docs:build": "npm run --prefix ./docs docs:build",
41
- "docs:preview": "npm run --prefix ./docs docs:preview",
42
- "prepublishOnly": "npm run build"
43
- },
44
- "dependencies": {
45
- "@fortawesome/free-solid-svg-icons": "7.3.1",
46
- "@mapbox/sphericalmercator": "2.0.2",
47
- "carto": "1.2.0",
48
- "fontkit": "2.0.4",
49
- "sharp": "0.35.4",
50
- "svg-path-bounds": "1.0.2"
51
- },
52
- "peerDependencies": {
53
- "@opengis/fastify-table": "^2.5.32"
54
- },
55
- "resolutions": {
56
- "rollup": "4.30.0"
57
- },
58
- "devDependencies": {
59
- "@opengis/core": "^0.0.37",
60
- "@opengis/fastify-table": "^2.5.32",
61
- "@opengis/filter": "0.1.59",
62
- "@opengis/form": "^0.1.20",
63
- "@opengis/table": "^0.0.47",
64
- "@vitejs/plugin-vue": "^5.2.4",
65
- "eslint": "^8.57.1",
66
- "eslint-config-airbnb": "19.0.4",
67
- "eslint-plugin-import": "^2.32.0",
68
- "eslint-plugin-vue": "^9.33.0",
69
- "@vue/eslint-config-typescript": "^12.0.0",
70
- "vue-eslint-parser": "^10.4.1",
71
- "lucide-vue-next": "^0.577.0",
72
- "sass-embedded": "1.86.3",
73
- "typescript": "^7.0.2",
74
- "vite": "^6.4.3",
75
- "vue": "^3.5.38",
76
- "vue-router": "4.5.1",
77
- "vuedraggable": "^4.1.0"
78
- }
79
- }
1
+ {
2
+ "name": "@opengis/gis",
3
+ "version": "0.2.189",
4
+ "type": "module",
5
+ "author": "Softpro",
6
+ "main": "./dist/index.js",
7
+ "files": [
8
+ "dist/*",
9
+ "module/*",
10
+ "server/*",
11
+ "plugin.js",
12
+ "utils.js",
13
+ "config.js",
14
+ "README.md",
15
+ "LICENSE"
16
+ ],
17
+ "scripts": {
18
+ "dump": "bun ./node_modules/@opengis/fastify-table/dist/script/dump.js",
19
+ "migrate": "MIGRATE=true bun ./node_modules/@opengis/fastify-table/dist/script/migrate.js",
20
+ "start": "bun server",
21
+ "start:kyiv-demo": "bun --env-file=.env.kyiv-demo server",
22
+ "kamyanske": "bun --env-file=.env.kamyanske server",
23
+ "start:kr": "bun --env-file=.env.kr server",
24
+ "poltava": "bun --env-file=.env.poltava --hot server",
25
+ "dev:kyiv-demo": "bun --env-file=.env.kyiv-demo --hot server",
26
+ "dev:kamyanske": "bun --env-file=.env.kamyanske --hot server",
27
+ "kr": "bun --env-file=.env.kr --hot server",
28
+ "lint": "eslint src --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts",
29
+ "fix": "eslint src --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix",
30
+ "patch": "npm version patch && git push && npm publish",
31
+ "dev": "bun --hot server",
32
+ "front": "vite dev",
33
+ "build-lib": "vite build",
34
+ "build:admin": "vite build admin",
35
+ "build": "vite build",
36
+ "preview": "vite preview",
37
+ "prod": "NODE_ENV=production node server",
38
+ "docs:install": "npm install --prefix ./docs",
39
+ "docs:dev": "npm run --prefix ./docs docs:dev",
40
+ "docs:build": "npm run --prefix ./docs docs:build",
41
+ "docs:preview": "npm run --prefix ./docs docs:preview",
42
+ "prepublishOnly": "npm run build"
43
+ },
44
+ "dependencies": {
45
+ "@fortawesome/free-solid-svg-icons": "7.3.1",
46
+ "@mapbox/sphericalmercator": "2.0.2",
47
+ "carto": "1.2.0",
48
+ "fontkit": "2.0.4",
49
+ "sharp": "0.35.4",
50
+ "svg-path-bounds": "1.0.2"
51
+ },
52
+ "peerDependencies": {
53
+ "@opengis/fastify-table": "^2.5.32"
54
+ },
55
+ "resolutions": {
56
+ "rollup": "4.30.0"
57
+ },
58
+ "devDependencies": {
59
+ "@opengis/core": "^0.0.37",
60
+ "@opengis/fastify-table": "^2.5.32",
61
+ "@opengis/filter": "0.1.59",
62
+ "@opengis/form": "^0.1.20",
63
+ "@opengis/table": "^0.0.47",
64
+ "@vitejs/plugin-vue": "^5.2.4",
65
+ "eslint": "^8.57.1",
66
+ "eslint-config-airbnb": "19.0.4",
67
+ "eslint-plugin-import": "^2.32.0",
68
+ "eslint-plugin-vue": "^9.33.0",
69
+ "@vue/eslint-config-typescript": "^12.0.0",
70
+ "vue-eslint-parser": "^10.4.1",
71
+ "lucide-vue-next": "^0.577.0",
72
+ "sass-embedded": "1.86.3",
73
+ "typescript": "^7.0.2",
74
+ "vite": "^6.4.3",
75
+ "vue": "^3.5.38",
76
+ "vue-router": "4.5.1",
77
+ "vuedraggable": "^4.1.0"
78
+ }
79
+ }
@@ -85,6 +85,8 @@ export default async function vtile({
85
85
  const statusColumn = style?.colorAttr || style?.iconAttr ? columns.filter(col => col.name === style.colorAttr || style?.iconAttr) : [];
86
86
  const props = !queryAll ? (statusColumn || []).concat(data.popup || []).concat(data.card || []) : columns.filter(el => !['json', 'geometry'].includes(pg.pgType[el.dataTypeID]) && !['uid', 'cdate', 'editor_id', 'editor_date'].includes(el.name));
87
87
 
88
+ const customClsList = await pg.queryCache('select array_agg(name) from admin.user_cls where parent is null and type=$1', { table: 'admin.user_cls', args: ['json'] }).then((r) => r.rows?.[0]?.array_agg || []);
89
+
88
90
  const cache = layer + (queryAll ? '-all' : '') + JSON.stringify(data.popup || []).length;
89
91
  const propsWithCls = propsCache[cache] ?? await Promise.all(props.map(async (col, idx) => {
90
92
  const key = col.name;
@@ -96,12 +98,16 @@ export default async function vtile({
96
98
  console.error('gis vtile: cls not found', clsData);
97
99
  return null;
98
100
  }
99
- return { name: clsData, type: el.arr ? 'cls' : 'select', sql: el.sql };
101
+
102
+ return { name: clsData, type: el.arr ? 'cls' : 'select', sql: el.sql, custom: customClsList.includes(clsData) };
100
103
  }) : null;
101
- const { name, type: type1, sql: sql1 } = cls || getColumnCLS(table, col.data || key) || {};
104
+ const { name, type: type1, sql: sql1, custom } = cls || getColumnCLS(table, col.data || key) || {};
102
105
  // console.log({ name, type, sql });
106
+ if (name && type1 === 'cls' && custom) {
107
+ return `(select name from admin.user_cls where parent='${name.replace(/'/g, "")}' and code::text=q.${key}::text limit 1) as "${key}_text","${key}"::text`;
108
+ }
103
109
  if (name && type1 === 'cls') {
104
- return `(select name from admin.cls where parent='${name}' and code::text=q.${key}::text limit 1) as "${key}_text","${key}"::text`;
110
+ return `(select name from admin.cls where parent='${name.replace(/'/g, "")}' and code::text=q.${key}::text limit 1) as "${key}_text","${key}"::text`;
105
111
  }
106
112
  if (type1 === 'select' && sql1) {
107
113
  const { fields = [] } = await pg.query(`${sql1} limit 0`);