qmap-forms 1.0.7 → 1.0.9

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.
package/index.es.js CHANGED
@@ -1,11 +1,18 @@
1
- import { Fragment as e, Teleport as t, computed as n, createApp as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createSlots as c, createTextVNode as l, createVNode as u, defineAsyncComponent as d, defineComponent as f, h as p, inject as m, nextTick as h, normalizeClass as g, normalizeStyle as _, onBeforeMount as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveComponent as D, resolveDynamicComponent as O, toDisplayString as k, unref as A, vModelCheckbox as j, vModelRadio as M, vModelSelect as N, vModelText as P, vShow as F, watch as I, withCtx as L, withDirectives as R, withKeys as z, withModifiers as B } from "vue";
2
- import { DateTime as V } from "luxon";
3
- import { BehaviorSubject as H, Subject as U } from "rxjs";
1
+ import { Fragment as e, Teleport as t, computed as n, createApp as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createSlots as c, createTextVNode as l, createVNode as u, defineAsyncComponent as d, defineComponent as f, h as p, inject as m, nextTick as h, normalizeClass as g, normalizeStyle as _, onBeforeMount as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveComponent as D, resolveDynamicComponent as O, toDisplayString as k, unref as A, vModelCheckbox as ee, vModelRadio as j, vModelSelect as M, vModelText as N, vShow as P, watch as F, withCtx as I, withDirectives as L, withKeys as R, withModifiers as z } from "vue";
2
+ import { DateTime as B } from "luxon";
3
+ import { BehaviorSubject as V, Subject as H } from "rxjs";
4
4
  import "leaflet-editable";
5
- import "leaflet-path-drag";
6
- import "leaflet";
5
+ import te from "leaflet-path-drag";
6
+ import { Circle as U, Control as W, DomEvent as G, DomUtil as K, FeatureGroup as q, LatLngBounds as ne, Map as re, Rectangle as ie, TileLayer as J, featureGroup as ae, geoJSON as oe } from "leaflet";
7
7
  //#region \0rolldown/runtime.js
8
- var ee = /* @__PURE__ */ f({
8
+ var Y = Object.defineProperty, se = (e, t) => {
9
+ let n = {};
10
+ for (var r in e) Y(n, r, {
11
+ get: e[r],
12
+ enumerable: !0
13
+ });
14
+ return t || Y(n, Symbol.toStringTag, { value: "Module" }), n;
15
+ }, ce = /* @__PURE__ */ f({
9
16
  __name: "BtnTooltip",
10
17
  props: { label: {} },
11
18
  setup(n) {
@@ -49,7 +56,7 @@ var ee = /* @__PURE__ */ f({
49
56
  onMouseover: f,
50
57
  class: "qmap-button",
51
58
  onMouseleave: p,
52
- onKeydown: z(p, ["esc"]),
59
+ onKeydown: R(p, ["esc"]),
53
60
  style: {
54
61
  border: "none",
55
62
  background: "none"
@@ -65,47 +72,47 @@ var ee = /* @__PURE__ */ f({
65
72
  tabindex: "-1"
66
73
  }, k(n.label), 5)) : a("", !0)]))], 64));
67
74
  }
68
- }), W = /* @__PURE__ */ f({
75
+ }), le = /* @__PURE__ */ f({
69
76
  __name: "subtitle-button",
70
77
  props: { qMap: {} },
71
78
  setup(e) {
72
- return (t, n) => e.qMap.subtitle ? (S(), i(ee, {
79
+ return (t, n) => e.qMap.subtitle ? (S(), i(ce, {
73
80
  key: 0,
74
81
  label: e.qMap.subtitle
75
82
  }, {
76
- default: L(() => [...n[0] ||= [s("i", { class: "fa fa-question-circle" }, null, -1)]]),
83
+ default: I(() => [...n[0] ||= [s("i", { class: "fa fa-question-circle text-qmap-primary" }, null, -1)]]),
77
84
  _: 1
78
85
  }, 8, ["label"])) : a("", !0);
79
86
  }
80
- }), G = { class: "block" }, K = /* @__PURE__ */ f({
87
+ }), ue = { class: "block" }, X = /* @__PURE__ */ f({
81
88
  __name: "title-block",
82
89
  props: { qMap: {} },
83
90
  setup(e) {
84
- return (t, n) => (S(), o("span", G, [
91
+ return (t, n) => (S(), o("span", ue, [
85
92
  l(k(e.qMap.title || (e.qMap.id !== "#" && e.qMap.type !== "col" && e.qMap.type !== "group" ? e.qMap.id : "")) + " ", 1),
86
93
  E(t.$slots, "default"),
87
- u(W, { "q-map": e.qMap }, null, 8, ["q-map"])
94
+ u(le, { "q-map": e.qMap }, null, 8, ["q-map"])
88
95
  ]));
89
96
  }
90
- }), q = { class: "my-2 flex flex-row items-center justify-between" }, te = {
97
+ }), de = { class: "my-2 flex flex-row items-center justify-between" }, fe = {
91
98
  key: 0,
92
99
  class: "qmap_array--unset"
93
- }, J = {
100
+ }, pe = {
94
101
  key: 1,
95
102
  class: "qmap_array--set"
96
- }, ne = {
103
+ }, me = {
97
104
  key: 0,
98
105
  class: "qmap-card min-w-0 p-6 text-center qmap-empty"
99
- }, re = {
106
+ }, he = {
100
107
  key: 1,
101
108
  class: ""
102
- }, ie = {
109
+ }, ge = {
103
110
  key: 0,
104
111
  class: "qmap-card min-w-0 p-3"
105
- }, Y = { class: "flex flex-col" }, ae = { class: "flex items-center gap-3 py-2 qmap-list-row" }, oe = { class: "flex-1 min-w-0" }, se = ["onClick"], ce = {
112
+ }, _e = { class: "flex flex-col" }, ve = { class: "flex items-center gap-3 py-2 qmap-list-row" }, ye = { class: "flex-1 min-w-0" }, be = ["onClick"], xe = {
106
113
  key: 1,
107
114
  class: "mt-2 flex flex-col gap-2"
108
- }, le = { class: "qmap-card min-w-0 p-3 flex flex-row items-center gap-2" }, ue = { class: "flex-1 min-w-0 flex flex-col gap-2 qmap_sub_group mt-2" }, de = ["onClick"], fe = /* @__PURE__ */ f({
115
+ }, Se = { class: "qmap-card min-w-0 p-3 flex flex-row items-center gap-2" }, Ce = { class: "flex-1 min-w-0 flex flex-col gap-2 qmap_sub_group mt-2" }, we = ["onClick"], Te = /* @__PURE__ */ f({
109
116
  __name: "qArray",
110
117
  props: {
111
118
  qMap: {},
@@ -123,7 +130,7 @@ var ee = /* @__PURE__ */ f({
123
130
  v(() => {
124
131
  let e = r.model[r.qMap.id];
125
132
  e && r.qMap.item ? l.value = e.slice().map((e) => ({ "#": e })) : e ? l.value = e : !e && r.qMap.required && (l.value = []);
126
- }), I(l, (e) => {
133
+ }), F(l, (e) => {
127
134
  p(e);
128
135
  });
129
136
  function d() {
@@ -143,19 +150,19 @@ var ee = /* @__PURE__ */ f({
143
150
  var t = l.value.slice();
144
151
  t.splice(e, 1), l.value = t;
145
152
  }
146
- return (n, r) => (S(), o("div", null, [s("div", q, [u(K, { "q-map": t.qMap }, null, 8, ["q-map"]), l.value ? (S(), o("div", J, [s("button", {
153
+ return (n, r) => (S(), o("div", null, [s("div", de, [u(X, { "q-map": t.qMap }, null, 8, ["q-map"]), l.value ? (S(), o("div", pe, [s("button", {
147
154
  type: "button",
148
155
  class: "inline-flex items-center justify-center gap-2 min-h-9 px-3.5 py-2 qmap-button",
149
156
  "aria-label": "Add item",
150
157
  onClick: r[1] ||= (e) => d()
151
- }, "+")])) : (S(), o("div", te, [s("button", {
158
+ }, "+")])) : (S(), o("div", fe, [s("button", {
152
159
  type: "button",
153
160
  class: "inline-flex items-center justify-center gap-2 min-h-9 px-3.5 py-2 qmap-button",
154
161
  "aria-label": "Add item",
155
162
  onClick: r[0] ||= (e) => {
156
163
  l.value = [], d();
157
164
  }
158
- }, "+")]))]), !l.value || !l.value.length ? (S(), o("div", ne, [...r[2] ||= [s("i", null, "Not set", -1)]])) : (S(), o("div", re, [t.qMap.item ? (S(), o("div", ie, [s("div", Y, [(S(!0), o(e, null, T(l.value, (e, n) => (S(), o("div", ae, [s("div", oe, [u(Q, {
165
+ }, "+")]))]), !l.value || !l.value.length ? (S(), o("div", me, [...r[2] ||= [s("i", null, "Not set", -1)]])) : (S(), o("div", he, [t.qMap.item ? (S(), o("div", ge, [s("div", _e, [(S(!0), o(e, null, T(l.value, (e, n) => (S(), o("div", ve, [s("div", ye, [u(Q, {
159
166
  qMap: t.qMap.item,
160
167
  modelValue: l.value[n],
161
168
  "onUpdate:modelValue": [(e) => l.value[n] = e, (e) => f(n, e)],
@@ -174,7 +181,7 @@ var ee = /* @__PURE__ */ f({
174
181
  class: "inline-flex items-center justify-center min-w-8 min-h-8 p-1 qmap-icon-button qmap-danger",
175
182
  "aria-label": "Remove item",
176
183
  onClick: (e) => m(n)
177
- }, [...r[3] ||= [s("i", { class: "fa fa-trash" }, null, -1)]], 8, se)]))), 256))])])) : t.qMap.items ? (S(), o("div", ce, [(S(!0), o(e, null, T(l.value, (n, a) => (S(), o("div", le, [s("div", ue, [(S(!0), o(e, null, T(t.qMap.items, (e) => (S(), i(Q, {
184
+ }, [...r[3] ||= [s("i", { class: "fa fa-trash" }, null, -1)]], 8, be)]))), 256))])])) : t.qMap.items ? (S(), o("div", xe, [(S(!0), o(e, null, T(l.value, (n, a) => (S(), o("div", Se, [s("div", Ce, [(S(!0), o(e, null, T(t.qMap.items, (e) => (S(), i(Q, {
178
185
  qMap: e,
179
186
  modelValue: l.value[a],
180
187
  "onUpdate:modelValue": [(e) => l.value[a] = e, (e) => f(a, e)],
@@ -195,13 +202,13 @@ var ee = /* @__PURE__ */ f({
195
202
  class: "inline-flex items-center justify-center min-w-8 min-h-8 p-1 qmap-icon-button qmap-danger",
196
203
  "aria-label": "Remove item",
197
204
  onClick: (e) => m(a)
198
- }, [...r[4] ||= [s("i", { class: "fa fa-times" }, null, -1)]], 8, de)]))), 256))])) : a("", !0)]))]));
205
+ }, [...r[4] ||= [s("i", { class: "fa fa-times" }, null, -1)]], 8, we)]))), 256))])) : a("", !0)]))]));
199
206
  }
200
- }), pe = { class: "flex items-center gap-1" }, me = [
207
+ }), Ee = { class: "flex items-center gap-1" }, De = [
201
208
  "aria-checked",
202
209
  "aria-label",
203
210
  "disabled"
204
- ], he = /*@__PURE__*/ f({
211
+ ], Oe = /*@__PURE__*/ f({
205
212
  __name: "ToggleSwitch",
206
213
  props: {
207
214
  modelValue: { type: Boolean },
@@ -225,44 +232,47 @@ var ee = /* @__PURE__ */ f({
225
232
  a.value === !1 && "slider-unchecked",
226
233
  a.value === void 0 && "slider-indeterminate"
227
234
  ].filter(Boolean).join(" "));
228
- return (t, n) => (S(), o("span", pe, [s("button", {
235
+ return (t, n) => (S(), o("span", Ee, [s("button", {
229
236
  type: "button",
230
237
  class: g(["toggle-root", l.value]),
231
238
  onClick: c,
232
239
  "aria-checked": String(a.value),
233
240
  "aria-label": e.ariaLabel,
234
241
  disabled: e.disabled
235
- }, [s("span", { class: g(["toggle-slider", u.value]) }, null, 2)], 10, me), E(t.$slots, "default", {}, void 0, !0)]));
242
+ }, [s("span", { class: g(["toggle-slider", u.value]) }, null, 2)], 10, De), E(t.$slots, "default", {}, void 0, !0)]));
236
243
  }
237
- }), ge = (e, t) => {
244
+ }), ke = (e, t) => {
238
245
  let n = e.__vccOpts || e;
239
246
  for (let [e, r] of t) n[e] = r;
240
247
  return n;
241
- }, _e = /*#__PURE__*/ ge(he, [["__scopeId", "data-v-edf9fc7d"]]), ve = {
248
+ }, Ae = /*#__PURE__*/ ke(Oe, [["__scopeId", "data-v-7ac41677"]]), je = {
242
249
  key: 0,
243
250
  class: "inline-flex items-center gap-2"
244
- }, ye = ["for"], be = {
251
+ }, Me = ["for"], Ne = {
245
252
  key: 0,
246
253
  class: "qmap-required"
247
- }, xe = {
254
+ }, Pe = {
248
255
  key: 1,
249
- class: "qmap-required"
250
- }, Se = {
256
+ class: "qmap-required && value == undefined"
257
+ }, Fe = {
251
258
  key: 2,
252
- class: "qmap-button-field sm:flex items-center"
253
- }, Ce = { class: "sm:w-1/2 md:w-1/4 lg:w-1/5" }, we = {
259
+ class: "qmap-button-field lg:flex items-center"
260
+ }, Ie = { class: "lg:w-1/2 xl:w-1/4" }, Le = {
254
261
  key: 0,
255
262
  class: "qmap-required"
256
- }, Te = {
257
- class: "btn-group sm:w-1/2 md:w-2/4 lg:w-1/4 flex",
263
+ }, Re = {
264
+ key: 0,
265
+ class: "fa fa-asterisk"
266
+ }, ze = {
267
+ class: "btn-group lg:w-1/2 xl:w-1/4 flex",
258
268
  role: "group"
259
- }, Ee = ["aria-pressed", "disabled"], De = ["aria-pressed", "disabled"], Oe = ["for"], ke = ["id", "disabled"], Ae = {
269
+ }, Be = ["aria-pressed", "disabled"], Ve = ["aria-pressed", "disabled"], He = ["for"], Ue = ["id", "disabled"], We = {
260
270
  key: 0,
261
271
  class: "qmap-required"
262
- }, je = {
272
+ }, Ge = {
263
273
  key: 1,
264
- class: "qmap-required"
265
- }, Me = /* @__PURE__ */ f({
274
+ class: "qmap-required && value == undefined"
275
+ }, Ke = /* @__PURE__ */ f({
266
276
  __name: "qBool",
267
277
  props: {
268
278
  qMap: {},
@@ -277,7 +287,7 @@ var ee = /* @__PURE__ */ f({
277
287
  emits: ["qmap_change", "qmap_subquestions"],
278
288
  setup(e, { emit: t }) {
279
289
  let n = e, r = t, c = w(n.model[n.qMap.id]);
280
- I(c, (e) => r("qmap_subquestions", e === !0 ? n.qMap.onPos : e === !1 ? n.qMap.onNeg : void 0)), I(() => n.model, (e) => c.value = e[n.qMap.id]), v(() => r("qmap_subquestions", c.value === !0 ? n.qMap.onPos : c.value === !1 ? n.qMap.onNeg : void 0));
290
+ F(c, (e) => r("qmap_subquestions", e === !0 ? n.qMap.onPos : e === !1 ? n.qMap.onNeg : void 0)), F(() => n.model, (e) => c.value = e[n.qMap.id]), v(() => r("qmap_subquestions", c.value === !0 ? n.qMap.onPos : c.value === !1 ? n.qMap.onNeg : void 0));
281
291
  function l(e) {
282
292
  n.model[n.qMap.id] = e, r("qmap_change", {
283
293
  qMap: n.qMap,
@@ -287,61 +297,61 @@ var ee = /* @__PURE__ */ f({
287
297
  function d(e) {
288
298
  c.value = e, l(e);
289
299
  }
290
- return (t, n) => e.lite && e.readOnly ? (S(), o("span", ve, k(c.value ? "✓" : "□"), 1)) : e.qMap.style === "switch" ? (S(), o("label", {
300
+ return (t, n) => e.lite && e.readOnly ? (S(), o("span", je, k(c.value ? "✓" : "□"), 1)) : e.qMap.style === "switch" ? (S(), o("label", {
291
301
  key: 1,
292
302
  class: "inline-flex items-center gap-2 min-h-8 qmap-check-row",
293
303
  for: e.qMap.id
294
- }, [u(_e, {
304
+ }, [u(Ae, {
295
305
  modelValue: c.value,
296
306
  "onUpdate:modelValue": [n[0] ||= (e) => c.value = e, d],
297
307
  disabled: e.readOnly
298
- }, null, 8, ["modelValue", "disabled"]), e.lite ? e.qMap.required ? (S(), o("span", xe, [...n[6] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0) : (S(), i(K, {
308
+ }, null, 8, ["modelValue", "disabled"]), e.lite ? e.qMap.required ? (S(), o("span", Pe, [...n[6] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0) : (S(), i(X, {
299
309
  key: 0,
300
310
  "q-map": e.qMap
301
311
  }, {
302
- default: L(() => [e.qMap.required ? (S(), o("span", be, [...n[5] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0)]),
312
+ default: I(() => [e.qMap.required ? (S(), o("span", Ne, [...n[5] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0)]),
303
313
  _: 1
304
- }, 8, ["q-map"]))], 8, ye)) : e.qMap.style === "button" ? (S(), o("div", Se, [s("div", Ce, [u(K, { "q-map": e.qMap }, {
305
- default: L(() => [e.qMap.required ? (S(), o("span", we, [...n[7] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0)]),
314
+ }, 8, ["q-map"]))], 8, Me)) : e.qMap.style === "button" ? (S(), o("div", Fe, [s("div", Ie, [u(X, { "q-map": e.qMap }, {
315
+ default: I(() => [e.qMap.required ? (S(), o("span", Le, [c.value == null ? (S(), o("i", Re)) : a("", !0)])) : a("", !0)]),
306
316
  _: 1
307
- }, 8, ["q-map"])]), s("div", Te, [s("button", {
317
+ }, 8, ["q-map"])]), s("div", ze, [s("button", {
308
318
  type: "button",
309
319
  "aria-pressed": c.value === !0,
310
- class: g(["gap-2 flex-1 min-h-9 px-3.5 py-2 qmap-button", { "qmap-button-selected": c.value === !0 }]),
320
+ class: g(["gap-2 flex-1 min-h-9 px-3.5 py-2 qmap-button", { "bg-green-300 dark:bg-green-700 ": c.value === !0 }]),
311
321
  disabled: e.readOnly,
312
322
  onClick: n[1] ||= (e) => d(!0)
313
- }, k(e.qMap.pos || "Yes"), 11, Ee), s("button", {
323
+ }, k(e.qMap.pos || "Yes"), 11, Be), s("button", {
314
324
  type: "button",
315
325
  "aria-pressed": c.value === !1,
316
- class: g(["gap-2 flex-1 min-h-9 px-3.5 py-2 qmap-button", { "qmap-button-selected": c.value === !1 }]),
326
+ class: g(["gap-2 flex-1 min-h-9 px-3.5 py-2 qmap-button", { "bg-red-300 dark:bg-red-700": c.value === !1 }]),
317
327
  disabled: e.readOnly,
318
328
  onClick: n[2] ||= (e) => d(!1)
319
- }, k(e.qMap.neg || "No"), 11, De)])])) : (S(), o("label", {
329
+ }, k(e.qMap.neg || "No"), 11, Ve)])])) : (S(), o("label", {
320
330
  key: 3,
321
331
  class: "inline-flex items-center gap-2 min-h-8 my-2 qmap-check-row",
322
332
  for: e.qMap.id
323
- }, [R(s("input", {
333
+ }, [L(s("input", {
324
334
  id: e.qMap.id,
325
335
  "onUpdate:modelValue": n[3] ||= (e) => c.value = e,
326
336
  type: "checkbox",
327
337
  class: "qmap-checkbox",
328
338
  disabled: e.readOnly,
329
339
  onChange: n[4] ||= (e) => l(c.value)
330
- }, null, 40, ke), [[j, c.value]]), e.lite ? e.qMap.required && !c.value ? (S(), o("span", je, [...n[9] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0) : (S(), i(K, {
340
+ }, null, 40, Ue), [[ee, c.value]]), e.lite ? e.qMap.required && !c.value ? (S(), o("span", Ge, [...n[8] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0) : (S(), i(X, {
331
341
  key: 0,
332
342
  "q-map": e.qMap
333
343
  }, {
334
- default: L(() => [e.qMap.required && !c.value ? (S(), o("span", Ae, [...n[8] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0)]),
344
+ default: I(() => [e.qMap.required && !c.value ? (S(), o("span", We, [...n[7] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0)]),
335
345
  _: 1
336
- }, 8, ["q-map"]))], 8, Oe));
346
+ }, 8, ["q-map"]))], 8, He));
337
347
  }
338
- }), Ne = {
348
+ }), qe = {
339
349
  key: 0,
340
350
  class: "inline-flex shrink-0 items-center gap-1 qmap-control-prepend"
341
- }, Pe = {
351
+ }, Je = {
342
352
  key: 1,
343
353
  class: "inline-flex shrink-0 items-center gap-1 qmap-control-append"
344
- }, X = /* @__PURE__ */ f({
354
+ }, Z = /* @__PURE__ */ f({
345
355
  __name: "FieldControl",
346
356
  props: {
347
357
  invalid: { type: Boolean },
@@ -354,39 +364,39 @@ var ee = /* @__PURE__ */ f({
354
364
  "qmap-control-invalid": e.invalid,
355
365
  "qmap-control-disabled": e.disabled
356
366
  }]) }, [
357
- t.$slots.prepend ? (S(), o("div", Ne, [E(t.$slots, "prepend")])) : a("", !0),
367
+ t.$slots.prepend ? (S(), o("div", qe, [E(t.$slots, "prepend")])) : a("", !0),
358
368
  E(t.$slots, "default"),
359
- t.$slots.append ? (S(), o("div", Pe, [E(t.$slots, "append")])) : a("", !0)
369
+ t.$slots.append ? (S(), o("div", Je, [E(t.$slots, "append")])) : a("", !0)
360
370
  ], 2));
361
371
  }
362
- }), Fe = {
372
+ }), Ye = {
363
373
  key: 0,
364
374
  class: "inline-flex items-center gap-2"
365
- }, Ie = { class: "qmap-field flex flex-col gap-1.5 min-w-0 text-sm" }, Le = [
375
+ }, Xe = { class: "qmap-field flex flex-col gap-1.5 min-w-0 text-sm" }, Ze = [
366
376
  "aria-expanded",
367
377
  "aria-label",
368
378
  "disabled",
369
379
  "onKeydown"
370
- ], Re = {
380
+ ], Qe = {
371
381
  key: 0,
372
382
  class: "qmap-required",
373
383
  "aria-hidden": "true"
374
- }, ze = {
384
+ }, $e = {
375
385
  key: 1,
376
386
  class: "absolute z-50 top-full left-0 mt-1 w-9/10 overflow-hidden qmap-select-dropdown"
377
- }, Be = { class: "flex items-center gap-2 px-3 py-2 qmap-select-search-wrap" }, Ve = ["aria-multiselectable"], He = [
387
+ }, et = { class: "flex items-center gap-2 px-3 py-2 qmap-select-search-wrap" }, tt = ["aria-multiselectable"], nt = [
378
388
  "aria-selected",
379
389
  "onMouseenter",
380
390
  "onKeydown",
381
391
  "onClick"
382
- ], Ue = {
392
+ ], rt = {
383
393
  key: 0,
384
394
  class: "inline-flex w-4 justify-center",
385
395
  "aria-hidden": "true"
386
- }, We = { class: "flex-1 min-w-0" }, Ge = {
396
+ }, it = { class: "flex-1 min-w-0" }, at = {
387
397
  key: 0,
388
398
  class: "m-0 p-3 text-center qmap-select-empty"
389
- }, Ke = /* @__PURE__ */ f({
399
+ }, ot = /* @__PURE__ */ f({
390
400
  __name: "SimpleChoice",
391
401
  props: {
392
402
  modelValue: {},
@@ -398,138 +408,138 @@ var ee = /* @__PURE__ */ f({
398
408
  },
399
409
  emits: ["update:model-value"],
400
410
  setup(t, { emit: r }) {
401
- let d = t, f = r, p = w(), m = w(), v = [], x = w(!1), C = w(""), D = w(0), O = w([]), A = w(d.multi ? [] : void 0), j = `qmap-select-${Math.random().toString(36).slice(2)}`, M = {
411
+ let d = t, f = r, p = w(), m = w(), v = [], x = w(!1), C = w(""), D = w(0), O = w([]), A = w(d.multi ? [] : void 0), ee = `qmap-select-${Math.random().toString(36).slice(2)}`, j = {
402
412
  title: "Not set",
403
413
  value: null,
404
414
  icon: "fa fa-ban",
405
415
  colour: "#71717a"
406
- }, N = n(() => {
416
+ }, M = n(() => {
407
417
  let e = C.value.trim().toLocaleLowerCase();
408
- return e ? O.value.filter((t) => U(t).toLocaleLowerCase().includes(e)) : O.value;
409
- }), F = n(() => d.multi ? N.value : [M, ...N.value]), V = n(() => d.multi ? d.qMap.icon : A.value?.icon), H = n(() => d.multi ? (A.value || []).map((e) => U(e)).join(", ") || "Select…" : A.value?.value == null ? "Not set" : U(A.value));
410
- I(() => d.qMap.values, ee, {
418
+ return e ? O.value.filter((t) => H(t).toLocaleLowerCase().includes(e)) : O.value;
419
+ }), P = n(() => d.multi ? M.value : [j, ...M.value]), B = n(() => d.multi ? d.qMap.icon : A.value?.icon), V = n(() => d.multi ? (A.value || []).map((e) => H(e)).join(", ") || "Select…" : A.value?.value == null ? "Not set" : H(A.value));
420
+ F(() => d.qMap.values, te, {
411
421
  immediate: !0,
412
422
  deep: !0
413
- }), I(() => d.modelValue, (e) => {
414
- A.value = W(e);
415
- }, { immediate: !0 }), I(() => d.multi, () => {
416
- A.value = W(d.modelValue), q();
417
- }), I(N, (e) => {
418
- D.value = Math.min(D.value, Math.max(0, F.value.length - 1));
419
- }), I(C, () => {
423
+ }), F(() => d.modelValue, (e) => {
424
+ A.value = U(e);
425
+ }, { immediate: !0 }), F(() => d.multi, () => {
426
+ A.value = U(d.modelValue), G();
427
+ }), F(M, (e) => {
428
+ D.value = Math.min(D.value, Math.max(0, P.value.length - 1));
429
+ }), F(C, () => {
420
430
  D.value = 0;
421
431
  });
422
- function U(e) {
432
+ function H(e) {
423
433
  return String(e.title ?? e.value ?? "Not set");
424
434
  }
425
- function ee() {
435
+ function te() {
426
436
  O.value = (d.qMap.values || []).map((e) => ({
427
437
  ...e,
428
438
  title: e.title || String(e.value ?? "Not set")
429
- })), A.value = W(d.modelValue);
439
+ })), A.value = U(d.modelValue);
430
440
  }
431
- function W(e) {
432
- return d.multi ? Array.isArray(e) ? O.value.filter((t) => e.some((e) => Object.is(e, t.value))) : [] : O.value.find((t) => Object.is(t.value, e)) || M;
441
+ function U(e) {
442
+ return d.multi ? Array.isArray(e) ? O.value.filter((t) => e.some((e) => Object.is(e, t.value))) : [] : O.value.find((t) => Object.is(t.value, e)) || j;
433
443
  }
434
- function G(e) {
444
+ function W(e) {
435
445
  return d.multi ? (A.value || []).some((t) => Object.is(t.value, e.value)) : e.value == null ? A.value?.value == null : Object.is(A.value?.value, e.value);
436
446
  }
437
- function q() {
447
+ function G() {
438
448
  f("update:model-value", d.multi ? (A.value || []).map((e) => e.value) : A.value?.value);
439
449
  }
440
- function te() {
450
+ function K() {
441
451
  d.readOnly || x.value || (x.value = !0, C.value = "", D.value = 0, h(() => m.value?.focus()));
442
452
  }
443
- function J() {
453
+ function q() {
444
454
  x.value = !1, C.value = "";
445
455
  }
446
456
  function ne(e) {
447
457
  if (d.multi) {
448
458
  let t = A.value || [];
449
- A.value = G(e) ? t.filter((t) => !Object.is(t.value, e.value)) : [...t, e], q();
459
+ A.value = W(e) ? t.filter((t) => !Object.is(t.value, e.value)) : [...t, e], G();
450
460
  return;
451
461
  }
452
- A.value = e, q(), J();
462
+ A.value = e, G(), q();
453
463
  }
454
464
  function re() {
455
465
  A.value = d.multi ? [] : {
456
466
  title: "Not set",
457
467
  value: null
458
- }, q(), d.multi || J();
468
+ }, G(), d.multi || q();
459
469
  }
460
470
  function ie(e, t) {
461
471
  t instanceof HTMLButtonElement && (v[e] = t);
462
472
  }
463
- function Y(e) {
464
- F.value.length && (D.value = (e + F.value.length) % F.value.length, h(() => v[D.value]?.focus()));
473
+ function J(e) {
474
+ P.value.length && (D.value = (e + P.value.length) % P.value.length, h(() => v[D.value]?.focus()));
465
475
  }
466
476
  function ae(e) {
467
- e.key === "ArrowDown" ? (e.preventDefault(), Y(D.value)) : e.key === "Escape" ? (e.preventDefault(), J()) : e.key === "Enter" && F.value[D.value] && (e.preventDefault(), ne(F.value[D.value]));
477
+ e.key === "ArrowDown" ? (e.preventDefault(), J(D.value)) : e.key === "Escape" ? (e.preventDefault(), q()) : e.key === "Enter" && P.value[D.value] && (e.preventDefault(), ne(P.value[D.value]));
468
478
  }
469
479
  function oe(e, t) {
470
- e.key === "ArrowDown" ? (e.preventDefault(), Y(t + 1)) : e.key === "ArrowUp" ? (e.preventDefault(), Y(t - 1)) : e.key === "Escape" ? (e.preventDefault(), J()) : e.key === "Tab" && !e.shiftKey && t === F.value.length - 1 && J();
480
+ e.key === "ArrowDown" ? (e.preventDefault(), J(t + 1)) : e.key === "ArrowUp" ? (e.preventDefault(), J(t - 1)) : e.key === "Escape" ? (e.preventDefault(), q()) : e.key === "Tab" && !e.shiftKey && t === P.value.length - 1 && q();
471
481
  }
472
- function se(e) {
473
- p.value && !p.value.contains(e.target) && J();
482
+ function Y(e) {
483
+ p.value && !p.value.contains(e.target) && q();
474
484
  }
475
- return b(() => document.addEventListener("pointerdown", se)), y(() => document.removeEventListener("pointerdown", se)), (n, r) => t.lite && t.readOnly ? (S(), o("div", Fe, [A.value?.icon ? (S(), o("i", {
485
+ return b(() => document.addEventListener("pointerdown", Y)), y(() => document.removeEventListener("pointerdown", Y)), (n, r) => t.lite && t.readOnly ? (S(), o("div", Ye, [A.value?.icon ? (S(), o("i", {
476
486
  key: 0,
477
487
  class: g(A.value.icon),
478
488
  style: _({ color: A.value.colour }),
479
489
  "aria-hidden": "true"
480
- }, null, 6)) : a("", !0), l(" " + k(H.value), 1)])) : (S(), o("div", {
490
+ }, null, 6)) : a("", !0), l(" " + k(V.value), 1)])) : (S(), o("div", {
481
491
  key: 1,
482
492
  ref_key: "root",
483
493
  ref: p,
484
494
  class: "flex flex-col relative w-full gap-1 min-w-0 min-h-10"
485
495
  }, [
486
- t.lite ? a("", !0) : (S(), i(K, {
496
+ t.lite ? a("", !0) : (S(), i(X, {
487
497
  key: 0,
488
498
  "q-map": t.qMap
489
499
  }, null, 8, ["q-map"])),
490
- s("label", Ie, [u(X, { disabled: t.readOnly }, c({
491
- append: L(() => [
492
- t.required && (!A.value || A.value?.value == null) ? (S(), o("span", Re, [...r[2] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0),
500
+ s("label", Xe, [u(Z, { disabled: t.readOnly }, c({
501
+ append: I(() => [
502
+ t.required && (!A.value || A.value?.value == null) ? (S(), o("span", Qe, [...r[2] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0),
493
503
  (t.multi ? A.value?.length : A.value?.value != null) && !t.readOnly ? (S(), o("button", {
494
504
  key: 1,
495
505
  type: "button",
496
506
  class: "inline-flex items-center justify-center min-w-8 min-h-8 p-1 qmap-icon-button qmap-select-clear",
497
507
  "aria-label": "Clear selection",
498
- onClick: B(re, ["stop"])
508
+ onClick: z(re, ["stop"])
499
509
  }, [...r[3] ||= [s("i", { class: "fa fa-times" }, null, -1)]])) : a("", !0),
500
510
  s("i", {
501
511
  class: g(["fa fa-chevron-down qmap-select-chevron", { "qmap-select-chevron-open": x.value }]),
502
512
  "aria-hidden": "true"
503
513
  }, null, 2)
504
514
  ]),
505
- default: L(() => [s("button", {
515
+ default: I(() => [s("button", {
506
516
  type: "button",
507
517
  class: "qmap-input qmap-select-trigger flex flex-1 min-w-0 min-h-0 items-center justify-start px-0 py-2 text-left",
508
518
  role: "combobox",
509
519
  "aria-expanded": x.value,
510
- "aria-controls": j,
520
+ "aria-controls": ee,
511
521
  "aria-label": t.qMap.title || t.qMap.id,
512
522
  disabled: t.readOnly,
513
- onClick: r[0] ||= (e) => x.value ? J() : te(),
514
- onKeydown: [z(B(te, ["prevent"]), ["down"]), z(B(J, ["prevent"]), ["esc"])]
523
+ onClick: r[0] ||= (e) => x.value ? q() : K(),
524
+ onKeydown: [R(z(K, ["prevent"]), ["down"]), R(z(q, ["prevent"]), ["esc"])]
515
525
  }, [s("span", { class: g(["flex flex-1 min-w-0 items-center flex-wrap gap-1 overflow-hidden", { "qmap-select-placeholder": !d.multi && A.value?.value == null }]) }, [t.multi && A.value?.length ? (S(!0), o(e, { key: 0 }, T(A.value, (e) => (S(), o("span", {
516
526
  key: String(e.value),
517
527
  class: "inline-flex max-w-full items-center qmap-select-chip"
518
- }, k(U(e)), 1))), 128)) : (S(), o(e, { key: 1 }, [l(k(H.value), 1)], 64))], 2)], 40, Le)]),
528
+ }, k(H(e)), 1))), 128)) : (S(), o(e, { key: 1 }, [l(k(V.value), 1)], 64))], 2)], 40, Ze)]),
519
529
  _: 2
520
- }, [V.value || t.qMap.icon ? {
530
+ }, [B.value || t.qMap.icon ? {
521
531
  name: "prepend",
522
- fn: L(() => [E(n.$slots, "default"), s("i", {
523
- class: g(V.value),
532
+ fn: I(() => [E(n.$slots, "default"), s("i", {
533
+ class: g(B.value),
524
534
  style: _({ color: A.value?.colour }),
525
535
  "aria-hidden": "true"
526
536
  }, null, 6)]),
527
537
  key: "0"
528
538
  } : void 0]), 1032, ["disabled"])]),
529
- x.value ? (S(), o("div", ze, [s("div", Be, [r[4] ||= s("i", {
539
+ x.value ? (S(), o("div", $e, [s("div", et, [r[4] ||= s("i", {
530
540
  class: "fa fa-search qmap-select-search-icon",
531
541
  "aria-hidden": "true"
532
- }, null, -1), R(s("input", {
542
+ }, null, -1), L(s("input", {
533
543
  ref_key: "searchInput",
534
544
  ref: m,
535
545
  "onUpdate:modelValue": r[1] ||= (e) => C.value = e,
@@ -539,12 +549,12 @@ var ee = /* @__PURE__ */ f({
539
549
  autocomplete: "off",
540
550
  "aria-label": "Search options",
541
551
  onKeydown: ae
542
- }, null, 544), [[P, C.value]])]), s("div", {
543
- id: j,
552
+ }, null, 544), [[N, C.value]])]), s("div", {
553
+ id: ee,
544
554
  class: "max-h-64 overflow-auto p-1",
545
555
  role: "listbox",
546
556
  "aria-multiselectable": t.multi || void 0
547
- }, [(S(!0), o(e, null, T(F.value, (e, r) => (S(), o("button", {
557
+ }, [(S(!0), o(e, null, T(P.value, (e, r) => (S(), o("button", {
548
558
  key: `${r}-${String(e.value)}`,
549
559
  ref_for: !0,
550
560
  ref: (e) => ie(r, e),
@@ -552,59 +562,59 @@ var ee = /* @__PURE__ */ f({
552
562
  role: "option",
553
563
  class: g(["flex w-full min-h-9 items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm qmap-select-option", {
554
564
  "qmap-select-option-active": D.value === r,
555
- "qmap-select-option-selected": G(e)
565
+ "qmap-select-option-selected": W(e)
556
566
  }]),
557
- "aria-selected": G(e),
567
+ "aria-selected": W(e),
558
568
  onMouseenter: (e) => D.value = r,
559
569
  onKeydown: (e) => oe(e, r),
560
570
  onClick: (t) => ne(e)
561
571
  }, [E(n.$slots, "option", {
562
572
  option: e,
563
- selected: G(e),
573
+ selected: W(e),
564
574
  active: D.value === r
565
575
  }, () => [
566
- t.multi ? (S(), o("span", Ue, k(G(e) ? "✓" : ""), 1)) : a("", !0),
576
+ t.multi ? (S(), o("span", rt, k(W(e) ? "✓" : ""), 1)) : a("", !0),
567
577
  e.icon ? (S(), o("i", {
568
578
  key: 1,
569
579
  class: g([e.icon, "w-4 text-center"]),
570
580
  style: _({ color: e.colour }),
571
581
  "aria-hidden": "true"
572
582
  }, null, 6)) : a("", !0),
573
- s("span", We, k(U(e)), 1)
574
- ])], 42, He))), 128)), F.value.length ? a("", !0) : (S(), o("p", Ge, "No options found."))], 8, Ve)])) : a("", !0)
583
+ s("span", it, k(H(e)), 1)
584
+ ])], 42, nt))), 128)), P.value.length ? a("", !0) : (S(), o("p", at, "No options found."))], 8, tt)])) : a("", !0)
575
585
  ], 512));
576
586
  }
577
- }), qe = {
587
+ }), st = {
578
588
  key: 0,
579
589
  class: "block"
580
- }, Je = /* @__PURE__ */ f({
590
+ }, ct = /* @__PURE__ */ f({
581
591
  __name: "icon-block",
582
592
  props: { qMap: {} },
583
593
  setup(e) {
584
594
  let t = e, r = n(() => [t.qMap.icon || "", t.qMap.colour || ""].reduce((e, t) => e + " " + t));
585
- return (t, n) => e.qMap.icon ? (S(), o("span", qe, [s("i", { class: g(r.value) }, null, 2)])) : a("", !0);
595
+ return (t, n) => e.qMap.icon ? (S(), o("span", st, [s("i", { class: g(r.value) }, null, 2)])) : a("", !0);
586
596
  }
587
- }), Ye = { key: 0 }, Xe = { class: "inline-flex items-center gap-2" }, Ze = [
597
+ }), lt = { key: 0 }, ut = { class: "inline-flex items-center gap-2" }, dt = [
588
598
  "name",
589
599
  "value",
590
600
  "disabled",
591
601
  "onChange"
592
- ], Qe = { class: "mt-1 inline-flex items-center gap-1" }, $e = { key: 1 }, et = { class: "inline-flex items-center gap-2 min-h-8 qmap-check-row" }, tt = [
602
+ ], ft = { class: "mt-1 inline-flex items-center gap-1" }, pt = { key: 1 }, mt = { class: "inline-flex items-center gap-2 min-h-8 qmap-check-row" }, ht = [
593
603
  "name",
594
604
  "value",
595
605
  "disabled",
596
606
  "onChange"
597
- ], nt = { class: "mt-1" }, rt = {
607
+ ], gt = { class: "mt-1" }, _t = {
598
608
  key: 2,
599
609
  class: "sm:flex items-center"
600
- }, it = { class: "sm:w-1/2 md:w-1/4" }, at = {
610
+ }, vt = { class: "sm:w-1/2 md:w-1/4" }, yt = {
601
611
  class: "btn-group sm:w-1/2 md:w-3/4 flex",
602
612
  role: "group"
603
- }, ot = [
613
+ }, bt = [
604
614
  "aria-pressed",
605
615
  "disabled",
606
616
  "onClick"
607
- ], st = /* @__PURE__ */ f({
617
+ ], xt = /* @__PURE__ */ f({
608
618
  __name: "qChoice",
609
619
  props: {
610
620
  qMap: {},
@@ -619,7 +629,7 @@ var ee = /* @__PURE__ */ f({
619
629
  emits: ["qmap_change", "qmap_subquestions"],
620
630
  setup(t, { emit: n }) {
621
631
  let r = t, c = n, d = w();
622
- I(() => r.model, (e) => d.value = r.model[r.qMap.id]), v(() => {
632
+ F(() => r.model, (e) => d.value = r.model[r.qMap.id]), v(() => {
623
633
  d.value = r.model[r.qMap.id], f(d.value);
624
634
  });
625
635
  function f(e) {
@@ -632,32 +642,32 @@ var ee = /* @__PURE__ */ f({
632
642
  value: e
633
643
  }), f(e);
634
644
  }
635
- return (n, r) => t.qMap.style == "radio" ? (S(), o("div", Ye, [u(K, { "q-map": t.qMap }, null, 8, ["q-map"]), s("div", Xe, [(S(!0), o(e, null, T(t.qMap.values, (e) => (S(), o("div", {
645
+ return (n, r) => t.qMap.style == "radio" ? (S(), o("div", lt, [u(X, { "q-map": t.qMap }, null, 8, ["q-map"]), s("div", ut, [(S(!0), o(e, null, T(t.qMap.values, (e) => (S(), o("div", {
636
646
  key: String(e.value),
637
647
  class: "inline-flex items-center gap-0 min-h-8 qmap-check-row"
638
- }, [R(s("input", {
648
+ }, [L(s("input", {
639
649
  "onUpdate:modelValue": r[0] ||= (e) => d.value = e,
640
650
  type: "radio",
641
651
  name: t.qMap.id,
642
652
  value: e.value,
643
653
  disabled: t.readOnly,
644
654
  onChange: (t) => p(e.value)
645
- }, null, 40, Ze), [[M, d.value]]), s("div", Qe, [e.icon ? (S(), o("i", {
655
+ }, null, 40, dt), [[j, d.value]]), s("div", ft, [e.icon ? (S(), o("i", {
646
656
  key: 0,
647
657
  class: g(e.icon),
648
658
  "aria-hidden": "true"
649
- }, null, 2)) : a("", !0), l(k(e.title || e.value), 1)])]))), 128))])])) : t.qMap.style == "v-radio" ? (S(), o("div", $e, [u(K, { "q-map": t.qMap }, null, 8, ["q-map"]), (S(!0), o(e, null, T(t.qMap.values, (e) => (S(), o("div", null, [s("label", et, [R(s("input", {
659
+ }, null, 2)) : a("", !0), l(k(e.title || e.value), 1)])]))), 128))])])) : t.qMap.style == "v-radio" ? (S(), o("div", pt, [u(X, { "q-map": t.qMap }, null, 8, ["q-map"]), (S(!0), o(e, null, T(t.qMap.values, (e) => (S(), o("div", null, [s("label", mt, [L(s("input", {
650
660
  "onUpdate:modelValue": r[1] ||= (e) => d.value = e,
651
661
  type: "radio",
652
662
  name: t.qMap.id,
653
663
  value: e.value,
654
664
  disabled: t.readOnly,
655
665
  onChange: (t) => p(e.value)
656
- }, null, 40, tt), [[M, d.value]]), s("div", nt, [e.icon ? (S(), o("i", {
666
+ }, null, 40, ht), [[j, d.value]]), s("div", gt, [e.icon ? (S(), o("i", {
657
667
  key: 0,
658
668
  class: g(e.icon),
659
669
  "aria-hidden": "true"
660
- }, null, 2)) : a("", !0), l(k(e.title || e.value), 1)])])]))), 256))])) : t.qMap.style == "buttons" ? (S(), o("div", rt, [s("div", it, [u(K, { "q-map": t.qMap }, null, 8, ["q-map"])]), s("div", at, [(S(!0), o(e, null, T(t.qMap.values, (e) => (S(), o("button", {
670
+ }, null, 2)) : a("", !0), l(k(e.title || e.value), 1)])])]))), 256))])) : t.qMap.style == "buttons" ? (S(), o("div", _t, [s("div", vt, [u(X, { "q-map": t.qMap }, null, 8, ["q-map"])]), s("div", yt, [(S(!0), o(e, null, T(t.qMap.values, (e) => (S(), o("button", {
661
671
  key: String(e.value),
662
672
  type: "button",
663
673
  class: g(["flex-1 inline-flex items-center justify-center gap-2 min-h-9 px-3.5 py-2 qmap-button", { "qmap-button-selected": d.value === e.value }]),
@@ -670,7 +680,7 @@ var ee = /* @__PURE__ */ f({
670
680
  key: 0,
671
681
  class: g(e.icon),
672
682
  "aria-hidden": "true"
673
- }, null, 2)) : a("", !0), l(k(e.title || e.value), 1)], 10, ot))), 128))])])) : (S(), i(Ke, {
683
+ }, null, 2)) : a("", !0), l(k(e.title || e.value), 1)], 10, bt))), 128))])])) : (S(), i(ot, {
674
684
  key: 3,
675
685
  modelValue: d.value,
676
686
  "onUpdate:modelValue": [r[2] ||= (e) => d.value = e, p],
@@ -679,7 +689,7 @@ var ee = /* @__PURE__ */ f({
679
689
  lite: t.lite,
680
690
  required: t.qMap.required
681
691
  }, {
682
- default: L(() => [u(Je, { qMap: t.qMap }, null, 8, ["qMap"])]),
692
+ default: I(() => [u(ct, { qMap: t.qMap }, null, 8, ["qMap"])]),
683
693
  _: 1
684
694
  }, 8, [
685
695
  "modelValue",
@@ -689,14 +699,14 @@ var ee = /* @__PURE__ */ f({
689
699
  "required"
690
700
  ]));
691
701
  }
692
- }), ct = {
702
+ }), St = {
693
703
  key: 0,
694
704
  class: "inline-flex items-center gap-2"
695
- }, lt = ["for"], ut = ["value", "disabled"], dt = [
705
+ }, Ct = ["for"], wt = ["value", "disabled"], Tt = [
696
706
  "id",
697
707
  "value",
698
708
  "readonly"
699
- ], ft = /* @__PURE__ */ f({
709
+ ], Et = /* @__PURE__ */ f({
700
710
  __name: "qColour",
701
711
  props: {
702
712
  qMap: {},
@@ -717,47 +727,47 @@ var ee = /* @__PURE__ */ f({
717
727
  value: e
718
728
  });
719
729
  }
720
- return (t, n) => e.lite && e.readOnly ? (S(), o("div", ct, [s("span", {
730
+ return (t, n) => e.lite && e.readOnly ? (S(), o("div", St, [s("span", {
721
731
  class: "inline-block w-4 h-4 rounded-full qmap-colour-swatch",
722
732
  style: _({ backgroundColor: a.value })
723
733
  }, null, 4), l(k(a.value), 1)])) : (S(), o("label", {
724
734
  key: 1,
725
735
  class: "qmap-field flex flex-col gap-1.5 text-sm",
726
736
  for: e.qMap.id
727
- }, [u(K, { "q-map": e.qMap }, null, 8, ["q-map"]), u(X, {
737
+ }, [u(X, { "q-map": e.qMap }, null, 8, ["q-map"]), u(Z, {
728
738
  disabled: e.readOnly,
729
739
  class: ""
730
740
  }, c({
731
- append: L(() => [s("input", {
741
+ append: I(() => [s("input", {
732
742
  value: a.value || "#000000",
733
743
  type: "color",
734
744
  class: "shrink-0 w-7 h-7 p-0.5 qmap-color-picker border-none",
735
745
  "aria-label": "Choose color",
736
746
  disabled: e.readOnly,
737
747
  onInput: n[0] ||= (e) => d(e.target.value)
738
- }, null, 40, ut)]),
739
- default: L(() => [s("input", {
748
+ }, null, 40, wt)]),
749
+ default: I(() => [s("input", {
740
750
  id: e.qMap.id,
741
751
  value: a.value,
742
752
  type: "text",
743
753
  class: "qmap-input flex-1 px-0 py-2",
744
754
  readonly: e.readOnly,
745
755
  onChange: n[1] ||= (e) => d(e.target.value)
746
- }, null, 40, dt)]),
756
+ }, null, 40, Tt)]),
747
757
  _: 2
748
758
  }, [e.qMap.icon ? {
749
759
  name: "prepend",
750
- fn: L(() => [u(Je, { qMap: e.qMap }, null, 8, ["qMap"])]),
760
+ fn: I(() => [u(ct, { qMap: e.qMap }, null, 8, ["qMap"])]),
751
761
  key: "0"
752
- } : void 0]), 1032, ["disabled"])], 8, lt));
762
+ } : void 0]), 1032, ["disabled"])], 8, Ct));
753
763
  }
754
- }), pt = {
764
+ }), Dt = {
755
765
  key: 0,
756
766
  class: "calendar-modal"
757
- }, mt = { class: "calendar-dialog flex flex-col gap-2" }, ht = { class: "flex justify-between mb-2" }, gt = { class: "flex" }, _t = { class: "grid grid-cols-7" }, vt = ["onClick"], yt = {
767
+ }, Ot = { class: "calendar-dialog flex flex-col gap-2" }, kt = { class: "flex justify-between mb-2" }, At = { class: "flex" }, jt = { class: "grid grid-cols-7" }, Mt = ["onClick"], Nt = {
758
768
  key: 0,
759
769
  class: "calendar-time"
760
- }, bt = ["value"], xt = ["value"], St = /* @__PURE__ */ f({
770
+ }, Pt = ["value"], Ft = ["value"], It = /* @__PURE__ */ f({
761
771
  __name: "CalendarPicker",
762
772
  props: {
763
773
  modelValue: {},
@@ -775,27 +785,27 @@ var ee = /* @__PURE__ */ f({
775
785
  "Thu",
776
786
  "Fri",
777
787
  "Sat"
778
- ], C = n(() => h.value), D = n(() => _.value), O = n(() => new Date(C.value, D.value).toLocaleString("default", { month: "long" })), j = n(() => new Date(C.value, D.value + 1, 0).getDate()), M = n(() => Array(new Date(C.value, D.value, 1).getDay()).fill(0));
779
- function P(e) {
788
+ ], C = n(() => h.value), D = n(() => _.value), O = n(() => new Date(C.value, D.value).toLocaleString("default", { month: "long" })), ee = n(() => new Date(C.value, D.value + 1, 0).getDate()), j = n(() => Array(new Date(C.value, D.value, 1).getDay()).fill(0));
789
+ function N(e) {
780
790
  return console.log(D.value + " " + m.getMonth()), e === v.value && D.value === m.getMonth() && C.value === m.getFullYear();
781
791
  }
782
- function F(e) {
792
+ function P(e) {
783
793
  v.value = e, m = new Date(h.value, _.value, v.value, d.withTime ? y.value : 0, d.withTime ? b.value : 0, 0, 0);
784
794
  }
785
- function L() {
795
+ function I() {
786
796
  _.value === 0 ? (_.value = 11, --h.value) : --_.value;
787
797
  }
788
- function z() {
798
+ function R() {
789
799
  _.value === 11 ? (_.value = 0, h.value += 1) : _.value += 1;
790
800
  }
791
- function B() {
801
+ function z() {
792
802
  let e = new Date(h.value, _.value, v.value, d.withTime ? y.value : 0, d.withTime ? b.value : 0, 0, 0);
793
803
  f("update:modelValue", e.getTime()), p.value = !1;
794
804
  }
795
- function V() {
805
+ function B() {
796
806
  p.value = !1;
797
807
  }
798
- return I(() => d.modelValue, (e) => {
808
+ return F(() => d.modelValue, (e) => {
799
809
  if (e) {
800
810
  let t = new Date(e);
801
811
  h.value = t.getFullYear(), _.value = t.getMonth(), v.value = t.getDate(), y.value = t.getHours(), b.value = t.getMinutes();
@@ -811,76 +821,76 @@ var ee = /* @__PURE__ */ f({
811
821
  background: "none"
812
822
  },
813
823
  class: "qmap-button"
814
- }, [E(n.$slots, "default")]), (S(), i(t, { to: "body" }, [p.value ? (S(), o("div", pt, [s("div", mt, [
815
- s("div", ht, [
824
+ }, [E(n.$slots, "default")]), (S(), i(t, { to: "body" }, [p.value ? (S(), o("div", Dt, [s("div", Ot, [
825
+ s("div", kt, [
816
826
  s("button", {
817
- onClick: L,
827
+ onClick: I,
818
828
  class: "border-none bg-inherit qmap-button"
819
829
  }, [...c[3] ||= [s("i", { class: "fa fa-arrow-left" }, null, -1)]]),
820
830
  s("span", null, k(O.value) + " " + k(C.value), 1),
821
831
  s("button", {
822
- onClick: z,
832
+ onClick: R,
823
833
  class: "border-none bg-inherit qmap-button"
824
834
  }, [...c[4] ||= [s("i", { class: "fa fa-arrow-right" }, null, -1)]])
825
835
  ]),
826
- s("div", gt, [(S(), o(e, null, T(x, (e) => s("div", {
836
+ s("div", At, [(S(), o(e, null, T(x, (e) => s("div", {
827
837
  key: e,
828
838
  class: "w-1/7 text-center"
829
839
  }, k(e), 1)), 64))]),
830
- s("div", _t, [(S(!0), o(e, null, T(M.value, (e) => (S(), o("span", {
840
+ s("div", jt, [(S(!0), o(e, null, T(j.value, (e) => (S(), o("span", {
831
841
  key: "blank-" + e,
832
842
  class: ""
833
- }, "\xA0"))), 128)), (S(!0), o(e, null, T(j.value, (e) => (S(), o("button", {
843
+ }, "\xA0"))), 128)), (S(!0), o(e, null, T(ee.value, (e) => (S(), o("button", {
834
844
  key: "day-" + e,
835
845
  class: g(["p-2 border-none", {
836
- "bg-zinc-900 text-zinc-100 dark:bg-zinc-100 dark:text-zinc-900": P(e),
837
- "bg-zinc-100 text-zinc-900 dark:bg-zinc-900 dark:text-zinc-100": !P(e)
846
+ "bg-zinc-900 text-zinc-100 dark:bg-zinc-100 dark:text-zinc-900": N(e),
847
+ "bg-zinc-100 text-zinc-900 dark:bg-zinc-900 dark:text-zinc-100": !N(e)
838
848
  }]),
839
- onClick: (t) => F(e)
840
- }, k(e), 11, vt))), 128))]),
841
- r.withTime ? (S(), o("div", yt, [
842
- R(s("select", {
849
+ onClick: (t) => P(e)
850
+ }, k(e), 11, Mt))), 128))]),
851
+ r.withTime ? (S(), o("div", Nt, [
852
+ L(s("select", {
843
853
  "onUpdate:modelValue": c[1] ||= (e) => y.value = e,
844
854
  class: "qmap-input px-2 py-1"
845
855
  }, [(S(!0), o(e, null, T(A(l), (e) => (S(), o("option", {
846
856
  key: e,
847
857
  value: e
848
- }, k(String(e).padStart(2, "0")), 9, bt))), 128))], 512), [[N, y.value]]),
858
+ }, k(String(e).padStart(2, "0")), 9, Pt))), 128))], 512), [[M, y.value]]),
849
859
  c[5] ||= s("span", null, ":", -1),
850
- R(s("select", {
860
+ L(s("select", {
851
861
  "onUpdate:modelValue": c[2] ||= (e) => b.value = e,
852
862
  class: "qmap-input px-2 py-1"
853
863
  }, [(S(!0), o(e, null, T(A(u), (e) => (S(), o("option", {
854
864
  key: e,
855
865
  value: e
856
- }, k(String(e).padStart(2, "0")), 9, xt))), 128))], 512), [[N, b.value]])
866
+ }, k(String(e).padStart(2, "0")), 9, Ft))), 128))], 512), [[M, b.value]])
857
867
  ])) : a("", !0),
858
868
  s("div", { class: "flex justify-between" }, [s("button", {
859
- onClick: B,
869
+ onClick: z,
860
870
  class: "qmap-button p-2"
861
871
  }, "Ok"), s("button", {
862
- onClick: V,
872
+ onClick: B,
863
873
  class: "qmap-button"
864
874
  }, "Cancel")])
865
875
  ]), s("div", {
866
876
  class: "calendar-backdrop",
867
- onClick: V
877
+ onClick: B
868
878
  })])) : a("", !0)]))], 64));
869
879
  }
870
- }), Ct = [
880
+ }), Lt = [
871
881
  "placeholder",
872
882
  "readonly",
873
883
  "aria-invalid",
874
884
  "onKeydown"
875
- ], wt = {
885
+ ], Rt = {
876
886
  key: 0,
877
887
  class: "date-error",
878
888
  role: "status"
879
- }, Tt = {
889
+ }, zt = {
880
890
  key: 3,
881
891
  class: "date-required",
882
892
  "aria-hidden": "true"
883
- }, Et = /*#__PURE__*/ ge(/* @__PURE__ */ f({
893
+ }, Bt = /*#__PURE__*/ ke(/* @__PURE__ */ f({
884
894
  __name: "SimpleDate",
885
895
  props: {
886
896
  title: {},
@@ -906,35 +916,35 @@ var ee = /* @__PURE__ */ f({
906
916
  _.value = "", v.value = !1;
907
917
  return;
908
918
  }
909
- let t = e instanceof Date ? V.fromJSDate(e) : V.fromMillis(e);
919
+ let t = e instanceof Date ? B.fromJSDate(e) : B.fromMillis(e);
910
920
  _.value = t.setZone(r.timezone || "local").toFormat(m), v.value = !1, y.value = t.toMillis(), l("update:model-value", t.toMillis());
911
921
  }
912
- I(() => r.modelValue, b, { immediate: !0 });
922
+ F(() => r.modelValue, b, { immediate: !0 });
913
923
  function x() {
914
924
  if (!_.value) {
915
925
  v.value = !1;
916
926
  return;
917
927
  }
918
- let e = V.fromFormat(_.value, m, { zone: r.timezone || "local" });
928
+ let e = B.fromFormat(_.value, m, { zone: r.timezone || "local" });
919
929
  v.value = !e.isValid, e.isValid && (b(e.toMillis()), l("update:model-value", e.toMillis()));
920
930
  }
921
931
  function C() {
922
932
  _.value = "", v.value = !1, l("update:model-value", void 0);
923
933
  }
924
- return (t, n) => (S(), o("div", { class: g(["relative grid gap-1.5 text-sm date-field", r.class]) }, [u(X, {
934
+ return (t, n) => (S(), o("div", { class: g(["relative grid gap-1.5 text-sm date-field", r.class]) }, [u(Z, {
925
935
  class: "date-control",
926
936
  invalid: v.value,
927
937
  disabled: e.readOnly
928
938
  }, c({
929
- append: L(() => [
930
- v.value ? (S(), o("span", wt, "Invalid date")) : a("", !0),
931
- !e.readOnly && !e.lite ? (S(), i(St, {
939
+ append: I(() => [
940
+ v.value ? (S(), o("span", Rt, "Invalid date")) : a("", !0),
941
+ !e.readOnly && !e.lite ? (S(), i(It, {
932
942
  key: 1,
933
943
  withTime: !e.dateOnly,
934
944
  modelValue: y.value,
935
945
  "onUpdate:modelValue": [n[1] ||= (e) => y.value = e, b]
936
946
  }, {
937
- default: L(() => [...n[2] ||= [s("i", { class: "fa fa-calendar" }, null, -1)]]),
947
+ default: I(() => [...n[2] ||= [s("i", { class: "fa fa-calendar" }, null, -1)]]),
938
948
  _: 1
939
949
  }, 8, ["withTime", "modelValue"])) : a("", !0),
940
950
  e.clearable && _.value && !e.readOnly ? (S(), o("button", {
@@ -944,9 +954,9 @@ var ee = /* @__PURE__ */ f({
944
954
  "aria-label": "Clear date",
945
955
  onClick: C
946
956
  }, [...n[3] ||= [s("i", { class: "fa fa-times" }, null, -1)]])) : a("", !0),
947
- e.required ? (S(), o("span", Tt, [...n[4] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0)
957
+ e.required ? (S(), o("span", zt, [...n[4] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0)
948
958
  ]),
949
- default: L(() => [R(s("input", {
959
+ default: I(() => [L(s("input", {
950
960
  id: d,
951
961
  "onUpdate:modelValue": n[0] ||= (e) => _.value = e,
952
962
  type: "text",
@@ -955,19 +965,19 @@ var ee = /* @__PURE__ */ f({
955
965
  "aria-invalid": v.value,
956
966
  class: "min-w-0 flex-1 border-0 bg-transparent outline-none qmap-input",
957
967
  onBlur: x,
958
- onKeydown: z(B(x, ["prevent"]), ["enter"])
959
- }, null, 40, Ct), [[P, _.value]])]),
968
+ onKeydown: R(z(x, ["prevent"]), ["enter"])
969
+ }, null, 40, Lt), [[N, _.value]])]),
960
970
  _: 2
961
971
  }, [e.icon ? {
962
972
  name: "prepend",
963
- fn: L(() => [s("i", {
973
+ fn: I(() => [s("i", {
964
974
  class: g(e.icon),
965
975
  "aria-hidden": "true"
966
976
  }, null, 2)]),
967
977
  key: "0"
968
978
  } : void 0]), 1032, ["invalid", "disabled"]), E(t.$slots, "default", {}, void 0, !0)], 2));
969
979
  }
970
- }), [["__scopeId", "data-v-c327521a"]]), Dt = /* @__PURE__ */ f({
980
+ }), [["__scopeId", "data-v-c327521a"]]), Vt = /* @__PURE__ */ f({
971
981
  __name: "qDate",
972
982
  props: {
973
983
  qMap: {},
@@ -988,10 +998,10 @@ var ee = /* @__PURE__ */ f({
988
998
  value: e
989
999
  });
990
1000
  }
991
- return (n, r) => (S(), o(e, null, [t.lite ? a("", !0) : (S(), i(K, {
1001
+ return (n, r) => (S(), o(e, null, [t.lite ? a("", !0) : (S(), i(X, {
992
1002
  key: 0,
993
1003
  "q-map": t.qMap
994
- }, null, 8, ["q-map"])), u(Et, {
1004
+ }, null, 8, ["q-map"])), u(Bt, {
995
1005
  modelValue: l.value,
996
1006
  "onUpdate:modelValue": [r[0] ||= (e) => l.value = e, d],
997
1007
  icon: t.qMap.icon,
@@ -1002,10 +1012,7 @@ var ee = /* @__PURE__ */ f({
1002
1012
  "read-only": t.readOnly,
1003
1013
  dateOnly: t.qMap.type == "date",
1004
1014
  required: t.qMap.required && !l.value
1005
- }, {
1006
- default: L(() => [u(W, { "q-map": t.qMap }, null, 8, ["q-map"])]),
1007
- _: 1
1008
- }, 8, [
1015
+ }, null, 8, [
1009
1016
  "modelValue",
1010
1017
  "icon",
1011
1018
  "id",
@@ -1016,13 +1023,13 @@ var ee = /* @__PURE__ */ f({
1016
1023
  "required"
1017
1024
  ])], 64));
1018
1025
  }
1019
- }), Ot = ["aria-orientation"], kt = ["aria-selected", "onClick"], At = ["name"], jt = {
1026
+ }), Ht = ["aria-orientation"], Ut = ["aria-selected", "onClick"], Wt = ["name"], Gt = {
1020
1027
  key: 0,
1021
1028
  class: "flex flex-1 flex-col min-w-0 relative"
1022
- }, Mt = {
1029
+ }, Kt = {
1023
1030
  key: 1,
1024
1031
  class: "flex flex-1 flex-col min-w-0 relative"
1025
- }, Nt = { class: "group-scroll flex-1 min-h-0 overflow-auto" }, Pt = { class: "flex flex-col gap-2" }, Ft = /* @__PURE__ */ f({
1032
+ }, qt = { class: "group-scroll flex-1 min-h-0 overflow-auto" }, Jt = { class: "flex flex-col gap-2" }, Yt = /* @__PURE__ */ f({
1026
1033
  __name: "qGroup",
1027
1034
  props: {
1028
1035
  qMap: {},
@@ -1045,7 +1052,7 @@ var ee = /* @__PURE__ */ f({
1045
1052
  }),
1046
1053
  style: _(t.qMap.ui?.flex ? void 0 : { height: (t.qMap.ui?.height || 400) + "px" })
1047
1054
  }, [
1048
- u(K, { "q-map": t.qMap }, null, 8, ["q-map"]),
1055
+ u(X, { "q-map": t.qMap }, null, 8, ["q-map"]),
1049
1056
  s("div", {
1050
1057
  class: g(["flex flex-wrap gap-1 p-1 group-tabs", { "flex-col group-tabs-vertical pr-2": p.value }]),
1051
1058
  role: "tablist",
@@ -1061,16 +1068,16 @@ var ee = /* @__PURE__ */ f({
1061
1068
  key: 0,
1062
1069
  class: g(e.icon),
1063
1070
  "aria-hidden": "true"
1064
- }, null, 2)) : a("", !0), l(k(e.name), 1)], 10, kt))), 128))], 10, Ot),
1071
+ }, null, 2)) : a("", !0), l(k(e.name), 1)], 10, Ut))), 128))], 10, Ht),
1065
1072
  s("div", { class: g(["group-panels flex flex-1 flex-col min-w-0 min-h-0", {
1066
1073
  "ml-2": p.value,
1067
1074
  "mt-2": !p.value
1068
- }]) }, [(S(!0), o(e, null, T(t.qMap.groups, (n) => R((S(), o("section", {
1075
+ }]) }, [(S(!0), o(e, null, T(t.qMap.groups, (n) => L((S(), o("section", {
1069
1076
  name: n.name,
1070
1077
  key: n.name,
1071
1078
  class: "flex flex-1 flex-col min-w-0 min-h-0",
1072
1079
  role: "tabpanel"
1073
- }, [n.items?.length == 1 && n.items[0]?.type == "geo_map" ? (S(), o("div", jt, [(S(!0), o(e, null, T(n.items, (e) => (S(), i(Q, {
1080
+ }, [n.items?.length == 1 && n.items[0]?.type == "geo_map" ? (S(), o("div", Gt, [(S(!0), o(e, null, T(n.items, (e) => (S(), i(Q, {
1074
1081
  key: e.id,
1075
1082
  qMap: e,
1076
1083
  modelValue: m.value,
@@ -1089,7 +1096,7 @@ var ee = /* @__PURE__ */ f({
1089
1096
  "validator",
1090
1097
  "provider",
1091
1098
  "readOnly"
1092
- ]))), 128))])) : (S(), o("div", Mt, [s("div", Nt, [s("div", Pt, [(S(!0), o(e, null, T(n.items, (e) => (S(), i(Q, {
1099
+ ]))), 128))])) : (S(), o("div", Kt, [s("div", qt, [s("div", Jt, [(S(!0), o(e, null, T(n.items, (e) => (S(), i(Q, {
1093
1100
  key: e.id,
1094
1101
  qMap: e,
1095
1102
  modelValue: m.value,
@@ -1108,29 +1115,29 @@ var ee = /* @__PURE__ */ f({
1108
1115
  "validator",
1109
1116
  "provider",
1110
1117
  "readOnly"
1111
- ]))), 128))])])]))], 8, At)), [[F, d.value === n.name]])), 128))], 2)
1118
+ ]))), 128))])])]))], 8, Wt)), [[P, d.value === n.name]])), 128))], 2)
1112
1119
  ], 6));
1113
1120
  }
1114
- }), It = {
1121
+ }), Xt = {
1115
1122
  key: 0,
1116
1123
  class: "inline-flex items-center gap-2"
1117
- }, Lt = {
1124
+ }, Zt = {
1118
1125
  key: 1,
1119
1126
  class: "flex flex-col gap-1"
1120
- }, Rt = [
1127
+ }, Qt = [
1121
1128
  "id",
1122
1129
  "value",
1123
1130
  "readonly"
1124
- ], zt = [
1131
+ ], $t = [
1125
1132
  "id",
1126
1133
  "value",
1127
1134
  "readonly",
1128
1135
  "type"
1129
- ], Bt = {
1136
+ ], en = {
1130
1137
  key: 0,
1131
1138
  class: "qmap-required",
1132
1139
  "aria-hidden": "true"
1133
- }, Z = /* @__PURE__ */ f({
1140
+ }, tn = /* @__PURE__ */ f({
1134
1141
  __name: "qString",
1135
1142
  props: {
1136
1143
  qMap: {},
@@ -1154,18 +1161,18 @@ var ee = /* @__PURE__ */ f({
1154
1161
  value: e
1155
1162
  });
1156
1163
  }
1157
- return (t, n) => e.lite && e.readOnly ? (S(), o("div", It, k(d.value), 1)) : (S(), o("div", Lt, [!e.lite && e.qMap.id !== "#" ? (S(), i(K, {
1164
+ return (t, n) => e.lite && e.readOnly ? (S(), o("div", Xt, k(d.value), 1)) : (S(), o("div", Zt, [!e.lite && e.qMap.id !== "#" ? (S(), i(X, {
1158
1165
  key: 0,
1159
1166
  "q-map": e.qMap
1160
- }, null, 8, ["q-map"])) : a("", !0), u(X, { multiline: e.qMap.style === "longtext" || e.lite && e.qMap.style === "textarea" }, c({
1161
- append: L(() => [e.qMap.required && !d.value ? (S(), o("span", Bt, [...n[3] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0), !e.qMap.required && d.value && !e.readOnly ? (S(), o("button", {
1167
+ }, null, 8, ["q-map"])) : a("", !0), u(Z, { multiline: e.qMap.style === "longtext" || e.lite && e.qMap.style === "textarea" }, c({
1168
+ append: I(() => [e.qMap.required && !d.value ? (S(), o("span", en, [...n[3] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0), !e.qMap.required && d.value && !e.readOnly ? (S(), o("button", {
1162
1169
  key: 1,
1163
1170
  type: "button",
1164
1171
  class: "inline-flex items-center justify-center min-w-8 min-h-8 p-1 qmap-icon-button",
1165
1172
  "aria-label": "Clear",
1166
1173
  onClick: n[2] ||= (e) => p(void 0)
1167
1174
  }, [...n[4] ||= [s("i", { class: "fa fa-times" }, null, -1)]])) : a("", !0)]),
1168
- default: L(() => [e.qMap.type !== "number" && (e.qMap.style === "longtext" || e.lite && e.qMap.style === "textarea") ? (S(), o("textarea", {
1175
+ default: I(() => [e.qMap.type !== "number" && (e.qMap.style === "longtext" || e.lite && e.qMap.style === "textarea") ? (S(), o("textarea", {
1169
1176
  key: 0,
1170
1177
  id: e.qMap.id,
1171
1178
  value: d.value,
@@ -1174,7 +1181,7 @@ var ee = /* @__PURE__ */ f({
1174
1181
  class: "qmap-input min-w-0 flex-1 px-0 py-2 min-h-24 resize-y",
1175
1182
  onInput: f,
1176
1183
  onChange: n[0] ||= (e) => p(e.target.value)
1177
- }, null, 40, Rt)) : (S(), o("input", {
1184
+ }, null, 40, Qt)) : (S(), o("input", {
1178
1185
  key: 1,
1179
1186
  id: e.qMap.id,
1180
1187
  value: d.value,
@@ -1183,30 +1190,30 @@ var ee = /* @__PURE__ */ f({
1183
1190
  class: "qmap-input min-w-0 flex-1 px-0 py-2",
1184
1191
  onInput: f,
1185
1192
  onChange: n[1] ||= (e) => p(e.target.value)
1186
- }, null, 40, zt))]),
1193
+ }, null, 40, $t))]),
1187
1194
  _: 2
1188
1195
  }, [e.qMap.icon ? {
1189
1196
  name: "prepend",
1190
- fn: L(() => [u(Je, { qMap: e.qMap }, null, 8, ["qMap"])]),
1197
+ fn: I(() => [u(ct, { qMap: e.qMap }, null, 8, ["qMap"])]),
1191
1198
  key: "0"
1192
1199
  } : void 0]), 1032, ["multiline"])]));
1193
1200
  }
1194
- }), Vt = { key: 0 }, Ht = {
1201
+ }), nn = { key: 0 }, rn = {
1195
1202
  key: 0,
1196
1203
  class: "flex flex-row items-center"
1197
- }, Ut = ["for"], Wt = ["id", "readonly"], Gt = {
1204
+ }, an = ["for"], on = ["id", "readonly"], sn = {
1198
1205
  key: 0,
1199
1206
  class: "qmap-required"
1200
- }, Kt = {
1207
+ }, cn = {
1201
1208
  key: 1,
1202
1209
  class: "text-right text-negative"
1203
- }, qt = { key: 1 }, Jt = { class: "qmap-card flex min-w-0 gap-3 p-3 bg-zinc-50 dark:bg-zinc-900" }, Yt = { class: "flex-1 min-w-0" }, Xt = { key: 0 }, Zt = {
1210
+ }, ln = { key: 1 }, un = { class: "qmap-card flex min-w-0 gap-3 p-3 bg-zinc-50 dark:bg-zinc-900" }, dn = { class: "flex-1 min-w-0" }, fn = { key: 0 }, pn = {
1204
1211
  key: 1,
1205
1212
  class: "flex flex-col gap-2"
1206
- }, Qt = {
1213
+ }, mn = {
1207
1214
  key: 0,
1208
1215
  class: "flex flex-col justify-center"
1209
- }, $t = /* @__PURE__ */ f({
1216
+ }, hn = /* @__PURE__ */ f({
1210
1217
  __name: "qObject",
1211
1218
  props: {
1212
1219
  qMap: {},
@@ -1244,10 +1251,10 @@ var ee = /* @__PURE__ */ f({
1244
1251
  value: void 0
1245
1252
  });
1246
1253
  }
1247
- return (n, r) => t.qMap.items ? (S(), o("div", qt, [!t.lite && t.qMap.id !== "#" ? (S(), i(K, {
1254
+ return (n, r) => t.qMap.items ? (S(), o("div", ln, [!t.lite && t.qMap.id !== "#" ? (S(), i(X, {
1248
1255
  key: 0,
1249
1256
  "q-map": t.qMap
1250
- }, null, 8, ["q-map"])) : a("", !0), s("div", Jt, [s("div", Yt, [f.value ? (S(), o("div", Zt, [(S(!0), o(e, null, T(t.qMap.items, (e) => (S(), i(Q, {
1257
+ }, null, 8, ["q-map"])) : a("", !0), s("div", un, [s("div", dn, [f.value ? (S(), o("div", pn, [(S(!0), o(e, null, T(t.qMap.items, (e) => (S(), i(Q, {
1251
1258
  qMap: e,
1252
1259
  modelValue: f.value,
1253
1260
  "onUpdate:modelValue": [r[4] ||= (e) => f.value = e, h],
@@ -1262,11 +1269,11 @@ var ee = /* @__PURE__ */ f({
1262
1269
  "provider",
1263
1270
  "lite",
1264
1271
  "readOnly"
1265
- ]))), 256))])) : (S(), o("div", Xt, [s("button", {
1272
+ ]))), 256))])) : (S(), o("div", fn, [s("button", {
1266
1273
  type: "button",
1267
1274
  class: "inline-flex items-center justify-center gap-2 min-h-9 px-3.5 py-2 qmap-button",
1268
1275
  onClick: r[3] ||= (e) => f.value = {}
1269
- }, "Not set")]))]), !t.qMap.required && f.value != null ? (S(), o("div", Qt, [s("button", {
1276
+ }, "Not set")]))]), !t.qMap.required && f.value != null ? (S(), o("div", mn, [s("button", {
1270
1277
  type: "button",
1271
1278
  class: "inline-flex items-center justify-center min-w-8 min-h-8 p-1 qmap-icon-button qmap-danger",
1272
1279
  "aria-label": "Remove object",
@@ -1276,23 +1283,23 @@ var ee = /* @__PURE__ */ f({
1276
1283
  }, [...r[7] ||= [s("i", {
1277
1284
  class: "fa fa-trash",
1278
1285
  "aria-hidden": "true"
1279
- }, null, -1)]])])) : a("", !0)])])) : (S(), o("div", Vt, [
1280
- t.lite && t.readOnly ? (S(), o("div", Ht, k(d.value), 1)) : a("", !0),
1286
+ }, null, -1)]])])) : a("", !0)])])) : (S(), o("div", nn, [
1287
+ t.lite && t.readOnly ? (S(), o("div", rn, k(d.value), 1)) : a("", !0),
1281
1288
  s("label", {
1282
1289
  class: "qmap-field flex flex-col gap-1.5 min-w-0 text-sm",
1283
1290
  for: t.qMap.id
1284
- }, [!t.lite && t.qMap.id !== "#" ? (S(), i(K, {
1291
+ }, [!t.lite && t.qMap.id !== "#" ? (S(), i(X, {
1285
1292
  key: 0,
1286
1293
  "q-map": t.qMap
1287
- }, null, 8, ["q-map"])) : a("", !0), u(X, {
1294
+ }, null, 8, ["q-map"])) : a("", !0), u(Z, {
1288
1295
  disabled: t.readOnly,
1289
1296
  multiline: ""
1290
1297
  }, c({
1291
- append: L(() => [t.qMap.required && (!t.lite || !d.value) ? (S(), o("span", Gt, [...r[6] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0), t.qMap.subtitle ? (S(), i(W, {
1298
+ append: I(() => [t.qMap.required && (!t.lite || !d.value) ? (S(), o("span", sn, [...r[6] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0), t.qMap.subtitle ? (S(), i(le, {
1292
1299
  key: 1,
1293
1300
  "q-map": t.qMap
1294
1301
  }, null, 8, ["q-map"])) : a("", !0)]),
1295
- default: L(() => [R(s("textarea", {
1302
+ default: I(() => [L(s("textarea", {
1296
1303
  id: t.qMap.id,
1297
1304
  "onUpdate:modelValue": r[0] ||= (e) => d.value = e,
1298
1305
  class: "qmap-input min-w-0 flex-1 px-0 py-2 min-h-24 resize-y",
@@ -1300,23 +1307,23 @@ var ee = /* @__PURE__ */ f({
1300
1307
  rows: "5",
1301
1308
  onBlur: r[1] ||= (e) => m(d.value),
1302
1309
  onInput: r[2] ||= (e) => m(d.value)
1303
- }, null, 40, Wt), [[P, d.value]])]),
1310
+ }, null, 40, on), [[N, d.value]])]),
1304
1311
  _: 2
1305
1312
  }, [t.qMap.icon ? {
1306
1313
  name: "prepend",
1307
- fn: L(() => [s("i", {
1314
+ fn: I(() => [s("i", {
1308
1315
  class: g(t.qMap.icon),
1309
1316
  "aria-hidden": "true"
1310
1317
  }, null, 2)]),
1311
1318
  key: "0"
1312
- } : void 0]), 1032, ["disabled"])], 8, Ut),
1313
- p.value ? (S(), o("div", Kt, k(p.value), 1)) : a("", !0)
1319
+ } : void 0]), 1032, ["disabled"])], 8, an),
1320
+ p.value ? (S(), o("div", cn, k(p.value), 1)) : a("", !0)
1314
1321
  ]));
1315
1322
  }
1316
- }), en = { class: "text-lg" }, tn = {
1323
+ }), gn = { class: "text-lg" }, _n = {
1317
1324
  key: 0,
1318
1325
  class: "text-md"
1319
- }, nn = /* @__PURE__ */ f({
1326
+ }, vn = /* @__PURE__ */ f({
1320
1327
  __name: "qCaption",
1321
1328
  props: {
1322
1329
  qMap: {},
@@ -1330,9 +1337,9 @@ var ee = /* @__PURE__ */ f({
1330
1337
  },
1331
1338
  emits: ["qmap_change", "qmap_subquestions"],
1332
1339
  setup(t, { emit: n }) {
1333
- return (n, r) => (S(), o(e, null, [s("div", en, k(t.qMap.title), 1), t.qMap.subtitle ? (S(), o("div", tn, k(t.qMap.subtitle), 1)) : a("", !0)], 64));
1340
+ return (n, r) => (S(), o(e, null, [s("div", gn, k(t.qMap.title), 1), t.qMap.subtitle ? (S(), o("div", _n, k(t.qMap.subtitle), 1)) : a("", !0)], 64));
1334
1341
  }
1335
- }), rn = /* @__PURE__ */ f({
1342
+ }), yn = /* @__PURE__ */ f({
1336
1343
  __name: "qGeoMap",
1337
1344
  props: {
1338
1345
  qMap: {},
@@ -1346,8 +1353,8 @@ var ee = /* @__PURE__ */ f({
1346
1353
  },
1347
1354
  emits: ["qmap_change", "qmap_subquestions"],
1348
1355
  setup(e, { emit: t }) {
1349
- let r = d(() => Promise.resolve().then(() => jn)), i = e, a = t, s = w(), c = n(() => i.qMap.style == "full-screen");
1350
- I(() => i.model, (e) => s.value = i.model[i.qMap.id]), v(() => {
1356
+ let r = d(() => Promise.resolve().then(() => qn)), i = e, a = t, s = w(), c = n(() => i.qMap.style == "full-screen");
1357
+ F(() => i.model, (e) => s.value = i.model[i.qMap.id]), v(() => {
1351
1358
  s.value = i.model[i.qMap.id] ? JSON.parse(i.model[i.qMap.id]) : void 0, l(s.value);
1352
1359
  });
1353
1360
  function l(e) {
@@ -1385,10 +1392,10 @@ var ee = /* @__PURE__ */ f({
1385
1392
  "toolbar"
1386
1393
  ])], 6));
1387
1394
  }
1388
- }), an = { class: "mb-4" }, on = { class: "my-2 flex flex-row items-center justify-between" }, sn = { class: "qmap-table" }, cn = ["onUpdate:modelValue"], ln = ["onUpdate:modelValue"], un = ["onClick"], dn = { key: 0 }, fn = {
1395
+ }), bn = { class: "mb-4" }, xn = { class: "my-2 flex flex-row items-center justify-between" }, Sn = { class: "qmap-table" }, Cn = ["onUpdate:modelValue"], wn = ["onUpdate:modelValue"], Tn = ["onClick"], En = { key: 0 }, Dn = {
1389
1396
  colspan: "2",
1390
1397
  class: "text-center"
1391
- }, pn = /* @__PURE__ */ f({
1398
+ }, On = /* @__PURE__ */ f({
1392
1399
  __name: "qSimpleMap",
1393
1400
  props: {
1394
1401
  qMap: {},
@@ -1403,7 +1410,7 @@ var ee = /* @__PURE__ */ f({
1403
1410
  emits: ["qmap_change", "qmap_subquestions"],
1404
1411
  setup(t, { emit: n }) {
1405
1412
  let r = t, i = n, c = w([]);
1406
- I(() => r.model, (e) => l(r.model[r.qMap.id])), v(() => {
1413
+ F(() => r.model, (e) => l(r.model[r.qMap.id])), v(() => {
1407
1414
  l(r.model[r.qMap.id] || void 0);
1408
1415
  });
1409
1416
  function l(e) {
@@ -1428,41 +1435,41 @@ var ee = /* @__PURE__ */ f({
1428
1435
  function p(e) {
1429
1436
  c.value = c.value.filter((t) => t != e), d();
1430
1437
  }
1431
- return (n, r) => (S(), o("div", an, [s("div", on, [u(K, { "q-map": t.qMap }, null, 8, ["q-map"]), s("div", null, [s("button", {
1438
+ return (n, r) => (S(), o("div", bn, [s("div", xn, [u(X, { "q-map": t.qMap }, null, 8, ["q-map"]), s("div", null, [s("button", {
1432
1439
  type: "button",
1433
1440
  class: "inline-flex items-center justify-center gap-2 min-h-9 px-3.5 py-2 qmap-button",
1434
1441
  "aria-label": "Add row",
1435
1442
  onClick: r[0] ||= (e) => f()
1436
- }, "+")])]), s("table", sn, [r[4] ||= s("thead", null, [s("tr", null, [s("th", null, "Name"), s("th", null, "Value")])], -1), s("tbody", null, [(S(!0), o(e, null, T(c.value, (e, t) => (S(), o("tr", null, [s("td", null, [u(X, null, {
1437
- default: L(() => [R(s("input", {
1443
+ }, "+")])]), s("table", Sn, [r[4] ||= s("thead", null, [s("tr", null, [s("th", null, "Name"), s("th", null, "Value")])], -1), s("tbody", null, [(S(!0), o(e, null, T(c.value, (e, t) => (S(), o("tr", null, [s("td", null, [u(Z, null, {
1444
+ default: I(() => [L(s("input", {
1438
1445
  "onUpdate:modelValue": (e) => c.value[t].key = e,
1439
1446
  class: "qmap-input min-w-0 flex-1 px-0 py-2",
1440
1447
  onInput: d
1441
- }, null, 40, cn), [[P, c.value[t].key]])]),
1448
+ }, null, 40, Cn), [[N, c.value[t].key]])]),
1442
1449
  _: 2
1443
- }, 1024)]), s("td", null, [u(X, null, {
1444
- append: L(() => [s("button", {
1450
+ }, 1024)]), s("td", null, [u(Z, null, {
1451
+ append: I(() => [s("button", {
1445
1452
  type: "button",
1446
1453
  class: "inline-flex items-center justify-center min-w-8 min-h-8 p-1 qmap-icon-button qmap-danger",
1447
1454
  "aria-label": "Remove row",
1448
1455
  onClick: (t) => p(e)
1449
- }, [...r[2] ||= [s("i", { class: "fa fa-trash" }, null, -1)]], 8, un)]),
1450
- default: L(() => [R(s("input", {
1456
+ }, [...r[2] ||= [s("i", { class: "fa fa-trash" }, null, -1)]], 8, Tn)]),
1457
+ default: I(() => [L(s("input", {
1451
1458
  "onUpdate:modelValue": (e) => c.value[t].val = e,
1452
1459
  class: "qmap-input min-w-0 flex-1 px-0 py-2",
1453
1460
  onInput: d
1454
- }, null, 40, ln), [[P, c.value[t].val]])]),
1461
+ }, null, 40, wn), [[N, c.value[t].val]])]),
1455
1462
  _: 2
1456
- }, 1024)])]))), 256)), c.value.length ? a("", !0) : (S(), o("tr", dn, [s("td", fn, [r[3] ||= s("div", null, "No values ", -1), s("button", {
1463
+ }, 1024)])]))), 256)), c.value.length ? a("", !0) : (S(), o("tr", En, [s("td", Dn, [r[3] ||= s("div", null, "No values ", -1), s("button", {
1457
1464
  type: "button",
1458
1465
  class: "inline-flex items-center justify-center gap-2 min-h-9 px-3.5 py-2 qmap-button",
1459
1466
  onClick: r[1] ||= (e) => f()
1460
1467
  }, "Add Row")])]))])])]));
1461
1468
  }
1462
- }), mn = { class: "flex flex-col flex-1 min-w-0" }, hn = { key: 16 }, gn = { key: 17 }, _n = { key: 18 }, vn = {
1469
+ }), kn = { class: "flex flex-col flex-1 min-w-0" }, An = { key: 16 }, jn = { key: 17 }, Mn = { key: 18 }, Nn = {
1463
1470
  key: 0,
1464
1471
  class: "qmap-separator my-4"
1465
- }, yn = {
1472
+ }, Pn = {
1466
1473
  key: 1,
1467
1474
  class: "qmap_nested flex flex-col gap-2"
1468
1475
  }, Q = /* @__PURE__ */ f({
@@ -1491,7 +1498,7 @@ var ee = /* @__PURE__ */ f({
1491
1498
  return (n, r) => {
1492
1499
  let c = D("Question", !0);
1493
1500
  return S(), o(e, null, [
1494
- s("div", mn, [p.value ? (S(), i(O(t.provider?.questionTypes[f.value]), {
1501
+ s("div", kn, [p.value ? (S(), i(O(t.provider?.questionTypes[f.value]), {
1495
1502
  key: 0,
1496
1503
  qMap: t.qMap,
1497
1504
  modelValue: t.modelValue,
@@ -1510,7 +1517,7 @@ var ee = /* @__PURE__ */ f({
1510
1517
  "validator",
1511
1518
  "lite",
1512
1519
  "readOnly"
1513
- ])) : f.value == "text" || f.value == "string" ? (S(), i(Z, {
1520
+ ])) : f.value == "text" || f.value == "string" ? (S(), i(tn, {
1514
1521
  key: 1,
1515
1522
  qMap: t.qMap,
1516
1523
  model: t.modelValue,
@@ -1526,7 +1533,7 @@ var ee = /* @__PURE__ */ f({
1526
1533
  "validator",
1527
1534
  "lite",
1528
1535
  "readOnly"
1529
- ])) : f.value == "object" ? (S(), i($t, {
1536
+ ])) : f.value == "object" ? (S(), i(hn, {
1530
1537
  key: 2,
1531
1538
  qMap: t.qMap,
1532
1539
  model: t.modelValue,
@@ -1544,7 +1551,7 @@ var ee = /* @__PURE__ */ f({
1544
1551
  "lite",
1545
1552
  "readOnly",
1546
1553
  "provider"
1547
- ])) : f.value == "number" ? (S(), i(Z, {
1554
+ ])) : f.value == "number" ? (S(), i(tn, {
1548
1555
  key: 3,
1549
1556
  qMap: t.qMap,
1550
1557
  model: t.modelValue,
@@ -1561,7 +1568,7 @@ var ee = /* @__PURE__ */ f({
1561
1568
  "validator",
1562
1569
  "lite",
1563
1570
  "readOnly"
1564
- ])) : f.value == "colour" ? (S(), i(ft, {
1571
+ ])) : f.value == "colour" ? (S(), i(Et, {
1565
1572
  key: 4,
1566
1573
  qMap: t.qMap,
1567
1574
  model: t.modelValue,
@@ -1577,7 +1584,7 @@ var ee = /* @__PURE__ */ f({
1577
1584
  "validator",
1578
1585
  "lite",
1579
1586
  "readOnly"
1580
- ])) : f.value == "date" ? (S(), i(Dt, {
1587
+ ])) : f.value == "date" ? (S(), i(Vt, {
1581
1588
  key: 5,
1582
1589
  qMap: t.qMap,
1583
1590
  model: t.modelValue,
@@ -1594,7 +1601,7 @@ var ee = /* @__PURE__ */ f({
1594
1601
  "validator",
1595
1602
  "lite",
1596
1603
  "readOnly"
1597
- ])) : f.value == "datetime" ? (S(), i(Dt, {
1604
+ ])) : f.value == "datetime" ? (S(), i(Vt, {
1598
1605
  key: 6,
1599
1606
  qMap: t.qMap,
1600
1607
  model: t.modelValue,
@@ -1611,7 +1618,7 @@ var ee = /* @__PURE__ */ f({
1611
1618
  "validator",
1612
1619
  "lite",
1613
1620
  "readOnly"
1614
- ])) : f.value == "time" ? (S(), i(Z, {
1621
+ ])) : f.value == "time" ? (S(), i(tn, {
1615
1622
  key: 7,
1616
1623
  qMap: t.qMap,
1617
1624
  model: t.modelValue,
@@ -1628,7 +1635,7 @@ var ee = /* @__PURE__ */ f({
1628
1635
  "validator",
1629
1636
  "lite",
1630
1637
  "readOnly"
1631
- ])) : f.value == "colour" || f.value == "color" ? (S(), i(Z, {
1638
+ ])) : f.value == "colour" || f.value == "color" ? (S(), i(tn, {
1632
1639
  key: 8,
1633
1640
  qMap: t.qMap,
1634
1641
  model: t.modelValue,
@@ -1645,7 +1652,7 @@ var ee = /* @__PURE__ */ f({
1645
1652
  "lite",
1646
1653
  "readOnly",
1647
1654
  "extras"
1648
- ])) : f.value == "boolean" ? (S(), i(Me, {
1655
+ ])) : f.value == "boolean" ? (S(), i(Ke, {
1649
1656
  key: 9,
1650
1657
  qMap: t.qMap,
1651
1658
  model: t.modelValue,
@@ -1662,7 +1669,7 @@ var ee = /* @__PURE__ */ f({
1662
1669
  "validator",
1663
1670
  "lite",
1664
1671
  "readOnly"
1665
- ])) : f.value == "caption" ? (S(), i(nn, {
1672
+ ])) : f.value == "caption" ? (S(), i(vn, {
1666
1673
  key: 10,
1667
1674
  qMap: t.qMap,
1668
1675
  model: t.modelValue,
@@ -1671,7 +1678,7 @@ var ee = /* @__PURE__ */ f({
1671
1678
  "qMap",
1672
1679
  "model",
1673
1680
  "lite"
1674
- ])) : f.value == "choice" ? (S(), i(st, {
1681
+ ])) : f.value == "choice" ? (S(), i(xt, {
1675
1682
  key: 11,
1676
1683
  qMap: t.qMap,
1677
1684
  model: t.modelValue,
@@ -1690,7 +1697,7 @@ var ee = /* @__PURE__ */ f({
1690
1697
  "lite",
1691
1698
  "readOnly",
1692
1699
  "provider"
1693
- ])) : f.value == "map" ? (S(), i(pn, {
1700
+ ])) : f.value == "map" ? (S(), i(On, {
1694
1701
  key: 12,
1695
1702
  qMap: t.qMap,
1696
1703
  model: t.modelValue,
@@ -1709,7 +1716,7 @@ var ee = /* @__PURE__ */ f({
1709
1716
  "lite",
1710
1717
  "readOnly",
1711
1718
  "provider"
1712
- ])) : f.value == "geo_map" ? (S(), i(rn, {
1719
+ ])) : f.value == "geo_map" ? (S(), i(yn, {
1713
1720
  key: 13,
1714
1721
  qMap: t.qMap,
1715
1722
  model: t.modelValue,
@@ -1728,7 +1735,7 @@ var ee = /* @__PURE__ */ f({
1728
1735
  "lite",
1729
1736
  "readOnly",
1730
1737
  "provider"
1731
- ])) : f.value == "array" ? (S(), i(fe, {
1738
+ ])) : f.value == "array" ? (S(), i(Te, {
1732
1739
  key: 14,
1733
1740
  qMap: t.qMap,
1734
1741
  model: t.modelValue,
@@ -1746,7 +1753,7 @@ var ee = /* @__PURE__ */ f({
1746
1753
  "lite",
1747
1754
  "provider",
1748
1755
  "readOnly"
1749
- ])) : f.value == "group" ? (S(), i(Ft, {
1756
+ ])) : f.value == "group" ? (S(), i(Yt, {
1750
1757
  key: 15,
1751
1758
  qMap: t.qMap,
1752
1759
  model: t.modelValue,
@@ -1764,7 +1771,7 @@ var ee = /* @__PURE__ */ f({
1764
1771
  "lite",
1765
1772
  "provider",
1766
1773
  "readOnly"
1767
- ])) : f.value == "col" ? (S(), o("div", hn, [u(K, { "q-map": t.qMap }, null, 8, ["q-map"]), s("div", { class: g(["flex gap-2", {
1774
+ ])) : f.value == "col" ? (S(), o("div", An, [u(X, { "q-map": t.qMap }, null, 8, ["q-map"]), s("div", { class: g(["flex gap-2", {
1768
1775
  "flex-row": t.qMap.style != "column",
1769
1776
  "flex-col": t.qMap.style == "column"
1770
1777
  }]) }, [(S(!0), o(e, null, T(t.qMap.items, (e) => (S(), o("div", { class: g(["flex flex-1 flex-col min-w-0", { "gap-2": t.qMap.style != "column" }]) }, [u(c, {
@@ -1785,9 +1792,9 @@ var ee = /* @__PURE__ */ f({
1785
1792
  "validator",
1786
1793
  "lite",
1787
1794
  "readOnly"
1788
- ])], 2))), 256))], 2)])) : f.value == "hidden" ? (S(), o("div", gn)) : (S(), o("div", _n, "Unsupported " + k(t.qMap?.id) + " : " + k(f.value), 1))]),
1789
- y.value.length && t.qMap.ui?.separator ? (S(), o("hr", vn)) : a("", !0),
1790
- y.value.length ? (S(), o("div", yn, [(S(!0), o(e, null, T(y.value, (e) => (S(), i(c, {
1795
+ ])], 2))), 256))], 2)])) : f.value == "hidden" ? (S(), o("div", jn)) : (S(), o("div", Mn, "Unsupported " + k(t.qMap?.id) + " : " + k(f.value), 1))]),
1796
+ y.value.length && t.qMap.ui?.separator ? (S(), o("hr", Nn)) : a("", !0),
1797
+ y.value.length ? (S(), o("div", Pn, [(S(!0), o(e, null, T(y.value, (e) => (S(), i(c, {
1791
1798
  qMap: e,
1792
1799
  modelValue: t.modelValue,
1793
1800
  extras: t.extras,
@@ -1809,10 +1816,10 @@ var ee = /* @__PURE__ */ f({
1809
1816
  ], 64);
1810
1817
  };
1811
1818
  }
1812
- }), bn = ["col", "group"];
1813
- function xn(e, t) {
1819
+ }), Fn = ["col", "group"];
1820
+ function In(e, t) {
1814
1821
  var n = [];
1815
- if (bn.indexOf(e.type) != -1 && (e.items || e.groups) ? e.items ? n = n.concat(e.items) : e.groups && (n = n.concat(e.groups.map((e) => e.items).reduce((e, t) => e.concat(t)).map((e) => xn(e, t)).reduce((e, t) => e.concat(t)))) : n.push(e), e.onValue && (!t || t[e.id] != null && t[e.id] != "") && (n = n.concat($(e.onValue, t))), e.type == "boolean" && (!t || t[e.id] == 1) && e.onPos && (n = n.concat($(e.onPos, t))), e.type == "boolean" && (!t || t[e.id] == 0) && e.onNeg && (n = n.concat($(e.onNeg, t))), e.values) {
1822
+ if (Fn.indexOf(e.type) != -1 && (e.items || e.groups) ? e.items ? n = n.concat(e.items) : e.groups && (n = n.concat(e.groups.map((e) => e.items).reduce((e, t) => e.concat(t)).map((e) => In(e, t)).reduce((e, t) => e.concat(t)))) : n.push(e), e.onValue && (!t || t[e.id] != null && t[e.id] != "") && (n = n.concat($(e.onValue, t))), e.type == "boolean" && (!t || t[e.id] == 1) && e.onPos && (n = n.concat($(e.onPos, t))), e.type == "boolean" && (!t || t[e.id] == 0) && e.onNeg && (n = n.concat($(e.onNeg, t))), e.values) {
1816
1823
  let r = e.values.find((n) => n.value == (!t || t[e.id]));
1817
1824
  r?.onSelect && (n = n.concat($(r.onSelect, t)));
1818
1825
  }
@@ -1822,21 +1829,21 @@ function $(e, t) {
1822
1829
  var n = [];
1823
1830
  return e.forEach((e) => {
1824
1831
  if (e.type != "caption") {
1825
- let r = xn(e, t);
1832
+ let r = In(e, t);
1826
1833
  n = n.concat(r);
1827
1834
  }
1828
1835
  }), n;
1829
1836
  }
1830
1837
  //#endregion
1831
1838
  //#region src/services/question-validator.ts
1832
- var Sn = class {
1833
- invalidFields = new H([]);
1834
- isValid = new H(!0);
1839
+ var Ln = class {
1840
+ invalidFields = new V([]);
1841
+ isValid = new V(!0);
1835
1842
  qMaps = [];
1836
1843
  requiredQMaps = [];
1837
1844
  children = [];
1838
1845
  baseQMaps;
1839
- changeEvents = new U();
1846
+ changeEvents = new H();
1840
1847
  model;
1841
1848
  activeQMAPS = /* @__PURE__ */ new Map();
1842
1849
  constructor(e, t) {
@@ -1866,10 +1873,10 @@ var Sn = class {
1866
1873
  get currentQMaps() {
1867
1874
  return this.qMaps;
1868
1875
  }
1869
- }, Cn = {
1876
+ }, Rn = {
1870
1877
  key: 0,
1871
1878
  class: "flex-1 min-w-0 overflow-auto"
1872
- }, wn = { class: "flex flex-col gap-2 p-2" }, Tn = { class: "flex justify-end gap-2" }, En = ["disabled"], Dn = /* @__PURE__ */ f({
1879
+ }, zn = { class: "flex flex-col gap-2 p-2" }, Bn = { class: "flex justify-end gap-2" }, Vn = ["disabled"], Hn = /* @__PURE__ */ f({
1873
1880
  __name: "Form",
1874
1881
  props: {
1875
1882
  questions: {},
@@ -1889,7 +1896,7 @@ var Sn = class {
1889
1896
  "update:model-value"
1890
1897
  ],
1891
1898
  setup(t, { emit: r }) {
1892
- let c = t, l = r, u = { ...c.modelValue }, d = c.validator || new Sn(c.questions, c.modelValue), f = w(!0), p = n(() => !(c.showSubmit || c.showCancel || c.showReset)), m = n({
1899
+ let c = t, l = r, u = { ...c.modelValue }, d = c.validator || new Ln(c.questions, c.modelValue), f = w(!0), p = n(() => !(c.showSubmit || c.showCancel || c.showReset)), m = n({
1893
1900
  get: () => c.modelValue,
1894
1901
  set: (e) => l("update:model-value", e)
1895
1902
  });
@@ -1919,7 +1926,7 @@ var Sn = class {
1919
1926
  "flex flex-col gap-2 p-2": !t.scrollPane
1920
1927
  })
1921
1928
  }, [
1922
- t.scrollPane ? (S(), o("div", Cn, [s("div", wn, [(S(!0), o(e, null, T(t.questions, (e, n) => (S(), i(Q, {
1929
+ t.scrollPane ? (S(), o("div", Rn, [s("div", zn, [(S(!0), o(e, null, T(t.questions, (e, n) => (S(), i(Q, {
1923
1930
  key: n,
1924
1931
  qMap: e,
1925
1932
  validator: A(d),
@@ -1947,14 +1954,14 @@ var Sn = class {
1947
1954
  "modelValue"
1948
1955
  ]))), 128)),
1949
1956
  r[6] ||= s("hr", { class: "qmap-separator my-2" }, null, -1),
1950
- s("div", Tn, [
1957
+ s("div", Bn, [
1951
1958
  t.showSubmit ? (S(), o("button", {
1952
1959
  key: 0,
1953
1960
  type: "button",
1954
1961
  class: "inline-flex items-center justify-center gap-2 min-h-9 px-3.5 py-2 qmap-button",
1955
1962
  onClick: r[3] ||= (e) => l("submit", m.value),
1956
1963
  disabled: !f.value
1957
- }, "Submit", 8, En)) : a("", !0),
1964
+ }, "Submit", 8, Vn)) : a("", !0),
1958
1965
  t.showReset ? (S(), o("button", {
1959
1966
  key: 1,
1960
1967
  type: "button",
@@ -1972,22 +1979,214 @@ var Sn = class {
1972
1979
  ])
1973
1980
  ], 2));
1974
1981
  }
1975
- });
1976
- //#endregion
1977
- //#region __vite-optional-peer-dep:leaflet/dist/leaflet.css:qmap-forms
1978
- throw Error("Could not resolve \"leaflet/dist/leaflet.css\" imported by \"qmap-forms\". Is it installed?");
1979
- function On(e) {
1980
- C(Nn, e);
1982
+ }), Un = { class: "flex flex-row items-center justify-between p-2" }, Wn = { class: "absolute top-0 right-0 m-4 z-50 qmap-editor-title" }, Gn = ["title"], Kn = /*@__PURE__*/ f({
1983
+ __name: "SimpleGeomEditor",
1984
+ props: {
1985
+ modelValue: {},
1986
+ class: {},
1987
+ readOnly: { type: Boolean },
1988
+ defaultColour: {},
1989
+ qMap: {},
1990
+ toolbar: {},
1991
+ centre: {},
1992
+ keys: {}
1993
+ },
1994
+ emits: ["update:model-value"],
1995
+ setup(e, { emit: t }) {
1996
+ let n = e, r = t, c = w(), u = w(0), d = w(), f = w(), p = w(!1), m = w(!1);
1997
+ w(0);
1998
+ let h, _;
1999
+ F(d, (e, t) => {
2000
+ _.setStyle({
2001
+ fillColor: void 0,
2002
+ weight: 4
2003
+ }), e && (f.value = e.options.color || n.defaultColour, e.setStyle && e.setStyle({
2004
+ fillColor: "#6a1b9a",
2005
+ weight: 4
2006
+ }), e.enableEdit?.(h), e.dragging?.enable()), t && (t.disableEdit?.(h), t.dragging?.disable());
2007
+ }), F(m, (e) => {
2008
+ !e && E && E.removeFrom(h);
2009
+ }), b(() => {
2010
+ if (v(), n.modelValue && !n.readOnly) C(n.modelValue), h.flyToBounds(_.getBounds(), { animate: !1 });
2011
+ else if (n.modelValue) {
2012
+ let e = oe(n.modelValue);
2013
+ h.addLayer(e), h.flyToBounds(e.getBounds());
2014
+ }
2015
+ u.value = _.getLayers().length;
2016
+ }), x(() => {
2017
+ h && h.remove();
2018
+ });
2019
+ function v() {
2020
+ h && h.remove();
2021
+ let e = new J("https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v12/tiles/{z}/{x}/{y}?access_token=" + n.keys.mapbox, {
2022
+ maxZoom: 18,
2023
+ noWrap: !0
2024
+ }).setZIndex(0);
2025
+ if (n.readOnly) h = new re(c.value).setView(n.centre ? [n.centre.lng, n.centre.lat] : [-25, 135], n.centre ? n.centre.zoom : 5);
2026
+ else {
2027
+ h = new re(c.value, { editable: !0 }).setView(n.centre ? [n.centre.lng, n.centre.lat] : [-25, 135], n.centre ? n.centre.zoom : 5), h.on("click", (e) => {
2028
+ let t = e.originalEvent.target, n = t.closest(".leaflet-overlay-pane"), r = t.closest(".leaflet-control");
2029
+ !n && !r && !p.value && (d.value = void 0);
2030
+ });
2031
+ let e = W.extend({
2032
+ options: {
2033
+ position: "topleft",
2034
+ callback: null,
2035
+ kind: "",
2036
+ html: ""
2037
+ },
2038
+ onAdd: function(e) {
2039
+ var t = K.create("div", "leaflet-control leaflet-bar qmap-leaflet-button"), n = K.create("a", "", t);
2040
+ let r = this.options;
2041
+ return n.href = "#", n.title = "Create a new " + r.kind, n.innerHTML = this.options.html, G.on(n, "click", G.stop).on(n, "click", function() {
2042
+ r.callback.call(e.editTools);
2043
+ }, this), t;
2044
+ }
2045
+ }), t = e.extend({ options: {
2046
+ position: "topleft",
2047
+ callback: h.editTools.startPolyline,
2048
+ kind: "line",
2049
+ html: "<i class=\"fa fa-pencil\"/>"
2050
+ } }), r = e.extend({ options: {
2051
+ position: "topleft",
2052
+ callback: h.editTools.startPolygon,
2053
+ kind: "polygon",
2054
+ html: "<i class=\"fa fa-draw-polygon\"/>"
2055
+ } }), i = e.extend({ options: {
2056
+ position: "topleft",
2057
+ callback: h.editTools.startMarker,
2058
+ kind: "marker",
2059
+ html: "<i class=\"fa fa-map-pin\"/>"
2060
+ } }), a = e.extend({ options: {
2061
+ position: "topleft",
2062
+ callback: h.editTools.startRectangle,
2063
+ kind: "rectangle",
2064
+ html: "<i class=\"fa fa-square\"/>"
2065
+ } }), o = e.extend({ options: {
2066
+ position: "topleft",
2067
+ callback: h.editTools.startCircle,
2068
+ kind: "rectangle",
2069
+ html: "<i class=\"fa fa-circle\"/>"
2070
+ } });
2071
+ n.readOnly || (h.addControl(new i()), h.addControl(new t()), h.addControl(new r()), h.addControl(new a()), h.addControl(new o())), h.on("editable:edited", (e) => {
2072
+ let t = e.layer;
2073
+ _.hasLayer(t) || T(t), y();
2074
+ });
2075
+ }
2076
+ if (localStorage.lastMapPos) {
2077
+ let e = JSON.parse(localStorage.lastMapPos);
2078
+ if (e?.ne && e.sw) {
2079
+ let t = new ne(e.ne, e.sw);
2080
+ h.flyToBounds(t, { animate: !1 });
2081
+ } else h.setView([-26, 132], 5);
2082
+ } else h.setView([-26, 132], 5);
2083
+ h.addLayer(e), h.on("moveend", (e) => {
2084
+ let t = e.target.getBounds();
2085
+ localStorage.lastMapPos = JSON.stringify({
2086
+ ne: t.getNorthEast(),
2087
+ sw: t.getSouthWest()
2088
+ });
2089
+ }), _ = ae().addTo(h);
2090
+ }
2091
+ function y() {
2092
+ let e = _.getLayers().map((e) => {
2093
+ function t(t) {
2094
+ return Object.keys(e.options).filter((e) => [
2095
+ "color",
2096
+ "fill",
2097
+ "fillColor",
2098
+ "fillOpacity",
2099
+ "stroke",
2100
+ "weight",
2101
+ "title"
2102
+ ].indexOf(e) != -1).forEach((n) => t.properties[n] = e.options[n]), t;
2103
+ }
2104
+ if (e instanceof U) {
2105
+ let n = e.toGeoJSON();
2106
+ return n.properties = {
2107
+ type: "circle",
2108
+ radius: e.getRadius()
2109
+ }, t(n);
2110
+ }
2111
+ if (e instanceof ie) {
2112
+ let n = e.toGeoJSON();
2113
+ return n.properties = { type: "rectangle" }, t(n);
2114
+ }
2115
+ return t(e.toGeoJSON());
2116
+ });
2117
+ r("update:model-value", {
2118
+ features: e,
2119
+ type: "FeatureCollection"
2120
+ }), u.value = _.getLayers().length;
2121
+ }
2122
+ function C(e) {
2123
+ var t;
2124
+ return oe(e, { onEachFeature: (e, n) => {
2125
+ let r;
2126
+ if (r = e.properties?.type == "circle" && e.properties?.radius ? new U(new q([n]).getBounds().getCenter(), e.properties.radius) : e.properties?.type == "rectangle" ? new ie(new q([n]).getBounds()) : n, e.properties) {
2127
+ let t = {};
2128
+ Object.keys(e.properties).filter((e) => [
2129
+ "color",
2130
+ "fill",
2131
+ "fillOpacity",
2132
+ "stroke",
2133
+ "weight",
2134
+ "title"
2135
+ ].indexOf(e) != -1).forEach((n) => t[n] = e.properties[n]), r.setStyle && r.setStyle(t);
2136
+ }
2137
+ e.properties?.title && r.bindTooltip(e.properties.title, {
2138
+ permanent: !0,
2139
+ direction: "center",
2140
+ className: "qmap-tooltip",
2141
+ opacity: 1
2142
+ }), T(r), t = r;
2143
+ } }), t;
2144
+ }
2145
+ function T(e) {
2146
+ _.addLayer(e), te.makeDraggable(e), e.on("click", (t) => {
2147
+ d.value = e;
2148
+ });
2149
+ }
2150
+ var E;
2151
+ return (t, r) => (S(), o("div", {
2152
+ ref_key: "mapDiv",
2153
+ ref: c,
2154
+ class: g(n.class)
2155
+ }, [d.value ? (S(), o("div", {
2156
+ key: 0,
2157
+ class: "absolute bottom-0 left-0 m-4 flex flex-col gap-1 qmap-editor-card",
2158
+ style: { "z-index": "999" },
2159
+ onClick: r[1] ||= z(() => {}, ["stop"])
2160
+ }, [s("div", Un, [r[2] ||= l(" Selected Item ", -1), s("button", {
2161
+ type: "button",
2162
+ class: "inline-flex items-center justify-center min-w-8 min-h-8 p-1 qmap-icon-button",
2163
+ "aria-label": "Close",
2164
+ onClick: r[0] ||= (e) => d.value = void 0
2165
+ }, "×")]), r[3] ||= s("hr", { class: "qmap-separator my-2" }, null, -1)])) : a("", !0), s("div", Wn, [e.qMap ? (S(), i(X, {
2166
+ key: 0,
2167
+ "q-map": e.qMap
2168
+ }, {
2169
+ default: I(() => [e.qMap.required ? (S(), o("span", {
2170
+ key: 0,
2171
+ class: "qmap-required",
2172
+ title: u.value ? "Required to have value" : "A value is required"
2173
+ }, [...r[4] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]], 8, Gn)) : a("", !0)]),
2174
+ _: 1
2175
+ }, 8, ["q-map"])) : a("", !0)])], 2));
2176
+ }
2177
+ }), qn = /* @__PURE__ */ se({ default: () => Jn }), Jn = Kn, Yn = Symbol("QMAP");
2178
+ function Xn(e) {
2179
+ C(Yn, e);
1981
2180
  }
1982
- function kn() {
1983
- let e = m(Nn, null);
2181
+ function Zn() {
2182
+ let e = m(Yn, null);
1984
2183
  if (!e) throw Error("useMyService must be called under a provider (comp1)");
1985
2184
  return e;
1986
2185
  }
1987
2186
  //#endregion
1988
2187
  //#region src/lib.ts
1989
- function An(e, t, n, i) {
1990
- let a = w(n), o = new H(a.value), s = new U(), c = p(Dn, {
2188
+ function Qn(e, t, n, i) {
2189
+ let a = w(n), o = new V(a.value), s = new H(), c = p(Hn, {
1991
2190
  questions: t,
1992
2191
  modelValue: a.value,
1993
2192
  "onUpdate:model-value": (e) => {
@@ -2008,6 +2207,11 @@ function An(e, t, n, i) {
2008
2207
  events: s
2009
2208
  };
2010
2209
  }
2210
+ var $n = {
2211
+ Question: Q,
2212
+ Form: Hn,
2213
+ QuestionValidator: Ln,
2214
+ mount: Qn
2215
+ };
2011
2216
  //#endregion
2012
- export { St as CalendarPicker, Dn as Form, Nn as MyScopeKey, Q as Question, Sn as QuestionValidator, Ke as SimpleChoice, Et as SimpleDate, Mn as SimpleGeomEditor, K as TitleBlock, _e as ToggleSwitch, Pn as default, xn as flattenNode, $ as flattenQMAPs, An as mount, On as provideBadQMAPS, kn as useBadQMAPS };
2013
- var jn, Mn, Nn, Pn;
2217
+ export { It as CalendarPicker, Hn as Form, Yn as MyScopeKey, Q as Question, Ln as QuestionValidator, ot as SimpleChoice, Bt as SimpleDate, Jn as SimpleGeomEditor, X as TitleBlock, Ae as ToggleSwitch, $n as default, In as flattenNode, $ as flattenQMAPs, Qn as mount, Xn as provideBadQMAPS, Zn as useBadQMAPS };