@inpageedit/core 0.16.1 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/InPageEdit.js +1 -1
  2. package/dist/{PluginImagesUsed-DnPDXczO.js → PluginImagesUsed-D5O8t694.js} +2 -2
  3. package/dist/{PluginImagesUsed-DnPDXczO.js.map → PluginImagesUsed-D5O8t694.js.map} +1 -1
  4. package/dist/{PluginPrefSync-CDTFyM8g.js → PluginPrefSync-C8tb5SJJ.js} +2 -2
  5. package/dist/{PluginPrefSync-CDTFyM8g.js.map → PluginPrefSync-C8tb5SJJ.js.map} +1 -1
  6. package/dist/{PluginStoreApp-Bng4DFBZ.js → PluginStoreApp-CeKtXL3p.js} +2 -2
  7. package/dist/{PluginStoreApp-Bng4DFBZ.js.map → PluginStoreApp-CeKtXL3p.js.map} +1 -1
  8. package/dist/{PluginTemplatesUsed-oM_VzfbH.js → PluginTemplatesUsed-DYv_lbHw.js} +2 -2
  9. package/dist/{PluginTemplatesUsed-oM_VzfbH.js.map → PluginTemplatesUsed-DYv_lbHw.js.map} +1 -1
  10. package/dist/core.js +2 -2
  11. package/dist/{index-42B3CrSO.js → index--IhZKYnh.js} +3 -3
  12. package/dist/index--IhZKYnh.js.map +1 -0
  13. package/dist/{index-Bn6y0Eln.js → index-Bf6ewNGZ.js} +101 -113
  14. package/dist/{index-Bn6y0Eln.js.map → index-Bf6ewNGZ.js.map} +1 -1
  15. package/dist/{index-BBUv7Lv6.js → index-BuSA1t5R.js} +2 -2
  16. package/dist/{index-BBUv7Lv6.js.map → index-BuSA1t5R.js.map} +1 -1
  17. package/dist/{index-D7rUF8vA.js → index-CaTtMzfu.js} +578 -501
  18. package/dist/index-CaTtMzfu.js.map +1 -0
  19. package/dist/{index-1sZXko-X.js → index-CxjH0_fO.js} +2 -2
  20. package/dist/{index-1sZXko-X.js.map → index-CxjH0_fO.js.map} +1 -1
  21. package/dist/{index-DlCbsA25.js → index-DSh05RaI.js} +3 -3
  22. package/dist/{index-DlCbsA25.js.map → index-DSh05RaI.js.map} +1 -1
  23. package/dist/{index-mf_pX14E.js → index-Dp_n8QEV.js} +2 -2
  24. package/dist/{index-mf_pX14E.js.map → index-Dp_n8QEV.js.map} +1 -1
  25. package/dist/{index-TG_MTC9y.js → index-Mi3qr9J0.js} +2 -2
  26. package/dist/{index-TG_MTC9y.js.map → index-Mi3qr9J0.js.map} +1 -1
  27. package/dist/{index-BllIuJSJ.js → index-QtXlz9l0.js} +3 -3
  28. package/dist/{index-BllIuJSJ.js.map → index-QtXlz9l0.js.map} +1 -1
  29. package/dist/{index-BcTomMXW.js → index-_Sydb5MZ.js} +391 -356
  30. package/dist/index-_Sydb5MZ.js.map +1 -0
  31. package/dist/{index-CkSHCMRN.js → index-fa8d4Dv_.js} +2 -2
  32. package/dist/{index-CkSHCMRN.js.map → index-fa8d4Dv_.js.map} +1 -1
  33. package/dist/{index-CN7r2e0P.js → index-h57rl1RH.js} +11 -11
  34. package/dist/index-h57rl1RH.js.map +1 -0
  35. package/dist/{index-CMmEZcB1.js → index-qbW7-LUD.js} +3 -3
  36. package/dist/index-qbW7-LUD.js.map +1 -0
  37. package/dist/index.d.ts +77 -39
  38. package/dist/index.js +2 -2
  39. package/dist/plugins/index.js +12 -12
  40. package/dist/services/index.js +14 -12
  41. package/dist/style.css +1 -1
  42. package/lib/index.umd.js +15 -15
  43. package/lib/index.umd.js.map +1 -1
  44. package/lib/style.css +1 -1
  45. package/package.json +2 -2
  46. package/dist/index-42B3CrSO.js.map +0 -1
  47. package/dist/index-BcTomMXW.js.map +0 -1
  48. package/dist/index-CMmEZcB1.js.map +0 -1
  49. package/dist/index-CN7r2e0P.js.map +0 -1
  50. package/dist/index-D7rUF8vA.js.map +0 -1
@@ -1,10 +1,10 @@
1
- import { j as _, P as Ae, F as Ie } from "./Promise.withResolvers-C4chhLB1.js";
2
- import { S as Le, a as Fe } from "./index-D7rUF8vA.js";
3
- import { a as re, m as te, u as ae, b as oe, e as T, o as Me, f as le, g as Pe, w as J, n as U, h as F, i as je, j as Te, t as De, k as Re, s as Oe, r as O, l as z, p as qe, q, v as G, F as He, x as Ue, y as Be, z as se, A as Ve, B as ne, c as ze } from "./vueHooks-Bs93iP61.js";
1
+ import { j as _, P as Le, F as Ae } from "./Promise.withResolvers-C4chhLB1.js";
2
+ import { S as Pe, a as Ie } from "./index-CaTtMzfu.js";
3
+ import { a as oe, m as ae, u as se, b as le, e as D, o as Me, f as ce, g as Fe, w as K, n as B, h as I, i as je, j as Re, t as De, k as Te, s as Oe, r as q, l as G, p as qe, q as H, v as J, F as He, x as Ue, y as Be, z as ne, A as Ve, B as re, c as ze } from "./vueHooks-Bs93iP61.js";
4
4
  import { n as Ge } from "./noop-ClDc6zv4.js";
5
5
  import { _ as Je } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
- import { BasePlugin as We } from "./core.js";
7
- const k = '@charset "UTF-8";:host{display:block;font-family:var(--schema-font-family, ui-sans-serif, system-ui, -apple-system);color:var(--schema-color-fg, #111827)}*,*:before,*:after{box-sizing:border-box}.wrapper{display:block;background:var(--schema-color-bg, #ffffff)}.form{display:grid;gap:12px}.field{display:grid;gap:6px;padding:8px 10px;border:1px solid var(--schema-color-muted, #e5e7eb);border-radius:var(--schema-radius, 10px);background:var(--schema-surface, #fff)}.label{font-size:12px;color:var(--schema-color-muted-text, #6b7280)}.input,select,textarea{width:100%;padding:8px 10px;border-radius:8px;border:1px solid var(--schema-color-muted, #e5e7eb);background:var(--schema-input-bg, #fff);color:inherit}.checkbox{display:inline-flex;align-items:center;gap:8px}.helper{font-size:12px;color:var(--schema-color-muted-text, #6b7280)}.row{display:grid;gap:8px}.actions{display:flex;gap:8px}.btn{padding:6px 10px;border:1px solid var(--schema-color-muted, #e5e7eb);background:var(--schema-btn-bg, #f8fafc);border-radius:8px;cursor:pointer;color:var(--schema-color-fg)}.btn.primary{background:var(--schema-color-primary, #2563eb);color:#fff;border-color:transparent}.btn:disabled{opacity:.5;cursor:not-allowed}.btn.danger{background:var(--schema-color-danger, #dc2626);color:#fff;border-color:transparent}.group{display:grid;gap:10px}.kv{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;align-items:center}.badge{display:inline-flex;padding:2px 6px;border-radius:999px;font-size:11px;background:var(--schema-badge-bg, #eef2ff);color:var(--schema-badge-fg, #4f46e5)}.hidden{display:none!important}.toolbar{display:flex;gap:6px}.schema-collection-row{position:relative;transition:transform var(--schema-collection-transition-duration, .25s) var(--schema-collection-transition-ease, ease),opacity var(--schema-collection-transition-duration, .25s) var(--schema-collection-transition-ease, ease)}.schema-collection-row.enter{opacity:0}.schema-collection-row.enter.enter-active{opacity:1}.schema-collection-row.leaving{opacity:0}.field.schema-type-array .group,.field.schema-type-array .group .row{position:relative}', ce = {
6
+ import { BasePlugin as Ke } from "./core.js";
7
+ const w = '@charset "UTF-8";:host{display:block;font-family:var(--schema-font-family, ui-sans-serif, system-ui, -apple-system);color:var(--schema-color-fg, #111827)}*,*:before,*:after{box-sizing:border-box}.wrapper{display:block;background:var(--schema-color-bg, #ffffff)}.form{display:grid;gap:12px}.field{display:grid;gap:6px;padding:8px 10px;border:1px solid var(--schema-color-muted, #e5e7eb);border-radius:var(--schema-radius, 10px);background:var(--schema-surface, #fff)}.label{font-size:12px;color:var(--schema-color-muted-text, #6b7280)}.input,select,textarea{width:100%;padding:8px 10px;border-radius:8px;border:1px solid var(--schema-color-muted, #e5e7eb);background:var(--schema-input-bg, #fff);color:inherit}.checkbox{display:inline-flex;align-items:center;gap:8px}.helper{font-size:12px;color:var(--schema-color-muted-text, #6b7280)}.row{display:grid;gap:8px}.actions{display:flex;gap:8px}.btn{padding:6px 10px;border:1px solid var(--schema-color-muted, #e5e7eb);background:var(--schema-btn-bg, #f8fafc);border-radius:8px;cursor:pointer;color:var(--schema-color-fg)}.btn.primary{background:var(--schema-color-primary, #2563eb);color:#fff;border-color:transparent}.btn:disabled{opacity:.5;cursor:not-allowed}.btn.danger{background:var(--schema-color-danger, #dc2626);color:#fff;border-color:transparent}.group{display:grid;gap:10px}.kv{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;align-items:center}.badge{display:inline-flex;padding:2px 6px;border-radius:999px;font-size:11px;background:var(--schema-badge-bg, #eef2ff);color:var(--schema-badge-fg, #4f46e5)}.hidden{display:none!important}.toolbar{display:flex;gap:6px}.schema-collection-row{position:relative;transition:transform var(--schema-collection-transition-duration, .25s) var(--schema-collection-transition-ease, ease),opacity var(--schema-collection-transition-duration, .25s) var(--schema-collection-transition-ease, ease)}.schema-collection-row.enter{opacity:0}.schema-collection-row.enter.enter-active{opacity:1}.schema-collection-row.leaving{opacity:0}.field.schema-type-array .group,.field.schema-type-array .group .row{position:relative}.keyshortcut-wrap{display:flex;gap:.5em;align-items:center}.keyshortcut-btn{padding:6px 8px;font-size:1em}.keyshortcut-btn.recording{background:var(--schema-color-primary, #2563eb);color:#fff;border-color:transparent;animation:keyshortcut-pulse .5s ease-in-out infinite}@keyframes keyshortcut-pulse{0%,to{opacity:1}50%{opacity:.6}}', ue = {
8
8
  arrayAdd: "+",
9
9
  arrayMoveUp: "↑",
10
10
  arrayMoveDown: "↓",
@@ -14,35 +14,35 @@ const k = '@charset "UTF-8";:host{display:block;font-family:var(--schema-font-fa
14
14
  rootLabel: "root"
15
15
  }, b = (n, e) => {
16
16
  customElements.get(n) || customElements.define(n, e);
17
- }, Qe = (n, e, s) => {
17
+ }, We = (n, e, s) => {
18
18
  if (!e.length) return;
19
- let a = n, t = null, r = null;
19
+ let a = n, t = null, i = null;
20
20
  for (let o = 0; o < e.length - 1; o++) {
21
21
  const c = e[o];
22
22
  let h = a?.[c];
23
- h == null ? (h = typeof e[o + 1] == "number" ? [] : {}, a[c] = h) : typeof h != "object" && (h = typeof e[o + 1] == "number" ? [] : {}, a[c] = h), t = a, r = c, a = h;
23
+ h == null ? (h = typeof e[o + 1] == "number" ? [] : {}, a[c] = h) : typeof h != "object" && (h = typeof e[o + 1] == "number" ? [] : {}, a[c] = h), t = a, i = c, a = h;
24
24
  }
25
- const i = e[e.length - 1];
25
+ const r = e[e.length - 1];
26
26
  if (a == null || typeof a != "object") {
27
- const o = typeof i == "number" ? [] : {};
27
+ const o = typeof r == "number" ? [] : {};
28
28
  if (t)
29
- t[r] = o, a = o;
29
+ t[i] = o, a = o;
30
30
  else
31
31
  return;
32
32
  }
33
33
  try {
34
- a[i] = s;
34
+ a[r] = s;
35
35
  } catch {
36
36
  try {
37
37
  const o = Array.isArray(a) ? a.slice() : { ...a };
38
- o[i] = s, t && (t[r] = o);
38
+ o[r] = s, t && (t[i] = o);
39
39
  } catch {
40
40
  }
41
41
  }
42
- }, R = (n) => n.map(String).join("."), Xe = (n) => n.replace(/[^a-zA-Z0-9_-]/g, "_"), I = (n) => `schema_${Xe(R(n) || "root")}`, P = (n) => R(n), p = (n, ...e) => {
42
+ }, O = (n) => n.map(String).join("."), Qe = (n) => n.replace(/[^a-zA-Z0-9_-]/g, "_"), A = (n) => `schema_${Qe(O(n) || "root")}`, j = (n) => O(n), f = (n, ...e) => {
43
43
  const s = new Set(e);
44
44
  s.size && n.setAttribute("part", Array.from(s).join(" "));
45
- }, Ye = [
45
+ }, Xe = [
46
46
  "wrapper",
47
47
  "form",
48
48
  "field",
@@ -122,10 +122,10 @@ function de(n) {
122
122
  function N(n) {
123
123
  return n?.meta ?? {};
124
124
  }
125
- function Ze(n) {
125
+ function Ye(n) {
126
126
  return n.length > 0 && n.every((e) => e?.type === "const");
127
127
  }
128
- function j(n) {
128
+ function R(n) {
129
129
  if (!n) return;
130
130
  const e = n, s = e.meta || {};
131
131
  if (Object.prototype.hasOwnProperty.call(s, "default")) return s.default;
@@ -154,26 +154,26 @@ function j(n) {
154
154
  return {};
155
155
  case "union": {
156
156
  const t = e.list || [];
157
- return t.length ? j(t[0]) : void 0;
157
+ return t.length ? R(t[0]) : void 0;
158
158
  }
159
159
  case "const":
160
160
  return e.value;
161
161
  case "date":
162
162
  return;
163
163
  case "intersect": {
164
- const t = e.list || [], r = (o, c) => {
164
+ const t = e.list || [], i = (o, c) => {
165
165
  if (Array.isArray(o) && Array.isArray(c)) return c.slice();
166
166
  if (o && c && typeof o == "object" && typeof c == "object") {
167
167
  const h = { ...o };
168
168
  for (const l of Object.keys(c))
169
- h[l] = l in h ? r(h[l], c[l]) : c[l];
169
+ h[l] = l in h ? i(h[l], c[l]) : c[l];
170
170
  return h;
171
171
  }
172
172
  return c ?? o;
173
173
  };
174
- let i = {};
175
- for (const o of t) i = r(i, j(o));
176
- return i;
174
+ let r = {};
175
+ for (const o of t) r = i(r, R(o));
176
+ return r;
177
177
  }
178
178
  default:
179
179
  return;
@@ -181,20 +181,20 @@ function j(n) {
181
181
  }
182
182
  class S extends HTMLElement {
183
183
  constructor() {
184
- super(), this._path = [], this._i18n = ce, this.$root = this.attachShadow({ mode: "open" });
184
+ super(), this._path = [], this._i18n = ue, this.$root = this.attachShadow({ mode: "open" });
185
185
  const e = document.createElement("style");
186
- e.textContent = k, this.$root.appendChild(e);
186
+ e.textContent = w, this.$root.appendChild(e);
187
187
  }
188
188
  /** 初始化公共容器(带类名与 data-path) */
189
189
  makeFieldContainer(e, s) {
190
190
  const a = document.createElement("div");
191
- if (a.className = `field schema-form-item schema-type-${e}`, a.setAttribute("data-path", R(this._path)), p(a, "field", `field-${e}`), this._label) {
191
+ if (a.className = `field schema-form-item schema-type-${e}`, a.setAttribute("data-path", O(this._path)), f(a, "field", `field-${e}`), this._label) {
192
192
  const t = document.createElement("label");
193
- t.className = "label", t.textContent = this._label, p(t, "field-label"), a.appendChild(t);
193
+ t.className = "label", t.textContent = this._label, f(t, "field-label"), a.appendChild(t);
194
194
  }
195
195
  if (s && s !== this._label) {
196
196
  const t = document.createElement("div");
197
- t.className = "helper", t.textContent = s, p(t, "field-helper"), a.appendChild(t);
197
+ t.className = "helper", t.textContent = s, f(t, "field-helper"), a.appendChild(t);
198
198
  }
199
199
  return a;
200
200
  }
@@ -240,113 +240,148 @@ class S extends HTMLElement {
240
240
  );
241
241
  }
242
242
  }
243
- class ue extends S {
243
+ class F extends S {
244
+ static {
245
+ this.recEnd = null;
246
+ }
244
247
  render() {
245
248
  if (this.$input && this.$root.contains(this.$input)) {
246
- const r = !!this.$root.querySelector("label.label");
247
- if (!(this._label && !r)) {
248
- const i = this._value ?? "";
249
- this.$input.value !== i && document.activeElement !== this.$input && (this.$input.value = i);
249
+ const i = !!this.$root.querySelector("label.label");
250
+ if (!(this._label && !i)) {
251
+ const r = this._value ?? "";
252
+ this.$input.value !== r && document.activeElement !== this.$input && (this.$input.value = r);
250
253
  return;
251
254
  }
252
255
  }
253
- this.$root.innerHTML = `<style>${k}</style>`;
256
+ this.$root.innerHTML = `<style>${w}</style>`;
254
257
  const e = N(this._schema), s = this.makeFieldContainer("string", e.description), a = document.createElement("input");
255
- this.$input = a, a.className = "input", p(a, "field-input", "field-input-text"), a.type = "text", a.name = P(this._path), a.id = I(this._path), e?.pattern?.source && (a.pattern = e.pattern.source), e?.max != null && (a.maxLength = e.max), a.value = this._value ?? "", a.oninput = () => this.emitChange(X("string", a.value));
258
+ this.$input = a, a.className = "input", f(a, "field-input", "field-input-text"), a.type = "text", a.name = j(this._path), a.id = A(this._path), e?.pattern?.source && (a.pattern = e.pattern.source), e?.max != null && (a.maxLength = e.max), a.value = this._value ?? "", a.oninput = () => this.emitChange(X("string", a.value));
256
259
  const t = s.querySelector("label.label");
257
- t && (t.htmlFor = a.id), s.appendChild(a), this.$root.appendChild(s);
260
+ if (t && (t.htmlFor = a.id), e.role === "keyshortcut") {
261
+ const i = document.createElement("div");
262
+ i.className = "keyshortcut-wrap";
263
+ const r = document.createElement("button");
264
+ r.type = "button", r.className = "btn keyshortcut-btn", r.title = "Record shortcut", r.textContent = "⌨";
265
+ let o = null;
266
+ const c = () => {
267
+ o && (o(), o = null, r.classList.remove("recording"), r.title = "Record shortcut", F.recEnd === c && (F.recEnd = null));
268
+ };
269
+ r.onclick = () => {
270
+ if (o) {
271
+ c();
272
+ return;
273
+ }
274
+ F.recEnd?.(), F.recEnd = c, r.classList.add("recording"), r.title = "Press your keys! (Esc to cancel)";
275
+ const h = (l) => {
276
+ if (l.preventDefault(), l.stopPropagation(), l.key === "Escape") {
277
+ c();
278
+ return;
279
+ }
280
+ const m = [];
281
+ l.ctrlKey && m.push("ctrl"), l.metaKey && m.push("meta"), l.altKey && m.push("alt"), l.shiftKey && m.push("shift");
282
+ const d = l.key.toLowerCase();
283
+ if (["control", "meta", "alt", "shift"].includes(d)) return;
284
+ m.push(d);
285
+ const p = m.join("-"), u = a.value.trimEnd();
286
+ u.toLowerCase().split(/\s*,\s*/).includes(p) || (a.value = u ? u.replace(/,+$/, "") + ", " + p : p, this.emitChange(a.value)), c();
287
+ };
288
+ document.addEventListener("keydown", h, { capture: !0 }), o = () => document.removeEventListener("keydown", h, { capture: !0 });
289
+ }, i.appendChild(a), i.appendChild(r), s.appendChild(i);
290
+ } else
291
+ s.appendChild(a);
292
+ this.$root.appendChild(s);
258
293
  }
259
294
  }
260
- b("schema-form-string", ue);
295
+ b("schema-form-string", F);
261
296
  class he extends S {
262
297
  render() {
263
298
  if (this.$input && this.$root.contains(this.$input)) {
264
- const i = !!this.$root.querySelector("label.label");
265
- if (!(this._label && !i)) {
299
+ const r = !!this.$root.querySelector("label.label");
300
+ if (!(this._label && !r)) {
266
301
  const o = this._value ?? "";
267
302
  this.$input.value !== String(o) && document.activeElement !== this.$input && (this.$input.value = o);
268
303
  return;
269
304
  }
270
305
  }
271
- this.$root.innerHTML = `<style>${k}</style>`;
306
+ this.$root.innerHTML = `<style>${w}</style>`;
272
307
  const e = this._schema?.type ?? "number", s = N(this._schema), a = this.makeFieldContainer("number", s.description), t = document.createElement("input");
273
- this.$input = t, t.className = "input", p(t, "field-input", "field-input-number"), t.name = P(this._path), t.id = I(this._path), s?.min != null && (t.min = String(s.min)), s?.max != null && (t.max = String(s.max)), s?.step != null && (t.step = String(s.step)), e === "percent" && !t.step && (t.step = "0.01"), t.value = this._value ?? "", t.oninput = () => this.emitChange(X(e, t.value));
274
- const r = a.querySelector("label.label");
275
- r && (r.htmlFor = t.id), s.role === "slider" ? t.type = "range" : t.type = "number", a.appendChild(t), this.$root.appendChild(a);
308
+ this.$input = t, t.className = "input", f(t, "field-input", "field-input-number"), t.name = j(this._path), t.id = A(this._path), s?.min != null && (t.min = String(s.min)), s?.max != null && (t.max = String(s.max)), s?.step != null && (t.step = String(s.step)), e === "percent" && !t.step && (t.step = "0.01"), t.value = this._value ?? "", t.oninput = () => this.emitChange(X(e, t.value));
309
+ const i = a.querySelector("label.label");
310
+ i && (i.htmlFor = t.id), s.role === "slider" ? t.type = "range" : t.type = "number", a.appendChild(t), this.$root.appendChild(a);
276
311
  }
277
312
  }
278
313
  b("schema-form-number", he);
279
314
  class me extends S {
280
315
  render() {
281
- this.$root.innerHTML = `<style>${k}</style>`;
316
+ this.$root.innerHTML = `<style>${w}</style>`;
282
317
  const e = N(this._schema), s = this.makeFieldContainer("boolean", e.description), a = document.createElement("label");
283
- a.className = "checkbox", p(a, "field-checkbox");
318
+ a.className = "checkbox", f(a, "field-checkbox");
284
319
  const t = document.createElement("input");
285
- t.type = "checkbox", t.checked = !!this._value, t.name = P(this._path), t.id = I(this._path), p(t, "field-input", "field-input-checkbox");
286
- const r = document.createElement("span");
287
- r.textContent = e.description ?? this._label ?? "", p(r, "field-checkbox-text"), t.onchange = () => this.emitChange(t.checked);
288
- const i = s.querySelector("label.label");
289
- i && (i.htmlFor = t.id), a.append(t, r), s.appendChild(a), this.$root.appendChild(s);
320
+ t.type = "checkbox", t.checked = !!this._value, t.name = j(this._path), t.id = A(this._path), f(t, "field-input", "field-input-checkbox");
321
+ const i = document.createElement("span");
322
+ i.textContent = e.description ?? this._label ?? "", f(i, "field-checkbox-text"), t.onchange = () => this.emitChange(t.checked);
323
+ const r = s.querySelector("label.label");
324
+ r && (r.htmlFor = t.id), a.append(t, i), s.appendChild(a), this.$root.appendChild(s);
290
325
  }
291
326
  }
292
327
  b("schema-form-boolean", me);
293
- function B(n) {
328
+ function V(n) {
294
329
  return String(n).padStart(2, "0");
295
330
  }
296
- function D(n) {
297
- return `${n.getFullYear()}-${B(n.getMonth() + 1)}-${B(n.getDate())}`;
331
+ function T(n) {
332
+ return `${n.getFullYear()}-${V(n.getMonth() + 1)}-${V(n.getDate())}`;
298
333
  }
299
334
  function W(n) {
300
- return `${B(n.getHours())}:${B(n.getMinutes())}`;
335
+ return `${V(n.getHours())}:${V(n.getMinutes())}`;
301
336
  }
302
- function H(n) {
303
- return `${D(n)}T${W(n)}`;
337
+ function U(n) {
338
+ return `${T(n)}T${W(n)}`;
304
339
  }
305
340
  class pe extends S {
306
341
  render() {
307
342
  if (this.$input && this.$root.contains(this.$input)) {
308
- const i = !!this.$root.querySelector("label.label");
309
- if (!(this._label && !i)) {
343
+ const r = !!this.$root.querySelector("label.label");
344
+ if (!(this._label && !r)) {
310
345
  const o = N(this._schema).role || "date";
311
346
  if (document.activeElement !== this.$input)
312
347
  if (this._value instanceof Date)
313
- o === "date" ? this.$input.value = D(this._value) : o === "time" ? this.$input.value = W(this._value) : o === "datetime" && (this.$input.value = H(this._value));
348
+ o === "date" ? this.$input.value = T(this._value) : o === "time" ? this.$input.value = W(this._value) : o === "datetime" && (this.$input.value = U(this._value));
314
349
  else if (typeof this._value == "string" && o !== "time") {
315
350
  const c = new Date(this._value);
316
- isNaN(+c) || (o === "date" ? this.$input.value = D(c) : o === "datetime" && (this.$input.value = H(c)));
351
+ isNaN(+c) || (o === "date" ? this.$input.value = T(c) : o === "datetime" && (this.$input.value = U(c)));
317
352
  } else this._value || (this.$input.value = "");
318
353
  return;
319
354
  }
320
355
  }
321
- this.$root.innerHTML = `<style>${k}</style>`;
356
+ this.$root.innerHTML = `<style>${w}</style>`;
322
357
  const e = N(this._schema), s = this.makeFieldContainer("date", e.description), a = document.createElement("input");
323
- this.$input = a, a.className = "input", p(a, "field-input", "field-input-date");
358
+ this.$input = a, a.className = "input", f(a, "field-input", "field-input-date");
324
359
  const t = e.role || "date";
325
- if (t === "datetime" ? a.type = "datetime-local" : t === "time" ? a.type = "time" : a.type = "date", a.name = P(this._path), a.id = I(this._path), this._value instanceof Date)
326
- t === "date" ? a.value = D(this._value) : t === "time" ? a.value = W(this._value) : t === "datetime" && (a.value = H(this._value));
360
+ if (t === "datetime" ? a.type = "datetime-local" : t === "time" ? a.type = "time" : a.type = "date", a.name = j(this._path), a.id = A(this._path), this._value instanceof Date)
361
+ t === "date" ? a.value = T(this._value) : t === "time" ? a.value = W(this._value) : t === "datetime" && (a.value = U(this._value));
327
362
  else if (typeof this._value == "string" && t !== "time") {
328
- const i = new Date(this._value);
329
- isNaN(+i) || (t === "date" ? a.value = D(i) : t === "datetime" && (a.value = H(i)));
363
+ const r = new Date(this._value);
364
+ isNaN(+r) || (t === "date" ? a.value = T(r) : t === "datetime" && (a.value = U(r)));
330
365
  }
331
366
  a.oninput = () => {
332
367
  e.role;
333
- let i;
368
+ let r;
334
369
  if (!a.value)
335
- i = void 0;
370
+ r = void 0;
336
371
  else {
337
372
  const o = new Date(a.value);
338
- i = Number.isNaN(+o) ? void 0 : o;
373
+ r = Number.isNaN(+o) ? void 0 : o;
339
374
  }
340
- this.emitChange(i);
375
+ this.emitChange(r);
341
376
  };
342
- const r = s.querySelector("label.label");
343
- r && (r.htmlFor = a.id), s.appendChild(a), this.$root.appendChild(s);
377
+ const i = s.querySelector("label.label");
378
+ i && (i.htmlFor = a.id), s.appendChild(a), this.$root.appendChild(s);
344
379
  }
345
380
  }
346
381
  b("schema-form-date", pe);
347
382
  class Y extends S {
348
383
  render() {
349
- this.$root.innerHTML = `<style>${k}</style>`;
384
+ this.$root.innerHTML = `<style>${w}</style>`;
350
385
  const e = N(this._schema), s = this._schema.value;
351
386
  if (e.role === "raw-html") {
352
387
  if (s instanceof Node) {
@@ -356,47 +391,47 @@ class Y extends S {
356
391
  this.$root.append(s());
357
392
  return;
358
393
  } else if (typeof s == "string") {
359
- const i = document.createElement("div");
360
- i.innerHTML = String(s), p(i, "field-const-value"), this.$root.appendChild(i);
394
+ const r = document.createElement("div");
395
+ r.innerHTML = String(s), f(r, "field-const-value"), this.$root.appendChild(r);
361
396
  return;
362
397
  }
363
398
  }
364
399
  const a = this.makeFieldContainer("const", e.description), t = document.createElement("section");
365
- t.className = "const content", t.textContent = String(s), t.id = I(this._path), p(t, "field-const-value");
366
- const r = a.querySelector("label.label");
367
- r && (r.htmlFor = t.id), a.appendChild(t), this.$root.appendChild(a);
400
+ t.className = "const content", t.textContent = String(s), t.id = A(this._path), f(t, "field-const-value");
401
+ const i = a.querySelector("label.label");
402
+ i && (i.htmlFor = t.id), a.appendChild(t), this.$root.appendChild(a);
368
403
  }
369
404
  }
370
405
  b("schema-form-const", Y);
371
406
  class fe extends S {
372
407
  render() {
373
- this.$root.innerHTML = `<style>${k}</style>`;
408
+ this.$root.innerHTML = `<style>${w}</style>`;
374
409
  const e = N(this._schema), s = this.makeFieldContainer("intersect", e.description);
375
410
  s.classList.remove("field");
376
411
  const a = document.createElement("div");
377
- a.classList.add("group"), p(a, "field-group");
378
- const t = this._schema.list || [], r = t.length > 0 && t.every((o) => o?.type === "object"), i = (o, c) => {
412
+ a.classList.add("group"), f(a, "field-group");
413
+ const t = this._schema.list || [], i = t.length > 0 && t.every((o) => o?.type === "object"), r = (o, c) => {
379
414
  if (Array.isArray(o) && Array.isArray(c)) return c.slice();
380
415
  if (o && c && typeof o == "object" && typeof c == "object") {
381
416
  const h = { ...o };
382
417
  for (const l of Object.keys(c))
383
- h[l] = l in h ? i(h[l], c[l]) : c[l];
418
+ h[l] = l in h ? r(h[l], c[l]) : c[l];
384
419
  return h;
385
420
  }
386
421
  return c ?? o;
387
422
  };
388
- if (r) {
423
+ if (i) {
389
424
  const o = this._value && typeof this._value == "object" ? this._value : {};
390
425
  t.forEach((c, h) => {
391
- const l = c?.meta?.description ?? "", m = L(c, this._path, o, l, this._i18n);
392
- m.addEventListener("change", (u) => {
393
- u.stopPropagation();
394
- const f = i(this._value ?? {}, u.detail.value);
395
- this.emitChange(f);
426
+ const l = c?.meta?.description ?? "", m = P(c, this._path, o, l, this._i18n);
427
+ m.addEventListener("change", (d) => {
428
+ d.stopPropagation();
429
+ const p = r(this._value ?? {}, d.detail.value);
430
+ this.emitChange(p);
396
431
  }), a.appendChild(m);
397
432
  });
398
433
  } else {
399
- const o = t[t.length - 1], c = L(o, this._path, this._value, this._label, this._i18n);
434
+ const o = t[t.length - 1], c = P(o, this._path, this._value, this._label, this._i18n);
400
435
  c.addEventListener("change", (h) => {
401
436
  h.stopPropagation(), this.emitChange(h.detail.value);
402
437
  }), a.appendChild(c);
@@ -405,7 +440,7 @@ class fe extends S {
405
440
  }
406
441
  }
407
442
  b("schema-form-intersect", fe);
408
- function Ke(n) {
443
+ function Ze(n) {
409
444
  switch (n.type) {
410
445
  case "intersect":
411
446
  return "schema-form-intersect";
@@ -437,45 +472,45 @@ function Ke(n) {
437
472
  return "schema-form-string";
438
473
  }
439
474
  }
440
- function L(n, e, s, a, t) {
441
- const r = Ke(n), i = document.createElement(r);
442
- return i.schema = n, i.path = e, i.label = a, t && (i.i18n = t), i.setValue?.(s), i.setAttribute("exportparts", Ye), i;
475
+ function P(n, e, s, a, t) {
476
+ const i = Ze(n), r = document.createElement(i);
477
+ return r.schema = n, r.path = e, r.label = a, t && (r.i18n = t), r.setValue?.(s), r.setAttribute("exportparts", Xe), r;
443
478
  }
444
479
  class ve extends S {
445
480
  render() {
446
- this.$root.innerHTML = `<style>${k}</style>`;
481
+ this.$root.innerHTML = `<style>${w}</style>`;
447
482
  const e = N(this._schema), s = this.makeFieldContainer("union", e.description), a = this._schema.list || [];
448
- if (Ze(a)) {
483
+ if (Ye(a)) {
449
484
  const t = document.createElement("select");
450
- t.className = "input", p(t, "field-input", "field-input-select"), t.name = P(this._path), t.id = I(this._path), a.forEach((i) => {
485
+ t.className = "input", f(t, "field-input", "field-input-select"), t.name = j(this._path), t.id = A(this._path), a.forEach((r) => {
451
486
  const o = document.createElement("option");
452
- o.value = String(i.value), o.textContent = String(i.meta?.description || i.value || i.type), this._value === i.value && (o.selected = !0), t.appendChild(o);
487
+ o.value = String(r.value), o.textContent = String(r.meta?.description || r.value || r.type), this._value === r.value && (o.selected = !0), t.appendChild(o);
453
488
  }), t.onchange = () => this.emitChange(X("string", t.value));
454
- const r = s.querySelector("label.label");
455
- r && (r.htmlFor = t.id), s.appendChild(t);
489
+ const i = s.querySelector("label.label");
490
+ i && (i.htmlFor = t.id), s.appendChild(t);
456
491
  } else {
457
492
  const t = document.createElement("div");
458
- t.className = "toolbar", p(t, "field-toolbar");
459
- const r = document.createElement("select");
460
- r.className = "input", p(r, "field-input", "field-input-select", "field-toolbar-select"), r.name = P(this._path) + ".__type", r.id = I(this._path) + "__type";
461
- let i = 0;
493
+ t.className = "toolbar", f(t, "field-toolbar");
494
+ const i = document.createElement("select");
495
+ i.className = "input", f(i, "field-input", "field-input-select", "field-toolbar-select"), i.name = j(this._path) + ".__type", i.id = A(this._path) + "__type";
496
+ let r = 0;
462
497
  a.forEach((l, m) => {
463
- const u = document.createElement("option");
464
- u.value = String(m), u.textContent = String(l.meta?.description || l.value || l.type), r.appendChild(u);
465
- }), r.onchange = () => {
466
- i = Number(r.value);
467
- const l = a[i], m = j(l);
498
+ const d = document.createElement("option");
499
+ d.value = String(m), d.textContent = String(l.meta?.description || l.value || l.type), i.appendChild(d);
500
+ }), i.onchange = () => {
501
+ r = Number(i.value);
502
+ const l = a[r], m = R(l);
468
503
  this.emitChange(m), h();
469
504
  };
470
505
  const o = s.querySelector("label.label");
471
- o && (o.htmlFor = r.id), t.appendChild(r), s.appendChild(t);
506
+ o && (o.htmlFor = i.id), t.appendChild(i), s.appendChild(t);
472
507
  const c = document.createElement("div");
473
- c.className = "group", p(c, "field-group");
508
+ c.className = "group", f(c, "field-group");
474
509
  const h = () => {
475
510
  c.innerHTML = "";
476
- const l = a[i], m = L(l, this._path, this._value, this._label);
477
- m instanceof Y || (m.addEventListener("change", (u) => {
478
- u.stopPropagation(), this.emitChange(u.detail.value);
511
+ const l = a[r], m = P(l, this._path, this._value, this._label);
512
+ m instanceof Y || (m.addEventListener("change", (d) => {
513
+ d.stopPropagation(), this.emitChange(d.detail.value);
479
514
  }), c.appendChild(m));
480
515
  };
481
516
  h(), s.appendChild(c);
@@ -486,21 +521,21 @@ class ve extends S {
486
521
  b("schema-form-union", ve);
487
522
  class ge extends S {
488
523
  render() {
489
- this.$root.innerHTML = `<style>${k}</style>`;
524
+ this.$root.innerHTML = `<style>${w}</style>`;
490
525
  const e = N(this._schema), s = this.makeFieldContainer("tuple", e.description), a = document.createElement("div");
491
- a.className = "group", p(a, "field-group");
526
+ a.className = "group", f(a, "field-group");
492
527
  const t = Array.isArray(this._value) ? this._value : [];
493
- (this._schema.list || []).forEach((r, i) => {
494
- const o = L(
495
- r,
496
- [...this._path, i],
497
- t[i],
498
- `${this._label ?? ""}[${i}]`
528
+ (this._schema.list || []).forEach((i, r) => {
529
+ const o = P(
530
+ i,
531
+ [...this._path, r],
532
+ t[r],
533
+ `${this._label ?? ""}[${r}]`
499
534
  );
500
535
  o.addEventListener("change", (c) => {
501
536
  c.stopPropagation();
502
537
  const h = Array.isArray(this._value) ? this._value.slice() : [];
503
- h[i] = c.detail.value, this.emitChange(h);
538
+ h[r] = c.detail.value, this.emitChange(h);
504
539
  }), a.appendChild(o);
505
540
  }), s.appendChild(a), this.$root.appendChild(s);
506
541
  }
@@ -508,23 +543,23 @@ class ge extends S {
508
543
  b("schema-form-tuple", ge);
509
544
  class _e extends S {
510
545
  render() {
511
- this.$root.innerHTML = `<style>${k}</style>`;
546
+ this.$root.innerHTML = `<style>${w}</style>`;
512
547
  const e = N(this._schema), s = this.makeFieldContainer("object", e.description), a = document.createElement("div");
513
- a.className = "group", p(a, "field-group");
548
+ a.className = "group", f(a, "field-group");
514
549
  const t = this._schema.dict || {};
515
- Object.keys(t).forEach((r) => {
516
- if (t[r]?.meta?.hidden) return;
517
- const i = (this._value ?? {})[r], o = L(t[r], [...this._path, r], i, r);
550
+ Object.keys(t).forEach((i) => {
551
+ if (t[i]?.meta?.hidden) return;
552
+ const r = (this._value ?? {})[i], o = P(t[i], [...this._path, i], r, i);
518
553
  o.addEventListener("change", (c) => {
519
554
  c.stopPropagation();
520
555
  const h = { ...this._value ?? {} };
521
- h[r] = c.detail.value, this.emitChange(h);
556
+ h[i] = c.detail.value, this.emitChange(h);
522
557
  }), a.appendChild(o);
523
558
  }), s.appendChild(a), this.$root.appendChild(s);
524
559
  }
525
560
  }
526
561
  b("schema-form-object", _e);
527
- class V extends S {
562
+ class z extends S {
528
563
  constructor() {
529
564
  super(...arguments), this._itemIds = [];
530
565
  }
@@ -537,7 +572,7 @@ class V extends S {
537
572
  return crypto.randomUUID();
538
573
  } catch {
539
574
  }
540
- return "i" + V._idCounter++;
575
+ return "i" + z._idCounter++;
541
576
  }
542
577
  ensureItemIds(e) {
543
578
  for (; this._itemIds.length < e; ) this._itemIds.push(this.generateItemId());
@@ -555,169 +590,169 @@ class V extends S {
555
590
  Array.from(e.querySelectorAll(".row")).forEach((a) => {
556
591
  const t = a.dataset.uid;
557
592
  if (!t) return;
558
- const r = s[t];
559
- if (!r) return;
560
- const i = a.getBoundingClientRect(), o = r.left - i.left, c = r.top - i.top;
593
+ const i = s[t];
594
+ if (!i) return;
595
+ const r = a.getBoundingClientRect(), o = i.left - r.left, c = i.top - r.top;
561
596
  (o || c) && (a.style.transition = "none", a.style.transform = `translate(${o}px, ${c}px)`, requestAnimationFrame(() => {
562
597
  a.style.transition = "transform .25s ease", a.style.transform = "";
563
598
  }));
564
599
  });
565
600
  }
566
601
  render() {
567
- this.$root.innerHTML = `<style>${k}</style>`;
602
+ this.$root.innerHTML = `<style>${w}</style>`;
568
603
  const e = N(this._schema), s = this.makeFieldContainer("array", e.description), a = document.createElement("div");
569
- a.className = "group", p(a, "field-group");
570
- const t = this._schema.inner, r = () => Array.isArray(this._value) ? this._value : [];
571
- this.ensureItemIds(r().length);
572
- const i = (h, l) => {
573
- a.innerHTML = "", r().forEach((m, u) => {
574
- const f = [...this._path, u], d = document.createElement("div");
575
- d.className = "row schema-collection-row", p(d, "field-row", "collection-row");
576
- const g = this._itemIds[u];
577
- d.dataset.uid = g, d.setAttribute("data-path", R(f));
578
- const v = L(
604
+ a.className = "group", f(a, "field-group");
605
+ const t = this._schema.inner, i = () => Array.isArray(this._value) ? this._value : [];
606
+ this.ensureItemIds(i().length);
607
+ const r = (h, l) => {
608
+ a.innerHTML = "", i().forEach((m, d) => {
609
+ const p = [...this._path, d], u = document.createElement("div");
610
+ u.className = "row schema-collection-row", f(u, "field-row", "collection-row");
611
+ const g = this._itemIds[d];
612
+ u.dataset.uid = g, u.setAttribute("data-path", O(p));
613
+ const v = P(
579
614
  t,
580
- f,
615
+ p,
581
616
  m,
582
- `${this._label ?? ""}[${u}]`
617
+ `${this._label ?? ""}[${d}]`
583
618
  );
584
- v.addEventListener("change", ($) => {
585
- $.stopPropagation();
586
- const x = r().slice();
587
- x[u] = $.detail.value, this._value = x, this.emitChange(x);
619
+ v.addEventListener("change", (E) => {
620
+ E.stopPropagation();
621
+ const C = i().slice();
622
+ C[d] = E.detail.value, this._value = C, this.emitChange(C);
588
623
  });
589
- const C = document.createElement("div");
590
- C.className = "actions", p(C, "field-actions");
591
- const w = document.createElement("button");
592
- w.type = "button", w.className = "btn", p(w, "field-button", "field-button-secondary"), w.textContent = this._i18n.arrayMoveUp ?? "↑", w.onclick = () => {
593
- if (u <= 0) return;
594
- const $ = this.capturePositions(a), x = r().slice();
595
- [x[u - 1], x[u]] = [x[u], x[u - 1]], [this._itemIds[u - 1], this._itemIds[u]] = [
596
- this._itemIds[u],
597
- this._itemIds[u - 1]
598
- ], this._value = x, i($), this.emitChange(x);
624
+ const x = document.createElement("div");
625
+ x.className = "actions", f(x, "field-actions");
626
+ const k = document.createElement("button");
627
+ k.type = "button", k.className = "btn", f(k, "field-button", "field-button-secondary"), k.textContent = this._i18n.arrayMoveUp ?? "↑", k.onclick = () => {
628
+ if (d <= 0) return;
629
+ const E = this.capturePositions(a), C = i().slice();
630
+ [C[d - 1], C[d]] = [C[d], C[d - 1]], [this._itemIds[d - 1], this._itemIds[d]] = [
631
+ this._itemIds[d],
632
+ this._itemIds[d - 1]
633
+ ], this._value = C, r(E), this.emitChange(C);
599
634
  };
600
- const E = document.createElement("button");
601
- E.type = "button", E.className = "btn", p(E, "field-button", "field-button-secondary"), E.textContent = this._i18n.arrayMoveDown ?? "↓", E.onclick = () => {
602
- const $ = r();
603
- if (u >= $.length - 1) return;
604
- const x = this.capturePositions(a), A = $.slice();
605
- [A[u + 1], A[u]] = [A[u], A[u + 1]], [this._itemIds[u + 1], this._itemIds[u]] = [
606
- this._itemIds[u],
607
- this._itemIds[u + 1]
608
- ], this._value = A, i(x), this.emitChange(A);
635
+ const $ = document.createElement("button");
636
+ $.type = "button", $.className = "btn", f($, "field-button", "field-button-secondary"), $.textContent = this._i18n.arrayMoveDown ?? "↓", $.onclick = () => {
637
+ const E = i();
638
+ if (d >= E.length - 1) return;
639
+ const C = this.capturePositions(a), L = E.slice();
640
+ [L[d + 1], L[d]] = [L[d], L[d + 1]], [this._itemIds[d + 1], this._itemIds[d]] = [
641
+ this._itemIds[d],
642
+ this._itemIds[d + 1]
643
+ ], this._value = L, r(C), this.emitChange(L);
609
644
  };
610
645
  const y = document.createElement("button");
611
- y.type = "button", y.className = "btn danger", p(y, "field-button", "field-button-danger"), y.textContent = this._i18n.arrayRemove ?? "×", y.onclick = () => {
612
- d.classList.add("leaving");
613
- const $ = 250;
614
- let x = !1;
615
- const A = () => {
616
- if (x) return;
617
- x = !0, clearTimeout(ke);
618
- const ee = r().filter((xt, Se) => Se !== u);
619
- this._itemIds.splice(u, 1);
646
+ y.type = "button", y.className = "btn danger", f(y, "field-button", "field-button-danger"), y.textContent = this._i18n.arrayRemove ?? "×", y.onclick = () => {
647
+ u.classList.add("leaving");
648
+ const E = 250;
649
+ let C = !1;
650
+ const L = () => {
651
+ if (C) return;
652
+ C = !0, clearTimeout(we);
653
+ const te = i().filter((Ct, Se) => Se !== d);
654
+ this._itemIds.splice(d, 1);
620
655
  const Ne = this.capturePositions(a);
621
- this._value = ee, i(Ne), this.emitChange(ee);
656
+ this._value = te, r(Ne), this.emitChange(te);
622
657
  };
623
- d.addEventListener("transitionend", A, { once: !0 });
624
- const ke = setTimeout(A, $ + 80);
625
- }, C.append(w, E, y), d.appendChild(v), d.appendChild(C), a.appendChild(d), l && l === g && (d.classList.add("enter"), requestAnimationFrame(() => {
626
- d.classList.add("enter-active");
658
+ u.addEventListener("transitionend", L, { once: !0 });
659
+ const we = setTimeout(L, E + 80);
660
+ }, x.append(k, $, y), u.appendChild(v), u.appendChild(x), a.appendChild(u), l && l === g && (u.classList.add("enter"), requestAnimationFrame(() => {
661
+ u.classList.add("enter-active");
627
662
  }), requestAnimationFrame(() => {
628
- d.classList.remove("enter");
663
+ u.classList.remove("enter");
629
664
  }));
630
665
  }), h && this.playFLIP(a, h);
631
666
  };
632
- i();
667
+ r();
633
668
  const o = document.createElement("button");
634
- o.type = "button", o.className = "btn primary", p(o, "field-button", "field-button-primary"), o.textContent = this._i18n.arrayAdd ?? "+", o.onclick = () => {
635
- const h = this.capturePositions(a), l = r().slice(), m = j(t);
669
+ o.type = "button", o.className = "btn primary", f(o, "field-button", "field-button-primary"), o.textContent = this._i18n.arrayAdd ?? "+", o.onclick = () => {
670
+ const h = this.capturePositions(a), l = i().slice(), m = R(t);
636
671
  l.push(m);
637
- const u = this.generateItemId();
638
- this._itemIds.push(u), this._value = l, i(h, u), this.emitChange(l);
672
+ const d = this.generateItemId();
673
+ this._itemIds.push(d), this._value = l, r(h, d), this.emitChange(l);
639
674
  };
640
675
  const c = document.createElement("div");
641
- c.className = "actions", p(c, "field-actions"), c.appendChild(o), s.appendChild(a), s.appendChild(c), this.$root.appendChild(s);
676
+ c.className = "actions", f(c, "field-actions"), c.appendChild(o), s.appendChild(a), s.appendChild(c), this.$root.appendChild(s);
642
677
  }
643
678
  }
644
- b("schema-form-array", V);
679
+ b("schema-form-array", z);
645
680
  class be extends S {
646
681
  render() {
647
- this.$root.innerHTML = `<style>${k}</style>`;
682
+ this.$root.innerHTML = `<style>${w}</style>`;
648
683
  const e = N(this._schema), s = this.makeFieldContainer("dict", e.description), a = document.createElement("div");
649
- a.className = "group", p(a, "field-group");
650
- const t = this._schema.inner, r = this._value ?? {}, i = (u) => `d_${u}`, o = () => {
651
- const u = {};
652
- return a.querySelectorAll(".kv").forEach((f) => {
653
- const d = f.dataset.uid;
654
- d && (u[d] = f.getBoundingClientRect());
655
- }), u;
656
- }, c = (u) => {
657
- a.querySelectorAll(".kv").forEach((f) => {
658
- const d = f.dataset.uid;
659
- if (!d) return;
660
- const g = u[d];
684
+ a.className = "group", f(a, "field-group");
685
+ const t = this._schema.inner, i = this._value ?? {}, r = (d) => `d_${d}`, o = () => {
686
+ const d = {};
687
+ return a.querySelectorAll(".kv").forEach((p) => {
688
+ const u = p.dataset.uid;
689
+ u && (d[u] = p.getBoundingClientRect());
690
+ }), d;
691
+ }, c = (d) => {
692
+ a.querySelectorAll(".kv").forEach((p) => {
693
+ const u = p.dataset.uid;
694
+ if (!u) return;
695
+ const g = d[u];
661
696
  if (!g) return;
662
- const v = f.getBoundingClientRect(), C = g.left - v.left, w = g.top - v.top;
663
- (C || w) && (f.style.transition = "none", f.style.transform = `translate(${C}px, ${w}px)`, requestAnimationFrame(() => {
664
- f.style.transition = "transform .25s ease", f.style.transform = "";
697
+ const v = p.getBoundingClientRect(), x = g.left - v.left, k = g.top - v.top;
698
+ (x || k) && (p.style.transition = "none", p.style.transform = `translate(${x}px, ${k}px)`, requestAnimationFrame(() => {
699
+ p.style.transition = "transform .25s ease", p.style.transform = "";
665
700
  }));
666
701
  });
667
- }, h = (u, f) => {
668
- a.innerHTML = "", Object.keys(r).forEach((d) => {
669
- const g = [...this._path, d], v = document.createElement("div");
670
- v.className = "kv schema-collection-row", p(v, "field-row", "collection-row"), v.dataset.uid = i(d), v.setAttribute("data-path", R(g));
671
- const C = document.createElement("input");
672
- C.className = "input", p(C, "field-input", "field-input-text"), C.value = d, C.name = P(g) + ".__key", C.id = I(g) + "__key";
673
- const w = L(t, g, r[d], `${this._label ?? ""}[${d}]`), E = document.createElement("button");
674
- E.type = "button", E.className = "btn danger", p(E, "field-button", "field-button-danger"), E.textContent = this._i18n.dictRemove ?? "×", E.onclick = () => {
702
+ }, h = (d, p) => {
703
+ a.innerHTML = "", Object.keys(i).forEach((u) => {
704
+ const g = [...this._path, u], v = document.createElement("div");
705
+ v.className = "kv schema-collection-row", f(v, "field-row", "collection-row"), v.dataset.uid = r(u), v.setAttribute("data-path", O(g));
706
+ const x = document.createElement("input");
707
+ x.className = "input", f(x, "field-input", "field-input-text"), x.value = u, x.name = j(g) + ".__key", x.id = A(g) + "__key";
708
+ const k = P(t, g, i[u], `${this._label ?? ""}[${u}]`), $ = document.createElement("button");
709
+ $.type = "button", $.className = "btn danger", f($, "field-button", "field-button-danger"), $.textContent = this._i18n.dictRemove ?? "×", $.onclick = () => {
675
710
  const y = o();
676
- delete r[d];
677
- const $ = { ...this._value ?? {} };
678
- delete $[d], this._value = $, h(y), this.emitChange($);
679
- }, C.onchange = () => {
680
- const y = C.value.trim();
681
- if (!y || y === d || r[y] !== void 0) return;
682
- const $ = o();
683
- r[y] = r[d], delete r[d];
684
- const x = { ...this._value ?? {} };
685
- x[y] = x[d], delete x[d], this._value = x, h($), this.emitChange(x);
686
- }, w.addEventListener("change", (y) => {
711
+ delete i[u];
712
+ const E = { ...this._value ?? {} };
713
+ delete E[u], this._value = E, h(y), this.emitChange(E);
714
+ }, x.onchange = () => {
715
+ const y = x.value.trim();
716
+ if (!y || y === u || i[y] !== void 0) return;
717
+ const E = o();
718
+ i[y] = i[u], delete i[u];
719
+ const C = { ...this._value ?? {} };
720
+ C[y] = C[u], delete C[u], this._value = C, h(E), this.emitChange(C);
721
+ }, k.addEventListener("change", (y) => {
687
722
  y.stopPropagation();
688
- const $ = { ...this._value ?? {} };
689
- $[d] = y.detail.value, this._value = $, this.emitChange($);
690
- }), v.append(C, w, E), a.appendChild(v), f === d && (v.classList.add("enter"), requestAnimationFrame(() => v.classList.add("enter-active")), requestAnimationFrame(() => v.classList.remove("enter")));
691
- }), u && c(u);
723
+ const E = { ...this._value ?? {} };
724
+ E[u] = y.detail.value, this._value = E, this.emitChange(E);
725
+ }), v.append(x, k, $), a.appendChild(v), p === u && (v.classList.add("enter"), requestAnimationFrame(() => v.classList.add("enter-active")), requestAnimationFrame(() => v.classList.remove("enter")));
726
+ }), d && c(d);
692
727
  };
693
728
  h();
694
729
  const l = document.createElement("button");
695
- l.type = "button", l.className = "btn primary", p(l, "field-button", "field-button-primary"), l.textContent = this._i18n.dictAdd ?? "+", l.onclick = () => {
696
- let u = Object.keys(r).length + 1, f = `k${u}`;
697
- for (; r[f] !== void 0; ) f = `k${++u}`;
698
- const d = o();
699
- r[f] = j(t);
700
- const g = { ...this._value ?? {}, [f]: r[f] };
701
- this._value = g, h(d, f), this.emitChange(g);
730
+ l.type = "button", l.className = "btn primary", f(l, "field-button", "field-button-primary"), l.textContent = this._i18n.dictAdd ?? "+", l.onclick = () => {
731
+ let d = Object.keys(i).length + 1, p = `k${d}`;
732
+ for (; i[p] !== void 0; ) p = `k${++d}`;
733
+ const u = o();
734
+ i[p] = R(t);
735
+ const g = { ...this._value ?? {}, [p]: i[p] };
736
+ this._value = g, h(u, p), this.emitChange(g);
702
737
  };
703
738
  const m = document.createElement("div");
704
- m.className = "actions", p(m, "field-actions"), m.appendChild(l), s.appendChild(a), s.appendChild(m), this.$root.appendChild(s);
739
+ m.className = "actions", f(m, "field-actions"), m.appendChild(l), s.appendChild(a), s.appendChild(m), this.$root.appendChild(s);
705
740
  }
706
741
  }
707
742
  b("schema-form-dict", be);
708
743
  class ye extends HTMLElement {
709
744
  constructor() {
710
- super(), this._i18n = { ...ce }, this._i18nCommitted = !1, this.$root = this.attachShadow({ mode: "open" });
745
+ super(), this._i18n = { ...ue }, this._i18nCommitted = !1, this.$root = this.attachShadow({ mode: "open" });
711
746
  const e = document.createElement("style");
712
- e.textContent = k, this.$root.appendChild(e);
747
+ e.textContent = w, this.$root.appendChild(e);
713
748
  const s = document.createElement("div");
714
- s.className = "wrapper", p(s, "wrapper");
749
+ s.className = "wrapper", f(s, "wrapper");
715
750
  const a = document.createElement("form");
716
- a.className = "form", p(a, "form"), s.appendChild(a), this.$root.appendChild(s), this.addEventListener("change", (t) => {
751
+ a.className = "form", f(a, "form"), s.appendChild(a), this.$root.appendChild(s), this.addEventListener("change", (t) => {
717
752
  if (!t?.detail) return;
718
- const { path: r, value: i } = t.detail;
719
- Array.isArray(r) && r.length === 0 ? this._state = i : Qe(this._state ?? (this._state = {}), r, i), this.dispatchEvent(
720
- new CustomEvent("form-change", { detail: { path: r, value: i, state: this._state } })
753
+ const { path: i, value: r } = t.detail;
754
+ Array.isArray(i) && i.length === 0 ? this._state = r : We(this._state ?? (this._state = {}), i, r), this.dispatchEvent(
755
+ new CustomEvent("form-change", { detail: { path: i, value: r, state: this._state } })
721
756
  );
722
757
  });
723
758
  }
@@ -727,7 +762,7 @@ class ye extends HTMLElement {
727
762
  try {
728
763
  this._state = this._schema(null, { autofix: !0 });
729
764
  } catch {
730
- this._state = j(this._schema);
765
+ this._state = R(this._schema);
731
766
  }
732
767
  this.render();
733
768
  }
@@ -754,7 +789,7 @@ class ye extends HTMLElement {
754
789
  try {
755
790
  this._state = this._schema(null, { autofix: !0 });
756
791
  } catch {
757
- this._state = j(this._schema);
792
+ this._state = R(this._schema);
758
793
  }
759
794
  this.render();
760
795
  }
@@ -772,7 +807,7 @@ class ye extends HTMLElement {
772
807
  if (!this._schema) return;
773
808
  const e = this.$root.querySelector("form");
774
809
  e.innerHTML = "";
775
- const s = L(
810
+ const s = P(
776
811
  this._schema,
777
812
  [],
778
813
  this._state,
@@ -784,11 +819,11 @@ class ye extends HTMLElement {
784
819
  }
785
820
  b("schema-form", ye);
786
821
  function et() {
787
- b("schema-form", ye), b("schema-form-string", ue), b("schema-form-number", he), b("schema-form-boolean", me), b("schema-form-date", pe), b("schema-form-const", Y), b("schema-form-union", ve), b("schema-form-tuple", ge), b("schema-form-object", _e), b("schema-form-array", V), b("schema-form-dict", be), b("schema-form-intersect", fe);
822
+ b("schema-form", ye), b("schema-form-string", F), b("schema-form-number", he), b("schema-form-boolean", me), b("schema-form-date", pe), b("schema-form-const", Y), b("schema-form-union", ve), b("schema-form-tuple", ge), b("schema-form-object", _e), b("schema-form-array", z), b("schema-form-dict", be), b("schema-form-intersect", fe);
788
823
  }
789
- const tt = /* @__PURE__ */ re({
824
+ const tt = /* @__PURE__ */ oe({
790
825
  __name: "SchemasteryFormVue",
791
- props: /* @__PURE__ */ te({
826
+ props: /* @__PURE__ */ ae({
792
827
  schema: {},
793
828
  value: {},
794
829
  validateOnChange: { type: Boolean, default: !1 }
@@ -798,39 +833,39 @@ const tt = /* @__PURE__ */ re({
798
833
  value: { required: !1, default: {} },
799
834
  valueModifiers: {}
800
835
  }),
801
- emits: /* @__PURE__ */ te(["change"], ["update:schema", "update:value"]),
836
+ emits: /* @__PURE__ */ ae(["change"], ["update:schema", "update:value"]),
802
837
  setup(n, { expose: e, emit: s }) {
803
- const a = ae(n, "schema"), t = ae(n, "value"), r = s, i = oe("elRef");
838
+ const a = se(n, "schema"), t = se(n, "value"), i = s, r = le("elRef");
804
839
  let o = !1, c = !1;
805
840
  const h = (l) => {
806
841
  if (c)
807
842
  return;
808
- const m = i.value, u = n.validateOnChange ? m.getData({ validate: !0 }) : l.detail.state;
809
- o = !0, t.value = u, U(() => {
843
+ const m = r.value, d = n.validateOnChange ? m.getData({ validate: !0 }) : l.detail.state;
844
+ o = !0, t.value = d, B(() => {
810
845
  o = !1;
811
- }), r("change", l.detail);
846
+ }), i("change", l.detail);
812
847
  };
813
848
  return Me(() => {
814
849
  et();
815
- }), le(() => {
816
- const l = i.value;
850
+ }), ce(() => {
851
+ const l = r.value;
817
852
  a.value && (l.schema = a.value), t.value !== void 0 && l.setData(t.value, { validate: !1, autofix: !0 }), l.addEventListener("form-change", h);
818
- }), Pe(() => {
819
- i.value?.removeEventListener("form-change", h);
820
- }), J(
853
+ }), Fe(() => {
854
+ r.value?.removeEventListener("form-change", h);
855
+ }), K(
821
856
  a,
822
857
  (l) => {
823
- o || i.value && l && i.value.schema !== l && (c = !0, i.value.schema = l, U(() => {
858
+ o || r.value && l && r.value.schema !== l && (c = !0, r.value.schema = l, B(() => {
824
859
  c = !1;
825
860
  }));
826
861
  },
827
862
  { deep: !0, immediate: !0 }
828
- ), J(
863
+ ), K(
829
864
  t,
830
865
  (l) => {
831
- if (o || !i.value || l === void 0) return;
832
- const m = i.value.getData({ validate: !1 });
833
- JSON.stringify(m) !== JSON.stringify(l) && (c = !0, i.value.setData(l, { validate: !1 }), U(() => {
866
+ if (o || !r.value || l === void 0) return;
867
+ const m = r.value.getData({ validate: !1 });
868
+ JSON.stringify(m) !== JSON.stringify(l) && (c = !0, r.value.setData(l, { validate: !1 }), B(() => {
834
869
  c = !1;
835
870
  }));
836
871
  },
@@ -838,33 +873,33 @@ const tt = /* @__PURE__ */ re({
838
873
  ), e({
839
874
  /** 手动设置数据并可选择是否触发 v-model:data */
840
875
  setData(l, m) {
841
- const u = i.value;
842
- u.setData(l, { validate: !!m?.validate }), m?.emit && (t.value = u.getData({ validate: !!m?.validate }));
876
+ const d = r.value;
877
+ d.setData(l, { validate: !!m?.validate }), m?.emit && (t.value = d.getData({ validate: !!m?.validate }));
843
878
  },
844
879
  /** 获取数据 */
845
880
  getData(l) {
846
- return i.value.getData(l);
881
+ return r.value.getData(l);
847
882
  },
848
883
  /** 设置 schema,并同步到 v-model:schema */
849
884
  setSchema(l, m = !0) {
850
- i.value.schema = l, m && (a.value = l);
885
+ r.value.schema = l, m && (a.value = l);
851
886
  },
852
887
  refresh() {
853
- i.value.refresh();
888
+ r.value.refresh();
854
889
  },
855
890
  reset() {
856
- i.value.reset();
891
+ r.value.reset();
857
892
  },
858
893
  /** 原生元素 */
859
- el: i
860
- }), (l, m) => (F(), T("schema-form", je({
894
+ el: r
895
+ }), (l, m) => (I(), D("schema-form", je({
861
896
  ref_key: "elRef",
862
- ref: i
897
+ ref: r
863
898
  }, l.$attrs), null, 16));
864
899
  }
865
900
  });
866
901
  function M(n, e = /* @__PURE__ */ new WeakMap()) {
867
- if (Te(n))
902
+ if (Re(n))
868
903
  return M(n.value, e);
869
904
  if (n === null || typeof n != "object")
870
905
  return n;
@@ -876,21 +911,21 @@ function M(n, e = /* @__PURE__ */ new WeakMap()) {
876
911
  return new RegExp(n);
877
912
  if (n instanceof Map) {
878
913
  const t = /* @__PURE__ */ new Map();
879
- return e.set(n, t), Array.from(n.entries()).forEach(([r, i]) => {
880
- t.set(r, M(i, e));
914
+ return e.set(n, t), Array.from(n.entries()).forEach(([i, r]) => {
915
+ t.set(i, M(r, e));
881
916
  }), t;
882
917
  }
883
918
  if (n instanceof Set) {
884
919
  const t = /* @__PURE__ */ new Set();
885
- return e.set(n, t), Array.from(n).forEach((r) => {
886
- t.add(M(r, e));
920
+ return e.set(n, t), Array.from(n).forEach((i) => {
921
+ t.add(M(i, e));
887
922
  }), t;
888
923
  }
889
924
  if (Array.isArray(n)) {
890
925
  const t = [];
891
926
  e.set(n, t);
892
- for (const r of n)
893
- t.push(M(r, e));
927
+ for (const i of n)
928
+ t.push(M(i, e));
894
929
  return t;
895
930
  }
896
931
  const s = De(n), a = {};
@@ -901,104 +936,104 @@ function M(n, e = /* @__PURE__ */ new WeakMap()) {
901
936
  a[t] = M(s[t], e);
902
937
  return a;
903
938
  }
904
- const at = { id: "preferences-ui-app" }, st = { class: "tabbar" }, nt = { class: "tabbar-tabs" }, it = ["onClick", "data-value"], rt = { class: "tabbar-content" }, ot = { key: 0 }, lt = { style: { "max-height": "20em", overflow: "auto" } }, ct = /* @__PURE__ */ re({
939
+ const at = { id: "preferences-ui-app" }, st = { class: "tabbar" }, nt = { class: "tabbar-tabs" }, rt = ["onClick", "data-value"], it = { class: "tabbar-content" }, ot = { key: 0 }, lt = { style: { "max-height": "20em", overflow: "auto" } }, ct = /* @__PURE__ */ oe({
905
940
  __name: "PreferencesApp",
906
941
  setup(n, { expose: e }) {
907
- const s = Re(), a = !1, t = Oe([]), r = O([]), i = O(""), o = z(() => r.value.find((d) => d.name === i.value) || null), c = z(() => {
908
- const d = t.value.filter((g) => g.category === i.value).map((g) => g.schema);
909
- return d.length === 0 ? null : Le.intersect(d);
910
- }), h = z(() => o.value && typeof o.value.autoGenerateForm == "boolean" ? o.value.autoGenerateForm : !0), l = O({});
942
+ const s = Te(), a = !1, t = Oe([]), i = q([]), r = q(""), o = G(() => i.value.find((u) => u.name === r.value) || null), c = G(() => {
943
+ const u = t.value.filter((g) => g.category === r.value).map((g) => g.schema);
944
+ return u.length === 0 ? null : Pe.intersect(u);
945
+ }), h = G(() => o.value && typeof o.value.autoGenerateForm == "boolean" ? o.value.autoGenerateForm : !0), l = q({});
911
946
  e({
912
947
  getValue() {
913
948
  return M(l);
914
949
  },
915
- mergeValue(d) {
950
+ mergeValue(u) {
916
951
  l.value = {
917
952
  ...l.value,
918
- ...d
953
+ ...u
919
954
  };
920
955
  },
921
- selectTab(d) {
922
- i.value = d;
956
+ selectTab(u) {
957
+ r.value = u;
923
958
  }
924
- }), le(async () => {
925
- s.inject(["preferences"], async (d) => {
926
- const g = await d.preferences.getAll();
927
- l.value = g, r.value = d.preferences.getConfigCategories(), t.value = d.preferences.getConfigRegistries(), i.value = r.value[0].name;
959
+ }), ce(async () => {
960
+ s.inject(["preferences"], async (u) => {
961
+ const g = await u.preferences.getAll();
962
+ l.value = g, i.value = u.preferences.getConfigCategories(), t.value = u.preferences.getConfigRegistries(), r.value = i.value[0].name;
928
963
  });
929
964
  });
930
- const m = (d, g) => {
931
- d.preventDefault(), i.value = g;
932
- const v = d.currentTarget;
965
+ const m = (u, g) => {
966
+ u.preventDefault(), r.value = g;
967
+ const v = u.currentTarget;
933
968
  v && v.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "center" });
934
- }, u = oe("customRenderContainerRef"), f = O([]);
969
+ }, d = le("customRenderContainerRef"), p = q([]);
935
970
  return qe(() => {
936
- f.value.forEach((d) => d()), f.value = [];
937
- }), J(
971
+ p.value.forEach((u) => u()), p.value = [];
972
+ }), K(
938
973
  o,
939
- async (d) => {
940
- f.value.forEach((v) => v()), f.value = [], await U();
941
- const g = u.value;
942
- if (g && (g.innerText = "", d && typeof d.customRenderer == "function")) {
974
+ async (u) => {
975
+ p.value.forEach((v) => v()), p.value = [], await B();
976
+ const g = d.value;
977
+ if (g && (g.innerText = "", u && typeof u.customRenderer == "function")) {
943
978
  let v = Ge;
944
- const C = (y) => {
979
+ const x = (y) => {
945
980
  v = y;
946
- }, w = (y) => {
947
- f.value.push(y);
948
- }, E = await d.customRenderer({ ctx: s, onMounted: C, onUnmount: w });
949
- E && (g.appendChild(E), v?.(g));
981
+ }, k = (y) => {
982
+ p.value.push(y);
983
+ }, $ = await u.customRenderer({ ctx: s, onMounted: x, onUnmount: k });
984
+ $ && (g.appendChild($), v?.(g));
950
985
  }
951
986
  },
952
987
  { immediate: !0, deep: !1 }
953
- ), (d, g) => (F(), T("div", at, [
954
- q("div", st, [
955
- q("div", nt, [
956
- (F(!0), T(He, null, Ue(r.value, (v) => (F(), T("a", {
957
- class: Be(["tab", { active: i.value === v.name }]),
988
+ ), (u, g) => (I(), D("div", at, [
989
+ H("div", st, [
990
+ H("div", nt, [
991
+ (I(!0), D(He, null, Ue(i.value, (v) => (I(), D("a", {
992
+ class: Be(["tab", { active: r.value === v.name }]),
958
993
  key: v.name,
959
- onClick: (C) => m(C, v.name),
994
+ onClick: (x) => m(x, v.name),
960
995
  "data-value": v.name
961
- }, se(v.label), 11, it))), 128))
996
+ }, ne(v.label), 11, rt))), 128))
962
997
  ]),
963
- q("div", rt, [
964
- o.value && o.value.customRenderer ? (F(), T("div", {
998
+ H("div", it, [
999
+ o.value && o.value.customRenderer ? (I(), D("div", {
965
1000
  class: "custom-render-container",
966
1001
  ref_key: "customRenderContainerRef",
967
- ref: u,
968
- key: i.value
969
- })) : G("", !0),
970
- h.value && c.value ? (F(), Ve(ne(tt), {
1002
+ ref: d,
1003
+ key: r.value
1004
+ })) : J("", !0),
1005
+ h.value && c.value ? (I(), Ve(re(tt), {
971
1006
  class: "auto-schema-form",
972
- key: i.value,
973
- "data-category": i.value,
1007
+ key: r.value,
1008
+ "data-category": r.value,
974
1009
  schema: c.value,
975
1010
  value: l.value,
976
1011
  "onUpdate:value": g[0] || (g[0] = (v) => l.value = { ...l.value, ...v }),
977
1012
  "validate-on-change": !1,
978
1013
  i18n: { rootLabel: "" }
979
- }, null, 8, ["data-category", "schema", "value"])) : G("", !0)
1014
+ }, null, 8, ["data-category", "schema", "value"])) : J("", !0)
980
1015
  ])
981
1016
  ]),
982
- ne(a) ? (F(), T("details", ot, [
983
- q("pre", lt, se(l.value), 1)
984
- ])) : G("", !0)
1017
+ re(a) ? (I(), D("details", ot, [
1018
+ H("pre", lt, ne(l.value), 1)
1019
+ ])) : J("", !0)
985
1020
  ]));
986
1021
  }
987
- }), dt = /* @__PURE__ */ Je(ct, [["__scopeId", "data-v-775e2739"]]);
988
- var ut = Object.create, Z = Object.defineProperty, ht = Object.getOwnPropertyDescriptor, xe = (n, e) => (e = Symbol[n]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + n), Ce = (n) => {
1022
+ }), ut = /* @__PURE__ */ Je(ct, [["__scopeId", "data-v-775e2739"]]);
1023
+ var dt = Object.create, Z = Object.defineProperty, ht = Object.getOwnPropertyDescriptor, Ce = (n, e) => (e = Symbol[n]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + n), xe = (n) => {
989
1024
  throw TypeError(n);
990
- }, mt = (n, e, s) => e in n ? Z(n, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : n[e] = s, pt = (n, e) => Z(n, "name", { value: e, configurable: !0 }), ft = (n) => [, , , ut(n?.[xe("metadata")] ?? null)], vt = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], $e = (n) => n !== void 0 && typeof n != "function" ? Ce("Function expected") : n, gt = (n, e, s, a, t) => ({ kind: vt[n], name: e, metadata: a, addInitializer: (r) => s._ ? Ce("Already initialized") : t.push($e(r || null)) }), _t = (n, e) => mt(e, xe("metadata"), n[3]), bt = (n, e, s, a) => {
991
- for (var t = 0, r = n[e >> 1], i = r && r.length; t < i; t++) r[t].call(s);
1025
+ }, mt = (n, e, s) => e in n ? Z(n, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : n[e] = s, pt = (n, e) => Z(n, "name", { value: e, configurable: !0 }), ft = (n) => [, , , dt(n?.[Ce("metadata")] ?? null)], vt = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Ee = (n) => n !== void 0 && typeof n != "function" ? xe("Function expected") : n, gt = (n, e, s, a, t) => ({ kind: vt[n], name: e, metadata: a, addInitializer: (i) => s._ ? xe("Already initialized") : t.push(Ee(i || null)) }), _t = (n, e) => mt(e, Ce("metadata"), n[3]), bt = (n, e, s, a) => {
1026
+ for (var t = 0, i = n[e >> 1], r = i && i.length; t < r; t++) i[t].call(s);
992
1027
  return a;
993
- }, yt = (n, e, s, a, t, r) => {
994
- var i, o, c, h = e & 7, l = !1, m = 0, u = n[m] || (n[m] = []), f = h && (t = t.prototype, h < 5 && (h > 3 || !l) && ht(t, s));
1028
+ }, yt = (n, e, s, a, t, i) => {
1029
+ var r, o, c, h = e & 7, l = !1, m = 0, d = n[m] || (n[m] = []), p = h && (t = t.prototype, h < 5 && (h > 3 || !l) && ht(t, s));
995
1030
  pt(t, s);
996
- for (var d = a.length - 1; d >= 0; d--)
997
- c = gt(h, s, o = {}, n[3], u), i = (0, a[d])(t, c), o._ = 1, $e(i) && (t = i);
998
- return _t(n, t), f && Z(t, s, f), l ? h ^ 4 ? r : f : t;
999
- }, Ee, K, we;
1000
- Ee = [Fe(["preferences", "modal", "$", "$$"])];
1001
- class Q extends (we = We) {
1031
+ for (var u = a.length - 1; u >= 0; u--)
1032
+ c = gt(h, s, o = {}, n[3], d), r = (0, a[u])(t, c), o._ = 1, Ee(r) && (t = r);
1033
+ return _t(n, t), p && Z(t, s, p), l ? h ^ 4 ? i : p : t;
1034
+ }, $e, ee, ke;
1035
+ $e = [Ie(["preferences", "modal", "$", "$$"])];
1036
+ class Q extends (ke = Ke) {
1002
1037
  constructor(e) {
1003
1038
  super(e, {}, "preferences-ui"), this.ctx = e, this._modal = null, this._form = null, e.set("preferencesUI", this);
1004
1039
  const s = e.$, a = e.$$;
@@ -1072,13 +1107,13 @@ class Q extends (we = We) {
1072
1107
  group: "group2",
1073
1108
  index: 99,
1074
1109
  onClick: () => this.showModal()
1075
- }), this.addDisposeHandler((r) => {
1076
- r.toolbox.removeButton("preferences");
1110
+ }), this.addDisposeHandler((i) => {
1111
+ i.toolbox.removeButton("preferences");
1077
1112
  });
1078
1113
  });
1079
1114
  }
1080
1115
  async start() {
1081
- import("./PluginPrefSync-CDTFyM8g.js").then(({ PluginPrefSync: e }) => {
1116
+ import("./PluginPrefSync-C8tb5SJJ.js").then(({ PluginPrefSync: e }) => {
1082
1117
  this.ctx.plugin(e);
1083
1118
  }).catch(this.ctx.logger.warn), this.ctx.on("preferences/changed", (e) => {
1084
1119
  this._form?.mergeValue?.(e.input);
@@ -1096,7 +1131,7 @@ class Q extends (we = We) {
1096
1131
  outSideClose: !1,
1097
1132
  center: !0,
1098
1133
  title: `${e`InPageEdit Preferences`} (${this.ctx.version})`,
1099
- content: /* @__PURE__ */ _(Ie, { children: /* @__PURE__ */ _(Ae, {}) })
1134
+ content: /* @__PURE__ */ _(Ae, { children: /* @__PURE__ */ _(Le, {}) })
1100
1135
  });
1101
1136
  s.get$window().classList.add("dialog");
1102
1137
  const a = /* @__PURE__ */ _(
@@ -1110,11 +1145,11 @@ class Q extends (we = We) {
1110
1145
  ctx: this.ctx,
1111
1146
  modal: s
1112
1147
  });
1113
- const t = this.createPreferencesUIApp(), r = t.mount(a);
1114
- return this._form = r, this.ctx.emit("preferences-ui/vue-app-mounted", {
1148
+ const t = this.createPreferencesUIApp(), i = t.mount(a);
1149
+ return this._form = i, this.ctx.emit("preferences-ui/vue-app-mounted", {
1115
1150
  ctx: this.ctx,
1116
1151
  app: t,
1117
- form: r
1152
+ form: i
1118
1153
  }), s.setButtons([
1119
1154
  {
1120
1155
  label: e`Close`,
@@ -1127,10 +1162,10 @@ class Q extends (we = We) {
1127
1162
  label: e`Save`,
1128
1163
  className: "is-primary is-ghost",
1129
1164
  method: async () => {
1130
- const i = r.getValue();
1165
+ const r = i.getValue();
1131
1166
  try {
1132
- const o = await this.ctx.preferences.setMany(i);
1133
- this.logger.info("preferences saved", i, o);
1167
+ const o = await this.ctx.preferences.setMany(r);
1168
+ this.logger.info("preferences saved", r, o);
1134
1169
  } catch (o) {
1135
1170
  this.logger.error("failed to save preferences", o);
1136
1171
  }
@@ -1165,13 +1200,13 @@ class Q extends (we = We) {
1165
1200
  return this._form?.mergeValue?.(e), !!this._form?.mergeValue;
1166
1201
  }
1167
1202
  createPreferencesUIApp() {
1168
- return ze(this.ctx, dt);
1203
+ return ze(this.ctx, ut);
1169
1204
  }
1170
1205
  }
1171
- K = ft(we);
1172
- Q = yt(K, 0, "PluginPreferencesUI", Ee, Q);
1173
- bt(K, 1, Q);
1206
+ ee = ft(ke);
1207
+ Q = yt(ee, 0, "PluginPreferencesUI", $e, Q);
1208
+ bt(ee, 1, Q);
1174
1209
  export {
1175
1210
  Q as PluginPreferencesUI
1176
1211
  };
1177
- //# sourceMappingURL=index-BcTomMXW.js.map
1212
+ //# sourceMappingURL=index-_Sydb5MZ.js.map