@inpageedit/core 0.16.0 → 0.16.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 (49) hide show
  1. package/dist/InPageEdit.js +2 -2
  2. package/dist/{PluginImagesUsed-BVyvFA1_.js → PluginImagesUsed-DnPDXczO.js} +2 -2
  3. package/dist/{PluginImagesUsed-BVyvFA1_.js.map → PluginImagesUsed-DnPDXczO.js.map} +1 -1
  4. package/dist/{PluginPrefSync-CUKkx4Qk.js → PluginPrefSync-CDTFyM8g.js} +2 -2
  5. package/dist/{PluginPrefSync-CUKkx4Qk.js.map → PluginPrefSync-CDTFyM8g.js.map} +1 -1
  6. package/dist/{PluginStoreApp-CoOAw1fr.js → PluginStoreApp-Bng4DFBZ.js} +2 -2
  7. package/dist/{PluginStoreApp-CoOAw1fr.js.map → PluginStoreApp-Bng4DFBZ.js.map} +1 -1
  8. package/dist/{PluginTemplatesUsed-CdjT1wR4.js → PluginTemplatesUsed-oM_VzfbH.js} +2 -2
  9. package/dist/{PluginTemplatesUsed-CdjT1wR4.js.map → PluginTemplatesUsed-oM_VzfbH.js.map} +1 -1
  10. package/dist/core.js +2 -2
  11. package/dist/{index-BPTMltVf.js → index-1sZXko-X.js} +2 -2
  12. package/dist/{index-BPTMltVf.js.map → index-1sZXko-X.js.map} +1 -1
  13. package/dist/{index-Dm2vgYkZ.js → index-42B3CrSO.js} +2 -2
  14. package/dist/{index-Dm2vgYkZ.js.map → index-42B3CrSO.js.map} +1 -1
  15. package/dist/{index-1tsXE6ax.js → index-BBUv7Lv6.js} +2 -2
  16. package/dist/{index-1tsXE6ax.js.map → index-BBUv7Lv6.js.map} +1 -1
  17. package/dist/{index-BYlcHc-O.js → index-BcTomMXW.js} +3 -3
  18. package/dist/{index-BYlcHc-O.js.map → index-BcTomMXW.js.map} +1 -1
  19. package/dist/{index-bQ0CVu3l.js → index-BllIuJSJ.js} +3 -3
  20. package/dist/{index-bQ0CVu3l.js.map → index-BllIuJSJ.js.map} +1 -1
  21. package/dist/{index-CAtPo7xJ.js → index-Bn6y0Eln.js} +2 -2
  22. package/dist/{index-CAtPo7xJ.js.map → index-Bn6y0Eln.js.map} +1 -1
  23. package/dist/index-C0spLL-i.js +1661 -0
  24. package/dist/index-C0spLL-i.js.map +1 -0
  25. package/dist/{index-DZa9mxN4.js → index-CMmEZcB1.js} +2 -2
  26. package/dist/{index-DZa9mxN4.js.map → index-CMmEZcB1.js.map} +1 -1
  27. package/dist/{index-B32tFyLB.js → index-CN7r2e0P.js} +3 -3
  28. package/dist/{index-B32tFyLB.js.map → index-CN7r2e0P.js.map} +1 -1
  29. package/dist/{index-CVCy0wPP.js → index-CkSHCMRN.js} +2 -2
  30. package/dist/{index-CVCy0wPP.js.map → index-CkSHCMRN.js.map} +1 -1
  31. package/dist/{index-QnWieXQc.js → index-D7rUF8vA.js} +584 -569
  32. package/dist/index-D7rUF8vA.js.map +1 -0
  33. package/dist/{index-ygc4AMy4.js → index-DlCbsA25.js} +3 -3
  34. package/dist/{index-ygc4AMy4.js.map → index-DlCbsA25.js.map} +1 -1
  35. package/dist/{index-C4qm_X_A.js → index-TG_MTC9y.js} +2 -2
  36. package/dist/{index-C4qm_X_A.js.map → index-TG_MTC9y.js.map} +1 -1
  37. package/dist/{index-NWWeW3tX.js → index-mf_pX14E.js} +2 -2
  38. package/dist/{index-NWWeW3tX.js.map → index-mf_pX14E.js.map} +1 -1
  39. package/dist/index.d.ts +37383 -1361
  40. package/dist/index.js +2 -2
  41. package/dist/models/index.js +1 -1
  42. package/dist/plugins/index.js +12 -12
  43. package/dist/services/index.js +1 -1
  44. package/lib/index.umd.js +20 -20
  45. package/lib/index.umd.js.map +1 -1
  46. package/package.json +14 -14
  47. package/dist/index-CYfkwXRf.js +0 -1631
  48. package/dist/index-CYfkwXRf.js.map +0 -1
  49. package/dist/index-QnWieXQc.js.map +0 -1
@@ -1,93 +1,93 @@
1
- import { W as wi, d as bi, e as vi, r as _i, u as xi, c as ki, a as Si, f as $i } from "./index-CYfkwXRf.js";
2
- import { j as M, P as Ei, p as wt } from "./Promise.withResolvers-C4chhLB1.js";
3
- var Ci = Object.defineProperty, S = (i, e) => Ci(i, "name", { value: e, configurable: !0 });
4
- function Ai() {
1
+ import { W as bi, d as vi, e as _i, r as xi, u as ki, c as Si, a as $i, f as Ei } from "./index-C0spLL-i.js";
2
+ import { j as N, P as Ci, p as bt } from "./Promise.withResolvers-C4chhLB1.js";
3
+ var Ai = Object.defineProperty, S = (i, e) => Ai(i, "name", { value: e, configurable: !0 });
4
+ function Oi() {
5
5
  }
6
- S(Ai, "noop");
6
+ S(Oi, "noop");
7
7
  function I(i) {
8
8
  return i == null;
9
9
  }
10
10
  S(I, "isNullable");
11
- function Oi(i) {
11
+ function Pi(i) {
12
12
  return !I(i);
13
13
  }
14
- S(Oi, "isNonNullable");
15
- function le(i) {
14
+ S(Pi, "isNonNullable");
15
+ function he(i) {
16
16
  return i && typeof i == "object" && !Array.isArray(i);
17
17
  }
18
- S(le, "isPlainObject");
19
- function bt(i, e) {
18
+ S(he, "isPlainObject");
19
+ function vt(i, e) {
20
20
  return Object.fromEntries(Object.entries(i).filter(([t, r]) => e(t, r)));
21
21
  }
22
- S(bt, "filterKeys");
23
- function q(i, e) {
22
+ S(vt, "filterKeys");
23
+ function K(i, e) {
24
24
  return Object.fromEntries(Object.entries(i).map(([t, r]) => [t, e(r, t)]));
25
25
  }
26
- S(q, "mapValues");
27
- function vt(i, e, t) {
26
+ S(K, "mapValues");
27
+ function _t(i, e, t) {
28
28
  if (!e) return { ...i };
29
29
  const r = {};
30
30
  for (const n of e)
31
31
  (t || i[n] !== void 0) && (r[n] = i[n]);
32
32
  return r;
33
33
  }
34
- S(vt, "pick");
35
- function Pi(i, e) {
34
+ S(_t, "pick");
35
+ function Ii(i, e) {
36
36
  if (!e) return { ...i };
37
37
  const t = { ...i };
38
38
  for (const r of e)
39
39
  Reflect.deleteProperty(t, r);
40
40
  return t;
41
41
  }
42
- S(Pi, "omit");
42
+ S(Ii, "omit");
43
43
  function j(i, e, t) {
44
44
  return Object.defineProperty(i, e, { writable: !0, value: t, enumerable: !1 });
45
45
  }
46
46
  S(j, "defineProperty");
47
- function Ii(i, e) {
47
+ function Li(i, e) {
48
48
  return e.every((t) => i.includes(t));
49
49
  }
50
- S(Ii, "contain");
51
- function Li(i, e) {
50
+ S(Li, "contain");
51
+ function Ri(i, e) {
52
52
  return i.filter((t) => e.includes(t));
53
53
  }
54
- S(Li, "intersection");
55
- function Ri(i, e) {
54
+ S(Ri, "intersection");
55
+ function ji(i, e) {
56
56
  return i.filter((t) => !e.includes(t));
57
57
  }
58
- S(Ri, "difference");
59
- function ji(i, e) {
58
+ S(ji, "difference");
59
+ function Di(i, e) {
60
60
  return Array.from(/* @__PURE__ */ new Set([...i, ...e]));
61
61
  }
62
- S(ji, "union");
63
- function Di(i) {
62
+ S(Di, "union");
63
+ function Ti(i) {
64
64
  return [...new Set(i)];
65
65
  }
66
- S(Di, "deduplicate");
66
+ S(Ti, "deduplicate");
67
67
  function W(i, e) {
68
68
  const t = i?.indexOf(e);
69
69
  return t >= 0 ? (i.splice(t, 1), !0) : !1;
70
70
  }
71
71
  S(W, "remove");
72
- function Ti(i) {
72
+ function Ni(i) {
73
73
  return Array.isArray(i) ? i : I(i) ? [] : [i];
74
74
  }
75
- S(Ti, "makeArray");
75
+ S(Ni, "makeArray");
76
76
  function G(i, e) {
77
77
  return arguments.length === 1 ? (t) => G(i, t) : i in globalThis && e instanceof globalThis[i] || Object.prototype.toString.call(e).slice(8, -1) === i;
78
78
  }
79
79
  S(G, "is");
80
- function ne(i) {
80
+ function se(i) {
81
81
  return G("ArrayBuffer", i) || G("SharedArrayBuffer", i);
82
82
  }
83
- S(ne, "isArrayBufferLike");
84
- function _t(i) {
85
- return ne(i) || ArrayBuffer.isView(i);
83
+ S(se, "isArrayBufferLike");
84
+ function xt(i) {
85
+ return se(i) || ArrayBuffer.isView(i);
86
86
  }
87
- S(_t, "isArrayBufferSource");
87
+ S(xt, "isArrayBufferSource");
88
88
  var B;
89
89
  ((i) => {
90
- i.is = ne, i.isSource = _t;
90
+ i.is = se, i.isSource = xt;
91
91
  function e(o) {
92
92
  return ArrayBuffer.isView(o) ? o.buffer.slice(o.byteOffset, o.byteOffset + o.byteLength) : o;
93
93
  }
@@ -123,56 +123,56 @@ B.fromBase64;
123
123
  B.toBase64;
124
124
  B.fromHex;
125
125
  B.toHex;
126
- function he(i, e = /* @__PURE__ */ new Map()) {
126
+ function ue(i, e = /* @__PURE__ */ new Map()) {
127
127
  if (!i || typeof i != "object") return i;
128
128
  if (G("Date", i)) return new Date(i.valueOf());
129
129
  if (G("RegExp", i)) return new RegExp(i.source, i.flags);
130
- if (ne(i)) return i.slice(0);
130
+ if (se(i)) return i.slice(0);
131
131
  if (ArrayBuffer.isView(i)) return i.buffer.slice(i.byteOffset, i.byteOffset + i.byteLength);
132
132
  const t = e.get(i);
133
133
  if (t) return t;
134
134
  if (Array.isArray(i)) {
135
135
  const n = [];
136
136
  return e.set(i, n), i.forEach((s, o) => {
137
- n[o] = Reflect.apply(he, null, [s, e]);
137
+ n[o] = Reflect.apply(ue, null, [s, e]);
138
138
  }), n;
139
139
  }
140
140
  const r = Object.create(Object.getPrototypeOf(i));
141
141
  e.set(i, r);
142
142
  for (const n of Reflect.ownKeys(i)) {
143
143
  const s = { ...Reflect.getOwnPropertyDescriptor(i, n) };
144
- "value" in s && (s.value = Reflect.apply(he, null, [s.value, e])), Reflect.defineProperty(r, n, s);
144
+ "value" in s && (s.value = Reflect.apply(ue, null, [s.value, e])), Reflect.defineProperty(r, n, s);
145
145
  }
146
146
  return r;
147
147
  }
148
- S(he, "clone");
149
- function J(i, e, t) {
148
+ S(ue, "clone");
149
+ function Y(i, e, t) {
150
150
  if (i === e || !t && I(i) && I(e)) return !0;
151
151
  if (typeof i != typeof e || typeof i != "object" || !i || !e) return !1;
152
152
  function r(n, s) {
153
153
  return n(i) ? n(e) ? s(i, e) : !1 : n(e) ? !1 : void 0;
154
154
  }
155
- return S(r, "check"), r(Array.isArray, (n, s) => n.length === s.length && n.every((o, a) => J(o, s[a]))) ?? r(G("Date"), (n, s) => n.valueOf() === s.valueOf()) ?? r(G("RegExp"), (n, s) => n.source === s.source && n.flags === s.flags) ?? r(ne, (n, s) => {
155
+ return S(r, "check"), r(Array.isArray, (n, s) => n.length === s.length && n.every((o, a) => Y(o, s[a]))) ?? r(G("Date"), (n, s) => n.valueOf() === s.valueOf()) ?? r(G("RegExp"), (n, s) => n.source === s.source && n.flags === s.flags) ?? r(se, (n, s) => {
156
156
  if (n.byteLength !== s.byteLength) return !1;
157
157
  const o = new Uint8Array(n), a = new Uint8Array(s);
158
158
  for (let f = 0; f < o.length; f++)
159
159
  if (o[f] !== a[f]) return !1;
160
160
  return !0;
161
- }) ?? Object.keys({ ...i, ...e }).every((n) => J(i[n], e[n], t));
161
+ }) ?? Object.keys({ ...i, ...e }).every((n) => Y(i[n], e[n], t));
162
162
  }
163
- S(J, "deepEqual");
163
+ S(Y, "deepEqual");
164
164
  function Mi(i) {
165
165
  return i.charAt(0).toUpperCase() + i.slice(1);
166
166
  }
167
167
  S(Mi, "capitalize");
168
- function Ni(i) {
168
+ function Bi(i) {
169
169
  return i.charAt(0).toLowerCase() + i.slice(1);
170
170
  }
171
- S(Ni, "uncapitalize");
172
- function Bi(i) {
171
+ S(Bi, "uncapitalize");
172
+ function Ui(i) {
173
173
  return i.replace(/[_-][a-z]/g, (e) => e.slice(1).toUpperCase());
174
174
  }
175
- S(Bi, "camelCase");
175
+ S(Ui, "camelCase");
176
176
  function Me(i, e, t) {
177
177
  const r = [];
178
178
  let n = 0;
@@ -190,27 +190,27 @@ function Me(i, e, t) {
190
190
  return String.fromCharCode(...r);
191
191
  }
192
192
  S(Me, "tokenize");
193
- function Ui(i) {
193
+ function Fi(i) {
194
194
  return Me(i, [45, 95], 45);
195
195
  }
196
- S(Ui, "paramCase");
197
- function Fi(i) {
196
+ S(Fi, "paramCase");
197
+ function zi(i) {
198
198
  return Me(i, [45, 95], 95);
199
199
  }
200
- S(Fi, "snakeCase");
201
- function zi(i) {
200
+ S(zi, "snakeCase");
201
+ function Hi(i) {
202
202
  return typeof i != "string" ? `[${i.toString()}]` : /^[a-z_$][\w$]*$/i.test(i) ? `.${i}` : `[${JSON.stringify(i)}]`;
203
203
  }
204
- S(zi, "formatProperty");
205
- function xt(i) {
204
+ S(Hi, "formatProperty");
205
+ function kt(i) {
206
206
  return i.replace(/\/$/, "");
207
207
  }
208
- S(xt, "trimSlash");
208
+ S(kt, "trimSlash");
209
209
  function Ki(i) {
210
- return i.startsWith("/") || (i = "/" + i), xt(i);
210
+ return i.startsWith("/") || (i = "/" + i), kt(i);
211
211
  }
212
212
  S(Ki, "sanitize");
213
- var ot;
213
+ var at;
214
214
  ((i) => {
215
215
  i.millisecond = 1, i.second = 1e3, i.minute = i.second * 60, i.hour = i.minute * 60, i.day = i.hour * 24, i.week = i.day * 7;
216
216
  let e = (/* @__PURE__ */ new Date()).getTimezoneOffset();
@@ -261,7 +261,7 @@ var ot;
261
261
  return g.replace("yyyy", w.getFullYear().toString()).replace("yy", w.getFullYear().toString().slice(2)).replace("MM", y(w.getMonth() + 1)).replace("dd", y(w.getDate())).replace("hh", y(w.getHours())).replace("mm", y(w.getMinutes())).replace("ss", y(w.getSeconds())).replace("SSS", y(w.getMilliseconds(), 3));
262
262
  }
263
263
  i.template = _, S(_, "template");
264
- })(ot || (ot = {}));
264
+ })(at || (at = {}));
265
265
  var qi = Object.defineProperty, k = (i, e) => qi(i, "name", { value: e, configurable: !0 }), b = {
266
266
  // internal symbols
267
267
  shadow: /* @__PURE__ */ Symbol.for("cordis.shadow"),
@@ -283,63 +283,63 @@ var qi = Object.defineProperty, k = (i, e) => qi(i, "name", { value: e, configur
283
283
  tracker: /* @__PURE__ */ Symbol.for("cordis.tracker"),
284
284
  provide: /* @__PURE__ */ Symbol.for("cordis.provide"),
285
285
  immediate: /* @__PURE__ */ Symbol.for("cordis.immediate")
286
- }, Hi = function* () {
287
- }.constructor, at = async function* () {
286
+ }, Wi = function* () {
287
+ }.constructor, ct = async function* () {
288
288
  }.constructor;
289
- function Ne(i) {
290
- return !(!i.prototype || i instanceof Hi || at !== Function && i instanceof at);
289
+ function Be(i) {
290
+ return !(!i.prototype || i instanceof Wi || ct !== Function && i instanceof ct);
291
291
  }
292
- k(Ne, "isConstructor");
293
- function se(i, e) {
292
+ k(Be, "isConstructor");
293
+ function oe(i, e) {
294
294
  const t = i.Config || i.schema;
295
295
  return t && i.schema !== !1 && (e = t(e)), e ?? {};
296
296
  }
297
- k(se, "resolveConfig");
298
- function kt(i) {
297
+ k(oe, "resolveConfig");
298
+ function St(i) {
299
299
  return [Map, Set, Date, Promise].some((e) => i instanceof e);
300
300
  }
301
- k(kt, "isUnproxyable");
302
- function Be(i, e) {
301
+ k(St, "isUnproxyable");
302
+ function Ue(i, e) {
303
303
  if (i === Object.prototype) return e;
304
- const t = Object.create(Be(Object.getPrototypeOf(i), e));
304
+ const t = Object.create(Ue(Object.getPrototypeOf(i), e));
305
305
  for (const r of Reflect.ownKeys(i))
306
306
  Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(i, r));
307
307
  return t;
308
308
  }
309
- k(Be, "joinPrototype");
310
- function Ue(i) {
309
+ k(Ue, "joinPrototype");
310
+ function Fe(i) {
311
311
  return i && (typeof i == "object" || typeof i == "function");
312
312
  }
313
- k(Ue, "isObject");
313
+ k(Fe, "isObject");
314
314
  function U(i, e, t) {
315
- if (!Ue(e)) return e;
315
+ if (!Fe(e)) return e;
316
316
  if (Object.hasOwn(e, b.shadow))
317
317
  return Object.getPrototypeOf(e);
318
318
  const r = e[b.tracker];
319
- return r ? ve(i, e, r, t) : e;
319
+ return r ? _e(i, e, r, t) : e;
320
320
  }
321
321
  k(U, "getTraceable");
322
- function ie(i, e) {
322
+ function re(i, e) {
323
323
  return e ? new Proxy(i, {
324
324
  get: /* @__PURE__ */ k((t, r, n) => r in e && r !== "constructor" ? Reflect.get(e, r, n) : Reflect.get(t, r, n), "get"),
325
325
  set: /* @__PURE__ */ k((t, r, n, s) => r in e && r !== "constructor" ? Reflect.set(e, r, n, s) : Reflect.set(t, r, n, s), "set")
326
326
  }) : i;
327
327
  }
328
- k(ie, "withProps");
329
- function ue(i, e, t) {
330
- return ie(i, Object.defineProperty(/* @__PURE__ */ Object.create(null), e, {
328
+ k(re, "withProps");
329
+ function fe(i, e, t) {
330
+ return re(i, Object.defineProperty(/* @__PURE__ */ Object.create(null), e, {
331
331
  value: t,
332
332
  writable: !1
333
333
  }));
334
334
  }
335
- k(ue, "withProp");
336
- function Ee(i, e, t, r) {
335
+ k(fe, "withProp");
336
+ function Ce(i, e, t, r) {
337
337
  if (!t) return r;
338
338
  const n = Reflect.getOwnPropertyDescriptor(e, t)?.value;
339
- return n ? ue(r, t, i.extend({ [b.shadow]: n })) : r;
339
+ return n ? fe(r, t, i.extend({ [b.shadow]: n })) : r;
340
340
  }
341
- k(Ee, "createShadow");
342
- function St(i, e, t, r) {
341
+ k(Ce, "createShadow");
342
+ function $t(i, e, t, r) {
343
343
  return new Proxy(e, {
344
344
  apply: /* @__PURE__ */ k((n, s, o) => (s === t && (s = r), o = o.map((a) => typeof a != "function" || a[b.original] ? a : new Proxy(a, {
345
345
  get: /* @__PURE__ */ k((f, u, p) => {
@@ -354,8 +354,8 @@ function St(i, e, t, r) {
354
354
  })), U(i, Reflect.apply(n, s, o))), "apply")
355
355
  });
356
356
  }
357
- k(St, "createShadowMethod");
358
- function ve(i, e, t, r) {
357
+ k($t, "createShadowMethod");
358
+ function _e(i, e, t, r) {
359
359
  i[b.shadow] && (i = Object.getPrototypeOf(i));
360
360
  const n = new Proxy(e, {
361
361
  get: /* @__PURE__ */ k((s, o, a) => {
@@ -364,37 +364,37 @@ function ve(i, e, t, r) {
364
364
  if (typeof o == "symbol")
365
365
  return Reflect.get(s, o, a);
366
366
  if (t.associate && i[b.internal][`${t.associate}.${o}`])
367
- return Reflect.get(i, `${t.associate}.${o}`, ue(i, b.receiver, a));
368
- const f = Ee(i, s, t.property, a), u = Reflect.get(s, o, f), p = u?.[b.tracker];
369
- return p ? ve(i, u, p) : !r && typeof u == "function" ? St(i, u, a, f) : u;
367
+ return Reflect.get(i, `${t.associate}.${o}`, fe(i, b.receiver, a));
368
+ const f = Ce(i, s, t.property, a), u = Reflect.get(s, o, f), p = u?.[b.tracker];
369
+ return p ? _e(i, u, p) : !r && typeof u == "function" ? $t(i, u, a, f) : u;
370
370
  }, "get"),
371
371
  set: /* @__PURE__ */ k((s, o, a, f) => {
372
372
  if (o === b.original || o === t.property) return !1;
373
373
  if (typeof o == "symbol")
374
374
  return Reflect.set(s, o, a, f);
375
375
  if (t.associate && i[b.internal][`${t.associate}.${o}`])
376
- return Reflect.set(i, `${t.associate}.${o}`, a, ue(i, b.receiver, f));
377
- const u = Ee(i, s, t.property, f);
376
+ return Reflect.set(i, `${t.associate}.${o}`, a, fe(i, b.receiver, f));
377
+ const u = Ce(i, s, t.property, f);
378
378
  return Reflect.set(s, o, a, u);
379
379
  }, "set"),
380
- apply: /* @__PURE__ */ k((s, o, a) => Fe(n, s, o, a), "apply")
380
+ apply: /* @__PURE__ */ k((s, o, a) => ze(n, s, o, a), "apply")
381
381
  });
382
382
  return n;
383
383
  }
384
- k(ve, "createTraceable");
385
- function Fe(i, e, t, r) {
384
+ k(_e, "createTraceable");
385
+ function ze(i, e, t, r) {
386
386
  return e[b.invoke] ? e[b.invoke].apply(i, r) : Reflect.apply(e, t, r);
387
387
  }
388
- k(Fe, "applyTraceable");
389
- function Ce(i, e, t) {
388
+ k(ze, "applyTraceable");
389
+ function Ae(i, e, t) {
390
390
  const r = /* @__PURE__ */ k(function(...n) {
391
- const s = ve(r.ctx, r, t);
392
- return Fe(s, r, this, n);
391
+ const s = _e(r.ctx, r, t);
392
+ return ze(s, r, this, n);
393
393
  }, "self");
394
394
  return j(r, "name", i), Object.setPrototypeOf(r, e);
395
395
  }
396
- k(Ce, "createCallable");
397
- var Wi = class Q {
396
+ k(Ae, "createCallable");
397
+ var Gi = class Q {
398
398
  constructor(e) {
399
399
  this.ctx = e, j(this, b.tracker, {
400
400
  associate: "reflect",
@@ -454,7 +454,7 @@ var Wi = class Q {
454
454
  const o = this.ctx;
455
455
  I(t) || (s = o.effect(() => () => {
456
456
  o.set(e, void 0);
457
- })), kt(t) && o.emit(o, "internal/warning", new Error(`service ${e} is an unproxyable object, which may lead to unexpected behavior`));
457
+ })), St(t) && o.emit(o, "internal/warning", new Error(`service ${e} is an unproxyable object, which may lead to unexpected behavior`));
458
458
  const a = Object.create(o);
459
459
  return a[b.filter] = (f) => o[b.isolate][e] === f[b.isolate][e], o.emit(a, "internal/before-service", e, t), o[b.store][r] = { value: t, source: o }, o.emit(a, "internal/service", e, n), s;
460
460
  }
@@ -462,7 +462,7 @@ var Wi = class Q {
462
462
  const n = this.ctx.root[b.internal];
463
463
  if (e in n) return;
464
464
  const s = Symbol(e);
465
- n[e] = { type: "service", builtin: r }, this.ctx.root[b.isolate][e] = s, Ue(t) && (this.ctx[b.store][s] = { value: t, source: null }, j(t, b.tracker, {
465
+ n[e] = { type: "service", builtin: r }, this.ctx.root[b.isolate][e] = s, Fe(t) && (this.ctx[b.store][s] = { value: t, source: null }, j(t, b.tracker, {
466
466
  associate: e,
467
467
  property: "ctx"
468
468
  }));
@@ -486,11 +486,11 @@ var Wi = class Q {
486
486
  get(f) {
487
487
  const u = n(this);
488
488
  if (I(u)) return u;
489
- const p = f ? ie(f, u) : u, y = Reflect.get(u, o, p);
489
+ const p = f ? re(f, u) : u, y = Reflect.get(u, o, p);
490
490
  return typeof y != "function" ? y : y.bind(p ?? u);
491
491
  },
492
492
  set(f, u) {
493
- const p = n(this), y = u ? ie(u, p) : p;
493
+ const p = n(this), y = u ? re(u, p) : p;
494
494
  return Reflect.set(p, o, f, y);
495
495
  }
496
496
  }));
@@ -507,12 +507,12 @@ var Wi = class Q {
507
507
  apply: /* @__PURE__ */ k((t, r, n) => t.apply(this.trace(r), n.map((s) => this.trace(s))), "apply")
508
508
  });
509
509
  }
510
- }, Ae = Wi;
511
- function Oe(i) {
510
+ }, Oe = Gi;
511
+ function Pe(i) {
512
512
  return i !== null && i !== !1 && i !== void 0;
513
513
  }
514
- k(Oe, "isBailed");
515
- var Gi = class {
514
+ k(Pe, "isBailed");
515
+ var Vi = class {
516
516
  constructor(i) {
517
517
  this.ctx = i, j(this, b.tracker, {
518
518
  associate: "lifecycle",
@@ -525,11 +525,11 @@ var Gi = class {
525
525
  return this.scope.disposables[s](r), j(r, "name", "event <dispose>"), () => W(this.scope.disposables, r);
526
526
  if (t === "fork")
527
527
  return this.scope.runtime.forkables[s](r), this.scope.collect("event <fork>", () => W(this.scope.runtime.forkables, r));
528
- }), N.static, i.scope);
528
+ }), M.static, i.scope);
529
529
  for (const t of ["info", "error", "warning"])
530
530
  j(this.on(`internal/${t}`, (r, ...n) => {
531
531
  this._hooks[`internal/${t}`].length > 1;
532
- }), N.static, i.scope);
532
+ }), M.static, i.scope);
533
533
  j(this.on("internal/before-service", function(t) {
534
534
  for (const r of this.registry.values()) {
535
535
  if (!r.inject[t]?.required) continue;
@@ -537,23 +537,23 @@ var Gi = class {
537
537
  for (const s of n)
538
538
  this[b.filter](s.ctx) && (s.updateStatus(), s.reset());
539
539
  }
540
- }, { global: !0 }), N.static, i.scope), j(this.on("internal/service", function(t) {
540
+ }, { global: !0 }), M.static, i.scope), j(this.on("internal/service", function(t) {
541
541
  for (const r of this.registry.values()) {
542
542
  if (!r.inject[t]?.required) continue;
543
543
  const n = r.isReusable ? r.children : [r];
544
544
  for (const s of n)
545
545
  this[b.filter](s.ctx) && s.start();
546
546
  }
547
- }, { global: !0 }), N.static, i.scope);
547
+ }, { global: !0 }), M.static, i.scope);
548
548
  const e = /* @__PURE__ */ k((t, r) => {
549
549
  if (!t.runtime.plugin) return !1;
550
550
  for (const n in t.runtime.inject)
551
- if (r === Ae.resolveInject(t.ctx, n)[0]) return !0;
551
+ if (r === Oe.resolveInject(t.ctx, n)[0]) return !0;
552
552
  return e(t.parent.scope, r);
553
553
  }, "checkInject");
554
554
  j(this.on("internal/inject", function(t) {
555
555
  return e(this.scope, t);
556
- }, { global: !0 }), N.static, i.scope);
556
+ }, { global: !0 }), M.static, i.scope);
557
557
  }
558
558
  static {
559
559
  k(this, "Lifecycle");
@@ -567,7 +567,7 @@ var Gi = class {
567
567
  }
568
568
  filterHooks(i, e) {
569
569
  return e = U(this.ctx, e), i.slice().filter((t) => {
570
- const r = e?.[N.filter];
570
+ const r = e?.[M.filter];
571
571
  return t.global || !r || r.call(e, t.ctx);
572
572
  });
573
573
  }
@@ -585,11 +585,11 @@ var Gi = class {
585
585
  }
586
586
  async serial(...i) {
587
587
  for await (const e of this.dispatch("serial", i))
588
- if (Oe(e)) return e;
588
+ if (Pe(e)) return e;
589
589
  }
590
590
  bail(...i) {
591
591
  for (const e of this.dispatch("bail", i))
592
- if (Oe(e)) return e;
592
+ if (Pe(e)) return e;
593
593
  }
594
594
  register(i, e, t, r) {
595
595
  const n = r.prepend ? "unshift" : "push";
@@ -625,9 +625,9 @@ var Gi = class {
625
625
  async stop() {
626
626
  this.isActive = !1, this.ctx.scope.reset();
627
627
  }
628
- }, Vi = Gi, Ji = /* @__PURE__ */ ((i) => (i[i.PENDING = 0] = "PENDING", i[i.LOADING = 1] = "LOADING", i[i.ACTIVE = 2] = "ACTIVE", i[i.FAILED = 3] = "FAILED", i[i.DISPOSED = 4] = "DISPOSED", i))(Ji || {}), Pe = class $t extends Error {
628
+ }, Yi = Vi, Ji = /* @__PURE__ */ ((i) => (i[i.PENDING = 0] = "PENDING", i[i.LOADING = 1] = "LOADING", i[i.ACTIVE = 2] = "ACTIVE", i[i.FAILED = 3] = "FAILED", i[i.DISPOSED = 4] = "DISPOSED", i))(Ji || {}), Ie = class Et extends Error {
629
629
  constructor(e, t) {
630
- super(t ?? $t.Code[e]), this.code = e;
630
+ super(t ?? Et.Code[e]), this.code = e;
631
631
  }
632
632
  static {
633
633
  k(this, "CordisError");
@@ -637,8 +637,8 @@ var Gi = class {
637
637
  i.Code = {
638
638
  INACTIVE_EFFECT: "cannot create effect on inactive context"
639
639
  };
640
- })(Pe || (Pe = {}));
641
- var Et = class {
640
+ })(Ie || (Ie = {}));
641
+ var Ct = class {
642
642
  constructor(i, e) {
643
643
  this.parent = i, this.config = e, this.uid = i.registry ? i.registry.counter : 0, this.ctx = this.context = i.extend({ scope: this }), this.proxy = new Proxy({}, {
644
644
  get: /* @__PURE__ */ k((t, r) => Reflect.get(this.config, r), "get")
@@ -664,11 +664,11 @@ var Et = class {
664
664
  }
665
665
  assertActive() {
666
666
  if (!(this.uid !== null || this.isActive))
667
- throw new Pe("INACTIVE_EFFECT");
667
+ throw new Ie("INACTIVE_EFFECT");
668
668
  }
669
669
  effect(i, e) {
670
670
  this.assertActive();
671
- const t = Ne(i) ? new i(this.ctx, e) : i(this.ctx, e);
671
+ const t = Be(i) ? new i(this.ctx, e) : i(this.ctx, e);
672
672
  let r = !1;
673
673
  const n = typeof t == "function" ? t : t.dispose.bind(t), s = /* @__PURE__ */ k((...o) => {
674
674
  if (!r)
@@ -706,7 +706,7 @@ var Et = class {
706
706
  }
707
707
  reset() {
708
708
  this.isActive = !1, this.disposables = this.disposables.splice(0).filter((i) => {
709
- if (this.uid !== null && i[N.static] === this) return !0;
709
+ if (this.uid !== null && i[M.static] === this) return !0;
710
710
  (async () => i())().catch((e) => {
711
711
  this.context.emit(this.ctx, "internal/error", e);
712
712
  });
@@ -730,7 +730,7 @@ var Et = class {
730
730
  if (e || !this.config) return [!0, !0];
731
731
  if (e === !1) return [!1, !1];
732
732
  const t = /* @__PURE__ */ Object.create(null), r = /* @__PURE__ */ k((f) => {
733
- const u = t[f] ??= !J(this.config[f], i[f]);
733
+ const u = t[f] ??= !Y(this.config[f], i[f]);
734
734
  return s ||= u, u;
735
735
  }, "checkPropertyUpdate"), n = /* @__PURE__ */ new Set();
736
736
  let s = !1, o = !1, a = this.runtime.isReactive || null;
@@ -754,13 +754,13 @@ var Et = class {
754
754
  }
755
755
  return [s, o];
756
756
  }
757
- }, Yi = class extends Et {
757
+ }, Xi = class extends Ct {
758
758
  constructor(i, e, t, r) {
759
759
  super(i, t), this.runtime = e, this.dispose = j(i.scope.collect(`fork <${i.runtime.name}>`, () => {
760
760
  this.uid = null, this.reset(), this.context.emit("internal/fork", this);
761
761
  const n = W(e.disposables, this.dispose);
762
762
  return W(e.children, this) && !e.children.length && i.registry.delete(e.plugin), n;
763
- }), N.static, e), e.children.push(this), e.disposables.push(this.dispose), this.context.emit("internal/fork", this), this.init(r);
763
+ }), M.static, e), e.children.push(this), e.disposables.push(this.dispose), this.context.emit("internal/fork", this), this.init(r);
764
764
  }
765
765
  static {
766
766
  k(this, "ForkScope");
@@ -776,14 +776,14 @@ var Et = class {
776
776
  if (r.config !== t) return;
777
777
  let n;
778
778
  try {
779
- n = se(this.runtime.plugin, i);
779
+ n = oe(this.runtime.plugin, i);
780
780
  } catch (a) {
781
781
  return this.context.emit("internal/error", a), this.cancel(a);
782
782
  }
783
783
  const [s, o] = r.checkUpdate(n, e);
784
784
  this.context.emit("internal/before-update", this, i), this.config = n, r.config = n, s && this.context.emit("internal/update", this, t), o && r.restart();
785
785
  }
786
- }, ct = class extends Et {
786
+ }, lt = class extends Ct {
787
787
  constructor(i, e, t, r) {
788
788
  super(i, t), this.plugin = e, e ? (this.setup(), this.init(r)) : (this.name = "root", this.isActive = !0);
789
789
  }
@@ -803,7 +803,7 @@ var Et = class {
803
803
  return this.forkables.length > 0;
804
804
  }
805
805
  fork(i, e, t) {
806
- return new Yi(i, this, e, t);
806
+ return new Xi(i, this, e, t);
807
807
  }
808
808
  dispose() {
809
809
  return this.uid = null, this.reset(), this.context.emit("internal/runtime", this), !0;
@@ -815,8 +815,8 @@ var Et = class {
815
815
  apply = /* @__PURE__ */ k((i, e) => {
816
816
  if (typeof this.plugin != "function")
817
817
  return this.plugin.apply(i, e);
818
- if (Ne(this.plugin)) {
819
- const t = new this.plugin(i, e), r = t[N.expose];
818
+ if (Be(this.plugin)) {
819
+ const t = new this.plugin(i, e), r = t[M.expose];
820
820
  return r && i.set(r, t), t.fork && this.forkables.push(t.fork.bind(t)), t;
821
821
  } else
822
822
  return this.plugin(i, e);
@@ -840,7 +840,7 @@ var Et = class {
840
840
  const t = this.config;
841
841
  let r;
842
842
  try {
843
- r = se(this.runtime.plugin || this.context.constructor, i);
843
+ r = oe(this.runtime.plugin || this.context.constructor, i);
844
844
  } catch (a) {
845
845
  return this.context.emit("internal/error", a), this.cancel(a);
846
846
  }
@@ -848,10 +848,10 @@ var Et = class {
848
848
  this.config = r, o && (this.context.emit("internal/before-update", o, i), o.config = r, n && this.context.emit("internal/update", o, t)), s && this.restart();
849
849
  }
850
850
  };
851
- function Ct(i) {
851
+ function At(i) {
852
852
  return i && typeof i == "object" && typeof i.apply == "function";
853
853
  }
854
- k(Ct, "isApplicable");
854
+ k(At, "isApplicable");
855
855
  function F(i) {
856
856
  return function(e, t) {
857
857
  if (t.kind === "class")
@@ -861,7 +861,7 @@ function F(i) {
861
861
  const r = this[b.tracker]?.property;
862
862
  if (!r) throw new Error("missing context tracker");
863
863
  this[r].inject(i, (n) => {
864
- e.call(ie(this, { [r]: n }));
864
+ e.call(re(this, { [r]: n }));
865
865
  });
866
866
  });
867
867
  else
@@ -879,13 +879,13 @@ k(F, "Inject");
879
879
  }
880
880
  i.resolve = e, k(e, "resolve");
881
881
  })(F || (F = {}));
882
- var Xi = class {
882
+ var Qi = class {
883
883
  constructor(i, e) {
884
884
  this.ctx = i, j(this, b.tracker, {
885
885
  associate: "registry",
886
886
  property: "ctx"
887
887
  }), this.context = i;
888
- const t = new ct(i, null, e);
888
+ const t = new lt(i, null, e);
889
889
  i.scope = t, t.ctx = i, this.set(null, t);
890
890
  }
891
891
  static {
@@ -902,7 +902,7 @@ var Xi = class {
902
902
  }
903
903
  resolve(i, e = !1) {
904
904
  if (i === null || typeof i == "function") return i;
905
- if (Ct(i)) return i.apply;
905
+ if (At(i)) return i.apply;
906
906
  if (e) throw new Error('invalid plugin, expect function or object with an "apply" method, received ' + typeof i);
907
907
  }
908
908
  get(i) {
@@ -943,14 +943,14 @@ var Xi = class {
943
943
  plugin(i, e, t) {
944
944
  if (this.resolve(i, !0), this.ctx.scope.assertActive(), !t)
945
945
  try {
946
- e = se(i, e);
946
+ e = oe(i, e);
947
947
  } catch (n) {
948
948
  this.context.emit(this.ctx, "internal/error", n), t = n, e = null;
949
949
  }
950
950
  let r = this.get(i);
951
- return r ? (r.isForkable || this.context.emit(this.ctx, "internal/warning", new Error(`duplicate plugin detected: ${i.name}`)), r.fork(this.ctx, e, t)) : (r = new ct(this.ctx, i, e, t), this.set(i, r), r.fork(this.ctx, e, t));
951
+ return r ? (r.isForkable || this.context.emit(this.ctx, "internal/warning", new Error(`duplicate plugin detected: ${i.name}`)), r.fork(this.ctx, e, t)) : (r = new lt(this.ctx, i, e, t), this.set(i, r), r.fork(this.ctx, e, t));
952
952
  }
953
- }, Qi = Xi, N = class ee {
953
+ }, Zi = Qi, M = class te {
954
954
  static {
955
955
  k(this, "Context");
956
956
  }
@@ -965,19 +965,19 @@ var Xi = class {
965
965
  static origin = "ctx";
966
966
  static current = "ctx";
967
967
  static is(e) {
968
- return !!e?.[ee.is];
968
+ return !!e?.[te.is];
969
969
  }
970
970
  static {
971
- ee.is[Symbol.toPrimitive] = () => /* @__PURE__ */ Symbol.for("cordis.is"), ee.prototype[ee.is] = !0;
971
+ te.is[Symbol.toPrimitive] = () => /* @__PURE__ */ Symbol.for("cordis.is"), te.prototype[te.is] = !0;
972
972
  }
973
973
  /** @deprecated use `Service.traceable` instead */
974
974
  static associate(e, t) {
975
975
  return e;
976
976
  }
977
977
  constructor(e) {
978
- e = se(this.constructor, e), this[b.store] = /* @__PURE__ */ Object.create(null), this[b.isolate] = /* @__PURE__ */ Object.create(null), this[b.internal] = /* @__PURE__ */ Object.create(null), this[b.intercept] = /* @__PURE__ */ Object.create(null);
979
- const t = new Proxy(this, Ae.handler);
980
- t.root = t, t.reflect = new Ae(t), t.registry = new Qi(t, e), t.lifecycle = new Vi(t);
978
+ e = oe(this.constructor, e), this[b.store] = /* @__PURE__ */ Object.create(null), this[b.isolate] = /* @__PURE__ */ Object.create(null), this[b.internal] = /* @__PURE__ */ Object.create(null), this[b.intercept] = /* @__PURE__ */ Object.create(null);
979
+ const t = new Proxy(this, Oe.handler);
980
+ t.root = t, t.reflect = new Oe(t), t.registry = new Zi(t, e), t.lifecycle = new Yi(t);
981
981
  const r = /* @__PURE__ */ k((n) => {
982
982
  if (n) {
983
983
  r(Object.getPrototypeOf(n));
@@ -1018,8 +1018,8 @@ var Xi = class {
1018
1018
  return r[e] = t, this.extend({ [b.intercept]: r });
1019
1019
  }
1020
1020
  };
1021
- N.prototype[N.internal] = /* @__PURE__ */ Object.create(null);
1022
- var z = class At {
1021
+ M.prototype[M.internal] = /* @__PURE__ */ Object.create(null);
1022
+ var z = class Ot {
1023
1023
  static {
1024
1024
  k(this, "Service");
1025
1025
  }
@@ -1038,13 +1038,13 @@ var z = class At {
1038
1038
  config;
1039
1039
  constructor(...e) {
1040
1040
  let t, r, n, s;
1041
- N.is(e[0]) ? (t = e[0], typeof e[1] == "string" ? (r = e[1], n = e[2]) : s = e[1]) : s = e[0], r ??= this.constructor[b.provide], n ??= this.constructor[b.immediate];
1041
+ M.is(e[0]) ? (t = e[0], typeof e[1] == "string" ? (r = e[1], n = e[2]) : s = e[1]) : s = e[0], r ??= this.constructor[b.provide], n ??= this.constructor[b.immediate];
1042
1042
  let o = this;
1043
1043
  const a = {
1044
1044
  associate: r,
1045
1045
  property: "ctx"
1046
1046
  };
1047
- return o[b.invoke] && (o = Ce(r, Be(Object.getPrototypeOf(this), Function.prototype), a)), t ? o.ctx = t : o[b.setup](), o.name = r, o.config = s, j(o, b.tracker, a), o.ctx.provide(r), o.ctx.runtime.name = r, n && (t ? o[b.expose] = r : o.ctx.set(r, o)), o.ctx.on("ready", async () => {
1047
+ return o[b.invoke] && (o = Ae(r, Ue(Object.getPrototypeOf(this), Function.prototype), a)), t ? o.ctx = t : o[b.setup](), o.name = r, o.config = s, j(o, b.tracker, a), o.ctx.provide(r), o.ctx.runtime.name = r, n && (t ? o[b.expose] = r : o.ctx.set(r, o)), o.ctx.on("ready", async () => {
1048
1048
  await Promise.resolve(), await o.start(), n || o.ctx.set(r, o);
1049
1049
  }), o.ctx.on("dispose", () => o.stop()), o;
1050
1050
  }
@@ -1052,11 +1052,11 @@ var z = class At {
1052
1052
  return e[b.isolate][this.name] === this.ctx[b.isolate][this.name];
1053
1053
  }
1054
1054
  [b.setup]() {
1055
- this.ctx = new N();
1055
+ this.ctx = new M();
1056
1056
  }
1057
1057
  [b.extend](e) {
1058
1058
  let t;
1059
- return this[At.invoke] ? t = Ce(this.name, this, this[b.tracker]) : t = Object.create(this), Object.assign(t, e);
1059
+ return this[Ot.invoke] ? t = Ae(this.name, this, this[b.tracker]) : t = Object.create(this), Object.assign(t, e);
1060
1060
  }
1061
1061
  static [Symbol.hasInstance](e) {
1062
1062
  let t = e.constructor;
@@ -1066,9 +1066,9 @@ var z = class At {
1066
1066
  }
1067
1067
  return !1;
1068
1068
  }
1069
- }, Zi = Object.defineProperty, er = Object.getOwnPropertyNames, E = (i, e) => Zi(i, "name", { value: e, configurable: !0 }), tr = (i, e) => function() {
1070
- return e || (0, i[er(i)[0]])((e = { exports: {} }).exports, e), e.exports;
1071
- }, ir = tr({
1069
+ }, er = Object.defineProperty, tr = Object.getOwnPropertyNames, E = (i, e) => er(i, "name", { value: e, configurable: !0 }), ir = (i, e) => function() {
1070
+ return e || (0, i[tr(i)[0]])((e = { exports: {} }).exports, e), e.exports;
1071
+ }, rr = ir({
1072
1072
  "src/index.ts"(i, e) {
1073
1073
  var t = /* @__PURE__ */ Symbol.for("schemastery"), r = /* @__PURE__ */ Symbol.for("ValidationError");
1074
1074
  globalThis.__schemastery_index__ ??= 0, globalThis.__schemastery_refs__ = void 0;
@@ -1095,10 +1095,10 @@ var z = class At {
1095
1095
  return s.resolve(h, c, d)[0];
1096
1096
  }, "schema");
1097
1097
  if (l.refs) {
1098
- const h = q(l.refs, (m) => new s(m)), d = /* @__PURE__ */ E((m) => h[m], "getRef");
1098
+ const h = K(l.refs, (m) => new s(m)), d = /* @__PURE__ */ E((m) => h[m], "getRef");
1099
1099
  for (const m in h) {
1100
1100
  const v = h[m];
1101
- v.sKey = d(v.sKey), v.inner = d(v.inner), v.list = v.list && v.list.map(d), v.dict = v.dict && q(v.dict, d);
1101
+ v.sKey = d(v.sKey), v.inner = d(v.inner), v.list = v.list && v.list.map(d), v.dict = v.dict && K(v.dict, d);
1102
1102
  }
1103
1103
  return h[l.uid];
1104
1104
  }
@@ -1134,11 +1134,11 @@ var z = class At {
1134
1134
  }
1135
1135
  E(a, "getInner");
1136
1136
  function f(l) {
1137
- return bt(l ?? {}, (c) => !c.startsWith("$"));
1137
+ return vt(l ?? {}, (c) => !c.startsWith("$"));
1138
1138
  }
1139
1139
  E(f, "extractKeys"), s.prototype.i18n = /* @__PURE__ */ E(function(c) {
1140
1140
  const h = s(this), d = o(h.meta.description, c);
1141
- return Object.keys(d).length && (h.meta.description = d), h.dict && (h.dict = q(h.dict, (m, v) => m.i18n(q(c, (x) => a(x)?.[v] ?? x?.[v])))), h.list && (h.list = h.list.map((m, v) => m.i18n(q(c, (x = {}) => Array.isArray(a(x)) ? a(x)[v] : Array.isArray(x) ? x[v] : f(x))))), h.inner && (h.inner = h.inner.i18n(q(c, (m) => a(m) ? a(m) : f(m)))), h.sKey && (h.sKey = h.sKey.i18n(q(c, (m) => m?.$key))), h;
1141
+ return Object.keys(d).length && (h.meta.description = d), h.dict && (h.dict = K(h.dict, (m, v) => m.i18n(K(c, (x) => a(x)?.[v] ?? x?.[v])))), h.list && (h.list = h.list.map((m, v) => m.i18n(K(c, (x = {}) => Array.isArray(a(x)) ? a(x)[v] : Array.isArray(x) ? x[v] : f(x))))), h.inner && (h.inner = h.inner.i18n(K(c, (m) => a(m) ? a(m) : f(m)))), h.sKey && (h.sKey = h.sKey.i18n(K(c, (m) => m?.$key))), h;
1142
1142
  }, "i18n"), s.prototype.extra = /* @__PURE__ */ E(function(c, h) {
1143
1143
  const d = s(this);
1144
1144
  return d.meta = { ...d.meta, [c]: h }, d;
@@ -1157,10 +1157,10 @@ var z = class At {
1157
1157
  const c = s(this);
1158
1158
  return c.meta.badges ||= [], c.meta.badges.push({ text: "experimental", type: "warning" }), c;
1159
1159
  }, "experimental"), s.prototype.pattern = /* @__PURE__ */ E(function(c) {
1160
- const h = s(this), d = vt(c, ["source", "flags"]);
1160
+ const h = s(this), d = _t(c, ["source", "flags"]);
1161
1161
  return h.meta = { ...h.meta, pattern: d }, h;
1162
1162
  }, "pattern"), s.prototype.simplify = /* @__PURE__ */ E(function(c) {
1163
- if (J(c, this.meta.default, this.type === "dict")) return null;
1163
+ if (Y(c, this.meta.default, this.type === "dict")) return null;
1164
1164
  if (I(c)) return c;
1165
1165
  if (this.type === "object" || this.type === "dict") {
1166
1166
  const h = {};
@@ -1168,7 +1168,7 @@ var z = class At {
1168
1168
  const v = (this.type === "object" ? this.dict[d] : this.inner)?.simplify(c[d]);
1169
1169
  (this.type === "dict" || !I(v)) && (h[d] = v);
1170
1170
  }
1171
- return J(h, this.meta.default, this.type === "dict") ? null : h;
1171
+ return Y(h, this.meta.default, this.type === "dict") ? null : h;
1172
1172
  } else if (this.type === "array" || this.type === "tuple") {
1173
1173
  const h = [];
1174
1174
  return c.forEach((d, m) => {
@@ -1212,7 +1212,7 @@ var z = class At {
1212
1212
  for (; x?.type === "intersect" && I(A); )
1213
1213
  x = x.list[0], A = x?.meta.default;
1214
1214
  if (I(A)) return [c];
1215
- c = he(A);
1215
+ c = ue(A);
1216
1216
  }
1217
1217
  const v = u[h.type];
1218
1218
  if (!v) throw new n(`unsupported type "${h.type}"`, d);
@@ -1290,7 +1290,7 @@ var z = class At {
1290
1290
  }, "arrayBuffer"), s.extend("lazy", (l, c, h, d) => (c.inner[t] || (c.inner = c.builder(), c.inner.meta = { ...c.meta, ...c.inner.meta }), s.resolve(l, c.inner, h, d))), s.extend("any", (l) => [l]), s.extend("never", (l, c, h) => {
1291
1291
  throw new n(`expected nullable but got ${l}`, h);
1292
1292
  }), s.extend("const", (l, { value: c }, h) => {
1293
- if (J(l, c)) return [c];
1293
+ if (Y(l, c)) return [c];
1294
1294
  throw new n(`expected ${c} but got ${l}`, h);
1295
1295
  });
1296
1296
  function p(l, c, h, d, m = !1) {
@@ -1380,15 +1380,15 @@ var z = class At {
1380
1380
  if (!Array.isArray(l)) throw new n(`expected array but got ${l}`, d);
1381
1381
  return p(l.length, h, "array length", d, !I(c.meta.default)), [l.map((m, v) => g(l, v, c, d))];
1382
1382
  }), s.extend("dict", (l, { inner: c, sKey: h }, d, m) => {
1383
- if (!le(l)) throw new n(`expected object but got ${l}`, d);
1383
+ if (!he(l)) throw new n(`expected object but got ${l}`, d);
1384
1384
  const v = {};
1385
1385
  for (const x in l) {
1386
1386
  let A;
1387
1387
  try {
1388
1388
  A = s.resolve(x, h, d)[0];
1389
- } catch (ke) {
1389
+ } catch (Se) {
1390
1390
  if (m) continue;
1391
- throw ke;
1391
+ throw Se;
1392
1392
  }
1393
1393
  v[A] = g(l, x, c, d), l[A] = l[x], x !== A && delete l[x];
1394
1394
  }
@@ -1403,7 +1403,7 @@ var z = class At {
1403
1403
  h in l || (l[h] = c[h]);
1404
1404
  }
1405
1405
  E(w, "merge"), s.extend("object", (l, { dict: c }, h, d) => {
1406
- if (!le(l)) throw new n(`expected object but got ${l}`, h);
1406
+ if (!he(l)) throw new n(`expected object but got ${l}`, h);
1407
1407
  const m = {};
1408
1408
  for (const v in c) {
1409
1409
  const x = g(l, v, c[v], h);
@@ -1434,7 +1434,7 @@ var z = class At {
1434
1434
  throw new n(`expected ${h()} but got ${JSON.stringify(l)}`, d);
1435
1435
  }
1436
1436
  }
1437
- return !m && le(l) && w(v, l), [v];
1437
+ return !m && he(l) && w(v, l), [v];
1438
1438
  }), s.extend("transform", (l, { inner: c, callback: h, preserve: d }, m) => {
1439
1439
  const [v, x = l] = s.resolve(l, c, m, !0);
1440
1440
  return d ? [h(v)] : [h(v), h(x)];
@@ -1456,7 +1456,7 @@ var z = class At {
1456
1456
  m.list = d[x].map(s.from);
1457
1457
  break;
1458
1458
  case "dict":
1459
- m.dict = q(d[x], s.from);
1459
+ m.dict = K(d[x], s.from);
1460
1460
  break;
1461
1461
  case "bits": {
1462
1462
  m.bits = {};
@@ -1487,18 +1487,18 @@ var z = class At {
1487
1487
  }), C("intersect", ["list"], ({ list: l }) => `${l.map((c) => c.toString(!0)).join(" & ")}`), C("transform", ["inner", "callback", "preserve"], ({ inner: l }, c) => l.toString(c)), e.exports = s;
1488
1488
  }
1489
1489
  });
1490
- const $ = ir();
1491
- var Ot = /* @__PURE__ */ ((i) => (i[i.debug = -1] = "debug", i[i.log = 0] = "log", i[i.info = 1] = "info", i[i.warn = 2] = "warn", i[i.error = 3] = "error", i[i.silent = 4] = "silent", i))(Ot || {});
1492
- const Ie = globalThis || window, Le = /* @__PURE__ */ Symbol.for("__IPE_LOGGER_COLOR_MAP__");
1493
- Ie[Le] || (Ie[Le] = /* @__PURE__ */ new Map());
1494
- const Se = Ie[Le];
1495
- function oe(i) {
1490
+ const $ = rr();
1491
+ var Pt = /* @__PURE__ */ ((i) => (i[i.debug = -1] = "debug", i[i.log = 0] = "log", i[i.info = 1] = "info", i[i.warn = 2] = "warn", i[i.error = 3] = "error", i[i.silent = 4] = "silent", i))(Pt || {});
1492
+ const Le = globalThis || window, Re = /* @__PURE__ */ Symbol.for("__IPE_LOGGER_COLOR_MAP__");
1493
+ Le[Re] || (Le[Re] = /* @__PURE__ */ new Map());
1494
+ const $e = Le[Re];
1495
+ function ae(i) {
1496
1496
  let e = 2166136261;
1497
1497
  for (let t = 0; t < i.length; t++)
1498
1498
  e ^= i.charCodeAt(t), e = (e >>> 0) * 16777619;
1499
1499
  return e >>> 0;
1500
1500
  }
1501
- const lt = [
1501
+ const ht = [
1502
1502
  [350, 360],
1503
1503
  [0, 15],
1504
1504
  [15, 30],
@@ -1510,8 +1510,8 @@ const lt = [
1510
1510
  [140, 160],
1511
1511
  [160, 180]
1512
1512
  ];
1513
- function rr(i, e) {
1514
- const t = lt.length, r = oe(i) % t, [n, s] = lt[r], o = s - n, a = oe(i + ":" + e), f = n + a % (o || 1), u = oe(i + ":s"), p = oe(i + ":l");
1513
+ function nr(i, e) {
1514
+ const t = ht.length, r = ae(i) % t, [n, s] = ht[r], o = s - n, a = ae(i + ":" + e), f = n + a % (o || 1), u = ae(i + ":s"), p = ae(i + ":l");
1515
1515
  let y, _;
1516
1516
  if (e === "name")
1517
1517
  y = 62 + u % 18, _ = 30 + p % 12;
@@ -1521,30 +1521,30 @@ function rr(i, e) {
1521
1521
  }
1522
1522
  return `hsl(${f}, ${y}%, ${_}%)`;
1523
1523
  }
1524
- function ae(i, e) {
1524
+ function ce(i, e) {
1525
1525
  if (e)
1526
- return Se.set(i, e), e;
1527
- const t = Se.get(i);
1526
+ return $e.set(i, e), e;
1527
+ const t = $e.get(i);
1528
1528
  if (t) return t;
1529
- const r = i.startsWith("name:") ? "name" : "group", n = rr(i, r);
1530
- return Se.set(i, n), n;
1529
+ const r = i.startsWith("name:") ? "name" : "group", n = nr(i, r);
1530
+ return $e.set(i, n), n;
1531
1531
  }
1532
- class ze {
1532
+ class He {
1533
1533
  /**
1534
1534
  * Note: constructor returns a callable Proxy so that you can do `logger('group')`.
1535
1535
  */
1536
1536
  constructor(e = {}) {
1537
1537
  this._custom = (t) => {
1538
- if (!this._enabled(t.level)) return ht;
1538
+ if (!this._enabled(t.level)) return ut;
1539
1539
  const [r, n] = this._prefix(t.label);
1540
1540
  return this._consoleMethod(t.method).bind(console, r, ...n);
1541
1541
  }, this._name = e.name, this._nameColor = e.color, this._groupPath = e._groupPath ? [...e._groupPath] : [], this._dynamicLevels = { ...e._dynamicLevels }, this._levelRef = e._levelRef ?? {
1542
1542
  value: e.level ?? 1
1543
1543
  /* info */
1544
- }, this._name && ae(`name:${this._name}`, this._nameColor), this._installBuiltinLevels();
1544
+ }, this._name && ce(`name:${this._name}`, this._nameColor), this._installBuiltinLevels();
1545
1545
  for (const t of Object.keys(this._dynamicLevels))
1546
1546
  this._installLevelGetter(t, this._dynamicLevels[t]);
1547
- return sr(this);
1547
+ return or(this);
1548
1548
  }
1549
1549
  // ---------- public API ----------
1550
1550
  get level() {
@@ -1555,7 +1555,7 @@ class ze {
1555
1555
  }
1556
1556
  /** Create a sub-logger with a group label */
1557
1557
  group(e, t) {
1558
- return e && ae(`group:${e}`, t?.color), new ze({
1558
+ return e && ce(`group:${e}`, t?.color), new He({
1559
1559
  name: this._name,
1560
1560
  color: this._nameColor,
1561
1561
  _groupPath: [...this._groupPath, e],
@@ -1594,8 +1594,8 @@ class ze {
1594
1594
  });
1595
1595
  }
1596
1596
  _method(e) {
1597
- const t = nr[e];
1598
- if (!this._enabled(t.level)) return ht;
1597
+ const t = sr[e];
1598
+ if (!this._enabled(t.level)) return ut;
1599
1599
  const [r, n] = this._prefix(t.label);
1600
1600
  return this._consoleMethod(e).bind(console, r, ...n);
1601
1601
  }
@@ -1609,28 +1609,28 @@ class ze {
1609
1609
  const t = [];
1610
1610
  let r = "";
1611
1611
  if (this._name) {
1612
- const n = ae(`name:${this._name}`, this._nameColor);
1612
+ const n = ce(`name:${this._name}`, this._nameColor);
1613
1613
  r += `%c${this._name}%c`, t.push(
1614
1614
  `background:${n}; color:#fff; padding:1px 4px; border-radius:2px; font-weight:700;`,
1615
- ut
1615
+ ft
1616
1616
  );
1617
1617
  }
1618
1618
  if (e && (r += ` ${e}`), this._groupPath.length) {
1619
- const n = this._groupPath.join("/"), s = ae(`group:${n}`);
1620
- r += ` %c${n}%c`, t.push(`color:${s}; text-decoration: underline;`, ut);
1619
+ const n = this._groupPath.join("/"), s = ce(`group:${n}`);
1620
+ r += ` %c${n}%c`, t.push(`color:${s}; text-decoration: underline;`, ft);
1621
1621
  }
1622
1622
  return [r, t];
1623
1623
  }
1624
1624
  }
1625
- const ht = () => {
1626
- }, ut = "color:inherit; background:transparent; text-decoration:none;", nr = {
1625
+ const ut = () => {
1626
+ }, ft = "color:inherit; background:transparent; text-decoration:none;", sr = {
1627
1627
  debug: { level: -1, label: "", method: "debug" },
1628
1628
  log: { level: 0, label: "", method: "log" },
1629
1629
  info: { level: 1, label: "[I]", method: "info" },
1630
1630
  warn: { level: 2, label: "[W]", method: "warn" },
1631
1631
  error: { level: 3, label: "[E]", method: "error" }
1632
1632
  };
1633
- function sr(i) {
1633
+ function or(i) {
1634
1634
  const e = function(t, r) {
1635
1635
  return i.group(t, r);
1636
1636
  };
@@ -1649,10 +1649,10 @@ function sr(i) {
1649
1649
  }
1650
1650
  });
1651
1651
  }
1652
- function or(i) {
1653
- return new ze(i);
1652
+ function ar(i) {
1653
+ return new He(i);
1654
1654
  }
1655
- class Re extends wi {
1655
+ class je extends bi {
1656
1656
  async clientLogin(e, t, r) {
1657
1657
  r ||= {}, !r.logincontinue && !r.loginreturnurl && (r.loginreturnurl = location?.origin);
1658
1658
  const n = await this.postWithToken(
@@ -1669,16 +1669,16 @@ class Re extends wi {
1669
1669
  );
1670
1670
  if (n?.data?.clientlogin?.status === "PASS")
1671
1671
  return n.data.clientlogin;
1672
- throw new bi(
1673
- vi.LOGIN_FAILED,
1672
+ throw new vi(
1673
+ _i.LOGIN_FAILED,
1674
1674
  n.data.clientlogin.message,
1675
1675
  n
1676
1676
  );
1677
1677
  }
1678
1678
  }
1679
- class ar extends Re {
1679
+ class cr extends je {
1680
1680
  constructor(e, t, r) {
1681
- const n = _i(
1681
+ const n = xi(
1682
1682
  e,
1683
1683
  {
1684
1684
  credentials: "include",
@@ -1693,10 +1693,10 @@ class ar extends Re {
1693
1693
  super(n);
1694
1694
  }
1695
1695
  }
1696
- class cr {
1696
+ class lr {
1697
1697
  constructor(e, t = {}) {
1698
1698
  this.ctx = e, this.options = t, this._apiClients = /* @__PURE__ */ new Map(), location?.href && t?.baseURL?.toString()?.startsWith("/") && (t.baseURL = new URL(t.baseURL, location.origin));
1699
- const r = this.api = new Re({
1699
+ const r = this.api = new je({
1700
1700
  baseURL: t.baseURL.toString(),
1701
1701
  fexiosConfigs: {
1702
1702
  headers: {
@@ -1717,7 +1717,7 @@ class cr {
1717
1717
  const n = t.origin === location.origin, s = {
1718
1718
  baseURL: t.toString(),
1719
1719
  throwOnApiError: !0
1720
- }, o = n ? new Re(s) : new ar(s);
1720
+ }, o = n ? new je(s) : new cr(s);
1721
1721
  o.request.on("beforeRequest", (a) => {
1722
1722
  a.headers = o.request.mergeHeaders(a.headers, {
1723
1723
  "x-api-user-agent": null,
@@ -1728,68 +1728,82 @@ class cr {
1728
1728
  return this._apiClients.get(r);
1729
1729
  }
1730
1730
  }
1731
- const ft = (i, e = document) => e.querySelector(i), ps = (i, e = document) => e.querySelectorAll(i);
1732
- var lr = Object.create, Ke = Object.defineProperty, hr = Object.getOwnPropertyDescriptor, Pt = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), It = (i) => {
1731
+ const dt = (i, e = document) => e.querySelector(i), ms = (i, e = document) => e.querySelectorAll(i);
1732
+ var hr = Object.create, Ke = Object.defineProperty, ur = Object.getOwnPropertyDescriptor, It = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), Lt = (i) => {
1733
1733
  throw TypeError(i);
1734
- }, ur = (i, e, t) => e in i ? Ke(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, fr = (i, e) => Ke(i, "name", { value: e, configurable: !0 }), dr = (i) => [, , , lr(i?.[Pt("metadata")] ?? null)], pr = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Lt = (i) => i !== void 0 && typeof i != "function" ? It("Function expected") : i, gr = (i, e, t, r, n) => ({ kind: pr[i], name: e, metadata: r, addInitializer: (s) => t._ ? It("Already initialized") : n.push(Lt(s || null)) }), mr = (i, e) => ur(e, Pt("metadata"), i[3]), yr = (i, e, t, r) => {
1734
+ }, fr = (i, e, t) => e in i ? Ke(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, dr = (i, e) => Ke(i, "name", { value: e, configurable: !0 }), pr = (i) => [, , , hr(i?.[It("metadata")] ?? null)], gr = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Rt = (i) => i !== void 0 && typeof i != "function" ? Lt("Function expected") : i, mr = (i, e, t, r, n) => ({ kind: gr[i], name: e, metadata: r, addInitializer: (s) => t._ ? Lt("Already initialized") : n.push(Rt(s || null)) }), yr = (i, e) => fr(e, It("metadata"), i[3]), wr = (i, e, t, r) => {
1735
1735
  for (var n = 0, s = i[e >> 1], o = s && s.length; n < o; n++) s[n].call(t);
1736
1736
  return r;
1737
- }, wr = (i, e, t, r, n, s) => {
1738
- var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && hr(n, t));
1739
- fr(n, t);
1737
+ }, br = (i, e, t, r, n, s) => {
1738
+ var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && ur(n, t));
1739
+ dr(n, t);
1740
1740
  for (var w = r.length - 1; w >= 0; w--)
1741
- f = gr(u, t, a = {}, i[3], _), o = (0, r[w])(n, f), a._ = 1, Lt(o) && (n = o);
1742
- return mr(i, n), g && Ke(n, t, g), p ? u ^ 4 ? s : g : n;
1743
- }, Rt, qe, jt;
1744
- Rt = [F(["wiki", "wikiTitle"])];
1745
- class fe extends (jt = z) {
1741
+ f = mr(u, t, a = {}, i[3], _), o = (0, r[w])(n, f), a._ = 1, Rt(o) && (n = o);
1742
+ return yr(i, n), g && Ke(n, t, g), p ? u ^ 4 ? s : g : n;
1743
+ }, jt, qe, Dt;
1744
+ jt = [F(["wiki", "wikiTitle"])];
1745
+ let de = class Z extends (Dt = z) {
1746
1746
  constructor(e) {
1747
- super(e, "currentPage", !1), this.ctx = e, this.url = new URL(window.location.href), this.isMainPage = void 0, this.wikiTitle = void 0;
1747
+ super(e, "currentPage", !1), this.ctx = e, this.#e = this.#r.bind(this), this.url = new URL(window.location.href), this.isMainPage = void 0, this.wikiTitle = void 0;
1748
1748
  }
1749
1749
  get logger() {
1750
1750
  return this.ctx.logger("CURRENT_PAGE");
1751
1751
  }
1752
+ static {
1753
+ this.HISTORY_CHANGE_EVENT = "inpageedit:historychange";
1754
+ }
1755
+ static {
1756
+ this.POPSTATE_INJECTION_KEY = /* @__PURE__ */ Symbol.for(
1757
+ "inpageedit:currentpage:popstateinjection"
1758
+ );
1759
+ }
1752
1760
  async start() {
1753
- await this.#e(), this.#i(), window.addEventListener("popstate", this.#t.bind(this)), this.logger.info("initialized", this.wikiTitle);
1761
+ await this.#t(), this.#i(), window.addEventListener(Z.HISTORY_CHANGE_EVENT, this.#e), this.ctx.emit("current-page/popstate"), this.logger.info("initialized", this.wikiTitle);
1754
1762
  }
1755
1763
  stop() {
1756
- window.removeEventListener("popstate", this.#t.bind(this));
1764
+ window.removeEventListener(Z.HISTORY_CHANGE_EVENT, this.#e);
1757
1765
  }
1758
- async #e() {
1759
- await this.#n(), await this.#r();
1766
+ async #t() {
1767
+ await this.#s(), await this.#n();
1760
1768
  }
1769
+ /**
1770
+ * @NOTE
1771
+ * Do not use event name 'popstate' to listen to history change,
1772
+ * because it will cause conflict with some SPA frameworks (e.g. vue-router).
1773
+ */
1761
1774
  #i() {
1762
- const e = /* @__PURE__ */ Symbol.for("InPageEdit.CurrentPageService.UrlChangeListenerInstalled");
1775
+ const e = Z.POPSTATE_INJECTION_KEY;
1763
1776
  if (window[e])
1764
1777
  return;
1765
1778
  const t = history.pushState, r = history.replaceState;
1766
1779
  history.pushState = function(n, s, o) {
1767
- t.apply(this, [n, s, o]), window.dispatchEvent(new PopStateEvent("popstate", { state: n }));
1780
+ t.apply(this, [n, s, o]), window.dispatchEvent(new CustomEvent(Z.HISTORY_CHANGE_EVENT));
1768
1781
  }, history.replaceState = function(n, s, o) {
1769
- r.apply(this, [n, s, o]), window.dispatchEvent(new PopStateEvent("popstate", { state: n }));
1782
+ r.apply(this, [n, s, o]), window.dispatchEvent(new CustomEvent(Z.HISTORY_CHANGE_EVENT));
1770
1783
  }, window[e] = !0;
1771
1784
  }
1772
- async #t(e) {
1773
- const t = this.url, r = new URL(window.location.href);
1774
- this.url = r, (t.pathname !== r.pathname || t.searchParams.get("title") !== r.searchParams.get("title") || t.searchParams.get("curid") !== r.searchParams.get("curid")) && (await this.#e(), this.logger.info("location changed", r, this.wikiTitle));
1785
+ async #r() {
1786
+ const e = this.url, t = new URL(window.location.href);
1787
+ this.url = t, (e.pathname !== t.pathname || e.searchParams.get("title") !== t.searchParams.get("title") || e.searchParams.get("curid") !== t.searchParams.get("curid")) && (await this.#t(), this.ctx.emit("current-page/popstate"), this.logger.info("location changed", t, this.wikiTitle));
1775
1788
  }
1789
+ #e;
1776
1790
  get params() {
1777
1791
  return this.url.searchParams;
1778
1792
  }
1779
1793
  get canonicalUrl() {
1780
- const e = (ft('link[rel="alternate"][hreflang="x-default"]') || ft('link[rel="canonical"]'))?.href;
1794
+ const e = (dt('link[rel="alternate"][hreflang="x-default"]') || dt('link[rel="canonical"]'))?.href;
1781
1795
  let t = null;
1782
1796
  return e && (t = new URL(e, location.origin)), Reflect.defineProperty(this, "canonicalUrl", {
1783
1797
  get: () => t
1784
1798
  }), t;
1785
1799
  }
1786
- async #r() {
1800
+ async #n() {
1787
1801
  const t = this.wikiTitle?.getMainDBKey() === this.ctx.wiki.mainPageName;
1788
1802
  return Reflect.defineProperty(this, "isMainPage", {
1789
1803
  get: () => t
1790
1804
  }), t;
1791
1805
  }
1792
- async #n() {
1806
+ async #s() {
1793
1807
  let e = null;
1794
1808
  return this.canonicalUrl ? e = await this.ctx.wikiTitle.newTitleFromUrl(this.canonicalUrl) : e = await this.ctx.wikiTitle.newTitleFromUrl(this.url), Object.freeze(e), Reflect.defineProperty(this, "wikiTitle", {
1795
1809
  get: () => e
@@ -1798,11 +1812,12 @@ class fe extends (jt = z) {
1798
1812
  get wikiAction() {
1799
1813
  return this.params.get("action") || "view";
1800
1814
  }
1801
- }
1802
- qe = dr(jt);
1803
- fe = wr(qe, 0, "CurrentPageService", Rt, fe);
1804
- yr(qe, 1, fe);
1805
- class br extends z {
1815
+ };
1816
+ qe = pr(Dt);
1817
+ de = br(qe, 0, "CurrentPageService", jt, de);
1818
+ wr(qe, 1, de);
1819
+ let vr = de;
1820
+ class _r extends z {
1806
1821
  constructor(e) {
1807
1822
  super(e, "resourceLoader", !0), this.ctx = e;
1808
1823
  }
@@ -1851,40 +1866,40 @@ class br extends z {
1851
1866
  return e.startsWith("http") || e.startsWith("//") ? e : import.meta.resolve(e);
1852
1867
  }
1853
1868
  }
1854
- const _e = Object.keys;
1855
- function vr(i) {
1869
+ const xe = Object.keys;
1870
+ function xr(i) {
1856
1871
  return typeof i == "boolean";
1857
1872
  }
1858
- function _r(i) {
1873
+ function kr(i) {
1859
1874
  return i && typeof i.nodeType == "number";
1860
1875
  }
1861
- function He(i) {
1876
+ function We(i) {
1862
1877
  return typeof i == "string";
1863
1878
  }
1864
- function Dt(i) {
1879
+ function Tt(i) {
1865
1880
  return typeof i == "number";
1866
1881
  }
1867
- function Y(i) {
1868
- return typeof i == "object" ? i !== null : re(i);
1882
+ function J(i) {
1883
+ return typeof i == "object" ? i !== null : ne(i);
1869
1884
  }
1870
- function re(i) {
1885
+ function ne(i) {
1871
1886
  return typeof i == "function";
1872
1887
  }
1873
- function xr(i) {
1888
+ function Sr(i) {
1874
1889
  return !!(i && i.isComponent);
1875
1890
  }
1876
- function kr(i) {
1877
- return Y(i) && typeof i.length == "number" && typeof i.nodeType != "number";
1891
+ function $r(i) {
1892
+ return J(i) && typeof i.length == "number" && typeof i.nodeType != "number";
1878
1893
  }
1879
- function je(i, e) {
1894
+ function De(i, e) {
1880
1895
  if (i)
1881
- for (const t of _e(i))
1896
+ for (const t of xe(i))
1882
1897
  e(i[t], t);
1883
1898
  }
1884
- function Sr(i) {
1885
- return Y(i) && "current" in i;
1899
+ function Er(i) {
1900
+ return J(i) && "current" in i;
1886
1901
  }
1887
- const De = {
1902
+ const Te = {
1888
1903
  animationIterationCount: 0,
1889
1904
  borderImageOutset: 0,
1890
1905
  borderImageSlice: 0,
@@ -1929,30 +1944,30 @@ const De = {
1929
1944
  strokeOpacity: 0,
1930
1945
  strokeWidth: 0
1931
1946
  };
1932
- function $r(i, e) {
1947
+ function Cr(i, e) {
1933
1948
  return i + e.charAt(0).toUpperCase() + e.substring(1);
1934
1949
  }
1935
- const Er = ["Webkit", "ms", "Moz", "O"];
1936
- _e(De).forEach((i) => {
1937
- Er.forEach((e) => {
1938
- De[$r(e, i)] = 0;
1950
+ const Ar = ["Webkit", "ms", "Moz", "O"];
1951
+ xe(Te).forEach((i) => {
1952
+ Ar.forEach((e) => {
1953
+ Te[Cr(e, i)] = 0;
1939
1954
  });
1940
1955
  });
1941
- const Cr = /* @__PURE__ */ Symbol.for("jsx-dom:type");
1942
- var Tt = /* @__PURE__ */ (function(i) {
1956
+ const Or = /* @__PURE__ */ Symbol.for("jsx-dom:type");
1957
+ var Nt = /* @__PURE__ */ (function(i) {
1943
1958
  return i.ShadowRoot = "ShadowRoot", i;
1944
- })(Tt || {});
1945
- function Ar(i) {
1946
- return i != null && i[Cr] === Tt.ShadowRoot;
1959
+ })(Nt || {});
1960
+ function Pr(i) {
1961
+ return i != null && i[Or] === Nt.ShadowRoot;
1947
1962
  }
1948
- const Or = "http://www.w3.org/2000/svg", Pr = "http://www.w3.org/1999/xlink", Ir = "http://www.w3.org/XML/1998/namespace";
1963
+ const Ir = "http://www.w3.org/2000/svg", Lr = "http://www.w3.org/1999/xlink", Rr = "http://www.w3.org/XML/1998/namespace";
1949
1964
  function Mt(i) {
1950
- return !vr(i) && i != null;
1965
+ return !xr(i) && i != null;
1951
1966
  }
1952
- function Te(i) {
1953
- return Array.isArray(i) ? i.map(Te).filter(Boolean).join(" ") : Y(i) ? Symbol.iterator in i ? Te(Array.from(i)) : _e(i).filter((e) => i[e]).join(" ") : Mt(i) ? "" + i : "";
1967
+ function Ne(i) {
1968
+ return Array.isArray(i) ? i.map(Ne).filter(Boolean).join(" ") : J(i) ? Symbol.iterator in i ? Ne(Array.from(i)) : xe(i).filter((e) => i[e]).join(" ") : Mt(i) ? "" + i : "";
1954
1969
  }
1955
- const Lr = {
1970
+ const jr = {
1956
1971
  animate: 0,
1957
1972
  circle: 0,
1958
1973
  clipPath: 0,
@@ -2007,28 +2022,28 @@ const Lr = {
2007
2022
  tspan: 0,
2008
2023
  use: 0,
2009
2024
  view: 0
2010
- }, Rr = /^(a(ll|t|u)|base[FP]|c(al|lipPathU|on)|di|ed|ex|filter[RU]|g(lyphR|r)|ke|l(en|im)|ma(rker[HUW]|s)|n|pat|pr|point[^e]|re[^n]|s[puy]|st[^or]|ta|textL|vi|xC|y|z)/;
2011
- function jr(i) {
2025
+ }, Dr = /^(a(ll|t|u)|base[FP]|c(al|lipPathU|on)|di|ed|ex|filter[RU]|g(lyphR|r)|ke|l(en|im)|ma(rker[HUW]|s)|n|pat|pr|point[^e]|re[^n]|s[puy]|st[^or]|ta|textL|vi|xC|y|z)/;
2026
+ function Tr(i) {
2012
2027
  const e = document.createDocumentFragment();
2013
- return xe(i.children, e), e;
2028
+ return ke(i.children, e), e;
2014
2029
  }
2015
- function Dr(i, e, t) {
2030
+ function Nr(i, e, t) {
2016
2031
  e = {
2017
2032
  ...e,
2018
2033
  children: t
2019
2034
  };
2020
2035
  const r = new i(e), n = r.render();
2021
- return "ref" in e && We(e.ref, r), n;
2036
+ return "ref" in e && Ge(e.ref, r), n;
2022
2037
  }
2023
2038
  function P(i, e) {
2024
2039
  let { children: t, ...r } = e;
2025
- !r.namespaceURI && Lr[i] === 0 && (r = {
2040
+ !r.namespaceURI && jr[i] === 0 && (r = {
2026
2041
  ...r,
2027
- namespaceURI: Or
2042
+ namespaceURI: Ir
2028
2043
  });
2029
2044
  let n;
2030
- if (He(i)) {
2031
- if (n = r.namespaceURI ? document.createElementNS(r.namespaceURI, i) : document.createElement(i), Nr(r, n), xe(t, n), n instanceof window.HTMLSelectElement && r.value != null)
2045
+ if (We(i)) {
2046
+ if (n = r.namespaceURI ? document.createElementNS(r.namespaceURI, i) : document.createElement(i), Ur(r, n), ke(t, n), n instanceof window.HTMLSelectElement && r.value != null)
2032
2047
  if (r.multiple === !0 && Array.isArray(r.value)) {
2033
2048
  const s = r.value.map((o) => String(o));
2034
2049
  n.querySelectorAll("option").forEach(
@@ -2036,12 +2051,12 @@ function P(i, e) {
2036
2051
  );
2037
2052
  } else
2038
2053
  n.value = r.value;
2039
- We(r.ref, n);
2040
- } else if (re(i))
2041
- Y(i.defaultProps) && (r = {
2054
+ Ge(r.ref, n);
2055
+ } else if (ne(i))
2056
+ J(i.defaultProps) && (r = {
2042
2057
  ...i.defaultProps,
2043
2058
  ...r
2044
- }), n = xr(i) ? Dr(i, r, t) : i({
2059
+ }), n = Sr(i) ? Nr(i, r, t) : i({
2045
2060
  ...r,
2046
2061
  children: t
2047
2062
  });
@@ -2049,40 +2064,40 @@ function P(i, e) {
2049
2064
  throw new TypeError(`Invalid JSX element type: ${i}`);
2050
2065
  return n;
2051
2066
  }
2052
- function We(i, e) {
2053
- Sr(i) ? i.current = e : re(i) && i(e);
2067
+ function Ge(i, e) {
2068
+ Er(i) ? i.current = e : ne(i) && i(e);
2054
2069
  }
2055
- function xe(i, e) {
2056
- if (kr(i))
2057
- Tr(i, e);
2058
- else if (He(i) || Dt(i))
2059
- $e(document.createTextNode(i), e);
2070
+ function ke(i, e) {
2071
+ if ($r(i))
2072
+ Mr(i, e);
2073
+ else if (We(i) || Tt(i))
2074
+ Ee(document.createTextNode(i), e);
2060
2075
  else if (i === null)
2061
- $e(document.createComment(""), e);
2062
- else if (_r(i))
2063
- $e(i, e);
2064
- else if (Ar(i)) {
2076
+ Ee(document.createComment(""), e);
2077
+ else if (kr(i))
2078
+ Ee(i, e);
2079
+ else if (Pr(i)) {
2065
2080
  const t = e.attachShadow(i.attr);
2066
- xe(i.children, t), We(i.ref, t);
2081
+ ke(i.children, t), Ge(i.ref, t);
2067
2082
  }
2068
2083
  }
2069
- function Tr(i, e) {
2084
+ function Mr(i, e) {
2070
2085
  for (const t of [...i])
2071
- xe(t, e);
2086
+ ke(t, e);
2072
2087
  return e;
2073
2088
  }
2074
- function $e(i, e) {
2089
+ function Ee(i, e) {
2075
2090
  e instanceof window.HTMLTemplateElement ? e.content.appendChild(i) : e.appendChild(i);
2076
2091
  }
2077
- function ce(i, e) {
2092
+ function le(i, e) {
2078
2093
  return i.replace(/[A-Z]/g, (t) => e + t.toLowerCase());
2079
2094
  }
2080
- function Nt(i, e) {
2081
- e == null || e === !1 || (Array.isArray(e) ? e.forEach((t) => Nt(i, t)) : He(e) ? i.setAttribute("style", e) : Y(e) && je(e, (t, r) => {
2082
- r.indexOf("-") === 0 ? i.style.setProperty(r, t) : Dt(t) && De[r] !== 0 ? i.style[r] = t + "px" : i.style[r] = t;
2095
+ function Bt(i, e) {
2096
+ e == null || e === !1 || (Array.isArray(e) ? e.forEach((t) => Bt(i, t)) : We(e) ? i.setAttribute("style", e) : J(e) && De(e, (t, r) => {
2097
+ r.indexOf("-") === 0 ? i.style.setProperty(r, t) : Tt(t) && Te[r] !== 0 ? i.style[r] = t + "px" : i.style[r] = t;
2083
2098
  }));
2084
2099
  }
2085
- function Mr(i, e, t) {
2100
+ function Br(i, e, t) {
2086
2101
  switch (i) {
2087
2102
  case "xlinkActuate":
2088
2103
  case "xlinkArcrole":
@@ -2091,15 +2106,15 @@ function Mr(i, e, t) {
2091
2106
  case "xlinkShow":
2092
2107
  case "xlinkTitle":
2093
2108
  case "xlinkType":
2094
- dt(t, Pr, ce(i, ":"), e);
2109
+ pt(t, Lr, le(i, ":"), e);
2095
2110
  return;
2096
2111
  case "xmlnsXlink":
2097
- X(t, ce(i, ":"), e);
2112
+ X(t, le(i, ":"), e);
2098
2113
  return;
2099
2114
  case "xmlBase":
2100
2115
  case "xmlLang":
2101
2116
  case "xmlSpace":
2102
- dt(t, Ir, ce(i, ":"), e);
2117
+ pt(t, Rr, le(i, ":"), e);
2103
2118
  return;
2104
2119
  }
2105
2120
  switch (i) {
@@ -2107,7 +2122,7 @@ function Mr(i, e, t) {
2107
2122
  X(t, "for", e);
2108
2123
  return;
2109
2124
  case "dataset":
2110
- je(e, (r, n) => {
2125
+ De(e, (r, n) => {
2111
2126
  r != null && (t.dataset[n] = r);
2112
2127
  });
2113
2128
  return;
@@ -2117,7 +2132,7 @@ function Mr(i, e, t) {
2117
2132
  Mt(e) && (t[i] = e);
2118
2133
  return;
2119
2134
  case "dangerouslySetInnerHTML":
2120
- Y(e) && (t.innerHTML = e.__html);
2135
+ J(e) && (t.innerHTML = e.__html);
2121
2136
  return;
2122
2137
  case "value":
2123
2138
  if (e == null || t instanceof window.HTMLSelectElement)
@@ -2132,22 +2147,22 @@ function Mr(i, e, t) {
2132
2147
  return;
2133
2148
  case "class":
2134
2149
  case "className":
2135
- re(e) ? e(t) : X(t, "class", Te(e));
2150
+ ne(e) ? e(t) : X(t, "class", Ne(e));
2136
2151
  return;
2137
2152
  case "ref":
2138
2153
  case "namespaceURI":
2139
2154
  return;
2140
2155
  case "style":
2141
- Nt(t, e);
2156
+ Bt(t, e);
2142
2157
  return;
2143
2158
  case "on":
2144
2159
  case "onCapture":
2145
- je(e, (r, n) => {
2160
+ De(e, (r, n) => {
2146
2161
  t.addEventListener(n, r, i === "onCapture");
2147
2162
  });
2148
2163
  return;
2149
2164
  }
2150
- if (re(e)) {
2165
+ if (ne(e)) {
2151
2166
  if (i[0] === "o" && i[1] === "n") {
2152
2167
  let r = i.toLowerCase();
2153
2168
  const n = r.endsWith("capture");
@@ -2164,30 +2179,30 @@ function Mr(i, e, t) {
2164
2179
  r in window ? s = r.substring(2) : s = r[2] + i.slice(3), t.addEventListener(s, e);
2165
2180
  }
2166
2181
  }
2167
- } else Y(e) ? t[i] = e : e === !0 ? X(t, i, "") : e !== !1 && e != null && (t instanceof SVGElement && !Rr.test(i) ? X(t, ce(i, "-"), e) : X(t, i, e));
2182
+ } else J(e) ? t[i] = e : e === !0 ? X(t, i, "") : e !== !1 && e != null && (t instanceof SVGElement && !Dr.test(i) ? X(t, le(i, "-"), e) : X(t, i, e));
2168
2183
  }
2169
2184
  function X(i, e, t) {
2170
2185
  i.setAttribute(e, t);
2171
2186
  }
2172
- function dt(i, e, t, r) {
2187
+ function pt(i, e, t, r) {
2173
2188
  i.setAttributeNS(e, t, r);
2174
2189
  }
2175
- function Nr(i, e) {
2176
- for (const t of _e(i))
2177
- Mr(t, i[t], e);
2190
+ function Ur(i, e) {
2191
+ for (const t of xe(i))
2192
+ Br(t, i[t], e);
2178
2193
  return e;
2179
2194
  }
2180
- var Ge = /* @__PURE__ */ ((i) => (i.Init = "modal.init", i.BeforeShow = "modal.beforeShow", i.Show = "modal.show", i.BeforeClose = "modal.beforeClose", i.Close = "modal.close", i.Destroy = "modal.destroy", i.ToastShow = "toast.show", i.ToastClose = "toast.close", i))(Ge || {});
2181
- let Br = 0;
2182
- const pt = (i) => `${i}-${++Br}`;
2183
- function Z(i) {
2195
+ var Ve = /* @__PURE__ */ ((i) => (i.Init = "modal.init", i.BeforeShow = "modal.beforeShow", i.Show = "modal.show", i.BeforeClose = "modal.beforeClose", i.Close = "modal.close", i.Destroy = "modal.destroy", i.ToastShow = "toast.show", i.ToastClose = "toast.close", i))(Ve || {});
2196
+ let Fr = 0;
2197
+ const gt = (i) => `${i}-${++Fr}`;
2198
+ function ee(i) {
2184
2199
  return i instanceof Node ? i : document.createTextNode(String(i));
2185
2200
  }
2186
- function K(i, e) {
2201
+ function H(i, e) {
2187
2202
  if (!i) throw new Error(`${e ?? "Element"} not found`);
2188
2203
  return i;
2189
2204
  }
2190
- function gt(i) {
2205
+ function mt(i) {
2191
2206
  const e = [
2192
2207
  "a[href]",
2193
2208
  "button:not([disabled])",
@@ -2206,8 +2221,8 @@ function D(i, e = {}) {
2206
2221
  for (const [r, n] of Object.entries(e.attrs)) t.setAttribute(r, n);
2207
2222
  return t;
2208
2223
  }
2209
- const Ur = typeof navigator < "u" && /Mac|iPhone|iPad|iPod/i.test(navigator.platform), Bt = ["ctrl", "alt", "shift", "meta"];
2210
- function Fr(i) {
2224
+ const zr = typeof navigator < "u" && /Mac|iPhone|iPad|iPod/i.test(navigator.platform), Ut = ["ctrl", "alt", "shift", "meta"];
2225
+ function Hr(i) {
2211
2226
  if (!i) return null;
2212
2227
  const e = String(i).trim().toLowerCase().split(/[+\-\s]+/g).filter(Boolean), t = [];
2213
2228
  let r = null;
@@ -2233,23 +2248,23 @@ function Fr(i) {
2233
2248
  continue;
2234
2249
  }
2235
2250
  if (a === "mod") {
2236
- n(Ur ? "meta" : "ctrl");
2251
+ n(zr ? "meta" : "ctrl");
2237
2252
  continue;
2238
2253
  }
2239
2254
  a === "esc" && (a = "escape"), a === "return" && (a = "enter"), (a === "space" || a === "spacebar") && (a = "space"), r = a;
2240
2255
  }
2241
- const s = Bt.filter((o) => t.includes(o));
2256
+ const s = Ut.filter((o) => t.includes(o));
2242
2257
  return !r || r === "" ? s.length ? s.join("+") : null : s.length ? `${s.join("+")}+${r}` : r;
2243
2258
  }
2244
- function zr(i) {
2259
+ function Kr(i) {
2245
2260
  const e = [];
2246
2261
  i.ctrlKey && e.push("ctrl"), i.altKey && e.push("alt"), i.shiftKey && e.push("shift"), i.metaKey && e.push("meta");
2247
2262
  let t = i.key;
2248
2263
  t === " " && (t = "space");
2249
- const r = (t.length, t.toLowerCase()), n = Bt.filter((s) => e.includes(s));
2264
+ const r = (t.length, t.toLowerCase()), n = Ut.filter((s) => e.includes(s));
2250
2265
  return n.length ? `${n.join("+")}+${r}` : r;
2251
2266
  }
2252
- class Kr {
2267
+ class qr {
2253
2268
  constructor() {
2254
2269
  this.zBase = 1e3, this.stack = [];
2255
2270
  }
@@ -2282,10 +2297,10 @@ class Kr {
2282
2297
  document.body.classList.remove("ipe-modal-no-scroll");
2283
2298
  }
2284
2299
  }
2285
- const T = new Kr();
2286
- class de {
2300
+ const T = new qr();
2301
+ class pe {
2287
2302
  constructor(e = {}) {
2288
- this.backdropId = pt("ipe-modal-backdrop"), this.modalId = pt("ipe-modal"), this.numberId = this.modalId.split("-")[1], this._isDestroyed = !1, this.pluginName = "normalModal", this.buttonElsLeft = [], this.buttonElsRight = [], this.keyMap = /* @__PURE__ */ new Map(), this.isOpen = !1, this.isToast = !1, this.isDragging = !1, this.dragStartX = 0, this.dragStartY = 0, this.modalStartX = 0, this.modalStartY = 0, this.Event = Ge, this._hooks = [], this.startCloseTimer = (t) => {
2303
+ this.backdropId = gt("ipe-modal-backdrop"), this.modalId = gt("ipe-modal"), this.numberId = this.modalId.split("-")[1], this._isDestroyed = !1, this.pluginName = "normalModal", this.buttonElsLeft = [], this.buttonElsRight = [], this.keyMap = /* @__PURE__ */ new Map(), this.isOpen = !1, this.isToast = !1, this.isDragging = !1, this.dragStartX = 0, this.dragStartY = 0, this.modalStartX = 0, this.modalStartY = 0, this.Event = Ve, this._hooks = [], this.startCloseTimer = (t) => {
2289
2304
  this.stopCloseTimer(), this.closeTimer = window.setTimeout(() => this.close(), t);
2290
2305
  }, this.stopCloseTimer = () => {
2291
2306
  this.closeTimer && window.clearTimeout(this.closeTimer), this.closeTimer = void 0;
@@ -2301,7 +2316,7 @@ class de {
2301
2316
  t.classList.remove("is-dragging"), r.style.animation = "none", requestAnimationFrame(() => {
2302
2317
  this.applyAnimation(!0);
2303
2318
  });
2304
- }, this.options = { ...de.DEFAULT_OPTIONS, ...e }, this.options.backdrop === !1 && e.bodyScroll === void 0 && (this.options.bodyScroll = !0);
2319
+ }, this.options = { ...pe.DEFAULT_OPTIONS, ...e }, this.options.backdrop === !1 && e.bodyScroll === void 0 && (this.options.bodyScroll = !0);
2305
2320
  }
2306
2321
  get isDestroyed() {
2307
2322
  return this._isDestroyed;
@@ -2377,7 +2392,7 @@ class de {
2377
2392
  }), _ = D("div", {
2378
2393
  className: "ipe-modal-modal__buttons ipe-modal-modal__buttons--right"
2379
2394
  });
2380
- return p.append(y, _), n.append(s, u, p), r.appendChild(n), this.$backdrop = t, this.$modal = r, this.$window = n, this.$header = s, this.$title = a, this.$icons = f, this.$content = u, this.$footer = p, this.$buttonsLeft = y, this.$buttonsRight = _, this.options.title && this.setTitle(this.options.title), this.options.content && this.setContent(this.options.content), this.options.buttons?.length ? this.setButtons(this.options.buttons) : p.style.display = "none", this.options.center && this.$modal.classList.add("is-centered"), this.options.fitScreen && this.$modal.classList.add("is-fullscreen"), this.options.iconButtons && this.$header.classList.add("has-icon-buttons"), this.options.className && this.$window.classList.add(...this.options.className.split(/[\s\.#+]+/g).filter(Boolean)), typeof this.options.fixedHeight == "number" ? this.$window.style.height = `${Math.max(0, this.options.fixedHeight)}px` : this.options.fixedHeight === !0 && this.$window.classList.add("is-fixed-height"), t && t.addEventListener("pointerdown", (g) => {
2395
+ return p.append(y, _), n.append(s, u, p), r.appendChild(n), this.$backdrop = t, this.$modal = r, this.$window = n, this.$header = s, this.$title = a, this.$icons = f, this.$content = u, this.$footer = p, this.$buttonsLeft = y, this.$buttonsRight = _, this.options.title && this.setTitle(this.options.title), this.options.content && this.setContent(this.options.content), this.options.buttons?.length ? this.setButtons(this.options.buttons) : p.style.display = "none", this.options.center && this.$modal.classList.add("is-centered"), this.options.fitScreen && this.$modal.classList.add("is-fullscreen"), this.options.iconButtons && this.$header.classList.add("has-icon-buttons"), this.options.className && this.$window.classList.add(...this.options.className.split(/[\s\.#+]+/g).filter(Boolean)), typeof this.options.fixedHeight == "number" ? this.$window.style.height = `${Math.max(0, this.options.fixedHeight)}px` : this.options.fixedHeight === !0 && this.$window.classList.add("is-fixed-height"), t && t.addEventListener("pointerup", (g) => {
2381
2396
  this.options.outSideClose && g.target === t && this.close();
2382
2397
  }), this.options.draggable && n.addEventListener("pointerdown", (g) => {
2383
2398
  g.target && n.contains(g.target) && this.bringToFront();
@@ -2463,34 +2478,34 @@ class de {
2463
2478
  return this.$backdrop;
2464
2479
  }
2465
2480
  get$modal() {
2466
- return K(this.$modal, "modal");
2481
+ return H(this.$modal, "modal");
2467
2482
  }
2468
2483
  get$window() {
2469
- return K(this.$window, "window");
2484
+ return H(this.$window, "window");
2470
2485
  }
2471
2486
  get$header() {
2472
- return K(this.$header, "header");
2487
+ return H(this.$header, "header");
2473
2488
  }
2474
2489
  get$title() {
2475
- return K(this.$title, "title");
2490
+ return H(this.$title, "title");
2476
2491
  }
2477
2492
  get$content() {
2478
- return K(this.$content, "content");
2493
+ return H(this.$content, "content");
2479
2494
  }
2480
2495
  get$icons() {
2481
- return K(this.$icons, "icons");
2496
+ return H(this.$icons, "icons");
2482
2497
  }
2483
2498
  get$buttons(e) {
2484
- return e === "leftButtons" ? K(this.$buttonsLeft, "leftButtons") : e === "rightButtons" ? K(this.$buttonsRight, "rightButtons") : K(this.$footer, "buttons");
2499
+ return e === "leftButtons" ? H(this.$buttonsLeft, "leftButtons") : e === "rightButtons" ? H(this.$buttonsRight, "rightButtons") : H(this.$footer, "buttons");
2485
2500
  }
2486
2501
  // ------------------------------ content ------------------------------- //
2487
2502
  setTitle(e) {
2488
2503
  const t = this.get$title();
2489
- return t.innerHTML = "", t.append(Z(e)), this;
2504
+ return t.innerHTML = "", t.append(ee(e)), this;
2490
2505
  }
2491
2506
  setContent(e, t = "replace") {
2492
2507
  const r = this.get$content();
2493
- return t === "replace" ? (r.innerHTML = "", r.append(Z(e))) : t === "append" ? r.append(Z(e)) : r.prepend(Z(e)), this;
2508
+ return t === "replace" ? (r.innerHTML = "", r.append(ee(e))) : t === "append" ? r.append(ee(e)) : r.prepend(ee(e)), this;
2494
2509
  }
2495
2510
  setIcons(e) {
2496
2511
  const t = this.get$icons();
@@ -2522,7 +2537,7 @@ class de {
2522
2537
  generateButton(e) {
2523
2538
  const t = e.type ?? "button", r = t === "link" ? D("a") : D("button", { attrs: { type: "button" } });
2524
2539
  e.id && (r.id = e.id), r.className = `ipe-modal-btn ${e.className ?? ""}`.trim();
2525
- const n = Z(e.label ?? "OK");
2540
+ const n = ee(e.label ?? "OK");
2526
2541
  if (r.append(n), t === "link" && e.href && (r.href = e.href), e.method && r.addEventListener("click", (s) => {
2527
2542
  if (r._ipe_tmpDisabled) {
2528
2543
  s.preventDefault(), s.stopPropagation();
@@ -2541,7 +2556,7 @@ class de {
2541
2556
  if (e.keyPress) {
2542
2557
  const s = String(e.keyPress).split(/[\,\|]+/g).map((o) => o.trim()).filter(Boolean);
2543
2558
  for (const o of s) {
2544
- const a = Fr(o);
2559
+ const a = Hr(o);
2545
2560
  a && this.keyMap.set(a, r);
2546
2561
  }
2547
2562
  }
@@ -2610,7 +2625,7 @@ class de {
2610
2625
  return (!s.dispatchEvent(o) || o.defaultPrevented) && (n = !1), n;
2611
2626
  }
2612
2627
  focusFirst() {
2613
- const e = this.get$modal(), t = gt(e);
2628
+ const e = this.get$modal(), t = mt(e);
2614
2629
  t.length ? t[0].focus() : e.focus({ preventScroll: !0 });
2615
2630
  }
2616
2631
  onKeyDown(e) {
@@ -2622,7 +2637,7 @@ class de {
2622
2637
  const t = this.get$modal();
2623
2638
  if (!t.contains(document.activeElement)) return;
2624
2639
  if (e.key === "Tab") {
2625
- const a = gt(t);
2640
+ const a = mt(t);
2626
2641
  if (!a.length) return;
2627
2642
  const f = a[0], u = a[a.length - 1], p = document.activeElement;
2628
2643
  e.shiftKey && p === f ? (e.preventDefault(), u.focus()) : !e.shiftKey && p === u && (e.preventDefault(), f.focus());
@@ -2630,7 +2645,7 @@ class de {
2630
2645
  const r = e.ctrlKey || e.altKey || e.metaKey, n = e.target;
2631
2646
  if (!r && (n && ["INPUT", "TEXTAREA"].includes(n.tagName) || n.contentEditable === "true"))
2632
2647
  return;
2633
- const s = zr(e), o = this.keyMap.get(s);
2648
+ const s = Kr(e), o = this.keyMap.get(s);
2634
2649
  if (o) {
2635
2650
  e.preventDefault(), o.click();
2636
2651
  return;
@@ -2668,7 +2683,7 @@ class de {
2668
2683
  /** Show as toast (no backdrop, container stack). */
2669
2684
  showToast(e) {
2670
2685
  this.$window || this.init();
2671
- const t = qr(e.position ?? "top right"), r = this.get$window();
2686
+ const t = Wr(e.position ?? "top right"), r = this.get$window();
2672
2687
  this.isToast = !0, r.style.pointerEvents = "auto", this.applyAnimation(!0), t.appendChild(r);
2673
2688
  const n = (typeof this.options.closeAfter == "number" ? this.options.closeAfter : this.options.closeAfter?.time) ?? 3e3, s = (typeof this.options.closeAfter == "number" ? !0 : this.options.closeAfter?.resetOnHover) ?? !0;
2674
2689
  return n > 0 && (this.startCloseTimer(n), s && (r.addEventListener("mouseenter", this.stopCloseTimer), r.addEventListener("mouseleave", () => this.startCloseTimer(n)))), this.isOpen = !0, this.options.onShow?.(this), V.push(this), this.emit(
@@ -2702,7 +2717,7 @@ class de {
2702
2717
  return T.closeAll(e, t), [...V].forEach((s) => {
2703
2718
  const o = s.modalId, a = n.size ? n.has(s.pluginName) : !0, f = r.has(o);
2704
2719
  a && !f && s.close();
2705
- }), T.top() ?? new de();
2720
+ }), T.top() ?? new pe();
2706
2721
  }
2707
2722
  static removeAll() {
2708
2723
  T.removeAll(), [...V].forEach((e) => e.destroy());
@@ -2865,7 +2880,7 @@ class de {
2865
2880
  t.title = a[0].toUpperCase() + a.slice(1).toLowerCase();
2866
2881
  }
2867
2882
  const n = t.icon ?? this.getDefaultNotifyIcon(e);
2868
- n && (n instanceof Element && n.classList.add("ipe-modal-notify-icon"), t.title = /* @__PURE__ */ P(jr, { children: [
2883
+ n && (n instanceof Element && n.classList.add("ipe-modal-notify-icon"), t.title = /* @__PURE__ */ P(Tr, { children: [
2869
2884
  n,
2870
2885
  t.title
2871
2886
  ] })), e === "confirm" && (typeof t.closeAfter > "u" && (t.closeAfter = 0), t.okBtn || (t.okBtn = { label: "OK" })), t.okBtn && (typeof t.okBtn != "object" && (t.okBtn = { label: "OK" }), t.okBtn.label ??= "OK", t.okBtn.className ??= "is-primary is-text ok-btn", t.okBtn.method = (a, f) => {
@@ -2892,7 +2907,7 @@ class de {
2892
2907
  }
2893
2908
  }
2894
2909
  const V = [];
2895
- function qr(i = "top right") {
2910
+ function Wr(i = "top right") {
2896
2911
  const e = "ipe-modal-toast-container", t = `${e}-${i.replace(/[\s-\.|\/]+/g, "-")}`;
2897
2912
  let r = document.getElementById(t);
2898
2913
  return r || (r = D("div", {
@@ -2900,7 +2915,7 @@ function qr(i = "top right") {
2900
2915
  attrs: { id: t, "data-position": i }
2901
2916
  }), document.body.appendChild(r)), r;
2902
2917
  }
2903
- class R extends de {
2918
+ class R extends pe {
2904
2919
  constructor(e = {}) {
2905
2920
  e.className ||= "", e.className += " theme-ipe", e.modalAnimation ||= {
2906
2921
  show: "ipe-modal-fade-in",
@@ -2915,7 +2930,7 @@ class R extends de {
2915
2930
  this._tmpDisabledActiveInputs = t, t.forEach((r) => {
2916
2931
  r.disabled = !0;
2917
2932
  }), this.get$content().append(
2918
- /* @__PURE__ */ M(
2933
+ /* @__PURE__ */ N(
2919
2934
  "div",
2920
2935
  {
2921
2936
  id: "ipe-modalLoadingWrapper",
@@ -2931,7 +2946,7 @@ class R extends de {
2931
2946
  backgroundColor: "rgba(255, 255, 255, 0.5)",
2932
2947
  zIndex: 2e3
2933
2948
  },
2934
- children: /* @__PURE__ */ M(Ei, { style: { width: "80%", maxWidth: "800px" } })
2949
+ children: /* @__PURE__ */ N(Ci, { style: { width: "80%", maxWidth: "800px" } })
2935
2950
  }
2936
2951
  )
2937
2952
  );
@@ -2944,14 +2959,14 @@ class R extends de {
2944
2959
  }
2945
2960
  }
2946
2961
  }
2947
- class Hr {
2962
+ class Gr {
2948
2963
  constructor(e) {
2949
- this.ctx = e, this.IPEModal = R, this.IPEModalEvent = Ge, this.show = R.show.bind(R), this.createObject = R.createObject.bind(R), this.close = R.close.bind(R), this.closeAll = R.closeAll.bind(R), this.removeAll = R.removeAll.bind(R), this.dialog = R.dialog.bind(R), this.confirm = R.confirm.bind(R), this.notify = R.notify.bind(R), e.set("modal", this), e.on("dispose", () => {
2964
+ this.ctx = e, this.IPEModal = R, this.IPEModalEvent = Ve, this.show = R.show.bind(R), this.createObject = R.createObject.bind(R), this.close = R.close.bind(R), this.closeAll = R.closeAll.bind(R), this.removeAll = R.removeAll.bind(R), this.dialog = R.dialog.bind(R), this.confirm = R.confirm.bind(R), this.notify = R.notify.bind(R), e.set("modal", this), e.on("dispose", () => {
2950
2965
  R.closeAll();
2951
2966
  });
2952
2967
  }
2953
2968
  }
2954
- const Ut = (i) => {
2969
+ const Ft = (i) => {
2955
2970
  if (!i)
2956
2971
  return new URLSearchParams();
2957
2972
  if (i instanceof URLSearchParams)
@@ -2974,26 +2989,26 @@ const Ut = (i) => {
2974
2989
  e.set(t, r?.toString());
2975
2990
  }
2976
2991
  return e;
2977
- }, Ft = (i, e, t) => {
2978
- const r = typeof i == "string" ? new URL(i, window?.location?.origin) : new URL(i), n = new URLSearchParams(r.search), s = Ut(e);
2992
+ }, zt = (i, e, t) => {
2993
+ const r = typeof i == "string" ? new URL(i, window?.location?.origin) : new URL(i), n = new URLSearchParams(r.search), s = Ft(e);
2979
2994
  for (const [o, a] of s.entries())
2980
2995
  n.set(o, a);
2981
2996
  return r.search = n.toString(), r.hash = "", r;
2982
2997
  };
2983
- var Wr = Object.create, Ve = Object.defineProperty, Gr = Object.getOwnPropertyDescriptor, zt = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), Kt = (i) => {
2998
+ var Vr = Object.create, Ye = Object.defineProperty, Yr = Object.getOwnPropertyDescriptor, Ht = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), Kt = (i) => {
2984
2999
  throw TypeError(i);
2985
- }, Vr = (i, e, t) => e in i ? Ve(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, Jr = (i, e) => Ve(i, "name", { value: e, configurable: !0 }), Yr = (i) => [, , , Wr(i?.[zt("metadata")] ?? null)], Xr = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], qt = (i) => i !== void 0 && typeof i != "function" ? Kt("Function expected") : i, Qr = (i, e, t, r, n) => ({ kind: Xr[i], name: e, metadata: r, addInitializer: (s) => t._ ? Kt("Already initialized") : n.push(qt(s || null)) }), Zr = (i, e) => Vr(e, zt("metadata"), i[3]), en = (i, e, t, r) => {
3000
+ }, Jr = (i, e, t) => e in i ? Ye(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, Xr = (i, e) => Ye(i, "name", { value: e, configurable: !0 }), Qr = (i) => [, , , Vr(i?.[Ht("metadata")] ?? null)], Zr = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], qt = (i) => i !== void 0 && typeof i != "function" ? Kt("Function expected") : i, en = (i, e, t, r, n) => ({ kind: Zr[i], name: e, metadata: r, addInitializer: (s) => t._ ? Kt("Already initialized") : n.push(qt(s || null)) }), tn = (i, e) => Jr(e, Ht("metadata"), i[3]), rn = (i, e, t, r) => {
2986
3001
  for (var n = 0, s = i[e >> 1], o = s && s.length; n < o; n++) s[n].call(t);
2987
3002
  return r;
2988
- }, tn = (i, e, t, r, n, s) => {
2989
- var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && Gr(n, t));
2990
- Jr(n, t);
3003
+ }, nn = (i, e, t, r, n, s) => {
3004
+ var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && Yr(n, t));
3005
+ Xr(n, t);
2991
3006
  for (var w = r.length - 1; w >= 0; w--)
2992
- f = Qr(u, t, a = {}, i[3], _), o = (0, r[w])(n, f), a._ = 1, qt(o) && (n = o);
2993
- return Zr(i, n), g && Ve(n, t, g), p ? u ^ 4 ? s : g : n;
2994
- }, Ht, Je, Wt;
2995
- Ht = [F(["api", "storage"])];
2996
- class pe extends (Wt = z) {
3007
+ f = en(u, t, a = {}, i[3], _), o = (0, r[w])(n, f), a._ = 1, qt(o) && (n = o);
3008
+ return tn(i, n), g && Ye(n, t, g), p ? u ^ 4 ? s : g : n;
3009
+ }, Wt, Je, Gt;
3010
+ Wt = [F(["api", "storage"])];
3011
+ class ge extends (Gt = z) {
2997
3012
  constructor(e) {
2998
3013
  super(e, "wiki", !1), this.ctx = e, this._data = {}, this.CACHE_VERSION = 4, this.CACHE_TTL = {
2999
3014
  siteinfo: 1e3 * 60 * 60 * 24 * 3,
@@ -3034,11 +3049,11 @@ class pe extends (Wt = z) {
3034
3049
  "WikiMetadataService",
3035
3050
  $.object({
3036
3051
  WikiMetadataService: $.const(
3037
- /* @__PURE__ */ M("div", { children: [
3038
- /* @__PURE__ */ M("h3", { children: t`Wiki Informations` }),
3039
- /* @__PURE__ */ M("ul", { children: [
3040
- /* @__PURE__ */ M("li", { children: [
3041
- /* @__PURE__ */ M("strong", { children: [
3052
+ /* @__PURE__ */ N("div", { children: [
3053
+ /* @__PURE__ */ N("h3", { children: t`Wiki Informations` }),
3054
+ /* @__PURE__ */ N("ul", { children: [
3055
+ /* @__PURE__ */ N("li", { children: [
3056
+ /* @__PURE__ */ N("strong", { children: [
3042
3057
  t`Site`,
3043
3058
  ":"
3044
3059
  ] }),
@@ -3048,23 +3063,23 @@ class pe extends (Wt = z) {
3048
3063
  this.landingPageUrl,
3049
3064
  ")"
3050
3065
  ] }),
3051
- /* @__PURE__ */ M("li", { children: [
3052
- /* @__PURE__ */ M("strong", { children: t`User` }),
3066
+ /* @__PURE__ */ N("li", { children: [
3067
+ /* @__PURE__ */ N("strong", { children: t`User` }),
3053
3068
  ": ",
3054
3069
  this.userInfo.name,
3055
3070
  " (ID: ",
3056
3071
  this.userInfo.id,
3057
3072
  ")"
3058
3073
  ] }),
3059
- /* @__PURE__ */ M("li", { children: [
3060
- /* @__PURE__ */ M("strong", { children: t`Groups` }),
3074
+ /* @__PURE__ */ N("li", { children: [
3075
+ /* @__PURE__ */ N("strong", { children: t`Groups` }),
3061
3076
  ": ",
3062
3077
  this.userGroups.join(", ") || "None"
3063
3078
  ] })
3064
3079
  ] }),
3065
- /* @__PURE__ */ M("div", { children: [
3066
- /* @__PURE__ */ M("p", { style: { fontStyle: "italic" }, children: t`If the information shown above is incorrect (for example, the user is not you), click the button below.` }),
3067
- /* @__PURE__ */ M(
3080
+ /* @__PURE__ */ N("div", { children: [
3081
+ /* @__PURE__ */ N("p", { style: { fontStyle: "italic" }, children: t`If the information shown above is incorrect (for example, the user is not you), click the button below.` }),
3082
+ /* @__PURE__ */ N(
3068
3083
  "button",
3069
3084
  {
3070
3085
  className: "btn danger",
@@ -3238,10 +3253,10 @@ class pe extends (Wt = z) {
3238
3253
  }
3239
3254
  /** Get mainpage URL */
3240
3255
  getMainpageUrl(e) {
3241
- return Ft(this.siteInfo.general.base, e).toString();
3256
+ return zt(this.siteInfo.general.base, e).toString();
3242
3257
  }
3243
3258
  getUrl(e, t) {
3244
- const r = Ut(t);
3259
+ const r = Ft(t);
3245
3260
  let n;
3246
3261
  return typeof e == "string" && e !== "" ? n = new URL(`${this.articleBaseUrl.replace("$1", e)}`) : typeof e == "number" ? (r.set("curid", e.toString()), n = new URL(this.getSciprtUrl("index"))) : n = new URL(this.getSciprtUrl("index")), n.search = r.toString(), n.toString();
3247
3262
  }
@@ -3271,16 +3286,16 @@ class pe extends (Wt = z) {
3271
3286
  } : null;
3272
3287
  }
3273
3288
  }
3274
- Je = Yr(Wt);
3275
- pe = tn(Je, 0, "WikiMetadataService", Ht, pe);
3276
- en(Je, 1, pe);
3277
- const rn = (() => {
3289
+ Je = Qr(Gt);
3290
+ ge = nn(Je, 0, "WikiMetadataService", Wt, ge);
3291
+ rn(Je, 1, ge);
3292
+ const sn = (() => {
3278
3293
  const i = /* @__PURE__ */ Symbol.for("IPE.GlobalMemoryStorage");
3279
- return i in globalThis || (globalThis[i] = xi()), globalThis[i];
3294
+ return i in globalThis || (globalThis[i] = ki()), globalThis[i];
3280
3295
  })();
3281
- class nn {
3296
+ class on {
3282
3297
  constructor(e, t, r = 1 / 0, n, s = "localStorage") {
3283
- this.dbName = e, this.storeName = t, this.ttl = r, this.version = n, this.engine = s, typeof r != "number" && (this.ttl = Number(r)), (isNaN(this.ttl) || this.ttl <= 0) && (this.ttl = 1 / 0), this.engine === "localStorage" && "localStorage" in window ? this.db = window.localStorage : this.engine === "sessionStorage" && "sessionStorage" in window ? this.db = window.sessionStorage : this.db = rn;
3298
+ this.dbName = e, this.storeName = t, this.ttl = r, this.version = n, this.engine = s, typeof r != "number" && (this.ttl = Number(r)), (isNaN(this.ttl) || this.ttl <= 0) && (this.ttl = 1 / 0), this.engine === "localStorage" && "localStorage" in window ? this.db = window.localStorage : this.engine === "sessionStorage" && "sessionStorage" in window ? this.db = window.sessionStorage : this.db = sn;
3284
3299
  }
3285
3300
  // Key builder
3286
3301
  makeKey(e) {
@@ -3506,7 +3521,7 @@ var L;
3506
3521
  }
3507
3522
  i.waitTx = f;
3508
3523
  })(L || (L = {}));
3509
- class sn {
3524
+ class an {
3510
3525
  constructor(e, t, r = {}) {
3511
3526
  this.dbName = e, this.storeName = t, this.options = r;
3512
3527
  }
@@ -3634,9 +3649,9 @@ class sn {
3634
3649
  await L.closeConnection(this.dbName);
3635
3650
  }
3636
3651
  }
3637
- class on {
3652
+ class cn {
3638
3653
  constructor(e, t, r = 1 / 0, n) {
3639
- this.dbName = e, this.storeName = t, this.ttl = r, this.version = n, this.db = new sn(e, t), this.keys = this.db.keys.bind(this.db), this.values = this.db.values.bind(this.db), this.entries = this.db.entries.bind(this.db), typeof this.ttl != "number" && (this.ttl = Number(this.ttl)), (isNaN(this.ttl) || this.ttl <= 0) && (this.ttl = 1 / 0), this._clearExpiredEntries().catch(() => {
3654
+ this.dbName = e, this.storeName = t, this.ttl = r, this.version = n, this.db = new an(e, t), this.keys = this.db.keys.bind(this.db), this.values = this.db.values.bind(this.db), this.entries = this.db.entries.bind(this.db), typeof this.ttl != "number" && (this.ttl = Number(this.ttl)), (isNaN(this.ttl) || this.ttl <= 0) && (this.ttl = 1 / 0), this._clearExpiredEntries().catch(() => {
3640
3655
  });
3641
3656
  }
3642
3657
  async _clearExpiredEntries() {
@@ -3722,7 +3737,7 @@ class on {
3722
3737
  return await this.db.clear(), this;
3723
3738
  }
3724
3739
  }
3725
- class an extends z {
3740
+ class ln extends z {
3726
3741
  constructor(e, t) {
3727
3742
  super(e, "storage", !1), this.config = t, this.kv = this.createDatabase("key-val", 0, 1, "indexedDB"), this.simpleKV = this.createDatabase("~", 0, 1, "localStorage"), this.memoryKV = this.createDatabase("~", 0, 1, "memory");
3728
3743
  }
@@ -3730,34 +3745,34 @@ class an extends z {
3730
3745
  const s = "indexedDB" in window && window.indexedDB !== null;
3731
3746
  switch (n === "indexedDB" && !s && (n = "localStorage"), n) {
3732
3747
  case "indexedDB":
3733
- return new on(this.config.dbName, e, t, r);
3748
+ return new cn(this.config.dbName, e, t, r);
3734
3749
  case "localStorage":
3735
3750
  case "sessionStorage":
3736
3751
  case "memory":
3737
- return new nn(this.config.dbName, e, t, r, n);
3752
+ return new on(this.config.dbName, e, t, r, n);
3738
3753
  default:
3739
3754
  throw new Error(`Unsupported storage engine: ${n}`);
3740
3755
  }
3741
3756
  }
3742
3757
  }
3743
- function Gt(i) {
3758
+ function Vt(i) {
3744
3759
  return function(e) {
3745
3760
  return e.PreferencesSchema = i, e;
3746
3761
  };
3747
3762
  }
3748
- var cn = Object.create, Ye = Object.defineProperty, ln = Object.getOwnPropertyDescriptor, Vt = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), Jt = (i) => {
3763
+ var hn = Object.create, Xe = Object.defineProperty, un = Object.getOwnPropertyDescriptor, Yt = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), Jt = (i) => {
3749
3764
  throw TypeError(i);
3750
- }, hn = (i, e, t) => e in i ? Ye(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, un = (i, e) => Ye(i, "name", { value: e, configurable: !0 }), fn = (i) => [, , , cn(i?.[Vt("metadata")] ?? null)], dn = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Yt = (i) => i !== void 0 && typeof i != "function" ? Jt("Function expected") : i, pn = (i, e, t, r, n) => ({ kind: dn[i], name: e, metadata: r, addInitializer: (s) => t._ ? Jt("Already initialized") : n.push(Yt(s || null)) }), gn = (i, e) => hn(e, Vt("metadata"), i[3]), mn = (i, e, t, r) => {
3765
+ }, fn = (i, e, t) => e in i ? Xe(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, dn = (i, e) => Xe(i, "name", { value: e, configurable: !0 }), pn = (i) => [, , , hn(i?.[Yt("metadata")] ?? null)], gn = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Xt = (i) => i !== void 0 && typeof i != "function" ? Jt("Function expected") : i, mn = (i, e, t, r, n) => ({ kind: gn[i], name: e, metadata: r, addInitializer: (s) => t._ ? Jt("Already initialized") : n.push(Xt(s || null)) }), yn = (i, e) => fn(e, Yt("metadata"), i[3]), wn = (i, e, t, r) => {
3751
3766
  for (var n = 0, s = i[e >> 1], o = s && s.length; n < o; n++) s[n].call(t);
3752
3767
  return r;
3753
- }, yn = (i, e, t, r, n, s) => {
3754
- var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && ln(n, t));
3755
- un(n, t);
3768
+ }, bn = (i, e, t, r, n, s) => {
3769
+ var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && un(n, t));
3770
+ dn(n, t);
3756
3771
  for (var w = r.length - 1; w >= 0; w--)
3757
- f = pn(u, t, a = {}, i[3], _), o = (0, r[w])(n, f), a._ = 1, Yt(o) && (n = o);
3758
- return gn(i, n), g && Ye(n, t, g), p ? u ^ 4 ? s : g : n;
3759
- }, Xt, Xe, Qt;
3760
- Xt = [F(["preferences"]), Gt(
3772
+ f = mn(u, t, a = {}, i[3], _), o = (0, r[w])(n, f), a._ = 1, Xt(o) && (n = o);
3773
+ return yn(i, n), g && Xe(n, t, g), p ? u ^ 4 ? s : g : n;
3774
+ }, Qt, Qe, Zt;
3775
+ Qt = [F(["preferences"]), Vt(
3761
3776
  $.object({
3762
3777
  theme: $.union([
3763
3778
  $.const("auto").description("Follow system"),
@@ -3767,7 +3782,7 @@ Xt = [F(["preferences"]), Gt(
3767
3782
  ]).default("auto").description("Theme preference")
3768
3783
  }).description("Theme settings").extra("category", "general")
3769
3784
  )];
3770
- class ge extends (Qt = z) {
3785
+ class me extends (Zt = z) {
3771
3786
  constructor(e) {
3772
3787
  super(e, "theme", !1), this.ctx = e, this._mediaQueryList = null, this._observer = null, this._handleSystemThemeChange = this._onSystemThemeChange.bind(this), this._handleBodyClassChange = this._onBodyClassChange.bind(this);
3773
3788
  }
@@ -3815,12 +3830,12 @@ class ge extends (Qt = z) {
3815
3830
  return document.body.classList.contains("ipe-theme-dark") ? "dark" : "light";
3816
3831
  }
3817
3832
  }
3818
- Xe = fn(Qt);
3819
- ge = yn(Xe, 0, "ThemeService", Xt, ge);
3820
- mn(Xe, 1, ge);
3821
- class wn extends z {
3833
+ Qe = pn(Zt);
3834
+ me = bn(Qe, 0, "ThemeService", Qt, me);
3835
+ wn(Qe, 1, me);
3836
+ class vn extends z {
3822
3837
  constructor(e) {
3823
- super(e, "wikiPage", !0), this.ctx = e, this.WikiPage = ki(this.ctx.api);
3838
+ super(e, "wikiPage", !0), this.ctx = e, this.WikiPage = Si(this.ctx.api);
3824
3839
  }
3825
3840
  static {
3826
3841
  this.inject = ["api"];
@@ -3841,9 +3856,9 @@ class wn extends z {
3841
3856
  return this.WikiPage.newBlankPage(e);
3842
3857
  }
3843
3858
  }
3844
- class Qe extends z {
3859
+ class Ze extends z {
3845
3860
  constructor(e) {
3846
- super(e, "wikiTitle", !0), this.ctx = e, this.logger = this.ctx.logger("WikiTitleService"), this._cachedTitles = /* @__PURE__ */ new Map(), this.wiki = this.ctx.wiki, this.wikiBaseUrl = this.wiki.baseUrl, this.wikiArticlePath = this.wiki.articlePath.replace("$1", ""), this.wikiArticleBaseUrl = this.wiki.articleBaseUrl.replace("$1", ""), this.wikiIndexPhpUrl = this.wiki.getSciprtUrl("index.php"), this.Title = Si(this.ctx.wiki.siteInfo);
3861
+ super(e, "wikiTitle", !0), this.ctx = e, this.logger = this.ctx.logger("WikiTitleService"), this._cachedTitles = /* @__PURE__ */ new Map(), this.wiki = this.ctx.wiki, this.wikiBaseUrl = this.wiki.baseUrl, this.wikiArticlePath = this.wiki.articlePath.replace("$1", ""), this.wikiArticleBaseUrl = this.wiki.articleBaseUrl.replace("$1", ""), this.wikiIndexPhpUrl = this.wiki.getSciprtUrl("index.php"), this.Title = $i(this.ctx.wiki.siteInfo);
3847
3862
  }
3848
3863
  static {
3849
3864
  this.inject = ["wiki", "wikiPage"];
@@ -3867,7 +3882,7 @@ class Qe extends z {
3867
3882
  throw new Error("Invalid id or kind", { cause: e });
3868
3883
  if (!t && this._cachedTitles.has(`${a}:${o}`))
3869
3884
  return await this._cachedTitles.get(`${a}:${o}`);
3870
- const { promise: f, resolve: u, reject: p } = wt();
3885
+ const { promise: f, resolve: u, reject: p } = bt();
3871
3886
  this._cachedTitles.set(`${a}:${o}`, f);
3872
3887
  try {
3873
3888
  const { wikiPage: y } = this.ctx;
@@ -3937,12 +3952,12 @@ class Qe extends z {
3937
3952
  this.REG_SKIPPED_HREF = /^(#|javascript:|vbscript:|file:)/i;
3938
3953
  }
3939
3954
  validateHrefAttr(e) {
3940
- return typeof e != "string" ? !1 : !Qe.REG_SKIPPED_HREF.test(e);
3955
+ return typeof e != "string" ? !1 : !Ze.REG_SKIPPED_HREF.test(e);
3941
3956
  }
3942
3957
  parseWikiLink(e) {
3943
3958
  if (!e || typeof e == "string" && !this.validateHrefAttr(e))
3944
3959
  return null;
3945
- const t = Ft(e);
3960
+ const t = zt(e);
3946
3961
  if (!this.isWikiLink(t.toString()))
3947
3962
  return null;
3948
3963
  const r = t.searchParams, n = t.hash.replace("#", ""), s = r.get("action") || "view", o = r.get("title") || "", a = parseInt(r.get("curid") || "0", 10), f = parseInt(r.get("oldid") || "0", 10);
@@ -3976,27 +3991,27 @@ class Qe extends z {
3976
3991
  };
3977
3992
  }
3978
3993
  }
3979
- const Zt = (i) => typeof i == "function";
3980
- async function bn(i) {
3981
- return Zt(i) ? await i() : i;
3994
+ const ei = (i) => typeof i == "function";
3995
+ async function _n(i) {
3996
+ return ei(i) ? await i() : i;
3982
3997
  }
3983
- function gs(i) {
3984
- return Zt(i) ? i() : i;
3998
+ function ys(i) {
3999
+ return ei(i) ? i() : i;
3985
4000
  }
3986
- var vn = Object.create, Ze = Object.defineProperty, _n = Object.getOwnPropertyDescriptor, ei = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), ti = (i) => {
4001
+ var xn = Object.create, et = Object.defineProperty, kn = Object.getOwnPropertyDescriptor, ti = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), ii = (i) => {
3987
4002
  throw TypeError(i);
3988
- }, xn = (i, e, t) => e in i ? Ze(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, kn = (i, e) => Ze(i, "name", { value: e, configurable: !0 }), Sn = (i) => [, , , vn(i?.[ei("metadata")] ?? null)], $n = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], ii = (i) => i !== void 0 && typeof i != "function" ? ti("Function expected") : i, En = (i, e, t, r, n) => ({ kind: $n[i], name: e, metadata: r, addInitializer: (s) => t._ ? ti("Already initialized") : n.push(ii(s || null)) }), Cn = (i, e) => xn(e, ei("metadata"), i[3]), An = (i, e, t, r) => {
4003
+ }, Sn = (i, e, t) => e in i ? et(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, $n = (i, e) => et(i, "name", { value: e, configurable: !0 }), En = (i) => [, , , xn(i?.[ti("metadata")] ?? null)], Cn = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], ri = (i) => i !== void 0 && typeof i != "function" ? ii("Function expected") : i, An = (i, e, t, r, n) => ({ kind: Cn[i], name: e, metadata: r, addInitializer: (s) => t._ ? ii("Already initialized") : n.push(ri(s || null)) }), On = (i, e) => Sn(e, ti("metadata"), i[3]), Pn = (i, e, t, r) => {
3989
4004
  for (var n = 0, s = i[e >> 1], o = s && s.length; n < o; n++) s[n].call(t);
3990
4005
  return r;
3991
- }, On = (i, e, t, r, n, s) => {
3992
- var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && _n(n, t));
3993
- kn(n, t);
4006
+ }, In = (i, e, t, r, n, s) => {
4007
+ var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && kn(n, t));
4008
+ $n(n, t);
3994
4009
  for (var w = r.length - 1; w >= 0; w--)
3995
- f = En(u, t, a = {}, i[3], _), o = (0, r[w])(n, f), a._ = 1, ii(o) && (n = o);
3996
- return Cn(i, n), g && Ze(n, t, g), p ? u ^ 4 ? s : g : n;
3997
- }, ri, et, ni;
3998
- ri = [F(["storage", "wiki"])];
3999
- class me extends (ni = z) {
4010
+ f = An(u, t, a = {}, i[3], _), o = (0, r[w])(n, f), a._ = 1, ri(o) && (n = o);
4011
+ return On(i, n), g && et(n, t, g), p ? u ^ 4 ? s : g : n;
4012
+ }, ni, tt, si;
4013
+ ni = [F(["storage", "wiki"])];
4014
+ class ye extends (si = z) {
4000
4015
  constructor(e) {
4001
4016
  super(e, "preferences", !0), this.ctx = e, this.db = void 0, this.customRegistries = [], this.categoryDefinitions = [], this._defaultPreferences = {}, e.set("prefs", this), this.db = e.storage.createDatabase(`preferences:${e.wiki.userInfo.id}`, 1 / 0);
4002
4017
  try {
@@ -4017,7 +4032,7 @@ class me extends (ni = z) {
4017
4032
  return this.logger.debug(e, `(fallback value: ${n})`), n;
4018
4033
  };
4019
4034
  const r = await this.db.get(e, void 0);
4020
- return r !== null ? r : await bn(t);
4035
+ return r !== null ? r : await _n(t);
4021
4036
  }
4022
4037
  /**
4023
4038
  * 获取全部注册的配置项以及最终生效的值
@@ -4080,7 +4095,7 @@ class me extends (ni = z) {
4080
4095
  getConfigRegistries(e) {
4081
4096
  return Array.from(this.ctx.registry.entries()).map(([t]) => t === null ? {
4082
4097
  name: "@root",
4083
- schema: be?.PreferencesSchema || null
4098
+ schema: ve?.PreferencesSchema || null
4084
4099
  } : {
4085
4100
  name: t.name,
4086
4101
  schema: t?.PreferencesSchema || null
@@ -4109,19 +4124,19 @@ class me extends (ni = z) {
4109
4124
  return t && this.logger.info(`Migrated ${t} preferences from master DB`), await e.clear(), await e?.db?.disconnect?.(), t;
4110
4125
  }
4111
4126
  }
4112
- et = Sn(ni);
4113
- me = On(et, 0, "PreferencesService", ri, me);
4114
- An(et, 1, me);
4115
- var tt = /* @__PURE__ */ ((i) => (i.ANALYTICS_API_BASE = "https://analytics.ipe.wiki/api/v6", i.ANALYTICS_DASH_URL = "https://analytics.ipe.wiki", i.GITHUB_URL = "https://github.com/inpageedit/inpageedit-next", i.GITHUB_OWNER = "inpageedit", i.GITHUB_REPO = "inpageedit-next", i.HOME_URL = "https://www.ipe.wiki/", i.UPDATE_LOGS_URL = "https://www.ipe.wiki/changelogs/", i.PLUGIN_REGISTRY_URL = "https://registry.ipe.wiki/registry.v1.json", i.I18N_INDEX_URL = "https://registry.ipe.wiki/i18n/index.json", i.QQ_GROUP_ID = "1026023666", i))(tt || {});
4116
- const si = "", oi = "", Pn = /\\\{/g, In = /\\\}/g, Ln = new RegExp(si, "g"), Rn = new RegExp(oi, "g");
4117
- function mt(i) {
4127
+ tt = En(si);
4128
+ ye = In(tt, 0, "PreferencesService", ni, ye);
4129
+ Pn(tt, 1, ye);
4130
+ var it = /* @__PURE__ */ ((i) => (i.ANALYTICS_API_BASE = "https://analytics.ipe.wiki/api/v6", i.ANALYTICS_DASH_URL = "https://analytics.ipe.wiki", i.GITHUB_URL = "https://github.com/inpageedit/inpageedit-next", i.GITHUB_OWNER = "inpageedit", i.GITHUB_REPO = "inpageedit-next", i.HOME_URL = "https://www.ipe.wiki/", i.UPDATE_LOGS_URL = "https://www.ipe.wiki/changelogs/", i.PLUGIN_REGISTRY_URL = "https://registry.ipe.wiki/registry.v1.json", i.I18N_INDEX_URL = "https://registry.ipe.wiki/i18n/index.json", i.QQ_GROUP_ID = "1026023666", i))(it || {});
4131
+ const oi = "", ai = "", Ln = /\\\{/g, Rn = /\\\}/g, jn = new RegExp(oi, "g"), Dn = new RegExp(ai, "g");
4132
+ function yt(i) {
4118
4133
  const e = i ? { ...i } : void 0;
4119
- return (r, ...n) => jn(e, r, ...n);
4134
+ return (r, ...n) => Tn(e, r, ...n);
4120
4135
  }
4121
- function jn(i, e, ...t) {
4136
+ function Tn(i, e, ...t) {
4122
4137
  if (!e) return "";
4123
- let r = String(e).replace(Pn, si).replace(In, oi), n = {}, s = [];
4124
- t.length === 1 && Array.isArray(t[0]) ? s = t[0] : t.length === 1 && Dn(t[0]) ? n = t[0] : t.length > 0 && (s = t);
4138
+ let r = String(e).replace(Ln, oi).replace(Rn, ai), n = {}, s = [];
4139
+ t.length === 1 && Array.isArray(t[0]) ? s = t[0] : t.length === 1 && Nn(t[0]) ? n = t[0] : t.length > 0 && (s = t);
4125
4140
  const o = /* @__PURE__ */ Object.create(null);
4126
4141
  if (s && s.length)
4127
4142
  for (let a = 0; a < s.length; a++)
@@ -4135,18 +4150,18 @@ function jn(i, e, ...t) {
4135
4150
  const u = String(f).trim();
4136
4151
  if (!u) return "";
4137
4152
  try {
4138
- const p = Tn(u, o);
4153
+ const p = Mn(u, o);
4139
4154
  return p == null ? "" : String(p);
4140
4155
  } catch {
4141
4156
  return "";
4142
4157
  }
4143
- }), r.replace(Ln, "{").replace(Rn, "}");
4158
+ }), r.replace(jn, "{").replace(Dn, "}");
4144
4159
  }
4145
- function Dn(i) {
4160
+ function Nn(i) {
4146
4161
  return typeof i == "object" && i !== null && i.constructor === Object;
4147
4162
  }
4148
- const Tn = Mn();
4149
- function Mn() {
4163
+ const Mn = Bn();
4164
+ function Bn() {
4150
4165
  const i = /* @__PURE__ */ new Set([
4151
4166
  "eval",
4152
4167
  "Object",
@@ -4191,29 +4206,29 @@ function Mn() {
4191
4206
  return e(t, n);
4192
4207
  };
4193
4208
  }
4194
- function ai(i) {
4209
+ function ci(i) {
4195
4210
  return i.charAt(0).toLowerCase() + i.slice(1);
4196
4211
  }
4197
- function te(i) {
4198
- return ai(i).replace(/_/g, "-").replace(/.[A-Z]+/g, (e) => e[0] + "-" + e.slice(1).toLowerCase());
4212
+ function ie(i) {
4213
+ return ci(i).replace(/_/g, "-").replace(/.[A-Z]+/g, (e) => e[0] + "-" + e.slice(1).toLowerCase());
4199
4214
  }
4200
- function ms(i) {
4201
- return ai(i).replace(/-/g, "_").replace(/.[A-Z]+/g, (e) => e[0] + "_" + e.slice(1).toLowerCase());
4215
+ function ws(i) {
4216
+ return ci(i).replace(/-/g, "_").replace(/.[A-Z]+/g, (e) => e[0] + "_" + e.slice(1).toLowerCase());
4202
4217
  }
4203
- function H(i, e) {
4218
+ function q(i, e) {
4204
4219
  let t = i[0] ?? "";
4205
4220
  for (let r = 0; r < e.length; r++)
4206
4221
  t += String(e[r]) + (i[r + 1] ?? "");
4207
4222
  return t;
4208
4223
  }
4209
- class Nn {
4224
+ class Un {
4210
4225
  constructor(e, t) {
4211
4226
  this.languages = /* @__PURE__ */ new Map(), this.currentLanguage = "en", this.missingKeys = /* @__PURE__ */ new Map(), this.usedKeys = /* @__PURE__ */ new Set();
4212
4227
  const r = t?.language || "en";
4213
- this.currentLanguage = r, this.interpolate = mt(t?.globals), e && Object.keys(e).length && this.setLanguageData(r, e);
4228
+ this.currentLanguage = r, this.interpolate = yt(t?.globals), e && Object.keys(e).length && this.setLanguageData(r, e);
4214
4229
  }
4215
4230
  setGlobals(e) {
4216
- return this.interpolate = mt(e), this;
4231
+ return this.interpolate = yt(e), this;
4217
4232
  }
4218
4233
  set(e, t) {
4219
4234
  const r = this.currentLanguage, n = this.ensureLanguageMap(r);
@@ -4227,20 +4242,20 @@ class Nn {
4227
4242
  return this;
4228
4243
  }
4229
4244
  setLanguageData(e, t) {
4230
- e = te(e).toLowerCase();
4245
+ e = ie(e).toLowerCase();
4231
4246
  const r = this.ensureLanguageMap(e), n = this.toStringRecord(t);
4232
4247
  for (const [s, o] of Object.entries(n))
4233
4248
  r.set(s, o);
4234
4249
  return this;
4235
4250
  }
4236
4251
  setLanguage(e) {
4237
- return e = te(e).toLowerCase(), this.currentLanguage = e, this;
4252
+ return e = ie(e).toLowerCase(), this.currentLanguage = e, this;
4238
4253
  }
4239
4254
  getLanguage() {
4240
4255
  return this.currentLanguage;
4241
4256
  }
4242
4257
  hasLanguage(e) {
4243
- e = te(e).toLowerCase();
4258
+ e = ie(e).toLowerCase();
4244
4259
  const t = this.languages.get(e);
4245
4260
  return t && Object.keys(t).length > 0;
4246
4261
  }
@@ -4284,12 +4299,12 @@ class Nn {
4284
4299
  }
4285
4300
  $(...e) {
4286
4301
  if (Array.isArray(e[0]) && e[0]?.raw) {
4287
- const n = e[0], s = e.slice(1), o = H(n, s);
4302
+ const n = e[0], s = e.slice(1), o = q(n, s);
4288
4303
  return this.translate(o);
4289
4304
  }
4290
4305
  const r = e;
4291
4306
  return (n, ...s) => {
4292
- const o = H(n, s);
4307
+ const o = q(n, s);
4293
4308
  return this.translate(o, ...r);
4294
4309
  };
4295
4310
  }
@@ -4307,11 +4322,11 @@ class Nn {
4307
4322
  }
4308
4323
  $raw(...e) {
4309
4324
  if (Array.isArray(e[0]) && e[0]?.raw) {
4310
- const r = e[0], n = e.slice(1), s = H(r, n);
4325
+ const r = e[0], n = e.slice(1), s = q(r, n);
4311
4326
  return this.translateRaw(s);
4312
4327
  }
4313
4328
  return (r, ...n) => {
4314
- const s = H(r, n);
4329
+ const s = q(r, n);
4315
4330
  return this.translateRaw(s);
4316
4331
  };
4317
4332
  }
@@ -4325,12 +4340,12 @@ class Nn {
4325
4340
  }
4326
4341
  $$(...e) {
4327
4342
  if (Array.isArray(e[0]) && e[0]?.raw) {
4328
- const n = e[0], s = e.slice(1), o = H(n, s);
4343
+ const n = e[0], s = e.slice(1), o = q(n, s);
4329
4344
  return this.message(o);
4330
4345
  }
4331
4346
  const r = e;
4332
4347
  return (n, ...s) => {
4333
- const o = H(n, s);
4348
+ const o = q(n, s);
4334
4349
  return this.message(o, ...r);
4335
4350
  };
4336
4351
  }
@@ -4348,11 +4363,11 @@ class Nn {
4348
4363
  }
4349
4364
  $$raw(...e) {
4350
4365
  if (Array.isArray(e[0]) && e[0].raw) {
4351
- const r = e[0], n = e.slice(1), s = H(r, n);
4366
+ const r = e[0], n = e.slice(1), s = q(r, n);
4352
4367
  return this.messageRaw(s);
4353
4368
  }
4354
4369
  return (r, ...n) => {
4355
- const s = H(r, n);
4370
+ const s = q(r, n);
4356
4371
  return this.messageRaw(s);
4357
4372
  };
4358
4373
  }
@@ -4400,19 +4415,19 @@ class Nn {
4400
4415
  return e;
4401
4416
  }
4402
4417
  }
4403
- var Bn = Object.create, it = Object.defineProperty, Un = Object.getOwnPropertyDescriptor, ci = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), li = (i) => {
4418
+ var Fn = Object.create, rt = Object.defineProperty, zn = Object.getOwnPropertyDescriptor, li = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), hi = (i) => {
4404
4419
  throw TypeError(i);
4405
- }, Fn = (i, e, t) => e in i ? it(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, zn = (i, e) => it(i, "name", { value: e, configurable: !0 }), Kn = (i) => [, , , Bn(i?.[ci("metadata")] ?? null)], qn = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], hi = (i) => i !== void 0 && typeof i != "function" ? li("Function expected") : i, Hn = (i, e, t, r, n) => ({ kind: qn[i], name: e, metadata: r, addInitializer: (s) => t._ ? li("Already initialized") : n.push(hi(s || null)) }), Wn = (i, e) => Fn(e, ci("metadata"), i[3]), Gn = (i, e, t, r) => {
4420
+ }, Hn = (i, e, t) => e in i ? rt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, Kn = (i, e) => rt(i, "name", { value: e, configurable: !0 }), qn = (i) => [, , , Fn(i?.[li("metadata")] ?? null)], Wn = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], ui = (i) => i !== void 0 && typeof i != "function" ? hi("Function expected") : i, Gn = (i, e, t, r, n) => ({ kind: Wn[i], name: e, metadata: r, addInitializer: (s) => t._ ? hi("Already initialized") : n.push(ui(s || null)) }), Vn = (i, e) => Hn(e, li("metadata"), i[3]), Yn = (i, e, t, r) => {
4406
4421
  for (var n = 0, s = i[e >> 1], o = s && s.length; n < o; n++) s[n].call(t);
4407
4422
  return r;
4408
- }, Vn = (i, e, t, r, n, s) => {
4409
- var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && Un(n, t));
4410
- zn(n, t);
4423
+ }, Jn = (i, e, t, r, n, s) => {
4424
+ var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && zn(n, t));
4425
+ Kn(n, t);
4411
4426
  for (var w = r.length - 1; w >= 0; w--)
4412
- f = Hn(u, t, a = {}, i[3], _), o = (0, r[w])(n, f), a._ = 1, hi(o) && (n = o);
4413
- return Wn(i, n), g && it(n, t, g), p ? u ^ 4 ? s : g : n;
4414
- }, ui, rt, fi;
4415
- const yt = new $(
4427
+ f = Gn(u, t, a = {}, i[3], _), o = (0, r[w])(n, f), a._ = 1, ui(o) && (n = o);
4428
+ return Vn(i, n), g && rt(n, t, g), p ? u ^ 4 ? s : g : n;
4429
+ }, fi, nt, di;
4430
+ const wt = new $(
4416
4431
  $.object({
4417
4432
  manifest_version: $.const(1).required(),
4418
4433
  base_language: $.string().required(),
@@ -4431,16 +4446,16 @@ const yt = new $(
4431
4446
  ).required()
4432
4447
  })
4433
4448
  );
4434
- ui = [F(["wiki", "preferences"]), Gt(
4449
+ fi = [F(["wiki", "preferences"]), Vt(
4435
4450
  $.object({
4436
4451
  "i18n.index_url": $.string().description("I18n index URL (DO NOT CHANGE THIS) ").default(
4437
- tt.I18N_INDEX_URL
4452
+ it.I18N_INDEX_URL
4438
4453
  )
4439
4454
  }).description("").extra("category", "general")
4440
4455
  )];
4441
- class ye extends (fi = z) {
4456
+ class we extends (di = z) {
4442
4457
  constructor(e) {
4443
- super(e, "i18n", !1), this.ctx = e, this.logger = void 0, this._indexUrl = void 0, this._indexCache = null, this.manager = void 0, this.i18nIndexDB = void 0, this.i18nDataDB = void 0, this.$ = void 0, this.$raw = void 0, this.$$ = void 0, this.$$raw = void 0, this.logger = this.ctx.logger("I18nService"), this.manager = new Nn(
4458
+ super(e, "i18n", !1), this.ctx = e, this.logger = void 0, this._indexUrl = void 0, this._indexCache = null, this.manager = void 0, this.i18nIndexDB = void 0, this.i18nDataDB = void 0, this.$ = void 0, this.$raw = void 0, this.$$ = void 0, this.$$raw = void 0, this.logger = this.ctx.logger("I18nService"), this.manager = new Un(
4444
4459
  {},
4445
4460
  {
4446
4461
  language: "",
@@ -4519,7 +4534,7 @@ class ye extends (fi = z) {
4519
4534
  this.ctx.set("$", this.manager.$.bind(this.manager)), this.ctx.set("$raw", this.manager.$raw.bind(this.manager)), this.ctx.set("$$", this.manager.$$.bind(this.manager)), this.ctx.set("$$raw", this.manager.$$raw.bind(this.manager));
4520
4535
  }
4521
4536
  normalizeLanguageCode(e) {
4522
- return !e || typeof e != "string" ? "en" : (e === "@user" && (e = this.ctx.wiki.userInfo.options.language || "en"), e === "@site" && (e = this.ctx.wiki.siteInfo.general.lang || "en"), te(String(e)).toLowerCase());
4537
+ return !e || typeof e != "string" ? "en" : (e === "@user" && (e = this.ctx.wiki.userInfo.options.language || "en"), e === "@site" && (e = this.ctx.wiki.siteInfo.general.lang || "en"), ie(String(e)).toLowerCase());
4523
4538
  }
4524
4539
  get language() {
4525
4540
  return this.manager.getLanguage();
@@ -4557,7 +4572,7 @@ class ye extends (fi = z) {
4557
4572
  );
4558
4573
  }
4559
4574
  findLanguageMeta(e, t) {
4560
- const r = te(String(t)).toLowerCase(), n = e.languages[r];
4575
+ const r = ie(String(t)).toLowerCase(), n = e.languages[r];
4561
4576
  if (n)
4562
4577
  return {
4563
4578
  code: r,
@@ -4577,7 +4592,7 @@ class ye extends (fi = z) {
4577
4592
  const n = await this.i18nIndexDB.get(e);
4578
4593
  if (n)
4579
4594
  try {
4580
- return yt(n);
4595
+ return wt(n);
4581
4596
  } catch (s) {
4582
4597
  this.logger.error("Failed to parse cached i18n index", s), this.i18nIndexDB.delete(e);
4583
4598
  }
@@ -4587,7 +4602,7 @@ class ye extends (fi = z) {
4587
4602
  }
4588
4603
  async fetchI18nIndex(e) {
4589
4604
  const t = await fetch(e).then((r) => r.json());
4590
- return yt(t);
4605
+ return wt(t);
4591
4606
  }
4592
4607
  async ensureLanguageLoaded(e) {
4593
4608
  if (!this.manager || !this._indexCache) throw new Error("I18nManager is not initialized");
@@ -4626,18 +4641,18 @@ class ye extends (fi = z) {
4626
4641
  await this.i18nIndexDB.clear(), await this.i18nDataDB.clear();
4627
4642
  }
4628
4643
  }
4629
- rt = Kn(fi);
4630
- ye = Vn(rt, 0, "I18nService", ui, ye);
4631
- Gn(rt, 1, ye);
4632
- const Jn = new TextEncoder();
4633
- function Yn(i) {
4634
- if (typeof i == "string") return Jn.encode(i);
4644
+ nt = qn(di);
4645
+ we = Jn(nt, 0, "I18nService", fi, we);
4646
+ Yn(nt, 1, we);
4647
+ const Xn = new TextEncoder();
4648
+ function Qn(i) {
4649
+ if (typeof i == "string") return Xn.encode(i);
4635
4650
  if (i instanceof ArrayBuffer) return new Uint8Array(i);
4636
4651
  if (ArrayBuffer.isView(i))
4637
4652
  return new Uint8Array(i.buffer, i.byteOffset, i.byteLength);
4638
4653
  throw new TypeError("Unsupported input type");
4639
4654
  }
4640
- function Xn(i) {
4655
+ function Zn(i) {
4641
4656
  let e = "";
4642
4657
  for (let t = 0; t < i.length; t++) {
4643
4658
  const r = i[t].toString(16).padStart(2, "0");
@@ -4645,10 +4660,10 @@ function Xn(i) {
4645
4660
  }
4646
4661
  return e;
4647
4662
  }
4648
- function Qn(i, e) {
4663
+ function es(i, e) {
4649
4664
  return i << e | i >>> 32 - e;
4650
4665
  }
4651
- const Zn = [
4666
+ const ts = [
4652
4667
  7,
4653
4668
  12,
4654
4669
  17,
@@ -4713,9 +4728,9 @@ const Zn = [
4713
4728
  10,
4714
4729
  15,
4715
4730
  21
4716
- ], es = new Array(64).fill(0).map((i, e) => Math.floor(Math.abs(Math.sin(e + 1)) * 2 ** 32) >>> 0);
4717
- function ts(i) {
4718
- const e = Yn(i), t = (56 - (e.length + 1) % 64 + 64) % 64, r = e.length + 1 + t + 8, n = new Uint8Array(r);
4731
+ ], is = new Array(64).fill(0).map((i, e) => Math.floor(Math.abs(Math.sin(e + 1)) * 2 ** 32) >>> 0);
4732
+ function rs(i) {
4733
+ const e = Qn(i), t = (56 - (e.length + 1) % 64 + 64) % 64, r = e.length + 1 + t + 8, n = new Uint8Array(r);
4719
4734
  n.set(e, 0), n[e.length] = 128;
4720
4735
  const s = e.length, o = s << 3 >>> 0, a = s >>> 29 >>> 0, f = new DataView(n.buffer);
4721
4736
  f.setUint32(r - 8, o, !0), f.setUint32(r - 4, a, !0);
@@ -4727,28 +4742,28 @@ function ts(i) {
4727
4742
  for (let m = 0; m < 64; m++) {
4728
4743
  let v, x;
4729
4744
  m < 16 ? (v = c & h | ~c & d, x = m) : m < 32 ? (v = d & c | ~d & h, x = (5 * m + 1) % 16) : m < 48 ? (v = c ^ h ^ d, x = (3 * m + 5) % 16) : (v = h ^ (c | ~d), x = 7 * m % 16);
4730
- const A = d, ke = l + v + es[m] + g[x] >>> 0;
4731
- d = h, h = c, c = c + Qn(ke, Zn[m]) >>> 0, l = A;
4745
+ const A = d, Se = l + v + is[m] + g[x] >>> 0;
4746
+ d = h, h = c, c = c + es(Se, ts[m]) >>> 0, l = A;
4732
4747
  }
4733
4748
  u = u + l >>> 0, p = p + c >>> 0, y = y + h >>> 0, _ = _ + d >>> 0;
4734
4749
  }
4735
4750
  const w = new Uint8Array(16), O = new DataView(w.buffer);
4736
4751
  return O.setUint32(0, u, !0), O.setUint32(4, p, !0), O.setUint32(8, y, !0), O.setUint32(12, _, !0), w;
4737
4752
  }
4738
- var is = Object.create, nt = Object.defineProperty, rs = Object.getOwnPropertyDescriptor, di = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), pi = (i) => {
4753
+ var ns = Object.create, st = Object.defineProperty, ss = Object.getOwnPropertyDescriptor, pi = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), gi = (i) => {
4739
4754
  throw TypeError(i);
4740
- }, ns = (i, e, t) => e in i ? nt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, ss = (i, e) => nt(i, "name", { value: e, configurable: !0 }), os = (i) => [, , , is(i?.[di("metadata")] ?? null)], as = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], gi = (i) => i !== void 0 && typeof i != "function" ? pi("Function expected") : i, cs = (i, e, t, r, n) => ({ kind: as[i], name: e, metadata: r, addInitializer: (s) => t._ ? pi("Already initialized") : n.push(gi(s || null)) }), ls = (i, e) => ns(e, di("metadata"), i[3]), hs = (i, e, t, r) => {
4755
+ }, os = (i, e, t) => e in i ? st(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, as = (i, e) => st(i, "name", { value: e, configurable: !0 }), cs = (i) => [, , , ns(i?.[pi("metadata")] ?? null)], ls = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], mi = (i) => i !== void 0 && typeof i != "function" ? gi("Function expected") : i, hs = (i, e, t, r, n) => ({ kind: ls[i], name: e, metadata: r, addInitializer: (s) => t._ ? gi("Already initialized") : n.push(mi(s || null)) }), us = (i, e) => os(e, pi("metadata"), i[3]), fs = (i, e, t, r) => {
4741
4756
  for (var n = 0, s = i[e >> 1], o = s && s.length; n < o; n++) s[n].call(t);
4742
4757
  return r;
4743
- }, us = (i, e, t, r, n, s) => {
4744
- var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && rs(n, t));
4745
- ss(n, t);
4758
+ }, ds = (i, e, t, r, n, s) => {
4759
+ var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && ss(n, t));
4760
+ as(n, t);
4746
4761
  for (var w = r.length - 1; w >= 0; w--)
4747
- f = cs(u, t, a = {}, i[3], _), o = (0, r[w])(n, f), a._ = 1, gi(o) && (n = o);
4748
- return ls(i, n), g && nt(n, t, g), p ? u ^ 4 ? s : g : n;
4749
- }, mi, st, yi;
4750
- mi = [F(["wiki", "wikiTitle", "wikiPage", "apiService"])];
4751
- class we extends (yi = z) {
4762
+ f = hs(u, t, a = {}, i[3], _), o = (0, r[w])(n, f), a._ = 1, mi(o) && (n = o);
4763
+ return us(i, n), g && st(n, t, g), p ? u ^ 4 ? s : g : n;
4764
+ }, yi, ot, wi;
4765
+ yi = [F(["wiki", "wikiTitle", "wikiPage", "apiService"])];
4766
+ class be extends (wi = z) {
4752
4767
  constructor(e) {
4753
4768
  super(e, "wikiFile", !0), this.ctx = e;
4754
4769
  }
@@ -4770,7 +4785,7 @@ class we extends (yi = z) {
4770
4785
  return e.getMainDBKey().split("/").pop() || "";
4771
4786
  }
4772
4787
  getHashPath(e, t = 2) {
4773
- const r = this.getFileName(e), n = Xn(ts(r));
4788
+ const r = this.getFileName(e), n = Zn(rs(r));
4774
4789
  let s = [];
4775
4790
  for (let o = 1; o <= t; o++)
4776
4791
  s.push(n.slice(0, o));
@@ -4797,34 +4812,34 @@ class we extends (yi = z) {
4797
4812
  );
4798
4813
  }
4799
4814
  }
4800
- st = os(yi);
4801
- we = us(st, 0, "WikiFileService", mi, we);
4802
- hs(st, 1, we);
4803
- class be extends N {
4815
+ ot = cs(wi);
4816
+ be = ds(ot, 0, "WikiFileService", yi, be);
4817
+ fs(ot, 1, be);
4818
+ class ve extends M {
4804
4819
  constructor(e) {
4805
4820
  super({
4806
4821
  name: "InPageEdit"
4807
- }), this.version = "0.16.0", this.Endpoints = tt, this.schema = $, this.config = $i(be.DEFAULT_CONFIG, e), this.logger = or({
4822
+ }), this.version = "0.16.1", this.Endpoints = it, this.schema = $, this.config = Ei(ve.DEFAULT_CONFIG, e), this.logger = ar({
4808
4823
  name: "IPE",
4809
4824
  color: "#33aaff",
4810
4825
  level: this.config.logLevel
4811
- }), this.#e();
4826
+ }), this.#t();
4812
4827
  }
4813
4828
  static {
4814
4829
  this.DEFAULT_CONFIG = {
4815
4830
  apiConfigs: {},
4816
4831
  legacyPreferences: {},
4817
- logLevel: Ot.info,
4832
+ logLevel: Pt.info,
4818
4833
  storageNamespace: "InPageEdit",
4819
4834
  autoloadStyles: !0,
4820
4835
  autoInstallCorePlugins: !0
4821
4836
  };
4822
4837
  }
4823
- async #e() {
4824
- await this.#i(), this.config.autoInstallCorePlugins && this.#r(), this.#n();
4838
+ async #t() {
4839
+ await this.#i(), this.config.autoInstallCorePlugins && this.#e(), this.#n();
4825
4840
  }
4826
4841
  async #i() {
4827
- this.plugin(ye), this.plugin(cr, this.config.apiConfigs), this.plugin(fe), this.plugin(br), this.plugin(Hr), this.plugin(me), this.plugin(an, { dbName: this.config.storageNamespace }), this.plugin(ge), this.plugin(we), this.plugin(pe), this.plugin(wn), this.plugin(Qe), this.#t([
4842
+ this.plugin(we), this.plugin(lr, this.config.apiConfigs), this.plugin(vr), this.plugin(_r), this.plugin(Gr), this.plugin(ye), this.plugin(ln, { dbName: this.config.storageNamespace }), this.plugin(me), this.plugin(be), this.plugin(ge), this.plugin(vn), this.plugin(Ze), this.#r([
4828
4843
  "i18n",
4829
4844
  "$",
4830
4845
  "$$",
@@ -4844,37 +4859,37 @@ class be extends N {
4844
4859
  "getMainpageUrl"
4845
4860
  ]);
4846
4861
  }
4847
- #t(e) {
4862
+ #r(e) {
4848
4863
  if (!Array.isArray(e) || e.length === 0) return this;
4849
4864
  for (const t of e) {
4850
- const r = this[be.internal][t];
4865
+ const r = this[ve.internal][t];
4851
4866
  r?.type === "service" && (r.builtin = !0);
4852
4867
  }
4853
4868
  return this;
4854
4869
  }
4855
4870
  // TODO: 这里不应该硬编码,暂时先这样
4856
- async #r() {
4871
+ async #e() {
4857
4872
  [
4858
- import("./index-NWWeW3tX.js").then(({ PluginAnalytics: t }) => t),
4859
- import("./index-BPTMltVf.js").then(
4873
+ import("./index-mf_pX14E.js").then(({ PluginAnalytics: t }) => t),
4874
+ import("./index-1sZXko-X.js").then(
4860
4875
  ({ PluginInArticleLinks: t }) => t
4861
4876
  ),
4862
- import("./index-bQ0CVu3l.js").then(({ PluginPluginStore: t }) => t),
4863
- import("./index-BYlcHc-O.js").then(
4877
+ import("./index-BllIuJSJ.js").then(({ PluginPluginStore: t }) => t),
4878
+ import("./index-BcTomMXW.js").then(
4864
4879
  ({ PluginPreferencesUI: t }) => t
4865
4880
  ),
4866
- import("./index-B32tFyLB.js").then(({ PluginQuickEdit: t }) => t),
4867
- import("./index-CVCy0wPP.js").then(({ PluginQuickMove: t }) => t),
4868
- import("./index-DZa9mxN4.js").then(
4881
+ import("./index-CN7r2e0P.js").then(({ PluginQuickEdit: t }) => t),
4882
+ import("./index-CkSHCMRN.js").then(({ PluginQuickMove: t }) => t),
4883
+ import("./index-CMmEZcB1.js").then(
4869
4884
  ({ PluginQuickPreview: t }) => t
4870
4885
  ),
4871
- import("./index-Dm2vgYkZ.js").then(({ PluginQuickDiff: t }) => t),
4872
- import("./index-1tsXE6ax.js").then(
4886
+ import("./index-42B3CrSO.js").then(({ PluginQuickDiff: t }) => t),
4887
+ import("./index-BBUv7Lv6.js").then(
4873
4888
  ({ PluginQuickRedirect: t }) => t
4874
4889
  ),
4875
- import("./index-CAtPo7xJ.js").then(({ PluginQuickUpload: t }) => t),
4876
- import("./index-ygc4AMy4.js").then(({ PluginQuickUsage: t }) => t),
4877
- import("./index-C4qm_X_A.js").then(({ PluginToolbox: t }) => t)
4890
+ import("./index-Bn6y0Eln.js").then(({ PluginQuickUpload: t }) => t),
4891
+ import("./index-DlCbsA25.js").then(({ PluginQuickUsage: t }) => t),
4892
+ import("./index-TG_MTC9y.js").then(({ PluginToolbox: t }) => t)
4878
4893
  ].forEach(async (t) => {
4879
4894
  this.plugin(await t);
4880
4895
  });
@@ -4886,47 +4901,47 @@ class be extends N {
4886
4901
  });
4887
4902
  }
4888
4903
  async withInject(e) {
4889
- const { promise: t, resolve: r } = wt();
4904
+ const { promise: t, resolve: r } = bt();
4890
4905
  return this.inject(e, (n) => {
4891
4906
  r(n);
4892
4907
  }), t;
4893
4908
  }
4894
4909
  }
4895
4910
  export {
4896
- Ot as $,
4897
- cr as A,
4898
- Pe as C,
4899
- tt as E,
4900
- Yi as F,
4901
- be as I,
4902
- ct as M,
4903
- de as N,
4904
- Ge as P,
4905
- Gt as R,
4911
+ Pt as $,
4912
+ lr as A,
4913
+ Ie as C,
4914
+ it as E,
4915
+ Xi as F,
4916
+ ve as I,
4917
+ lt as M,
4918
+ pe as N,
4919
+ Ve as P,
4920
+ Vt as R,
4906
4921
  $ as S,
4907
- ge as T,
4908
- we as W,
4922
+ me as T,
4923
+ be as W,
4909
4924
  F as a,
4910
- Et as b,
4925
+ Ct as b,
4911
4926
  Ji as c,
4912
4927
  z as d,
4913
- Vi as e,
4914
- or as f,
4915
- gs as g,
4916
- ps as h,
4917
- ms as i,
4918
- an as j,
4919
- fe as k,
4928
+ Yi as e,
4929
+ ar as f,
4930
+ ys as g,
4931
+ ms as h,
4932
+ ws as i,
4933
+ ln as j,
4934
+ vr as k,
4920
4935
  R as l,
4921
- ze as m,
4922
- Hr as n,
4923
- me as o,
4924
- te as p,
4925
- ft as q,
4926
- br as r,
4936
+ He as m,
4937
+ Gr as n,
4938
+ ye as o,
4939
+ ie as p,
4940
+ dt as q,
4941
+ _r as r,
4927
4942
  b as s,
4928
- pe as t,
4929
- wn as u,
4930
- Qe as v
4943
+ ge as t,
4944
+ vn as u,
4945
+ Ze as v
4931
4946
  };
4932
- //# sourceMappingURL=index-QnWieXQc.js.map
4947
+ //# sourceMappingURL=index-D7rUF8vA.js.map