@inpageedit/core 0.17.4 → 0.18.0

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 (48) hide show
  1. package/dist/InPageEdit.js +2 -2
  2. package/dist/{PluginImagesUsed-DIsW4sQH.js → PluginImagesUsed-D9D4IRJt.js} +2 -2
  3. package/dist/{PluginImagesUsed-DIsW4sQH.js.map → PluginImagesUsed-D9D4IRJt.js.map} +1 -1
  4. package/dist/{PluginPrefSync-BM1-tOBL.js → PluginPrefSync-DzmDUTF-.js} +2 -2
  5. package/dist/{PluginPrefSync-BM1-tOBL.js.map → PluginPrefSync-DzmDUTF-.js.map} +1 -1
  6. package/dist/{PluginStoreApp-By2yV_Kl.js → PluginStoreApp-BifScxOt.js} +2 -2
  7. package/dist/{PluginStoreApp-By2yV_Kl.js.map → PluginStoreApp-BifScxOt.js.map} +1 -1
  8. package/dist/{PluginTemplatesUsed-BhNX1xSY.js → PluginTemplatesUsed-De0Y5yo9.js} +2 -2
  9. package/dist/{PluginTemplatesUsed-BhNX1xSY.js.map → PluginTemplatesUsed-De0Y5yo9.js.map} +1 -1
  10. package/dist/core.js +2 -2
  11. package/dist/{index-BAJiXDPz.js → index-9I-lTJju.js} +153 -143
  12. package/dist/index-9I-lTJju.js.map +1 -0
  13. package/dist/{index-C0spLL-i.js → index-Ay5PsdkH.js} +250 -248
  14. package/dist/{index-C0spLL-i.js.map → index-Ay5PsdkH.js.map} +1 -1
  15. package/dist/{index-B5KNZ_9z.js → index-B5tbjHvN.js} +2 -2
  16. package/dist/{index-B5KNZ_9z.js.map → index-B5tbjHvN.js.map} +1 -1
  17. package/dist/{index-S6Jhp39r.js → index-B6Zxq3gX.js} +2 -2
  18. package/dist/{index-S6Jhp39r.js.map → index-B6Zxq3gX.js.map} +1 -1
  19. package/dist/{index-BFdMEvlW.js → index-BVuMfFbP.js} +3 -3
  20. package/dist/{index-BFdMEvlW.js.map → index-BVuMfFbP.js.map} +1 -1
  21. package/dist/{index-D8_-baBt.js → index-BwGWWeee.js} +2 -2
  22. package/dist/{index-D8_-baBt.js.map → index-BwGWWeee.js.map} +1 -1
  23. package/dist/{index-CoX1x5ls.js → index-Cn0EjRz9.js} +2 -2
  24. package/dist/{index-CoX1x5ls.js.map → index-Cn0EjRz9.js.map} +1 -1
  25. package/dist/{index-DHitL1S2.js → index-D3hnOW_f.js} +8 -8
  26. package/dist/{index-DHitL1S2.js.map → index-D3hnOW_f.js.map} +1 -1
  27. package/dist/{index-QZjXZBoj.js → index-D6AvNjpW.js} +3 -3
  28. package/dist/{index-QZjXZBoj.js.map → index-D6AvNjpW.js.map} +1 -1
  29. package/dist/{index-Bf8jOXlz.js → index-DiWAbu-c.js} +3 -3
  30. package/dist/{index-Bf8jOXlz.js.map → index-DiWAbu-c.js.map} +1 -1
  31. package/dist/{index-BoVgsh8u.js → index-DkyIt0u7.js} +2 -2
  32. package/dist/{index-BoVgsh8u.js.map → index-DkyIt0u7.js.map} +1 -1
  33. package/dist/{index-CZfEZBOj.js → index-JE9-Xotj.js} +246 -221
  34. package/dist/index-JE9-Xotj.js.map +1 -0
  35. package/dist/{index-Bd_cTayA.js → index-b29qTV0M.js} +3 -3
  36. package/dist/{index-Bd_cTayA.js.map → index-b29qTV0M.js.map} +1 -1
  37. package/dist/{index-ruv3nAtX.js → index-mLleTCbq.js} +2 -2
  38. package/dist/{index-ruv3nAtX.js.map → index-mLleTCbq.js.map} +1 -1
  39. package/dist/index.d.ts +16 -10
  40. package/dist/index.js +2 -2
  41. package/dist/models/index.js +1 -1
  42. package/dist/plugins/index.js +12 -12
  43. package/dist/services/index.js +1 -1
  44. package/lib/index.umd.js +18 -18
  45. package/lib/index.umd.js.map +1 -1
  46. package/package.json +1 -1
  47. package/dist/index-BAJiXDPz.js.map +0 -1
  48. package/dist/index-CZfEZBOj.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { W as _i, d as xi, e as ki, r as Si, u as $i, c as Ei, a as Ai, f as Ci } from "./index-C0spLL-i.js";
1
+ import { W as _i, d as xi, e as ki, r as Si, u as $i, c as Ei, a as Ci, f as Ai } from "./index-Ay5PsdkH.js";
2
2
  import { j as N, P as Oi, p as _t } from "./Promise.withResolvers-C4chhLB1.js";
3
3
  var Pi = Object.defineProperty, S = (i, e) => Pi(i, "name", { value: e, configurable: !0 });
4
4
  function Ii() {
@@ -40,18 +40,18 @@ function Ri(i, e) {
40
40
  return t;
41
41
  }
42
42
  S(Ri, "omit");
43
- function j(i, e, t) {
43
+ function T(i, e, t) {
44
44
  return Object.defineProperty(i, e, { writable: !0, value: t, enumerable: !1 });
45
45
  }
46
- S(j, "defineProperty");
47
- function ji(i, e) {
46
+ S(T, "defineProperty");
47
+ function Ti(i, e) {
48
48
  return e.every((t) => i.includes(t));
49
49
  }
50
- S(ji, "contain");
51
- function Ti(i, e) {
50
+ S(Ti, "contain");
51
+ function ji(i, e) {
52
52
  return i.filter((t) => e.includes(t));
53
53
  }
54
- S(Ti, "intersection");
54
+ S(ji, "intersection");
55
55
  function Di(i, e) {
56
56
  return i.filter((t) => !e.includes(t));
57
57
  }
@@ -333,13 +333,13 @@ function fe(i, e, t) {
333
333
  }));
334
334
  }
335
335
  k(fe, "withProp");
336
- function Ce(i, e, t, r) {
336
+ function Ae(i, e, t, r) {
337
337
  if (!t) return r;
338
338
  const n = Reflect.getOwnPropertyDescriptor(e, t)?.value;
339
339
  return n ? fe(r, t, i.extend({ [b.shadow]: n })) : r;
340
340
  }
341
- k(Ce, "createShadow");
342
- function At(i, e, t, r) {
341
+ k(Ae, "createShadow");
342
+ function Ct(i, e, t, r) {
343
343
  return new Proxy(e, {
344
344
  apply: /* @__PURE__ */ k((n, s, o) => (s === t && (s = r), o = o.map((a) => typeof a != "function" || a[b.original] ? a : new Proxy(a, {
345
345
  get: /* @__PURE__ */ k((f, u, p) => {
@@ -354,7 +354,7 @@ function At(i, e, t, r) {
354
354
  })), U(i, Reflect.apply(n, s, o))), "apply")
355
355
  });
356
356
  }
357
- k(At, "createShadowMethod");
357
+ k(Ct, "createShadowMethod");
358
358
  function _e(i, e, t, r) {
359
359
  i[b.shadow] && (i = Object.getPrototypeOf(i));
360
360
  const n = new Proxy(e, {
@@ -365,8 +365,8 @@ function _e(i, e, t, r) {
365
365
  return Reflect.get(s, o, a);
366
366
  if (t.associate && i[b.internal][`${t.associate}.${o}`])
367
367
  return Reflect.get(i, `${t.associate}.${o}`, fe(i, b.receiver, a));
368
- const f = Ce(i, s, t.property, a), u = Reflect.get(s, o, f), p = u?.[b.tracker];
369
- return p ? _e(i, u, p) : !r && typeof u == "function" ? At(i, u, a, f) : u;
368
+ const f = Ae(i, s, t.property, a), u = Reflect.get(s, o, f), p = u?.[b.tracker];
369
+ return p ? _e(i, u, p) : !r && typeof u == "function" ? Ct(i, u, a, f) : u;
370
370
  }, "get"),
371
371
  set: /* @__PURE__ */ k((s, o, a, f) => {
372
372
  if (o === b.original || o === t.property) return !1;
@@ -374,7 +374,7 @@ function _e(i, e, t, r) {
374
374
  return Reflect.set(s, o, a, f);
375
375
  if (t.associate && i[b.internal][`${t.associate}.${o}`])
376
376
  return Reflect.set(i, `${t.associate}.${o}`, a, fe(i, b.receiver, f));
377
- const u = Ce(i, s, t.property, f);
377
+ const u = Ae(i, s, t.property, f);
378
378
  return Reflect.set(s, o, a, u);
379
379
  }, "set"),
380
380
  apply: /* @__PURE__ */ k((s, o, a) => He(n, s, o, a), "apply")
@@ -391,12 +391,12 @@ function Oe(i, e, t) {
391
391
  const s = _e(r.ctx, r, t);
392
392
  return He(s, r, this, n);
393
393
  }, "self");
394
- return j(r, "name", i), Object.setPrototypeOf(r, e);
394
+ return T(r, "name", i), Object.setPrototypeOf(r, e);
395
395
  }
396
396
  k(Oe, "createCallable");
397
397
  var Yi = class X {
398
398
  constructor(e) {
399
- this.ctx = e, j(this, b.tracker, {
399
+ this.ctx = e, T(this, b.tracker, {
400
400
  associate: "reflect",
401
401
  property: "ctx"
402
402
  }), 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"]);
@@ -462,7 +462,7 @@ var Yi = class X {
462
462
  const n = this.ctx.root[b.internal];
463
463
  if (e in n) return;
464
464
  const s = Symbol(e);
465
- n[e] = { type: "service", builtin: r }, this.ctx.root[b.isolate][e] = s, ze(t) && (this.ctx[b.store][s] = { value: t, source: null }, j(t, b.tracker, {
465
+ n[e] = { type: "service", builtin: r }, this.ctx.root[b.isolate][e] = s, ze(t) && (this.ctx[b.store][s] = { value: t, source: null }, T(t, b.tracker, {
466
466
  associate: e,
467
467
  property: "ctx"
468
468
  }));
@@ -514,30 +514,30 @@ function Ie(i) {
514
514
  k(Ie, "isBailed");
515
515
  var Ji = class {
516
516
  constructor(i) {
517
- this.ctx = i, j(this, b.tracker, {
517
+ this.ctx = i, T(this, b.tracker, {
518
518
  associate: "lifecycle",
519
519
  property: "ctx"
520
- }), j(this.on("internal/listener", function(t, r, n) {
520
+ }), T(this.on("internal/listener", function(t, r, n) {
521
521
  const s = n.prepend ? "unshift" : "push";
522
522
  if (t === "ready")
523
523
  return this.lifecycle.isActive ? (this.scope.ensure(async () => r()), () => !1) : void 0;
524
524
  if (t === "dispose")
525
- return this.scope.disposables[s](r), j(r, "name", "event <dispose>"), () => W(this.scope.disposables, r);
525
+ return this.scope.disposables[s](r), T(r, "name", "event <dispose>"), () => W(this.scope.disposables, r);
526
526
  if (t === "fork")
527
527
  return this.scope.runtime.forkables[s](r), this.scope.collect("event <fork>", () => W(this.scope.runtime.forkables, r));
528
528
  }), M.static, i.scope);
529
529
  for (const t of ["info", "error", "warning"])
530
- j(this.on(`internal/${t}`, (r, ...n) => {
530
+ T(this.on(`internal/${t}`, (r, ...n) => {
531
531
  this._hooks[`internal/${t}`].length > 1;
532
532
  }), M.static, i.scope);
533
- j(this.on("internal/before-service", function(t) {
533
+ T(this.on("internal/before-service", function(t) {
534
534
  for (const r of this.registry.values()) {
535
535
  if (!r.inject[t]?.required) continue;
536
536
  const n = r.isReusable ? r.children : [r];
537
537
  for (const s of n)
538
538
  this[b.filter](s.ctx) && (s.updateStatus(), s.reset());
539
539
  }
540
- }, { global: !0 }), M.static, i.scope), j(this.on("internal/service", function(t) {
540
+ }, { global: !0 }), M.static, i.scope), T(this.on("internal/service", function(t) {
541
541
  for (const r of this.registry.values()) {
542
542
  if (!r.inject[t]?.required) continue;
543
543
  const n = r.isReusable ? r.children : [r];
@@ -551,7 +551,7 @@ var Ji = class {
551
551
  if (r === Pe.resolveInject(t.ctx, n)[0]) return !0;
552
552
  return e(t.parent.scope, r);
553
553
  }, "checkInject");
554
- j(this.on("internal/inject", function(t) {
554
+ T(this.on("internal/inject", function(t) {
555
555
  return e(this.scope, t);
556
556
  }, { global: !0 }), M.static, i.scope);
557
557
  }
@@ -625,9 +625,9 @@ var Ji = class {
625
625
  async stop() {
626
626
  this.isActive = !1, this.ctx.scope.reset();
627
627
  }
628
- }, Qi = Ji, Xi = /* @__PURE__ */ ((i) => (i[i.PENDING = 0] = "PENDING", i[i.LOADING = 1] = "LOADING", i[i.ACTIVE = 2] = "ACTIVE", i[i.FAILED = 3] = "FAILED", i[i.DISPOSED = 4] = "DISPOSED", i))(Xi || {}), Le = class Ct extends Error {
628
+ }, Qi = Ji, Xi = /* @__PURE__ */ ((i) => (i[i.PENDING = 0] = "PENDING", i[i.LOADING = 1] = "LOADING", i[i.ACTIVE = 2] = "ACTIVE", i[i.FAILED = 3] = "FAILED", i[i.DISPOSED = 4] = "DISPOSED", i))(Xi || {}), Le = class At extends Error {
629
629
  constructor(e, t) {
630
- super(t ?? Ct.Code[e]), this.code = e;
630
+ super(t ?? At.Code[e]), this.code = e;
631
631
  }
632
632
  static {
633
633
  k(this, "CordisError");
@@ -677,7 +677,7 @@ var Ot = class {
677
677
  return this.disposables.push(s), typeof t == "function" ? s : (t.dispose = s, t);
678
678
  }
679
679
  collect(i, e) {
680
- const t = j(() => (W(this.disposables, t), e()), "name", i);
680
+ const t = T(() => (W(this.disposables, t), e()), "name", i);
681
681
  return this.disposables.push(t), t;
682
682
  }
683
683
  restart() {
@@ -756,7 +756,7 @@ var Ot = class {
756
756
  }
757
757
  }, Zi = class extends Ot {
758
758
  constructor(i, e, t, r) {
759
- super(i, t), this.runtime = e, this.dispose = j(i.scope.collect(`fork <${i.runtime.name}>`, () => {
759
+ super(i, t), this.runtime = e, this.dispose = T(i.scope.collect(`fork <${i.runtime.name}>`, () => {
760
760
  this.uid = null, this.reset(), this.context.emit("internal/fork", this);
761
761
  const n = W(e.disposables, this.dispose);
762
762
  return W(e.children, this) && !e.children.length && i.registry.delete(e.plugin), n;
@@ -881,7 +881,7 @@ k(F, "Inject");
881
881
  })(F || (F = {}));
882
882
  var er = class {
883
883
  constructor(i, e) {
884
- this.ctx = i, j(this, b.tracker, {
884
+ this.ctx = i, T(this, b.tracker, {
885
885
  associate: "registry",
886
886
  property: "ctx"
887
887
  }), this.context = i;
@@ -983,7 +983,7 @@ var er = class {
983
983
  r(Object.getPrototypeOf(n));
984
984
  for (const s of Object.getOwnPropertyNames(n)) {
985
985
  const o = n[s].prototype?.constructor;
986
- o && (t[n[s].key] = new o(t, e), j(t[n[s].key], "ctx", t));
986
+ o && (t[n[s].key] = new o(t, e), T(t[n[s].key], "ctx", t));
987
987
  }
988
988
  }
989
989
  }, "attach");
@@ -1044,7 +1044,7 @@ var z = class It {
1044
1044
  associate: r,
1045
1045
  property: "ctx"
1046
1046
  };
1047
- return o[b.invoke] && (o = Oe(r, Fe(Object.getPrototypeOf(this), Function.prototype), a)), t ? o.ctx = t : o[b.setup](), o.name = r, o.config = s, j(o, b.tracker, a), o.ctx.provide(r), o.ctx.runtime.name = r, n && (t ? o[b.expose] = r : o.ctx.set(r, o)), o.ctx.on("ready", async () => {
1047
+ return o[b.invoke] && (o = Oe(r, Fe(Object.getPrototypeOf(this), Function.prototype), a)), t ? o.ctx = t : o[b.setup](), o.name = r, o.config = s, T(o, b.tracker, a), o.ctx.provide(r), o.ctx.runtime.name = r, n && (t ? o[b.expose] = r : o.ctx.set(r, o)), o.ctx.on("ready", async () => {
1048
1048
  await Promise.resolve(), await o.start(), n || o.ctx.set(r, o);
1049
1049
  }), o.ctx.on("dispose", () => o.stop()), o;
1050
1050
  }
@@ -1208,11 +1208,11 @@ var z = class It {
1208
1208
  if (d.ignore?.(c, h)) return [c];
1209
1209
  if (I(c) && h.type !== "lazy") {
1210
1210
  if (h.meta.required) throw new n("missing required value", d);
1211
- let x = h, C = h.meta.default;
1212
- for (; x?.type === "intersect" && I(C); )
1213
- x = x.list[0], C = x?.meta.default;
1214
- if (I(C)) return [c];
1215
- c = ue(C);
1211
+ let x = h, A = h.meta.default;
1212
+ for (; x?.type === "intersect" && I(A); )
1213
+ x = x.list[0], A = x?.meta.default;
1214
+ if (I(A)) return [c];
1215
+ c = ue(A);
1216
1216
  }
1217
1217
  const v = u[h.type];
1218
1218
  if (!v) throw new n(`unsupported type "${h.type}"`, d);
@@ -1383,14 +1383,14 @@ var z = class It {
1383
1383
  if (!he(l)) throw new n(`expected object but got ${l}`, d);
1384
1384
  const v = {};
1385
1385
  for (const x in l) {
1386
- let C;
1386
+ let A;
1387
1387
  try {
1388
- C = s.resolve(x, h, d)[0];
1388
+ A = s.resolve(x, h, d)[0];
1389
1389
  } catch (Se) {
1390
1390
  if (m) continue;
1391
1391
  throw Se;
1392
1392
  }
1393
- v[C] = g(l, x, c, d), l[C] = l[x], x !== C && delete l[x];
1393
+ v[A] = g(l, x, c, d), l[A] = l[x], x !== A && delete l[x];
1394
1394
  }
1395
1395
  return [v];
1396
1396
  }), s.extend("tuple", (l, { list: c }, h, d) => {
@@ -1421,16 +1421,16 @@ var z = class It {
1421
1421
  if (!c.length) return [l];
1422
1422
  let v;
1423
1423
  for (const x of c) {
1424
- const C = s.resolve(l, x, d, !0)[0];
1425
- if (!I(C))
1424
+ const A = s.resolve(l, x, d, !0)[0];
1425
+ if (!I(A))
1426
1426
  if (I(v))
1427
- v = C;
1427
+ v = A;
1428
1428
  else {
1429
- if (typeof v != typeof C)
1429
+ if (typeof v != typeof A)
1430
1430
  throw new n(`expected ${h()} but got ${JSON.stringify(l)}`, d);
1431
- if (typeof C == "object")
1432
- w(v ??= {}, C);
1433
- else if (v !== C)
1431
+ if (typeof A == "object")
1432
+ w(v ??= {}, A);
1433
+ else if (v !== A)
1434
1434
  throw new n(`expected ${h()} but got ${JSON.stringify(l)}`, d);
1435
1435
  }
1436
1436
  }
@@ -1440,7 +1440,7 @@ var z = class It {
1440
1440
  return d ? [h(v)] : [h(v), h(x)];
1441
1441
  });
1442
1442
  var O = {};
1443
- function A(l, c, h) {
1443
+ function C(l, c, h) {
1444
1444
  O[l] = h, Object.assign(s, {
1445
1445
  [l](...d) {
1446
1446
  const m = new s({ type: l });
@@ -1460,18 +1460,18 @@ var z = class It {
1460
1460
  break;
1461
1461
  case "bits": {
1462
1462
  m.bits = {};
1463
- for (const C in d[x])
1464
- typeof d[x][C] == "number" && (m.bits[C] = d[x][C]);
1463
+ for (const A in d[x])
1464
+ typeof d[x][A] == "number" && (m.bits[A] = d[x][A]);
1465
1465
  break;
1466
1466
  }
1467
1467
  case "callback": {
1468
- const C = m.callback = d[x];
1469
- C.toJSON ||= () => C.toString();
1468
+ const A = m.callback = d[x];
1469
+ A.toJSON ||= () => A.toString();
1470
1470
  break;
1471
1471
  }
1472
1472
  case "constructor": {
1473
- const C = m.constructor = d[x];
1474
- typeof C == "function" && (C.toJSON ||= () => C.name);
1473
+ const A = m.constructor = d[x];
1474
+ typeof A == "function" && (A.toJSON ||= () => A.name);
1475
1475
  break;
1476
1476
  }
1477
1477
  default:
@@ -1481,17 +1481,17 @@ var z = class It {
1481
1481
  }
1482
1482
  });
1483
1483
  }
1484
- E(A, "defineMethod"), A("is", ["constructor"], ({ constructor: l }) => typeof l == "function" ? l.name : l), A("any", [], () => "any"), A("never", [], () => "never"), A("const", ["value"], ({ value: l }) => typeof l == "string" ? JSON.stringify(l) : l), A("string", [], () => "string"), A("number", [], () => "number"), A("boolean", [], () => "boolean"), A("bitset", ["bits"], () => "bitset"), A("function", [], () => "function"), A("array", ["inner"], ({ inner: l }) => `${l.toString(!0)}[]`), A("dict", ["inner", "sKey"], ({ inner: l, sKey: c }) => `{ [key: ${c.toString()}]: ${l.toString()} }`), A("tuple", ["list"], ({ list: l }) => `[${l.map((c) => c.toString()).join(", ")}]`), A("object", ["dict"], ({ dict: l }) => Object.keys(l).length === 0 ? "{}" : `{ ${Object.entries(l).map(([c, h]) => `${c}${h.meta.required ? "" : "?"}: ${h.toString()}`).join(", ")} }`), A("union", ["list"], ({ list: l }, c) => {
1484
+ E(C, "defineMethod"), C("is", ["constructor"], ({ constructor: l }) => typeof l == "function" ? l.name : l), C("any", [], () => "any"), C("never", [], () => "never"), C("const", ["value"], ({ value: l }) => typeof l == "string" ? JSON.stringify(l) : l), C("string", [], () => "string"), C("number", [], () => "number"), C("boolean", [], () => "boolean"), C("bitset", ["bits"], () => "bitset"), C("function", [], () => "function"), C("array", ["inner"], ({ inner: l }) => `${l.toString(!0)}[]`), C("dict", ["inner", "sKey"], ({ inner: l, sKey: c }) => `{ [key: ${c.toString()}]: ${l.toString()} }`), C("tuple", ["list"], ({ list: l }) => `[${l.map((c) => c.toString()).join(", ")}]`), C("object", ["dict"], ({ dict: l }) => Object.keys(l).length === 0 ? "{}" : `{ ${Object.entries(l).map(([c, h]) => `${c}${h.meta.required ? "" : "?"}: ${h.toString()}`).join(", ")} }`), C("union", ["list"], ({ list: l }, c) => {
1485
1485
  const h = l.map(({ toString: d }) => d()).join(" | ");
1486
1486
  return c ? `(${h})` : h;
1487
- }), A("intersect", ["list"], ({ list: l }) => `${l.map((c) => c.toString(!0)).join(" & ")}`), A("transform", ["inner", "callback", "preserve"], ({ inner: l }, c) => l.toString(c)), e.exports = s;
1487
+ }), C("intersect", ["list"], ({ list: l }) => `${l.map((c) => c.toString(!0)).join(" & ")}`), C("transform", ["inner", "callback", "preserve"], ({ inner: l }, c) => l.toString(c)), e.exports = s;
1488
1488
  }
1489
1489
  });
1490
1490
  const $ = sr();
1491
1491
  var Lt = /* @__PURE__ */ ((i) => (i[i.debug = -1] = "debug", i[i.log = 0] = "log", i[i.info = 1] = "info", i[i.warn = 2] = "warn", i[i.error = 3] = "error", i[i.silent = 4] = "silent", i))(Lt || {});
1492
- const Re = globalThis || window, je = /* @__PURE__ */ Symbol.for("__IPE_LOGGER_COLOR_MAP__");
1493
- Re[je] || (Re[je] = /* @__PURE__ */ new Map());
1494
- const $e = Re[je];
1492
+ const Re = globalThis || window, Te = /* @__PURE__ */ Symbol.for("__IPE_LOGGER_COLOR_MAP__");
1493
+ Re[Te] || (Re[Te] = /* @__PURE__ */ new Map());
1494
+ const $e = Re[Te];
1495
1495
  function ae(i) {
1496
1496
  let e = 2166136261;
1497
1497
  for (let t = 0; t < i.length; t++)
@@ -1652,7 +1652,7 @@ function cr(i) {
1652
1652
  function lr(i) {
1653
1653
  return new Ke(i);
1654
1654
  }
1655
- class Te extends _i {
1655
+ class je extends _i {
1656
1656
  async clientLogin(e, t, r) {
1657
1657
  r ||= {}, !r.logincontinue && !r.loginreturnurl && (r.loginreturnurl = location?.origin);
1658
1658
  const n = await this.postWithToken(
@@ -1676,7 +1676,7 @@ class Te extends _i {
1676
1676
  );
1677
1677
  }
1678
1678
  }
1679
- class hr extends Te {
1679
+ class hr extends je {
1680
1680
  constructor(e, t, r) {
1681
1681
  const n = Si(
1682
1682
  e,
@@ -1696,7 +1696,7 @@ class hr extends Te {
1696
1696
  class ur {
1697
1697
  constructor(e, t = {}) {
1698
1698
  this.ctx = e, this.options = t, this._apiClients = /* @__PURE__ */ new Map(), location?.href && t?.baseURL?.toString()?.startsWith("/") && (t.baseURL = new URL(t.baseURL, location.origin));
1699
- const r = this.api = new Te({
1699
+ const r = this.api = new je({
1700
1700
  baseURL: t.baseURL.toString(),
1701
1701
  fexiosConfigs: {
1702
1702
  headers: {
@@ -1717,7 +1717,7 @@ class ur {
1717
1717
  const n = t.origin === location.origin, s = {
1718
1718
  baseURL: t.toString(),
1719
1719
  throwOnApiError: !0
1720
- }, o = n ? new Te(s) : new hr(s);
1720
+ }, o = n ? new je(s) : new hr(s);
1721
1721
  o.request.on("beforeRequest", (a) => {
1722
1722
  a.headers = o.request.mergeHeaders(a.headers, {
1723
1723
  "x-api-user-agent": null,
@@ -1729,16 +1729,16 @@ class ur {
1729
1729
  }
1730
1730
  }
1731
1731
  const pt = (i, e = document) => e.querySelector(i), vs = (i, e = document) => e.querySelectorAll(i);
1732
- var fr = Object.create, qe = Object.defineProperty, dr = Object.getOwnPropertyDescriptor, Rt = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), jt = (i) => {
1732
+ var fr = Object.create, qe = Object.defineProperty, dr = Object.getOwnPropertyDescriptor, Rt = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), Tt = (i) => {
1733
1733
  throw TypeError(i);
1734
- }, pr = (i, e, t) => e in i ? qe(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, gr = (i, e) => qe(i, "name", { value: e, configurable: !0 }), mr = (i) => [, , , fr(i?.[Rt("metadata")] ?? null)], yr = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Tt = (i) => i !== void 0 && typeof i != "function" ? jt("Function expected") : i, wr = (i, e, t, r, n) => ({ kind: yr[i], name: e, metadata: r, addInitializer: (s) => t._ ? jt("Already initialized") : n.push(Tt(s || null)) }), br = (i, e) => pr(e, Rt("metadata"), i[3]), vr = (i, e, t, r) => {
1734
+ }, pr = (i, e, t) => e in i ? qe(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, gr = (i, e) => qe(i, "name", { value: e, configurable: !0 }), mr = (i) => [, , , fr(i?.[Rt("metadata")] ?? null)], yr = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], jt = (i) => i !== void 0 && typeof i != "function" ? Tt("Function expected") : i, wr = (i, e, t, r, n) => ({ kind: yr[i], name: e, metadata: r, addInitializer: (s) => t._ ? Tt("Already initialized") : n.push(jt(s || null)) }), br = (i, e) => pr(e, Rt("metadata"), i[3]), vr = (i, e, t, r) => {
1735
1735
  for (var n = 0, s = i[e >> 1], o = s && s.length; n < o; n++) s[n].call(t);
1736
1736
  return r;
1737
1737
  }, _r = (i, e, t, r, n, s) => {
1738
1738
  var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && dr(n, t));
1739
1739
  gr(n, t);
1740
1740
  for (var w = r.length - 1; w >= 0; w--)
1741
- f = wr(u, t, a = {}, i[3], _), o = (0, r[w])(n, f), a._ = 1, Tt(o) && (n = o);
1741
+ f = wr(u, t, a = {}, i[3], _), o = (0, r[w])(n, f), a._ = 1, jt(o) && (n = o);
1742
1742
  return br(i, n), g && qe(n, t, g), p ? u ^ 4 ? s : g : n;
1743
1743
  }, Dt, We, Nt;
1744
1744
  Dt = [F(["wiki", "wikiTitle"])];
@@ -1889,7 +1889,7 @@ function ne(i) {
1889
1889
  function Er(i) {
1890
1890
  return !!(i && i.isComponent);
1891
1891
  }
1892
- function Ar(i) {
1892
+ function Cr(i) {
1893
1893
  return J(i) && typeof i.length == "number" && typeof i.nodeType != "number";
1894
1894
  }
1895
1895
  function De(i, e) {
@@ -1897,7 +1897,7 @@ function De(i, e) {
1897
1897
  for (const t of xe(i))
1898
1898
  e(i[t], t);
1899
1899
  }
1900
- function Cr(i) {
1900
+ function Ar(i) {
1901
1901
  return J(i) && "current" in i;
1902
1902
  }
1903
1903
  const Ne = {
@@ -1961,7 +1961,7 @@ var Bt = /* @__PURE__ */ (function(i) {
1961
1961
  function Lr(i) {
1962
1962
  return i != null && i[Ir] === Bt.ShadowRoot;
1963
1963
  }
1964
- const Rr = "http://www.w3.org/2000/svg", jr = "http://www.w3.org/1999/xlink", Tr = "http://www.w3.org/XML/1998/namespace";
1964
+ const Rr = "http://www.w3.org/2000/svg", Tr = "http://www.w3.org/1999/xlink", jr = "http://www.w3.org/XML/1998/namespace";
1965
1965
  function Ut(i) {
1966
1966
  return !Sr(i) && i != null;
1967
1967
  }
@@ -2066,10 +2066,10 @@ function P(i, e) {
2066
2066
  return n;
2067
2067
  }
2068
2068
  function Ve(i, e) {
2069
- Cr(i) ? i.current = e : ne(i) && i(e);
2069
+ Ar(i) ? i.current = e : ne(i) && i(e);
2070
2070
  }
2071
2071
  function ke(i, e) {
2072
- if (Ar(i))
2072
+ if (Cr(i))
2073
2073
  Ur(i, e);
2074
2074
  else if (Ge(i) || Mt(i))
2075
2075
  Ee(document.createTextNode(i), e);
@@ -2107,7 +2107,7 @@ function Fr(i, e, t) {
2107
2107
  case "xlinkShow":
2108
2108
  case "xlinkTitle":
2109
2109
  case "xlinkType":
2110
- gt(t, jr, le(i, ":"), e);
2110
+ gt(t, Tr, le(i, ":"), e);
2111
2111
  return;
2112
2112
  case "xmlnsXlink":
2113
2113
  Q(t, le(i, ":"), e);
@@ -2115,7 +2115,7 @@ function Fr(i, e, t) {
2115
2115
  case "xmlBase":
2116
2116
  case "xmlLang":
2117
2117
  case "xmlSpace":
2118
- gt(t, Tr, le(i, ":"), e);
2118
+ gt(t, jr, le(i, ":"), e);
2119
2119
  return;
2120
2120
  }
2121
2121
  switch (i) {
@@ -2216,7 +2216,7 @@ function yt(i) {
2216
2216
  (t) => !!(t.offsetWidth || t.offsetHeight || t.getClientRects().length)
2217
2217
  );
2218
2218
  }
2219
- function T(i, e = {}) {
2219
+ function j(i, e = {}) {
2220
2220
  const t = document.createElement(i);
2221
2221
  if (e.className && (t.className = e.className), e.html != null && (t.innerHTML = e.html), e.text != null && (t.textContent = e.text), e.attrs)
2222
2222
  for (const [r, n] of Object.entries(e.attrs)) t.setAttribute(r, n);
@@ -2351,11 +2351,11 @@ class pe {
2351
2351
  if (this.$modal) return this;
2352
2352
  const e = this.options.backdrop !== !1;
2353
2353
  let t;
2354
- e && (t = T("div", {
2354
+ e && (t = j("div", {
2355
2355
  className: "ipe-modal-backdrop",
2356
2356
  attrs: { id: this.backdropId, "data-modal-id": this.modalId }
2357
2357
  }));
2358
- const r = T("div", {
2358
+ const r = j("div", {
2359
2359
  className: "ipe-modal-modal",
2360
2360
  attrs: { id: this.modalId, role: "dialog", "aria-modal": "true", tabindex: "-1" }
2361
2361
  });
@@ -2366,18 +2366,18 @@ class pe {
2366
2366
  r.style.left = `${w + O / 2 - r.offsetWidth / 2}px`;
2367
2367
  });
2368
2368
  }
2369
- const n = T("div", {
2369
+ const n = j("div", {
2370
2370
  className: `ipe-modal-modal__window size--${this.options.sizeClass || "auto"} plugin--${this.pluginName}`
2371
2371
  });
2372
2372
  n.modal = this;
2373
- const s = T("div", { className: "ipe-modal-modal__header" }), o = `${this.modalId}-title`, a = T("h2", {
2373
+ const s = j("div", { className: "ipe-modal-modal__header" }), o = `${this.modalId}-title`, a = j("h2", {
2374
2374
  className: "ipe-modal-modal__title",
2375
2375
  attrs: { id: o, role: "heading", "aria-level": "2" }
2376
2376
  });
2377
2377
  r.setAttribute("aria-labelledby", o);
2378
- const f = T("div", { className: "ipe-modal-modal__icons" });
2378
+ const f = j("div", { className: "ipe-modal-modal__icons" });
2379
2379
  if (this.options.closeIcon) {
2380
- const g = T("button", {
2380
+ const g = j("button", {
2381
2381
  className: "ipe-modal-modal__close",
2382
2382
  attrs: { type: "button", "aria-label": "Close" },
2383
2383
  html: "&times;"
@@ -2388,9 +2388,9 @@ class pe {
2388
2388
  }), f.appendChild(g);
2389
2389
  }
2390
2390
  s.append(a, f), this.options.draggable && e && (this.options.draggable = !1), this.options.draggable && (s.style.cursor = "move", s.style.userSelect = "none", s.addEventListener("pointerdown", this.onDragStart.bind(this)), r.classList.add("is-draggable"));
2391
- const u = T("div", { className: "ipe-modal-modal__content" }), p = T("div", { className: "ipe-modal-modal__footer" }), y = T("div", {
2391
+ const u = j("div", { className: "ipe-modal-modal__content" }), p = j("div", { className: "ipe-modal-modal__footer" }), y = j("div", {
2392
2392
  className: "ipe-modal-modal__buttons ipe-modal-modal__buttons--left"
2393
- }), _ = T("div", {
2393
+ }), _ = j("div", {
2394
2394
  className: "ipe-modal-modal__buttons ipe-modal-modal__buttons--right"
2395
2395
  });
2396
2396
  return p.append(y, _), n.append(s, u, p), r.appendChild(n), this.$backdrop = t, this.$modal = r, this.$window = n, this.$header = s, this.$title = a, this.$icons = f, this.$content = u, this.$footer = p, this.$buttonsLeft = y, this.$buttonsRight = _, this.options.title && this.setTitle(this.options.title), this.options.content && this.setContent(this.options.content), this.options.buttons?.length ? this.setButtons(this.options.buttons) : p.style.display = "none", this.options.center && this.$modal.classList.add("is-centered"), this.options.fitScreen && this.$modal.classList.add("is-fullscreen"), this.options.iconButtons && this.$header.classList.add("has-icon-buttons"), this.options.className && this.$window.classList.add(...this.options.className.split(/[\s\.#+]+/g).filter(Boolean)), typeof this.options.fixedHeight == "number" ? this.$window.style.height = `${Math.max(0, this.options.fixedHeight)}px` : this.options.fixedHeight === !0 && this.$window.classList.add("is-fixed-height"), t && t.addEventListener("pointerup", (g) => {
@@ -2512,7 +2512,7 @@ class pe {
2512
2512
  const t = this.get$icons();
2513
2513
  t.innerHTML = "";
2514
2514
  for (const r of e) {
2515
- const n = T("button", {
2515
+ const n = j("button", {
2516
2516
  className: `ipe-modal-modal__icon ${r.className}`,
2517
2517
  attrs: { type: "button" }
2518
2518
  });
@@ -2536,7 +2536,7 @@ class pe {
2536
2536
  return this;
2537
2537
  }
2538
2538
  generateButton(e) {
2539
- const t = e.type ?? "button", r = t === "link" ? T("a") : T("button", { attrs: { type: "button" } });
2539
+ const t = e.type ?? "button", r = t === "link" ? j("a") : j("button", { attrs: { type: "button" } });
2540
2540
  e.id && (r.id = e.id), r.className = `ipe-modal-btn ${e.className ?? ""}`.trim();
2541
2541
  const n = ee(e.label ?? "OK");
2542
2542
  if (r.append(n), t === "link" && e.href && (r.href = e.href), e.method && r.addEventListener("click", (s) => {
@@ -2911,7 +2911,7 @@ const V = [];
2911
2911
  function Vr(i = "top right") {
2912
2912
  const e = "ipe-modal-toast-container", t = `${e}-${i.replace(/[\s-\.|\/]+/g, "-")}`;
2913
2913
  let r = document.getElementById(t);
2914
- return r || (r = T("div", {
2914
+ return r || (r = j("div", {
2915
2915
  className: `${e} ${i}`,
2916
2916
  attrs: { id: t, "data-position": i }
2917
2917
  }), document.body.appendChild(r)), r;
@@ -3011,7 +3011,7 @@ var Jr = Object.create, Je = Object.defineProperty, Qr = Object.getOwnPropertyDe
3011
3011
  Vt = [F(["api", "storage"])];
3012
3012
  class ge extends (Yt = z) {
3013
3013
  constructor(e) {
3014
- super(e, "wiki", !1), this.ctx = e, this._data = {}, this.CACHE_VERSION = 4, this.CACHE_TTL = {
3014
+ super(e, "wiki", !1), this.ctx = e, this._data = {}, this.CACHE_VERSION = 5, this.CACHE_TTL = {
3015
3015
  siteinfo: 1e3 * 60 * 60 * 24 * 3,
3016
3016
  // 3 days
3017
3017
  userinfo: 1e3 * 60 * 30
@@ -3019,7 +3019,7 @@ class ge extends (Yt = z) {
3019
3019
  }, this.QUERY_DATA = {
3020
3020
  siteinfo: {
3021
3021
  meta: "siteinfo|filerepoinfo",
3022
- siprop: "general|specialpagealiases|namespacealiases|namespaces|magicwords",
3022
+ siprop: "general|specialpagealiases|namespacealiases|namespaces|magicwords|fileextensions",
3023
3023
  friprop: "canUpload|displayname|initialCapital|local|name|rootUrl|scriptDirUrl|thumbUrl|url"
3024
3024
  },
3025
3025
  userinfo: { meta: "userinfo", uiprop: "groups|rights|blockinfo|options" }
@@ -3110,30 +3110,31 @@ class ge extends (Yt = z) {
3110
3110
  return this.saveToCache(e, n), this._data[e] = n, this.logger.debug("Fetched from API", e, n), n;
3111
3111
  }
3112
3112
  }
3113
- getCacheKey(e) {
3114
- return `${e}:${new URL(this.ctx.api.config.baseURL).pathname.replace(/^\//, "")}`;
3113
+ getCacheKey(e, t = this.api) {
3114
+ const r = new URL(t.config.baseURL, window.location.origin);
3115
+ return `${e}:${r.host}/${r.pathname.replace(/^\//, "")}`;
3115
3116
  }
3116
- async fetchFromApi(e) {
3117
- return this.api.get({
3117
+ async fetchFromApi(e, t = this.api) {
3118
+ return t.get({
3118
3119
  action: "query",
3119
3120
  ...this.QUERY_DATA[e]
3120
- }).then(({ data: t }) => {
3121
- if (typeof t?.query != "object" || t.query === null)
3122
- throw new Error("Invalid query data", { cause: t });
3123
- return e === "siteinfo" ? t.query : t.query?.[e] || t.query;
3124
- }).catch((t) => (this.logger.error("Failed to fetch", t), Promise.reject(t)));
3121
+ }).then(({ data: r }) => {
3122
+ if (typeof r?.query != "object" || r.query === null)
3123
+ throw new Error("Invalid query data", { cause: r });
3124
+ return e === "siteinfo" ? r.query : r.query?.[e] || r.query;
3125
+ }).catch((r) => (this.logger.error("Failed to fetch", r), Promise.reject(r)));
3125
3126
  }
3126
- async fetchFromCache(e) {
3127
- const t = this.getCacheKey(e);
3128
- return await this.CACHE_DB.get(t, this.CACHE_TTL[e]);
3127
+ async fetchFromCache(e, t = this.api) {
3128
+ const r = this.getCacheKey(e, t);
3129
+ return await this.CACHE_DB.get(r, this.CACHE_TTL[e]);
3129
3130
  }
3130
- async saveToCache(e, t) {
3131
- const r = this.getCacheKey(e);
3132
- return this.CACHE_DB.set(r, t);
3131
+ async saveToCache(e, t, r = this.api) {
3132
+ const n = this.getCacheKey(e, r);
3133
+ return this.CACHE_DB.set(n, t);
3133
3134
  }
3134
- async invalidateCache(e) {
3135
- const t = this.getCacheKey(e);
3136
- return this.CACHE_DB.delete(t);
3135
+ async invalidateCache(e, t = this.api) {
3136
+ const r = this.getCacheKey(e, t);
3137
+ return this.CACHE_DB.delete(r);
3137
3138
  }
3138
3139
  async onClearCache() {
3139
3140
  await this.CACHE_DB.clear();
@@ -3171,6 +3172,15 @@ class ge extends (Yt = z) {
3171
3172
  get magicWords() {
3172
3173
  return this.siteInfo.magicwords;
3173
3174
  }
3175
+ get allowedFileExtensions() {
3176
+ return (this.siteInfo.fileextensions ?? []).map((e) => e.ext);
3177
+ }
3178
+ async getAllowedFileExtensions(e) {
3179
+ if (!e)
3180
+ return this.allowedFileExtensions;
3181
+ const t = await this.fetchFromCache("siteinfo", e), r = t ?? await this.fetchFromApi("siteinfo", e);
3182
+ return t || this.saveToCache("siteinfo", r, e), (r.fileextensions ?? []).map((n) => n.ext);
3183
+ }
3174
3184
  // userInfo
3175
3185
  get userInfo() {
3176
3186
  return this._data.userinfo;
@@ -3446,8 +3456,8 @@ var L;
3446
3456
  const w = indexedDB.open(u, p);
3447
3457
  w.onupgradeneeded = () => {
3448
3458
  try {
3449
- const O = w.result, A = w.transaction;
3450
- y?.(O, A);
3459
+ const O = w.result, C = w.transaction;
3460
+ y?.(O, C);
3451
3461
  } catch (O) {
3452
3462
  g(O);
3453
3463
  }
@@ -3467,17 +3477,17 @@ var L;
3467
3477
  async function n(u, p, y) {
3468
3478
  let _ = !u.objectStoreNames.contains(p), g = [];
3469
3479
  if (!_ && y?.indexes?.length) {
3470
- const A = u.transaction(p, "readonly"), l = A.objectStore(p), c = new Set(Array.from(l.indexNames));
3480
+ const C = u.transaction(p, "readonly"), l = C.objectStore(p), c = new Set(Array.from(l.indexNames));
3471
3481
  g = (y.indexes || []).filter((h) => !c.has(h.name)), await new Promise((h, d) => {
3472
- A.oncomplete = () => h(), A.onabort = () => d(A.error), A.onerror = () => d(A.error);
3482
+ C.oncomplete = () => h(), C.onabort = () => d(C.error), C.onerror = () => d(C.error);
3473
3483
  });
3474
3484
  }
3475
3485
  if (!_ && g.length === 0) return u;
3476
3486
  const w = u.version + 1;
3477
3487
  u.close();
3478
- const O = await r(u.name, w, (A, l) => {
3488
+ const O = await r(u.name, w, (C, l) => {
3479
3489
  let c;
3480
- A.objectStoreNames.contains(p) ? c = l.objectStore(p) : c = A.createObjectStore(p, {
3490
+ C.objectStoreNames.contains(p) ? c = l.objectStore(p) : c = C.createObjectStore(p, {
3481
3491
  keyPath: y?.keyPath ?? void 0,
3482
3492
  autoIncrement: !!y?.autoIncrement
3483
3493
  });
@@ -3764,7 +3774,7 @@ function Jt(i) {
3764
3774
  function wt(i) {
3765
3775
  return i === "html" ? [document.documentElement] : i === "body" ? [document.body] : [document.documentElement, document.body];
3766
3776
  }
3767
- function Ae(i, e) {
3777
+ function Ce(i, e) {
3768
3778
  return i.some((t) => e.some((r) => t.classList.contains(r)));
3769
3779
  }
3770
3780
  function fn(i) {
@@ -3773,11 +3783,11 @@ function fn(i) {
3773
3783
  return {
3774
3784
  name: i.name,
3775
3785
  match() {
3776
- return Ae([document.documentElement, document.body], i.skinClasses);
3786
+ return Ce([document.documentElement, document.body], i.skinClasses);
3777
3787
  },
3778
3788
  getCurrentTheme() {
3779
3789
  const o = wt(e);
3780
- return Ae(o, i.darkClasses) || t.length > 0 && Ae(o, t) && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
3790
+ return Ce(o, i.darkClasses) || t.length > 0 && Ce(o, t) && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
3781
3791
  },
3782
3792
  startObserving(o) {
3783
3793
  if (!r) {
@@ -3933,7 +3943,7 @@ class Sn extends z {
3933
3943
  }
3934
3944
  class et extends z {
3935
3945
  constructor(e) {
3936
- super(e, "wikiTitle", !0), this.ctx = e, this.logger = this.ctx.logger("WikiTitleService"), this._cachedTitles = /* @__PURE__ */ new Map(), this.wiki = this.ctx.wiki, this.wikiBaseUrl = this.wiki.baseUrl, this.wikiArticlePath = this.wiki.articlePath.replace("$1", ""), this.wikiArticleBaseUrl = this.wiki.articleBaseUrl.replace("$1", ""), this.wikiIndexPhpUrl = this.wiki.getSciprtUrl("index.php"), this.Title = Ai(this.ctx.wiki.siteInfo);
3946
+ super(e, "wikiTitle", !0), this.ctx = e, this.logger = this.ctx.logger("WikiTitleService"), this._cachedTitles = /* @__PURE__ */ new Map(), this.wiki = this.ctx.wiki, this.wikiBaseUrl = this.wiki.baseUrl, this.wikiArticlePath = this.wiki.articlePath.replace("$1", ""), this.wikiArticleBaseUrl = this.wiki.articleBaseUrl.replace("$1", ""), this.wikiIndexPhpUrl = this.wiki.getSciprtUrl("index.php"), this.Title = Ci(this.ctx.wiki.siteInfo);
3937
3947
  }
3938
3948
  static {
3939
3949
  this.inject = ["wiki", "wikiPage"];
@@ -4073,13 +4083,13 @@ async function $n(i) {
4073
4083
  function _s(i) {
4074
4084
  return ii(i) ? i() : i;
4075
4085
  }
4076
- var En = Object.create, tt = Object.defineProperty, An = Object.getOwnPropertyDescriptor, ri = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), ni = (i) => {
4086
+ var En = Object.create, tt = Object.defineProperty, Cn = Object.getOwnPropertyDescriptor, ri = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), ni = (i) => {
4077
4087
  throw TypeError(i);
4078
- }, Cn = (i, e, t) => e in i ? tt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, On = (i, e) => tt(i, "name", { value: e, configurable: !0 }), Pn = (i) => [, , , En(i?.[ri("metadata")] ?? null)], In = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], si = (i) => i !== void 0 && typeof i != "function" ? ni("Function expected") : i, Ln = (i, e, t, r, n) => ({ kind: In[i], name: e, metadata: r, addInitializer: (s) => t._ ? ni("Already initialized") : n.push(si(s || null)) }), Rn = (i, e) => Cn(e, ri("metadata"), i[3]), jn = (i, e, t, r) => {
4088
+ }, An = (i, e, t) => e in i ? tt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, On = (i, e) => tt(i, "name", { value: e, configurable: !0 }), Pn = (i) => [, , , En(i?.[ri("metadata")] ?? null)], In = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], si = (i) => i !== void 0 && typeof i != "function" ? ni("Function expected") : i, Ln = (i, e, t, r, n) => ({ kind: In[i], name: e, metadata: r, addInitializer: (s) => t._ ? ni("Already initialized") : n.push(si(s || null)) }), Rn = (i, e) => An(e, ri("metadata"), i[3]), Tn = (i, e, t, r) => {
4079
4089
  for (var n = 0, s = i[e >> 1], o = s && s.length; n < o; n++) s[n].call(t);
4080
4090
  return r;
4081
- }, Tn = (i, e, t, r, n, s) => {
4082
- var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && An(n, t));
4091
+ }, jn = (i, e, t, r, n, s) => {
4092
+ var o, a, f, u = e & 7, p = !1, y = 0, _ = i[y] || (i[y] = []), g = u && (n = n.prototype, u < 5 && (u > 3 || !p) && Cn(n, t));
4083
4093
  On(n, t);
4084
4094
  for (var w = r.length - 1; w >= 0; w--)
4085
4095
  f = Ln(u, t, a = {}, i[3], _), o = (0, r[w])(n, f), a._ = 1, si(o) && (n = o);
@@ -4090,7 +4100,7 @@ class ye extends (ai = z) {
4090
4100
  constructor(e) {
4091
4101
  super(e, "preferences", !0), this.ctx = e, this.db = void 0, this.customRegistries = [], this.categoryDefinitions = [], this._defaultPreferences = {}, e.set("prefs", this), this.db = e.storage.createDatabase(`preferences:${e.wiki.userInfo.id}`, 1 / 0);
4092
4102
  try {
4093
- this._migrageFromLegacyMasterDB();
4103
+ this._migrateFromLegacyMasterDB();
4094
4104
  } catch {
4095
4105
  }
4096
4106
  }
@@ -4191,7 +4201,7 @@ class ye extends (ai = z) {
4191
4201
  getConfigCategories() {
4192
4202
  return this.categoryDefinitions;
4193
4203
  }
4194
- async _migrageFromLegacyMasterDB() {
4204
+ async _migrateFromLegacyMasterDB() {
4195
4205
  const e = this.ctx.storage.createDatabase("preferences", 1 / 0);
4196
4206
  let t = 0;
4197
4207
  for await (const [r, n] of e.entries())
@@ -4200,8 +4210,8 @@ class ye extends (ai = z) {
4200
4210
  }
4201
4211
  }
4202
4212
  it = Pn(ai);
4203
- ye = Tn(it, 0, "PreferencesService", oi, ye);
4204
- jn(it, 1, ye);
4213
+ ye = jn(it, 0, "PreferencesService", oi, ye);
4214
+ Tn(it, 1, ye);
4205
4215
  var rt = /* @__PURE__ */ ((i) => (i.ANALYTICS_API_BASE = "https://analytics.ipe.wiki/api/v6", i.ANALYTICS_DASH_URL = "https://analytics.ipe.wiki", i.GITHUB_URL = "https://github.com/inpageedit/inpageedit-next", i.GITHUB_OWNER = "inpageedit", i.GITHUB_REPO = "inpageedit-next", i.HOME_URL = "https://www.ipe.wiki/", i.UPDATE_LOGS_URL = "https://www.ipe.wiki/changelogs/", i.PLUGIN_REGISTRY_URL = "https://registry.ipe.wiki/registry.v1.json", i.I18N_INDEX_URL = "https://registry.ipe.wiki/i18n/index.json", i.QQ_GROUP_ID = "1026023666", i))(rt || {});
4206
4216
  const ci = "", li = "", Dn = /\\\{/g, Nn = /\\\}/g, Mn = new RegExp(ci, "g"), Bn = new RegExp(li, "g");
4207
4217
  function bt(i) {
@@ -4811,14 +4821,14 @@ function as(i) {
4811
4821
  f.setUint32(r - 8, o, !0), f.setUint32(r - 4, a, !0);
4812
4822
  let u = 1732584193, p = 4023233417, y = 2562383102, _ = 271733878;
4813
4823
  const g = new Uint32Array(16);
4814
- for (let A = 0; A < n.length; A += 64) {
4815
- for (let m = 0; m < 16; m++) g[m] = f.getUint32(A + m * 4, !0);
4824
+ for (let C = 0; C < n.length; C += 64) {
4825
+ for (let m = 0; m < 16; m++) g[m] = f.getUint32(C + m * 4, !0);
4816
4826
  let l = u, c = p, h = y, d = _;
4817
4827
  for (let m = 0; m < 64; m++) {
4818
4828
  let v, x;
4819
4829
  m < 16 ? (v = c & h | ~c & d, x = m) : m < 32 ? (v = d & c | ~d & h, x = (5 * m + 1) % 16) : m < 48 ? (v = c ^ h ^ d, x = (3 * m + 5) % 16) : (v = h ^ (c | ~d), x = 7 * m % 16);
4820
- const C = d, Se = l + v + os[m] + g[x] >>> 0;
4821
- d = h, h = c, c = c + ns(Se, ss[m]) >>> 0, l = C;
4830
+ const A = d, Se = l + v + os[m] + g[x] >>> 0;
4831
+ d = h, h = c, c = c + ns(Se, ss[m]) >>> 0, l = A;
4822
4832
  }
4823
4833
  u = u + l >>> 0, p = p + c >>> 0, y = y + h >>> 0, _ = _ + d >>> 0;
4824
4834
  }
@@ -4852,7 +4862,7 @@ class be extends (vi = z) {
4852
4862
  return this.fileRepos.find((e) => e.local);
4853
4863
  }
4854
4864
  get writableFileRepo() {
4855
- return this.fileRepos.find((e) => e.canUpload);
4865
+ return this.fileRepos.find((e) => e.canUpload) ?? this.fileRepos.find((e) => !e.local && e.scriptDirUrl);
4856
4866
  }
4857
4867
  getFileName(e) {
4858
4868
  if (e = this.ctx.wikiTitle.newTitle(e, 6), ![6, -2].includes(e.getNamespaceId()))
@@ -4873,7 +4883,7 @@ class be extends (vi = z) {
4873
4883
  return new URL(`${t.rootUrl}/${r}`, location.origin).toString();
4874
4884
  }
4875
4885
  async upload(e, t) {
4876
- if (t = t || this.writableFileRepo, !t?.canUpload)
4886
+ if (t = t || this.writableFileRepo, !t)
4877
4887
  throw new Error("No writable file repository found");
4878
4888
  if (!e.file && !e.url && !e.chunk && !e.filekey)
4879
4889
  throw new Error('At least one of "file", "url", "chunk", or "filekey" is required');
@@ -4894,7 +4904,7 @@ class ve extends M {
4894
4904
  constructor(e) {
4895
4905
  super({
4896
4906
  name: "InPageEdit"
4897
- }), this.version = "0.17.4", this.Endpoints = rt, this.schema = $, this.config = Ci(ve.DEFAULT_CONFIG, e), this.logger = lr({
4907
+ }), this.version = "0.18.0", this.Endpoints = rt, this.schema = $, this.config = Ai(ve.DEFAULT_CONFIG, e), this.logger = lr({
4898
4908
  name: "IPE",
4899
4909
  color: "#33aaff",
4900
4910
  level: this.config.logLevel
@@ -4930,7 +4940,7 @@ class ve extends M {
4930
4940
  // WikiMetadataService
4931
4941
  "wiki",
4932
4942
  "getUrl",
4933
- "getSciprtUrl",
4943
+ "getScriptUrl",
4934
4944
  "getMainpageUrl"
4935
4945
  ]);
4936
4946
  }
@@ -4945,26 +4955,26 @@ class ve extends M {
4945
4955
  // TODO: 这里不应该硬编码,暂时先这样
4946
4956
  async #e() {
4947
4957
  [
4948
- import("./index-B5KNZ_9z.js").then(({ PluginAnalytics: t }) => t),
4949
- import("./index-ruv3nAtX.js").then(
4958
+ import("./index-B5tbjHvN.js").then(({ PluginAnalytics: t }) => t),
4959
+ import("./index-mLleTCbq.js").then(
4950
4960
  ({ PluginInArticleLinks: t }) => t
4951
4961
  ),
4952
- import("./index-QZjXZBoj.js").then(({ PluginPluginStore: t }) => t),
4953
- import("./index-Bd_cTayA.js").then(
4962
+ import("./index-D6AvNjpW.js").then(({ PluginPluginStore: t }) => t),
4963
+ import("./index-b29qTV0M.js").then(
4954
4964
  ({ PluginPreferencesUI: t }) => t
4955
4965
  ),
4956
- import("./index-BFdMEvlW.js").then(({ PluginQuickEdit: t }) => t),
4957
- import("./index-DHitL1S2.js").then(({ PluginQuickMove: t }) => t),
4958
- import("./index-BoVgsh8u.js").then(
4966
+ import("./index-BVuMfFbP.js").then(({ PluginQuickEdit: t }) => t),
4967
+ import("./index-D3hnOW_f.js").then(({ PluginQuickMove: t }) => t),
4968
+ import("./index-DkyIt0u7.js").then(
4959
4969
  ({ PluginQuickPreview: t }) => t
4960
4970
  ),
4961
- import("./index-S6Jhp39r.js").then(({ PluginQuickDiff: t }) => t),
4962
- import("./index-CoX1x5ls.js").then(
4971
+ import("./index-B6Zxq3gX.js").then(({ PluginQuickDiff: t }) => t),
4972
+ import("./index-Cn0EjRz9.js").then(
4963
4973
  ({ PluginQuickRedirect: t }) => t
4964
4974
  ),
4965
- import("./index-CZfEZBOj.js").then(({ PluginQuickUpload: t }) => t),
4966
- import("./index-Bf8jOXlz.js").then(({ PluginQuickUsage: t }) => t),
4967
- import("./index-D8_-baBt.js").then(({ PluginToolbox: t }) => t)
4975
+ import("./index-JE9-Xotj.js").then(({ PluginQuickUpload: t }) => t),
4976
+ import("./index-DiWAbu-c.js").then(({ PluginQuickUsage: t }) => t),
4977
+ import("./index-BwGWWeee.js").then(({ PluginToolbox: t }) => t)
4968
4978
  ].forEach(async (t) => {
4969
4979
  this.plugin(await t);
4970
4980
  });
@@ -5021,4 +5031,4 @@ export {
5021
5031
  Sn as v,
5022
5032
  et as w
5023
5033
  };
5024
- //# sourceMappingURL=index-BAJiXDPz.js.map
5034
+ //# sourceMappingURL=index-9I-lTJju.js.map