@inpageedit/core 0.5.2 → 0.5.4

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 (47) hide show
  1. package/README.md +2 -2
  2. package/dist/Preferences-Bg3J5Ur9.js.map +1 -1
  3. package/dist/constants/endpoints.d.ts +2 -5
  4. package/dist/decorators/Preferences.d.ts +1 -1
  5. package/dist/{index-DXvJqlhL.js → index-BSjnoNn2.js} +3 -3
  6. package/dist/index-BSjnoNn2.js.map +1 -0
  7. package/dist/{index-BwVAO_o4.js → index-BedbUMp8.js} +6 -6
  8. package/dist/index-BedbUMp8.js.map +1 -0
  9. package/dist/{index-CIzmjtBz.js → index-DNQjqBV-.js} +1211 -1077
  10. package/dist/index-DNQjqBV-.js.map +1 -0
  11. package/dist/{index-B0QzYk-q.js → index-DtOC8Ck-.js} +1258 -1297
  12. package/dist/{index-B0QzYk-q.js.map → index-DtOC8Ck-.js.map} +1 -1
  13. package/dist/{index-3FdvKxaN.js → index-UyiZ7umI.js} +65 -42
  14. package/dist/index-UyiZ7umI.js.map +1 -0
  15. package/dist/{index-6bp2nmez.js → index-e7eyr1FL.js} +2 -2
  16. package/dist/{index-6bp2nmez.js.map → index-e7eyr1FL.js.map} +1 -1
  17. package/dist/{index-D1plOuGc.js → index-i-Uf0vuA.js} +63 -63
  18. package/dist/{index-D1plOuGc.js.map → index-i-Uf0vuA.js.map} +1 -1
  19. package/dist/{index-DlE7PWxs.js → index-rMDuLpcz.js} +170 -140
  20. package/dist/index-rMDuLpcz.js.map +1 -0
  21. package/dist/index-xJ2bdsOD.js +128 -0
  22. package/dist/index-xJ2bdsOD.js.map +1 -0
  23. package/dist/index.js +1 -1
  24. package/dist/models/WikiPage/types/PageInfo.d.ts +2 -0
  25. package/dist/plugins/in-article-links/index.d.ts +6 -8
  26. package/dist/plugins/preferences/index.d.ts +5 -4
  27. package/dist/plugins/quick-edit/index.d.ts +8 -4
  28. package/dist/plugins/toolbox/index.d.ts +12 -2
  29. package/dist/services/ModalService/IPEModal.d.ts +4 -4
  30. package/dist/services/ModalService/index.d.ts +6 -14
  31. package/dist/services/SiteMetadataService.d.ts +3 -2
  32. package/dist/style.css +1 -1
  33. package/dist/utils/computeable.d.ts +2 -0
  34. package/dist/utils/makeCallable.d.ts +3 -0
  35. package/lib/index.umd.js +28 -28
  36. package/lib/index.umd.js.map +1 -1
  37. package/lib/style.css +1 -1
  38. package/package.json +8 -11
  39. package/dist/index-3FdvKxaN.js.map +0 -1
  40. package/dist/index-BwVAO_o4.js.map +0 -1
  41. package/dist/index-CIzmjtBz.js.map +0 -1
  42. package/dist/index-DXvJqlhL.js.map +0 -1
  43. package/dist/index-DlE7PWxs.js.map +0 -1
  44. package/dist/index-DnpXoEP3.js +0 -142
  45. package/dist/index-DnpXoEP3.js.map +0 -1
  46. package/dist/sleep-DpyIipK-.js +0 -5
  47. package/dist/sleep-DpyIipK-.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { j as Vt, P as $n } from "./index-CvhkVj_L.js";
1
+ import { j as W, F as $n, P as Tn } from "./index-CvhkVj_L.js";
2
2
  const ar = () => {
3
3
  let r, e;
4
4
  return { promise: new Promise((n, i) => {
@@ -6,30 +6,30 @@ const ar = () => {
6
6
  }), resolve: r, reject: e };
7
7
  };
8
8
  Promise.withResolvers || (Promise.withResolvers = ar);
9
- var Tn = Object.defineProperty, B = (r, e) => Tn(r, "name", { value: e, configurable: !0 });
10
- function Ln() {
9
+ var Dn = Object.defineProperty, B = (r, e) => Dn(r, "name", { value: e, configurable: !0 });
10
+ function Cn() {
11
11
  }
12
- B(Ln, "noop");
13
- function Y(r) {
12
+ B(Cn, "noop");
13
+ function K(r) {
14
14
  return r == null;
15
15
  }
16
- B(Y, "isNullable");
17
- function Dn(r) {
18
- return !Y(r);
16
+ B(K, "isNullable");
17
+ function Ln(r) {
18
+ return !K(r);
19
19
  }
20
- B(Dn, "isNonNullable");
21
- function He(r) {
20
+ B(Ln, "isNonNullable");
21
+ function We(r) {
22
22
  return r && typeof r == "object" && !Array.isArray(r);
23
23
  }
24
- B(He, "isPlainObject");
24
+ B(We, "isPlainObject");
25
25
  function cr(r, e) {
26
26
  return Object.fromEntries(Object.entries(r).filter(([t, n]) => e(t, n)));
27
27
  }
28
28
  B(cr, "filterKeys");
29
- function fe(r, e) {
29
+ function he(r, e) {
30
30
  return Object.fromEntries(Object.entries(r).map(([t, n]) => [t, e(n, t)]));
31
31
  }
32
- B(fe, "mapValues");
32
+ B(he, "mapValues");
33
33
  function lr(r, e, t) {
34
34
  if (!e) return { ...r };
35
35
  const n = {};
@@ -38,62 +38,62 @@ function lr(r, e, t) {
38
38
  return n;
39
39
  }
40
40
  B(lr, "pick");
41
- function Cn(r, e) {
41
+ function Pn(r, e) {
42
42
  if (!e) return { ...r };
43
43
  const t = { ...r };
44
44
  for (const n of e)
45
45
  Reflect.deleteProperty(t, n);
46
46
  return t;
47
47
  }
48
- B(Cn, "omit");
49
- function X(r, e, t) {
48
+ B(Pn, "omit");
49
+ function J(r, e, t) {
50
50
  return Object.defineProperty(r, e, { writable: !0, value: t, enumerable: !1 });
51
51
  }
52
- B(X, "defineProperty");
53
- function Pn(r, e) {
52
+ B(J, "defineProperty");
53
+ function Nn(r, e) {
54
54
  return e.every((t) => r.includes(t));
55
55
  }
56
- B(Pn, "contain");
57
- function Nn(r, e) {
56
+ B(Nn, "contain");
57
+ function Bn(r, e) {
58
58
  return r.filter((t) => e.includes(t));
59
59
  }
60
- B(Nn, "intersection");
61
- function Bn(r, e) {
60
+ B(Bn, "intersection");
61
+ function jn(r, e) {
62
62
  return r.filter((t) => !e.includes(t));
63
63
  }
64
- B(Bn, "difference");
65
- function jn(r, e) {
64
+ B(jn, "difference");
65
+ function Mn(r, e) {
66
66
  return Array.from(/* @__PURE__ */ new Set([...r, ...e]));
67
67
  }
68
- B(jn, "union");
68
+ B(Mn, "union");
69
69
  function Un(r) {
70
70
  return [...new Set(r)];
71
71
  }
72
72
  B(Un, "deduplicate");
73
- function me(r, e) {
73
+ function ye(r, e) {
74
74
  const t = r?.indexOf(e);
75
75
  return t >= 0 ? (r.splice(t, 1), !0) : !1;
76
76
  }
77
- B(me, "remove");
78
- function Mn(r) {
79
- return Array.isArray(r) ? r : Y(r) ? [] : [r];
77
+ B(ye, "remove");
78
+ function Fn(r) {
79
+ return Array.isArray(r) ? r : K(r) ? [] : [r];
80
80
  }
81
- B(Mn, "makeArray");
82
- function ye(r, e) {
83
- return arguments.length === 1 ? (t) => ye(r, t) : r in globalThis && e instanceof globalThis[r] || Object.prototype.toString.call(e).slice(8, -1) === r;
81
+ B(Fn, "makeArray");
82
+ function ge(r, e) {
83
+ return arguments.length === 1 ? (t) => ge(r, t) : r in globalThis && e instanceof globalThis[r] || Object.prototype.toString.call(e).slice(8, -1) === r;
84
84
  }
85
- B(ye, "is");
86
- function Ce(r) {
87
- return ye("ArrayBuffer", r) || ye("SharedArrayBuffer", r);
85
+ B(ge, "is");
86
+ function Pe(r) {
87
+ return ge("ArrayBuffer", r) || ge("SharedArrayBuffer", r);
88
88
  }
89
- B(Ce, "isArrayBufferLike");
89
+ B(Pe, "isArrayBufferLike");
90
90
  function ur(r) {
91
- return Ce(r) || ArrayBuffer.isView(r);
91
+ return Pe(r) || ArrayBuffer.isView(r);
92
92
  }
93
93
  B(ur, "isArrayBufferSource");
94
- var oe;
94
+ var ae;
95
95
  ((r) => {
96
- r.is = Ce, r.isSource = ur;
96
+ r.is = Pe, r.isSource = ur;
97
97
  function e(c) {
98
98
  return ArrayBuffer.isView(c) ? c.buffer.slice(c.byteOffset, c.byteOffset + c.byteLength) : c;
99
99
  }
@@ -124,62 +124,62 @@ var oe;
124
124
  return Uint8Array.from(b).buffer;
125
125
  }
126
126
  r.fromHex = s, B(s, "fromHex");
127
- })(oe || (oe = {}));
128
- oe.fromBase64;
129
- oe.toBase64;
130
- oe.fromHex;
131
- oe.toHex;
132
- function Ye(r, e = /* @__PURE__ */ new Map()) {
127
+ })(ae || (ae = {}));
128
+ ae.fromBase64;
129
+ ae.toBase64;
130
+ ae.fromHex;
131
+ ae.toHex;
132
+ function Ke(r, e = /* @__PURE__ */ new Map()) {
133
133
  if (!r || typeof r != "object") return r;
134
- if (ye("Date", r)) return new Date(r.valueOf());
135
- if (ye("RegExp", r)) return new RegExp(r.source, r.flags);
136
- if (Ce(r)) return r.slice(0);
134
+ if (ge("Date", r)) return new Date(r.valueOf());
135
+ if (ge("RegExp", r)) return new RegExp(r.source, r.flags);
136
+ if (Pe(r)) return r.slice(0);
137
137
  if (ArrayBuffer.isView(r)) return r.buffer.slice(r.byteOffset, r.byteOffset + r.byteLength);
138
138
  const t = e.get(r);
139
139
  if (t) return t;
140
140
  if (Array.isArray(r)) {
141
141
  const i = [];
142
142
  return e.set(r, i), r.forEach((s, c) => {
143
- i[c] = Reflect.apply(Ye, null, [s, e]);
143
+ i[c] = Reflect.apply(Ke, null, [s, e]);
144
144
  }), i;
145
145
  }
146
146
  const n = Object.create(Object.getPrototypeOf(r));
147
147
  e.set(r, n);
148
148
  for (const i of Reflect.ownKeys(r)) {
149
149
  const s = { ...Reflect.getOwnPropertyDescriptor(r, i) };
150
- "value" in s && (s.value = Reflect.apply(Ye, null, [s.value, e])), Reflect.defineProperty(n, i, s);
150
+ "value" in s && (s.value = Reflect.apply(Ke, null, [s.value, e])), Reflect.defineProperty(n, i, s);
151
151
  }
152
152
  return n;
153
153
  }
154
- B(Ye, "clone");
155
- function be(r, e, t) {
156
- if (r === e || !t && Y(r) && Y(e)) return !0;
154
+ B(Ke, "clone");
155
+ function ve(r, e, t) {
156
+ if (r === e || !t && K(r) && K(e)) return !0;
157
157
  if (typeof r != typeof e || typeof r != "object" || !r || !e) return !1;
158
158
  function n(i, s) {
159
159
  return i(r) ? i(e) ? s(r, e) : !1 : i(e) ? !1 : void 0;
160
160
  }
161
- return B(n, "check"), n(Array.isArray, (i, s) => i.length === s.length && i.every((c, l) => be(c, s[l]))) ?? n(ye("Date"), (i, s) => i.valueOf() === s.valueOf()) ?? n(ye("RegExp"), (i, s) => i.source === s.source && i.flags === s.flags) ?? n(Ce, (i, s) => {
161
+ return B(n, "check"), n(Array.isArray, (i, s) => i.length === s.length && i.every((c, l) => ve(c, s[l]))) ?? n(ge("Date"), (i, s) => i.valueOf() === s.valueOf()) ?? n(ge("RegExp"), (i, s) => i.source === s.source && i.flags === s.flags) ?? n(Pe, (i, s) => {
162
162
  if (i.byteLength !== s.byteLength) return !1;
163
163
  const c = new Uint8Array(i), l = new Uint8Array(s);
164
164
  for (let b = 0; b < c.length; b++)
165
165
  if (c[b] !== l[b]) return !1;
166
166
  return !0;
167
- }) ?? Object.keys({ ...r, ...e }).every((i) => be(r[i], e[i], t));
167
+ }) ?? Object.keys({ ...r, ...e }).every((i) => ve(r[i], e[i], t));
168
168
  }
169
- B(be, "deepEqual");
170
- function Fn(r) {
169
+ B(ve, "deepEqual");
170
+ function zn(r) {
171
171
  return r.charAt(0).toUpperCase() + r.slice(1);
172
172
  }
173
- B(Fn, "capitalize");
174
- function Wn(r) {
173
+ B(zn, "capitalize");
174
+ function Hn(r) {
175
175
  return r.charAt(0).toLowerCase() + r.slice(1);
176
176
  }
177
- B(Wn, "uncapitalize");
178
- function Hn(r) {
177
+ B(Hn, "uncapitalize");
178
+ function Wn(r) {
179
179
  return r.replace(/[_-][a-z]/g, (e) => e.slice(1).toUpperCase());
180
180
  }
181
- B(Hn, "camelCase");
182
- function gt(r, e, t) {
181
+ B(Wn, "camelCase");
182
+ function bt(r, e, t) {
183
183
  const n = [];
184
184
  let i = 0;
185
185
  for (let s = 0; s < r.length; s++) {
@@ -195,46 +195,46 @@ function gt(r, e, t) {
195
195
  }
196
196
  return String.fromCharCode(...n);
197
197
  }
198
- B(gt, "tokenize");
198
+ B(bt, "tokenize");
199
199
  function qn(r) {
200
- return gt(r, [45, 95], 45);
200
+ return bt(r, [45, 95], 45);
201
201
  }
202
202
  B(qn, "paramCase");
203
- function zn(r) {
204
- return gt(r, [45, 95], 95);
205
- }
206
- B(zn, "snakeCase");
207
203
  function Yn(r) {
204
+ return bt(r, [45, 95], 95);
205
+ }
206
+ B(Yn, "snakeCase");
207
+ function Kn(r) {
208
208
  return typeof r != "string" ? `[${r.toString()}]` : /^[a-z_$][\w$]*$/i.test(r) ? `.${r}` : `[${JSON.stringify(r)}]`;
209
209
  }
210
- B(Yn, "formatProperty");
210
+ B(Kn, "formatProperty");
211
211
  function fr(r) {
212
212
  return r.replace(/\/$/, "");
213
213
  }
214
214
  B(fr, "trimSlash");
215
- function Kn(r) {
215
+ function Vn(r) {
216
216
  return r.startsWith("/") || (r = "/" + r), fr(r);
217
217
  }
218
- B(Kn, "sanitize");
218
+ B(Vn, "sanitize");
219
219
  var Gt;
220
220
  ((r) => {
221
221
  r.millisecond = 1, r.second = 1e3, r.minute = r.second * 60, r.hour = r.minute * 60, r.day = r.hour * 24, r.week = r.day * 7;
222
222
  let e = (/* @__PURE__ */ new Date()).getTimezoneOffset();
223
- function t(k) {
224
- e = k;
223
+ function t(O) {
224
+ e = O;
225
225
  }
226
226
  r.setTimezoneOffset = t, B(t, "setTimezoneOffset");
227
227
  function n() {
228
228
  return e;
229
229
  }
230
230
  r.getTimezoneOffset = n, B(n, "getTimezoneOffset");
231
- function i(k = /* @__PURE__ */ new Date(), L) {
232
- return typeof k == "number" && (k = new Date(k)), L === void 0 && (L = e), Math.floor((k.valueOf() / r.minute - L) / 1440);
231
+ function i(O = /* @__PURE__ */ new Date(), D) {
232
+ return typeof O == "number" && (O = new Date(O)), D === void 0 && (D = e), Math.floor((O.valueOf() / r.minute - D) / 1440);
233
233
  }
234
234
  r.getDateNumber = i, B(i, "getDateNumber");
235
- function s(k, L) {
236
- const q = new Date(k * r.day);
237
- return L === void 0 && (L = e), new Date(+q + L * r.minute);
235
+ function s(O, D) {
236
+ const q = new Date(O * r.day);
237
+ return D === void 0 && (D = e), new Date(+q + D * r.minute);
238
238
  }
239
239
  r.fromDateNumber = s, B(s, "fromDateNumber");
240
240
  const c = /\d+(?:\.\d+)?/.source, l = new RegExp(`^${[
@@ -243,32 +243,32 @@ var Gt;
243
243
  "h(?:our(?:s)?)?",
244
244
  "m(?:in(?:ute)?(?:s)?)?",
245
245
  "s(?:ec(?:ond)?(?:s)?)?"
246
- ].map((k) => `(${c}${k})?`).join("")}$`);
247
- function b(k) {
248
- const L = l.exec(k);
249
- return L ? (parseFloat(L[1]) * r.week || 0) + (parseFloat(L[2]) * r.day || 0) + (parseFloat(L[3]) * r.hour || 0) + (parseFloat(L[4]) * r.minute || 0) + (parseFloat(L[5]) * r.second || 0) : 0;
246
+ ].map((O) => `(${c}${O})?`).join("")}$`);
247
+ function b(O) {
248
+ const D = l.exec(O);
249
+ return D ? (parseFloat(D[1]) * r.week || 0) + (parseFloat(D[2]) * r.day || 0) + (parseFloat(D[3]) * r.hour || 0) + (parseFloat(D[4]) * r.minute || 0) + (parseFloat(D[5]) * r.second || 0) : 0;
250
250
  }
251
251
  r.parseTime = b, B(b, "parseTime");
252
- function v(k) {
253
- const L = b(k);
254
- return L ? k = Date.now() + L : /^\d{1,2}(:\d{1,2}){1,2}$/.test(k) ? k = `${(/* @__PURE__ */ new Date()).toLocaleDateString()}-${k}` : /^\d{1,2}-\d{1,2}-\d{1,2}(:\d{1,2}){1,2}$/.test(k) && (k = `${(/* @__PURE__ */ new Date()).getFullYear()}-${k}`), k ? new Date(k) : /* @__PURE__ */ new Date();
252
+ function v(O) {
253
+ const D = b(O);
254
+ return D ? O = Date.now() + D : /^\d{1,2}(:\d{1,2}){1,2}$/.test(O) ? O = `${(/* @__PURE__ */ new Date()).toLocaleDateString()}-${O}` : /^\d{1,2}-\d{1,2}-\d{1,2}(:\d{1,2}){1,2}$/.test(O) && (O = `${(/* @__PURE__ */ new Date()).getFullYear()}-${O}`), O ? new Date(O) : /* @__PURE__ */ new Date();
255
255
  }
256
256
  r.parseDate = v, B(v, "parseDate");
257
- function E(k) {
258
- const L = Math.abs(k);
259
- return L >= r.day - r.hour / 2 ? Math.round(k / r.day) + "d" : L >= r.hour - r.minute / 2 ? Math.round(k / r.hour) + "h" : L >= r.minute - r.second / 2 ? Math.round(k / r.minute) + "m" : L >= r.second ? Math.round(k / r.second) + "s" : k + "ms";
257
+ function S(O) {
258
+ const D = Math.abs(O);
259
+ return D >= r.day - r.hour / 2 ? Math.round(O / r.day) + "d" : D >= r.hour - r.minute / 2 ? Math.round(O / r.hour) + "h" : D >= r.minute - r.second / 2 ? Math.round(O / r.minute) + "m" : D >= r.second ? Math.round(O / r.second) + "s" : O + "ms";
260
260
  }
261
- r.format = E, B(E, "format");
262
- function w(k, L = 2) {
263
- return k.toString().padStart(L, "0");
261
+ r.format = S, B(S, "format");
262
+ function w(O, D = 2) {
263
+ return O.toString().padStart(D, "0");
264
264
  }
265
265
  r.toDigits = w, B(w, "toDigits");
266
- function D(k, L = /* @__PURE__ */ new Date()) {
267
- return k.replace("yyyy", L.getFullYear().toString()).replace("yy", L.getFullYear().toString().slice(2)).replace("MM", w(L.getMonth() + 1)).replace("dd", w(L.getDate())).replace("hh", w(L.getHours())).replace("mm", w(L.getMinutes())).replace("ss", w(L.getSeconds())).replace("SSS", w(L.getMilliseconds(), 3));
266
+ function C(O, D = /* @__PURE__ */ new Date()) {
267
+ return O.replace("yyyy", D.getFullYear().toString()).replace("yy", D.getFullYear().toString().slice(2)).replace("MM", w(D.getMonth() + 1)).replace("dd", w(D.getDate())).replace("hh", w(D.getHours())).replace("mm", w(D.getMinutes())).replace("ss", w(D.getSeconds())).replace("SSS", w(D.getMilliseconds(), 3));
268
268
  }
269
- r.template = D, B(D, "template");
269
+ r.template = C, B(C, "template");
270
270
  })(Gt || (Gt = {}));
271
- var Vn = Object.defineProperty, P = (r, e) => Vn(r, "name", { value: e, configurable: !0 }), T = {
271
+ var Gn = Object.defineProperty, P = (r, e) => Gn(r, "name", { value: e, configurable: !0 }), T = {
272
272
  // internal symbols
273
273
  shadow: Symbol.for("cordis.shadow"),
274
274
  receiver: Symbol.for("cordis.receiver"),
@@ -289,79 +289,79 @@ var Vn = Object.defineProperty, P = (r, e) => Vn(r, "name", { value: e, configur
289
289
  tracker: Symbol.for("cordis.tracker"),
290
290
  provide: Symbol.for("cordis.provide"),
291
291
  immediate: Symbol.for("cordis.immediate")
292
- }, Gn = function* () {
292
+ }, Xn = function* () {
293
293
  }.constructor, Xt = async function* () {
294
294
  }.constructor;
295
- function bt(r) {
296
- return !(!r.prototype || r instanceof Gn || Xt !== Function && r instanceof Xt);
295
+ function vt(r) {
296
+ return !(!r.prototype || r instanceof Xn || Xt !== Function && r instanceof Xt);
297
297
  }
298
- P(bt, "isConstructor");
299
- function Pe(r, e) {
298
+ P(vt, "isConstructor");
299
+ function Ne(r, e) {
300
300
  const t = r.Config || r.schema;
301
301
  return t && r.schema !== !1 && (e = t(e)), e ?? {};
302
302
  }
303
- P(Pe, "resolveConfig");
303
+ P(Ne, "resolveConfig");
304
304
  function hr(r) {
305
305
  return [Map, Set, Date, Promise].some((e) => r instanceof e);
306
306
  }
307
307
  P(hr, "isUnproxyable");
308
- function vt(r, e) {
308
+ function wt(r, e) {
309
309
  if (r === Object.prototype) return e;
310
- const t = Object.create(vt(Object.getPrototypeOf(r), e));
310
+ const t = Object.create(wt(Object.getPrototypeOf(r), e));
311
311
  for (const n of Reflect.ownKeys(r))
312
312
  Object.defineProperty(t, n, Object.getOwnPropertyDescriptor(r, n));
313
313
  return t;
314
314
  }
315
- P(vt, "joinPrototype");
316
- function wt(r) {
315
+ P(wt, "joinPrototype");
316
+ function _t(r) {
317
317
  return r && (typeof r == "object" || typeof r == "function");
318
318
  }
319
- P(wt, "isObject");
320
- function ae(r, e, t) {
321
- if (!wt(e)) return e;
319
+ P(_t, "isObject");
320
+ function ce(r, e, t) {
321
+ if (!_t(e)) return e;
322
322
  if (Object.hasOwn(e, T.shadow))
323
323
  return Object.getPrototypeOf(e);
324
324
  const n = e[T.tracker];
325
- return n ? Ge(r, e, n, t) : e;
325
+ return n ? Xe(r, e, n, t) : e;
326
326
  }
327
- P(ae, "getTraceable");
328
- function $e(r, e) {
327
+ P(ce, "getTraceable");
328
+ function Te(r, e) {
329
329
  return e ? new Proxy(r, {
330
330
  get: /* @__PURE__ */ P((t, n, i) => n in e && n !== "constructor" ? Reflect.get(e, n, i) : Reflect.get(t, n, i), "get"),
331
331
  set: /* @__PURE__ */ P((t, n, i, s) => n in e && n !== "constructor" ? Reflect.set(e, n, i, s) : Reflect.set(t, n, i, s), "set")
332
332
  }) : r;
333
333
  }
334
- P($e, "withProps");
335
- function Ke(r, e, t) {
336
- return $e(r, Object.defineProperty(/* @__PURE__ */ Object.create(null), e, {
334
+ P(Te, "withProps");
335
+ function Ve(r, e, t) {
336
+ return Te(r, Object.defineProperty(/* @__PURE__ */ Object.create(null), e, {
337
337
  value: t,
338
338
  writable: !1
339
339
  }));
340
340
  }
341
- P(Ke, "withProp");
342
- function ut(r, e, t, n) {
341
+ P(Ve, "withProp");
342
+ function ft(r, e, t, n) {
343
343
  if (!t) return n;
344
344
  const i = Reflect.getOwnPropertyDescriptor(e, t)?.value;
345
- return i ? Ke(n, t, r.extend({ [T.shadow]: i })) : n;
345
+ return i ? Ve(n, t, r.extend({ [T.shadow]: i })) : n;
346
346
  }
347
- P(ut, "createShadow");
347
+ P(ft, "createShadow");
348
348
  function dr(r, e, t, n) {
349
349
  return new Proxy(e, {
350
350
  apply: /* @__PURE__ */ P((i, s, c) => (s === t && (s = n), c = c.map((l) => typeof l != "function" || l[T.original] ? l : new Proxy(l, {
351
- get: /* @__PURE__ */ P((b, v, E) => {
351
+ get: /* @__PURE__ */ P((b, v, S) => {
352
352
  if (v === T.original) return b;
353
- const w = Reflect.get(b, v, E);
354
- return v === "toString" && w === Function.prototype.toString ? function(...D) {
355
- return Reflect.apply(w, this === E ? b : this, D);
353
+ const w = Reflect.get(b, v, S);
354
+ return v === "toString" && w === Function.prototype.toString ? function(...C) {
355
+ return Reflect.apply(w, this === S ? b : this, C);
356
356
  } : w;
357
357
  }, "get"),
358
- apply: /* @__PURE__ */ P((b, v, E) => Reflect.apply(b, ae(r, v), E.map((w) => ae(r, w))), "apply"),
359
- construct: /* @__PURE__ */ P((b, v, E) => Reflect.construct(b, v.map((w) => ae(r, w)), E), "construct")
360
- })), ae(r, Reflect.apply(i, s, c))), "apply")
358
+ apply: /* @__PURE__ */ P((b, v, S) => Reflect.apply(b, ce(r, v), S.map((w) => ce(r, w))), "apply"),
359
+ construct: /* @__PURE__ */ P((b, v, S) => Reflect.construct(b, v.map((w) => ce(r, w)), S), "construct")
360
+ })), ce(r, Reflect.apply(i, s, c))), "apply")
361
361
  });
362
362
  }
363
363
  P(dr, "createShadowMethod");
364
- function Ge(r, e, t, n) {
364
+ function Xe(r, e, t, n) {
365
365
  r[T.shadow] && (r = Object.getPrototypeOf(r));
366
366
  const i = new Proxy(e, {
367
367
  get: /* @__PURE__ */ P((s, c, l) => {
@@ -370,39 +370,39 @@ function Ge(r, e, t, n) {
370
370
  if (typeof c == "symbol")
371
371
  return Reflect.get(s, c, l);
372
372
  if (t.associate && r[T.internal][`${t.associate}.${c}`])
373
- return Reflect.get(r, `${t.associate}.${c}`, Ke(r, T.receiver, l));
374
- const b = ut(r, s, t.property, l), v = Reflect.get(s, c, b), E = v?.[T.tracker];
375
- return E ? Ge(r, v, E) : !n && typeof v == "function" ? dr(r, v, l, b) : v;
373
+ return Reflect.get(r, `${t.associate}.${c}`, Ve(r, T.receiver, l));
374
+ const b = ft(r, s, t.property, l), v = Reflect.get(s, c, b), S = v?.[T.tracker];
375
+ return S ? Xe(r, v, S) : !n && typeof v == "function" ? dr(r, v, l, b) : v;
376
376
  }, "get"),
377
377
  set: /* @__PURE__ */ P((s, c, l, b) => {
378
378
  if (c === T.original || c === t.property) return !1;
379
379
  if (typeof c == "symbol")
380
380
  return Reflect.set(s, c, l, b);
381
381
  if (t.associate && r[T.internal][`${t.associate}.${c}`])
382
- return Reflect.set(r, `${t.associate}.${c}`, l, Ke(r, T.receiver, b));
383
- const v = ut(r, s, t.property, b);
382
+ return Reflect.set(r, `${t.associate}.${c}`, l, Ve(r, T.receiver, b));
383
+ const v = ft(r, s, t.property, b);
384
384
  return Reflect.set(s, c, l, v);
385
385
  }, "set"),
386
- apply: /* @__PURE__ */ P((s, c, l) => _t(i, s, c, l), "apply")
386
+ apply: /* @__PURE__ */ P((s, c, l) => St(i, s, c, l), "apply")
387
387
  });
388
388
  return i;
389
389
  }
390
- P(Ge, "createTraceable");
391
- function _t(r, e, t, n) {
390
+ P(Xe, "createTraceable");
391
+ function St(r, e, t, n) {
392
392
  return e[T.invoke] ? e[T.invoke].apply(r, n) : Reflect.apply(e, t, n);
393
393
  }
394
- P(_t, "applyTraceable");
395
- function ft(r, e, t) {
394
+ P(St, "applyTraceable");
395
+ function ht(r, e, t) {
396
396
  const n = /* @__PURE__ */ P(function(...i) {
397
- const s = Ge(n.ctx, n, t);
398
- return _t(s, n, this, i);
397
+ const s = Xe(n.ctx, n, t);
398
+ return St(s, n, this, i);
399
399
  }, "self");
400
- return X(n, "name", r), Object.setPrototypeOf(n, e);
400
+ return J(n, "name", r), Object.setPrototypeOf(n, e);
401
401
  }
402
- P(ft, "createCallable");
403
- var Xn = class Se {
402
+ P(ht, "createCallable");
403
+ var Jn = class Ee {
404
404
  constructor(e) {
405
- this.ctx = e, X(this, T.tracker, {
405
+ this.ctx = e, J(this, T.tracker, {
406
406
  associate: "reflect",
407
407
  property: "ctx"
408
408
  }), this._mixin("reflect", ["get", "set", "provide", "accessor", "mixin", "alias"]), this._mixin("scope", ["config", "runtime", "effect", "collect", "accept", "decline"]), this._mixin("registry", ["using", "inject", "plugin"]), this._mixin("lifecycle", ["on", "once", "parallel", "emit", "serial", "bail", "start", "stop"]);
@@ -427,26 +427,26 @@ var Xn = class Se {
427
427
  get: /* @__PURE__ */ P((e, t, n) => {
428
428
  if (typeof t != "string") return Reflect.get(e, t, n);
429
429
  if (Reflect.has(e, t))
430
- return ae(n, Reflect.get(e, t, n), !0);
431
- const [i, s] = Se.resolveInject(e, t), c = new Error(`property ${i} is not registered, declare it as \`inject\` to suppress this warning`);
432
- return s ? s.type === "accessor" ? s.get.call(n, n[T.receiver]) : (s.builtin || Se.checkInject(n, i, c), n.reflect.get(i)) : (Se.checkInject(n, i, c), Reflect.get(e, i, n));
430
+ return ce(n, Reflect.get(e, t, n), !0);
431
+ const [i, s] = Ee.resolveInject(e, t), c = new Error(`property ${i} is not registered, declare it as \`inject\` to suppress this warning`);
432
+ return s ? s.type === "accessor" ? s.get.call(n, n[T.receiver]) : (s.builtin || Ee.checkInject(n, i, c), n.reflect.get(i)) : (Ee.checkInject(n, i, c), Reflect.get(e, i, n));
433
433
  }, "get"),
434
434
  set: /* @__PURE__ */ P((e, t, n, i) => {
435
435
  if (typeof t != "string") return Reflect.set(e, t, n, i);
436
- const [s, c] = Se.resolveInject(e, t);
436
+ const [s, c] = Ee.resolveInject(e, t);
437
437
  return c ? c.type === "accessor" ? c.set ? c.set.call(i, n, i[T.receiver]) : !1 : (i.reflect.set(s, n), !0) : Reflect.set(e, s, n, i);
438
438
  }, "set"),
439
439
  has: /* @__PURE__ */ P((e, t) => {
440
440
  if (typeof t != "string") return Reflect.has(e, t);
441
441
  if (Reflect.has(e, t)) return !0;
442
- const [, n] = Se.resolveInject(e, t);
442
+ const [, n] = Ee.resolveInject(e, t);
443
443
  return !!n;
444
444
  }, "has")
445
445
  };
446
446
  get(e) {
447
447
  if (this.ctx[T.internal][e]?.type !== "service") return;
448
448
  const n = this.ctx[T.isolate][e], i = this.ctx[T.store][n]?.value;
449
- return ae(this.ctx, i);
449
+ return ce(this.ctx, i);
450
450
  }
451
451
  set(e, t) {
452
452
  this.provide(e);
@@ -455,10 +455,10 @@ var Xn = class Se {
455
455
  let s = /* @__PURE__ */ P(() => {
456
456
  }, "dispose");
457
457
  if (i === t) return s;
458
- if (!Y(t) && !Y(i))
458
+ if (!K(t) && !K(i))
459
459
  throw new Error(`service ${e} has been registered`);
460
460
  const c = this.ctx;
461
- Y(t) || (s = c.effect(() => () => {
461
+ K(t) || (s = c.effect(() => () => {
462
462
  c.set(e, void 0);
463
463
  })), hr(t) && c.emit(c, "internal/warning", new Error(`service ${e} is an unproxyable object, which may lead to unexpected behavior`));
464
464
  const l = Object.create(c);
@@ -468,7 +468,7 @@ var Xn = class Se {
468
468
  const i = this.ctx.root[T.internal];
469
469
  if (e in i) return;
470
470
  const s = Symbol(e);
471
- i[e] = { type: "service", builtin: n }, this.ctx.root[T.isolate][e] = s, wt(t) && (this.ctx[T.store][s] = { value: t, source: null }, X(t, T.tracker, {
471
+ i[e] = { type: "service", builtin: n }, this.ctx.root[T.isolate][e] = s, _t(t) && (this.ctx[T.store][s] = { value: t, source: null }, J(t, T.tracker, {
472
472
  associate: e,
473
473
  property: "ctx"
474
474
  }));
@@ -491,13 +491,13 @@ var Xn = class Se {
491
491
  const n = Array.isArray(t) ? t.map((c) => [c, c]) : Object.entries(t), i = typeof e == "string" ? (c) => c[e] : () => e, s = n.map(([c, l]) => this._accessor(l, {
492
492
  get(b) {
493
493
  const v = i(this);
494
- if (Y(v)) return v;
495
- const E = b ? $e(b, v) : v, w = Reflect.get(v, c, E);
496
- return typeof w != "function" ? w : w.bind(E ?? v);
494
+ if (K(v)) return v;
495
+ const S = b ? Te(b, v) : v, w = Reflect.get(v, c, S);
496
+ return typeof w != "function" ? w : w.bind(S ?? v);
497
497
  },
498
498
  set(b, v) {
499
- const E = i(this), w = v ? $e(v, E) : E;
500
- return Reflect.set(E, c, b, w);
499
+ const S = i(this), w = v ? Te(v, S) : S;
500
+ return Reflect.set(S, c, b, w);
501
501
  }
502
502
  }));
503
503
  return () => s.forEach((c) => c());
@@ -506,60 +506,60 @@ var Xn = class Se {
506
506
  this.ctx.scope.effect(() => this._mixin(e, t));
507
507
  }
508
508
  trace(e) {
509
- return ae(this.ctx, e);
509
+ return ce(this.ctx, e);
510
510
  }
511
511
  bind(e) {
512
512
  return new Proxy(e, {
513
513
  apply: /* @__PURE__ */ P((t, n, i) => t.apply(this.trace(n), i.map((s) => this.trace(s))), "apply")
514
514
  });
515
515
  }
516
- }, ht = Xn;
517
- function dt(r) {
516
+ }, dt = Jn;
517
+ function pt(r) {
518
518
  return r !== null && r !== !1 && r !== void 0;
519
519
  }
520
- P(dt, "isBailed");
521
- var Jn = class {
520
+ P(pt, "isBailed");
521
+ var Qn = class {
522
522
  constructor(r) {
523
- this.ctx = r, X(this, T.tracker, {
523
+ this.ctx = r, J(this, T.tracker, {
524
524
  associate: "lifecycle",
525
525
  property: "ctx"
526
- }), X(this.on("internal/listener", function(t, n, i) {
526
+ }), J(this.on("internal/listener", function(t, n, i) {
527
527
  const s = i.prepend ? "unshift" : "push";
528
528
  if (t === "ready")
529
529
  return this.lifecycle.isActive ? (this.scope.ensure(async () => n()), () => !1) : void 0;
530
530
  if (t === "dispose")
531
- return this.scope.disposables[s](n), X(n, "name", "event <dispose>"), () => me(this.scope.disposables, n);
531
+ return this.scope.disposables[s](n), J(n, "name", "event <dispose>"), () => ye(this.scope.disposables, n);
532
532
  if (t === "fork")
533
- return this.scope.runtime.forkables[s](n), this.scope.collect("event <fork>", () => me(this.scope.runtime.forkables, n));
534
- }), te.static, r.scope);
533
+ return this.scope.runtime.forkables[s](n), this.scope.collect("event <fork>", () => ye(this.scope.runtime.forkables, n));
534
+ }), re.static, r.scope);
535
535
  for (const t of ["info", "error", "warning"])
536
- X(this.on(`internal/${t}`, (n, ...i) => {
536
+ J(this.on(`internal/${t}`, (n, ...i) => {
537
537
  this._hooks[`internal/${t}`].length > 1;
538
- }), te.static, r.scope);
539
- X(this.on("internal/before-service", function(t) {
538
+ }), re.static, r.scope);
539
+ J(this.on("internal/before-service", function(t) {
540
540
  for (const n of this.registry.values()) {
541
541
  if (!n.inject[t]?.required) continue;
542
542
  const i = n.isReusable ? n.children : [n];
543
543
  for (const s of i)
544
544
  this[T.filter](s.ctx) && (s.updateStatus(), s.reset());
545
545
  }
546
- }, { global: !0 }), te.static, r.scope), X(this.on("internal/service", function(t) {
546
+ }, { global: !0 }), re.static, r.scope), J(this.on("internal/service", function(t) {
547
547
  for (const n of this.registry.values()) {
548
548
  if (!n.inject[t]?.required) continue;
549
549
  const i = n.isReusable ? n.children : [n];
550
550
  for (const s of i)
551
551
  this[T.filter](s.ctx) && s.start();
552
552
  }
553
- }, { global: !0 }), te.static, r.scope);
553
+ }, { global: !0 }), re.static, r.scope);
554
554
  const e = /* @__PURE__ */ P((t, n) => {
555
555
  if (!t.runtime.plugin) return !1;
556
556
  for (const i in t.runtime.inject)
557
- if (n === ht.resolveInject(t.ctx, i)[0]) return !0;
557
+ if (n === dt.resolveInject(t.ctx, i)[0]) return !0;
558
558
  return e(t.parent.scope, n);
559
559
  }, "checkInject");
560
- X(this.on("internal/inject", function(t) {
560
+ J(this.on("internal/inject", function(t) {
561
561
  return e(this.scope, t);
562
- }, { global: !0 }), te.static, r.scope);
562
+ }, { global: !0 }), re.static, r.scope);
563
563
  }
564
564
  static {
565
565
  P(this, "Lifecycle");
@@ -572,8 +572,8 @@ var Jn = class {
572
572
  await Promise.all(Array.from(this._tasks));
573
573
  }
574
574
  filterHooks(r, e) {
575
- return e = ae(this.ctx, e), r.slice().filter((t) => {
576
- const n = e?.[te.filter];
575
+ return e = ce(this.ctx, e), r.slice().filter((t) => {
576
+ const n = e?.[re.filter];
577
577
  return t.global || !n || n.call(e, t.ctx);
578
578
  });
579
579
  }
@@ -591,11 +591,11 @@ var Jn = class {
591
591
  }
592
592
  async serial(...r) {
593
593
  for await (const e of this.dispatch("serial", r))
594
- if (dt(e)) return e;
594
+ if (pt(e)) return e;
595
595
  }
596
596
  bail(...r) {
597
597
  for (const e of this.dispatch("bail", r))
598
- if (dt(e)) return e;
598
+ if (pt(e)) return e;
599
599
  }
600
600
  register(r, e, t, n) {
601
601
  const i = n.prepend ? "unshift" : "push";
@@ -631,7 +631,7 @@ var Jn = class {
631
631
  async stop() {
632
632
  this.isActive = !1, this.ctx.scope.reset();
633
633
  }
634
- }, Qn = Jn, pt = class pr extends Error {
634
+ }, Zn = Qn, mt = class pr extends Error {
635
635
  constructor(e, t) {
636
636
  super(t ?? pr.Code[e]), this.code = e;
637
637
  }
@@ -643,7 +643,7 @@ var Jn = class {
643
643
  r.Code = {
644
644
  INACTIVE_EFFECT: "cannot create effect on inactive context"
645
645
  };
646
- })(pt || (pt = {}));
646
+ })(mt || (mt = {}));
647
647
  var mr = class {
648
648
  constructor(r, e) {
649
649
  this.parent = r, this.config = e, this.uid = r.registry ? r.registry.counter : 0, this.ctx = this.context = r.extend({ scope: this }), this.proxy = new Proxy({}, {
@@ -670,20 +670,20 @@ var mr = class {
670
670
  }
671
671
  assertActive() {
672
672
  if (!(this.uid !== null || this.isActive))
673
- throw new pt("INACTIVE_EFFECT");
673
+ throw new mt("INACTIVE_EFFECT");
674
674
  }
675
675
  effect(r, e) {
676
676
  this.assertActive();
677
- const t = bt(r) ? new r(this.ctx, e) : r(this.ctx, e);
677
+ const t = vt(r) ? new r(this.ctx, e) : r(this.ctx, e);
678
678
  let n = !1;
679
679
  const i = typeof t == "function" ? t : t.dispose.bind(t), s = /* @__PURE__ */ P((...c) => {
680
680
  if (!n)
681
- return n = !0, me(this.disposables, s), i(...c);
681
+ return n = !0, ye(this.disposables, s), i(...c);
682
682
  }, "wrapped");
683
683
  return this.disposables.push(s), typeof t == "function" ? s : (t.dispose = s, t);
684
684
  }
685
685
  collect(r, e) {
686
- const t = X(() => (me(this.disposables, t), e()), "name", r);
686
+ const t = J(() => (ye(this.disposables, t), e()), "name", r);
687
687
  return this.disposables.push(t), t;
688
688
  }
689
689
  restart() {
@@ -708,11 +708,11 @@ var mr = class {
708
708
  this.error = r, this.updateStatus(() => this.hasError = !0), this.reset();
709
709
  }
710
710
  get ready() {
711
- return Object.entries(this.runtime.inject).every(([r, e]) => !e.required || !Y(this.ctx.get(r)));
711
+ return Object.entries(this.runtime.inject).every(([r, e]) => !e.required || !K(this.ctx.get(r)));
712
712
  }
713
713
  reset() {
714
714
  this.isActive = !1, this.disposables = this.disposables.splice(0).filter((r) => {
715
- if (this.uid !== null && r[te.static] === this) return !0;
715
+ if (this.uid !== null && r[re.static] === this) return !0;
716
716
  (async () => r())().catch((e) => {
717
717
  this.context.emit(this.ctx, "internal/error", e);
718
718
  });
@@ -727,7 +727,7 @@ var mr = class {
727
727
  }
728
728
  accept(...r) {
729
729
  const t = { keys: Array.isArray(r[0]) ? r.shift() : null, callback: r[0], ...r[1] };
730
- return this.effect(() => (this.acceptors.push(t), t.immediate && t.callback?.(this.config), () => me(this.acceptors, t)));
730
+ return this.effect(() => (this.acceptors.push(t), t.immediate && t.callback?.(this.config), () => ye(this.acceptors, t)));
731
731
  }
732
732
  decline(r) {
733
733
  return this.accept(r, () => !0);
@@ -736,20 +736,20 @@ var mr = class {
736
736
  if (e || !this.config) return [!0, !0];
737
737
  if (e === !1) return [!1, !1];
738
738
  const t = /* @__PURE__ */ Object.create(null), n = /* @__PURE__ */ P((b) => {
739
- const v = t[b] ??= !be(this.config[b], r[b]);
739
+ const v = t[b] ??= !ve(this.config[b], r[b]);
740
740
  return s ||= v, v;
741
741
  }, "checkPropertyUpdate"), i = /* @__PURE__ */ new Set();
742
742
  let s = !1, c = !1, l = this.runtime.isReactive || null;
743
- for (const { keys: b, callback: v, passive: E } of this.acceptors) {
743
+ for (const { keys: b, callback: v, passive: S } of this.acceptors) {
744
744
  if (!b)
745
- l ||= !E;
746
- else if (E)
747
- b?.forEach((D) => i.add(D));
745
+ l ||= !S;
746
+ else if (S)
747
+ b?.forEach((C) => i.add(C));
748
748
  else {
749
- let D = !1;
750
- for (const k of b)
751
- D ||= n(k);
752
- if (!D) continue;
749
+ let C = !1;
750
+ for (const O of b)
751
+ C ||= n(O);
752
+ if (!C) continue;
753
753
  }
754
754
  v?.(r) && (c = !0);
755
755
  }
@@ -760,13 +760,13 @@ var mr = class {
760
760
  }
761
761
  return [s, c];
762
762
  }
763
- }, Zn = class extends mr {
763
+ }, ei = class extends mr {
764
764
  constructor(r, e, t, n) {
765
- super(r, t), this.runtime = e, this.dispose = X(r.scope.collect(`fork <${r.runtime.name}>`, () => {
765
+ super(r, t), this.runtime = e, this.dispose = J(r.scope.collect(`fork <${r.runtime.name}>`, () => {
766
766
  this.uid = null, this.reset(), this.context.emit("internal/fork", this);
767
- const i = me(e.disposables, this.dispose);
768
- return me(e.children, this) && !e.children.length && r.registry.delete(e.plugin), i;
769
- }), te.static, e), e.children.push(this), e.disposables.push(this.dispose), this.context.emit("internal/fork", this), this.init(n);
767
+ const i = ye(e.disposables, this.dispose);
768
+ return ye(e.children, this) && !e.children.length && r.registry.delete(e.plugin), i;
769
+ }), re.static, e), e.children.push(this), e.disposables.push(this.dispose), this.context.emit("internal/fork", this), this.init(n);
770
770
  }
771
771
  static {
772
772
  P(this, "ForkScope");
@@ -782,7 +782,7 @@ var mr = class {
782
782
  if (n.config !== t) return;
783
783
  let i;
784
784
  try {
785
- i = Pe(this.runtime.plugin, r);
785
+ i = Ne(this.runtime.plugin, r);
786
786
  } catch (l) {
787
787
  return this.context.emit("internal/error", l), this.cancel(l);
788
788
  }
@@ -809,20 +809,20 @@ var mr = class {
809
809
  return this.forkables.length > 0;
810
810
  }
811
811
  fork(r, e, t) {
812
- return new Zn(r, this, e, t);
812
+ return new ei(r, this, e, t);
813
813
  }
814
814
  dispose() {
815
815
  return this.uid = null, this.reset(), this.context.emit("internal/runtime", this), !0;
816
816
  }
817
817
  setup() {
818
818
  const { name: r } = this.plugin;
819
- r && r !== "apply" && (this.name = r), this.schema = this.plugin.Config || this.plugin.schema, this.inject = Te.resolve(this.plugin.using || this.plugin.inject), this.isReusable = this.plugin.reusable, this.isReactive = this.plugin.reactive, this.context.emit("internal/runtime", this), this.isReusable && this.forkables.push(this.apply);
819
+ r && r !== "apply" && (this.name = r), this.schema = this.plugin.Config || this.plugin.schema, this.inject = De.resolve(this.plugin.using || this.plugin.inject), this.isReusable = this.plugin.reusable, this.isReactive = this.plugin.reactive, this.context.emit("internal/runtime", this), this.isReusable && this.forkables.push(this.apply);
820
820
  }
821
821
  apply = /* @__PURE__ */ P((r, e) => {
822
822
  if (typeof this.plugin != "function")
823
823
  return this.plugin.apply(r, e);
824
- if (bt(this.plugin)) {
825
- const t = new this.plugin(r, e), n = t[te.expose];
824
+ if (vt(this.plugin)) {
825
+ const t = new this.plugin(r, e), n = t[re.expose];
826
826
  return n && r.set(n, t), t.fork && this.forkables.push(t.fork.bind(t)), t;
827
827
  } else
828
828
  return this.plugin(r, e);
@@ -846,7 +846,7 @@ var mr = class {
846
846
  const t = this.config;
847
847
  let n;
848
848
  try {
849
- n = Pe(this.runtime.plugin || this.context.constructor, r);
849
+ n = Ne(this.runtime.plugin || this.context.constructor, r);
850
850
  } catch (l) {
851
851
  return this.context.emit("internal/error", l), this.cancel(l);
852
852
  }
@@ -858,7 +858,7 @@ function yr(r) {
858
858
  return r && typeof r == "object" && typeof r.apply == "function";
859
859
  }
860
860
  P(yr, "isApplicable");
861
- function Te(r) {
861
+ function De(r) {
862
862
  return function(e, t) {
863
863
  if (t.kind === "class")
864
864
  e.inject = r;
@@ -867,14 +867,14 @@ function Te(r) {
867
867
  const n = this[T.tracker]?.property;
868
868
  if (!n) throw new Error("missing context tracker");
869
869
  this[n].inject(r, (i) => {
870
- e.call($e(this, { [n]: i }));
870
+ e.call(Te(this, { [n]: i }));
871
871
  });
872
872
  });
873
873
  else
874
874
  throw new Error("@Inject can only be used on class or class methods");
875
875
  };
876
876
  }
877
- P(Te, "Inject");
877
+ P(De, "Inject");
878
878
  ((r) => {
879
879
  function e(t) {
880
880
  if (!t) return {};
@@ -884,10 +884,10 @@ P(Te, "Inject");
884
884
  return Array.isArray(n) && Object.assign(s, Object.fromEntries(n.map((c) => [c, { required: !0 }]))), Array.isArray(i) && Object.assign(s, Object.fromEntries(i.map((c) => [c, { required: !1 }]))), s;
885
885
  }
886
886
  r.resolve = e, P(e, "resolve");
887
- })(Te || (Te = {}));
888
- var ei = class {
887
+ })(De || (De = {}));
888
+ var ti = class {
889
889
  constructor(r, e) {
890
- this.ctx = r, X(this, T.tracker, {
890
+ this.ctx = r, J(this, T.tracker, {
891
891
  associate: "registry",
892
892
  property: "ctx"
893
893
  }), this.context = r;
@@ -949,14 +949,14 @@ var ei = class {
949
949
  plugin(r, e, t) {
950
950
  if (this.resolve(r, !0), this.ctx.scope.assertActive(), !t)
951
951
  try {
952
- e = Pe(r, e);
952
+ e = Ne(r, e);
953
953
  } catch (i) {
954
954
  this.context.emit(this.ctx, "internal/error", i), t = i, e = null;
955
955
  }
956
956
  let n = this.get(r);
957
957
  return n ? (n.isForkable || this.context.emit(this.ctx, "internal/warning", new Error(`duplicate plugin detected: ${r.name}`)), n.fork(this.ctx, e, t)) : (n = new Jt(this.ctx, r, e, t), this.set(r, n), n.fork(this.ctx, e, t));
958
958
  }
959
- }, ti = ei, te = class Re {
959
+ }, ri = ti, re = class Ae {
960
960
  static {
961
961
  P(this, "Context");
962
962
  }
@@ -971,25 +971,25 @@ var ei = class {
971
971
  static origin = "ctx";
972
972
  static current = "ctx";
973
973
  static is(e) {
974
- return !!e?.[Re.is];
974
+ return !!e?.[Ae.is];
975
975
  }
976
976
  static {
977
- Re.is[Symbol.toPrimitive] = () => Symbol.for("cordis.is"), Re.prototype[Re.is] = !0;
977
+ Ae.is[Symbol.toPrimitive] = () => Symbol.for("cordis.is"), Ae.prototype[Ae.is] = !0;
978
978
  }
979
979
  /** @deprecated use `Service.traceable` instead */
980
980
  static associate(e, t) {
981
981
  return e;
982
982
  }
983
983
  constructor(e) {
984
- e = Pe(this.constructor, e), this[T.store] = /* @__PURE__ */ Object.create(null), this[T.isolate] = /* @__PURE__ */ Object.create(null), this[T.internal] = /* @__PURE__ */ Object.create(null), this[T.intercept] = /* @__PURE__ */ Object.create(null);
985
- const t = new Proxy(this, ht.handler);
986
- t.root = t, t.reflect = new ht(t), t.registry = new ti(t, e), t.lifecycle = new Qn(t);
984
+ e = Ne(this.constructor, e), this[T.store] = /* @__PURE__ */ Object.create(null), this[T.isolate] = /* @__PURE__ */ Object.create(null), this[T.internal] = /* @__PURE__ */ Object.create(null), this[T.intercept] = /* @__PURE__ */ Object.create(null);
985
+ const t = new Proxy(this, dt.handler);
986
+ t.root = t, t.reflect = new dt(t), t.registry = new ri(t, e), t.lifecycle = new Zn(t);
987
987
  const n = /* @__PURE__ */ P((i) => {
988
988
  if (i) {
989
989
  n(Object.getPrototypeOf(i));
990
990
  for (const s of Object.getOwnPropertyNames(i)) {
991
991
  const c = i[s].prototype?.constructor;
992
- c && (t[i[s].key] = new c(t, e), X(t[i[s].key], "ctx", t));
992
+ c && (t[i[s].key] = new c(t, e), J(t[i[s].key], "ctx", t));
993
993
  }
994
994
  }
995
995
  }, "attach");
@@ -1012,7 +1012,7 @@ var ei = class {
1012
1012
  return this.scope;
1013
1013
  }
1014
1014
  extend(e = {}) {
1015
- const t = Reflect.getOwnPropertyDescriptor(this, T.shadow)?.value, n = Object.assign(Object.create(ae(this, this)), e);
1015
+ const t = Reflect.getOwnPropertyDescriptor(this, T.shadow)?.value, n = Object.assign(Object.create(ce(this, this)), e);
1016
1016
  return t ? Object.assign(Object.create(n), { [T.shadow]: t }) : n;
1017
1017
  }
1018
1018
  isolate(e, t) {
@@ -1024,8 +1024,8 @@ var ei = class {
1024
1024
  return n[e] = t, this.extend({ [T.intercept]: n });
1025
1025
  }
1026
1026
  };
1027
- te.prototype[te.internal] = /* @__PURE__ */ Object.create(null);
1028
- var Xe = class gr {
1027
+ re.prototype[re.internal] = /* @__PURE__ */ Object.create(null);
1028
+ var Je = class gr {
1029
1029
  static {
1030
1030
  P(this, "Service");
1031
1031
  }
@@ -1044,13 +1044,13 @@ var Xe = class gr {
1044
1044
  config;
1045
1045
  constructor(...e) {
1046
1046
  let t, n, i, s;
1047
- te.is(e[0]) ? (t = e[0], typeof e[1] == "string" ? (n = e[1], i = e[2]) : s = e[1]) : s = e[0], n ??= this.constructor[T.provide], i ??= this.constructor[T.immediate];
1047
+ re.is(e[0]) ? (t = e[0], typeof e[1] == "string" ? (n = e[1], i = e[2]) : s = e[1]) : s = e[0], n ??= this.constructor[T.provide], i ??= this.constructor[T.immediate];
1048
1048
  let c = this;
1049
1049
  const l = {
1050
1050
  associate: n,
1051
1051
  property: "ctx"
1052
1052
  };
1053
- return c[T.invoke] && (c = ft(n, vt(Object.getPrototypeOf(this), Function.prototype), l)), t ? c.ctx = t : c[T.setup](), c.name = n, c.config = s, X(c, T.tracker, l), c.ctx.provide(n), c.ctx.runtime.name = n, i && (t ? c[T.expose] = n : c.ctx.set(n, c)), c.ctx.on("ready", async () => {
1053
+ return c[T.invoke] && (c = ht(n, wt(Object.getPrototypeOf(this), Function.prototype), l)), t ? c.ctx = t : c[T.setup](), c.name = n, c.config = s, J(c, T.tracker, l), c.ctx.provide(n), c.ctx.runtime.name = n, i && (t ? c[T.expose] = n : c.ctx.set(n, c)), c.ctx.on("ready", async () => {
1054
1054
  await Promise.resolve(), await c.start(), i || c.ctx.set(n, c);
1055
1055
  }), c.ctx.on("dispose", () => c.stop()), c;
1056
1056
  }
@@ -1058,11 +1058,11 @@ var Xe = class gr {
1058
1058
  return e[T.isolate][this.name] === this.ctx[T.isolate][this.name];
1059
1059
  }
1060
1060
  [T.setup]() {
1061
- this.ctx = new te();
1061
+ this.ctx = new re();
1062
1062
  }
1063
1063
  [T.extend](e) {
1064
1064
  let t;
1065
- return this[gr.invoke] ? t = ft(this.name, this, this[T.tracker]) : t = Object.create(this), Object.assign(t, e);
1065
+ return this[gr.invoke] ? t = ht(this.name, this, this[T.tracker]) : t = Object.create(this), Object.assign(t, e);
1066
1066
  }
1067
1067
  static [Symbol.hasInstance](e) {
1068
1068
  let t = e.constructor;
@@ -1072,9 +1072,9 @@ var Xe = class gr {
1072
1072
  }
1073
1073
  return !1;
1074
1074
  }
1075
- }, ri = Object.defineProperty, ni = Object.getOwnPropertyNames, M = (r, e) => ri(r, "name", { value: e, configurable: !0 }), ii = (r, e) => function() {
1076
- return e || (0, r[ni(r)[0]])((e = { exports: {} }).exports, e), e.exports;
1077
- }, si = ii({
1075
+ }, ni = Object.defineProperty, ii = Object.getOwnPropertyNames, U = (r, e) => ni(r, "name", { value: e, configurable: !0 }), si = (r, e) => function() {
1076
+ return e || (0, r[ii(r)[0]])((e = { exports: {} }).exports, e), e.exports;
1077
+ }, oi = si({
1078
1078
  "src/index.ts"(r, e) {
1079
1079
  var t = Symbol.for("schemastery"), n = Symbol.for("ValidationError");
1080
1080
  globalThis.__schemastery_index__ ??= 0;
@@ -1086,7 +1086,7 @@ var Xe = class gr {
1086
1086
  y.startsWith(".") && (y = y.slice(1)), super((y === "$" ? "" : `${y} `) + u), this.options = d;
1087
1087
  }
1088
1088
  static {
1089
- M(this, "ValidationError");
1089
+ U(this, "ValidationError");
1090
1090
  }
1091
1091
  name = "ValidationError";
1092
1092
  static is(u) {
@@ -1096,15 +1096,15 @@ var Xe = class gr {
1096
1096
  Object.defineProperty(i.prototype, n, {
1097
1097
  value: !0
1098
1098
  });
1099
- var s = /* @__PURE__ */ M(function(u) {
1100
- const d = /* @__PURE__ */ M(function(y, h = {}) {
1099
+ var s = /* @__PURE__ */ U(function(u) {
1100
+ const d = /* @__PURE__ */ U(function(y, h = {}) {
1101
1101
  return s.resolve(y, d, h)[0];
1102
1102
  }, "schema");
1103
1103
  if (u.refs) {
1104
- const y = fe(u.refs, (_) => new s(_)), h = /* @__PURE__ */ M((_) => y[_], "getRef");
1104
+ const y = he(u.refs, (_) => new s(_)), h = /* @__PURE__ */ U((_) => y[_], "getRef");
1105
1105
  for (const _ in y) {
1106
1106
  const x = y[_];
1107
- x.sKey = h(x.sKey), x.inner = h(x.inner), x.list = x.list && x.list.map(h), x.dict = x.dict && fe(x.dict, h);
1107
+ x.sKey = h(x.sKey), x.inner = h(x.inner), x.list = x.list && x.list.map(h), x.dict = x.dict && he(x.dict, h);
1108
1108
  }
1109
1109
  return y[u.uid];
1110
1110
  }
@@ -1117,15 +1117,15 @@ var Xe = class gr {
1117
1117
  }, "Schema");
1118
1118
  s.prototype = Object.create(Function.prototype), s.prototype[t] = !0, s.ValidationError = i;
1119
1119
  var c;
1120
- s.prototype.toJSON = /* @__PURE__ */ M(function() {
1120
+ s.prototype.toJSON = /* @__PURE__ */ U(function() {
1121
1121
  if (c)
1122
1122
  return c[this.uid] ??= JSON.parse(JSON.stringify({ ...this })), this.uid;
1123
1123
  c = { [this.uid]: { ...this } }, c[this.uid] = JSON.parse(JSON.stringify({ ...this }));
1124
1124
  const d = { uid: this.uid, refs: c };
1125
1125
  return c = void 0, d;
1126
- }, "toJSON"), s.prototype.set = /* @__PURE__ */ M(function(d, y) {
1126
+ }, "toJSON"), s.prototype.set = /* @__PURE__ */ U(function(d, y) {
1127
1127
  return this.dict[d] = y, this;
1128
- }, "set"), s.prototype.push = /* @__PURE__ */ M(function(d) {
1128
+ }, "set"), s.prototype.push = /* @__PURE__ */ U(function(d) {
1129
1129
  return this.list.push(d), this;
1130
1130
  }, "push");
1131
1131
  function l(u, d) {
@@ -1136,18 +1136,18 @@ var Xe = class gr {
1136
1136
  }
1137
1137
  return y;
1138
1138
  }
1139
- M(l, "mergeDesc");
1139
+ U(l, "mergeDesc");
1140
1140
  function b(u) {
1141
1141
  return u?.$value ?? u?.$inner;
1142
1142
  }
1143
- M(b, "getInner");
1143
+ U(b, "getInner");
1144
1144
  function v(u) {
1145
1145
  return cr(u ?? {}, (d) => !d.startsWith("$"));
1146
1146
  }
1147
- M(v, "extractKeys"), s.prototype.i18n = /* @__PURE__ */ M(function(d) {
1147
+ U(v, "extractKeys"), s.prototype.i18n = /* @__PURE__ */ U(function(d) {
1148
1148
  const y = s(this), h = l(y.meta.description, d);
1149
- return Object.keys(h).length && (y.meta.description = h), y.dict && (y.dict = fe(y.dict, (_, x) => _.i18n(fe(d, (I) => b(I)?.[x] ?? I?.[x])))), y.list && (y.list = y.list.map((_, x) => _.i18n(fe(d, (I = {}) => Array.isArray(b(I)) ? b(I)[x] : Array.isArray(I) ? I[x] : v(I))))), y.inner && (y.inner = y.inner.i18n(fe(d, (_) => b(_) ? b(_) : v(_)))), y.sKey && (y.sKey = y.sKey.i18n(fe(d, (_) => _?.$key))), y;
1150
- }, "i18n"), s.prototype.extra = /* @__PURE__ */ M(function(d, y) {
1149
+ return Object.keys(h).length && (y.meta.description = h), y.dict && (y.dict = he(y.dict, (_, x) => _.i18n(he(d, (I) => b(I)?.[x] ?? I?.[x])))), y.list && (y.list = y.list.map((_, x) => _.i18n(he(d, (I = {}) => Array.isArray(b(I)) ? b(I)[x] : Array.isArray(I) ? I[x] : v(I))))), y.inner && (y.inner = y.inner.i18n(he(d, (_) => b(_) ? b(_) : v(_)))), y.sKey && (y.sKey = y.sKey.i18n(he(d, (_) => _?.$key))), y;
1150
+ }, "i18n"), s.prototype.extra = /* @__PURE__ */ U(function(d, y) {
1151
1151
  const h = s(this);
1152
1152
  return h.meta = { ...h.meta, [d]: y }, h;
1153
1153
  }, "extra");
@@ -1158,25 +1158,25 @@ var Xe = class gr {
1158
1158
  return y.meta = { ...y.meta, [u]: d }, y;
1159
1159
  }
1160
1160
  });
1161
- s.prototype.deprecated = /* @__PURE__ */ M(function() {
1161
+ s.prototype.deprecated = /* @__PURE__ */ U(function() {
1162
1162
  const d = s(this);
1163
1163
  return d.meta.badges ||= [], d.meta.badges.push({ text: "deprecated", type: "danger" }), d;
1164
- }, "deprecated"), s.prototype.experimental = /* @__PURE__ */ M(function() {
1164
+ }, "deprecated"), s.prototype.experimental = /* @__PURE__ */ U(function() {
1165
1165
  const d = s(this);
1166
1166
  return d.meta.badges ||= [], d.meta.badges.push({ text: "experimental", type: "warning" }), d;
1167
- }, "experimental"), s.prototype.pattern = /* @__PURE__ */ M(function(d) {
1167
+ }, "experimental"), s.prototype.pattern = /* @__PURE__ */ U(function(d) {
1168
1168
  const y = s(this), h = lr(d, ["source", "flags"]);
1169
1169
  return y.meta = { ...y.meta, pattern: h }, y;
1170
- }, "pattern"), s.prototype.simplify = /* @__PURE__ */ M(function(d) {
1171
- if (be(d, this.meta.default, this.type === "dict")) return null;
1172
- if (Y(d)) return d;
1170
+ }, "pattern"), s.prototype.simplify = /* @__PURE__ */ U(function(d) {
1171
+ if (ve(d, this.meta.default, this.type === "dict")) return null;
1172
+ if (K(d)) return d;
1173
1173
  if (this.type === "object" || this.type === "dict") {
1174
1174
  const y = {};
1175
1175
  for (const h in d) {
1176
1176
  const x = (this.type === "object" ? this.dict[h] : this.inner)?.simplify(d[h]);
1177
- (this.type === "dict" || !Y(x)) && (y[h] = x);
1177
+ (this.type === "dict" || !K(x)) && (y[h] = x);
1178
1178
  }
1179
- return be(y, this.meta.default, this.type === "dict") ? null : y;
1179
+ return ve(y, this.meta.default, this.type === "dict") ? null : y;
1180
1180
  } else if (this.type === "array" || this.type === "tuple") {
1181
1181
  const y = [];
1182
1182
  return d.forEach((h, _) => {
@@ -1195,9 +1195,9 @@ var Xe = class gr {
1195
1195
  } catch {
1196
1196
  }
1197
1197
  return d;
1198
- }, "simplify"), s.prototype.toString = /* @__PURE__ */ M(function(d) {
1198
+ }, "simplify"), s.prototype.toString = /* @__PURE__ */ U(function(d) {
1199
1199
  return H[this.type]?.(this, d) ?? `Schema<${this.type}>`;
1200
- }, "toString"), s.prototype.role = /* @__PURE__ */ M(function(u, d) {
1200
+ }, "toString"), s.prototype.role = /* @__PURE__ */ U(function(u, d) {
1201
1201
  const y = s(this);
1202
1202
  return y.meta = { ...y.meta, role: u, extra: d }, y;
1203
1203
  }, "role");
@@ -1208,21 +1208,21 @@ var Xe = class gr {
1208
1208
  return y.meta = { ...y.meta, [u]: d }, y;
1209
1209
  }
1210
1210
  });
1211
- var E = {};
1212
- s.extend = /* @__PURE__ */ M(function(d, y) {
1213
- E[d] = y;
1214
- }, "extend"), s.resolve = /* @__PURE__ */ M(function(d, y, h = {}, _ = !1) {
1211
+ var S = {};
1212
+ s.extend = /* @__PURE__ */ U(function(d, y) {
1213
+ S[d] = y;
1214
+ }, "extend"), s.resolve = /* @__PURE__ */ U(function(d, y, h = {}, _ = !1) {
1215
1215
  if (!y) return [d];
1216
1216
  if (h.ignore?.(d, y)) return [d];
1217
- if (Y(d) && y.type !== "lazy") {
1217
+ if (K(d) && y.type !== "lazy") {
1218
1218
  if (y.meta.required) throw new i("missing required value", h);
1219
1219
  let I = y, N = y.meta.default;
1220
- for (; I?.type === "intersect" && Y(N); )
1220
+ for (; I?.type === "intersect" && K(N); )
1221
1221
  I = I.list[0], N = I?.meta.default;
1222
- if (Y(N)) return [d];
1223
- d = Ye(N);
1222
+ if (K(N)) return [d];
1223
+ d = Ke(N);
1224
1224
  }
1225
- const x = E[y.type];
1225
+ const x = S[y.type];
1226
1226
  if (!x) throw new i(`unsupported type "${y.type}"`, h);
1227
1227
  try {
1228
1228
  return x(d, y, h, _);
@@ -1230,8 +1230,8 @@ var Xe = class gr {
1230
1230
  if (!y.meta.loose) throw I;
1231
1231
  return [y.meta.default];
1232
1232
  }
1233
- }, "resolve"), s.from = /* @__PURE__ */ M(function(d) {
1234
- if (Y(d))
1233
+ }, "resolve"), s.from = /* @__PURE__ */ U(function(d) {
1234
+ if (K(d))
1235
1235
  return s.any();
1236
1236
  if (["string", "number", "boolean"].includes(typeof d))
1237
1237
  return s.const(d).required();
@@ -1252,14 +1252,14 @@ var Xe = class gr {
1252
1252
  }
1253
1253
  else
1254
1254
  throw new TypeError(`cannot infer schema from ${d}`);
1255
- }, "from"), s.lazy = /* @__PURE__ */ M(function(d) {
1256
- const y = /* @__PURE__ */ M(() => (h.inner[t] || (h.inner = h.builder(), h.inner.meta = { ...h.meta, ...h.inner.meta }), h.inner.toJSON()), "toJSON"), h = new s({ type: "lazy", builder: d, inner: { toJSON: y } });
1255
+ }, "from"), s.lazy = /* @__PURE__ */ U(function(d) {
1256
+ const y = /* @__PURE__ */ U(() => (h.inner[t] || (h.inner = h.builder(), h.inner.meta = { ...h.meta, ...h.inner.meta }), h.inner.toJSON()), "toJSON"), h = new s({ type: "lazy", builder: d, inner: { toJSON: y } });
1257
1257
  return h;
1258
- }, "lazy"), s.natural = /* @__PURE__ */ M(function() {
1258
+ }, "lazy"), s.natural = /* @__PURE__ */ U(function() {
1259
1259
  return s.number().step(1).min(0);
1260
- }, "natural"), s.percent = /* @__PURE__ */ M(function() {
1260
+ }, "natural"), s.percent = /* @__PURE__ */ U(function() {
1261
1261
  return s.number().step(0.01).min(0).max(1).role("slider");
1262
- }, "percent"), s.date = /* @__PURE__ */ M(function() {
1262
+ }, "percent"), s.date = /* @__PURE__ */ U(function() {
1263
1263
  return s.union([
1264
1264
  s.is(Date),
1265
1265
  s.transform(s.string().role("datetime"), (d, y) => {
@@ -1268,7 +1268,7 @@ var Xe = class gr {
1268
1268
  return h;
1269
1269
  }, !0)
1270
1270
  ]);
1271
- }, "date"), s.regExp = /* @__PURE__ */ M(function(d = "") {
1271
+ }, "date"), s.regExp = /* @__PURE__ */ U(function(d = "") {
1272
1272
  return s.union([
1273
1273
  s.is(RegExp),
1274
1274
  s.transform(s.string().role("regexp", { flag: d }), (y, h) => {
@@ -1279,17 +1279,17 @@ var Xe = class gr {
1279
1279
  }
1280
1280
  }, !0)
1281
1281
  ]);
1282
- }, "regExp"), s.arrayBuffer = /* @__PURE__ */ M(function(d) {
1282
+ }, "regExp"), s.arrayBuffer = /* @__PURE__ */ U(function(d) {
1283
1283
  return s.union([
1284
1284
  s.is(ArrayBuffer),
1285
1285
  s.is(SharedArrayBuffer),
1286
1286
  s.transform(s.any(), (y, h) => {
1287
- if (oe.isSource(y)) return oe.fromSource(y);
1287
+ if (ae.isSource(y)) return ae.fromSource(y);
1288
1288
  throw new i(`expected ArrayBufferSource but got ${y}`, h);
1289
1289
  }, !0),
1290
1290
  ...d ? [s.transform(s.string(), (y, h) => {
1291
1291
  try {
1292
- return d === "base64" ? oe.fromBase64(y) : oe.fromHex(y);
1292
+ return d === "base64" ? ae.fromBase64(y) : ae.fromHex(y);
1293
1293
  } catch (_) {
1294
1294
  throw new i(_.message, h);
1295
1295
  }
@@ -1298,7 +1298,7 @@ var Xe = class gr {
1298
1298
  }, "arrayBuffer"), s.extend("lazy", (u, d, y, h) => (d.inner[t] || (d.inner = d.builder(), d.inner.meta = { ...d.meta, ...d.inner.meta }), s.resolve(u, d.inner, y, h))), s.extend("any", (u) => [u]), s.extend("never", (u, d, y) => {
1299
1299
  throw new i(`expected nullable but got ${u}`, y);
1300
1300
  }), s.extend("const", (u, { value: d }, y) => {
1301
- if (be(u, d)) return [d];
1301
+ if (ve(u, d)) return [d];
1302
1302
  throw new i(`expected ${d} but got ${u}`, y);
1303
1303
  });
1304
1304
  function w(u, d, y, h, _ = !1) {
@@ -1306,7 +1306,7 @@ var Xe = class gr {
1306
1306
  if (u > x) throw new i(`expected ${y} <= ${x} but got ${u}`, h);
1307
1307
  if (u < I && !_) throw new i(`expected ${y} >= ${I} but got ${u}`, h);
1308
1308
  }
1309
- M(w, "checkWithinRange"), s.extend("string", (u, { meta: d }, y) => {
1309
+ U(w, "checkWithinRange"), s.extend("string", (u, { meta: d }, y) => {
1310
1310
  if (typeof u != "string") throw new i(`expected string but got ${u}`, y);
1311
1311
  if (d.pattern) {
1312
1312
  const h = new RegExp(d.pattern.source, d.pattern.flags);
@@ -1314,7 +1314,7 @@ var Xe = class gr {
1314
1314
  }
1315
1315
  return w(u.length, d, "string length", y), [u];
1316
1316
  });
1317
- function D(u, d) {
1317
+ function C(u, d) {
1318
1318
  const y = u.toString();
1319
1319
  if (y.includes("e")) return u * Math.pow(10, d);
1320
1320
  const h = y.indexOf(".");
@@ -1322,18 +1322,18 @@ var Xe = class gr {
1322
1322
  const _ = y.slice(h + 1), x = y.slice(0, h);
1323
1323
  return _.length <= d ? +(x + _.padEnd(d, "0")) : +(x + _.slice(0, d) + "." + _.slice(d));
1324
1324
  }
1325
- M(D, "decimalShift");
1326
- function k(u, d, y) {
1325
+ U(C, "decimalShift");
1326
+ function O(u, d, y) {
1327
1327
  if (y = Math.abs(y), !/^\d+\.\d+$/.test(y.toString()))
1328
1328
  return (u - d) % y === 0;
1329
1329
  const h = y.toString().indexOf("."), _ = y.toString().slice(h + 1).length;
1330
- return Math.abs(D(u, _) - D(d, _)) % D(y, _) === 0;
1330
+ return Math.abs(C(u, _) - C(d, _)) % C(y, _) === 0;
1331
1331
  }
1332
- M(k, "isMultipleOf"), s.extend("number", (u, { meta: d }, y) => {
1332
+ U(O, "isMultipleOf"), s.extend("number", (u, { meta: d }, y) => {
1333
1333
  if (typeof u != "number") throw new i(`expected number but got ${u}`, y);
1334
1334
  w(u, d, "number", y);
1335
1335
  const { step: h } = d;
1336
- if (h && !k(u, d.min ?? 0, h))
1336
+ if (h && !O(u, d.min ?? 0, h))
1337
1337
  throw new i(`expected number multiple of ${h} but got ${u}`, y);
1338
1338
  return [u];
1339
1339
  }), s.extend("boolean", (u, d, y) => {
@@ -1362,7 +1362,7 @@ var Xe = class gr {
1362
1362
  if (u instanceof d) return [u];
1363
1363
  throw new i(`expected ${d.name} but got ${u}`, y);
1364
1364
  } else {
1365
- if (Y(u))
1365
+ if (K(u))
1366
1366
  throw new i(`expected ${d} but got ${u}`, y);
1367
1367
  let h = Object.getPrototypeOf(u);
1368
1368
  for (; h; ) {
@@ -1372,7 +1372,7 @@ var Xe = class gr {
1372
1372
  throw new i(`expected ${d} but got ${u}`, y);
1373
1373
  }
1374
1374
  });
1375
- function L(u, d, y, h) {
1375
+ function D(u, d, y, h) {
1376
1376
  try {
1377
1377
  const [_, x] = s.resolve(u[d], y, {
1378
1378
  ...h,
@@ -1384,38 +1384,38 @@ var Xe = class gr {
1384
1384
  return delete u[d], y.meta.default;
1385
1385
  }
1386
1386
  }
1387
- M(L, "property"), s.extend("array", (u, { inner: d, meta: y }, h) => {
1387
+ U(D, "property"), s.extend("array", (u, { inner: d, meta: y }, h) => {
1388
1388
  if (!Array.isArray(u)) throw new i(`expected array but got ${u}`, h);
1389
- return w(u.length, y, "array length", h, !Y(d.meta.default)), [u.map((_, x) => L(u, x, d, h))];
1389
+ return w(u.length, y, "array length", h, !K(d.meta.default)), [u.map((_, x) => D(u, x, d, h))];
1390
1390
  }), s.extend("dict", (u, { inner: d, sKey: y }, h, _) => {
1391
- if (!He(u)) throw new i(`expected object but got ${u}`, h);
1391
+ if (!We(u)) throw new i(`expected object but got ${u}`, h);
1392
1392
  const x = {};
1393
1393
  for (const I in u) {
1394
1394
  let N;
1395
1395
  try {
1396
1396
  N = s.resolve(I, y, h)[0];
1397
- } catch (J) {
1397
+ } catch (Q) {
1398
1398
  if (_) continue;
1399
- throw J;
1399
+ throw Q;
1400
1400
  }
1401
- x[N] = L(u, I, d, h), u[N] = u[I], I !== N && delete u[I];
1401
+ x[N] = D(u, I, d, h), u[N] = u[I], I !== N && delete u[I];
1402
1402
  }
1403
1403
  return [x];
1404
1404
  }), s.extend("tuple", (u, { list: d }, y, h) => {
1405
1405
  if (!Array.isArray(u)) throw new i(`expected array but got ${u}`, y);
1406
- const _ = d.map((x, I) => L(u, I, x, y));
1406
+ const _ = d.map((x, I) => D(u, I, x, y));
1407
1407
  return h ? [_] : (_.push(...u.slice(d.length)), [_]);
1408
1408
  });
1409
1409
  function q(u, d) {
1410
1410
  for (const y in d)
1411
1411
  y in u || (u[y] = d[y]);
1412
1412
  }
1413
- M(q, "merge"), s.extend("object", (u, { dict: d }, y, h) => {
1414
- if (!He(u)) throw new i(`expected object but got ${u}`, y);
1413
+ U(q, "merge"), s.extend("object", (u, { dict: d }, y, h) => {
1414
+ if (!We(u)) throw new i(`expected object but got ${u}`, y);
1415
1415
  const _ = {};
1416
1416
  for (const x in d) {
1417
- const I = L(u, x, d[x], y);
1418
- (!Y(I) || x in u) && (_[x] = I);
1417
+ const I = D(u, x, d[x], y);
1418
+ (!K(I) || x in u) && (_[x] = I);
1419
1419
  }
1420
1420
  return h || q(_, u), [_];
1421
1421
  }), s.extend("union", (u, { list: d, toString: y }, h, _) => {
@@ -1430,8 +1430,8 @@ var Xe = class gr {
1430
1430
  let x;
1431
1431
  for (const I of d) {
1432
1432
  const N = s.resolve(u, I, h, !0)[0];
1433
- if (!Y(N))
1434
- if (Y(x))
1433
+ if (!K(N))
1434
+ if (K(x))
1435
1435
  x = N;
1436
1436
  else {
1437
1437
  if (typeof x != typeof N)
@@ -1442,13 +1442,13 @@ var Xe = class gr {
1442
1442
  throw new i(`expected ${y()} but got ${JSON.stringify(u)}`, h);
1443
1443
  }
1444
1444
  }
1445
- return !_ && He(u) && q(x, u), [x];
1445
+ return !_ && We(u) && q(x, u), [x];
1446
1446
  }), s.extend("transform", (u, { inner: d, callback: y, preserve: h }, _) => {
1447
1447
  const [x, I = u] = s.resolve(u, d, _, !0);
1448
1448
  return h ? [y(x)] : [y(x), y(I)];
1449
1449
  });
1450
1450
  var H = {};
1451
- function U(u, d, y) {
1451
+ function M(u, d, y) {
1452
1452
  H[u] = y, Object.assign(s, {
1453
1453
  [u](...h) {
1454
1454
  const _ = new s({ type: u });
@@ -1464,7 +1464,7 @@ var Xe = class gr {
1464
1464
  _.list = h[I].map(s.from);
1465
1465
  break;
1466
1466
  case "dict":
1467
- _.dict = fe(h[I], s.from);
1467
+ _.dict = he(h[I], s.from);
1468
1468
  break;
1469
1469
  case "bits": {
1470
1470
  _.bits = {};
@@ -1489,13 +1489,13 @@ var Xe = class gr {
1489
1489
  }
1490
1490
  });
1491
1491
  }
1492
- M(U, "defineMethod"), U("is", ["constructor"], ({ constructor: u }) => typeof u == "function" ? u.name : u), U("any", [], () => "any"), U("never", [], () => "never"), U("const", ["value"], ({ value: u }) => typeof u == "string" ? JSON.stringify(u) : u), U("string", [], () => "string"), U("number", [], () => "number"), U("boolean", [], () => "boolean"), U("bitset", ["bits"], () => "bitset"), U("function", [], () => "function"), U("array", ["inner"], ({ inner: u }) => `${u.toString(!0)}[]`), U("dict", ["inner", "sKey"], ({ inner: u, sKey: d }) => `{ [key: ${d.toString()}]: ${u.toString()} }`), U("tuple", ["list"], ({ list: u }) => `[${u.map((d) => d.toString()).join(", ")}]`), U("object", ["dict"], ({ dict: u }) => Object.keys(u).length === 0 ? "{}" : `{ ${Object.entries(u).map(([d, y]) => `${d}${y.meta.required ? "" : "?"}: ${y.toString()}`).join(", ")} }`), U("union", ["list"], ({ list: u }, d) => {
1492
+ U(M, "defineMethod"), M("is", ["constructor"], ({ constructor: u }) => typeof u == "function" ? u.name : u), M("any", [], () => "any"), M("never", [], () => "never"), M("const", ["value"], ({ value: u }) => typeof u == "string" ? JSON.stringify(u) : u), M("string", [], () => "string"), M("number", [], () => "number"), M("boolean", [], () => "boolean"), M("bitset", ["bits"], () => "bitset"), M("function", [], () => "function"), M("array", ["inner"], ({ inner: u }) => `${u.toString(!0)}[]`), M("dict", ["inner", "sKey"], ({ inner: u, sKey: d }) => `{ [key: ${d.toString()}]: ${u.toString()} }`), M("tuple", ["list"], ({ list: u }) => `[${u.map((d) => d.toString()).join(", ")}]`), M("object", ["dict"], ({ dict: u }) => Object.keys(u).length === 0 ? "{}" : `{ ${Object.entries(u).map(([d, y]) => `${d}${y.meta.required ? "" : "?"}: ${y.toString()}`).join(", ")} }`), M("union", ["list"], ({ list: u }, d) => {
1493
1493
  const y = u.map(({ toString: h }) => h()).join(" | ");
1494
1494
  return d ? `(${y})` : y;
1495
- }), U("intersect", ["list"], ({ list: u }) => `${u.map((d) => d.toString(!0)).join(" & ")}`), U("transform", ["inner", "callback", "preserve"], ({ inner: u }, d) => u.toString(d)), e.exports = s;
1495
+ }), M("intersect", ["list"], ({ list: u }) => `${u.map((d) => d.toString(!0)).join(" & ")}`), M("transform", ["inner", "callback", "preserve"], ({ inner: u }, d) => u.toString(d)), e.exports = s;
1496
1496
  }
1497
1497
  });
1498
- const oi = si();
1498
+ const ai = oi();
1499
1499
  /**
1500
1500
  * @inpageedit/logger
1501
1501
  *
@@ -1505,9 +1505,9 @@ const oi = si();
1505
1505
  * @license MIT
1506
1506
  */
1507
1507
  var br = /* @__PURE__ */ ((r) => (r[r.debug = -1] = "debug", r[r.log = 0] = "log", r[r.info = 1] = "info", r[r.warn = 2] = "warn", r[r.error = 3] = "error", r[r.silent = 4] = "silent", r))(br || {});
1508
- const mt = globalThis || window, yt = Symbol.for("__IPE_LOGGER_COLOR_MAP__");
1509
- mt[yt] || (mt[yt] = /* @__PURE__ */ new Map());
1510
- const at = mt[yt];
1508
+ const yt = globalThis || window, gt = Symbol.for("__IPE_LOGGER_COLOR_MAP__");
1509
+ yt[gt] || (yt[gt] = /* @__PURE__ */ new Map());
1510
+ const ct = yt[gt];
1511
1511
  function Ue(r) {
1512
1512
  let e = 2166136261;
1513
1513
  for (let t = 0; t < r.length; t++)
@@ -1526,24 +1526,24 @@ const Qt = [
1526
1526
  [140, 160],
1527
1527
  [160, 180]
1528
1528
  ];
1529
- function ai(r, e) {
1530
- const t = Qt.length, n = Ue(r) % t, [i, s] = Qt[n], c = s - i, l = Ue(r + ":" + e), b = i + l % (c || 1), v = Ue(r + ":s"), E = Ue(r + ":l");
1531
- let w, D;
1529
+ function ci(r, e) {
1530
+ const t = Qt.length, n = Ue(r) % t, [i, s] = Qt[n], c = s - i, l = Ue(r + ":" + e), b = i + l % (c || 1), v = Ue(r + ":s"), S = Ue(r + ":l");
1531
+ let w, C;
1532
1532
  if (e === "name")
1533
- w = 62 + v % 18, D = 30 + E % 12;
1533
+ w = 62 + v % 18, C = 30 + S % 12;
1534
1534
  else {
1535
- const k = b >= 0 && b < 50 || b > 330 && b < 360, L = b >= 200 && b <= 300;
1536
- w = 55 + v % 20, L ? D = 55 + E % 8 : k ? D = 48 + E % 6 : D = 50 + E % 8, w < 60 && (w += 5);
1535
+ const O = b >= 0 && b < 50 || b > 330 && b < 360, D = b >= 200 && b <= 300;
1536
+ w = 55 + v % 20, D ? C = 55 + S % 8 : O ? C = 48 + S % 6 : C = 50 + S % 8, w < 60 && (w += 5);
1537
1537
  }
1538
- return `hsl(${b}, ${w}%, ${D}%)`;
1538
+ return `hsl(${b}, ${w}%, ${C}%)`;
1539
1539
  }
1540
- function Me(r, e) {
1540
+ function Fe(r, e) {
1541
1541
  if (e)
1542
- return at.set(r, e), e;
1543
- const t = at.get(r);
1542
+ return ct.set(r, e), e;
1543
+ const t = ct.get(r);
1544
1544
  if (t) return t;
1545
- const n = r.startsWith("name:") ? "name" : "group", i = ai(r, n);
1546
- return at.set(r, i), i;
1545
+ const n = r.startsWith("name:") ? "name" : "group", i = ci(r, n);
1546
+ return ct.set(r, i), i;
1547
1547
  }
1548
1548
  /**
1549
1549
  * @inpageedit/logger
@@ -1565,7 +1565,7 @@ function Me(r, e) {
1565
1565
  * logger.success('User created successfully')
1566
1566
  * ```
1567
1567
  */
1568
- let ci = class vr {
1568
+ let li = class vr {
1569
1569
  /**
1570
1570
  * Note: constructor returns a callable Proxy so that you can do `logger('group')`.
1571
1571
  */
@@ -1577,10 +1577,10 @@ let ci = class vr {
1577
1577
  }, this._name = e.name, this._nameColor = e.color, this._groupPath = e._groupPath ? [...e._groupPath] : [], this._dynamicLevels = { ...e._dynamicLevels }, this._levelRef = e._levelRef ?? {
1578
1578
  value: e.level ?? 1
1579
1579
  /* info */
1580
- }, this._name && Me(`name:${this._name}`, this._nameColor), this._installBuiltinLevels();
1580
+ }, this._name && Fe(`name:${this._name}`, this._nameColor), this._installBuiltinLevels();
1581
1581
  for (const t of Object.keys(this._dynamicLevels))
1582
1582
  this._installLevelGetter(t, this._dynamicLevels[t]);
1583
- return ui(this);
1583
+ return fi(this);
1584
1584
  }
1585
1585
  // ---------- public API ----------
1586
1586
  get level() {
@@ -1591,7 +1591,7 @@ let ci = class vr {
1591
1591
  }
1592
1592
  /** Create a sub-logger with a group label */
1593
1593
  group(e, t) {
1594
- return e && Me(`group:${e}`, t?.color), new vr({
1594
+ return e && Fe(`group:${e}`, t?.color), new vr({
1595
1595
  name: this._name,
1596
1596
  color: this._nameColor,
1597
1597
  _groupPath: [...this._groupPath, e],
@@ -1630,7 +1630,7 @@ let ci = class vr {
1630
1630
  });
1631
1631
  }
1632
1632
  _method(e) {
1633
- const t = li[e];
1633
+ const t = ui[e];
1634
1634
  if (!this._enabled(t.level)) return Zt;
1635
1635
  const [n, i] = this._prefix(t.label);
1636
1636
  return this._consoleMethod(e).bind(console, n, ...i);
@@ -1645,28 +1645,28 @@ let ci = class vr {
1645
1645
  const t = [];
1646
1646
  let n = "";
1647
1647
  if (this._name) {
1648
- const i = Me(`name:${this._name}`, this._nameColor);
1648
+ const i = Fe(`name:${this._name}`, this._nameColor);
1649
1649
  n += `%c${this._name}%c`, t.push(
1650
1650
  `background:${i}; color:#fff; padding:1px 4px; border-radius:2px; font-weight:700;`,
1651
1651
  er
1652
1652
  );
1653
1653
  }
1654
1654
  if (e && (n += ` ${e}`), this._groupPath.length) {
1655
- const i = this._groupPath.join("/"), s = Me(`group:${i}`);
1655
+ const i = this._groupPath.join("/"), s = Fe(`group:${i}`);
1656
1656
  n += ` %c${i}%c`, t.push(`color:${s}; text-decoration: underline;`, er);
1657
1657
  }
1658
1658
  return [n, t];
1659
1659
  }
1660
1660
  };
1661
1661
  const Zt = () => {
1662
- }, er = "color:inherit; background:transparent; text-decoration:none;", li = {
1662
+ }, er = "color:inherit; background:transparent; text-decoration:none;", ui = {
1663
1663
  debug: { level: -1, label: "", method: "debug" },
1664
1664
  log: { level: 0, label: "", method: "log" },
1665
1665
  info: { level: 1, label: "[I]", method: "info" },
1666
1666
  warn: { level: 2, label: "[W]", method: "warn" },
1667
1667
  error: { level: 3, label: "[E]", method: "error" }
1668
1668
  };
1669
- function ui(r) {
1669
+ function fi(r) {
1670
1670
  const e = function(t, n) {
1671
1671
  return r.group(t, n);
1672
1672
  };
@@ -1685,21 +1685,21 @@ function ui(r) {
1685
1685
  }
1686
1686
  });
1687
1687
  }
1688
- function fi(r) {
1689
- return new ci(r);
1688
+ function hi(r) {
1689
+ return new li(r);
1690
1690
  }
1691
- var re = /* @__PURE__ */ ((r) => (r.BODY_USED = "BODY_USED", r.NO_BODY_READER = "NO_BODY_READER", r.TIMEOUT = "TIMEOUT", r.NETWORK_ERROR = "NETWORK_ERROR", r.BODY_NOT_ALLOWED = "BODY_NOT_ALLOWED", r.HOOK_CONTEXT_CHANGED = "HOOK_CONTEXT_CHANGED", r.ABORTED_BY_HOOK = "ABORTED_BY_HOOK", r.INVALID_HOOK_CALLBACK = "INVALID_HOOK_CALLBACK", r.UNEXPECTED_HOOK_RETURN = "UNEXPECTED_HOOK_RETURN", r))(re || {});
1692
- class ee extends Error {
1691
+ var ne = /* @__PURE__ */ ((r) => (r.BODY_USED = "BODY_USED", r.NO_BODY_READER = "NO_BODY_READER", r.TIMEOUT = "TIMEOUT", r.NETWORK_ERROR = "NETWORK_ERROR", r.BODY_NOT_ALLOWED = "BODY_NOT_ALLOWED", r.HOOK_CONTEXT_CHANGED = "HOOK_CONTEXT_CHANGED", r.ABORTED_BY_HOOK = "ABORTED_BY_HOOK", r.INVALID_HOOK_CALLBACK = "INVALID_HOOK_CALLBACK", r.UNEXPECTED_HOOK_RETURN = "UNEXPECTED_HOOK_RETURN", r))(ne || {});
1692
+ class te extends Error {
1693
1693
  constructor(e, t, n, i) {
1694
1694
  super(t, i), this.code = e, this.context = n, this.name = "FexiosError";
1695
1695
  }
1696
1696
  }
1697
- class hi extends ee {
1697
+ class di extends te {
1698
1698
  constructor(e, t, n) {
1699
1699
  super(t.statusText, e, void 0, n), this.response = t, this.name = "FexiosResponseError";
1700
1700
  }
1701
1701
  }
1702
- function di(r, e = 2048) {
1702
+ function pi(r, e = 2048) {
1703
1703
  if (!(r instanceof Uint8Array))
1704
1704
  throw new TypeError("Input must be a Uint8Array");
1705
1705
  if (r.length === 0)
@@ -1708,23 +1708,23 @@ function di(r, e = 2048) {
1708
1708
  Math.max(r.length, 256),
1709
1709
  e
1710
1710
  ), n = r.slice(0, t);
1711
- if (pi(n))
1711
+ if (mi(n))
1712
1712
  return !1;
1713
- const i = mi(n);
1713
+ const i = yi(n);
1714
1714
  if (i.nullByteRatio > 0.05 || i.highByteRatio > 0.95)
1715
1715
  return !1;
1716
1716
  const s = ["utf-8", "utf-16le", "utf-16be", "iso-8859-1"];
1717
1717
  let c = -1, l = !1;
1718
1718
  for (const b of s)
1719
1719
  try {
1720
- const v = new TextDecoder(b, { fatal: !0 }).decode(n), E = yi(v);
1721
- E > c && (c = E, l = E > 0.7);
1720
+ const v = new TextDecoder(b, { fatal: !0 }).decode(n), S = gi(v);
1721
+ S > c && (c = S, l = S > 0.7);
1722
1722
  } catch {
1723
1723
  continue;
1724
1724
  }
1725
1725
  return l;
1726
1726
  }
1727
- function pi(r) {
1727
+ function mi(r) {
1728
1728
  if (r.length < 4) return !1;
1729
1729
  const e = [
1730
1730
  [137, 80, 78, 71],
@@ -1764,7 +1764,7 @@ function pi(r) {
1764
1764
  }
1765
1765
  return !1;
1766
1766
  }
1767
- function mi(r) {
1767
+ function yi(r) {
1768
1768
  let e = 0, t = 0, n = 0;
1769
1769
  for (const i of r)
1770
1770
  i === 0 && e++, i > 127 && t++, (i < 32 && i !== 9 && i !== 10 && i !== 13 || i === 127) && n++;
@@ -1774,23 +1774,23 @@ function mi(r) {
1774
1774
  controlCharRatio: n / r.length
1775
1775
  };
1776
1776
  }
1777
- function yi(r) {
1777
+ function gi(r) {
1778
1778
  if (r.length === 0) return 1;
1779
1779
  let e = 1, t = 0;
1780
1780
  for (let i = 0; i < r.length; i++) {
1781
1781
  const s = r[i].charCodeAt(0);
1782
- s >= 32 && s <= 126 || s === 9 || s === 10 || s === 13 || s === 32 ? t++ : s > 127 && s < 65534 ? !gi(s) && !bi(s) && t++ : e -= 0.1;
1782
+ s >= 32 && s <= 126 || s === 9 || s === 10 || s === 13 || s === 32 ? t++ : s > 127 && s < 65534 ? !bi(s) && !vi(s) && t++ : e -= 0.1;
1783
1783
  }
1784
1784
  const n = t / r.length;
1785
- return e *= n, vi(r) && (e *= 1.1), Math.max(0, Math.min(1, e));
1785
+ return e *= n, wi(r) && (e *= 1.1), Math.max(0, Math.min(1, e));
1786
1786
  }
1787
- function gi(r) {
1787
+ function bi(r) {
1788
1788
  return r >= 0 && r <= 31 || r >= 127 && r <= 159;
1789
1789
  }
1790
- function bi(r) {
1790
+ function vi(r) {
1791
1791
  return r >= 57344 && r <= 63743 || r >= 983040 && r <= 1048573 || r >= 1048576 && r <= 1114109;
1792
1792
  }
1793
- function vi(r) {
1793
+ function wi(r) {
1794
1794
  return [
1795
1795
  /\b\w+\b/,
1796
1796
  // Words
@@ -1818,86 +1818,86 @@ function tr(r, e = {}) {
1818
1818
  i != null && (e.dropEmptyString && i === "" || (t[n] = i));
1819
1819
  }), t;
1820
1820
  }
1821
- class Ae {
1821
+ class Ie {
1822
1822
  constructor(e, t, n) {
1823
1823
  this.rawResponse = e, this.data = t, this.ok = e.ok, this.status = e.status, this.statusText = e.statusText, this.headers = e.headers, Object.entries(n || {}).forEach(([i, s]) => {
1824
1824
  this[i] = s;
1825
1825
  });
1826
1826
  }
1827
1827
  }
1828
- async function wi(r, e, t) {
1828
+ async function _i(r, e, t) {
1829
1829
  var n;
1830
1830
  if (r.bodyUsed)
1831
- throw new ee(
1832
- re.BODY_USED,
1831
+ throw new te(
1832
+ ne.BODY_USED,
1833
1833
  "Response body has already been used or locked"
1834
1834
  );
1835
- const i = r.headers.get("content-type") || "", s = Number(r.headers.get("content-length")) || 0, c = (b, v) => v === "json" || b.startsWith("application/json"), l = (b, v, E) => E === "blob" || b.startsWith("image/") && !b.startsWith("image/svg") || b.startsWith("video/") || b.startsWith("audio/") || !di(v);
1835
+ const i = r.headers.get("content-type") || "", s = Number(r.headers.get("content-length")) || 0, c = (b, v) => v === "json" || b.startsWith("application/json"), l = (b, v, S) => S === "blob" || b.startsWith("image/") && !b.startsWith("image/svg") || b.startsWith("video/") || b.startsWith("audio/") || !pi(v);
1836
1836
  if ((r.status === 101 || r.status === 426 || r.headers.get("upgrade")) && typeof globalThis.WebSocket < "u") {
1837
1837
  const b = new WebSocket(r.url);
1838
- return await new Promise((v, E) => {
1839
- b.onopen = v, b.onerror = E;
1840
- }), new Ae(r, b, {
1838
+ return await new Promise((v, S) => {
1839
+ b.onopen = v, b.onerror = S;
1840
+ }), new Ie(r, b, {
1841
1841
  ok: !0,
1842
1842
  status: 101,
1843
1843
  statusText: "Switching Protocols"
1844
1844
  });
1845
1845
  } else if (i.startsWith("text/event-stream") && !["text", "json"].includes(e || "") && typeof globalThis.EventSource < "u") {
1846
1846
  const b = new EventSource(r.url);
1847
- return await new Promise((v, E) => {
1848
- b.onopen = v, b.onerror = E;
1849
- }), new Ae(r, b);
1847
+ return await new Promise((v, S) => {
1848
+ b.onopen = v, b.onerror = S;
1849
+ }), new Ie(r, b);
1850
1850
  } else {
1851
1851
  if (e === "stream")
1852
- return new Ae(
1852
+ return new Ie(
1853
1853
  r,
1854
1854
  r.body
1855
1855
  );
1856
1856
  {
1857
1857
  const b = (n = r.clone().body) == null ? void 0 : n.getReader();
1858
1858
  if (!b)
1859
- throw new ee(
1860
- re.NO_BODY_READER,
1859
+ throw new te(
1860
+ ne.NO_BODY_READER,
1861
1861
  "Failed to get ReadableStream from response body"
1862
1862
  );
1863
1863
  let v = new Uint8Array();
1864
1864
  for (; ; ) {
1865
- const { done: w, value: D } = await b.read();
1865
+ const { done: w, value: C } = await b.read();
1866
1866
  if (w) break;
1867
- if (D && (v = new Uint8Array([...v, ...D]), t && s > 0)) {
1868
- const k = Math.min(v.length / s, 1);
1869
- t(k, v);
1867
+ if (C && (v = new Uint8Array([...v, ...C]), t && s > 0)) {
1868
+ const O = Math.min(v.length / s, 1);
1869
+ t(O, v);
1870
1870
  }
1871
1871
  }
1872
- const E = new Ae(r, void 0);
1872
+ const S = new Ie(r, void 0);
1873
1873
  if (e === "arrayBuffer")
1874
- return E.data = v.buffer, E;
1874
+ return S.data = v.buffer, S;
1875
1875
  if (c(i, e))
1876
1876
  try {
1877
1877
  const w = new TextDecoder().decode(v);
1878
- E.data = JSON.parse(w);
1878
+ S.data = JSON.parse(w);
1879
1879
  } catch {
1880
1880
  }
1881
- if (typeof E.data != "string" && l(i, v, e) ? E.data = new Blob([v], {
1881
+ if (typeof S.data != "string" && l(i, v, e) ? S.data = new Blob([v], {
1882
1882
  type: r.headers.get("content-type") || void 0
1883
- }) : E.data = new TextDecoder().decode(v), typeof E.data == "string" && e !== "text") {
1884
- const w = E.data.trim(), D = w[0], k = w[w.length - 1];
1885
- if (D === "{" && k === "}" || D === "[" && k === "]")
1883
+ }) : S.data = new TextDecoder().decode(v), typeof S.data == "string" && e !== "text") {
1884
+ const w = S.data.trim(), C = w[0], O = w[w.length - 1];
1885
+ if (C === "{" && O === "}" || C === "[" && O === "]")
1886
1886
  try {
1887
- E.data = JSON.parse(E.data);
1887
+ S.data = JSON.parse(S.data);
1888
1888
  } catch {
1889
1889
  }
1890
1890
  }
1891
- if (typeof E.data > "u" && (E.data = v.length > 0 ? v : void 0), E.ok)
1892
- return E;
1893
- throw new hi(
1891
+ if (typeof S.data > "u" && (S.data = v.length > 0 ? v : void 0), S.ok)
1892
+ return S;
1893
+ throw new di(
1894
1894
  `Request failed with status code ${r.status}`,
1895
- E
1895
+ S
1896
1896
  );
1897
1897
  }
1898
1898
  }
1899
1899
  }
1900
- class _i {
1900
+ class Si {
1901
1901
  /**
1902
1902
  * Build URLSearchParams from a record object with proper array handling
1903
1903
  * @param query - The query object containing key-value pairs
@@ -1918,12 +1918,12 @@ class _i {
1918
1918
  return this.makeSearchParams(e).toString();
1919
1919
  }
1920
1920
  }
1921
- function Si(r) {
1921
+ function Ei(r) {
1922
1922
  return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
1923
1923
  }
1924
- var ct, rr;
1925
- function Ei() {
1926
- if (rr) return ct;
1924
+ var lt, rr;
1925
+ function xi() {
1926
+ if (rr) return lt;
1927
1927
  rr = 1;
1928
1928
  function r(e) {
1929
1929
  var t = this.constructor.prototype[e], n = function() {
@@ -1933,53 +1933,53 @@ function Ei() {
1933
1933
  Object.defineProperty(n, i, Object.getOwnPropertyDescriptor(t, i));
1934
1934
  }), n;
1935
1935
  }
1936
- return r.prototype = Object.create(Function.prototype), ct = r, ct;
1936
+ return r.prototype = Object.create(Function.prototype), lt = r, lt;
1937
1937
  }
1938
- var xi = Ei();
1939
- const Oi = /* @__PURE__ */ Si(xi), ze = class pe extends Oi {
1938
+ var ki = xi();
1939
+ const Oi = /* @__PURE__ */ Ei(ki), Ye = class me extends Oi {
1940
1940
  constructor(e = {}) {
1941
1941
  super("request"), this.baseConfigs = e, this.hooks = [], this.interceptors = {
1942
1942
  request: this.createInterceptor("beforeRequest"),
1943
1943
  response: this.createInterceptor("afterResponse")
1944
- }, this.create = pe.create, this.dropUndefinedAndNull = tr, this.checkIsPlainObject = qe, e = { ...pe.DEFAULT_CONFIGS, ...e }, pe.ALL_METHODS.forEach(this.createMethodShortcut.bind(this));
1944
+ }, this.create = me.create, this.dropUndefinedAndNull = tr, this.checkIsPlainObject = qe, e = { ...me.DEFAULT_CONFIGS, ...e }, me.ALL_METHODS.forEach(this.createMethodShortcut.bind(this));
1945
1945
  }
1946
1946
  async request(e, t) {
1947
1947
  var n, i, s, c;
1948
1948
  let l = t = t || {};
1949
1949
  typeof e == "string" || e instanceof URL ? l.url = e.toString() : typeof e == "object" && (l = { ...e, ...l }), l = await this.emit("beforeInit", l);
1950
- const b = t.baseURL || this.baseConfigs.baseURL || ((n = globalThis.location) == null ? void 0 : n.href), v = b ? new URL(b, (i = globalThis.location) == null ? void 0 : i.href) : void 0, E = new URL(l.url.toString(), v);
1951
- l.url = E.href, l.baseURL = v ? v.href : E.origin, l.headers = this.mergeHeaders(
1950
+ const b = t.baseURL || this.baseConfigs.baseURL || ((n = globalThis.location) == null ? void 0 : n.href), v = b ? new URL(b, (i = globalThis.location) == null ? void 0 : i.href) : void 0, S = new URL(l.url.toString(), v);
1951
+ l.url = S.href, l.baseURL = v ? v.href : S.origin, l.headers = this.mergeHeaders(
1952
1952
  this.baseConfigs.headers,
1953
1953
  t.headers
1954
1954
  );
1955
- const w = v?.searchParams, D = new URLSearchParams(E.searchParams);
1956
- if (E.search = "", l.url = E.href, l.query = this.mergeQuery(
1955
+ const w = v?.searchParams, C = new URLSearchParams(S.searchParams);
1956
+ if (S.search = "", l.url = S.href, l.query = this.mergeQuery(
1957
1957
  w,
1958
1958
  // baseURL query (lowest priority)
1959
1959
  this.baseConfigs.query,
1960
1960
  // defaultOptions (baseOptions)
1961
- D,
1961
+ C,
1962
1962
  // requestURL query (urlParams)
1963
1963
  t.query
1964
1964
  // requestOptions (highest priority)
1965
- ), E.search = _i.makeQueryString(l.query), l.url = E.toString(), pe.METHODS_WITHOUT_BODY.includes(
1965
+ ), S.search = Si.makeQueryString(l.query), l.url = S.toString(), me.METHODS_WITHOUT_BODY.includes(
1966
1966
  (s = l.method) == null ? void 0 : s.toLocaleLowerCase()
1967
1967
  ) && l.body)
1968
- throw new ee(
1969
- re.BODY_NOT_ALLOWED,
1968
+ throw new te(
1969
+ ne.BODY_NOT_ALLOWED,
1970
1970
  `Request method "${l.method}" does not allow body`
1971
1971
  );
1972
1972
  l = await this.emit("beforeRequest", l);
1973
- let k;
1974
- typeof l.body < "u" && l.body !== null && (l.body instanceof Blob || l.body instanceof FormData || l.body instanceof URLSearchParams ? k = l.body : typeof l.body == "object" && l.body !== null ? (k = JSON.stringify(l.body), l.headers["content-type"] = "application/json") : k = l.body), !((c = t.headers) != null && c["content-type"]) && k && (k instanceof FormData || k instanceof URLSearchParams ? delete l.headers["content-type"] : typeof k == "string" && typeof l.body == "object" ? l.headers["content-type"] = "application/json" : k instanceof Blob && (l.headers["content-type"] = k.type)), l.body = k, l = await this.emit("afterBodyTransformed", l);
1975
- const L = l.abortController || globalThis.AbortController ? new AbortController() : void 0, q = new Request(l.url, {
1973
+ let O;
1974
+ typeof l.body < "u" && l.body !== null && (l.body instanceof Blob || l.body instanceof FormData || l.body instanceof URLSearchParams ? O = l.body : typeof l.body == "object" && l.body !== null ? (O = JSON.stringify(l.body), l.headers["content-type"] = "application/json") : O = l.body), !((c = t.headers) != null && c["content-type"]) && O && (O instanceof FormData || O instanceof URLSearchParams ? delete l.headers["content-type"] : typeof O == "string" && typeof l.body == "object" ? l.headers["content-type"] = "application/json" : O instanceof Blob && (l.headers["content-type"] = O.type)), l.body = O, l = await this.emit("afterBodyTransformed", l);
1975
+ const D = l.abortController || globalThis.AbortController ? new AbortController() : void 0, q = new Request(l.url, {
1976
1976
  method: l.method || "GET",
1977
1977
  credentials: l.credentials,
1978
1978
  cache: l.cache,
1979
1979
  mode: l.mode,
1980
1980
  headers: l.headers,
1981
1981
  body: l.body,
1982
- signal: L?.signal
1982
+ signal: D?.signal
1983
1983
  });
1984
1984
  l.rawRequest = q, l = await this.emit("beforeActualFetch", l);
1985
1985
  const H = l.timeout || this.baseConfigs.timeout || 60 * 1e3;
@@ -1989,8 +1989,8 @@ const Oi = /* @__PURE__ */ Si(xi), ze = class pe extends Oi {
1989
1989
  return await new Promise((d, y) => {
1990
1990
  const h = setTimeout(() => {
1991
1991
  y(
1992
- new ee(
1993
- re.TIMEOUT,
1992
+ new te(
1993
+ ne.TIMEOUT,
1994
1994
  `WebSocket connection timed out after ${H}ms`,
1995
1995
  l
1996
1996
  )
@@ -2000,46 +2000,46 @@ const Oi = /* @__PURE__ */ Si(xi), ze = class pe extends Oi {
2000
2000
  clearTimeout(h), d();
2001
2001
  }, u.onerror = (_) => {
2002
2002
  clearTimeout(h), y(
2003
- new ee(
2004
- re.NETWORK_ERROR,
2003
+ new te(
2004
+ ne.NETWORK_ERROR,
2005
2005
  "WebSocket connection failed",
2006
2006
  l
2007
2007
  )
2008
2008
  );
2009
2009
  }, u.onclose = (_) => {
2010
2010
  _.code !== 1e3 && (clearTimeout(h), y(
2011
- new ee(
2012
- re.NETWORK_ERROR,
2011
+ new te(
2012
+ ne.NETWORK_ERROR,
2013
2013
  `WebSocket closed with code ${_.code}`,
2014
2014
  l
2015
2015
  )
2016
2016
  ));
2017
2017
  };
2018
- }), l.rawResponse = new Response(), l.response = new Ae(l.rawResponse, u, {
2018
+ }), l.rawResponse = new Response(), l.response = new Ie(l.rawResponse, u, {
2019
2019
  ok: !0,
2020
2020
  status: 101,
2021
2021
  statusText: "Switching Protocols"
2022
2022
  }), l.data = u, l.headers = new Headers(), this.emit("afterResponse", l);
2023
2023
  } catch (u) {
2024
- throw u instanceof ee ? u : new ee(
2025
- re.NETWORK_ERROR,
2024
+ throw u instanceof te ? u : new te(
2025
+ ne.NETWORK_ERROR,
2026
2026
  `WebSocket creation failed: ${u}`,
2027
2027
  l
2028
2028
  );
2029
2029
  }
2030
- let U;
2030
+ let M;
2031
2031
  try {
2032
- L && (U = setTimeout(() => {
2033
- L.abort();
2032
+ D && (M = setTimeout(() => {
2033
+ D.abort();
2034
2034
  }, H));
2035
2035
  const u = await (t.fetch || this.baseConfigs.fetch || globalThis.fetch)(l.rawRequest).catch((d) => {
2036
- throw U && clearTimeout(U), L != null && L.signal.aborted ? new ee(
2037
- re.TIMEOUT,
2036
+ throw M && clearTimeout(M), D != null && D.signal.aborted ? new te(
2037
+ ne.TIMEOUT,
2038
2038
  `Request timed out after ${H}ms`,
2039
2039
  l
2040
- ) : new ee(re.NETWORK_ERROR, d.message, l);
2040
+ ) : new te(ne.NETWORK_ERROR, d.message, l);
2041
2041
  });
2042
- return U && clearTimeout(U), l.rawResponse = u, l.response = await wi(
2042
+ return M && clearTimeout(M), l.rawResponse = u, l.response = await _i(
2043
2043
  u,
2044
2044
  l.responseType,
2045
2045
  (d, y) => {
@@ -2048,7 +2048,7 @@ const Oi = /* @__PURE__ */ Si(xi), ze = class pe extends Oi {
2048
2048
  }
2049
2049
  ), l.data = l.response.data, l.headers = l.response.headers, this.emit("afterResponse", l);
2050
2050
  } catch (u) {
2051
- throw U && clearTimeout(U), u;
2051
+ throw M && clearTimeout(M), u;
2052
2052
  }
2053
2053
  }
2054
2054
  mergeQuery(e, ...t) {
@@ -2088,8 +2088,8 @@ const Oi = /* @__PURE__ */ Si(xi), ze = class pe extends Oi {
2088
2088
  t[l] = l;
2089
2089
  let b = await s.action.call(this, t);
2090
2090
  if (b === void 0 && (b = t), b === !1)
2091
- throw new ee(
2092
- re.ABORTED_BY_HOOK,
2091
+ throw new te(
2092
+ ne.ABORTED_BY_HOOK,
2093
2093
  `Request aborted by hook "${c}"`,
2094
2094
  t
2095
2095
  );
@@ -2098,12 +2098,12 @@ const Oi = /* @__PURE__ */ Si(xi), ze = class pe extends Oi {
2098
2098
  else {
2099
2099
  const v = globalThis["".concat("console")];
2100
2100
  try {
2101
- throw new ee(
2102
- re.HOOK_CONTEXT_CHANGED,
2101
+ throw new te(
2102
+ ne.HOOK_CONTEXT_CHANGED,
2103
2103
  `Hook "${c}" should return the original FexiosContext or return false to abort the request, but got "${b}".`
2104
2104
  );
2105
- } catch (E) {
2106
- v.warn(E.stack || E);
2105
+ } catch (S) {
2106
+ v.warn(S.stack || S);
2107
2107
  }
2108
2108
  }
2109
2109
  delete t[l], i++;
@@ -2115,8 +2115,8 @@ const Oi = /* @__PURE__ */ Si(xi), ze = class pe extends Oi {
2115
2115
  }
2116
2116
  on(e, t, n = !1) {
2117
2117
  if (typeof t != "function")
2118
- throw new ee(
2119
- re.INVALID_HOOK_CALLBACK,
2118
+ throw new te(
2119
+ ne.INVALID_HOOK_CALLBACK,
2120
2120
  `Hook should be a function, but got "${typeof t}"`
2121
2121
  );
2122
2122
  return this.hooks[n ? "unshift" : "push"]({
@@ -2140,7 +2140,7 @@ const Oi = /* @__PURE__ */ Si(xi), ze = class pe extends Oi {
2140
2140
  }
2141
2141
  createMethodShortcut(e) {
2142
2142
  return Object.defineProperty(this, e, {
2143
- value: (t, n, i) => (pe.METHODS_WITHOUT_BODY.includes(
2143
+ value: (t, n, i) => (me.METHODS_WITHOUT_BODY.includes(
2144
2144
  e.toLocaleLowerCase()
2145
2145
  ) ? i = n : (i = i || {}, i.body = n), this.request(t, {
2146
2146
  ...i,
@@ -2149,14 +2149,14 @@ const Oi = /* @__PURE__ */ Si(xi), ze = class pe extends Oi {
2149
2149
  }), this;
2150
2150
  }
2151
2151
  extends(e) {
2152
- const t = new pe({ ...this.baseConfigs, ...e });
2152
+ const t = new me({ ...this.baseConfigs, ...e });
2153
2153
  return t.hooks = [...this.hooks], t;
2154
2154
  }
2155
2155
  static create(e) {
2156
- return new pe(e);
2156
+ return new me(e);
2157
2157
  }
2158
2158
  };
2159
- ze.DEFAULT_CONFIGS = {
2159
+ Ye.DEFAULT_CONFIGS = {
2160
2160
  baseURL: "",
2161
2161
  timeout: 60 * 1e3,
2162
2162
  credentials: "same-origin",
@@ -2164,7 +2164,7 @@ ze.DEFAULT_CONFIGS = {
2164
2164
  query: {},
2165
2165
  responseType: void 0,
2166
2166
  fetch: globalThis.fetch
2167
- }, ze.ALL_METHODS = [
2167
+ }, Ye.ALL_METHODS = [
2168
2168
  "get",
2169
2169
  "post",
2170
2170
  "put",
@@ -2173,13 +2173,13 @@ ze.DEFAULT_CONFIGS = {
2173
2173
  "head",
2174
2174
  "options",
2175
2175
  "trace"
2176
- ], ze.METHODS_WITHOUT_BODY = [
2176
+ ], Ye.METHODS_WITHOUT_BODY = [
2177
2177
  "get",
2178
2178
  "head",
2179
2179
  "options",
2180
2180
  "trace"
2181
2181
  ];
2182
- let wr = ze;
2182
+ let wr = Ye;
2183
2183
  /**
2184
2184
  * Fexios
2185
2185
  * @desc Fetch based HTTP client with similar API to axios for browser and Node.js
@@ -2187,7 +2187,7 @@ let wr = ze;
2187
2187
  * @license MIT
2188
2188
  * @author dragon-fish <dragon-fish@qq.com>
2189
2189
  */
2190
- const ki = wr.create, nr = ki();
2190
+ const Ri = wr.create, nr = Ri();
2191
2191
  typeof globalThis < "u" ? globalThis.fexios = nr : typeof window < "u" && (window.fexios = nr);
2192
2192
  /**
2193
2193
  * MediaWiki Api
@@ -2196,21 +2196,21 @@ typeof globalThis < "u" ? globalThis.fexios = nr : typeof window < "u" && (windo
2196
2196
  * @author Dragon-Fish <dragon-fish@qq.com>
2197
2197
  * @license MIT
2198
2198
  */
2199
- const _r = class G {
2199
+ const _r = class X {
2200
2200
  constructor(e, t, n) {
2201
- if (this.baseURL = e, this.version = "5.2.0", this.normalizeParamValue = G.normalizeParamValue, this.normalizeBody = G.normalizeBody, this.isMediaWikiApiError = G.isMediaWikiApiError, this.extractMediaWikiErrors = G.extractMediaWikiErrors, this.isBadTokenError = G.isBadTokenError, !e && typeof window == "object" && window.mediaWiki) {
2201
+ if (this.baseURL = e, this.version = "5.2.0", this.normalizeParamValue = X.normalizeParamValue, this.normalizeBody = X.normalizeBody, this.isMediaWikiApiError = X.isMediaWikiApiError, this.extractMediaWikiErrors = X.extractMediaWikiErrors, this.isBadTokenError = X.isBadTokenError, !e && typeof window == "object" && window.mediaWiki) {
2202
2202
  const { wgServer: i, wgScriptPath: s } = window.mediaWiki?.config?.get(["wgServer", "wgScriptPath"]) || {};
2203
2203
  typeof i == "string" && typeof s == "string" && (e = `${i}${s}/api.php`);
2204
2204
  }
2205
2205
  if (typeof e != "string")
2206
2206
  throw new Error("baseURL is undefined");
2207
2207
  this.baseURL = e, this.tokens = {}, this.defaultParams = {
2208
- ...G.INIT_DEFAULT_PARAMS,
2208
+ ...X.INIT_DEFAULT_PARAMS,
2209
2209
  ...n
2210
2210
  }, this.defaultOptions = {
2211
2211
  responseType: "json",
2212
2212
  ...t
2213
- }, this.request = G.createRequestHandler(this.baseURL);
2213
+ }, this.request = X.createRequestHandler(this.baseURL);
2214
2214
  }
2215
2215
  setBaseURL(e) {
2216
2216
  return this.request.baseConfigs.baseURL = e, this;
@@ -2223,12 +2223,12 @@ const _r = class G {
2223
2223
  if (e != null) {
2224
2224
  if (t(e))
2225
2225
  return e.forEach((n, i) => {
2226
- const s = G.normalizeParamValue(n);
2226
+ const s = X.normalizeParamValue(n);
2227
2227
  s == null ? e.delete(i) : s !== n && e.set(i, s);
2228
2228
  }), e;
2229
2229
  if (qe(e))
2230
2230
  return e = Object.fromEntries(
2231
- Object.entries(e).map(([n, i]) => [n, G.normalizeParamValue(i)]).filter(([n, i]) => i != null)
2231
+ Object.entries(e).map(([n, i]) => [n, X.normalizeParamValue(i)]).filter(([n, i]) => i != null)
2232
2232
  ), Object.values(e).some(
2233
2233
  (n) => n instanceof File || n instanceof Blob
2234
2234
  ) ? (e = new FormData(), Object.entries(e).forEach(([n, i]) => {
@@ -2246,9 +2246,9 @@ const _r = class G {
2246
2246
  return n;
2247
2247
  if (n.body === void 0 || n.body === null)
2248
2248
  return n.body = void 0, n;
2249
- const i = n.body = G.normalizeBody(n.body), s = new URLSearchParams(n.query);
2249
+ const i = n.body = X.normalizeBody(n.body), s = new URLSearchParams(n.query);
2250
2250
  return i.has("format") && s.delete("format"), i.has("formatversion") && s.delete("formatversion"), i.has("action") && s.delete("action"), i.has("origin") && (s.set("origin", "" + i.get("origin")), i.delete("origin")), n.query = Object.fromEntries(s.entries()), n;
2251
- }), t.on("beforeInit", (n) => (n.query = G.normalizeBody(n.query) || {}, n)), t.on("beforeRequest", (n) => {
2251
+ }), t.on("beforeInit", (n) => (n.query = X.normalizeBody(n.query) || {}, n)), t.on("beforeRequest", (n) => {
2252
2252
  const i = new URL(n.url), s = i.searchParams;
2253
2253
  if (globalThis.location && (!s.has("origin") && location.origin !== new URL(e).origin ? (s.set("origin", location.origin), t.baseConfigs.credentials = "include", t.baseConfigs.mode = "cors") : location.origin === new URL(e).origin && (s.delete("origin"), t.baseConfigs.credentials = void 0, t.baseConfigs.mode = void 0)), i.searchParams.has("origin")) {
2254
2254
  const c = encodeURIComponent(
@@ -2280,7 +2280,7 @@ const _r = class G {
2280
2280
  }
2281
2281
  async login(e, t, n, i) {
2282
2282
  if (this.defaultOptions.credentials = "include", i = i || {}, i.retry ??= 3, i.retry < 1)
2283
- throw new _e(
2283
+ throw new Se(
2284
2284
  "LOGIN_RETRY_LIMIT_EXCEEDED",
2285
2285
  "The limit of the number of times to automatically re-login has been exceeded"
2286
2286
  );
@@ -2301,7 +2301,7 @@ const _r = class G {
2301
2301
  else
2302
2302
  throw c;
2303
2303
  } catch (c) {
2304
- if (c instanceof _e)
2304
+ if (c instanceof Se)
2305
2305
  throw c;
2306
2306
  if (c?.ok === !1)
2307
2307
  return this.login(e, t, n, {
@@ -2309,14 +2309,14 @@ const _r = class G {
2309
2309
  noCache: !0,
2310
2310
  retry: i.retry - 1
2311
2311
  });
2312
- throw new _e(
2312
+ throw new Se(
2313
2313
  "HTTP_ERROR",
2314
2314
  "The server returns an error, but it doesn't seem to be caused by MediaWiki",
2315
2315
  c
2316
2316
  );
2317
2317
  }
2318
2318
  if (s?.login?.result !== "Success")
2319
- throw new _e(
2319
+ throw new Se(
2320
2320
  "LOGIN_FAILED",
2321
2321
  s?.login?.reason?.text || s?.login?.result || "Login failed with unknown reason",
2322
2322
  s
@@ -2347,7 +2347,7 @@ const _r = class G {
2347
2347
  async postWithToken(e, t, n) {
2348
2348
  const { tokenName: i = "token", retry: s = 3, noCache: c = !1 } = n || {};
2349
2349
  if (s < 1)
2350
- throw new _e(
2350
+ throw new Se(
2351
2351
  "TOKEN_RETRY_LIMIT_EXCEEDED",
2352
2352
  "The limit of the number of times to automatically re-acquire the token has been exceeded"
2353
2353
  );
@@ -2360,15 +2360,15 @@ const _r = class G {
2360
2360
  [i]: l,
2361
2361
  ...t
2362
2362
  }).then((v) => {
2363
- const E = v.data;
2364
- return G.isBadTokenError(E) ? b() : v;
2363
+ const S = v.data;
2364
+ return X.isBadTokenError(S) ? b() : v;
2365
2365
  }).catch((v) => {
2366
- const E = v.data;
2367
- if (G.isBadTokenError(E) || v?.ok === !1)
2366
+ const S = v.data;
2367
+ if (X.isBadTokenError(S) || v?.ok === !1)
2368
2368
  return b();
2369
- if (typeof E == "object" && E !== null)
2370
- return Promise.reject(E);
2371
- throw new _e(
2369
+ if (typeof S == "object" && S !== null)
2370
+ return Promise.reject(S);
2371
+ throw new Se(
2372
2372
  "HTTP_ERROR",
2373
2373
  "The server returns an error, but it doesn’t seem to be caused by MediaWiki",
2374
2374
  v
@@ -2406,18 +2406,18 @@ const _r = class G {
2406
2406
  return e?.response?.data || e?.data || e || void 0;
2407
2407
  }
2408
2408
  static isMediaWikiApiError(e) {
2409
- const t = G.extractResponseDataFromAny(e);
2409
+ const t = X.extractResponseDataFromAny(e);
2410
2410
  return typeof t == "object" && t !== null && ("error" in t || "errors" in t);
2411
2411
  }
2412
2412
  static extractMediaWikiErrors(e) {
2413
- const t = G.extractResponseDataFromAny(e);
2413
+ const t = X.extractResponseDataFromAny(e);
2414
2414
  if (typeof t != "object" || t === null)
2415
2415
  return [];
2416
2416
  const n = t?.error, i = t?.errors, s = [];
2417
2417
  return n && s.push(n), Array.isArray(i) && s.push(...i), s;
2418
2418
  }
2419
2419
  static isBadTokenError(e) {
2420
- return G.extractMediaWikiErrors(e).some((t) => t.code === "badtoken") || ["NeedToken", "WrongToken"].includes(e?.login?.result);
2420
+ return X.extractMediaWikiErrors(e).some((t) => t.code === "badtoken") || ["NeedToken", "WrongToken"].includes(e?.login?.result);
2421
2421
  }
2422
2422
  };
2423
2423
  _r.INIT_DEFAULT_PARAMS = {
@@ -2426,8 +2426,8 @@ _r.INIT_DEFAULT_PARAMS = {
2426
2426
  format: "json",
2427
2427
  formatversion: 2
2428
2428
  };
2429
- let Ri = _r;
2430
- class _e extends Error {
2429
+ let Ai = _r;
2430
+ class Se extends Error {
2431
2431
  constructor(e, t = "", n) {
2432
2432
  super(), this.code = e, this.message = t, this.cause = n, this.name = "WikiSaikouError";
2433
2433
  }
@@ -2439,9 +2439,9 @@ class _e extends Error {
2439
2439
  * @author Dragon-Fish <dragon-fish@qq.com>
2440
2440
  * @license MIT
2441
2441
  */
2442
- class Sr extends Ri {
2442
+ class Sr extends Ai {
2443
2443
  }
2444
- class Ai {
2444
+ class Ii {
2445
2445
  constructor(e, t) {
2446
2446
  this.ctx = e;
2447
2447
  let n = typeof t?.baseURL == "string" ? t.baseURL : t?.baseURL?.toString();
@@ -2454,7 +2454,7 @@ class Ai {
2454
2454
  e.set("api", i);
2455
2455
  }
2456
2456
  }
2457
- class Ii extends Xe {
2457
+ class $i extends Je {
2458
2458
  constructor(e) {
2459
2459
  super(e, "resourceLoader", !0), this.ctx = e;
2460
2460
  }
@@ -2466,8 +2466,8 @@ class Ii extends Xe {
2466
2466
  const n = `script:${e}`, i = document.querySelector(`[data-ipe="${n}"]`);
2467
2467
  return i ? Promise.resolve(i) : new Promise((c, l) => {
2468
2468
  const b = document.createElement("script");
2469
- b.src = e, b.dataset.ipe = n, t && Object.entries(t).forEach(([v, E]) => {
2470
- typeof E > "u" || E === !1 || E === null ? b.removeAttribute(v) : b.setAttribute(v, E);
2469
+ b.src = e, b.dataset.ipe = n, t && Object.entries(t).forEach(([v, S]) => {
2470
+ typeof S > "u" || S === !1 || S === null ? b.removeAttribute(v) : b.setAttribute(v, S);
2471
2471
  }), document.body.appendChild(b), b.onload = () => c(b), b.onerror = (v) => l(v);
2472
2472
  });
2473
2473
  }
@@ -2477,26 +2477,26 @@ class Ii extends Xe {
2477
2477
  const n = `style:${e}`, i = document.querySelector(`[data-ipe="${n}"]`);
2478
2478
  return i ? Promise.resolve(i) : new Promise((c, l) => {
2479
2479
  const b = document.createElement("link");
2480
- b.rel = "stylesheet", b.href = e, b.dataset.ipe = n, t && Object.entries(t).forEach(([E, w]) => {
2481
- typeof w > "u" || w === !1 || w === null ? b.removeAttribute(E) : b.setAttribute(E, w);
2480
+ b.rel = "stylesheet", b.href = e, b.dataset.ipe = n, t && Object.entries(t).forEach(([S, w]) => {
2481
+ typeof w > "u" || w === !1 || w === null ? b.removeAttribute(S) : b.setAttribute(S, w);
2482
2482
  }), (document.querySelector('meta[name="ipe-styles"]') || (() => {
2483
- const E = document.createElement("meta");
2484
- return E.id = "ipe-styles", E.name = "ipe-styles", document.head.insertAdjacentElement("afterbegin", E), E;
2485
- })()).before(b), b.onload = () => c(b), b.onerror = (E) => l(E);
2483
+ const S = document.createElement("meta");
2484
+ return S.id = "ipe-styles", S.name = "ipe-styles", document.head.insertAdjacentElement("afterbegin", S), S;
2485
+ })()).before(b), b.onload = () => c(b), b.onerror = (S) => l(S);
2486
2486
  });
2487
2487
  }
2488
2488
  resolveImportPath(e) {
2489
2489
  return e.startsWith("http") || e.startsWith("//") ? e : import.meta.resolve(e);
2490
2490
  }
2491
2491
  }
2492
- var Fe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2493
- function $i(r) {
2492
+ var ze = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2493
+ function Ti(r) {
2494
2494
  return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
2495
2495
  }
2496
- function We(r) {
2496
+ function He(r) {
2497
2497
  throw new Error('Could not dynamically require "' + r + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
2498
2498
  }
2499
- var lt = { exports: {} };
2499
+ var ut = { exports: {} };
2500
2500
  /*!
2501
2501
  localForage -- Offline Storage, Improved
2502
2502
  Version 1.10.0
@@ -2504,79 +2504,79 @@ var lt = { exports: {} };
2504
2504
  (c) 2013-2017 Mozilla, Apache License 2.0
2505
2505
  */
2506
2506
  var ir;
2507
- function Ti() {
2507
+ function Di() {
2508
2508
  return ir || (ir = 1, function(r, e) {
2509
2509
  (function(t) {
2510
2510
  r.exports = t();
2511
2511
  })(function() {
2512
2512
  return function t(n, i, s) {
2513
- function c(v, E) {
2513
+ function c(v, S) {
2514
2514
  if (!i[v]) {
2515
2515
  if (!n[v]) {
2516
- var w = typeof We == "function" && We;
2517
- if (!E && w) return w(v, !0);
2516
+ var w = typeof He == "function" && He;
2517
+ if (!S && w) return w(v, !0);
2518
2518
  if (l) return l(v, !0);
2519
- var D = new Error("Cannot find module '" + v + "'");
2520
- throw D.code = "MODULE_NOT_FOUND", D;
2519
+ var C = new Error("Cannot find module '" + v + "'");
2520
+ throw C.code = "MODULE_NOT_FOUND", C;
2521
2521
  }
2522
- var k = i[v] = { exports: {} };
2523
- n[v][0].call(k.exports, function(L) {
2524
- var q = n[v][1][L];
2525
- return c(q || L);
2526
- }, k, k.exports, t, n, i, s);
2522
+ var O = i[v] = { exports: {} };
2523
+ n[v][0].call(O.exports, function(D) {
2524
+ var q = n[v][1][D];
2525
+ return c(q || D);
2526
+ }, O, O.exports, t, n, i, s);
2527
2527
  }
2528
2528
  return i[v].exports;
2529
2529
  }
2530
- for (var l = typeof We == "function" && We, b = 0; b < s.length; b++) c(s[b]);
2530
+ for (var l = typeof He == "function" && He, b = 0; b < s.length; b++) c(s[b]);
2531
2531
  return c;
2532
2532
  }({ 1: [function(t, n, i) {
2533
2533
  (function(s) {
2534
2534
  var c = s.MutationObserver || s.WebKitMutationObserver, l;
2535
2535
  if (c) {
2536
- var b = 0, v = new c(L), E = s.document.createTextNode("");
2537
- v.observe(E, {
2536
+ var b = 0, v = new c(D), S = s.document.createTextNode("");
2537
+ v.observe(S, {
2538
2538
  characterData: !0
2539
2539
  }), l = function() {
2540
- E.data = b = ++b % 2;
2540
+ S.data = b = ++b % 2;
2541
2541
  };
2542
2542
  } else if (!s.setImmediate && typeof s.MessageChannel < "u") {
2543
2543
  var w = new s.MessageChannel();
2544
- w.port1.onmessage = L, l = function() {
2544
+ w.port1.onmessage = D, l = function() {
2545
2545
  w.port2.postMessage(0);
2546
2546
  };
2547
2547
  } else "document" in s && "onreadystatechange" in s.document.createElement("script") ? l = function() {
2548
2548
  var H = s.document.createElement("script");
2549
2549
  H.onreadystatechange = function() {
2550
- L(), H.onreadystatechange = null, H.parentNode.removeChild(H), H = null;
2550
+ D(), H.onreadystatechange = null, H.parentNode.removeChild(H), H = null;
2551
2551
  }, s.document.documentElement.appendChild(H);
2552
2552
  } : l = function() {
2553
- setTimeout(L, 0);
2553
+ setTimeout(D, 0);
2554
2554
  };
2555
- var D, k = [];
2556
- function L() {
2557
- D = !0;
2558
- for (var H, U, u = k.length; u; ) {
2559
- for (U = k, k = [], H = -1; ++H < u; )
2560
- U[H]();
2561
- u = k.length;
2555
+ var C, O = [];
2556
+ function D() {
2557
+ C = !0;
2558
+ for (var H, M, u = O.length; u; ) {
2559
+ for (M = O, O = [], H = -1; ++H < u; )
2560
+ M[H]();
2561
+ u = O.length;
2562
2562
  }
2563
- D = !1;
2563
+ C = !1;
2564
2564
  }
2565
2565
  n.exports = q;
2566
2566
  function q(H) {
2567
- k.push(H) === 1 && !D && l();
2567
+ O.push(H) === 1 && !C && l();
2568
2568
  }
2569
- }).call(this, typeof Fe < "u" ? Fe : typeof self < "u" ? self : typeof window < "u" ? window : {});
2569
+ }).call(this, typeof ze < "u" ? ze : typeof self < "u" ? self : typeof window < "u" ? window : {});
2570
2570
  }, {}], 2: [function(t, n, i) {
2571
2571
  var s = t(1);
2572
2572
  function c() {
2573
2573
  }
2574
- var l = {}, b = ["REJECTED"], v = ["FULFILLED"], E = ["PENDING"];
2574
+ var l = {}, b = ["REJECTED"], v = ["FULFILLED"], S = ["PENDING"];
2575
2575
  n.exports = w;
2576
2576
  function w(h) {
2577
2577
  if (typeof h != "function")
2578
2578
  throw new TypeError("resolver must be a function");
2579
- this.state = E, this.queue = [], this.outcome = void 0, h !== c && q(this, h);
2579
+ this.state = S, this.queue = [], this.outcome = void 0, h !== c && q(this, h);
2580
2580
  }
2581
2581
  w.prototype.catch = function(h) {
2582
2582
  return this.then(null, h);
@@ -2584,26 +2584,26 @@ function Ti() {
2584
2584
  if (typeof h != "function" && this.state === v || typeof _ != "function" && this.state === b)
2585
2585
  return this;
2586
2586
  var x = new this.constructor(c);
2587
- if (this.state !== E) {
2587
+ if (this.state !== S) {
2588
2588
  var I = this.state === v ? h : _;
2589
- k(x, I, this.outcome);
2589
+ O(x, I, this.outcome);
2590
2590
  } else
2591
- this.queue.push(new D(x, h, _));
2591
+ this.queue.push(new C(x, h, _));
2592
2592
  return x;
2593
2593
  };
2594
- function D(h, _, x) {
2594
+ function C(h, _, x) {
2595
2595
  this.promise = h, typeof _ == "function" && (this.onFulfilled = _, this.callFulfilled = this.otherCallFulfilled), typeof x == "function" && (this.onRejected = x, this.callRejected = this.otherCallRejected);
2596
2596
  }
2597
- D.prototype.callFulfilled = function(h) {
2597
+ C.prototype.callFulfilled = function(h) {
2598
2598
  l.resolve(this.promise, h);
2599
- }, D.prototype.otherCallFulfilled = function(h) {
2600
- k(this.promise, this.onFulfilled, h);
2601
- }, D.prototype.callRejected = function(h) {
2599
+ }, C.prototype.otherCallFulfilled = function(h) {
2600
+ O(this.promise, this.onFulfilled, h);
2601
+ }, C.prototype.callRejected = function(h) {
2602
2602
  l.reject(this.promise, h);
2603
- }, D.prototype.otherCallRejected = function(h) {
2604
- k(this.promise, this.onRejected, h);
2603
+ }, C.prototype.otherCallRejected = function(h) {
2604
+ O(this.promise, this.onRejected, h);
2605
2605
  };
2606
- function k(h, _, x) {
2606
+ function O(h, _, x) {
2607
2607
  s(function() {
2608
2608
  var I;
2609
2609
  try {
@@ -2615,7 +2615,7 @@ function Ti() {
2615
2615
  });
2616
2616
  }
2617
2617
  l.resolve = function(h, _) {
2618
- var x = H(L, _);
2618
+ var x = H(D, _);
2619
2619
  if (x.status === "error")
2620
2620
  return l.reject(h, x.value);
2621
2621
  var I = x.value;
@@ -2623,7 +2623,7 @@ function Ti() {
2623
2623
  q(h, I);
2624
2624
  else {
2625
2625
  h.state = v, h.outcome = _;
2626
- for (var N = -1, J = h.queue.length; ++N < J; )
2626
+ for (var N = -1, Q = h.queue.length; ++N < Q; )
2627
2627
  h.queue[N].callFulfilled(_);
2628
2628
  }
2629
2629
  return h;
@@ -2633,7 +2633,7 @@ function Ti() {
2633
2633
  h.queue[x].callRejected(_);
2634
2634
  return h;
2635
2635
  };
2636
- function L(h) {
2636
+ function D(h) {
2637
2637
  var _ = h && h.then;
2638
2638
  if (h && (typeof h == "object" || typeof h == "function") && typeof _ == "function")
2639
2639
  return function() {
@@ -2642,17 +2642,17 @@ function Ti() {
2642
2642
  }
2643
2643
  function q(h, _) {
2644
2644
  var x = !1;
2645
- function I(ie) {
2646
- x || (x = !0, l.reject(h, ie));
2645
+ function I(se) {
2646
+ x || (x = !0, l.reject(h, se));
2647
2647
  }
2648
- function N(ie) {
2649
- x || (x = !0, l.resolve(h, ie));
2648
+ function N(se) {
2649
+ x || (x = !0, l.resolve(h, se));
2650
2650
  }
2651
- function J() {
2651
+ function Q() {
2652
2652
  _(N, I);
2653
2653
  }
2654
- var ne = H(J);
2655
- ne.status === "error" && I(ne.value);
2654
+ var ie = H(Q);
2655
+ ie.status === "error" && I(ie.value);
2656
2656
  }
2657
2657
  function H(h, _) {
2658
2658
  var x = {};
@@ -2663,8 +2663,8 @@ function Ti() {
2663
2663
  }
2664
2664
  return x;
2665
2665
  }
2666
- w.resolve = U;
2667
- function U(h) {
2666
+ w.resolve = M;
2667
+ function M(h) {
2668
2668
  return h instanceof this ? h : l.resolve(new this(c), h);
2669
2669
  }
2670
2670
  w.reject = u;
@@ -2680,15 +2680,15 @@ function Ti() {
2680
2680
  var x = h.length, I = !1;
2681
2681
  if (!x)
2682
2682
  return this.resolve([]);
2683
- for (var N = new Array(x), J = 0, ne = -1, ie = new this(c); ++ne < x; )
2684
- ce(h[ne], ne);
2685
- return ie;
2686
- function ce(Ee, Ne) {
2687
- _.resolve(Ee).then(Je, function(ve) {
2688
- I || (I = !0, l.reject(ie, ve));
2683
+ for (var N = new Array(x), Q = 0, ie = -1, se = new this(c); ++ie < x; )
2684
+ le(h[ie], ie);
2685
+ return se;
2686
+ function le(xe, Be) {
2687
+ _.resolve(xe).then(Qe, function(we) {
2688
+ I || (I = !0, l.reject(se, we));
2689
2689
  });
2690
- function Je(ve) {
2691
- N[Ne] = ve, ++J === x && !I && (I = !0, l.resolve(ie, N));
2690
+ function Qe(we) {
2691
+ N[Be] = we, ++Q === x && !I && (I = !0, l.resolve(se, N));
2692
2692
  }
2693
2693
  }
2694
2694
  }
@@ -2700,21 +2700,21 @@ function Ti() {
2700
2700
  var x = h.length, I = !1;
2701
2701
  if (!x)
2702
2702
  return this.resolve([]);
2703
- for (var N = -1, J = new this(c); ++N < x; )
2704
- ne(h[N]);
2705
- return J;
2706
- function ne(ie) {
2707
- _.resolve(ie).then(function(ce) {
2708
- I || (I = !0, l.resolve(J, ce));
2709
- }, function(ce) {
2710
- I || (I = !0, l.reject(J, ce));
2703
+ for (var N = -1, Q = new this(c); ++N < x; )
2704
+ ie(h[N]);
2705
+ return Q;
2706
+ function ie(se) {
2707
+ _.resolve(se).then(function(le) {
2708
+ I || (I = !0, l.resolve(Q, le));
2709
+ }, function(le) {
2710
+ I || (I = !0, l.reject(Q, le));
2711
2711
  });
2712
2712
  }
2713
2713
  }
2714
2714
  }, { 1: 1 }], 3: [function(t, n, i) {
2715
2715
  (function(s) {
2716
2716
  typeof s.Promise != "function" && (s.Promise = t(2));
2717
- }).call(this, typeof Fe < "u" ? Fe : typeof self < "u" ? self : typeof window < "u" ? window : {});
2717
+ }).call(this, typeof ze < "u" ? ze : typeof self < "u" ? self : typeof window < "u" ? window : {});
2718
2718
  }, { 2: 2 }], 4: [function(t, n, i) {
2719
2719
  var s = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o) {
2720
2720
  return typeof o;
@@ -2756,7 +2756,7 @@ function Ti() {
2756
2756
  return !1;
2757
2757
  }
2758
2758
  }
2759
- function E(o, f) {
2759
+ function S(o, f) {
2760
2760
  o = o || [], f = f || {};
2761
2761
  try {
2762
2762
  return new Blob(o, f);
@@ -2770,24 +2770,24 @@ function Ti() {
2770
2770
  }
2771
2771
  typeof Promise > "u" && t(3);
2772
2772
  var w = Promise;
2773
- function D(o, f) {
2773
+ function C(o, f) {
2774
2774
  f && o.then(function(a) {
2775
2775
  f(null, a);
2776
2776
  }, function(a) {
2777
2777
  f(a);
2778
2778
  });
2779
2779
  }
2780
- function k(o, f, a) {
2780
+ function O(o, f, a) {
2781
2781
  typeof f == "function" && o.then(f), typeof a == "function" && o.catch(a);
2782
2782
  }
2783
- function L(o) {
2783
+ function D(o) {
2784
2784
  return typeof o != "string" && (o = String(o)), o;
2785
2785
  }
2786
2786
  function q() {
2787
2787
  if (arguments.length && typeof arguments[arguments.length - 1] == "function")
2788
2788
  return arguments[arguments.length - 1];
2789
2789
  }
2790
- var H = "local-forage-detect-blob-support", U = void 0, u = {}, d = Object.prototype.toString, y = "readonly", h = "readwrite";
2790
+ var H = "local-forage-detect-blob-support", M = void 0, u = {}, d = Object.prototype.toString, y = "readonly", h = "readwrite";
2791
2791
  function _(o) {
2792
2792
  for (var f = o.length, a = new ArrayBuffer(f), m = new Uint8Array(a), g = 0; g < f; g++)
2793
2793
  m[g] = o.charCodeAt(g);
@@ -2795,7 +2795,7 @@ function Ti() {
2795
2795
  }
2796
2796
  function x(o) {
2797
2797
  return new w(function(f) {
2798
- var a = o.transaction(H, h), m = E([""]);
2798
+ var a = o.transaction(H, h), m = S([""]);
2799
2799
  a.objectStore(H).put(m, "key"), a.onabort = function(g) {
2800
2800
  g.preventDefault(), g.stopPropagation(), f(!1);
2801
2801
  }, a.oncomplete = function() {
@@ -2807,8 +2807,8 @@ function Ti() {
2807
2807
  });
2808
2808
  }
2809
2809
  function I(o) {
2810
- return typeof U == "boolean" ? w.resolve(U) : x(o).then(function(f) {
2811
- return U = f, U;
2810
+ return typeof M == "boolean" ? w.resolve(M) : x(o).then(function(f) {
2811
+ return M = f, M;
2812
2812
  });
2813
2813
  }
2814
2814
  function N(o) {
@@ -2819,19 +2819,19 @@ function Ti() {
2819
2819
  return a.promise;
2820
2820
  }) : f.dbReady = a.promise;
2821
2821
  }
2822
- function J(o) {
2822
+ function Q(o) {
2823
2823
  var f = u[o.name], a = f.deferredOperations.pop();
2824
2824
  if (a)
2825
2825
  return a.resolve(), a.promise;
2826
2826
  }
2827
- function ne(o, f) {
2827
+ function ie(o, f) {
2828
2828
  var a = u[o.name], m = a.deferredOperations.pop();
2829
2829
  if (m)
2830
2830
  return m.reject(f), m.promise;
2831
2831
  }
2832
- function ie(o, f) {
2832
+ function se(o, f) {
2833
2833
  return new w(function(a, m) {
2834
- if (u[o.name] = u[o.name] || At(), o.db)
2834
+ if (u[o.name] = u[o.name] || It(), o.db)
2835
2835
  if (f)
2836
2836
  N(o), o.db.close();
2837
2837
  else
@@ -2839,31 +2839,31 @@ function Ti() {
2839
2839
  var g = [o.name];
2840
2840
  f && g.push(o.version);
2841
2841
  var p = b.open.apply(b, g);
2842
- f && (p.onupgradeneeded = function(S) {
2843
- var O = p.result;
2842
+ f && (p.onupgradeneeded = function(E) {
2843
+ var k = p.result;
2844
2844
  try {
2845
- O.createObjectStore(o.storeName), S.oldVersion <= 1 && O.createObjectStore(H);
2845
+ k.createObjectStore(o.storeName), E.oldVersion <= 1 && k.createObjectStore(H);
2846
2846
  } catch (R) {
2847
2847
  if (R.name !== "ConstraintError")
2848
2848
  throw R;
2849
2849
  }
2850
- }), p.onerror = function(S) {
2851
- S.preventDefault(), m(p.error);
2850
+ }), p.onerror = function(E) {
2851
+ E.preventDefault(), m(p.error);
2852
2852
  }, p.onsuccess = function() {
2853
- var S = p.result;
2854
- S.onversionchange = function(O) {
2855
- O.target.close();
2856
- }, a(S), J(o);
2853
+ var E = p.result;
2854
+ E.onversionchange = function(k) {
2855
+ k.target.close();
2856
+ }, a(E), Q(o);
2857
2857
  };
2858
2858
  });
2859
2859
  }
2860
- function ce(o) {
2861
- return ie(o, !1);
2860
+ function le(o) {
2861
+ return se(o, !1);
2862
2862
  }
2863
- function Ee(o) {
2864
- return ie(o, !0);
2863
+ function xe(o) {
2864
+ return se(o, !0);
2865
2865
  }
2866
- function Ne(o, f) {
2866
+ function Be(o, f) {
2867
2867
  if (!o.db)
2868
2868
  return !0;
2869
2869
  var a = !o.db.objectStoreNames.contains(o.storeName), m = o.version < o.db.version, g = o.version > o.db.version;
@@ -2876,7 +2876,7 @@ function Ti() {
2876
2876
  }
2877
2877
  return !1;
2878
2878
  }
2879
- function Je(o) {
2879
+ function Qe(o) {
2880
2880
  return new w(function(f, a) {
2881
2881
  var m = new FileReader();
2882
2882
  m.onerror = a, m.onloadend = function(g) {
@@ -2889,11 +2889,11 @@ function Ti() {
2889
2889
  }, m.readAsBinaryString(o);
2890
2890
  });
2891
2891
  }
2892
- function ve(o) {
2892
+ function we(o) {
2893
2893
  var f = _(atob(o.data));
2894
- return E([f], { type: o.type });
2894
+ return S([f], { type: o.type });
2895
2895
  }
2896
- function Rt(o) {
2896
+ function At(o) {
2897
2897
  return o && o.__local_forage_encoded_blob;
2898
2898
  }
2899
2899
  function $r(o) {
@@ -2902,7 +2902,7 @@ function Ti() {
2902
2902
  if (m && m.dbReady)
2903
2903
  return m.dbReady;
2904
2904
  });
2905
- return k(a, o, o), a;
2905
+ return O(a, o, o), a;
2906
2906
  }
2907
2907
  function Tr(o) {
2908
2908
  N(o);
@@ -2910,17 +2910,17 @@ function Ti() {
2910
2910
  var g = a[m];
2911
2911
  g._dbInfo.db && (g._dbInfo.db.close(), g._dbInfo.db = null);
2912
2912
  }
2913
- return o.db = null, ce(o).then(function(p) {
2914
- return o.db = p, Ne(o) ? Ee(o) : p;
2913
+ return o.db = null, le(o).then(function(p) {
2914
+ return o.db = p, Be(o) ? xe(o) : p;
2915
2915
  }).then(function(p) {
2916
2916
  o.db = f.db = p;
2917
- for (var S = 0; S < a.length; S++)
2918
- a[S]._dbInfo.db = p;
2917
+ for (var E = 0; E < a.length; E++)
2918
+ a[E]._dbInfo.db = p;
2919
2919
  }).catch(function(p) {
2920
- throw ne(o, p), p;
2920
+ throw ie(o, p), p;
2921
2921
  });
2922
2922
  }
2923
- function le(o, f, a, m) {
2923
+ function ue(o, f, a, m) {
2924
2924
  m === void 0 && (m = 1);
2925
2925
  try {
2926
2926
  var g = o.db.transaction(o.storeName, f);
@@ -2929,16 +2929,16 @@ function Ti() {
2929
2929
  if (m > 0 && (!o.db || p.name === "InvalidStateError" || p.name === "NotFoundError"))
2930
2930
  return w.resolve().then(function() {
2931
2931
  if (!o.db || p.name === "NotFoundError" && !o.db.objectStoreNames.contains(o.storeName) && o.version <= o.db.version)
2932
- return o.db && (o.version = o.db.version + 1), Ee(o);
2932
+ return o.db && (o.version = o.db.version + 1), xe(o);
2933
2933
  }).then(function() {
2934
2934
  return Tr(o).then(function() {
2935
- le(o, f, a, m - 1);
2935
+ ue(o, f, a, m - 1);
2936
2936
  });
2937
2937
  }).catch(a);
2938
2938
  a(p);
2939
2939
  }
2940
2940
  }
2941
- function At() {
2941
+ function It() {
2942
2942
  return {
2943
2943
  // Running localForages sharing a database.
2944
2944
  forages: [],
@@ -2950,7 +2950,7 @@ function Ti() {
2950
2950
  deferredOperations: []
2951
2951
  };
2952
2952
  }
2953
- function Lr(o) {
2953
+ function Dr(o) {
2954
2954
  var f = this, a = {
2955
2955
  db: null
2956
2956
  };
@@ -2958,41 +2958,41 @@ function Ti() {
2958
2958
  for (var m in o)
2959
2959
  a[m] = o[m];
2960
2960
  var g = u[a.name];
2961
- g || (g = At(), u[a.name] = g), g.forages.push(f), f._initReady || (f._initReady = f.ready, f.ready = $r);
2961
+ g || (g = It(), u[a.name] = g), g.forages.push(f), f._initReady || (f._initReady = f.ready, f.ready = $r);
2962
2962
  var p = [];
2963
- function S() {
2963
+ function E() {
2964
2964
  return w.resolve();
2965
2965
  }
2966
- for (var O = 0; O < g.forages.length; O++) {
2967
- var R = g.forages[O];
2968
- R !== f && p.push(R._initReady().catch(S));
2966
+ for (var k = 0; k < g.forages.length; k++) {
2967
+ var R = g.forages[k];
2968
+ R !== f && p.push(R._initReady().catch(E));
2969
2969
  }
2970
2970
  var A = g.forages.slice(0);
2971
2971
  return w.all(p).then(function() {
2972
- return a.db = g.db, ce(a);
2972
+ return a.db = g.db, le(a);
2973
2973
  }).then(function($) {
2974
- return a.db = $, Ne(a, f._defaultConfig.version) ? Ee(a) : $;
2974
+ return a.db = $, Be(a, f._defaultConfig.version) ? xe(a) : $;
2975
2975
  }).then(function($) {
2976
2976
  a.db = g.db = $, f._dbInfo = a;
2977
- for (var C = 0; C < A.length; C++) {
2978
- var j = A[C];
2977
+ for (var L = 0; L < A.length; L++) {
2978
+ var j = A[L];
2979
2979
  j !== f && (j._dbInfo.db = a.db, j._dbInfo.version = a.version);
2980
2980
  }
2981
2981
  });
2982
2982
  }
2983
- function Dr(o, f) {
2983
+ function Cr(o, f) {
2984
2984
  var a = this;
2985
- o = L(o);
2985
+ o = D(o);
2986
2986
  var m = new w(function(g, p) {
2987
2987
  a.ready().then(function() {
2988
- le(a._dbInfo, y, function(S, O) {
2989
- if (S)
2990
- return p(S);
2988
+ ue(a._dbInfo, y, function(E, k) {
2989
+ if (E)
2990
+ return p(E);
2991
2991
  try {
2992
- var R = O.objectStore(a._dbInfo.storeName), A = R.get(o);
2992
+ var R = k.objectStore(a._dbInfo.storeName), A = R.get(o);
2993
2993
  A.onsuccess = function() {
2994
2994
  var $ = A.result;
2995
- $ === void 0 && ($ = null), Rt($) && ($ = ve($)), g($);
2995
+ $ === void 0 && ($ = null), At($) && ($ = we($)), g($);
2996
2996
  }, A.onerror = function() {
2997
2997
  p(A.error);
2998
2998
  };
@@ -3002,82 +3002,82 @@ function Ti() {
3002
3002
  });
3003
3003
  }).catch(p);
3004
3004
  });
3005
- return D(m, f), m;
3005
+ return C(m, f), m;
3006
3006
  }
3007
- function Cr(o, f) {
3007
+ function Lr(o, f) {
3008
3008
  var a = this, m = new w(function(g, p) {
3009
3009
  a.ready().then(function() {
3010
- le(a._dbInfo, y, function(S, O) {
3011
- if (S)
3012
- return p(S);
3010
+ ue(a._dbInfo, y, function(E, k) {
3011
+ if (E)
3012
+ return p(E);
3013
3013
  try {
3014
- var R = O.objectStore(a._dbInfo.storeName), A = R.openCursor(), $ = 1;
3014
+ var R = k.objectStore(a._dbInfo.storeName), A = R.openCursor(), $ = 1;
3015
3015
  A.onsuccess = function() {
3016
- var C = A.result;
3017
- if (C) {
3018
- var j = C.value;
3019
- Rt(j) && (j = ve(j));
3020
- var F = o(j, C.key, $++);
3021
- F !== void 0 ? g(F) : C.continue();
3016
+ var L = A.result;
3017
+ if (L) {
3018
+ var j = L.value;
3019
+ At(j) && (j = we(j));
3020
+ var F = o(j, L.key, $++);
3021
+ F !== void 0 ? g(F) : L.continue();
3022
3022
  } else
3023
3023
  g();
3024
3024
  }, A.onerror = function() {
3025
3025
  p(A.error);
3026
3026
  };
3027
- } catch (C) {
3028
- p(C);
3027
+ } catch (L) {
3028
+ p(L);
3029
3029
  }
3030
3030
  });
3031
3031
  }).catch(p);
3032
3032
  });
3033
- return D(m, f), m;
3033
+ return C(m, f), m;
3034
3034
  }
3035
3035
  function Pr(o, f, a) {
3036
3036
  var m = this;
3037
- o = L(o);
3038
- var g = new w(function(p, S) {
3039
- var O;
3037
+ o = D(o);
3038
+ var g = new w(function(p, E) {
3039
+ var k;
3040
3040
  m.ready().then(function() {
3041
- return O = m._dbInfo, d.call(f) === "[object Blob]" ? I(O.db).then(function(R) {
3042
- return R ? f : Je(f);
3041
+ return k = m._dbInfo, d.call(f) === "[object Blob]" ? I(k.db).then(function(R) {
3042
+ return R ? f : Qe(f);
3043
3043
  }) : f;
3044
3044
  }).then(function(R) {
3045
- le(m._dbInfo, h, function(A, $) {
3045
+ ue(m._dbInfo, h, function(A, $) {
3046
3046
  if (A)
3047
- return S(A);
3047
+ return E(A);
3048
3048
  try {
3049
- var C = $.objectStore(m._dbInfo.storeName);
3049
+ var L = $.objectStore(m._dbInfo.storeName);
3050
3050
  R === null && (R = void 0);
3051
- var j = C.put(R, o);
3051
+ var j = L.put(R, o);
3052
3052
  $.oncomplete = function() {
3053
3053
  R === void 0 && (R = null), p(R);
3054
3054
  }, $.onabort = $.onerror = function() {
3055
3055
  var F = j.error ? j.error : j.transaction.error;
3056
- S(F);
3056
+ E(F);
3057
3057
  };
3058
3058
  } catch (F) {
3059
- S(F);
3059
+ E(F);
3060
3060
  }
3061
3061
  });
3062
- }).catch(S);
3062
+ }).catch(E);
3063
3063
  });
3064
- return D(g, a), g;
3064
+ return C(g, a), g;
3065
3065
  }
3066
3066
  function Nr(o, f) {
3067
3067
  var a = this;
3068
- o = L(o);
3068
+ o = D(o);
3069
3069
  var m = new w(function(g, p) {
3070
3070
  a.ready().then(function() {
3071
- le(a._dbInfo, h, function(S, O) {
3072
- if (S)
3073
- return p(S);
3071
+ ue(a._dbInfo, h, function(E, k) {
3072
+ if (E)
3073
+ return p(E);
3074
3074
  try {
3075
- var R = O.objectStore(a._dbInfo.storeName), A = R.delete(o);
3076
- O.oncomplete = function() {
3075
+ var R = k.objectStore(a._dbInfo.storeName), A = R.delete(o);
3076
+ k.oncomplete = function() {
3077
3077
  g();
3078
- }, O.onerror = function() {
3078
+ }, k.onerror = function() {
3079
3079
  p(A.error);
3080
- }, O.onabort = function() {
3080
+ }, k.onabort = function() {
3081
3081
  var $ = A.error ? A.error : A.transaction.error;
3082
3082
  p($);
3083
3083
  };
@@ -3087,19 +3087,19 @@ function Ti() {
3087
3087
  });
3088
3088
  }).catch(p);
3089
3089
  });
3090
- return D(m, f), m;
3090
+ return C(m, f), m;
3091
3091
  }
3092
3092
  function Br(o) {
3093
3093
  var f = this, a = new w(function(m, g) {
3094
3094
  f.ready().then(function() {
3095
- le(f._dbInfo, h, function(p, S) {
3095
+ ue(f._dbInfo, h, function(p, E) {
3096
3096
  if (p)
3097
3097
  return g(p);
3098
3098
  try {
3099
- var O = S.objectStore(f._dbInfo.storeName), R = O.clear();
3100
- S.oncomplete = function() {
3099
+ var k = E.objectStore(f._dbInfo.storeName), R = k.clear();
3100
+ E.oncomplete = function() {
3101
3101
  m();
3102
- }, S.onabort = S.onerror = function() {
3102
+ }, E.onabort = E.onerror = function() {
3103
3103
  var A = R.error ? R.error : R.transaction.error;
3104
3104
  g(A);
3105
3105
  };
@@ -3109,16 +3109,16 @@ function Ti() {
3109
3109
  });
3110
3110
  }).catch(g);
3111
3111
  });
3112
- return D(a, o), a;
3112
+ return C(a, o), a;
3113
3113
  }
3114
3114
  function jr(o) {
3115
3115
  var f = this, a = new w(function(m, g) {
3116
3116
  f.ready().then(function() {
3117
- le(f._dbInfo, y, function(p, S) {
3117
+ ue(f._dbInfo, y, function(p, E) {
3118
3118
  if (p)
3119
3119
  return g(p);
3120
3120
  try {
3121
- var O = S.objectStore(f._dbInfo.storeName), R = O.count();
3121
+ var k = E.objectStore(f._dbInfo.storeName), R = k.count();
3122
3122
  R.onsuccess = function() {
3123
3123
  m(R.result);
3124
3124
  }, R.onerror = function() {
@@ -3130,46 +3130,46 @@ function Ti() {
3130
3130
  });
3131
3131
  }).catch(g);
3132
3132
  });
3133
- return D(a, o), a;
3133
+ return C(a, o), a;
3134
3134
  }
3135
- function Ur(o, f) {
3135
+ function Mr(o, f) {
3136
3136
  var a = this, m = new w(function(g, p) {
3137
3137
  if (o < 0) {
3138
3138
  g(null);
3139
3139
  return;
3140
3140
  }
3141
3141
  a.ready().then(function() {
3142
- le(a._dbInfo, y, function(S, O) {
3143
- if (S)
3144
- return p(S);
3142
+ ue(a._dbInfo, y, function(E, k) {
3143
+ if (E)
3144
+ return p(E);
3145
3145
  try {
3146
- var R = O.objectStore(a._dbInfo.storeName), A = !1, $ = R.openKeyCursor();
3146
+ var R = k.objectStore(a._dbInfo.storeName), A = !1, $ = R.openKeyCursor();
3147
3147
  $.onsuccess = function() {
3148
- var C = $.result;
3149
- if (!C) {
3148
+ var L = $.result;
3149
+ if (!L) {
3150
3150
  g(null);
3151
3151
  return;
3152
3152
  }
3153
- o === 0 || A ? g(C.key) : (A = !0, C.advance(o));
3153
+ o === 0 || A ? g(L.key) : (A = !0, L.advance(o));
3154
3154
  }, $.onerror = function() {
3155
3155
  p($.error);
3156
3156
  };
3157
- } catch (C) {
3158
- p(C);
3157
+ } catch (L) {
3158
+ p(L);
3159
3159
  }
3160
3160
  });
3161
3161
  }).catch(p);
3162
3162
  });
3163
- return D(m, f), m;
3163
+ return C(m, f), m;
3164
3164
  }
3165
- function Mr(o) {
3165
+ function Ur(o) {
3166
3166
  var f = this, a = new w(function(m, g) {
3167
3167
  f.ready().then(function() {
3168
- le(f._dbInfo, y, function(p, S) {
3168
+ ue(f._dbInfo, y, function(p, E) {
3169
3169
  if (p)
3170
3170
  return g(p);
3171
3171
  try {
3172
- var O = S.objectStore(f._dbInfo.storeName), R = O.openKeyCursor(), A = [];
3172
+ var k = E.objectStore(f._dbInfo.storeName), R = k.openKeyCursor(), A = [];
3173
3173
  R.onsuccess = function() {
3174
3174
  var $ = R.result;
3175
3175
  if (!$) {
@@ -3186,7 +3186,7 @@ function Ti() {
3186
3186
  });
3187
3187
  }).catch(g);
3188
3188
  });
3189
- return D(a, o), a;
3189
+ return C(a, o), a;
3190
3190
  }
3191
3191
  function Fr(o, f) {
3192
3192
  f = q.apply(this, arguments);
@@ -3196,173 +3196,173 @@ function Ti() {
3196
3196
  if (!o.name)
3197
3197
  g = w.reject("Invalid arguments");
3198
3198
  else {
3199
- var p = o.name === a.name && m._dbInfo.db, S = p ? w.resolve(m._dbInfo.db) : ce(o).then(function(O) {
3199
+ var p = o.name === a.name && m._dbInfo.db, E = p ? w.resolve(m._dbInfo.db) : le(o).then(function(k) {
3200
3200
  var R = u[o.name], A = R.forages;
3201
- R.db = O;
3201
+ R.db = k;
3202
3202
  for (var $ = 0; $ < A.length; $++)
3203
- A[$]._dbInfo.db = O;
3204
- return O;
3203
+ A[$]._dbInfo.db = k;
3204
+ return k;
3205
3205
  });
3206
- o.storeName ? g = S.then(function(O) {
3207
- if (O.objectStoreNames.contains(o.storeName)) {
3208
- var R = O.version + 1;
3206
+ o.storeName ? g = E.then(function(k) {
3207
+ if (k.objectStoreNames.contains(o.storeName)) {
3208
+ var R = k.version + 1;
3209
3209
  N(o);
3210
3210
  var A = u[o.name], $ = A.forages;
3211
- O.close();
3212
- for (var C = 0; C < $.length; C++) {
3213
- var j = $[C];
3211
+ k.close();
3212
+ for (var L = 0; L < $.length; L++) {
3213
+ var j = $[L];
3214
3214
  j._dbInfo.db = null, j._dbInfo.version = R;
3215
3215
  }
3216
- var F = new w(function(W, K) {
3217
- var z = b.open(o.name, R);
3218
- z.onerror = function(se) {
3219
- var Oe = z.result;
3220
- Oe.close(), K(se);
3221
- }, z.onupgradeneeded = function() {
3222
- var se = z.result;
3223
- se.deleteObjectStore(o.storeName);
3224
- }, z.onsuccess = function() {
3225
- var se = z.result;
3226
- se.close(), W(se);
3216
+ var F = new w(function(z, V) {
3217
+ var Y = b.open(o.name, R);
3218
+ Y.onerror = function(oe) {
3219
+ var Oe = Y.result;
3220
+ Oe.close(), V(oe);
3221
+ }, Y.onupgradeneeded = function() {
3222
+ var oe = Y.result;
3223
+ oe.deleteObjectStore(o.storeName);
3224
+ }, Y.onsuccess = function() {
3225
+ var oe = Y.result;
3226
+ oe.close(), z(oe);
3227
3227
  };
3228
3228
  });
3229
- return F.then(function(W) {
3230
- A.db = W;
3231
- for (var K = 0; K < $.length; K++) {
3232
- var z = $[K];
3233
- z._dbInfo.db = W, J(z._dbInfo);
3229
+ return F.then(function(z) {
3230
+ A.db = z;
3231
+ for (var V = 0; V < $.length; V++) {
3232
+ var Y = $[V];
3233
+ Y._dbInfo.db = z, Q(Y._dbInfo);
3234
3234
  }
3235
- }).catch(function(W) {
3236
- throw (ne(o, W) || w.resolve()).catch(function() {
3237
- }), W;
3235
+ }).catch(function(z) {
3236
+ throw (ie(o, z) || w.resolve()).catch(function() {
3237
+ }), z;
3238
3238
  });
3239
3239
  }
3240
- }) : g = S.then(function(O) {
3240
+ }) : g = E.then(function(k) {
3241
3241
  N(o);
3242
3242
  var R = u[o.name], A = R.forages;
3243
- O.close();
3243
+ k.close();
3244
3244
  for (var $ = 0; $ < A.length; $++) {
3245
- var C = A[$];
3246
- C._dbInfo.db = null;
3245
+ var L = A[$];
3246
+ L._dbInfo.db = null;
3247
3247
  }
3248
- var j = new w(function(F, W) {
3249
- var K = b.deleteDatabase(o.name);
3250
- K.onerror = function() {
3251
- var z = K.result;
3252
- z && z.close(), W(K.error);
3253
- }, K.onblocked = function() {
3254
- }, K.onsuccess = function() {
3255
- var z = K.result;
3256
- z && z.close(), F(z);
3248
+ var j = new w(function(F, z) {
3249
+ var V = b.deleteDatabase(o.name);
3250
+ V.onerror = function() {
3251
+ var Y = V.result;
3252
+ Y && Y.close(), z(V.error);
3253
+ }, V.onblocked = function() {
3254
+ }, V.onsuccess = function() {
3255
+ var Y = V.result;
3256
+ Y && Y.close(), F(Y);
3257
3257
  };
3258
3258
  });
3259
3259
  return j.then(function(F) {
3260
3260
  R.db = F;
3261
- for (var W = 0; W < A.length; W++) {
3262
- var K = A[W];
3263
- J(K._dbInfo);
3261
+ for (var z = 0; z < A.length; z++) {
3262
+ var V = A[z];
3263
+ Q(V._dbInfo);
3264
3264
  }
3265
3265
  }).catch(function(F) {
3266
- throw (ne(o, F) || w.resolve()).catch(function() {
3266
+ throw (ie(o, F) || w.resolve()).catch(function() {
3267
3267
  }), F;
3268
3268
  });
3269
3269
  });
3270
3270
  }
3271
- return D(g, f), g;
3271
+ return C(g, f), g;
3272
3272
  }
3273
- var Wr = {
3273
+ var zr = {
3274
3274
  _driver: "asyncStorage",
3275
- _initStorage: Lr,
3275
+ _initStorage: Dr,
3276
3276
  _support: v(),
3277
- iterate: Cr,
3278
- getItem: Dr,
3277
+ iterate: Lr,
3278
+ getItem: Cr,
3279
3279
  setItem: Pr,
3280
3280
  removeItem: Nr,
3281
3281
  clear: Br,
3282
3282
  length: jr,
3283
- key: Ur,
3284
- keys: Mr,
3283
+ key: Mr,
3284
+ keys: Ur,
3285
3285
  dropInstance: Fr
3286
3286
  };
3287
3287
  function Hr() {
3288
3288
  return typeof openDatabase == "function";
3289
3289
  }
3290
- var he = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", qr = "~~local_forage_type~", It = /^~~local_forage_type~([^~]+)~/, Be = "__lfsc__:", Qe = Be.length, Ze = "arbf", et = "blob", $t = "si08", Tt = "ui08", Lt = "uic8", Dt = "si16", Ct = "si32", Pt = "ur16", Nt = "ui32", Bt = "fl32", jt = "fl64", Ut = Qe + Ze.length, Mt = Object.prototype.toString;
3291
- function Ft(o) {
3292
- var f = o.length * 0.75, a = o.length, m, g = 0, p, S, O, R;
3290
+ var de = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Wr = "~~local_forage_type~", $t = /^~~local_forage_type~([^~]+)~/, je = "__lfsc__:", Ze = je.length, et = "arbf", tt = "blob", Tt = "si08", Dt = "ui08", Ct = "uic8", Lt = "si16", Pt = "si32", Nt = "ur16", Bt = "ui32", jt = "fl32", Mt = "fl64", Ut = Ze + et.length, Ft = Object.prototype.toString;
3291
+ function zt(o) {
3292
+ var f = o.length * 0.75, a = o.length, m, g = 0, p, E, k, R;
3293
3293
  o[o.length - 1] === "=" && (f--, o[o.length - 2] === "=" && f--);
3294
3294
  var A = new ArrayBuffer(f), $ = new Uint8Array(A);
3295
3295
  for (m = 0; m < a; m += 4)
3296
- p = he.indexOf(o[m]), S = he.indexOf(o[m + 1]), O = he.indexOf(o[m + 2]), R = he.indexOf(o[m + 3]), $[g++] = p << 2 | S >> 4, $[g++] = (S & 15) << 4 | O >> 2, $[g++] = (O & 3) << 6 | R & 63;
3296
+ p = de.indexOf(o[m]), E = de.indexOf(o[m + 1]), k = de.indexOf(o[m + 2]), R = de.indexOf(o[m + 3]), $[g++] = p << 2 | E >> 4, $[g++] = (E & 15) << 4 | k >> 2, $[g++] = (k & 3) << 6 | R & 63;
3297
3297
  return A;
3298
3298
  }
3299
- function tt(o) {
3299
+ function rt(o) {
3300
3300
  var f = new Uint8Array(o), a = "", m;
3301
3301
  for (m = 0; m < f.length; m += 3)
3302
- a += he[f[m] >> 2], a += he[(f[m] & 3) << 4 | f[m + 1] >> 4], a += he[(f[m + 1] & 15) << 2 | f[m + 2] >> 6], a += he[f[m + 2] & 63];
3302
+ a += de[f[m] >> 2], a += de[(f[m] & 3) << 4 | f[m + 1] >> 4], a += de[(f[m + 1] & 15) << 2 | f[m + 2] >> 6], a += de[f[m + 2] & 63];
3303
3303
  return f.length % 3 === 2 ? a = a.substring(0, a.length - 1) + "=" : f.length % 3 === 1 && (a = a.substring(0, a.length - 2) + "=="), a;
3304
3304
  }
3305
- function zr(o, f) {
3305
+ function qr(o, f) {
3306
3306
  var a = "";
3307
- if (o && (a = Mt.call(o)), o && (a === "[object ArrayBuffer]" || o.buffer && Mt.call(o.buffer) === "[object ArrayBuffer]")) {
3308
- var m, g = Be;
3309
- o instanceof ArrayBuffer ? (m = o, g += Ze) : (m = o.buffer, a === "[object Int8Array]" ? g += $t : a === "[object Uint8Array]" ? g += Tt : a === "[object Uint8ClampedArray]" ? g += Lt : a === "[object Int16Array]" ? g += Dt : a === "[object Uint16Array]" ? g += Pt : a === "[object Int32Array]" ? g += Ct : a === "[object Uint32Array]" ? g += Nt : a === "[object Float32Array]" ? g += Bt : a === "[object Float64Array]" ? g += jt : f(new Error("Failed to get type for BinaryArray"))), f(g + tt(m));
3307
+ if (o && (a = Ft.call(o)), o && (a === "[object ArrayBuffer]" || o.buffer && Ft.call(o.buffer) === "[object ArrayBuffer]")) {
3308
+ var m, g = je;
3309
+ o instanceof ArrayBuffer ? (m = o, g += et) : (m = o.buffer, a === "[object Int8Array]" ? g += Tt : a === "[object Uint8Array]" ? g += Dt : a === "[object Uint8ClampedArray]" ? g += Ct : a === "[object Int16Array]" ? g += Lt : a === "[object Uint16Array]" ? g += Nt : a === "[object Int32Array]" ? g += Pt : a === "[object Uint32Array]" ? g += Bt : a === "[object Float32Array]" ? g += jt : a === "[object Float64Array]" ? g += Mt : f(new Error("Failed to get type for BinaryArray"))), f(g + rt(m));
3310
3310
  } else if (a === "[object Blob]") {
3311
3311
  var p = new FileReader();
3312
3312
  p.onload = function() {
3313
- var S = qr + o.type + "~" + tt(this.result);
3314
- f(Be + et + S);
3313
+ var E = Wr + o.type + "~" + rt(this.result);
3314
+ f(je + tt + E);
3315
3315
  }, p.readAsArrayBuffer(o);
3316
3316
  } else
3317
3317
  try {
3318
3318
  f(JSON.stringify(o));
3319
- } catch (S) {
3320
- f(null, S);
3319
+ } catch (E) {
3320
+ f(null, E);
3321
3321
  }
3322
3322
  }
3323
3323
  function Yr(o) {
3324
- if (o.substring(0, Qe) !== Be)
3324
+ if (o.substring(0, Ze) !== je)
3325
3325
  return JSON.parse(o);
3326
- var f = o.substring(Ut), a = o.substring(Qe, Ut), m;
3327
- if (a === et && It.test(f)) {
3328
- var g = f.match(It);
3326
+ var f = o.substring(Ut), a = o.substring(Ze, Ut), m;
3327
+ if (a === tt && $t.test(f)) {
3328
+ var g = f.match($t);
3329
3329
  m = g[1], f = f.substring(g[0].length);
3330
3330
  }
3331
- var p = Ft(f);
3331
+ var p = zt(f);
3332
3332
  switch (a) {
3333
- case Ze:
3334
- return p;
3335
3333
  case et:
3336
- return E([p], { type: m });
3337
- case $t:
3338
- return new Int8Array(p);
3334
+ return p;
3335
+ case tt:
3336
+ return S([p], { type: m });
3339
3337
  case Tt:
3338
+ return new Int8Array(p);
3339
+ case Dt:
3340
3340
  return new Uint8Array(p);
3341
- case Lt:
3341
+ case Ct:
3342
3342
  return new Uint8ClampedArray(p);
3343
- case Dt:
3343
+ case Lt:
3344
3344
  return new Int16Array(p);
3345
- case Pt:
3345
+ case Nt:
3346
3346
  return new Uint16Array(p);
3347
- case Ct:
3347
+ case Pt:
3348
3348
  return new Int32Array(p);
3349
- case Nt:
3350
- return new Uint32Array(p);
3351
3349
  case Bt:
3352
- return new Float32Array(p);
3350
+ return new Uint32Array(p);
3353
3351
  case jt:
3352
+ return new Float32Array(p);
3353
+ case Mt:
3354
3354
  return new Float64Array(p);
3355
3355
  default:
3356
3356
  throw new Error("Unkown type: " + a);
3357
3357
  }
3358
3358
  }
3359
- var rt = {
3360
- serialize: zr,
3359
+ var nt = {
3360
+ serialize: qr,
3361
3361
  deserialize: Yr,
3362
- stringToBuffer: Ft,
3363
- bufferToString: tt
3362
+ stringToBuffer: zt,
3363
+ bufferToString: rt
3364
3364
  };
3365
- function Wt(o, f, a, m) {
3365
+ function Ht(o, f, a, m) {
3366
3366
  o.executeSql("CREATE TABLE IF NOT EXISTS " + f.storeName + " (id INTEGER PRIMARY KEY, key unique, value)", [], a, m);
3367
3367
  }
3368
3368
  function Kr(o) {
@@ -3372,59 +3372,59 @@ function Ti() {
3372
3372
  if (o)
3373
3373
  for (var m in o)
3374
3374
  a[m] = typeof o[m] != "string" ? o[m].toString() : o[m];
3375
- var g = new w(function(p, S) {
3375
+ var g = new w(function(p, E) {
3376
3376
  try {
3377
3377
  a.db = openDatabase(a.name, String(a.version), a.description, a.size);
3378
- } catch (O) {
3379
- return S(O);
3378
+ } catch (k) {
3379
+ return E(k);
3380
3380
  }
3381
- a.db.transaction(function(O) {
3382
- Wt(O, a, function() {
3381
+ a.db.transaction(function(k) {
3382
+ Ht(k, a, function() {
3383
3383
  f._dbInfo = a, p();
3384
3384
  }, function(R, A) {
3385
- S(A);
3385
+ E(A);
3386
3386
  });
3387
- }, S);
3387
+ }, E);
3388
3388
  });
3389
- return a.serializer = rt, g;
3389
+ return a.serializer = nt, g;
3390
3390
  }
3391
- function de(o, f, a, m, g, p) {
3392
- o.executeSql(a, m, g, function(S, O) {
3393
- O.code === O.SYNTAX_ERR ? S.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?", [f.storeName], function(R, A) {
3394
- A.rows.length ? p(R, O) : Wt(R, f, function() {
3391
+ function pe(o, f, a, m, g, p) {
3392
+ o.executeSql(a, m, g, function(E, k) {
3393
+ k.code === k.SYNTAX_ERR ? E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?", [f.storeName], function(R, A) {
3394
+ A.rows.length ? p(R, k) : Ht(R, f, function() {
3395
3395
  R.executeSql(a, m, g, p);
3396
3396
  }, p);
3397
- }, p) : p(S, O);
3397
+ }, p) : p(E, k);
3398
3398
  }, p);
3399
3399
  }
3400
3400
  function Vr(o, f) {
3401
3401
  var a = this;
3402
- o = L(o);
3402
+ o = D(o);
3403
3403
  var m = new w(function(g, p) {
3404
3404
  a.ready().then(function() {
3405
- var S = a._dbInfo;
3406
- S.db.transaction(function(O) {
3407
- de(O, S, "SELECT * FROM " + S.storeName + " WHERE key = ? LIMIT 1", [o], function(R, A) {
3405
+ var E = a._dbInfo;
3406
+ E.db.transaction(function(k) {
3407
+ pe(k, E, "SELECT * FROM " + E.storeName + " WHERE key = ? LIMIT 1", [o], function(R, A) {
3408
3408
  var $ = A.rows.length ? A.rows.item(0).value : null;
3409
- $ && ($ = S.serializer.deserialize($)), g($);
3409
+ $ && ($ = E.serializer.deserialize($)), g($);
3410
3410
  }, function(R, A) {
3411
3411
  p(A);
3412
3412
  });
3413
3413
  });
3414
3414
  }).catch(p);
3415
3415
  });
3416
- return D(m, f), m;
3416
+ return C(m, f), m;
3417
3417
  }
3418
3418
  function Gr(o, f) {
3419
3419
  var a = this, m = new w(function(g, p) {
3420
3420
  a.ready().then(function() {
3421
- var S = a._dbInfo;
3422
- S.db.transaction(function(O) {
3423
- de(O, S, "SELECT * FROM " + S.storeName, [], function(R, A) {
3424
- for (var $ = A.rows, C = $.length, j = 0; j < C; j++) {
3425
- var F = $.item(j), W = F.value;
3426
- if (W && (W = S.serializer.deserialize(W)), W = o(W, F.key, j + 1), W !== void 0) {
3427
- g(W);
3421
+ var E = a._dbInfo;
3422
+ E.db.transaction(function(k) {
3423
+ pe(k, E, "SELECT * FROM " + E.storeName, [], function(R, A) {
3424
+ for (var $ = A.rows, L = $.length, j = 0; j < L; j++) {
3425
+ var F = $.item(j), z = F.value;
3426
+ if (z && (z = E.serializer.deserialize(z)), z = o(z, F.key, j + 1), z !== void 0) {
3427
+ g(z);
3428
3428
  return;
3429
3429
  }
3430
3430
  }
@@ -3435,47 +3435,47 @@ function Ti() {
3435
3435
  });
3436
3436
  }).catch(p);
3437
3437
  });
3438
- return D(m, f), m;
3438
+ return C(m, f), m;
3439
3439
  }
3440
- function Ht(o, f, a, m) {
3440
+ function Wt(o, f, a, m) {
3441
3441
  var g = this;
3442
- o = L(o);
3443
- var p = new w(function(S, O) {
3442
+ o = D(o);
3443
+ var p = new w(function(E, k) {
3444
3444
  g.ready().then(function() {
3445
3445
  f === void 0 && (f = null);
3446
3446
  var R = f, A = g._dbInfo;
3447
- A.serializer.serialize(f, function($, C) {
3448
- C ? O(C) : A.db.transaction(function(j) {
3449
- de(j, A, "INSERT OR REPLACE INTO " + A.storeName + " (key, value) VALUES (?, ?)", [o, $], function() {
3450
- S(R);
3451
- }, function(F, W) {
3452
- O(W);
3447
+ A.serializer.serialize(f, function($, L) {
3448
+ L ? k(L) : A.db.transaction(function(j) {
3449
+ pe(j, A, "INSERT OR REPLACE INTO " + A.storeName + " (key, value) VALUES (?, ?)", [o, $], function() {
3450
+ E(R);
3451
+ }, function(F, z) {
3452
+ k(z);
3453
3453
  });
3454
3454
  }, function(j) {
3455
3455
  if (j.code === j.QUOTA_ERR) {
3456
3456
  if (m > 0) {
3457
- S(Ht.apply(g, [o, R, a, m - 1]));
3457
+ E(Wt.apply(g, [o, R, a, m - 1]));
3458
3458
  return;
3459
3459
  }
3460
- O(j);
3460
+ k(j);
3461
3461
  }
3462
3462
  });
3463
3463
  });
3464
- }).catch(O);
3464
+ }).catch(k);
3465
3465
  });
3466
- return D(p, a), p;
3466
+ return C(p, a), p;
3467
3467
  }
3468
3468
  function Xr(o, f, a) {
3469
- return Ht.apply(this, [o, f, a, 1]);
3469
+ return Wt.apply(this, [o, f, a, 1]);
3470
3470
  }
3471
3471
  function Jr(o, f) {
3472
3472
  var a = this;
3473
- o = L(o);
3473
+ o = D(o);
3474
3474
  var m = new w(function(g, p) {
3475
3475
  a.ready().then(function() {
3476
- var S = a._dbInfo;
3477
- S.db.transaction(function(O) {
3478
- de(O, S, "DELETE FROM " + S.storeName + " WHERE key = ?", [o], function() {
3476
+ var E = a._dbInfo;
3477
+ E.db.transaction(function(k) {
3478
+ pe(k, E, "DELETE FROM " + E.storeName + " WHERE key = ?", [o], function() {
3479
3479
  g();
3480
3480
  }, function(R, A) {
3481
3481
  p(A);
@@ -3483,45 +3483,45 @@ function Ti() {
3483
3483
  });
3484
3484
  }).catch(p);
3485
3485
  });
3486
- return D(m, f), m;
3486
+ return C(m, f), m;
3487
3487
  }
3488
3488
  function Qr(o) {
3489
3489
  var f = this, a = new w(function(m, g) {
3490
3490
  f.ready().then(function() {
3491
3491
  var p = f._dbInfo;
3492
- p.db.transaction(function(S) {
3493
- de(S, p, "DELETE FROM " + p.storeName, [], function() {
3492
+ p.db.transaction(function(E) {
3493
+ pe(E, p, "DELETE FROM " + p.storeName, [], function() {
3494
3494
  m();
3495
- }, function(O, R) {
3495
+ }, function(k, R) {
3496
3496
  g(R);
3497
3497
  });
3498
3498
  });
3499
3499
  }).catch(g);
3500
3500
  });
3501
- return D(a, o), a;
3501
+ return C(a, o), a;
3502
3502
  }
3503
3503
  function Zr(o) {
3504
3504
  var f = this, a = new w(function(m, g) {
3505
3505
  f.ready().then(function() {
3506
3506
  var p = f._dbInfo;
3507
- p.db.transaction(function(S) {
3508
- de(S, p, "SELECT COUNT(key) as c FROM " + p.storeName, [], function(O, R) {
3507
+ p.db.transaction(function(E) {
3508
+ pe(E, p, "SELECT COUNT(key) as c FROM " + p.storeName, [], function(k, R) {
3509
3509
  var A = R.rows.item(0).c;
3510
3510
  m(A);
3511
- }, function(O, R) {
3511
+ }, function(k, R) {
3512
3512
  g(R);
3513
3513
  });
3514
3514
  });
3515
3515
  }).catch(g);
3516
3516
  });
3517
- return D(a, o), a;
3517
+ return C(a, o), a;
3518
3518
  }
3519
3519
  function en(o, f) {
3520
3520
  var a = this, m = new w(function(g, p) {
3521
3521
  a.ready().then(function() {
3522
- var S = a._dbInfo;
3523
- S.db.transaction(function(O) {
3524
- de(O, S, "SELECT key FROM " + S.storeName + " WHERE id = ? LIMIT 1", [o + 1], function(R, A) {
3522
+ var E = a._dbInfo;
3523
+ E.db.transaction(function(k) {
3524
+ pe(k, E, "SELECT key FROM " + E.storeName + " WHERE id = ? LIMIT 1", [o + 1], function(R, A) {
3525
3525
  var $ = A.rows.length ? A.rows.item(0).key : null;
3526
3526
  g($);
3527
3527
  }, function(R, A) {
@@ -3530,34 +3530,34 @@ function Ti() {
3530
3530
  });
3531
3531
  }).catch(p);
3532
3532
  });
3533
- return D(m, f), m;
3533
+ return C(m, f), m;
3534
3534
  }
3535
3535
  function tn(o) {
3536
3536
  var f = this, a = new w(function(m, g) {
3537
3537
  f.ready().then(function() {
3538
3538
  var p = f._dbInfo;
3539
- p.db.transaction(function(S) {
3540
- de(S, p, "SELECT key FROM " + p.storeName, [], function(O, R) {
3539
+ p.db.transaction(function(E) {
3540
+ pe(E, p, "SELECT key FROM " + p.storeName, [], function(k, R) {
3541
3541
  for (var A = [], $ = 0; $ < R.rows.length; $++)
3542
3542
  A.push(R.rows.item($).key);
3543
3543
  m(A);
3544
- }, function(O, R) {
3544
+ }, function(k, R) {
3545
3545
  g(R);
3546
3546
  });
3547
3547
  });
3548
3548
  }).catch(g);
3549
3549
  });
3550
- return D(a, o), a;
3550
+ return C(a, o), a;
3551
3551
  }
3552
3552
  function rn(o) {
3553
3553
  return new w(function(f, a) {
3554
3554
  o.transaction(function(m) {
3555
3555
  m.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'", [], function(g, p) {
3556
- for (var S = [], O = 0; O < p.rows.length; O++)
3557
- S.push(p.rows.item(O).name);
3556
+ for (var E = [], k = 0; k < p.rows.length; k++)
3557
+ E.push(p.rows.item(k).name);
3558
3558
  f({
3559
3559
  db: o,
3560
- storeNames: S
3560
+ storeNames: E
3561
3561
  });
3562
3562
  }, function(g, p) {
3563
3563
  a(p);
@@ -3573,35 +3573,35 @@ function Ti() {
3573
3573
  o = typeof o != "function" && o || {}, o.name || (o.name = o.name || a.name, o.storeName = o.storeName || a.storeName);
3574
3574
  var m = this, g;
3575
3575
  return o.name ? g = new w(function(p) {
3576
- var S;
3577
- o.name === a.name ? S = m._dbInfo.db : S = openDatabase(o.name, "", "", 0), o.storeName ? p({
3578
- db: S,
3576
+ var E;
3577
+ o.name === a.name ? E = m._dbInfo.db : E = openDatabase(o.name, "", "", 0), o.storeName ? p({
3578
+ db: E,
3579
3579
  storeNames: [o.storeName]
3580
- }) : p(rn(S));
3580
+ }) : p(rn(E));
3581
3581
  }).then(function(p) {
3582
- return new w(function(S, O) {
3582
+ return new w(function(E, k) {
3583
3583
  p.db.transaction(function(R) {
3584
3584
  function A(F) {
3585
- return new w(function(W, K) {
3585
+ return new w(function(z, V) {
3586
3586
  R.executeSql("DROP TABLE IF EXISTS " + F, [], function() {
3587
- W();
3588
- }, function(z, se) {
3589
- K(se);
3587
+ z();
3588
+ }, function(Y, oe) {
3589
+ V(oe);
3590
3590
  });
3591
3591
  });
3592
3592
  }
3593
- for (var $ = [], C = 0, j = p.storeNames.length; C < j; C++)
3594
- $.push(A(p.storeNames[C]));
3593
+ for (var $ = [], L = 0, j = p.storeNames.length; L < j; L++)
3594
+ $.push(A(p.storeNames[L]));
3595
3595
  w.all($).then(function() {
3596
- S();
3596
+ E();
3597
3597
  }).catch(function(F) {
3598
- O(F);
3598
+ k(F);
3599
3599
  });
3600
3600
  }, function(R) {
3601
- O(R);
3601
+ k(R);
3602
3602
  });
3603
3603
  });
3604
- }) : g = w.reject("Invalid arguments"), D(g, f), g;
3604
+ }) : g = w.reject("Invalid arguments"), C(g, f), g;
3605
3605
  }
3606
3606
  var sn = {
3607
3607
  _driver: "webSQLStorage",
@@ -3645,7 +3645,7 @@ function Ti() {
3645
3645
  if (o)
3646
3646
  for (var m in o)
3647
3647
  a[m] = o[m];
3648
- return a.keyPrefix = qt(o, f._defaultConfig), cn() ? (f._dbInfo = a, a.serializer = rt, w.resolve()) : w.reject();
3648
+ return a.keyPrefix = qt(o, f._defaultConfig), cn() ? (f._dbInfo = a, a.serializer = nt, w.resolve()) : w.reject();
3649
3649
  }
3650
3650
  function un(o) {
3651
3651
  var f = this, a = f.ready().then(function() {
@@ -3654,29 +3654,29 @@ function Ti() {
3654
3654
  p.indexOf(m) === 0 && localStorage.removeItem(p);
3655
3655
  }
3656
3656
  });
3657
- return D(a, o), a;
3657
+ return C(a, o), a;
3658
3658
  }
3659
3659
  function fn(o, f) {
3660
3660
  var a = this;
3661
- o = L(o);
3661
+ o = D(o);
3662
3662
  var m = a.ready().then(function() {
3663
3663
  var g = a._dbInfo, p = localStorage.getItem(g.keyPrefix + o);
3664
3664
  return p && (p = g.serializer.deserialize(p)), p;
3665
3665
  });
3666
- return D(m, f), m;
3666
+ return C(m, f), m;
3667
3667
  }
3668
3668
  function hn(o, f) {
3669
3669
  var a = this, m = a.ready().then(function() {
3670
- for (var g = a._dbInfo, p = g.keyPrefix, S = p.length, O = localStorage.length, R = 1, A = 0; A < O; A++) {
3670
+ for (var g = a._dbInfo, p = g.keyPrefix, E = p.length, k = localStorage.length, R = 1, A = 0; A < k; A++) {
3671
3671
  var $ = localStorage.key(A);
3672
3672
  if ($.indexOf(p) === 0) {
3673
- var C = localStorage.getItem($);
3674
- if (C && (C = g.serializer.deserialize(C)), C = o(C, $.substring(S), R++), C !== void 0)
3675
- return C;
3673
+ var L = localStorage.getItem($);
3674
+ if (L && (L = g.serializer.deserialize(L)), L = o(L, $.substring(E), R++), L !== void 0)
3675
+ return L;
3676
3676
  }
3677
3677
  }
3678
3678
  });
3679
- return D(m, f), m;
3679
+ return C(m, f), m;
3680
3680
  }
3681
3681
  function dn(o, f) {
3682
3682
  var a = this, m = a.ready().then(function() {
@@ -3688,54 +3688,54 @@ function Ti() {
3688
3688
  }
3689
3689
  return p && (p = p.substring(g.keyPrefix.length)), p;
3690
3690
  });
3691
- return D(m, f), m;
3691
+ return C(m, f), m;
3692
3692
  }
3693
3693
  function pn(o) {
3694
3694
  var f = this, a = f.ready().then(function() {
3695
- for (var m = f._dbInfo, g = localStorage.length, p = [], S = 0; S < g; S++) {
3696
- var O = localStorage.key(S);
3697
- O.indexOf(m.keyPrefix) === 0 && p.push(O.substring(m.keyPrefix.length));
3695
+ for (var m = f._dbInfo, g = localStorage.length, p = [], E = 0; E < g; E++) {
3696
+ var k = localStorage.key(E);
3697
+ k.indexOf(m.keyPrefix) === 0 && p.push(k.substring(m.keyPrefix.length));
3698
3698
  }
3699
3699
  return p;
3700
3700
  });
3701
- return D(a, o), a;
3701
+ return C(a, o), a;
3702
3702
  }
3703
3703
  function mn(o) {
3704
3704
  var f = this, a = f.keys().then(function(m) {
3705
3705
  return m.length;
3706
3706
  });
3707
- return D(a, o), a;
3707
+ return C(a, o), a;
3708
3708
  }
3709
3709
  function yn(o, f) {
3710
3710
  var a = this;
3711
- o = L(o);
3711
+ o = D(o);
3712
3712
  var m = a.ready().then(function() {
3713
3713
  var g = a._dbInfo;
3714
3714
  localStorage.removeItem(g.keyPrefix + o);
3715
3715
  });
3716
- return D(m, f), m;
3716
+ return C(m, f), m;
3717
3717
  }
3718
3718
  function gn(o, f, a) {
3719
3719
  var m = this;
3720
- o = L(o);
3720
+ o = D(o);
3721
3721
  var g = m.ready().then(function() {
3722
3722
  f === void 0 && (f = null);
3723
3723
  var p = f;
3724
- return new w(function(S, O) {
3724
+ return new w(function(E, k) {
3725
3725
  var R = m._dbInfo;
3726
3726
  R.serializer.serialize(f, function(A, $) {
3727
3727
  if ($)
3728
- O($);
3728
+ k($);
3729
3729
  else
3730
3730
  try {
3731
- localStorage.setItem(R.keyPrefix + o, A), S(p);
3732
- } catch (C) {
3733
- (C.name === "QuotaExceededError" || C.name === "NS_ERROR_DOM_QUOTA_REACHED") && O(C), O(C);
3731
+ localStorage.setItem(R.keyPrefix + o, A), E(p);
3732
+ } catch (L) {
3733
+ (L.name === "QuotaExceededError" || L.name === "NS_ERROR_DOM_QUOTA_REACHED") && k(L), k(L);
3734
3734
  }
3735
3735
  });
3736
3736
  });
3737
3737
  });
3738
- return D(g, a), g;
3738
+ return C(g, a), g;
3739
3739
  }
3740
3740
  function bn(o, f) {
3741
3741
  if (f = q.apply(this, arguments), o = typeof o != "function" && o || {}, !o.name) {
@@ -3746,11 +3746,11 @@ function Ti() {
3746
3746
  return o.name ? g = new w(function(p) {
3747
3747
  o.storeName ? p(qt(o, m._defaultConfig)) : p(o.name + "/");
3748
3748
  }).then(function(p) {
3749
- for (var S = localStorage.length - 1; S >= 0; S--) {
3750
- var O = localStorage.key(S);
3751
- O.indexOf(p) === 0 && localStorage.removeItem(O);
3749
+ for (var E = localStorage.length - 1; E >= 0; E--) {
3750
+ var k = localStorage.key(E);
3751
+ k.indexOf(p) === 0 && localStorage.removeItem(k);
3752
3752
  }
3753
- }) : g = w.reject("Invalid arguments"), D(g, f), g;
3753
+ }) : g = w.reject("Invalid arguments"), C(g, f), g;
3754
3754
  }
3755
3755
  var vn = {
3756
3756
  _driver: "localStorageWrapper",
@@ -3774,13 +3774,13 @@ function Ti() {
3774
3774
  g++;
3775
3775
  }
3776
3776
  return !1;
3777
- }, zt = Array.isArray || function(o) {
3777
+ }, Yt = Array.isArray || function(o) {
3778
3778
  return Object.prototype.toString.call(o) === "[object Array]";
3779
- }, xe = {}, Yt = {}, we = {
3780
- INDEXEDDB: Wr,
3779
+ }, ke = {}, Kt = {}, _e = {
3780
+ INDEXEDDB: zr,
3781
3781
  WEBSQL: sn,
3782
3782
  LOCALSTORAGE: vn
3783
- }, Sn = [we.INDEXEDDB._driver, we.WEBSQL._driver, we.LOCALSTORAGE._driver], je = ["dropInstance"], nt = ["clear", "getItem", "iterate", "key", "keys", "length", "removeItem", "setItem"].concat(je), En = {
3783
+ }, Sn = [_e.INDEXEDDB._driver, _e.WEBSQL._driver, _e.LOCALSTORAGE._driver], Me = ["dropInstance"], it = ["clear", "getItem", "iterate", "key", "keys", "length", "removeItem", "setItem"].concat(Me), En = {
3784
3784
  description: "",
3785
3785
  driver: Sn.slice(),
3786
3786
  name: "localforage",
@@ -3798,24 +3798,24 @@ function Ti() {
3798
3798
  });
3799
3799
  };
3800
3800
  }
3801
- function it() {
3801
+ function st() {
3802
3802
  for (var o = 1; o < arguments.length; o++) {
3803
3803
  var f = arguments[o];
3804
3804
  if (f)
3805
3805
  for (var a in f)
3806
- f.hasOwnProperty(a) && (zt(f[a]) ? arguments[0][a] = f[a].slice() : arguments[0][a] = f[a]);
3806
+ f.hasOwnProperty(a) && (Yt(f[a]) ? arguments[0][a] = f[a].slice() : arguments[0][a] = f[a]);
3807
3807
  }
3808
3808
  return arguments[0];
3809
3809
  }
3810
- var On = function() {
3810
+ var kn = function() {
3811
3811
  function o(f) {
3812
3812
  c(this, o);
3813
- for (var a in we)
3814
- if (we.hasOwnProperty(a)) {
3815
- var m = we[a], g = m._driver;
3816
- this[a] = g, xe[g] || this.defineDriver(m);
3813
+ for (var a in _e)
3814
+ if (_e.hasOwnProperty(a)) {
3815
+ var m = _e[a], g = m._driver;
3816
+ this[a] = g, ke[g] || this.defineDriver(m);
3817
3817
  }
3818
- this._defaultConfig = it({}, En), this._config = it({}, this._defaultConfig, f), this._driverSet = null, this._initDriver = null, this._ready = !1, this._dbInfo = null, this._wrapLibraryMethodsWithReady(), this.setDriver(this._config.driver).catch(function() {
3818
+ this._defaultConfig = st({}, En), this._config = st({}, this._defaultConfig, f), this._driverSet = null, this._initDriver = null, this._ready = !1, this._dbInfo = null, this._wrapLibraryMethodsWithReady(), this.setDriver(this._config.driver).catch(function() {
3819
3819
  });
3820
3820
  }
3821
3821
  return o.prototype.config = function(a) {
@@ -3830,75 +3830,75 @@ function Ti() {
3830
3830
  return "driver" in a && a.driver ? this.setDriver(this._config.driver) : !0;
3831
3831
  } else return typeof a == "string" ? this._config[a] : this._config;
3832
3832
  }, o.prototype.defineDriver = function(a, m, g) {
3833
- var p = new w(function(S, O) {
3833
+ var p = new w(function(E, k) {
3834
3834
  try {
3835
3835
  var R = a._driver, A = new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");
3836
3836
  if (!a._driver) {
3837
- O(A);
3837
+ k(A);
3838
3838
  return;
3839
3839
  }
3840
- for (var $ = nt.concat("_initStorage"), C = 0, j = $.length; C < j; C++) {
3841
- var F = $[C], W = !_n(je, F);
3842
- if ((W || a[F]) && typeof a[F] != "function") {
3843
- O(A);
3840
+ for (var $ = it.concat("_initStorage"), L = 0, j = $.length; L < j; L++) {
3841
+ var F = $[L], z = !_n(Me, F);
3842
+ if ((z || a[F]) && typeof a[F] != "function") {
3843
+ k(A);
3844
3844
  return;
3845
3845
  }
3846
3846
  }
3847
- var K = function() {
3847
+ var V = function() {
3848
3848
  for (var Oe = function(An) {
3849
3849
  return function() {
3850
- var In = new Error("Method " + An + " is not implemented by the current driver"), Kt = w.reject(In);
3851
- return D(Kt, arguments[arguments.length - 1]), Kt;
3850
+ var In = new Error("Method " + An + " is not implemented by the current driver"), Vt = w.reject(In);
3851
+ return C(Vt, arguments[arguments.length - 1]), Vt;
3852
3852
  };
3853
- }, st = 0, Rn = je.length; st < Rn; st++) {
3854
- var ot = je[st];
3855
- a[ot] || (a[ot] = Oe(ot));
3853
+ }, ot = 0, Rn = Me.length; ot < Rn; ot++) {
3854
+ var at = Me[ot];
3855
+ a[at] || (a[at] = Oe(at));
3856
3856
  }
3857
3857
  };
3858
- K();
3859
- var z = function(Oe) {
3860
- xe[R], xe[R] = a, Yt[R] = Oe, S();
3858
+ V();
3859
+ var Y = function(Oe) {
3860
+ ke[R], ke[R] = a, Kt[R] = Oe, E();
3861
3861
  };
3862
- "_support" in a ? a._support && typeof a._support == "function" ? a._support().then(z, O) : z(!!a._support) : z(!0);
3863
- } catch (se) {
3864
- O(se);
3862
+ "_support" in a ? a._support && typeof a._support == "function" ? a._support().then(Y, k) : Y(!!a._support) : Y(!0);
3863
+ } catch (oe) {
3864
+ k(oe);
3865
3865
  }
3866
3866
  });
3867
- return k(p, m, g), p;
3867
+ return O(p, m, g), p;
3868
3868
  }, o.prototype.driver = function() {
3869
3869
  return this._driver || null;
3870
3870
  }, o.prototype.getDriver = function(a, m, g) {
3871
- var p = xe[a] ? w.resolve(xe[a]) : w.reject(new Error("Driver not found."));
3872
- return k(p, m, g), p;
3871
+ var p = ke[a] ? w.resolve(ke[a]) : w.reject(new Error("Driver not found."));
3872
+ return O(p, m, g), p;
3873
3873
  }, o.prototype.getSerializer = function(a) {
3874
- var m = w.resolve(rt);
3875
- return k(m, a), m;
3874
+ var m = w.resolve(nt);
3875
+ return O(m, a), m;
3876
3876
  }, o.prototype.ready = function(a) {
3877
3877
  var m = this, g = m._driverSet.then(function() {
3878
3878
  return m._ready === null && (m._ready = m._initDriver()), m._ready;
3879
3879
  });
3880
- return k(g, a, a), g;
3880
+ return O(g, a, a), g;
3881
3881
  }, o.prototype.setDriver = function(a, m, g) {
3882
3882
  var p = this;
3883
- zt(a) || (a = [a]);
3884
- var S = this._getSupportedDrivers(a);
3885
- function O() {
3883
+ Yt(a) || (a = [a]);
3884
+ var E = this._getSupportedDrivers(a);
3885
+ function k() {
3886
3886
  p._config.driver = p.driver();
3887
3887
  }
3888
- function R(C) {
3889
- return p._extend(C), O(), p._ready = p._initStorage(p._config), p._ready;
3888
+ function R(L) {
3889
+ return p._extend(L), k(), p._ready = p._initStorage(p._config), p._ready;
3890
3890
  }
3891
- function A(C) {
3891
+ function A(L) {
3892
3892
  return function() {
3893
3893
  var j = 0;
3894
3894
  function F() {
3895
- for (; j < C.length; ) {
3896
- var W = C[j];
3897
- return j++, p._dbInfo = null, p._ready = null, p.getDriver(W).then(R).catch(F);
3895
+ for (; j < L.length; ) {
3896
+ var z = L[j];
3897
+ return j++, p._dbInfo = null, p._ready = null, p.getDriver(z).then(R).catch(F);
3898
3898
  }
3899
- O();
3900
- var K = new Error("No available storage method found.");
3901
- return p._driverSet = w.reject(K), p._driverSet;
3899
+ k();
3900
+ var V = new Error("No available storage method found.");
3901
+ return p._driverSet = w.reject(V), p._driverSet;
3902
3902
  }
3903
3903
  return F();
3904
3904
  };
@@ -3907,59 +3907,59 @@ function Ti() {
3907
3907
  return w.resolve();
3908
3908
  }) : w.resolve();
3909
3909
  return this._driverSet = $.then(function() {
3910
- var C = S[0];
3911
- return p._dbInfo = null, p._ready = null, p.getDriver(C).then(function(j) {
3912
- p._driver = j._driver, O(), p._wrapLibraryMethodsWithReady(), p._initDriver = A(S);
3910
+ var L = E[0];
3911
+ return p._dbInfo = null, p._ready = null, p.getDriver(L).then(function(j) {
3912
+ p._driver = j._driver, k(), p._wrapLibraryMethodsWithReady(), p._initDriver = A(E);
3913
3913
  });
3914
3914
  }).catch(function() {
3915
- O();
3916
- var C = new Error("No available storage method found.");
3917
- return p._driverSet = w.reject(C), p._driverSet;
3918
- }), k(this._driverSet, m, g), this._driverSet;
3915
+ k();
3916
+ var L = new Error("No available storage method found.");
3917
+ return p._driverSet = w.reject(L), p._driverSet;
3918
+ }), O(this._driverSet, m, g), this._driverSet;
3919
3919
  }, o.prototype.supports = function(a) {
3920
- return !!Yt[a];
3920
+ return !!Kt[a];
3921
3921
  }, o.prototype._extend = function(a) {
3922
- it(this, a);
3922
+ st(this, a);
3923
3923
  }, o.prototype._getSupportedDrivers = function(a) {
3924
3924
  for (var m = [], g = 0, p = a.length; g < p; g++) {
3925
- var S = a[g];
3926
- this.supports(S) && m.push(S);
3925
+ var E = a[g];
3926
+ this.supports(E) && m.push(E);
3927
3927
  }
3928
3928
  return m;
3929
3929
  }, o.prototype._wrapLibraryMethodsWithReady = function() {
3930
- for (var a = 0, m = nt.length; a < m; a++)
3931
- xn(this, nt[a]);
3930
+ for (var a = 0, m = it.length; a < m; a++)
3931
+ xn(this, it[a]);
3932
3932
  }, o.prototype.createInstance = function(a) {
3933
3933
  return new o(a);
3934
3934
  }, o;
3935
- }(), kn = new On();
3936
- n.exports = kn;
3935
+ }(), On = new kn();
3936
+ n.exports = On;
3937
3937
  }, { 3: 3 }] }, {}, [4])(4);
3938
3938
  });
3939
- }(lt)), lt.exports;
3939
+ }(ut)), ut.exports;
3940
3940
  }
3941
- var Li = Ti();
3942
- const Er = /* @__PURE__ */ $i(Li);
3943
- class Di extends Xe {
3941
+ var Ci = Di();
3942
+ const Er = /* @__PURE__ */ Ti(Ci);
3943
+ class Li extends Je {
3944
3944
  constructor(e) {
3945
3945
  super(e, "storage", !1), e.set("localforage", Er);
3946
3946
  }
3947
3947
  get StorageManager() {
3948
- return Le;
3948
+ return Ce;
3949
3949
  }
3950
3950
  createDatabse(e, t, n) {
3951
- return new Le("InPageEdit", e, t, n);
3951
+ return new Ce("InPageEdit", e, t, n);
3952
3952
  }
3953
3953
  }
3954
- class Le {
3954
+ class Ce {
3955
3955
  /**
3956
3956
  *
3957
3957
  * @param dbName
3958
3958
  * @param storeName
3959
3959
  * @param ttl
3960
3960
  */
3961
- constructor(e, t, n = Le.DEFAULT_TTL, i) {
3962
- this.dbName = e, this.storeName = t, this.ttl = n, this.version = i, this.db = Le.createDatabase(e, t), this.keys = this.db.keys.bind(this.db);
3961
+ constructor(e, t, n = Ce.DEFAULT_TTL, i) {
3962
+ this.dbName = e, this.storeName = t, this.ttl = n, this.version = i, this.db = Ce.createDatabase(e, t), this.keys = this.db.keys.bind(this.db);
3963
3963
  }
3964
3964
  static {
3965
3965
  this.DEFAULT_TTL = 1 / 0;
@@ -4038,44 +4038,43 @@ class Le {
4038
4038
  return await this.db.clear(), this;
4039
4039
  }
4040
4040
  }
4041
- var Ci = Object.create, St = Object.defineProperty, Pi = Object.getOwnPropertyDescriptor, xr = (r, e) => (e = Symbol[r]) ? e : Symbol.for("Symbol." + r), Or = (r) => {
4041
+ var Pi = Object.create, Et = Object.defineProperty, Ni = Object.getOwnPropertyDescriptor, xr = (r, e) => (e = Symbol[r]) ? e : Symbol.for("Symbol." + r), kr = (r) => {
4042
4042
  throw TypeError(r);
4043
- }, Ni = (r, e, t) => e in r ? St(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, Bi = (r, e) => St(r, "name", { value: e, configurable: !0 }), ji = (r) => [, , , Ci(r?.[xr("metadata")] ?? null)], Ui = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], kr = (r) => r !== void 0 && typeof r != "function" ? Or("Function expected") : r, Mi = (r, e, t, n, i) => ({ kind: Ui[r], name: e, metadata: n, addInitializer: (s) => t._ ? Or("Already initialized") : i.push(kr(s || null)) }), Fi = (r, e) => Ni(e, xr("metadata"), r[3]), Wi = (r, e, t, n) => {
4043
+ }, Bi = (r, e, t) => e in r ? Et(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, ji = (r, e) => Et(r, "name", { value: e, configurable: !0 }), Mi = (r) => [, , , Pi(r?.[xr("metadata")] ?? null)], Ui = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Or = (r) => r !== void 0 && typeof r != "function" ? kr("Function expected") : r, Fi = (r, e, t, n, i) => ({ kind: Ui[r], name: e, metadata: n, addInitializer: (s) => t._ ? kr("Already initialized") : i.push(Or(s || null)) }), zi = (r, e) => Bi(e, xr("metadata"), r[3]), Hi = (r, e, t, n) => {
4044
4044
  for (var i = 0, s = r[e >> 1], c = s && s.length; i < c; i++) s[i].call(t);
4045
4045
  return n;
4046
- }, Hi = (r, e, t, n, i, s) => {
4047
- var c, l, b, v = e & 7, E = !1, w = 0, D = r[w] || (r[w] = []), k = v && (i = i.prototype, v < 5 && (v > 3 || !E) && Pi(i, t));
4048
- Bi(i, t);
4049
- for (var L = n.length - 1; L >= 0; L--)
4050
- b = Mi(v, t, l = {}, r[3], D), c = (0, n[L])(i, b), l._ = 1, kr(c) && (i = c);
4051
- return Fi(r, i), k && St(i, t, k), E ? v ^ 4 ? s : k : i;
4052
- }, Rr, Et, Ar;
4053
- Rr = [Te(["api", "storage"])];
4054
- class Ve extends (Ar = Xe) {
4046
+ }, Wi = (r, e, t, n, i, s) => {
4047
+ var c, l, b, v = e & 7, S = !1, w = 0, C = r[w] || (r[w] = []), O = v && (i = i.prototype, v < 5 && (v > 3 || !S) && Ni(i, t));
4048
+ ji(i, t);
4049
+ for (var D = n.length - 1; D >= 0; D--)
4050
+ b = Fi(v, t, l = {}, r[3], C), c = (0, n[D])(i, b), l._ = 1, Or(c) && (i = c);
4051
+ return zi(r, i), O && Et(i, t, O), S ? v ^ 4 ? s : O : i;
4052
+ }, Rr, xt, Ar;
4053
+ Rr = [De(["api", "storage"])];
4054
+ class Ge extends (Ar = Je) {
4055
4055
  constructor(e) {
4056
- super(e, "sitemeta", !1), this.ctx = e, this._data = void 0, this.siteIdentity = void 0, this.CACHE_TTL = 1e3 * 60 * 60 * 24, this.VERSION = 2, this.db = void 0, this.queryData = {
4056
+ super(e, "sitemeta", !1), this.ctx = e, this._data = void 0, this.CACHE_TTL = 1e3 * 60 * 60 * 24, this.VERSION = 2, this.db = void 0, this.queryData = {
4057
4057
  meta: "siteinfo|userinfo",
4058
4058
  siprop: "general|specialpagealiases|namespacealiases|namespaces|magicwords",
4059
4059
  uiprop: "groups|rights|blockinfo|options"
4060
- }, this.db = e.storage.createDatabse("sitemeta", this.CACHE_TTL, this.VERSION);
4060
+ }, this.logger = this.ctx.logger("SiteMetadataService"), this.db = e.storage.createDatabse("sitemeta", this.CACHE_TTL, this.VERSION);
4061
4061
  }
4062
4062
  get api() {
4063
4063
  return this.ctx.api;
4064
4064
  }
4065
4065
  get mwConfig() {
4066
- return mw.config.values;
4066
+ return window?.mw?.config?.values;
4067
4067
  }
4068
4068
  async start() {
4069
4069
  const e = await this.fetchFromCache();
4070
4070
  if (e) {
4071
- this.ctx.logger("SiteMetadataService").info("Using cached metadata"), this._data = e;
4071
+ this.logger.info("Using cached metadata", e), this._data = e;
4072
4072
  return;
4073
4073
  }
4074
4074
  const t = await this.fetchFromApi();
4075
4075
  this.saveToCache(t), this._data = t;
4076
4076
  }
4077
- async computeSiteIdentity() {
4078
- if (this.siteIdentity) return this.siteIdentity;
4077
+ computeSiteIdentity() {
4079
4078
  let e;
4080
4079
  if (!window.mw?.config)
4081
4080
  e = new URL(location.href).origin;
@@ -4083,7 +4082,12 @@ class Ve extends (Ar = Xe) {
4083
4082
  const { wgServer: t, wgArticlePath: n } = window.mw.config.get();
4084
4083
  e = `${t}${n}`;
4085
4084
  }
4086
- return this.siteIdentity = e, this.siteIdentity;
4085
+ return Reflect.defineProperty(this, "computeSiteIdentity", {
4086
+ value: () => e,
4087
+ writable: !1,
4088
+ configurable: !1,
4089
+ enumerable: !0
4090
+ }), e;
4087
4091
  }
4088
4092
  async fetchFromApi() {
4089
4093
  return this.api.get({
@@ -4096,13 +4100,17 @@ class Ve extends (Ar = Xe) {
4096
4100
  }).catch((e) => (this.ctx.logger.error("[InPageEdit]", "fetchMetadata error", e), Promise.reject(e)));
4097
4101
  }
4098
4102
  async fetchFromCache() {
4099
- const e = await this.computeSiteIdentity();
4100
- return this.db.get(e);
4103
+ const e = this.computeSiteIdentity(), t = this.mwConfig?.wgUserId || 0, n = await this.db.get(e);
4104
+ return n && n.userinfo.id === t ? n : (this.logger.info("UserID changed, invalidating cache"), this.invalidateCache(), null);
4101
4105
  }
4102
4106
  async saveToCache(e) {
4103
- const t = await this.computeSiteIdentity();
4107
+ const t = this.computeSiteIdentity();
4104
4108
  return this.db.set(t, e);
4105
4109
  }
4110
+ async invalidateCache() {
4111
+ const e = this.computeSiteIdentity();
4112
+ return this.db.delete(e);
4113
+ }
4106
4114
  // shortcuts
4107
4115
  get _raw() {
4108
4116
  return this._data;
@@ -4177,11 +4185,11 @@ class Ve extends (Ar = Xe) {
4177
4185
  } : null;
4178
4186
  }
4179
4187
  }
4180
- Et = ji(Ar);
4181
- Ve = Hi(Et, 0, "SiteMetadataService", Rr, Ve);
4182
- Wi(Et, 1, Ve);
4188
+ xt = Mi(Ar);
4189
+ Ge = Wi(xt, 0, "SiteMetadataService", Rr, Ge);
4190
+ Hi(xt, 1, Ge);
4183
4191
  var Ir = /* @__PURE__ */ ((r) => (r.preferences = "preferences", r.watch = "watch", r.unwatch = "unwatch", r.nochange = "nochange", r))(Ir || {});
4184
- class Ie {
4192
+ class $e {
4185
4193
  static {
4186
4194
  this.DEFAULT_PAGE_INFO = {
4187
4195
  pageid: 0,
@@ -4212,7 +4220,7 @@ class Ie {
4212
4220
  }
4213
4221
  constructor(e, t) {
4214
4222
  this.pageInfo = {
4215
- ...Ie.DEFAULT_PAGE_INFO,
4223
+ ...$e.DEFAULT_PAGE_INFO,
4216
4224
  ...e
4217
4225
  }, this.api = t || new Sr();
4218
4226
  }
@@ -4361,7 +4369,7 @@ class Ie {
4361
4369
  return this.pageInfo.images || [];
4362
4370
  }
4363
4371
  }
4364
- class qi extends Xe {
4372
+ class qi extends Je {
4365
4373
  constructor(e) {
4366
4374
  super(e, "wikiPage", !0), this.ctx = e;
4367
4375
  }
@@ -4369,7 +4377,7 @@ class qi extends Xe {
4369
4377
  this.inject = ["api"];
4370
4378
  }
4371
4379
  get WikiPage() {
4372
- return Ie;
4380
+ return $e;
4373
4381
  }
4374
4382
  async createInstance(e) {
4375
4383
  const {
@@ -4392,7 +4400,7 @@ class qi extends Xe {
4392
4400
  rvprop: "ids|timestamp|user|userid|content",
4393
4401
  ...e
4394
4402
  });
4395
- return new Ie(t, this.ctx.api);
4403
+ return new $e(t, this.ctx.api);
4396
4404
  }
4397
4405
  async newFromTitle(e, t = !1, n) {
4398
4406
  return this.createInstance({ titles: e, converttitles: t, rvsection: n });
@@ -4404,16 +4412,16 @@ class qi extends Xe {
4404
4412
  return this.createInstance({ revids: e, rvsection: t });
4405
4413
  }
4406
4414
  newBlankPage(e = {}) {
4407
- return new Ie(e, this.ctx.api);
4415
+ return new $e(e, this.ctx.api);
4408
4416
  }
4409
4417
  }
4410
- var xt = /* @__PURE__ */ ((r) => (r.Init = "modal.init", r.BeforeShow = "modal.beforeShow", r.Show = "modal.show", r.BeforeClose = "modal.beforeClose", r.Close = "modal.close", r.Destroy = "modal.destroy", r.ToastShow = "toast.show", r.ToastClose = "toast.close", r))(xt || {});
4411
- let zi = 0;
4412
- const sr = (r) => `${r}-${++zi}`;
4413
- function ke(r) {
4418
+ var kt = /* @__PURE__ */ ((r) => (r.Init = "modal.init", r.BeforeShow = "modal.beforeShow", r.Show = "modal.show", r.BeforeClose = "modal.beforeClose", r.Close = "modal.close", r.Destroy = "modal.destroy", r.ToastShow = "toast.show", r.ToastClose = "toast.close", r))(kt || {});
4419
+ let Yi = 0;
4420
+ const sr = (r) => `${r}-${++Yi}`;
4421
+ function Re(r) {
4414
4422
  return r instanceof Node ? r : document.createTextNode(String(r));
4415
4423
  }
4416
- function ue(r, e) {
4424
+ function fe(r, e) {
4417
4425
  if (!r) throw new Error(`${e ?? "Element"} not found`);
4418
4426
  return r;
4419
4427
  }
@@ -4430,13 +4438,13 @@ function or(r) {
4430
4438
  (t) => !!(t.offsetWidth || t.offsetHeight || t.getClientRects().length)
4431
4439
  );
4432
4440
  }
4433
- function Q(r, e = {}) {
4441
+ function Z(r, e = {}) {
4434
4442
  const t = document.createElement(r);
4435
4443
  if (e.className && (t.className = e.className), e.html != null && (t.innerHTML = e.html), e.text != null && (t.textContent = e.text), e.attrs)
4436
4444
  for (const [n, i] of Object.entries(e.attrs)) t.setAttribute(n, i);
4437
4445
  return t;
4438
4446
  }
4439
- class Yi {
4447
+ class Ki {
4440
4448
  constructor() {
4441
4449
  this.zBase = 1e3, this.stack = [];
4442
4450
  }
@@ -4469,10 +4477,10 @@ class Yi {
4469
4477
  document.documentElement.classList.remove("ipe-modal-no-scroll");
4470
4478
  }
4471
4479
  }
4472
- const Z = new Yi();
4480
+ const ee = new Ki();
4473
4481
  class Ot {
4474
4482
  constructor(e = {}) {
4475
- this.backdropId = sr("ipe-modal-backdrop"), this.modalId = sr("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 = xt, this.DEFAULT_OPTIONS = {
4483
+ this.backdropId = sr("ipe-modal-backdrop"), this.modalId = sr("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 = kt, this.DEFAULT_OPTIONS = {
4476
4484
  className: "",
4477
4485
  sizeClass: "auto",
4478
4486
  center: !0,
@@ -4496,7 +4504,11 @@ class Ot {
4496
4504
  s.style.left = `${c}px`, s.style.top = `${l}px`;
4497
4505
  }, this.onDragEnd = () => {
4498
4506
  if (!this.isDragging) return;
4499
- this.isDragging = !1, document.removeEventListener("pointermove", this.onDragMove), document.removeEventListener("pointerup", this.onDragEnd), this.get$modal().classList.remove("is-dragging");
4507
+ this.isDragging = !1, document.removeEventListener("pointermove", this.onDragMove), document.removeEventListener("pointerup", this.onDragEnd);
4508
+ const t = this.get$modal(), n = this.get$window();
4509
+ t.classList.remove("is-dragging"), n.style.animation = "none", requestAnimationFrame(() => {
4510
+ this.applyAnimation(!0);
4511
+ });
4500
4512
  }, this.options = { ...this.DEFAULT_OPTIONS, ...e }, this.options.backdrop === !1 && e.bodyScroll === void 0 && (this.options.bodyScroll = !0);
4501
4513
  }
4502
4514
  get isDestroyed() {
@@ -4507,50 +4519,50 @@ class Ot {
4507
4519
  if (this.$modal) return this;
4508
4520
  const e = this.options.backdrop !== !1;
4509
4521
  let t;
4510
- e && (t = Q("div", {
4522
+ e && (t = Z("div", {
4511
4523
  className: "ipe-modal-backdrop",
4512
4524
  attrs: { id: this.backdropId, "data-modal-id": this.modalId }
4513
4525
  }));
4514
- const n = Q("div", {
4526
+ const n = Z("div", {
4515
4527
  className: "ipe-modal-modal",
4516
4528
  attrs: { id: this.modalId, role: "dialog", "aria-modal": "true", tabindex: "-1" }
4517
4529
  });
4518
4530
  if (n.modal = this, !e) {
4519
4531
  n.classList.add("no-backdrop");
4520
- const k = window.pageYOffset || document.documentElement.scrollTop, L = window.pageXOffset || document.documentElement.scrollLeft, q = window.innerWidth;
4521
- n.style.top = `${k + 60}px`, this.once("modal.show", () => {
4522
- n.style.left = `${L + q / 2 - n.offsetWidth / 2}px`;
4532
+ const O = window.pageYOffset || document.documentElement.scrollTop, D = window.pageXOffset || document.documentElement.scrollLeft, q = window.innerWidth;
4533
+ n.style.top = `${O + 60}px`, this.once("modal.show", () => {
4534
+ n.style.left = `${D + q / 2 - n.offsetWidth / 2}px`;
4523
4535
  });
4524
4536
  }
4525
- const i = Q("div", {
4537
+ const i = Z("div", {
4526
4538
  className: `ipe-modal-modal__window size--${this.options.sizeClass || "auto"} plugin--${this.pluginName}`
4527
4539
  });
4528
4540
  i.modal = this;
4529
- const s = Q("div", { className: "ipe-modal-modal__header" }), c = `${this.modalId}-title`, l = Q("h2", {
4541
+ const s = Z("div", { className: "ipe-modal-modal__header" }), c = `${this.modalId}-title`, l = Z("h2", {
4530
4542
  className: "ipe-modal-modal__title",
4531
4543
  attrs: { id: c, role: "heading", "aria-level": "2" }
4532
4544
  });
4533
4545
  n.setAttribute("aria-labelledby", c);
4534
- const b = Q("div", { className: "ipe-modal-modal__icons" });
4546
+ const b = Z("div", { className: "ipe-modal-modal__icons" });
4535
4547
  if (this.options.closeIcon) {
4536
- const k = Q("button", {
4548
+ const O = Z("button", {
4537
4549
  className: "ipe-modal-modal__close",
4538
4550
  attrs: { type: "button", "aria-label": "Close" },
4539
4551
  html: "&times;"
4540
4552
  });
4541
- k.addEventListener("click", () => {
4542
- let L = !0;
4543
- typeof this.options.onClickClose == "function" ? this.options.onClickClose(this) === !1 && (L = !1) : this.options.onClickClose === !1 && (L = !1), L && this.close();
4544
- }), b.appendChild(k);
4553
+ O.addEventListener("click", () => {
4554
+ let D = !0;
4555
+ typeof this.options.onClickClose == "function" ? this.options.onClickClose(this) === !1 && (D = !1) : this.options.onClickClose === !1 && (D = !1), D && this.close();
4556
+ }), b.appendChild(O);
4545
4557
  }
4546
4558
  s.append(l, b), !e && this.options.draggable && (s.style.cursor = "move", s.style.userSelect = "none", s.addEventListener("pointerdown", this.onDragStart.bind(this)));
4547
- const v = Q("div", { className: "ipe-modal-modal__content" }), E = Q("div", { className: "ipe-modal-modal__footer" }), w = Q("div", {
4559
+ const v = Z("div", { className: "ipe-modal-modal__content" }), S = Z("div", { className: "ipe-modal-modal__footer" }), w = Z("div", {
4548
4560
  className: "ipe-modal-modal__buttons ipe-modal-modal__buttons--left"
4549
- }), D = Q("div", {
4561
+ }), C = Z("div", {
4550
4562
  className: "ipe-modal-modal__buttons ipe-modal-modal__buttons--right"
4551
4563
  });
4552
- return E.append(w, D), i.append(s, v, E), n.appendChild(i), this.$backdrop = t, this.$modal = n, this.$window = i, this.$header = s, this.$title = l, this.$icons = b, this.$content = v, this.$footer = E, this.$buttonsLeft = w, this.$buttonsRight = D, 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) : E.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", (k) => {
4553
- this.options.outSideClose && k.target === t && this.close();
4564
+ return S.append(w, C), i.append(s, v, S), n.appendChild(i), this.$backdrop = t, this.$modal = n, this.$window = i, this.$header = s, this.$title = l, this.$icons = b, this.$content = v, this.$footer = S, this.$buttonsLeft = w, this.$buttonsRight = C, 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) : S.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", (O) => {
4565
+ this.options.outSideClose && O.target === t && this.close();
4554
4566
  }), this.onKeyDown = this.onKeyDown.bind(this), this.emit(
4555
4567
  "modal.init"
4556
4568
  /* Init */
@@ -4563,9 +4575,9 @@ class Ot {
4563
4575
  const n = this.emit("modal.beforeShow", !0), i = this.options.beforeShow ? this.options.beforeShow(this) !== !1 : !0;
4564
4576
  if (!n || !i) return this;
4565
4577
  }
4566
- this.lastFocused = document.activeElement ?? null, this.$backdrop && document.body.appendChild(this.$backdrop), document.body.appendChild(this.$modal), this.shouldLockBodyOnOpen() && Z.lockBodyScroll(), requestAnimationFrame(() => {
4578
+ this.lastFocused = document.activeElement ?? null, this.$backdrop && document.body.appendChild(this.$backdrop), document.body.appendChild(this.$modal), this.shouldLockBodyOnOpen() && ee.lockBodyScroll(), requestAnimationFrame(() => {
4567
4579
  this.$backdrop?.classList.add("is-open"), this.$modal.classList.add("is-open"), this.applyAnimation(!0), this.focusFirst();
4568
- }), document.addEventListener("keydown", this.onKeyDown), Z.push(this), this.isOpen = !0, this.options.onShow?.(this), this.emit(
4580
+ }), document.addEventListener("keydown", this.onKeyDown), ee.push(this), this.isOpen = !0, this.options.onShow?.(this), this.emit(
4569
4581
  "modal.show"
4570
4582
  /* Show */
4571
4583
  );
@@ -4578,14 +4590,26 @@ class Ot {
4578
4590
  const s = this.emit("modal.beforeClose", !0), c = this.options.beforeClose ? this.options.beforeClose(this) !== !1 : !0;
4579
4591
  if (!s || !c) return this;
4580
4592
  }
4581
- if (this.isToast)
4582
- return this.emit(
4593
+ if (this.isToast) {
4594
+ this.applyAnimation(!1), this.emit(
4583
4595
  "modal.close"
4584
4596
  /* Close */
4585
4597
  ), this.emit(
4586
4598
  "toast.close"
4587
4599
  /* ToastClose */
4588
- ), this.destroy(), this.options.onClose?.(this), this;
4600
+ );
4601
+ const s = this.isAnimationDisabled() ? 0 : this.options.animationSpeed ?? 200;
4602
+ let c = !1;
4603
+ const l = () => {
4604
+ c || (c = !0, this.destroy(), this.options.onClose?.(this));
4605
+ }, b = (v, S) => {
4606
+ const w = () => {
4607
+ v.removeEventListener(S, w), l();
4608
+ };
4609
+ v.addEventListener(S, w, { once: !0 });
4610
+ };
4611
+ return s > 0 && this.$window ? (b(this.$window, "transitionend"), b(this.$window, "animationend"), window.setTimeout(l, s + 20)) : window.setTimeout(l, s), this;
4612
+ }
4589
4613
  this.applyAnimation(!1), this.$backdrop?.classList.remove("is-open"), this.$modal?.classList.remove("is-open"), this.emit(
4590
4614
  "modal.close"
4591
4615
  /* Close */
@@ -4607,10 +4631,10 @@ class Ot {
4607
4631
  if (this._isDestroyed) return this;
4608
4632
  if (this.stopCloseTimer(), document.removeEventListener("keydown", this.onKeyDown), this.isDragging && this.onDragEnd(), this.$window?.removeEventListener("mouseenter", this.stopCloseTimer), this.isToast) {
4609
4633
  this.$window?.parentElement && this.$window.parentElement.removeChild(this.$window);
4610
- const e = ge.indexOf(this);
4611
- e !== -1 && ge.splice(e, 1);
4634
+ const e = be.indexOf(this);
4635
+ e !== -1 && be.splice(e, 1);
4612
4636
  } else
4613
- this.$backdrop?.parentElement && this.$backdrop.parentElement.removeChild(this.$backdrop), this.$modal?.parentElement && this.$modal.parentElement.removeChild(this.$modal), Z.remove(this), this.shouldUnlockBodyOnClose() && Z.unlockBodyScroll();
4637
+ this.$backdrop?.parentElement && this.$backdrop.parentElement.removeChild(this.$backdrop), this.$modal?.parentElement && this.$modal.parentElement.removeChild(this.$modal), ee.remove(this), this.shouldUnlockBodyOnClose() && ee.unlockBodyScroll();
4614
4638
  return this.isOpen = !1, this.lastFocused?.focus?.(), this.emit(
4615
4639
  "modal.destroy"
4616
4640
  /* Destroy */
@@ -4621,40 +4645,40 @@ class Ot {
4621
4645
  return this.$backdrop;
4622
4646
  }
4623
4647
  get$modal() {
4624
- return ue(this.$modal, "modal");
4648
+ return fe(this.$modal, "modal");
4625
4649
  }
4626
4650
  get$window() {
4627
- return ue(this.$window, "window");
4651
+ return fe(this.$window, "window");
4628
4652
  }
4629
4653
  get$header() {
4630
- return ue(this.$header, "header");
4654
+ return fe(this.$header, "header");
4631
4655
  }
4632
4656
  get$title() {
4633
- return ue(this.$title, "title");
4657
+ return fe(this.$title, "title");
4634
4658
  }
4635
4659
  get$content() {
4636
- return ue(this.$content, "content");
4660
+ return fe(this.$content, "content");
4637
4661
  }
4638
4662
  get$icons() {
4639
- return ue(this.$icons, "icons");
4663
+ return fe(this.$icons, "icons");
4640
4664
  }
4641
4665
  get$buttons(e) {
4642
- return e === "leftButtons" ? ue(this.$buttonsLeft, "leftButtons") : e === "rightButtons" ? ue(this.$buttonsRight, "rightButtons") : ue(this.$footer, "buttons");
4666
+ return e === "leftButtons" ? fe(this.$buttonsLeft, "leftButtons") : e === "rightButtons" ? fe(this.$buttonsRight, "rightButtons") : fe(this.$footer, "buttons");
4643
4667
  }
4644
4668
  // ------------------------------ content ------------------------------- //
4645
4669
  setTitle(e) {
4646
4670
  const t = this.get$title();
4647
- return t.innerHTML = "", t.append(ke(e)), this;
4671
+ return t.innerHTML = "", t.append(Re(e)), this;
4648
4672
  }
4649
4673
  setContent(e, t = "replace") {
4650
4674
  const n = this.get$content();
4651
- return t === "replace" ? (n.innerHTML = "", n.append(ke(e))) : t === "append" ? n.append(ke(e)) : n.prepend(ke(e)), this;
4675
+ return t === "replace" ? (n.innerHTML = "", n.append(Re(e))) : t === "append" ? n.append(Re(e)) : n.prepend(Re(e)), this;
4652
4676
  }
4653
4677
  setIcons(e) {
4654
4678
  const t = this.get$icons();
4655
4679
  t.innerHTML = "";
4656
4680
  for (const n of e) {
4657
- const i = Q("button", {
4681
+ const i = Z("button", {
4658
4682
  className: `ipe-modal-modal__icon ${n.className}`,
4659
4683
  attrs: { type: "button" }
4660
4684
  });
@@ -4678,9 +4702,9 @@ class Ot {
4678
4702
  return this;
4679
4703
  }
4680
4704
  generateButton(e) {
4681
- const t = e.type ?? "button", n = t === "link" ? Q("a") : Q("button", { attrs: { type: "button" } });
4705
+ const t = e.type ?? "button", n = t === "link" ? Z("a") : Z("button", { attrs: { type: "button" } });
4682
4706
  e.id && (n.id = e.id), n.className = `ipe-modal-btn ${e.className ?? ""}`.trim();
4683
- const i = ke(e.label ?? "OK");
4707
+ const i = Re(e.label ?? "OK");
4684
4708
  if (n.append(i), t === "link" && e.href && (n.href = e.href), e.method && n.addEventListener("click", (s) => {
4685
4709
  if (n._ipe_tmpDisabled) {
4686
4710
  s.preventDefault(), s.stopPropagation();
@@ -4738,7 +4762,9 @@ class Ot {
4738
4762
  return this._hooks.push({ type: e, listener: t }), () => this.off(e, t);
4739
4763
  }
4740
4764
  off(e, t) {
4741
- return this._hooks = this._hooks.filter((n) => n.type !== e || n.listener !== t), this;
4765
+ return this._hooks = this._hooks.filter(
4766
+ (n) => n.type !== e && (t ? n.listener !== t : !0)
4767
+ ), this;
4742
4768
  }
4743
4769
  once(e, t) {
4744
4770
  const n = this.on(e, (i) => (n(), t(i)));
@@ -4748,8 +4774,8 @@ class Ot {
4748
4774
  const n = this._hooks.filter((b) => b.type === e);
4749
4775
  let i = !0;
4750
4776
  for (const b of n) {
4751
- const v = new CustomEvent(e, { detail: this, cancelable: t }), E = b.listener(v);
4752
- if (v.defaultPrevented && (i = !1), E === !1 && (i = !1), !i) break;
4777
+ const v = new CustomEvent(e, { detail: this, cancelable: t }), S = b.listener(v);
4778
+ if (v.defaultPrevented && (i = !1), S === !1 && (i = !1), !i) break;
4753
4779
  }
4754
4780
  const s = this.$modal ?? document.body, c = new CustomEvent(e, { detail: this, cancelable: t });
4755
4781
  return (!s.dispatchEvent(c) || c.defaultPrevented) && (i = !1), i;
@@ -4759,7 +4785,7 @@ class Ot {
4759
4785
  t.length ? t[0].focus() : e.focus({ preventScroll: !0 });
4760
4786
  }
4761
4787
  onKeyDown(e) {
4762
- if (Z.top() !== this) return;
4788
+ if (ee.top() !== this) return;
4763
4789
  if (e.key === "Escape") {
4764
4790
  e.preventDefault(), this.close();
4765
4791
  return;
@@ -4780,19 +4806,19 @@ class Ot {
4780
4806
  }
4781
4807
  /** Bring this modal to the top of the stack. */
4782
4808
  bringToFront() {
4783
- return Z.remove(this), Z.push(this), this;
4809
+ return ee.remove(this), ee.push(this), this;
4784
4810
  }
4785
4811
  isAnimationDisabled() {
4786
4812
  const e = this.options.modalAnimation ?? this.options.animation;
4787
4813
  return e === !1 || e == null;
4788
4814
  }
4789
4815
  shouldLockBodyOnOpen() {
4790
- return this.options.backdrop === !1 || this.options.bodyScroll !== !1 ? !1 : !Z.stack.some(
4816
+ return this.options.backdrop === !1 || this.options.bodyScroll !== !1 ? !1 : !ee.stack.some(
4791
4817
  (t) => t !== this && t.options.backdrop !== !1 && t.options.bodyScroll === !1
4792
4818
  );
4793
4819
  }
4794
4820
  shouldUnlockBodyOnClose() {
4795
- return this.options.backdrop === !1 || this.options.bodyScroll !== !1 ? !1 : !Z.stack.some(
4821
+ return this.options.backdrop === !1 || this.options.bodyScroll !== !1 ? !1 : !ee.stack.some(
4796
4822
  (t) => t !== this && t.options.backdrop !== !1 && t.options.bodyScroll === !1
4797
4823
  );
4798
4824
  }
@@ -4807,10 +4833,10 @@ class Ot {
4807
4833
  /** Show as toast (no backdrop, container stack). */
4808
4834
  showToast(e) {
4809
4835
  this.$window || this.init();
4810
- const t = Ki(e.position ?? "top right"), n = this.get$window();
4836
+ const t = Vi(e.position ?? "top right"), n = this.get$window();
4811
4837
  this.isToast = !0, n.style.pointerEvents = "auto", this.applyAnimation(!0), t.appendChild(n);
4812
4838
  const i = (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;
4813
- return i > 0 && (this.startCloseTimer(i), s && (n.addEventListener("mouseenter", this.stopCloseTimer), n.addEventListener("mouseleave", () => this.startCloseTimer(i)))), this.isOpen = !0, this.options.onShow?.(this), ge.push(this), this.emit(
4839
+ return i > 0 && (this.startCloseTimer(i), s && (n.addEventListener("mouseenter", this.stopCloseTimer), n.addEventListener("mouseleave", () => this.startCloseTimer(i)))), this.isOpen = !0, this.options.onShow?.(this), be.push(this), this.emit(
4814
4840
  "toast.show"
4815
4841
  /* ToastShow */
4816
4842
  ), this.emit(
@@ -4827,24 +4853,24 @@ class Ot {
4827
4853
  }
4828
4854
  static close(e) {
4829
4855
  if (!e) {
4830
- const s = Z.top();
4856
+ const s = ee.top();
4831
4857
  return s?.close(), s;
4832
4858
  }
4833
- const t = typeof e == "string" ? e : e.id, n = Z.stack.find((s) => s.modalId === t);
4859
+ const t = typeof e == "string" ? e : e.id, n = ee.stack.find((s) => s.modalId === t);
4834
4860
  if (n)
4835
4861
  return n.close(), n;
4836
- const i = ge.find((s) => s.modalId === t);
4862
+ const i = be.find((s) => s.modalId === t);
4837
4863
  return i?.close(), i;
4838
4864
  }
4839
4865
  static closeAll(e, t) {
4840
4866
  const n = new Set((Array.isArray(t) ? t : t ? [t] : []).map(String)), i = new Set((Array.isArray(e) ? e : e ? [e] : []).map(String));
4841
- return Z.closeAll(e, t), [...ge].forEach((s) => {
4867
+ return ee.closeAll(e, t), [...be].forEach((s) => {
4842
4868
  const c = s.modalId, l = i.size ? i.has(s.pluginName) : !0, b = n.has(c);
4843
4869
  l && !b && s.close();
4844
- }), Z.top() ?? new Ot();
4870
+ }), ee.top() ?? new Ot();
4845
4871
  }
4846
4872
  static removeAll() {
4847
- Z.removeAll(), [...ge].forEach((e) => e.destroy());
4873
+ ee.removeAll(), [...be].forEach((e) => e.destroy());
4848
4874
  }
4849
4875
  static dialog(e, t) {
4850
4876
  const n = new this({
@@ -4864,8 +4890,8 @@ class Ot {
4864
4890
  return n.init().show();
4865
4891
  }
4866
4892
  static confirm(e, t) {
4867
- e.title ??= "Confirm";
4868
- const n = e.okBtn ?? { label: "OK", className: "is-primary" }, i = e.cancelBtn ?? { label: "Cancel", className: "is-danger is-ghost" }, s = new this({
4893
+ e.title ??= "Confirm", e.content ??= "Are you sure you want to perform this action?";
4894
+ const n = e.okBtn ?? { label: "OK", className: "is-primary is-ghost" }, i = e.cancelBtn ?? { label: "Cancel", className: "is-danger is-ghost" }, s = new this({
4869
4895
  sizeClass: "dialog",
4870
4896
  ...e,
4871
4897
  buttons: [
@@ -4887,27 +4913,132 @@ class Ot {
4887
4913
  });
4888
4914
  return s.init().show();
4889
4915
  }
4890
- static {
4891
- this.notifyIcons = {
4892
- success: "",
4893
- error: "❌",
4894
- warning: "⚠️",
4895
- info: "ℹ️",
4896
- dialog: "💬",
4897
- confirm: "💬"
4898
- };
4916
+ static getDefaultNotifyIcon(e) {
4917
+ switch (e) {
4918
+ case "success":
4919
+ return /* @__PURE__ */ W(
4920
+ "svg",
4921
+ {
4922
+ xmlns: "http://www.w3.org/2000/svg",
4923
+ width: "24",
4924
+ height: "24",
4925
+ viewBox: "0 0 24 24",
4926
+ fill: "currentColor",
4927
+ class: "icon icon-tabler icons-tabler-filled icon-tabler-circle-check",
4928
+ children: [
4929
+ /* @__PURE__ */ W("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
4930
+ /* @__PURE__ */ W("path", { d: "M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z" })
4931
+ ]
4932
+ }
4933
+ );
4934
+ case "error":
4935
+ return /* @__PURE__ */ W(
4936
+ "svg",
4937
+ {
4938
+ xmlns: "http://www.w3.org/2000/svg",
4939
+ width: "24",
4940
+ height: "24",
4941
+ viewBox: "0 0 24 24",
4942
+ fill: "currentColor",
4943
+ class: "icon icon-tabler icons-tabler-filled icon-tabler-alert-triangle",
4944
+ children: [
4945
+ /* @__PURE__ */ W("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
4946
+ /* @__PURE__ */ W("path", { d: "M12 1.67c.955 0 1.845 .467 2.39 1.247l.105 .16l8.114 13.548a2.914 2.914 0 0 1 -2.307 4.363l-.195 .008h-16.225a2.914 2.914 0 0 1 -2.582 -4.2l.099 -.185l8.11 -13.538a2.914 2.914 0 0 1 2.491 -1.403zm.01 13.33l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -7a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z" })
4947
+ ]
4948
+ }
4949
+ );
4950
+ case "warning":
4951
+ return /* @__PURE__ */ W(
4952
+ "svg",
4953
+ {
4954
+ xmlns: "http://www.w3.org/2000/svg",
4955
+ width: "24",
4956
+ height: "24",
4957
+ viewBox: "0 0 24 24",
4958
+ fill: "currentColor",
4959
+ class: "icon icon-tabler icons-tabler-filled icon-tabler-alert-circle",
4960
+ children: [
4961
+ /* @__PURE__ */ W("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
4962
+ /* @__PURE__ */ W("path", { d: "M12 2c5.523 0 10 4.477 10 10a10 10 0 0 1 -19.995 .324l-.005 -.324l.004 -.28c.148 -5.393 4.566 -9.72 9.996 -9.72zm.01 13l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -8a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z" })
4963
+ ]
4964
+ }
4965
+ );
4966
+ case "info":
4967
+ return /* @__PURE__ */ W(
4968
+ "svg",
4969
+ {
4970
+ xmlns: "http://www.w3.org/2000/svg",
4971
+ width: "24",
4972
+ height: "24",
4973
+ viewBox: "0 0 24 24",
4974
+ fill: "currentColor",
4975
+ class: "icon icon-tabler icons-tabler-filled icon-tabler-info-circle",
4976
+ children: [
4977
+ /* @__PURE__ */ W("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
4978
+ /* @__PURE__ */ W("path", { d: "M12 2c5.523 0 10 4.477 10 10a10 10 0 0 1 -19.995 .324l-.005 -.324l.004 -.28c.148 -5.393 4.566 -9.72 9.996 -9.72zm0 9h-1l-.117 .007a1 1 0 0 0 0 1.986l.117 .007v3l.007 .117a1 1 0 0 0 .876 .876l.117 .007h1l.117 -.007a1 1 0 0 0 .876 -.876l.007 -.117l-.007 -.117a1 1 0 0 0 -.764 -.857l-.112 -.02l-.117 -.006v-3l-.007 -.117a1 1 0 0 0 -.876 -.876l-.117 -.007zm.01 -3l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007z" })
4979
+ ]
4980
+ }
4981
+ );
4982
+ case "dialog":
4983
+ return /* @__PURE__ */ W(
4984
+ "svg",
4985
+ {
4986
+ xmlns: "http://www.w3.org/2000/svg",
4987
+ width: "24",
4988
+ height: "24",
4989
+ viewBox: "0 0 24 24",
4990
+ fill: "none",
4991
+ stroke: "currentColor",
4992
+ "stroke-width": "2",
4993
+ "stroke-linecap": "round",
4994
+ "stroke-linejoin": "round",
4995
+ class: "icon icon-tabler icons-tabler-outline icon-tabler-message-dots",
4996
+ children: [
4997
+ /* @__PURE__ */ W("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
4998
+ /* @__PURE__ */ W("path", { d: "M12 11v.01" }),
4999
+ /* @__PURE__ */ W("path", { d: "M8 11v.01" }),
5000
+ /* @__PURE__ */ W("path", { d: "M16 11v.01" }),
5001
+ /* @__PURE__ */ W("path", { d: "M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3z" })
5002
+ ]
5003
+ }
5004
+ );
5005
+ case "confirm":
5006
+ return /* @__PURE__ */ W(
5007
+ "svg",
5008
+ {
5009
+ xmlns: "http://www.w3.org/2000/svg",
5010
+ width: "24",
5011
+ height: "24",
5012
+ viewBox: "0 0 24 24",
5013
+ fill: "currentColor",
5014
+ class: "icon icon-tabler icons-tabler-filled icon-tabler-copy-check",
5015
+ children: [
5016
+ /* @__PURE__ */ W("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
5017
+ /* @__PURE__ */ W("path", { d: "M18.333 6a3.667 3.667 0 0 1 3.667 3.667v8.666a3.667 3.667 0 0 1 -3.667 3.667h-8.666a3.667 3.667 0 0 1 -3.667 -3.667v-8.666a3.667 3.667 0 0 1 3.667 -3.667zm-3.333 -4c1.094 0 1.828 .533 2.374 1.514a1 1 0 1 1 -1.748 .972c-.221 -.398 -.342 -.486 -.626 -.486h-10c-.548 0 -1 .452 -1 1v9.998c0 .32 .154 .618 .407 .805l.1 .065a1 1 0 1 1 -.99 1.738a3 3 0 0 1 -1.517 -2.606v-10c0 -1.652 1.348 -3 3 -3zm1.293 9.293l-3.293 3.292l-1.293 -1.292a1 1 0 0 0 -1.414 1.414l2 2a1 1 0 0 0 1.414 0l4 -4a1 1 0 0 0 -1.414 -1.414" })
5018
+ ]
5019
+ }
5020
+ );
5021
+ default:
5022
+ return null;
5023
+ }
4899
5024
  }
4900
5025
  static notify(e, t, n) {
4901
- t?.overrideOther && [...ge].forEach((l) => l.close()), typeof t.title > "u" && (t.title = e[0].toUpperCase() + e.slice(1).toLowerCase());
4902
- const i = this.notifyIcons[e];
4903
- t.title = `${i} ${t.title}`.trimStart(), t.okBtn && (t.okBtn.label ??= "OK", t.okBtn.className ??= "is-primary is-ghost ok-btn", t.okBtn.method = () => {
5026
+ if (t?.overrideOther && [...be].forEach((l) => l.close()), typeof t.title > "u") {
5027
+ const l = e || "Notification";
5028
+ t.title = l[0].toUpperCase() + l.slice(1).toLowerCase();
5029
+ }
5030
+ const i = t.icon ?? this.getDefaultNotifyIcon(e);
5031
+ i && (i instanceof Element && i.classList.add("ipe-modal-notify-icon"), t.title = /* @__PURE__ */ W($n, { children: [
5032
+ i,
5033
+ t.title
5034
+ ] })), t.okBtn && (t.okBtn.label ??= "OK", t.okBtn.className ??= "is-primary is-ghost ok-btn", t.okBtn.method = () => {
4904
5035
  n?.(!0), c.close();
4905
5036
  }), t.cancelBtn && (t.cancelBtn.label ??= "Cancel", t.cancelBtn.className ??= "is-danger is-ghost cancel-btn", t.cancelBtn.method = () => {
4906
5037
  n?.(!1), c.close();
4907
- }), t.buttons = [t.okBtn, t.cancelBtn, ...t.buttons ?? []].filter(
5038
+ }), t.buttons = [t.cancelBtn, t.okBtn, ...t.buttons ?? []].filter(
4908
5039
  Boolean
4909
5040
  );
4910
- const s = `is-${e || "dialog"} is-toast compact-buttons ${t.className ?? ""}`, c = new this({
5041
+ const s = `is-notify type-${e || "default"} ${t.className ?? ""}`, c = new this({
4911
5042
  ...t,
4912
5043
  className: s,
4913
5044
  sizeClass: "auto",
@@ -4927,18 +5058,21 @@ class Ot {
4927
5058
  });
4928
5059
  }
4929
5060
  }
4930
- const ge = [];
4931
- function Ki(r = "top right") {
5061
+ const be = [];
5062
+ function Vi(r = "top right") {
4932
5063
  const e = "ipe-modal-toast-container", t = `${e}-${r.replace(/[\s-\.|\/]+/g, "-")}`;
4933
5064
  let n = document.getElementById(t);
4934
- return n || (n = Q("div", {
5065
+ return n || (n = Z("div", {
4935
5066
  className: `${e} ${r}`,
4936
5067
  attrs: { id: t, "data-position": r }
4937
5068
  }), document.body.appendChild(n)), n;
4938
5069
  }
4939
- class V extends Ot {
5070
+ class G extends Ot {
4940
5071
  constructor(e = {}) {
4941
- e.className ||= "", e.className += " theme-ipe", super(e);
5072
+ e.className ||= "", e.className += " theme-ipe", e.modalAnimation ||= {
5073
+ show: "ipe-modal-fade-in",
5074
+ hide: "ipe-modal-fade-out"
5075
+ }, super(e);
4942
5076
  }
4943
5077
  setLoadingState(e) {
4944
5078
  if (this.get$window().classList.toggle("loading", e), e) {
@@ -4948,7 +5082,7 @@ class V extends Ot {
4948
5082
  this._tmpDisabledActiveInputs = t, t.forEach((n) => {
4949
5083
  n.disabled = !0;
4950
5084
  }), this.get$content().append(
4951
- /* @__PURE__ */ Vt(
5085
+ /* @__PURE__ */ W(
4952
5086
  "div",
4953
5087
  {
4954
5088
  id: "ipe-modalLoadingWrapper",
@@ -4964,7 +5098,7 @@ class V extends Ot {
4964
5098
  backgroundColor: "rgba(255, 255, 255, 0.5)",
4965
5099
  zIndex: 2e3
4966
5100
  },
4967
- children: /* @__PURE__ */ Vt($n, { style: { width: "80%", maxWidth: "800px" } })
5101
+ children: /* @__PURE__ */ W(Tn, { style: { width: "80%", maxWidth: "800px" } })
4968
5102
  }
4969
5103
  )
4970
5104
  );
@@ -4977,12 +5111,12 @@ class V extends Ot {
4977
5111
  }
4978
5112
  }
4979
5113
  }
4980
- class Vi {
5114
+ class Gi {
4981
5115
  constructor(e) {
4982
- this.ctx = e, this.IPEModal = V, this.IPEModalEvent = xt, this.show = V.show.bind(V), this.createObject = V.createObject.bind(V), this.close = V.close.bind(V), this.closeAll = V.closeAll.bind(V), this.removeAll = V.removeAll.bind(V), this.dialog = V.dialog.bind(V), this.confirm = V.confirm.bind(V), this.notify = V.notify.bind(V), e.set("modal", this);
5116
+ this.ctx = e, this.IPEModal = G, this.IPEModalEvent = kt, this.show = G.show.bind(G), this.createObject = G.createObject.bind(G), this.close = G.close.bind(G), this.closeAll = G.closeAll.bind(G), this.removeAll = G.removeAll.bind(G), this.dialog = G.dialog.bind(G), this.confirm = G.confirm.bind(G), this.notify = G.notify.bind(G), e.set("modal", this);
4983
5117
  }
4984
5118
  }
4985
- var kt = /* @__PURE__ */ ((r) => (r.ANALYTICS_API_BASE = "https://analytics.ipe.wiki/api", r.ANALYTICS_DASH_URL = "https://analytics.ipe.wiki", r.GITHUB_URL = "https://github.com/inpageedit/inpageedit-v2", r.HOME_URL = "https://www.ipe.wiki/", r.PLUGIN_CDN_BASE = "https://ipe-plugins.js.org", r.PLUGIN_HOME_URL = "https://github.com/inpageedit/Plugins", r.SPECIAL_NOTICE_JSON = "https://ipe-plugins.js.org/specialNotice.json", r.UPDATE_LOGS_URL = "https://www.ipe.wiki/update/", r))(kt || {});
5119
+ var Rt = /* @__PURE__ */ ((r) => (r.ANALYTICS_API_BASE = "https://analytics.ipe.wiki/api", r.ANALYTICS_DASH_URL = "https://analytics.ipe.wiki", r.GITHUB_URL = "https://github.com/inpageedit/inpageedit-next", r.HOME_URL = "https://www.ipe.wiki/", r.UPDATE_LOGS_URL = "https://www.ipe.wiki/changelogs/", r))(Rt || {});
4986
5120
  /**
4987
5121
  * ✏️ InPageEdit NEXT
4988
5122
  *
@@ -4993,12 +5127,12 @@ var kt = /* @__PURE__ */ ((r) => (r.ANALYTICS_API_BASE = "https://analytics.ipe.
4993
5127
  * @see https://github.com/inpageedit/inpageedit-next
4994
5128
  * @see https://www.ipe.wiki/
4995
5129
  */
4996
- class De extends te {
5130
+ class Le extends re {
4997
5131
  constructor(e) {
4998
- super(), this.version = "0.5.2", this.Endpoints = kt, this.schema = oi, this.config = {
4999
- ...De.DEFAULT_CONFIG,
5132
+ super(), this.version = "0.5.4", this.Endpoints = Rt, this.schema = ai, this.config = {
5133
+ ...Le.DEFAULT_CONFIG,
5000
5134
  ...e
5001
- }, this.logger = fi({
5135
+ }, this.logger = hi({
5002
5136
  name: "IPE",
5003
5137
  color: "#33aaff",
5004
5138
  level: this.config.logLevel
@@ -5012,7 +5146,7 @@ class De extends te {
5012
5146
  };
5013
5147
  }
5014
5148
  async #e() {
5015
- this.plugin(Ai, { baseURL: this.config.baseURL }), this.plugin(Ii), this.plugin(Vi), this.plugin(Di), this.plugin(Ve), this.plugin(qi), this.#t([
5149
+ this.plugin(Ii, { baseURL: this.config.baseURL }), this.plugin($i), this.plugin(Gi), this.plugin(Li), this.plugin(Ge), this.plugin(qi), this.#t([
5016
5150
  "api",
5017
5151
  "resourceLoader",
5018
5152
  "modal",
@@ -5024,7 +5158,7 @@ class De extends te {
5024
5158
  #t(e) {
5025
5159
  if (typeof e == "string" && (e = [e]), !Array.isArray(e) || e.length === 0) return this;
5026
5160
  for (const t of e) {
5027
- const n = this[De.internal][t];
5161
+ const n = this[Le.internal][t];
5028
5162
  n?.type === "service" && (n.builtin = !0);
5029
5163
  }
5030
5164
  return this;
@@ -5032,17 +5166,17 @@ class De extends te {
5032
5166
  // TODO: 这里不应该硬编码,暂时先这样
5033
5167
  async #r() {
5034
5168
  [
5035
- import("./index-3FdvKxaN.js").then(({ PluginPreferences: t }) => t),
5036
- import("./index-DlE7PWxs.js").then(({ PluginQuickEdit: t }) => t),
5037
- import("./index-BwVAO_o4.js").then(({ PluginQuickMove: t }) => t),
5038
- import("./index-6bp2nmez.js").then(
5169
+ import("./index-UyiZ7umI.js").then(({ PluginPreferences: t }) => t),
5170
+ import("./index-rMDuLpcz.js").then(({ PluginQuickEdit: t }) => t),
5171
+ import("./index-BedbUMp8.js").then(({ PluginQuickMove: t }) => t),
5172
+ import("./index-e7eyr1FL.js").then(
5039
5173
  ({ PluginQuickPreview: t }) => t
5040
5174
  ),
5041
- import("./index-D1plOuGc.js").then(({ PluginQuickDiff: t }) => t),
5042
- import("./index-DXvJqlhL.js").then(
5175
+ import("./index-i-Uf0vuA.js").then(({ PluginQuickDiff: t }) => t),
5176
+ import("./index-BSjnoNn2.js").then(
5043
5177
  ({ PluginQuickRedirect: t }) => t
5044
5178
  ),
5045
- import("./index-DnpXoEP3.js").then(({ PluginToolbox: t }) => t)
5179
+ import("./index-xJ2bdsOD.js").then(({ PluginToolbox: t }) => t)
5046
5180
  ].forEach(async (t) => {
5047
5181
  this.plugin(await t);
5048
5182
  });
@@ -5060,13 +5194,13 @@ class De extends te {
5060
5194
  }), t;
5061
5195
  }
5062
5196
  }
5063
- function Gi(r) {
5197
+ function Xi(r) {
5064
5198
  return r.charAt(0).toLowerCase() + r.slice(1);
5065
5199
  }
5066
- function Xi(r) {
5067
- return Gi(r).replace(/-/g, "_").replace(/.[A-Z]+/g, (e) => e[0] + "_" + e.slice(1).toLowerCase());
5200
+ function Ji(r) {
5201
+ return Xi(r).replace(/-/g, "_").replace(/.[A-Z]+/g, (e) => e[0] + "_" + e.slice(1).toLowerCase());
5068
5202
  }
5069
- class ts {
5203
+ class rs {
5070
5204
  constructor(e, t = void 0, n) {
5071
5205
  this.ctx = e, this.disposeHandlers = [], this.name = n || this.constructor.name, this.config = t || {};
5072
5206
  const { promise: i, resolve: s, reject: c } = Promise.withResolvers();
@@ -5080,7 +5214,7 @@ class ts {
5080
5214
  this.logger.error("Plugin start threw synchronously", l), c(l);
5081
5215
  }
5082
5216
  i.then(() => {
5083
- this.logger.info("Plugin started");
5217
+ this.logger.debug("Plugin started");
5084
5218
  }), i.catch((l) => {
5085
5219
  this.logger.error("Plugin start failed", l), this.ctx.scope.dispose();
5086
5220
  });
@@ -5106,7 +5240,7 @@ class ts {
5106
5240
  this.disposeHandlers = this.disposeHandlers.filter((t) => t !== e);
5107
5241
  }
5108
5242
  set name(e) {
5109
- this.#e = Xi(e).toUpperCase();
5243
+ this.#e = Ji(e).toUpperCase();
5110
5244
  }
5111
5245
  get name() {
5112
5246
  return this.#e;
@@ -5117,16 +5251,16 @@ class ts {
5117
5251
  }
5118
5252
  window.RLQ ||= [];
5119
5253
  window.__IPE_MODULES__ ||= [];
5120
- Qi("InPageEdit#autoload", () => {
5121
- window.RLQ.push(Ji);
5254
+ Zi("InPageEdit#autoload", () => {
5255
+ window.RLQ.push(Qi);
5122
5256
  });
5123
- async function Ji() {
5257
+ async function Qi() {
5124
5258
  typeof window?.ipe?.stop == "function" && await window.ipe.stop();
5125
- const r = window.InPageEdit || {}, e = new De({
5259
+ const r = window.InPageEdit || {}, e = new Le({
5126
5260
  baseURL: window.mw?.util.wikiScript("api"),
5127
5261
  legacyPreferences: r?.myPreferences || {}
5128
5262
  });
5129
- if (window.InPageEdit = De, window.ipe = e, window.mw.hook("InPageEdit.ready").fire(e), await e.start(), Array.isArray(window.__IPE_MODULES__)) {
5263
+ if (window.InPageEdit = Le, window.ipe = e, window.mw.hook("InPageEdit.ready").fire(e), await e.start(), Array.isArray(window.__IPE_MODULES__)) {
5130
5264
  const t = [];
5131
5265
  for (; window.__IPE_MODULES__.length; )
5132
5266
  try {
@@ -5143,7 +5277,7 @@ async function Ji() {
5143
5277
  });
5144
5278
  }
5145
5279
  e.logger("AUTOLOAD").info(
5146
- `${kt.HOME_URL}
5280
+ `${Rt.HOME_URL}
5147
5281
  ____ ____ ______ ___ __
5148
5282
  / _/___ / __ \\____ _____ ____ / ____/___/ (_) /_
5149
5283
  / // __ \\/ /_/ / __ \`/ __ \`/ _ \\/ __/ / __ / / __/
@@ -5152,19 +5286,19 @@ async function Ji() {
5152
5286
  /____/ v` + e.version
5153
5287
  );
5154
5288
  }
5155
- function Qi(r, e) {
5289
+ function Zi(r, e) {
5156
5290
  const t = Symbol.for(r);
5157
5291
  return window[t] ? !1 : (window[t] = !0, e(), !0);
5158
5292
  }
5159
5293
  export {
5160
5294
  br as $,
5161
- ts as B,
5162
- De as I,
5163
- oi as S,
5295
+ rs as B,
5296
+ Le as I,
5297
+ ai as S,
5164
5298
  Ir as W,
5165
- Te as a,
5166
- Xe as b,
5167
- fi as c,
5168
- ci as m
5299
+ De as a,
5300
+ Je as b,
5301
+ hi as c,
5302
+ li as m
5169
5303
  };
5170
- //# sourceMappingURL=index-CIzmjtBz.js.map
5304
+ //# sourceMappingURL=index-DNQjqBV-.js.map