mudlet-map-editor 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/index.js +564 -525
- package/dist-lib/styles.css +1 -1
- package/package.json +1 -1
package/dist-lib/index.js
CHANGED
|
@@ -105,7 +105,7 @@ function O(e) {
|
|
|
105
105
|
//#endregion
|
|
106
106
|
//#region node_modules/vite-plugin-node-polyfills/shims/buffer/dist/index.js
|
|
107
107
|
var k = {}, A = {};
|
|
108
|
-
A.byteLength = R, A.toByteArray =
|
|
108
|
+
A.byteLength = R, A.toByteArray = B, A.fromByteArray = ee;
|
|
109
109
|
for (var j = [], M = [], N = typeof Uint8Array < "u" ? Uint8Array : Array, P = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", F = 0, I = P.length; F < I; ++F) j[F] = P[F], M[P.charCodeAt(F)] = F;
|
|
110
110
|
M[45] = 62, M[95] = 63;
|
|
111
111
|
function L(e) {
|
|
@@ -120,27 +120,27 @@ function R(e) {
|
|
|
120
120
|
var t = L(e), n = t[0], r = t[1];
|
|
121
121
|
return (n + r) * 3 / 4 - r;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function z(e, t, n) {
|
|
124
124
|
return (t + n) * 3 / 4 - n;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
127
|
-
var t, n = L(e), r = n[0], i = n[1], a = new N(
|
|
126
|
+
function B(e) {
|
|
127
|
+
var t, n = L(e), r = n[0], i = n[1], a = new N(z(e, r, i)), o = 0, s = i > 0 ? r - 4 : r, c;
|
|
128
128
|
for (c = 0; c < s; c += 4) t = M[e.charCodeAt(c)] << 18 | M[e.charCodeAt(c + 1)] << 12 | M[e.charCodeAt(c + 2)] << 6 | M[e.charCodeAt(c + 3)], a[o++] = t >> 16 & 255, a[o++] = t >> 8 & 255, a[o++] = t & 255;
|
|
129
129
|
return i === 2 && (t = M[e.charCodeAt(c)] << 2 | M[e.charCodeAt(c + 1)] >> 4, a[o++] = t & 255), i === 1 && (t = M[e.charCodeAt(c)] << 10 | M[e.charCodeAt(c + 1)] << 4 | M[e.charCodeAt(c + 2)] >> 2, a[o++] = t >> 8 & 255, a[o++] = t & 255), a;
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function V(e) {
|
|
132
132
|
return j[e >> 18 & 63] + j[e >> 12 & 63] + j[e >> 6 & 63] + j[e & 63];
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
for (var r, i = [], a = t; a < n; a += 3) r = (e[a] << 16 & 16711680) + (e[a + 1] << 8 & 65280) + (e[a + 2] & 255), i.push(
|
|
134
|
+
function H(e, t, n) {
|
|
135
|
+
for (var r, i = [], a = t; a < n; a += 3) r = (e[a] << 16 & 16711680) + (e[a + 1] << 8 & 65280) + (e[a + 2] & 255), i.push(V(r));
|
|
136
136
|
return i.join("");
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
for (var t, n = e.length, r = n % 3, i = [], a = 16383, o = 0, s = n - r; o < s; o += a) i.push(
|
|
138
|
+
function ee(e) {
|
|
139
|
+
for (var t, n = e.length, r = n % 3, i = [], a = 16383, o = 0, s = n - r; o < s; o += a) i.push(H(e, o, o + a > s ? s : o + a));
|
|
140
140
|
return r === 1 ? (t = e[n - 1], i.push(j[t >> 2] + j[t << 4 & 63] + "==")) : r === 2 && (t = (e[n - 2] << 8) + e[n - 1], i.push(j[t >> 10] + j[t >> 4 & 63] + j[t << 2 & 63] + "=")), i.join("");
|
|
141
141
|
}
|
|
142
|
-
var
|
|
143
|
-
|
|
142
|
+
var te = {};
|
|
143
|
+
te.read = function(e, t, n, r, i) {
|
|
144
144
|
var a, o, s = i * 8 - r - 1, c = (1 << s) - 1, l = c >> 1, u = -7, d = n ? i - 1 : 0, f = n ? -1 : 1, p = e[t + d];
|
|
145
145
|
for (d += f, a = p & (1 << -u) - 1, p >>= -u, u += s; u > 0; a = a * 256 + e[t + d], d += f, u -= 8);
|
|
146
146
|
for (o = a & (1 << -u) - 1, a >>= -u, u += r; u > 0; o = o * 256 + e[t + d], d += f, u -= 8);
|
|
@@ -148,13 +148,13 @@ ne.read = function(e, t, n, r, i) {
|
|
|
148
148
|
else if (a === c) return o ? NaN : (p ? -1 : 1) * Infinity;
|
|
149
149
|
else o += 2 ** r, a -= l;
|
|
150
150
|
return (p ? -1 : 1) * o * 2 ** (a - r);
|
|
151
|
-
},
|
|
151
|
+
}, te.write = function(e, t, n, r, i, a) {
|
|
152
152
|
var o, s, c, l = a * 8 - i - 1, u = (1 << l) - 1, d = u >> 1, f = i === 23 ? 2 ** -24 - 2 ** -77 : 0, p = r ? 0 : a - 1, m = r ? 1 : -1, h = +(t < 0 || t === 0 && 1 / t < 0);
|
|
153
153
|
for (t = Math.abs(t), isNaN(t) || t === Infinity ? (s = +!!isNaN(t), o = u) : (o = Math.floor(Math.log(t) / Math.LN2), t * (c = 2 ** -o) < 1 && (o--, c *= 2), o + d >= 1 ? t += f / c : t += f * 2 ** (1 - d), t * c >= 2 && (o++, c /= 2), o + d >= u ? (s = 0, o = u) : o + d >= 1 ? (s = (t * c - 1) * 2 ** i, o += d) : (s = t * 2 ** (d - 1) * 2 ** i, o = 0)); i >= 8; e[n + p] = s & 255, p += m, s /= 256, i -= 8);
|
|
154
154
|
for (o = o << i | s, l += i; l > 0; e[n + p] = o & 255, p += m, o /= 256, l -= 8);
|
|
155
155
|
e[n + p - m] |= h * 128;
|
|
156
156
|
}, (function(e) {
|
|
157
|
-
let t = A, n =
|
|
157
|
+
let t = A, n = te, r = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
|
|
158
158
|
e.Buffer = u, e.SlowBuffer = x, e.INSPECT_MAX_BYTES = 50;
|
|
159
159
|
let i = 2147483647;
|
|
160
160
|
e.kMaxLength = i;
|
|
@@ -198,7 +198,7 @@ ne.read = function(e, t, n, r, i) {
|
|
|
198
198
|
if (typeof e == "string") return h(e, t);
|
|
199
199
|
if (o.isView(e)) return _(e);
|
|
200
200
|
if (e == null) throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e);
|
|
201
|
-
if (
|
|
201
|
+
if (J(e, o) || e && J(e.buffer, o) || s !== void 0 && (J(e, s) || e && J(e.buffer, s))) return v(e, t, n);
|
|
202
202
|
if (typeof e == "number") throw TypeError("The \"value\" argument must not be of type number. Received type number");
|
|
203
203
|
let r = e.valueOf && e.valueOf();
|
|
204
204
|
if (r != null && r !== e) return u.from(r, t, n);
|
|
@@ -239,7 +239,7 @@ ne.read = function(e, t, n, r, i) {
|
|
|
239
239
|
return n;
|
|
240
240
|
}
|
|
241
241
|
function _(e) {
|
|
242
|
-
if (
|
|
242
|
+
if (J(e, a)) {
|
|
243
243
|
let t = new a(e);
|
|
244
244
|
return v(t.buffer, t.byteOffset, t.byteLength);
|
|
245
245
|
}
|
|
@@ -256,7 +256,7 @@ ne.read = function(e, t, n, r, i) {
|
|
|
256
256
|
let t = b(e.length) | 0, n = l(t);
|
|
257
257
|
return n.length === 0 || e.copy(n, 0, 0, t), n;
|
|
258
258
|
}
|
|
259
|
-
if (e.length !== void 0) return typeof e.length != "number" ||
|
|
259
|
+
if (e.length !== void 0) return typeof e.length != "number" || he(e.length) ? l(0) : g(e);
|
|
260
260
|
if (e.type === "Buffer" && Array.isArray(e.data)) return g(e.data);
|
|
261
261
|
}
|
|
262
262
|
function b(e) {
|
|
@@ -269,7 +269,7 @@ ne.read = function(e, t, n, r, i) {
|
|
|
269
269
|
u.isBuffer = function(e) {
|
|
270
270
|
return e != null && e._isBuffer === !0 && e !== u.prototype;
|
|
271
271
|
}, u.compare = function(e, t) {
|
|
272
|
-
if (
|
|
272
|
+
if (J(e, a) && (e = u.from(e, e.offset, e.byteLength)), J(t, a) && (t = u.from(t, t.offset, t.byteLength)), !u.isBuffer(e) || !u.isBuffer(t)) throw TypeError("The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array");
|
|
273
273
|
if (e === t) return 0;
|
|
274
274
|
let n = e.length, r = t.length;
|
|
275
275
|
for (let i = 0, a = Math.min(n, r); i < a; ++i) if (e[i] !== t[i]) {
|
|
@@ -300,7 +300,7 @@ ne.read = function(e, t, n, r, i) {
|
|
|
300
300
|
let r = u.allocUnsafe(t), i = 0;
|
|
301
301
|
for (n = 0; n < e.length; ++n) {
|
|
302
302
|
let t = e[n];
|
|
303
|
-
if (
|
|
303
|
+
if (J(t, a)) i + t.length > r.length ? (u.isBuffer(t) || (t = u.from(t)), t.copy(r, i)) : a.prototype.set.call(r, t, i);
|
|
304
304
|
else if (u.isBuffer(t)) t.copy(r, i);
|
|
305
305
|
else throw TypeError("\"list\" argument must be an Array of Buffers");
|
|
306
306
|
i += t.length;
|
|
@@ -309,7 +309,7 @@ ne.read = function(e, t, n, r, i) {
|
|
|
309
309
|
};
|
|
310
310
|
function S(e, t) {
|
|
311
311
|
if (u.isBuffer(e)) return e.length;
|
|
312
|
-
if (o.isView(e) ||
|
|
312
|
+
if (o.isView(e) || J(e, o)) return e.byteLength;
|
|
313
313
|
if (typeof e != "string") throw TypeError("The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type " + typeof e);
|
|
314
314
|
let n = e.length, r = arguments.length > 2 && arguments[2] === !0;
|
|
315
315
|
if (!r && n === 0) return 0;
|
|
@@ -319,15 +319,15 @@ ne.read = function(e, t, n, r, i) {
|
|
|
319
319
|
case "latin1":
|
|
320
320
|
case "binary": return n;
|
|
321
321
|
case "utf8":
|
|
322
|
-
case "utf-8": return
|
|
322
|
+
case "utf-8": return de(e).length;
|
|
323
323
|
case "ucs2":
|
|
324
324
|
case "ucs-2":
|
|
325
325
|
case "utf16le":
|
|
326
326
|
case "utf-16le": return n * 2;
|
|
327
327
|
case "hex": return n >>> 1;
|
|
328
|
-
case "base64": return
|
|
328
|
+
case "base64": return q(e).length;
|
|
329
329
|
default:
|
|
330
|
-
if (i) return r ? -1 :
|
|
330
|
+
if (i) return r ? -1 : de(e).length;
|
|
331
331
|
t = ("" + t).toLowerCase(), i = !0;
|
|
332
332
|
}
|
|
333
333
|
}
|
|
@@ -336,7 +336,7 @@ ne.read = function(e, t, n, r, i) {
|
|
|
336
336
|
let r = !1;
|
|
337
337
|
if ((t === void 0 || t < 0) && (t = 0), t > this.length || ((n === void 0 || n > this.length) && (n = this.length), n <= 0) || (n >>>= 0, t >>>= 0, n <= t)) return "";
|
|
338
338
|
for (e ||= "utf8";;) switch (e) {
|
|
339
|
-
case "hex": return
|
|
339
|
+
case "hex": return z(this, t, n);
|
|
340
340
|
case "utf8":
|
|
341
341
|
case "utf-8": return P(this, t, n);
|
|
342
342
|
case "ascii": return L(this, t, n);
|
|
@@ -346,7 +346,7 @@ ne.read = function(e, t, n, r, i) {
|
|
|
346
346
|
case "ucs2":
|
|
347
347
|
case "ucs-2":
|
|
348
348
|
case "utf16le":
|
|
349
|
-
case "utf-16le": return
|
|
349
|
+
case "utf-16le": return B(this, t, n);
|
|
350
350
|
default:
|
|
351
351
|
if (r) throw TypeError("Unknown encoding: " + e);
|
|
352
352
|
e = (e + "").toLowerCase(), r = !0;
|
|
@@ -382,7 +382,7 @@ ne.read = function(e, t, n, r, i) {
|
|
|
382
382
|
let t = "", n = e.INSPECT_MAX_BYTES;
|
|
383
383
|
return t = this.toString("hex", 0, n).replace(/(.{2})/g, "$1 ").trim(), this.length > n && (t += " ... "), "<Buffer " + t + ">";
|
|
384
384
|
}, r && (u.prototype[r] = u.prototype.inspect), u.prototype.compare = function(e, t, n, r, i) {
|
|
385
|
-
if (
|
|
385
|
+
if (J(e, a) && (e = u.from(e, e.offset, e.byteLength)), !u.isBuffer(e)) throw TypeError("The \"target\" argument must be one of type Buffer or Uint8Array. Received type " + typeof e);
|
|
386
386
|
if (t === void 0 && (t = 0), n === void 0 && (n = e ? e.length : 0), r === void 0 && (r = 0), i === void 0 && (i = this.length), t < 0 || n > e.length || r < 0 || i > this.length) throw RangeError("out of range index");
|
|
387
387
|
if (r >= i && t >= n) return 0;
|
|
388
388
|
if (r >= i) return -1;
|
|
@@ -397,7 +397,7 @@ ne.read = function(e, t, n, r, i) {
|
|
|
397
397
|
};
|
|
398
398
|
function T(e, t, n, r, i) {
|
|
399
399
|
if (e.length === 0) return -1;
|
|
400
|
-
if (typeof n == "string" ? (r = n, n = 0) : n > 2147483647 ? n = 2147483647 : n < -2147483648 && (n = -2147483648), n = +n,
|
|
400
|
+
if (typeof n == "string" ? (r = n, n = 0) : n > 2147483647 ? n = 2147483647 : n < -2147483648 && (n = -2147483648), n = +n, he(n) && (n = i ? 0 : e.length - 1), n < 0 && (n = e.length + n), n >= e.length) {
|
|
401
401
|
if (i) return -1;
|
|
402
402
|
n = e.length - 1;
|
|
403
403
|
} else if (n < 0) if (i) n = 0;
|
|
@@ -447,22 +447,22 @@ ne.read = function(e, t, n, r, i) {
|
|
|
447
447
|
let o;
|
|
448
448
|
for (o = 0; o < r; ++o) {
|
|
449
449
|
let r = parseInt(t.substr(o * 2, 2), 16);
|
|
450
|
-
if (
|
|
450
|
+
if (he(r)) return o;
|
|
451
451
|
e[n + o] = r;
|
|
452
452
|
}
|
|
453
453
|
return o;
|
|
454
454
|
}
|
|
455
455
|
function O(e, t, n, r) {
|
|
456
|
-
return
|
|
456
|
+
return me(de(t, e.length - n), e, n, r);
|
|
457
457
|
}
|
|
458
458
|
function k(e, t, n, r) {
|
|
459
|
-
return
|
|
459
|
+
return me(fe(t), e, n, r);
|
|
460
460
|
}
|
|
461
461
|
function j(e, t, n, r) {
|
|
462
|
-
return
|
|
462
|
+
return me(q(t), e, n, r);
|
|
463
463
|
}
|
|
464
464
|
function M(e, t, n, r) {
|
|
465
|
-
return
|
|
465
|
+
return me(pe(t, e.length - n), e, n, r);
|
|
466
466
|
}
|
|
467
467
|
u.prototype.write = function(e, t, n, r) {
|
|
468
468
|
if (t === void 0) r = "utf8", n = this.length, t = 0;
|
|
@@ -542,14 +542,14 @@ ne.read = function(e, t, n, r, i) {
|
|
|
542
542
|
for (let i = t; i < n; ++i) r += String.fromCharCode(e[i]);
|
|
543
543
|
return r;
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function z(e, t, n) {
|
|
546
546
|
let r = e.length;
|
|
547
547
|
(!t || t < 0) && (t = 0), (!n || n < 0 || n > r) && (n = r);
|
|
548
548
|
let i = "";
|
|
549
|
-
for (let r = t; r < n; ++r) i +=
|
|
549
|
+
for (let r = t; r < n; ++r) i += ge[e[r]];
|
|
550
550
|
return i;
|
|
551
551
|
}
|
|
552
|
-
function
|
|
552
|
+
function B(e, t, n) {
|
|
553
553
|
let r = e.slice(t, n), i = "";
|
|
554
554
|
for (let e = 0; e < r.length - 1; e += 2) i += String.fromCharCode(r[e] + r[e + 1] * 256);
|
|
555
555
|
return i;
|
|
@@ -560,88 +560,88 @@ ne.read = function(e, t, n, r, i) {
|
|
|
560
560
|
let r = this.subarray(e, t);
|
|
561
561
|
return Object.setPrototypeOf(r, u.prototype), r;
|
|
562
562
|
};
|
|
563
|
-
function
|
|
563
|
+
function V(e, t, n) {
|
|
564
564
|
if (e % 1 != 0 || e < 0) throw RangeError("offset is not uint");
|
|
565
565
|
if (e + t > n) throw RangeError("Trying to access beyond buffer length");
|
|
566
566
|
}
|
|
567
567
|
u.prototype.readUintLE = u.prototype.readUIntLE = function(e, t, n) {
|
|
568
|
-
e >>>= 0, t >>>= 0, n ||
|
|
568
|
+
e >>>= 0, t >>>= 0, n || V(e, t, this.length);
|
|
569
569
|
let r = this[e], i = 1, a = 0;
|
|
570
570
|
for (; ++a < t && (i *= 256);) r += this[e + a] * i;
|
|
571
571
|
return r;
|
|
572
572
|
}, u.prototype.readUintBE = u.prototype.readUIntBE = function(e, t, n) {
|
|
573
|
-
e >>>= 0, t >>>= 0, n ||
|
|
573
|
+
e >>>= 0, t >>>= 0, n || V(e, t, this.length);
|
|
574
574
|
let r = this[e + --t], i = 1;
|
|
575
575
|
for (; t > 0 && (i *= 256);) r += this[e + --t] * i;
|
|
576
576
|
return r;
|
|
577
577
|
}, u.prototype.readUint8 = u.prototype.readUInt8 = function(e, t) {
|
|
578
|
-
return e >>>= 0, t ||
|
|
578
|
+
return e >>>= 0, t || V(e, 1, this.length), this[e];
|
|
579
579
|
}, u.prototype.readUint16LE = u.prototype.readUInt16LE = function(e, t) {
|
|
580
|
-
return e >>>= 0, t ||
|
|
580
|
+
return e >>>= 0, t || V(e, 2, this.length), this[e] | this[e + 1] << 8;
|
|
581
581
|
}, u.prototype.readUint16BE = u.prototype.readUInt16BE = function(e, t) {
|
|
582
|
-
return e >>>= 0, t ||
|
|
582
|
+
return e >>>= 0, t || V(e, 2, this.length), this[e] << 8 | this[e + 1];
|
|
583
583
|
}, u.prototype.readUint32LE = u.prototype.readUInt32LE = function(e, t) {
|
|
584
|
-
return e >>>= 0, t ||
|
|
584
|
+
return e >>>= 0, t || V(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + this[e + 3] * 16777216;
|
|
585
585
|
}, u.prototype.readUint32BE = u.prototype.readUInt32BE = function(e, t) {
|
|
586
|
-
return e >>>= 0, t ||
|
|
587
|
-
}, u.prototype.readBigUInt64LE =
|
|
588
|
-
e >>>= 0,
|
|
586
|
+
return e >>>= 0, t || V(e, 4, this.length), this[e] * 16777216 + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]);
|
|
587
|
+
}, u.prototype.readBigUInt64LE = _e(function(e) {
|
|
588
|
+
e >>>= 0, se(e, "offset");
|
|
589
589
|
let t = this[e], n = this[e + 7];
|
|
590
|
-
(t === void 0 || n === void 0) &&
|
|
590
|
+
(t === void 0 || n === void 0) && ce(e, this.length - 8);
|
|
591
591
|
let r = t + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + this[++e] * 2 ** 24, i = this[++e] + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + n * 2 ** 24;
|
|
592
592
|
return BigInt(r) + (BigInt(i) << BigInt(32));
|
|
593
|
-
}), u.prototype.readBigUInt64BE =
|
|
594
|
-
e >>>= 0,
|
|
593
|
+
}), u.prototype.readBigUInt64BE = _e(function(e) {
|
|
594
|
+
e >>>= 0, se(e, "offset");
|
|
595
595
|
let t = this[e], n = this[e + 7];
|
|
596
|
-
(t === void 0 || n === void 0) &&
|
|
596
|
+
(t === void 0 || n === void 0) && ce(e, this.length - 8);
|
|
597
597
|
let r = t * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e], i = this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + n;
|
|
598
598
|
return (BigInt(r) << BigInt(32)) + BigInt(i);
|
|
599
599
|
}), u.prototype.readIntLE = function(e, t, n) {
|
|
600
|
-
e >>>= 0, t >>>= 0, n ||
|
|
600
|
+
e >>>= 0, t >>>= 0, n || V(e, t, this.length);
|
|
601
601
|
let r = this[e], i = 1, a = 0;
|
|
602
602
|
for (; ++a < t && (i *= 256);) r += this[e + a] * i;
|
|
603
603
|
return i *= 128, r >= i && (r -= 2 ** (8 * t)), r;
|
|
604
604
|
}, u.prototype.readIntBE = function(e, t, n) {
|
|
605
|
-
e >>>= 0, t >>>= 0, n ||
|
|
605
|
+
e >>>= 0, t >>>= 0, n || V(e, t, this.length);
|
|
606
606
|
let r = t, i = 1, a = this[e + --r];
|
|
607
607
|
for (; r > 0 && (i *= 256);) a += this[e + --r] * i;
|
|
608
608
|
return i *= 128, a >= i && (a -= 2 ** (8 * t)), a;
|
|
609
609
|
}, u.prototype.readInt8 = function(e, t) {
|
|
610
|
-
return e >>>= 0, t ||
|
|
610
|
+
return e >>>= 0, t || V(e, 1, this.length), this[e] & 128 ? (255 - this[e] + 1) * -1 : this[e];
|
|
611
611
|
}, u.prototype.readInt16LE = function(e, t) {
|
|
612
|
-
e >>>= 0, t ||
|
|
612
|
+
e >>>= 0, t || V(e, 2, this.length);
|
|
613
613
|
let n = this[e] | this[e + 1] << 8;
|
|
614
614
|
return n & 32768 ? n | 4294901760 : n;
|
|
615
615
|
}, u.prototype.readInt16BE = function(e, t) {
|
|
616
|
-
e >>>= 0, t ||
|
|
616
|
+
e >>>= 0, t || V(e, 2, this.length);
|
|
617
617
|
let n = this[e + 1] | this[e] << 8;
|
|
618
618
|
return n & 32768 ? n | 4294901760 : n;
|
|
619
619
|
}, u.prototype.readInt32LE = function(e, t) {
|
|
620
|
-
return e >>>= 0, t ||
|
|
620
|
+
return e >>>= 0, t || V(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24;
|
|
621
621
|
}, u.prototype.readInt32BE = function(e, t) {
|
|
622
|
-
return e >>>= 0, t ||
|
|
623
|
-
}, u.prototype.readBigInt64LE =
|
|
624
|
-
e >>>= 0,
|
|
622
|
+
return e >>>= 0, t || V(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
|
|
623
|
+
}, u.prototype.readBigInt64LE = _e(function(e) {
|
|
624
|
+
e >>>= 0, se(e, "offset");
|
|
625
625
|
let t = this[e], n = this[e + 7];
|
|
626
|
-
(t === void 0 || n === void 0) &&
|
|
626
|
+
(t === void 0 || n === void 0) && ce(e, this.length - 8);
|
|
627
627
|
let r = this[e + 4] + this[e + 5] * 2 ** 8 + this[e + 6] * 2 ** 16 + (n << 24);
|
|
628
628
|
return (BigInt(r) << BigInt(32)) + BigInt(t + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + this[++e] * 2 ** 24);
|
|
629
|
-
}), u.prototype.readBigInt64BE =
|
|
630
|
-
e >>>= 0,
|
|
629
|
+
}), u.prototype.readBigInt64BE = _e(function(e) {
|
|
630
|
+
e >>>= 0, se(e, "offset");
|
|
631
631
|
let t = this[e], n = this[e + 7];
|
|
632
|
-
(t === void 0 || n === void 0) &&
|
|
632
|
+
(t === void 0 || n === void 0) && ce(e, this.length - 8);
|
|
633
633
|
let r = (t << 24) + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e];
|
|
634
634
|
return (BigInt(r) << BigInt(32)) + BigInt(this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + n);
|
|
635
635
|
}), u.prototype.readFloatLE = function(e, t) {
|
|
636
|
-
return e >>>= 0, t ||
|
|
636
|
+
return e >>>= 0, t || V(e, 4, this.length), n.read(this, e, !0, 23, 4);
|
|
637
637
|
}, u.prototype.readFloatBE = function(e, t) {
|
|
638
|
-
return e >>>= 0, t ||
|
|
638
|
+
return e >>>= 0, t || V(e, 4, this.length), n.read(this, e, !1, 23, 4);
|
|
639
639
|
}, u.prototype.readDoubleLE = function(e, t) {
|
|
640
|
-
return e >>>= 0, t ||
|
|
640
|
+
return e >>>= 0, t || V(e, 8, this.length), n.read(this, e, !0, 52, 8);
|
|
641
641
|
}, u.prototype.readDoubleBE = function(e, t) {
|
|
642
|
-
return e >>>= 0, t ||
|
|
642
|
+
return e >>>= 0, t || V(e, 8, this.length), n.read(this, e, !1, 52, 8);
|
|
643
643
|
};
|
|
644
|
-
function
|
|
644
|
+
function H(e, t, n, r, i, a) {
|
|
645
645
|
if (!u.isBuffer(e)) throw TypeError("\"buffer\" argument must be a Buffer instance");
|
|
646
646
|
if (t > i || t < a) throw RangeError("\"value\" argument is out of bounds");
|
|
647
647
|
if (n + r > e.length) throw RangeError("Index out of range");
|
|
@@ -649,7 +649,7 @@ ne.read = function(e, t, n, r, i) {
|
|
|
649
649
|
u.prototype.writeUintLE = u.prototype.writeUIntLE = function(e, t, n, r) {
|
|
650
650
|
if (e = +e, t >>>= 0, n >>>= 0, !r) {
|
|
651
651
|
let r = 2 ** (8 * n) - 1;
|
|
652
|
-
|
|
652
|
+
H(this, e, t, n, r, 0);
|
|
653
653
|
}
|
|
654
654
|
let i = 1, a = 0;
|
|
655
655
|
for (this[t] = e & 255; ++a < n && (i *= 256);) this[t + a] = e / i & 255;
|
|
@@ -657,44 +657,44 @@ ne.read = function(e, t, n, r, i) {
|
|
|
657
657
|
}, u.prototype.writeUintBE = u.prototype.writeUIntBE = function(e, t, n, r) {
|
|
658
658
|
if (e = +e, t >>>= 0, n >>>= 0, !r) {
|
|
659
659
|
let r = 2 ** (8 * n) - 1;
|
|
660
|
-
|
|
660
|
+
H(this, e, t, n, r, 0);
|
|
661
661
|
}
|
|
662
662
|
let i = n - 1, a = 1;
|
|
663
663
|
for (this[t + i] = e & 255; --i >= 0 && (a *= 256);) this[t + i] = e / a & 255;
|
|
664
664
|
return t + n;
|
|
665
665
|
}, u.prototype.writeUint8 = u.prototype.writeUInt8 = function(e, t, n) {
|
|
666
|
-
return e = +e, t >>>= 0, n ||
|
|
666
|
+
return e = +e, t >>>= 0, n || H(this, e, t, 1, 255, 0), this[t] = e & 255, t + 1;
|
|
667
667
|
}, u.prototype.writeUint16LE = u.prototype.writeUInt16LE = function(e, t, n) {
|
|
668
|
-
return e = +e, t >>>= 0, n ||
|
|
668
|
+
return e = +e, t >>>= 0, n || H(this, e, t, 2, 65535, 0), this[t] = e & 255, this[t + 1] = e >>> 8, t + 2;
|
|
669
669
|
}, u.prototype.writeUint16BE = u.prototype.writeUInt16BE = function(e, t, n) {
|
|
670
|
-
return e = +e, t >>>= 0, n ||
|
|
670
|
+
return e = +e, t >>>= 0, n || H(this, e, t, 2, 65535, 0), this[t] = e >>> 8, this[t + 1] = e & 255, t + 2;
|
|
671
671
|
}, u.prototype.writeUint32LE = u.prototype.writeUInt32LE = function(e, t, n) {
|
|
672
|
-
return e = +e, t >>>= 0, n ||
|
|
672
|
+
return e = +e, t >>>= 0, n || H(this, e, t, 4, 4294967295, 0), this[t + 3] = e >>> 24, this[t + 2] = e >>> 16, this[t + 1] = e >>> 8, this[t] = e & 255, t + 4;
|
|
673
673
|
}, u.prototype.writeUint32BE = u.prototype.writeUInt32BE = function(e, t, n) {
|
|
674
|
-
return e = +e, t >>>= 0, n ||
|
|
674
|
+
return e = +e, t >>>= 0, n || H(this, e, t, 4, 4294967295, 0), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = e & 255, t + 4;
|
|
675
675
|
};
|
|
676
|
-
function
|
|
677
|
-
|
|
676
|
+
function ee(e, t, n, r, i) {
|
|
677
|
+
oe(t, r, i, e, n, 7);
|
|
678
678
|
let a = Number(t & BigInt(4294967295));
|
|
679
679
|
e[n++] = a, a >>= 8, e[n++] = a, a >>= 8, e[n++] = a, a >>= 8, e[n++] = a;
|
|
680
680
|
let o = Number(t >> BigInt(32) & BigInt(4294967295));
|
|
681
681
|
return e[n++] = o, o >>= 8, e[n++] = o, o >>= 8, e[n++] = o, o >>= 8, e[n++] = o, n;
|
|
682
682
|
}
|
|
683
|
-
function
|
|
684
|
-
|
|
683
|
+
function ne(e, t, n, r, i) {
|
|
684
|
+
oe(t, r, i, e, n, 7);
|
|
685
685
|
let a = Number(t & BigInt(4294967295));
|
|
686
686
|
e[n + 7] = a, a >>= 8, e[n + 6] = a, a >>= 8, e[n + 5] = a, a >>= 8, e[n + 4] = a;
|
|
687
687
|
let o = Number(t >> BigInt(32) & BigInt(4294967295));
|
|
688
688
|
return e[n + 3] = o, o >>= 8, e[n + 2] = o, o >>= 8, e[n + 1] = o, o >>= 8, e[n] = o, n + 8;
|
|
689
689
|
}
|
|
690
|
-
u.prototype.writeBigUInt64LE =
|
|
691
|
-
return
|
|
692
|
-
}), u.prototype.writeBigUInt64BE =
|
|
693
|
-
return
|
|
690
|
+
u.prototype.writeBigUInt64LE = _e(function(e, t = 0) {
|
|
691
|
+
return ee(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
692
|
+
}), u.prototype.writeBigUInt64BE = _e(function(e, t = 0) {
|
|
693
|
+
return ne(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
694
694
|
}), u.prototype.writeIntLE = function(e, t, n, r) {
|
|
695
695
|
if (e = +e, t >>>= 0, !r) {
|
|
696
696
|
let r = 2 ** (8 * n - 1);
|
|
697
|
-
|
|
697
|
+
H(this, e, t, n, r - 1, -r);
|
|
698
698
|
}
|
|
699
699
|
let i = 0, a = 1, o = 0;
|
|
700
700
|
for (this[t] = e & 255; ++i < n && (a *= 256);) e < 0 && o === 0 && this[t + i - 1] !== 0 && (o = 1), this[t + i] = (e / a >> 0) - o & 255;
|
|
@@ -702,44 +702,44 @@ ne.read = function(e, t, n, r, i) {
|
|
|
702
702
|
}, u.prototype.writeIntBE = function(e, t, n, r) {
|
|
703
703
|
if (e = +e, t >>>= 0, !r) {
|
|
704
704
|
let r = 2 ** (8 * n - 1);
|
|
705
|
-
|
|
705
|
+
H(this, e, t, n, r - 1, -r);
|
|
706
706
|
}
|
|
707
707
|
let i = n - 1, a = 1, o = 0;
|
|
708
708
|
for (this[t + i] = e & 255; --i >= 0 && (a *= 256);) e < 0 && o === 0 && this[t + i + 1] !== 0 && (o = 1), this[t + i] = (e / a >> 0) - o & 255;
|
|
709
709
|
return t + n;
|
|
710
710
|
}, u.prototype.writeInt8 = function(e, t, n) {
|
|
711
|
-
return e = +e, t >>>= 0, n ||
|
|
711
|
+
return e = +e, t >>>= 0, n || H(this, e, t, 1, 127, -128), e < 0 && (e = 255 + e + 1), this[t] = e & 255, t + 1;
|
|
712
712
|
}, u.prototype.writeInt16LE = function(e, t, n) {
|
|
713
|
-
return e = +e, t >>>= 0, n ||
|
|
713
|
+
return e = +e, t >>>= 0, n || H(this, e, t, 2, 32767, -32768), this[t] = e & 255, this[t + 1] = e >>> 8, t + 2;
|
|
714
714
|
}, u.prototype.writeInt16BE = function(e, t, n) {
|
|
715
|
-
return e = +e, t >>>= 0, n ||
|
|
715
|
+
return e = +e, t >>>= 0, n || H(this, e, t, 2, 32767, -32768), this[t] = e >>> 8, this[t + 1] = e & 255, t + 2;
|
|
716
716
|
}, u.prototype.writeInt32LE = function(e, t, n) {
|
|
717
|
-
return e = +e, t >>>= 0, n ||
|
|
717
|
+
return e = +e, t >>>= 0, n || H(this, e, t, 4, 2147483647, -2147483648), this[t] = e & 255, this[t + 1] = e >>> 8, this[t + 2] = e >>> 16, this[t + 3] = e >>> 24, t + 4;
|
|
718
718
|
}, u.prototype.writeInt32BE = function(e, t, n) {
|
|
719
|
-
return e = +e, t >>>= 0, n ||
|
|
720
|
-
}, u.prototype.writeBigInt64LE =
|
|
721
|
-
return
|
|
722
|
-
}), u.prototype.writeBigInt64BE =
|
|
723
|
-
return
|
|
719
|
+
return e = +e, t >>>= 0, n || H(this, e, t, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = e & 255, t + 4;
|
|
720
|
+
}, u.prototype.writeBigInt64LE = _e(function(e, t = 0) {
|
|
721
|
+
return ee(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
722
|
+
}), u.prototype.writeBigInt64BE = _e(function(e, t = 0) {
|
|
723
|
+
return ne(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
724
724
|
});
|
|
725
|
-
function
|
|
725
|
+
function re(e, t, n, r, i, a) {
|
|
726
726
|
if (n + r > e.length || n < 0) throw RangeError("Index out of range");
|
|
727
727
|
}
|
|
728
|
-
function
|
|
729
|
-
return t = +t, r >>>= 0, a ||
|
|
728
|
+
function U(e, t, r, i, a) {
|
|
729
|
+
return t = +t, r >>>= 0, a || re(e, t, r, 4), n.write(e, t, r, i, 23, 4), r + 4;
|
|
730
730
|
}
|
|
731
731
|
u.prototype.writeFloatLE = function(e, t, n) {
|
|
732
|
-
return
|
|
732
|
+
return U(this, e, t, !0, n);
|
|
733
733
|
}, u.prototype.writeFloatBE = function(e, t, n) {
|
|
734
|
-
return
|
|
734
|
+
return U(this, e, t, !1, n);
|
|
735
735
|
};
|
|
736
|
-
function
|
|
737
|
-
return t = +t, r >>>= 0, a ||
|
|
736
|
+
function W(e, t, r, i, a) {
|
|
737
|
+
return t = +t, r >>>= 0, a || re(e, t, r, 8), n.write(e, t, r, i, 52, 8), r + 8;
|
|
738
738
|
}
|
|
739
739
|
u.prototype.writeDoubleLE = function(e, t, n) {
|
|
740
|
-
return
|
|
740
|
+
return W(this, e, t, !0, n);
|
|
741
741
|
}, u.prototype.writeDoubleBE = function(e, t, n) {
|
|
742
|
-
return
|
|
742
|
+
return W(this, e, t, !1, n);
|
|
743
743
|
}, u.prototype.copy = function(e, t, n, r) {
|
|
744
744
|
if (!u.isBuffer(e)) throw TypeError("argument should be a Buffer");
|
|
745
745
|
if (n ||= 0, !r && r !== 0 && (r = this.length), t >= e.length && (t = e.length), t ||= 0, r > 0 && r < n && (r = n), r === n || e.length === 0 || this.length === 0) return 0;
|
|
@@ -770,9 +770,9 @@ ne.read = function(e, t, n, r, i) {
|
|
|
770
770
|
}
|
|
771
771
|
return this;
|
|
772
772
|
};
|
|
773
|
-
let
|
|
774
|
-
function
|
|
775
|
-
|
|
773
|
+
let G = {};
|
|
774
|
+
function K(e, t, n) {
|
|
775
|
+
G[e] = class extends n {
|
|
776
776
|
constructor() {
|
|
777
777
|
super(), Object.defineProperty(this, "message", {
|
|
778
778
|
value: t.apply(this, arguments),
|
|
@@ -796,42 +796,42 @@ ne.read = function(e, t, n, r, i) {
|
|
|
796
796
|
}
|
|
797
797
|
};
|
|
798
798
|
}
|
|
799
|
-
|
|
799
|
+
K("ERR_BUFFER_OUT_OF_BOUNDS", function(e) {
|
|
800
800
|
return e ? `${e} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
|
|
801
|
-
}, RangeError),
|
|
801
|
+
}, RangeError), K("ERR_INVALID_ARG_TYPE", function(e, t) {
|
|
802
802
|
return `The "${e}" argument must be of type number. Received type ${typeof t}`;
|
|
803
|
-
}, TypeError),
|
|
803
|
+
}, TypeError), K("ERR_OUT_OF_RANGE", function(e, t, n) {
|
|
804
804
|
let r = `The value of "${e}" is out of range.`, i = n;
|
|
805
|
-
return Number.isInteger(n) && Math.abs(n) > 2 ** 32 ? i =
|
|
805
|
+
return Number.isInteger(n) && Math.abs(n) > 2 ** 32 ? i = ie(String(n)) : typeof n == "bigint" && (i = String(n), (n > BigInt(2) ** BigInt(32) || n < -(BigInt(2) ** BigInt(32))) && (i = ie(i)), i += "n"), r += ` It must be ${t}. Received ${i}`, r;
|
|
806
806
|
}, RangeError);
|
|
807
|
-
function
|
|
807
|
+
function ie(e) {
|
|
808
808
|
let t = "", n = e.length, r = +(e[0] === "-");
|
|
809
809
|
for (; n >= r + 4; n -= 3) t = `_${e.slice(n - 3, n)}${t}`;
|
|
810
810
|
return `${e.slice(0, n)}${t}`;
|
|
811
811
|
}
|
|
812
|
-
function
|
|
813
|
-
|
|
812
|
+
function ae(e, t, n) {
|
|
813
|
+
se(t, "offset"), (e[t] === void 0 || e[t + n] === void 0) && ce(t, e.length - (n + 1));
|
|
814
814
|
}
|
|
815
|
-
function
|
|
815
|
+
function oe(e, t, n, r, i, a) {
|
|
816
816
|
if (e > n || e < t) {
|
|
817
817
|
let r = typeof t == "bigint" ? "n" : "", i;
|
|
818
|
-
throw i = a > 3 ? t === 0 || t === BigInt(0) ? `>= 0${r} and < 2${r} ** ${(a + 1) * 8}${r}` : `>= -(2${r} ** ${(a + 1) * 8 - 1}${r}) and < 2 ** ${(a + 1) * 8 - 1}${r}` : `>= ${t}${r} and <= ${n}${r}`, new
|
|
818
|
+
throw i = a > 3 ? t === 0 || t === BigInt(0) ? `>= 0${r} and < 2${r} ** ${(a + 1) * 8}${r}` : `>= -(2${r} ** ${(a + 1) * 8 - 1}${r}) and < 2 ** ${(a + 1) * 8 - 1}${r}` : `>= ${t}${r} and <= ${n}${r}`, new G.ERR_OUT_OF_RANGE("value", i, e);
|
|
819
819
|
}
|
|
820
|
-
|
|
820
|
+
ae(r, i, a);
|
|
821
821
|
}
|
|
822
|
-
function
|
|
823
|
-
if (typeof e != "number") throw new
|
|
822
|
+
function se(e, t) {
|
|
823
|
+
if (typeof e != "number") throw new G.ERR_INVALID_ARG_TYPE(t, "number", e);
|
|
824
824
|
}
|
|
825
|
-
function
|
|
826
|
-
throw Math.floor(e) === e ? t < 0 ? new
|
|
825
|
+
function ce(e, t, n) {
|
|
826
|
+
throw Math.floor(e) === e ? t < 0 ? new G.ERR_BUFFER_OUT_OF_BOUNDS() : new G.ERR_OUT_OF_RANGE(n || "offset", `>= ${+!!n} and <= ${t}`, e) : (se(e, n), new G.ERR_OUT_OF_RANGE(n || "offset", "an integer", e));
|
|
827
827
|
}
|
|
828
|
-
let
|
|
829
|
-
function
|
|
830
|
-
if (e = e.split("=")[0], e = e.trim().replace(
|
|
828
|
+
let le = /[^+/0-9A-Za-z-_]/g;
|
|
829
|
+
function ue(e) {
|
|
830
|
+
if (e = e.split("=")[0], e = e.trim().replace(le, ""), e.length < 2) return "";
|
|
831
831
|
for (; e.length % 4 != 0;) e += "=";
|
|
832
832
|
return e;
|
|
833
833
|
}
|
|
834
|
-
function
|
|
834
|
+
function de(e, t) {
|
|
835
835
|
t ||= Infinity;
|
|
836
836
|
let n, r = e.length, i = null, a = [];
|
|
837
837
|
for (let o = 0; o < r; ++o) {
|
|
@@ -869,31 +869,31 @@ ne.read = function(e, t, n, r, i) {
|
|
|
869
869
|
}
|
|
870
870
|
return a;
|
|
871
871
|
}
|
|
872
|
-
function
|
|
872
|
+
function fe(e) {
|
|
873
873
|
let t = [];
|
|
874
874
|
for (let n = 0; n < e.length; ++n) t.push(e.charCodeAt(n) & 255);
|
|
875
875
|
return t;
|
|
876
876
|
}
|
|
877
|
-
function
|
|
877
|
+
function pe(e, t) {
|
|
878
878
|
let n, r, i, a = [];
|
|
879
879
|
for (let o = 0; o < e.length && !((t -= 2) < 0); ++o) n = e.charCodeAt(o), r = n >> 8, i = n % 256, a.push(i), a.push(r);
|
|
880
880
|
return a;
|
|
881
881
|
}
|
|
882
|
-
function
|
|
883
|
-
return t.toByteArray(
|
|
882
|
+
function q(e) {
|
|
883
|
+
return t.toByteArray(ue(e));
|
|
884
884
|
}
|
|
885
|
-
function
|
|
885
|
+
function me(e, t, n, r) {
|
|
886
886
|
let i;
|
|
887
887
|
for (i = 0; i < r && !(i + n >= t.length || i >= e.length); ++i) t[i + n] = e[i];
|
|
888
888
|
return i;
|
|
889
889
|
}
|
|
890
|
-
function
|
|
890
|
+
function J(e, t) {
|
|
891
891
|
return e instanceof t || e != null && e.constructor != null && e.constructor.name != null && e.constructor.name === t.name;
|
|
892
892
|
}
|
|
893
|
-
function
|
|
893
|
+
function he(e) {
|
|
894
894
|
return e !== e;
|
|
895
895
|
}
|
|
896
|
-
let
|
|
896
|
+
let ge = (function() {
|
|
897
897
|
let e = "0123456789abcdef", t = Array(256);
|
|
898
898
|
for (let n = 0; n < 16; ++n) {
|
|
899
899
|
let r = n * 16;
|
|
@@ -901,27 +901,27 @@ ne.read = function(e, t, n, r, i) {
|
|
|
901
901
|
}
|
|
902
902
|
return t;
|
|
903
903
|
})();
|
|
904
|
-
function
|
|
905
|
-
return typeof BigInt > "u" ?
|
|
904
|
+
function _e(e) {
|
|
905
|
+
return typeof BigInt > "u" ? ve : e;
|
|
906
906
|
}
|
|
907
|
-
function
|
|
907
|
+
function ve() {
|
|
908
908
|
throw Error("BigInt not supported");
|
|
909
909
|
}
|
|
910
910
|
})(k), k.Buffer, k.Blob, k.BlobOptions;
|
|
911
|
-
var
|
|
911
|
+
var ne = k.Buffer;
|
|
912
912
|
k.File, k.FileOptions, k.INSPECT_MAX_BYTES, k.SlowBuffer, k.TranscodeEncoding, k.atob, k.btoa, k.constants, k.isAscii, k.isUtf8, k.kMaxLength, k.kStringMaxLength, k.resolveObjectURL, k.transcode;
|
|
913
913
|
//#endregion
|
|
914
914
|
//#region src/mapIO.ts
|
|
915
|
-
function
|
|
916
|
-
return o(
|
|
915
|
+
function re(e) {
|
|
916
|
+
return o(ne.from(e));
|
|
917
917
|
}
|
|
918
|
-
function
|
|
918
|
+
function U(e) {
|
|
919
919
|
return new Uint8Array(c(e));
|
|
920
920
|
}
|
|
921
|
-
function
|
|
921
|
+
function W(e) {
|
|
922
922
|
return s(e);
|
|
923
923
|
}
|
|
924
|
-
function
|
|
924
|
+
function G() {
|
|
925
925
|
return {
|
|
926
926
|
version: 20,
|
|
927
927
|
rooms: {},
|
|
@@ -971,7 +971,7 @@ function W() {
|
|
|
971
971
|
}
|
|
972
972
|
//#endregion
|
|
973
973
|
//#region src/editor/loadFile.ts
|
|
974
|
-
async function
|
|
974
|
+
async function K(e, t) {
|
|
975
975
|
try {
|
|
976
976
|
D.setState({ status: "Fetching…" });
|
|
977
977
|
let n = await fetch(e);
|
|
@@ -989,7 +989,7 @@ async function G(e, t) {
|
|
|
989
989
|
}
|
|
990
990
|
let s = new Uint8Array(o), c = 0;
|
|
991
991
|
for (let e of a) s.set(e, c), c += e.length;
|
|
992
|
-
let l = e.split("/").pop()?.split("?")[0] || "map.dat", u =
|
|
992
|
+
let l = e.split("/").pop()?.split("?")[0] || "map.dat", u = re(s.buffer), d = Number(Object.keys(u.areaNames)[0] ?? -1), f = Number.isNaN(d) ? null : d;
|
|
993
993
|
D.setState({
|
|
994
994
|
map: u,
|
|
995
995
|
loaded: { fileName: l },
|
|
@@ -1008,10 +1008,10 @@ async function G(e, t) {
|
|
|
1008
1008
|
D.setState({ status: `Failed to load URL: ${e.message}` });
|
|
1009
1009
|
}
|
|
1010
1010
|
}
|
|
1011
|
-
async function
|
|
1011
|
+
async function ie(e) {
|
|
1012
1012
|
try {
|
|
1013
1013
|
D.setState({ status: `Reading ${e.name}…` });
|
|
1014
|
-
let t =
|
|
1014
|
+
let t = re(await e.arrayBuffer()), n = Number(Object.keys(t.areaNames)[0] ?? -1), r = Number.isNaN(n) ? null : n;
|
|
1015
1015
|
D.setState({
|
|
1016
1016
|
map: t,
|
|
1017
1017
|
loaded: { fileName: e.name },
|
|
@@ -1032,7 +1032,7 @@ async function ae(e) {
|
|
|
1032
1032
|
}
|
|
1033
1033
|
//#endregion
|
|
1034
1034
|
//#region src/components/DropdownSelect.tsx
|
|
1035
|
-
function
|
|
1035
|
+
function ae({ label: e, value: n, options: a, onChange: o, searchable: s, emptyText: c = "—", width: p }) {
|
|
1036
1036
|
let [m, h] = i(!1), [g, _] = i(""), [v, y] = i(-1), [b, x] = i({}), S = r(null), C = r(null), w = r(null), T = a.find((e) => e.value === n), E = s && g.trim() ? a.filter((e) => e.label.toLowerCase().includes(g.toLowerCase())) : a;
|
|
1037
1037
|
t(() => {
|
|
1038
1038
|
let e = E.findIndex((e) => e.value === n);
|
|
@@ -1133,7 +1133,7 @@ function oe({ label: e, value: n, options: a, onChange: o, searchable: s, emptyT
|
|
|
1133
1133
|
}
|
|
1134
1134
|
//#endregion
|
|
1135
1135
|
//#region src/components/HelpModal.tsx
|
|
1136
|
-
var
|
|
1136
|
+
var oe = [
|
|
1137
1137
|
{
|
|
1138
1138
|
id: "select",
|
|
1139
1139
|
label: "Select",
|
|
@@ -1182,7 +1182,7 @@ var se = [
|
|
|
1182
1182
|
hint: "Click or drag rooms to apply the active room swatch (symbol + environment). Select a swatch in the Swatches palette first.",
|
|
1183
1183
|
key: "8"
|
|
1184
1184
|
}
|
|
1185
|
-
],
|
|
1185
|
+
], se = [
|
|
1186
1186
|
{
|
|
1187
1187
|
keys: ["1–7"],
|
|
1188
1188
|
desc: "Switch tool"
|
|
@@ -1232,7 +1232,7 @@ var se = [
|
|
|
1232
1232
|
desc: "Cancel / deselect"
|
|
1233
1233
|
}
|
|
1234
1234
|
];
|
|
1235
|
-
function
|
|
1235
|
+
function ce({ onClose: e }) {
|
|
1236
1236
|
return /* @__PURE__ */ d("div", {
|
|
1237
1237
|
className: "modal-overlay",
|
|
1238
1238
|
onClick: e,
|
|
@@ -1264,7 +1264,7 @@ function le({ onClose: e }) {
|
|
|
1264
1264
|
}),
|
|
1265
1265
|
/* @__PURE__ */ d("table", {
|
|
1266
1266
|
className: "help-table",
|
|
1267
|
-
children: /* @__PURE__ */ d("tbody", { children:
|
|
1267
|
+
children: /* @__PURE__ */ d("tbody", { children: oe.map((e) => /* @__PURE__ */ f("tr", { children: [
|
|
1268
1268
|
/* @__PURE__ */ d("td", { children: /* @__PURE__ */ d("kbd", { children: e.key }) }),
|
|
1269
1269
|
/* @__PURE__ */ d("td", {
|
|
1270
1270
|
className: "help-tool-name",
|
|
@@ -1282,7 +1282,7 @@ function le({ onClose: e }) {
|
|
|
1282
1282
|
}),
|
|
1283
1283
|
/* @__PURE__ */ d("table", {
|
|
1284
1284
|
className: "help-table",
|
|
1285
|
-
children: /* @__PURE__ */ d("tbody", { children:
|
|
1285
|
+
children: /* @__PURE__ */ d("tbody", { children: se.map((e, t) => /* @__PURE__ */ f("tr", { children: [/* @__PURE__ */ d("td", { children: e.keys.map((e) => /* @__PURE__ */ d("kbd", { children: e }, e)) }), /* @__PURE__ */ d("td", {
|
|
1286
1286
|
colSpan: 2,
|
|
1287
1287
|
className: "help-tool-hint",
|
|
1288
1288
|
children: e.desc
|
|
@@ -1295,7 +1295,7 @@ function le({ onClose: e }) {
|
|
|
1295
1295
|
}
|
|
1296
1296
|
//#endregion
|
|
1297
1297
|
//#region src/components/Toolbar.tsx
|
|
1298
|
-
function
|
|
1298
|
+
function le({ title: e = "Mudlet Map Editor", onHelpClick: t, onLoadFromUrl: a, onSave: o, onSearchClick: s }) {
|
|
1299
1299
|
let c = O((e) => e.activeTool), l = O((e) => e.map), p = l != null, m = O((e) => e.loaded), h = O((e) => e.currentAreaId), _ = O((e) => e.currentZ), v = O((e) => e.snapToGrid), y = O((e) => e.status), b = O((e) => e.pending), x = O((e) => e.undo.length), C = O((e) => e.redo.length), w = O((e) => e.savedUndoLength), T = O((e) => e.swatchPaletteOpen), E = O((e) => e.activeSwatchId), k = O((e) => e.activeSwatchSetId), A = O((e) => e.swatchSets), j = O((e) => e.pluginSwatchSets), M = [...A, ...j].find((e) => e.id === k)?.swatches.find((e) => e.id === E) ?? null, N = x !== w, P = O((e) => e.structureVersion), F = n(() => l ? Object.entries(l.areaNames).map(([e, t]) => ({
|
|
1300
1300
|
id: Number(e),
|
|
1301
1301
|
name: t
|
|
@@ -1307,7 +1307,7 @@ function ue({ title: e = "Mudlet Map Editor", onHelpClick: t, onLoadFromUrl: a,
|
|
|
1307
1307
|
l,
|
|
1308
1308
|
h,
|
|
1309
1309
|
P
|
|
1310
|
-
]), L = r(null), [R,
|
|
1310
|
+
]), L = r(null), [R, z] = i(""), B = () => {
|
|
1311
1311
|
let e = parseInt(R, 10);
|
|
1312
1312
|
if (Number.isNaN(e)) return;
|
|
1313
1313
|
let t = D.getState();
|
|
@@ -1329,9 +1329,9 @@ function ue({ title: e = "Mudlet Map Editor", onHelpClick: t, onLoadFromUrl: a,
|
|
|
1329
1329
|
ids: [e]
|
|
1330
1330
|
},
|
|
1331
1331
|
pending: null
|
|
1332
|
-
}), D.bumpStructure(),
|
|
1333
|
-
},
|
|
1334
|
-
let e =
|
|
1332
|
+
}), D.bumpStructure(), z("");
|
|
1333
|
+
}, V = () => {
|
|
1334
|
+
let e = G();
|
|
1335
1335
|
D.setState({
|
|
1336
1336
|
map: e,
|
|
1337
1337
|
loaded: { fileName: "new-map.dat" },
|
|
@@ -1346,7 +1346,7 @@ function ue({ title: e = "Mudlet Map Editor", onHelpClick: t, onLoadFromUrl: a,
|
|
|
1346
1346
|
status: "New map created · 0 rooms · 1 area",
|
|
1347
1347
|
sessionId: null
|
|
1348
1348
|
}), D.bumpStructure();
|
|
1349
|
-
},
|
|
1349
|
+
}, H = ie;
|
|
1350
1350
|
return /* @__PURE__ */ f("div", {
|
|
1351
1351
|
className: "toolbar",
|
|
1352
1352
|
children: [/* @__PURE__ */ f("div", {
|
|
@@ -1361,7 +1361,7 @@ function ue({ title: e = "Mudlet Map Editor", onHelpClick: t, onLoadFromUrl: a,
|
|
|
1361
1361
|
/* @__PURE__ */ d("button", {
|
|
1362
1362
|
type: "button",
|
|
1363
1363
|
title: "New Map",
|
|
1364
|
-
onClick:
|
|
1364
|
+
onClick: V,
|
|
1365
1365
|
children: /* @__PURE__ */ f("svg", {
|
|
1366
1366
|
width: "16",
|
|
1367
1367
|
height: "16",
|
|
@@ -1429,7 +1429,7 @@ function ue({ title: e = "Mudlet Map Editor", onHelpClick: t, onLoadFromUrl: a,
|
|
|
1429
1429
|
style: { display: "none" },
|
|
1430
1430
|
onChange: (e) => {
|
|
1431
1431
|
let t = e.target.files?.[0];
|
|
1432
|
-
t &&
|
|
1432
|
+
t && H(t), e.target.value = "";
|
|
1433
1433
|
}
|
|
1434
1434
|
})]
|
|
1435
1435
|
}),
|
|
@@ -1484,7 +1484,7 @@ function ue({ title: e = "Mudlet Map Editor", onHelpClick: t, onLoadFromUrl: a,
|
|
|
1484
1484
|
onClick: () => {
|
|
1485
1485
|
let e = D.getState();
|
|
1486
1486
|
if (!(!e.map || !e.loaded)) try {
|
|
1487
|
-
let t =
|
|
1487
|
+
let t = U(e.map), n = t.buffer.slice(t.byteOffset, t.byteOffset + t.byteLength), r = new Blob([n], { type: "application/octet-stream" }), i = URL.createObjectURL(r), a = document.createElement("a");
|
|
1488
1488
|
a.href = i, a.download = e.loaded.fileName.replace(/\.dat$/i, "") + "-edited.dat", document.body.appendChild(a), a.click(), a.remove(), URL.revokeObjectURL(i), D.setState((e) => ({
|
|
1489
1489
|
savedUndoLength: e.undo.length,
|
|
1490
1490
|
status: `Saved ${a.download}`
|
|
@@ -1545,7 +1545,7 @@ function ue({ title: e = "Mudlet Map Editor", onHelpClick: t, onLoadFromUrl: a,
|
|
|
1545
1545
|
}),
|
|
1546
1546
|
p && /* @__PURE__ */ f(u, { children: [
|
|
1547
1547
|
/* @__PURE__ */ d("div", { className: "toolbar-sep" }),
|
|
1548
|
-
/* @__PURE__ */ d(
|
|
1548
|
+
/* @__PURE__ */ d(ae, {
|
|
1549
1549
|
label: "Area",
|
|
1550
1550
|
value: h,
|
|
1551
1551
|
options: F.map((e) => ({
|
|
@@ -1563,7 +1563,7 @@ function ue({ title: e = "Mudlet Map Editor", onHelpClick: t, onLoadFromUrl: a,
|
|
|
1563
1563
|
searchable: !0,
|
|
1564
1564
|
width: 300
|
|
1565
1565
|
}),
|
|
1566
|
-
/* @__PURE__ */ d(
|
|
1566
|
+
/* @__PURE__ */ d(ae, {
|
|
1567
1567
|
label: "Level",
|
|
1568
1568
|
value: _,
|
|
1569
1569
|
options: I.map((e) => ({
|
|
@@ -1595,15 +1595,15 @@ function ue({ title: e = "Mudlet Map Editor", onHelpClick: t, onLoadFromUrl: a,
|
|
|
1595
1595
|
min: 1,
|
|
1596
1596
|
placeholder: "ID",
|
|
1597
1597
|
value: R,
|
|
1598
|
-
onChange: (e) =>
|
|
1598
|
+
onChange: (e) => z(e.target.value),
|
|
1599
1599
|
onKeyDown: (e) => {
|
|
1600
|
-
e.key === "Enter" &&
|
|
1600
|
+
e.key === "Enter" && B();
|
|
1601
1601
|
}
|
|
1602
1602
|
}),
|
|
1603
1603
|
/* @__PURE__ */ d("button", {
|
|
1604
1604
|
type: "button",
|
|
1605
1605
|
className: "toolbar-goto-btn",
|
|
1606
|
-
onClick:
|
|
1606
|
+
onClick: B,
|
|
1607
1607
|
disabled: R === "",
|
|
1608
1608
|
children: "Go"
|
|
1609
1609
|
})
|
|
@@ -1657,7 +1657,7 @@ function ue({ title: e = "Mudlet Map Editor", onHelpClick: t, onLoadFromUrl: a,
|
|
|
1657
1657
|
children: [
|
|
1658
1658
|
/* @__PURE__ */ d("div", {
|
|
1659
1659
|
className: "tool-group",
|
|
1660
|
-
children:
|
|
1660
|
+
children: oe.map((e) => /* @__PURE__ */ f("button", {
|
|
1661
1661
|
type: "button",
|
|
1662
1662
|
className: `tool-btn${c === e.id ? " active" : ""}`,
|
|
1663
1663
|
title: `${e.label} (${e.key}) — ${e.hint}`,
|
|
@@ -1761,9 +1761,9 @@ function ue({ title: e = "Mudlet Map Editor", onHelpClick: t, onLoadFromUrl: a,
|
|
|
1761
1761
|
}
|
|
1762
1762
|
//#endregion
|
|
1763
1763
|
//#region src/components/UrlLoadModal.tsx
|
|
1764
|
-
function
|
|
1764
|
+
function ue({ onClose: e, initialUrl: n }) {
|
|
1765
1765
|
let [r, a] = i(n ?? ""), [o, s] = i(!1), [c, l] = i(null), u = async (t = r.trim()) => {
|
|
1766
|
-
t && (a(t), s(!0), l(0), await
|
|
1766
|
+
t && (a(t), s(!0), l(0), await K(t, l), s(!1), l(null), D.getState().map && e());
|
|
1767
1767
|
};
|
|
1768
1768
|
return t(() => {
|
|
1769
1769
|
n && u(n);
|
|
@@ -1849,14 +1849,14 @@ function de({ onClose: e, initialUrl: n }) {
|
|
|
1849
1849
|
}
|
|
1850
1850
|
//#endregion
|
|
1851
1851
|
//#region src/editor/types.ts
|
|
1852
|
-
var
|
|
1852
|
+
var de = {
|
|
1853
1853
|
family: "Arial",
|
|
1854
1854
|
size: 30,
|
|
1855
1855
|
bold: !1,
|
|
1856
1856
|
italic: !1,
|
|
1857
1857
|
underline: !1,
|
|
1858
1858
|
strikeout: !1
|
|
1859
|
-
},
|
|
1859
|
+
}, fe = [
|
|
1860
1860
|
"north",
|
|
1861
1861
|
"northeast",
|
|
1862
1862
|
"east",
|
|
@@ -1869,7 +1869,7 @@ var fe = {
|
|
|
1869
1869
|
"down",
|
|
1870
1870
|
"in",
|
|
1871
1871
|
"out"
|
|
1872
|
-
],
|
|
1872
|
+
], pe = {
|
|
1873
1873
|
north: "south",
|
|
1874
1874
|
south: "north",
|
|
1875
1875
|
east: "west",
|
|
@@ -1882,7 +1882,7 @@ var fe = {
|
|
|
1882
1882
|
down: "up",
|
|
1883
1883
|
in: "out",
|
|
1884
1884
|
out: "in"
|
|
1885
|
-
},
|
|
1885
|
+
}, q = {
|
|
1886
1886
|
north: "n",
|
|
1887
1887
|
south: "s",
|
|
1888
1888
|
east: "e",
|
|
@@ -1895,7 +1895,7 @@ var fe = {
|
|
|
1895
1895
|
down: "down",
|
|
1896
1896
|
in: "in",
|
|
1897
1897
|
out: "out"
|
|
1898
|
-
},
|
|
1898
|
+
}, me = Object.entries(q).reduce((e, [t, n]) => (e[n] = t, e), {}), J = {
|
|
1899
1899
|
north: 1,
|
|
1900
1900
|
northeast: 2,
|
|
1901
1901
|
northwest: 3,
|
|
@@ -1908,18 +1908,18 @@ var fe = {
|
|
|
1908
1908
|
down: 10,
|
|
1909
1909
|
in: 11,
|
|
1910
1910
|
out: 12
|
|
1911
|
-
},
|
|
1912
|
-
function
|
|
1911
|
+
}, he = new Set(Object.values(q)), ge = Object.entries(q).reduce((e, [t, n]) => (e[n] = t, e), {});
|
|
1912
|
+
function _e(e) {
|
|
1913
1913
|
let t = e.trim(), n = t.toLowerCase();
|
|
1914
|
-
return n in
|
|
1914
|
+
return n in q ? q[n] : he.has(n) ? n : t;
|
|
1915
1915
|
}
|
|
1916
1916
|
//#endregion
|
|
1917
1917
|
//#region src/editor/mapHelpers.ts
|
|
1918
|
-
function
|
|
1918
|
+
function ve(e) {
|
|
1919
1919
|
let t = Object.keys(e.areas).map(Number);
|
|
1920
1920
|
return t.length === 0 ? 1 : Math.max(...t) + 1;
|
|
1921
1921
|
}
|
|
1922
|
-
function
|
|
1922
|
+
function ye(e) {
|
|
1923
1923
|
let t = 0;
|
|
1924
1924
|
for (let n of Object.keys(e.rooms)) {
|
|
1925
1925
|
let e = Number(n);
|
|
@@ -1927,7 +1927,7 @@ function be(e) {
|
|
|
1927
1927
|
}
|
|
1928
1928
|
return t + 1;
|
|
1929
1929
|
}
|
|
1930
|
-
function
|
|
1930
|
+
function be(e, t, n, r, i) {
|
|
1931
1931
|
return {
|
|
1932
1932
|
area: t,
|
|
1933
1933
|
x: n,
|
|
@@ -1963,34 +1963,34 @@ function xe(e, t, n, r, i) {
|
|
|
1963
1963
|
doors: {}
|
|
1964
1964
|
};
|
|
1965
1965
|
}
|
|
1966
|
-
function
|
|
1966
|
+
function xe(e, t, n, r) {
|
|
1967
1967
|
let i = n - e, a = r - t;
|
|
1968
1968
|
if (Math.abs(i) < .001 && Math.abs(a) < .001) return "north";
|
|
1969
1969
|
let o = (Math.atan2(a, i) * 180 / Math.PI + 360) % 360;
|
|
1970
1970
|
return o < 22.5 || o >= 337.5 ? "east" : o < 67.5 ? "southeast" : o < 112.5 ? "south" : o < 157.5 ? "southwest" : o < 202.5 ? "west" : o < 247.5 ? "northwest" : o < 292.5 ? "north" : "northeast";
|
|
1971
1971
|
}
|
|
1972
|
-
function
|
|
1972
|
+
function Y(e, t) {
|
|
1973
1973
|
return e[t] ?? e.mSpecialExits[t] ?? void 0;
|
|
1974
1974
|
}
|
|
1975
|
-
function
|
|
1975
|
+
function Se(e, t) {
|
|
1976
1976
|
let n = [];
|
|
1977
1977
|
for (let r of Object.keys(e.rooms)) {
|
|
1978
1978
|
let i = Number(r);
|
|
1979
1979
|
if (i === t) continue;
|
|
1980
1980
|
let a = e.rooms[i];
|
|
1981
|
-
for (let e of
|
|
1981
|
+
for (let e of fe) Y(a, e) === t && n.push({
|
|
1982
1982
|
roomId: i,
|
|
1983
1983
|
dir: e
|
|
1984
1984
|
});
|
|
1985
1985
|
}
|
|
1986
1986
|
return n;
|
|
1987
1987
|
}
|
|
1988
|
-
function
|
|
1988
|
+
function Ce(e) {
|
|
1989
1989
|
return e !== "up" && e !== "down" && e !== "in" && e !== "out";
|
|
1990
1990
|
}
|
|
1991
1991
|
//#endregion
|
|
1992
1992
|
//#region src/editor/commands.ts
|
|
1993
|
-
function
|
|
1993
|
+
function we(e, t, n) {
|
|
1994
1994
|
let r = n?.reader;
|
|
1995
1995
|
switch (t.kind) {
|
|
1996
1996
|
case "moveRoom":
|
|
@@ -2160,7 +2160,7 @@ function Te(e, t, n) {
|
|
|
2160
2160
|
}
|
|
2161
2161
|
return { structural: !1 };
|
|
2162
2162
|
case "setDoor": {
|
|
2163
|
-
let n =
|
|
2163
|
+
let n = q[t.dir];
|
|
2164
2164
|
if (r) r.setDoor(t.roomId, t.dir, t.to);
|
|
2165
2165
|
else {
|
|
2166
2166
|
let r = e.rooms[t.roomId];
|
|
@@ -2169,7 +2169,7 @@ function Te(e, t, n) {
|
|
|
2169
2169
|
return { structural: !1 };
|
|
2170
2170
|
}
|
|
2171
2171
|
case "setExitWeight": {
|
|
2172
|
-
let n =
|
|
2172
|
+
let n = q[t.dir];
|
|
2173
2173
|
if (r) r.setExitWeight(t.roomId, t.dir, t.to);
|
|
2174
2174
|
else {
|
|
2175
2175
|
let r = e.rooms[t.roomId];
|
|
@@ -2178,7 +2178,7 @@ function Te(e, t, n) {
|
|
|
2178
2178
|
return { structural: !1 };
|
|
2179
2179
|
}
|
|
2180
2180
|
case "setExitLock": {
|
|
2181
|
-
let n =
|
|
2181
|
+
let n = J[t.dir];
|
|
2182
2182
|
if (r) r.setExitLock(t.roomId, t.dir, t.lock);
|
|
2183
2183
|
else {
|
|
2184
2184
|
let r = e.rooms[t.roomId];
|
|
@@ -2191,7 +2191,7 @@ function Te(e, t, n) {
|
|
|
2191
2191
|
return { structural: !1 };
|
|
2192
2192
|
}
|
|
2193
2193
|
case "setStub": {
|
|
2194
|
-
let n =
|
|
2194
|
+
let n = J[t.dir];
|
|
2195
2195
|
if (r) r.setStub(t.roomId, t.dir, t.stub);
|
|
2196
2196
|
else {
|
|
2197
2197
|
let r = e.rooms[t.roomId];
|
|
@@ -2329,12 +2329,12 @@ function Te(e, t, n) {
|
|
|
2329
2329
|
return n.reader.removeRooms(r), { structural: !0 };
|
|
2330
2330
|
}
|
|
2331
2331
|
let r = !1;
|
|
2332
|
-
for (let i of t.cmds)
|
|
2332
|
+
for (let i of t.cmds) we(e, i, n).structural && (r = !0);
|
|
2333
2333
|
return { structural: r };
|
|
2334
2334
|
}
|
|
2335
2335
|
}
|
|
2336
2336
|
}
|
|
2337
|
-
function
|
|
2337
|
+
function Te(e, t, n) {
|
|
2338
2338
|
let r = n?.reader;
|
|
2339
2339
|
switch (t.kind) {
|
|
2340
2340
|
case "moveRoom":
|
|
@@ -2524,7 +2524,7 @@ function Ee(e, t, n) {
|
|
|
2524
2524
|
}
|
|
2525
2525
|
return { structural: !1 };
|
|
2526
2526
|
case "setDoor": {
|
|
2527
|
-
let n =
|
|
2527
|
+
let n = q[t.dir];
|
|
2528
2528
|
if (r) r.setDoor(t.roomId, t.dir, t.from);
|
|
2529
2529
|
else {
|
|
2530
2530
|
let r = e.rooms[t.roomId];
|
|
@@ -2533,7 +2533,7 @@ function Ee(e, t, n) {
|
|
|
2533
2533
|
return { structural: !1 };
|
|
2534
2534
|
}
|
|
2535
2535
|
case "setExitWeight": {
|
|
2536
|
-
let n =
|
|
2536
|
+
let n = q[t.dir];
|
|
2537
2537
|
if (r) r.setExitWeight(t.roomId, t.dir, t.from);
|
|
2538
2538
|
else {
|
|
2539
2539
|
let r = e.rooms[t.roomId];
|
|
@@ -2542,7 +2542,7 @@ function Ee(e, t, n) {
|
|
|
2542
2542
|
return { structural: !1 };
|
|
2543
2543
|
}
|
|
2544
2544
|
case "setExitLock": {
|
|
2545
|
-
let n =
|
|
2545
|
+
let n = J[t.dir];
|
|
2546
2546
|
if (r) r.setExitLock(t.roomId, t.dir, !t.lock);
|
|
2547
2547
|
else {
|
|
2548
2548
|
let r = e.rooms[t.roomId];
|
|
@@ -2555,7 +2555,7 @@ function Ee(e, t, n) {
|
|
|
2555
2555
|
return { structural: !1 };
|
|
2556
2556
|
}
|
|
2557
2557
|
case "setStub": {
|
|
2558
|
-
let n =
|
|
2558
|
+
let n = J[t.dir];
|
|
2559
2559
|
if (r) r.setStub(t.roomId, t.dir, !t.stub);
|
|
2560
2560
|
else {
|
|
2561
2561
|
let r = e.rooms[t.roomId];
|
|
@@ -2701,27 +2701,27 @@ function Ee(e, t, n) {
|
|
|
2701
2701
|
}))), { structural: !0 };
|
|
2702
2702
|
}
|
|
2703
2703
|
let r = !1;
|
|
2704
|
-
for (let i of [...t.cmds].reverse())
|
|
2704
|
+
for (let i of [...t.cmds].reverse()) Te(e, i, n).structural && (r = !0);
|
|
2705
2705
|
return { structural: r };
|
|
2706
2706
|
}
|
|
2707
2707
|
}
|
|
2708
2708
|
}
|
|
2709
|
-
function
|
|
2709
|
+
function X(e, t) {
|
|
2710
2710
|
let n = D.getState();
|
|
2711
2711
|
if (!n.map) return !1;
|
|
2712
|
-
let { structural: r } =
|
|
2712
|
+
let { structural: r } = we(n.map, e, t);
|
|
2713
2713
|
return D.setState((t) => ({
|
|
2714
2714
|
undo: [...t.undo, e],
|
|
2715
2715
|
redo: []
|
|
2716
2716
|
})), r;
|
|
2717
2717
|
}
|
|
2718
|
-
function
|
|
2718
|
+
function Ee(e, t) {
|
|
2719
2719
|
if (e.length === 0) return !1;
|
|
2720
|
-
if (e.length === 1) return
|
|
2720
|
+
if (e.length === 1) return X(e[0], t);
|
|
2721
2721
|
let n = D.getState();
|
|
2722
2722
|
if (!n.map) return !1;
|
|
2723
2723
|
let r = !1;
|
|
2724
|
-
for (let i of e)
|
|
2724
|
+
for (let i of e) we(n.map, i, t).structural && (r = !0);
|
|
2725
2725
|
let i = {
|
|
2726
2726
|
kind: "batch",
|
|
2727
2727
|
cmds: e
|
|
@@ -2737,7 +2737,7 @@ function De(e) {
|
|
|
2737
2737
|
changed: !1,
|
|
2738
2738
|
structural: !1
|
|
2739
2739
|
};
|
|
2740
|
-
let n = t.undo[t.undo.length - 1], { structural: r } =
|
|
2740
|
+
let n = t.undo[t.undo.length - 1], { structural: r } = Te(t.map, n, e);
|
|
2741
2741
|
return D.setState((e) => ({
|
|
2742
2742
|
undo: e.undo.slice(0, -1),
|
|
2743
2743
|
redo: [...e.redo, n]
|
|
@@ -2752,7 +2752,7 @@ function Oe(e) {
|
|
|
2752
2752
|
changed: !1,
|
|
2753
2753
|
structural: !1
|
|
2754
2754
|
};
|
|
2755
|
-
let n = t.redo[t.redo.length - 1], { structural: r } =
|
|
2755
|
+
let n = t.redo[t.redo.length - 1], { structural: r } = we(t.map, n, e);
|
|
2756
2756
|
return D.setState((e) => ({
|
|
2757
2757
|
undo: [...e.undo, n],
|
|
2758
2758
|
redo: e.redo.slice(0, -1)
|
|
@@ -2797,10 +2797,10 @@ function ke(e, t, n, r) {
|
|
|
2797
2797
|
return a;
|
|
2798
2798
|
}
|
|
2799
2799
|
function Ae(e, t) {
|
|
2800
|
-
return
|
|
2800
|
+
return Se(e, t).map((t) => ({
|
|
2801
2801
|
roomId: t.roomId,
|
|
2802
2802
|
dir: t.dir,
|
|
2803
|
-
was:
|
|
2803
|
+
was: Y(e.rooms[t.roomId], t.dir)
|
|
2804
2804
|
}));
|
|
2805
2805
|
}
|
|
2806
2806
|
function je(e, t) {
|
|
@@ -2809,8 +2809,8 @@ function je(e, t) {
|
|
|
2809
2809
|
let i = Number(t);
|
|
2810
2810
|
if (n.has(i)) continue;
|
|
2811
2811
|
let a = e.rooms[i];
|
|
2812
|
-
for (let e of
|
|
2813
|
-
let t =
|
|
2812
|
+
for (let e of fe) {
|
|
2813
|
+
let t = Y(a, e);
|
|
2814
2814
|
n.has(t) && r.get(t).push({
|
|
2815
2815
|
roomId: i,
|
|
2816
2816
|
dir: e,
|
|
@@ -3004,8 +3004,8 @@ function Re({ sceneRef: e }) {
|
|
|
3004
3004
|
})).sort((e, t) => e.name.localeCompare(t.name)), g = () => {
|
|
3005
3005
|
let i = n.trim();
|
|
3006
3006
|
if (!i) return;
|
|
3007
|
-
let a =
|
|
3008
|
-
|
|
3007
|
+
let a = ve(t);
|
|
3008
|
+
X({
|
|
3009
3009
|
kind: "addArea",
|
|
3010
3010
|
id: a,
|
|
3011
3011
|
name: i
|
|
@@ -3038,7 +3038,7 @@ function Re({ sceneRef: e }) {
|
|
|
3038
3038
|
let n = Number(e);
|
|
3039
3039
|
if (a.has(n)) continue;
|
|
3040
3040
|
let r = t.rooms[n];
|
|
3041
|
-
for (let e of
|
|
3041
|
+
for (let e of fe) {
|
|
3042
3042
|
let t = r[e];
|
|
3043
3043
|
typeof t == "number" && a.has(t) && (s.push({
|
|
3044
3044
|
roomId: n,
|
|
@@ -3047,7 +3047,7 @@ function Re({ sceneRef: e }) {
|
|
|
3047
3047
|
}), c.add(r.area));
|
|
3048
3048
|
}
|
|
3049
3049
|
}
|
|
3050
|
-
if (
|
|
3050
|
+
if (X({
|
|
3051
3051
|
kind: "deleteAreaWithRooms",
|
|
3052
3052
|
areaId: n,
|
|
3053
3053
|
areaName: r,
|
|
@@ -3063,7 +3063,7 @@ function Re({ sceneRef: e }) {
|
|
|
3063
3063
|
}, y = () => {
|
|
3064
3064
|
if (!l || l.moveTarget === "") return;
|
|
3065
3065
|
let t = Number(l.moveTarget);
|
|
3066
|
-
|
|
3066
|
+
Ee([{
|
|
3067
3067
|
kind: "moveRoomsToArea",
|
|
3068
3068
|
roomIds: [...l.rooms],
|
|
3069
3069
|
fromAreaId: l.id,
|
|
@@ -3075,7 +3075,7 @@ function Re({ sceneRef: e }) {
|
|
|
3075
3075
|
}], e.current), D.getState().currentAreaId === l.id ? D.setState({ currentAreaId: t }) : e.current?.refresh(), D.bumpStructure(), D.setState({ status: `Moved ${l.rooms.length} rooms to area #${t}, deleted '${l.name}'` }), u(null);
|
|
3076
3076
|
}, b = (t, n) => {
|
|
3077
3077
|
let r = s.trim();
|
|
3078
|
-
r && r !== n && (
|
|
3078
|
+
r && r !== n && (X({
|
|
3079
3079
|
kind: "renameArea",
|
|
3080
3080
|
id: t,
|
|
3081
3081
|
from: n,
|
|
@@ -3165,7 +3165,7 @@ function Re({ sceneRef: e }) {
|
|
|
3165
3165
|
children: /* @__PURE__ */ d(Fe, {
|
|
3166
3166
|
data: t.areas[n]?.userData ?? {},
|
|
3167
3167
|
onCommit: (t, r, i) => {
|
|
3168
|
-
|
|
3168
|
+
X({
|
|
3169
3169
|
kind: "setAreaUserDataEntry",
|
|
3170
3170
|
areaId: n,
|
|
3171
3171
|
key: t,
|
|
@@ -3273,7 +3273,7 @@ function Ve({ sceneRef: e }) {
|
|
|
3273
3273
|
s(null), p(String(x())), l(!0);
|
|
3274
3274
|
}, C = (n, r) => {
|
|
3275
3275
|
let i = Be(r);
|
|
3276
|
-
|
|
3276
|
+
X({
|
|
3277
3277
|
kind: "setCustomEnvColor",
|
|
3278
3278
|
envId: n,
|
|
3279
3279
|
from: t.mCustomEnvColors[n] ?? null,
|
|
@@ -3281,7 +3281,7 @@ function Ve({ sceneRef: e }) {
|
|
|
3281
3281
|
}, e.current), e.current?.refresh(), D.bumpData(), D.setState({ status: `Env ${n} color updated` });
|
|
3282
3282
|
}, w = (n) => {
|
|
3283
3283
|
let r = t.mCustomEnvColors[n];
|
|
3284
|
-
r && (
|
|
3284
|
+
r && (X({
|
|
3285
3285
|
kind: "setCustomEnvColor",
|
|
3286
3286
|
envId: n,
|
|
3287
3287
|
from: r,
|
|
@@ -3294,7 +3294,7 @@ function Ve({ sceneRef: e }) {
|
|
|
3294
3294
|
return;
|
|
3295
3295
|
}
|
|
3296
3296
|
let r = Be(m);
|
|
3297
|
-
|
|
3297
|
+
X({
|
|
3298
3298
|
kind: "setCustomEnvColor",
|
|
3299
3299
|
envId: n,
|
|
3300
3300
|
from: t.mCustomEnvColors[n] ?? null,
|
|
@@ -3697,7 +3697,7 @@ function Je({ sceneRef: e }) {
|
|
|
3697
3697
|
/* @__PURE__ */ d(Fe, {
|
|
3698
3698
|
data: t.mUserData ?? {},
|
|
3699
3699
|
onCommit: (t, n, r) => {
|
|
3700
|
-
|
|
3700
|
+
X({
|
|
3701
3701
|
kind: "setMapUserDataEntry",
|
|
3702
3702
|
key: t,
|
|
3703
3703
|
from: n,
|
|
@@ -3792,7 +3792,7 @@ function Ye({ selection: e, map: t, sceneRef: n }) {
|
|
|
3792
3792
|
dir: s,
|
|
3793
3793
|
was: e.fromId
|
|
3794
3794
|
} : null;
|
|
3795
|
-
|
|
3795
|
+
X(t === "reverse" ? {
|
|
3796
3796
|
kind: "removeExit",
|
|
3797
3797
|
fromId: e.toId,
|
|
3798
3798
|
dir: s,
|
|
@@ -4205,8 +4205,8 @@ var ht = .15, gt = {
|
|
|
4205
4205
|
if (r && n.map) {
|
|
4206
4206
|
let { fromId: e, dir: i } = n.pending, a = n.map.rooms[e];
|
|
4207
4207
|
if (a) {
|
|
4208
|
-
let n =
|
|
4209
|
-
|
|
4208
|
+
let n = Y(a, i);
|
|
4209
|
+
X({
|
|
4210
4210
|
kind: "addExit",
|
|
4211
4211
|
fromId: e,
|
|
4212
4212
|
dir: i,
|
|
@@ -4763,7 +4763,7 @@ function vt(e, t, n, r, i, a) {
|
|
|
4763
4763
|
style: u,
|
|
4764
4764
|
arrow: d
|
|
4765
4765
|
};
|
|
4766
|
-
|
|
4766
|
+
X({
|
|
4767
4767
|
kind: "setCustomLine",
|
|
4768
4768
|
roomId: t,
|
|
4769
4769
|
exitName: n,
|
|
@@ -4850,16 +4850,16 @@ var yt = {
|
|
|
4850
4850
|
function bt(e, t, n, r, i, a) {
|
|
4851
4851
|
let o = e.scene.getRenderRoom(t), s = e.scene.getRenderRoom(n);
|
|
4852
4852
|
if (!o || !s) return;
|
|
4853
|
-
let c = r ??
|
|
4854
|
-
if (!
|
|
4853
|
+
let c = r ?? xe(o.x, o.y, s.x, s.y);
|
|
4854
|
+
if (!Ce(c)) return;
|
|
4855
4855
|
let l = D.getState().map?.rooms[t], u = D.getState().map?.rooms[n];
|
|
4856
4856
|
if (!l || !u) return;
|
|
4857
|
-
let d =
|
|
4857
|
+
let d = Y(l, c), f = i ?? pe[c], p = Ce(f), m = p ? Y(u, f) : -1, h = a || !p ? null : m === -1 || m === t ? {
|
|
4858
4858
|
fromId: n,
|
|
4859
4859
|
dir: f,
|
|
4860
4860
|
previous: m
|
|
4861
4861
|
} : null;
|
|
4862
|
-
|
|
4862
|
+
X({
|
|
4863
4863
|
kind: "addExit",
|
|
4864
4864
|
fromId: t,
|
|
4865
4865
|
dir: c,
|
|
@@ -4888,7 +4888,7 @@ var xt = {
|
|
|
4888
4888
|
g: 255,
|
|
4889
4889
|
b: 255
|
|
4890
4890
|
}, o = r?.customLinesStyle?.[e.exitName] ?? 1, s = r?.customLinesArrow?.[e.exitName] ?? !1;
|
|
4891
|
-
|
|
4891
|
+
X({
|
|
4892
4892
|
kind: "removeCustomLine",
|
|
4893
4893
|
roomId: e.roomId,
|
|
4894
4894
|
exitName: e.exitName,
|
|
@@ -4905,12 +4905,12 @@ var xt = {
|
|
|
4905
4905
|
let i = st(t.renderer, r.x, r.y, t.settings.roomSize);
|
|
4906
4906
|
if (i) {
|
|
4907
4907
|
if (!n.map.rooms[i.fromId]) return !0;
|
|
4908
|
-
let e =
|
|
4908
|
+
let e = pe[i.dir], r = n.map.rooms[i.toId], a = r && Ce(e) && Y(r, e) === i.fromId ? {
|
|
4909
4909
|
fromId: i.toId,
|
|
4910
4910
|
dir: e,
|
|
4911
4911
|
was: i.fromId
|
|
4912
4912
|
} : null;
|
|
4913
|
-
|
|
4913
|
+
X({
|
|
4914
4914
|
kind: "removeExit",
|
|
4915
4915
|
fromId: i.fromId,
|
|
4916
4916
|
dir: i.dir,
|
|
@@ -4925,10 +4925,10 @@ var xt = {
|
|
|
4925
4925
|
let o = n.map.rooms[i.id];
|
|
4926
4926
|
if (!o) return !0;
|
|
4927
4927
|
let s = [];
|
|
4928
|
-
for (let e of
|
|
4929
|
-
let t =
|
|
4928
|
+
for (let e of fe) {
|
|
4929
|
+
let t = Y(o, e);
|
|
4930
4930
|
if (t === -1) continue;
|
|
4931
|
-
let r = n.map.rooms[t], a =
|
|
4931
|
+
let r = n.map.rooms[t], a = pe[e], c = r && Y(r, a) === i.id ? {
|
|
4932
4932
|
fromId: t,
|
|
4933
4933
|
dir: a,
|
|
4934
4934
|
was: i.id
|
|
@@ -4943,7 +4943,7 @@ var xt = {
|
|
|
4943
4943
|
name: e,
|
|
4944
4944
|
toId: t
|
|
4945
4945
|
}));
|
|
4946
|
-
return s.length === 0 && c.length === 0 ? (D.setState({ status: `Room ${i.id} has no exits.` }), !0) : (
|
|
4946
|
+
return s.length === 0 && c.length === 0 ? (D.setState({ status: `Room ${i.id} has no exits.` }), !0) : (X({
|
|
4947
4947
|
kind: "removeAllExits",
|
|
4948
4948
|
roomId: i.id,
|
|
4949
4949
|
exits: s,
|
|
@@ -4962,11 +4962,11 @@ var xt = {
|
|
|
4962
4962
|
if (!n) return !1;
|
|
4963
4963
|
let { x: r, y: i } = pt(t, e), a = r, o = -i;
|
|
4964
4964
|
if (nt(n.map, n.areaId, a, o, n.z)) return D.setState({ status: "Cell is already occupied." }), !0;
|
|
4965
|
-
let s =
|
|
4966
|
-
return
|
|
4965
|
+
let s = ye(n.map);
|
|
4966
|
+
return X({
|
|
4967
4967
|
kind: "addRoom",
|
|
4968
4968
|
id: s,
|
|
4969
|
-
room:
|
|
4969
|
+
room: be(s, n.areaId, a, o, n.z),
|
|
4970
4970
|
areaId: n.areaId
|
|
4971
4971
|
}, t.scene), t.refresh(), D.bumpStructure(), e.ctrlKey || e.metaKey ? D.setState({ status: `Added room ${s} at (${a}, ${o}, ${n.z})` }) : D.setState({
|
|
4972
4972
|
activeTool: "select",
|
|
@@ -4992,7 +4992,7 @@ var xt = {
|
|
|
4992
4992
|
if (i) {
|
|
4993
4993
|
let e = t.scene.reader.getLabelSnapshot(i.areaId, i.id);
|
|
4994
4994
|
if (e) {
|
|
4995
|
-
|
|
4995
|
+
X({
|
|
4996
4996
|
kind: "deleteLabel",
|
|
4997
4997
|
areaId: i.areaId,
|
|
4998
4998
|
label: e
|
|
@@ -5013,7 +5013,7 @@ var xt = {
|
|
|
5013
5013
|
g: 255,
|
|
5014
5014
|
b: 255
|
|
5015
5015
|
}, o = r?.customLinesStyle?.[e.exitName] ?? 1, s = r?.customLinesArrow?.[e.exitName] ?? !1;
|
|
5016
|
-
|
|
5016
|
+
X({
|
|
5017
5017
|
kind: "removeCustomLine",
|
|
5018
5018
|
roomId: e.roomId,
|
|
5019
5019
|
exitName: e.exitName,
|
|
@@ -5030,12 +5030,12 @@ var xt = {
|
|
|
5030
5030
|
let i = st(t.renderer, r.x, r.y, t.settings.roomSize);
|
|
5031
5031
|
if (i) {
|
|
5032
5032
|
if (!n.map.rooms[i.fromId]) return !0;
|
|
5033
|
-
let e =
|
|
5033
|
+
let e = pe[i.dir], r = n.map.rooms[i.toId], a = r && Ce(e) && Y(r, e) === i.fromId ? {
|
|
5034
5034
|
fromId: i.toId,
|
|
5035
5035
|
dir: e,
|
|
5036
5036
|
was: i.fromId
|
|
5037
5037
|
} : null;
|
|
5038
|
-
|
|
5038
|
+
X({
|
|
5039
5039
|
kind: "removeExit",
|
|
5040
5040
|
fromId: i.fromId,
|
|
5041
5041
|
dir: i.dir,
|
|
@@ -5050,7 +5050,7 @@ var xt = {
|
|
|
5050
5050
|
let s = n.map.rooms[a.id];
|
|
5051
5051
|
if (!s) return !0;
|
|
5052
5052
|
let c = { ...s }, l = Ae(n.map, a.id);
|
|
5053
|
-
|
|
5053
|
+
X({
|
|
5054
5054
|
kind: "deleteRoom",
|
|
5055
5055
|
id: a.id,
|
|
5056
5056
|
room: c,
|
|
@@ -5309,10 +5309,10 @@ var Mt = {
|
|
|
5309
5309
|
},
|
|
5310
5310
|
noScaling: !1,
|
|
5311
5311
|
showOnTop: !1,
|
|
5312
|
-
font: { ...
|
|
5312
|
+
font: { ...de },
|
|
5313
5313
|
pixMap: ""
|
|
5314
5314
|
};
|
|
5315
|
-
return
|
|
5315
|
+
return X({
|
|
5316
5316
|
kind: "addLabel",
|
|
5317
5317
|
areaId: r.areaId,
|
|
5318
5318
|
label: f
|
|
@@ -5644,7 +5644,7 @@ function Bt({ pending: e, sceneRef: t }) {
|
|
|
5644
5644
|
});
|
|
5645
5645
|
}
|
|
5646
5646
|
function Vt({ selection: e, map: t, sceneRef: n }) {
|
|
5647
|
-
let r = t.rooms[e.roomId], a = r?.customLines?.[e.exitName], o = r?.customLinesColor?.[e.exitName], s = r?.customLinesStyle?.[e.exitName] ?? 1, c = r?.customLinesArrow?.[e.exitName] ?? !1, l = r?.mSpecialExits?.[e.exitName], p =
|
|
5647
|
+
let r = t.rooms[e.roomId], a = r?.customLines?.[e.exitName], o = r?.customLinesColor?.[e.exitName], s = r?.customLinesStyle?.[e.exitName] ?? 1, c = r?.customLinesArrow?.[e.exitName] ?? !1, l = r?.mSpecialExits?.[e.exitName], p = Y(r, me[e.exitName] ?? e.exitName), m = l ?? (p != null && p > 0 ? p : void 0), h = m == null ? null : t.rooms[m], [g, _] = i(o ? Ie(o) : "#ffffff"), [v, y] = i(s), [b, x] = i(c), [S, C] = i(null);
|
|
5648
5648
|
if (!r || !a) return /* @__PURE__ */ d("h3", { children: "Custom line not found" });
|
|
5649
5649
|
let w = (e) => ({
|
|
5650
5650
|
points: a,
|
|
@@ -5669,7 +5669,7 @@ function Vt({ selection: e, map: t, sceneRef: n }) {
|
|
|
5669
5669
|
style: s,
|
|
5670
5670
|
arrow: c
|
|
5671
5671
|
}, E = (t) => {
|
|
5672
|
-
|
|
5672
|
+
X({
|
|
5673
5673
|
kind: "setCustomLine",
|
|
5674
5674
|
roomId: e.roomId,
|
|
5675
5675
|
exitName: e.exitName,
|
|
@@ -5677,7 +5677,7 @@ function Vt({ selection: e, map: t, sceneRef: n }) {
|
|
|
5677
5677
|
previous: T
|
|
5678
5678
|
}, n.current), n.current?.refresh(), D.bumpData();
|
|
5679
5679
|
}, O = () => {
|
|
5680
|
-
|
|
5680
|
+
X({
|
|
5681
5681
|
kind: "removeCustomLine",
|
|
5682
5682
|
roomId: e.roomId,
|
|
5683
5683
|
exitName: e.exitName,
|
|
@@ -5714,7 +5714,7 @@ function Vt({ selection: e, map: t, sceneRef: n }) {
|
|
|
5714
5714
|
g: 255,
|
|
5715
5715
|
b: 255
|
|
5716
5716
|
}, m = a.map((e, n) => n === t ? [d, f] : [e[0], e[1]]);
|
|
5717
|
-
|
|
5717
|
+
X({
|
|
5718
5718
|
kind: "setCustomLine",
|
|
5719
5719
|
roomId: e.roomId,
|
|
5720
5720
|
exitName: e.exitName,
|
|
@@ -5912,7 +5912,7 @@ function Vt({ selection: e, map: t, sceneRef: n }) {
|
|
|
5912
5912
|
D.setState({ status: `Custom line '${e.exitName}' already on grid.` });
|
|
5913
5913
|
return;
|
|
5914
5914
|
}
|
|
5915
|
-
|
|
5915
|
+
X({
|
|
5916
5916
|
kind: "setCustomLine",
|
|
5917
5917
|
roomId: e.roomId,
|
|
5918
5918
|
exitName: e.exitName,
|
|
@@ -5977,7 +5977,7 @@ function Wt(e) {
|
|
|
5977
5977
|
}
|
|
5978
5978
|
function Gt(e) {
|
|
5979
5979
|
let t = e.includes(",") ? e.split(",")[1] : e;
|
|
5980
|
-
return t ?
|
|
5980
|
+
return t ? ne.from(t, "base64") : ne.alloc(0);
|
|
5981
5981
|
}
|
|
5982
5982
|
//#endregion
|
|
5983
5983
|
//#region src/components/FontPicker.tsx
|
|
@@ -6145,7 +6145,7 @@ function Zt({ selection: e, sceneRef: n }) {
|
|
|
6145
6145
|
...r,
|
|
6146
6146
|
text: E.current
|
|
6147
6147
|
};
|
|
6148
|
-
|
|
6148
|
+
Ee([{
|
|
6149
6149
|
kind: "setLabelText",
|
|
6150
6150
|
areaId: e.areaId,
|
|
6151
6151
|
id: e.id,
|
|
@@ -6163,7 +6163,7 @@ function Zt({ selection: e, sceneRef: n }) {
|
|
|
6163
6163
|
...r,
|
|
6164
6164
|
size: [i, a]
|
|
6165
6165
|
};
|
|
6166
|
-
|
|
6166
|
+
Ee([{
|
|
6167
6167
|
kind: "setLabelSize",
|
|
6168
6168
|
areaId: e.areaId,
|
|
6169
6169
|
id: e.id,
|
|
@@ -6188,7 +6188,7 @@ function Zt({ selection: e, sceneRef: n }) {
|
|
|
6188
6188
|
fgColor: t,
|
|
6189
6189
|
bgColor: r
|
|
6190
6190
|
};
|
|
6191
|
-
|
|
6191
|
+
Ee([{
|
|
6192
6192
|
kind: "setLabelColors",
|
|
6193
6193
|
areaId: e.areaId,
|
|
6194
6194
|
id: e.id,
|
|
@@ -6201,25 +6201,25 @@ function Zt({ selection: e, sceneRef: n }) {
|
|
|
6201
6201
|
let r = n.current;
|
|
6202
6202
|
if (!r) return;
|
|
6203
6203
|
let i = r.reader.getLabelSnapshot(e.areaId, e.id);
|
|
6204
|
-
!i || i.noScaling === t || (
|
|
6204
|
+
!i || i.noScaling === t || (X({
|
|
6205
6205
|
kind: "setLabelNoScaling",
|
|
6206
6206
|
areaId: e.areaId,
|
|
6207
6207
|
id: e.id,
|
|
6208
6208
|
from: i.noScaling,
|
|
6209
6209
|
to: t
|
|
6210
6210
|
}, r), r.refresh(), D.bumpData());
|
|
6211
|
-
},
|
|
6211
|
+
}, z = (t) => {
|
|
6212
6212
|
let r = n.current;
|
|
6213
6213
|
if (!r) return;
|
|
6214
6214
|
let i = r.reader.getLabelSnapshot(e.areaId, e.id);
|
|
6215
|
-
!i || i.showOnTop === t || (
|
|
6215
|
+
!i || i.showOnTop === t || (X({
|
|
6216
6216
|
kind: "setLabelShowOnTop",
|
|
6217
6217
|
areaId: e.areaId,
|
|
6218
6218
|
id: e.id,
|
|
6219
6219
|
from: i.showOnTop,
|
|
6220
6220
|
to: t
|
|
6221
6221
|
}, r), r.refresh(), D.bumpData());
|
|
6222
|
-
},
|
|
6222
|
+
}, B = (t) => {
|
|
6223
6223
|
let r = n.current;
|
|
6224
6224
|
if (!r) return;
|
|
6225
6225
|
let i = r.reader.getLabelSnapshot(e.areaId, e.id);
|
|
@@ -6228,7 +6228,7 @@ function Zt({ selection: e, sceneRef: n }) {
|
|
|
6228
6228
|
...i.font,
|
|
6229
6229
|
...t
|
|
6230
6230
|
};
|
|
6231
|
-
|
|
6231
|
+
Ee([{
|
|
6232
6232
|
kind: "setLabelFont",
|
|
6233
6233
|
areaId: e.areaId,
|
|
6234
6234
|
id: e.id,
|
|
@@ -6238,9 +6238,9 @@ function Zt({ selection: e, sceneRef: n }) {
|
|
|
6238
6238
|
...i,
|
|
6239
6239
|
font: a
|
|
6240
6240
|
})], r), r.refresh(), D.bumpData();
|
|
6241
|
-
},
|
|
6241
|
+
}, V = () => {
|
|
6242
6242
|
M.current ||= { color: s.outlineColor };
|
|
6243
|
-
},
|
|
6243
|
+
}, H = (t) => {
|
|
6244
6244
|
let r = n.current, i = M.current ?? { color: s.outlineColor };
|
|
6245
6245
|
if (M.current = null, !r || Yt(i.color, t)) return;
|
|
6246
6246
|
let a = r.reader.getLabelSnapshot(e.areaId, e.id);
|
|
@@ -6249,14 +6249,14 @@ function Zt({ selection: e, sceneRef: n }) {
|
|
|
6249
6249
|
...a,
|
|
6250
6250
|
outlineColor: t
|
|
6251
6251
|
};
|
|
6252
|
-
|
|
6252
|
+
Ee([{
|
|
6253
6253
|
kind: "setLabelOutlineColor",
|
|
6254
6254
|
areaId: e.areaId,
|
|
6255
6255
|
id: e.id,
|
|
6256
6256
|
from: i.color,
|
|
6257
6257
|
to: t
|
|
6258
6258
|
}, ...N(o)], r), r.refresh(), D.bumpData();
|
|
6259
|
-
},
|
|
6259
|
+
}, ee = () => {
|
|
6260
6260
|
let t = n.current;
|
|
6261
6261
|
if (!t) return;
|
|
6262
6262
|
let r = t.reader.getLabelSnapshot(e.areaId, e.id);
|
|
@@ -6275,21 +6275,21 @@ function Zt({ selection: e, sceneRef: n }) {
|
|
|
6275
6275
|
`"${u.family}", sans-serif`
|
|
6276
6276
|
].filter(Boolean).join(" "), Math.max(...l.map((e) => i.measureText(e).width)) <= s ? (m = e, f = e + 1) : p = e - 1;
|
|
6277
6277
|
}
|
|
6278
|
-
m !== r.font.size &&
|
|
6279
|
-
},
|
|
6278
|
+
m !== r.font.size && B({ size: m });
|
|
6279
|
+
}, te = () => {
|
|
6280
6280
|
let t = n.current;
|
|
6281
6281
|
if (!t) return;
|
|
6282
6282
|
let r = t.reader.getLabelSnapshot(e.areaId, e.id);
|
|
6283
6283
|
if (!r) return;
|
|
6284
6284
|
let i = Wt(r);
|
|
6285
|
-
i !== r.pixMap && (
|
|
6285
|
+
i !== r.pixMap && (X({
|
|
6286
6286
|
kind: "setLabelPixmap",
|
|
6287
6287
|
areaId: e.areaId,
|
|
6288
6288
|
id: e.id,
|
|
6289
6289
|
from: r.pixMap,
|
|
6290
6290
|
to: i
|
|
6291
6291
|
}, t), t.refresh(), D.bumpData());
|
|
6292
|
-
},
|
|
6292
|
+
}, ne = () => {
|
|
6293
6293
|
let t = document.createElement("input");
|
|
6294
6294
|
t.type = "file", t.accept = "image/*", t.onchange = () => {
|
|
6295
6295
|
let r = t.files?.[0];
|
|
@@ -6303,7 +6303,7 @@ function Zt({ selection: e, sceneRef: n }) {
|
|
|
6303
6303
|
let a = i.reader.getLabelSnapshot(e.areaId, e.id);
|
|
6304
6304
|
if (!a) return;
|
|
6305
6305
|
let o = Math.max(.1, Math.round(r.naturalWidth / Xt * 100) / 100), s = Math.max(.1, Math.round(r.naturalHeight / Xt * 100) / 100);
|
|
6306
|
-
|
|
6306
|
+
Ee([
|
|
6307
6307
|
{
|
|
6308
6308
|
kind: "setLabelImageSrc",
|
|
6309
6309
|
areaId: e.areaId,
|
|
@@ -6329,13 +6329,13 @@ function Zt({ selection: e, sceneRef: n }) {
|
|
|
6329
6329
|
}, r.src = t;
|
|
6330
6330
|
}, i.readAsDataURL(r);
|
|
6331
6331
|
}, t.click();
|
|
6332
|
-
},
|
|
6332
|
+
}, re = () => {
|
|
6333
6333
|
let t = n.current;
|
|
6334
6334
|
if (!t) return;
|
|
6335
6335
|
let r = t.reader.getLabelSnapshot(e.areaId, e.id);
|
|
6336
6336
|
if (!r || !r.imageSrc) return;
|
|
6337
6337
|
let i = Wt(r);
|
|
6338
|
-
|
|
6338
|
+
Ee([{
|
|
6339
6339
|
kind: "setLabelImageSrc",
|
|
6340
6340
|
areaId: e.areaId,
|
|
6341
6341
|
id: e.id,
|
|
@@ -6348,14 +6348,14 @@ function Zt({ selection: e, sceneRef: n }) {
|
|
|
6348
6348
|
from: r.pixMap,
|
|
6349
6349
|
to: i
|
|
6350
6350
|
}], t), t.refresh(), D.setState({ labelAspectRatioLocked: !1 }), D.bumpData();
|
|
6351
|
-
},
|
|
6351
|
+
}, U = !!s.imageSrc, W = Ie(s.fgColor), G = Ie(s.bgColor), K = s.outlineColor ?? {
|
|
6352
6352
|
spec: 1,
|
|
6353
6353
|
r: 0,
|
|
6354
6354
|
g: 0,
|
|
6355
6355
|
b: 0,
|
|
6356
6356
|
alpha: 0,
|
|
6357
6357
|
pad: 0
|
|
6358
|
-
},
|
|
6358
|
+
}, ie = Ie(K), ae = (e) => ({
|
|
6359
6359
|
flex: 1,
|
|
6360
6360
|
padding: "4px 0",
|
|
6361
6361
|
fontSize: 12,
|
|
@@ -6390,18 +6390,18 @@ function Zt({ selection: e, sceneRef: n }) {
|
|
|
6390
6390
|
overflow: "hidden"
|
|
6391
6391
|
},
|
|
6392
6392
|
children: [/* @__PURE__ */ d("button", {
|
|
6393
|
-
style:
|
|
6393
|
+
style: ae(!U),
|
|
6394
6394
|
onClick: () => {
|
|
6395
|
-
|
|
6395
|
+
U && re();
|
|
6396
6396
|
},
|
|
6397
6397
|
children: "Text"
|
|
6398
6398
|
}), /* @__PURE__ */ d("button", {
|
|
6399
6399
|
style: {
|
|
6400
|
-
...
|
|
6400
|
+
...ae(U),
|
|
6401
6401
|
borderLeft: "1px solid var(--border, #444)"
|
|
6402
6402
|
},
|
|
6403
6403
|
onClick: () => {
|
|
6404
|
-
|
|
6404
|
+
U || ne();
|
|
6405
6405
|
},
|
|
6406
6406
|
children: "Image"
|
|
6407
6407
|
})]
|
|
@@ -6458,7 +6458,7 @@ function Zt({ selection: e, sceneRef: n }) {
|
|
|
6458
6458
|
}),
|
|
6459
6459
|
/* @__PURE__ */ d(Ne, {
|
|
6460
6460
|
checked: s.showOnTop,
|
|
6461
|
-
onChange:
|
|
6461
|
+
onChange: z,
|
|
6462
6462
|
description: "Show on top (foreground)"
|
|
6463
6463
|
}),
|
|
6464
6464
|
/* @__PURE__ */ d(Ne, {
|
|
@@ -6466,7 +6466,7 @@ function Zt({ selection: e, sceneRef: n }) {
|
|
|
6466
6466
|
onChange: (e) => R(!e),
|
|
6467
6467
|
description: "Scale with zoom"
|
|
6468
6468
|
}),
|
|
6469
|
-
|
|
6469
|
+
U && /* @__PURE__ */ d(Z, {
|
|
6470
6470
|
label: "Image",
|
|
6471
6471
|
children: /* @__PURE__ */ f("div", {
|
|
6472
6472
|
style: {
|
|
@@ -6484,13 +6484,13 @@ function Zt({ selection: e, sceneRef: n }) {
|
|
|
6484
6484
|
borderRadius: 3
|
|
6485
6485
|
}
|
|
6486
6486
|
}), /* @__PURE__ */ d("button", {
|
|
6487
|
-
onClick:
|
|
6487
|
+
onClick: ne,
|
|
6488
6488
|
style: { alignSelf: "flex-start" },
|
|
6489
6489
|
children: "Replace image..."
|
|
6490
6490
|
})]
|
|
6491
6491
|
})
|
|
6492
6492
|
}),
|
|
6493
|
-
!
|
|
6493
|
+
!U && /* @__PURE__ */ f(u, { children: [
|
|
6494
6494
|
/* @__PURE__ */ d(Z, {
|
|
6495
6495
|
label: "Text",
|
|
6496
6496
|
children: /* @__PURE__ */ d("textarea", {
|
|
@@ -6516,22 +6516,22 @@ function Zt({ selection: e, sceneRef: n }) {
|
|
|
6516
6516
|
as: "div",
|
|
6517
6517
|
children: /* @__PURE__ */ d("input", {
|
|
6518
6518
|
type: "color",
|
|
6519
|
-
defaultValue:
|
|
6519
|
+
defaultValue: W,
|
|
6520
6520
|
onMouseDown: I,
|
|
6521
6521
|
onBlur: (e) => L(Le(e.target.value), s.bgColor)
|
|
6522
|
-
}, `fg-${e.id}-${
|
|
6522
|
+
}, `fg-${e.id}-${W}`)
|
|
6523
6523
|
}), /* @__PURE__ */ d(Z, {
|
|
6524
6524
|
label: "BG color",
|
|
6525
6525
|
as: "div",
|
|
6526
6526
|
children: /* @__PURE__ */ d("input", {
|
|
6527
6527
|
type: "color",
|
|
6528
|
-
defaultValue:
|
|
6528
|
+
defaultValue: G,
|
|
6529
6529
|
onMouseDown: I,
|
|
6530
6530
|
onBlur: (e) => L(s.fgColor, {
|
|
6531
6531
|
...Le(e.target.value),
|
|
6532
6532
|
alpha: s.bgColor.alpha
|
|
6533
6533
|
})
|
|
6534
|
-
}, `bg-${e.id}-${
|
|
6534
|
+
}, `bg-${e.id}-${G}`)
|
|
6535
6535
|
})]
|
|
6536
6536
|
}),
|
|
6537
6537
|
/* @__PURE__ */ d(Z, {
|
|
@@ -6577,7 +6577,7 @@ function Zt({ selection: e, sceneRef: n }) {
|
|
|
6577
6577
|
children: /* @__PURE__ */ d(Kt, {
|
|
6578
6578
|
value: s.font.family,
|
|
6579
6579
|
options: x,
|
|
6580
|
-
onChange: (e) =>
|
|
6580
|
+
onChange: (e) => B({ family: e })
|
|
6581
6581
|
})
|
|
6582
6582
|
}),
|
|
6583
6583
|
/* @__PURE__ */ d(Z, {
|
|
@@ -6596,14 +6596,14 @@ function Zt({ selection: e, sceneRef: n }) {
|
|
|
6596
6596
|
defaultValue: s.font.size,
|
|
6597
6597
|
onBlur: (e) => {
|
|
6598
6598
|
let t = parseInt(e.target.value, 10);
|
|
6599
|
-
t > 0 &&
|
|
6599
|
+
t > 0 && B({ size: t });
|
|
6600
6600
|
},
|
|
6601
6601
|
onKeyDown: (e) => e.key === "Enter" && e.target.blur(),
|
|
6602
6602
|
style: { width: 60 }
|
|
6603
6603
|
}, `font-size-${e.id}-${s.font.size}`),
|
|
6604
6604
|
/* @__PURE__ */ d("button", {
|
|
6605
6605
|
title: "Auto-fit font size to fill label area",
|
|
6606
|
-
onClick:
|
|
6606
|
+
onClick: ee,
|
|
6607
6607
|
style: {
|
|
6608
6608
|
height: 24,
|
|
6609
6609
|
padding: "0 6px",
|
|
@@ -6644,7 +6644,7 @@ function Zt({ selection: e, sceneRef: n }) {
|
|
|
6644
6644
|
]
|
|
6645
6645
|
].map(([e, t, n]) => /* @__PURE__ */ d("button", {
|
|
6646
6646
|
title: t,
|
|
6647
|
-
onClick: () =>
|
|
6647
|
+
onClick: () => B({ [t]: !s.font[t] }),
|
|
6648
6648
|
style: {
|
|
6649
6649
|
width: 24,
|
|
6650
6650
|
height: 24,
|
|
@@ -6668,13 +6668,13 @@ function Zt({ selection: e, sceneRef: n }) {
|
|
|
6668
6668
|
as: "div",
|
|
6669
6669
|
children: /* @__PURE__ */ d("input", {
|
|
6670
6670
|
type: "color",
|
|
6671
|
-
defaultValue:
|
|
6672
|
-
onMouseDown:
|
|
6673
|
-
onBlur: (e) =>
|
|
6674
|
-
...
|
|
6671
|
+
defaultValue: ie,
|
|
6672
|
+
onMouseDown: V,
|
|
6673
|
+
onBlur: (e) => H({
|
|
6674
|
+
...K,
|
|
6675
6675
|
...Le(e.target.value)
|
|
6676
6676
|
})
|
|
6677
|
-
}, `outline-${e.id}-${
|
|
6677
|
+
}, `outline-${e.id}-${ie}`)
|
|
6678
6678
|
}),
|
|
6679
6679
|
/* @__PURE__ */ d(Z, {
|
|
6680
6680
|
label: "Outline alpha",
|
|
@@ -6692,19 +6692,19 @@ function Zt({ selection: e, sceneRef: n }) {
|
|
|
6692
6692
|
step: 1,
|
|
6693
6693
|
value: y,
|
|
6694
6694
|
style: { flex: 1 },
|
|
6695
|
-
onPointerDown:
|
|
6695
|
+
onPointerDown: V,
|
|
6696
6696
|
onChange: (e) => b(parseInt(e.target.value, 10)),
|
|
6697
6697
|
onPointerUp: (e) => {
|
|
6698
6698
|
let t = parseInt(e.target.value, 10);
|
|
6699
|
-
|
|
6700
|
-
...
|
|
6699
|
+
H(t === 0 ? void 0 : {
|
|
6700
|
+
...K,
|
|
6701
6701
|
alpha: t
|
|
6702
6702
|
});
|
|
6703
6703
|
},
|
|
6704
6704
|
onBlur: (e) => {
|
|
6705
6705
|
let t = parseInt(e.target.value, 10);
|
|
6706
|
-
|
|
6707
|
-
...
|
|
6706
|
+
H(t === 0 ? void 0 : {
|
|
6707
|
+
...K,
|
|
6708
6708
|
alpha: t
|
|
6709
6709
|
});
|
|
6710
6710
|
}
|
|
@@ -6740,7 +6740,7 @@ function Zt({ selection: e, sceneRef: n }) {
|
|
|
6740
6740
|
className: "hint",
|
|
6741
6741
|
children: "No pixmap stored"
|
|
6742
6742
|
}), /* @__PURE__ */ d("button", {
|
|
6743
|
-
onClick:
|
|
6743
|
+
onClick: te,
|
|
6744
6744
|
style: { alignSelf: "flex-start" },
|
|
6745
6745
|
children: "Regenerate pixmap"
|
|
6746
6746
|
})]
|
|
@@ -7059,34 +7059,34 @@ var an = [
|
|
|
7059
7059
|
"door-locked"
|
|
7060
7060
|
];
|
|
7061
7061
|
function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = [] }) {
|
|
7062
|
-
let l = n.ids[0], p = O((e) => e.pending), [m, h] = i(a.name ?? ""), [g, _] = i(String(a.weight ?? 1)), [v, y] = i(a.symbol ?? ""), [b, x] = i(a.userData?.["system.fallback_symbol_color"] ?? null), [S, C] = i(!1), [w, T] = i(""), [E, k] = i(""), [A, j] = i({}), [M, N] = i(null), [P, F] = i("#ffffff"), [I, L] = i(1), [R,
|
|
7063
|
-
|
|
7064
|
-
let
|
|
7065
|
-
|
|
7066
|
-
let
|
|
7067
|
-
|
|
7068
|
-
let
|
|
7069
|
-
|
|
7062
|
+
let l = n.ids[0], p = O((e) => e.pending), [m, h] = i(a.name ?? ""), [g, _] = i(String(a.weight ?? 1)), [v, y] = i(a.symbol ?? ""), [b, x] = i(a.userData?.["system.fallback_symbol_color"] ?? null), [S, C] = i(!1), [w, T] = i(""), [E, k] = i(""), [A, j] = i({}), [M, N] = i(null), [P, F] = i("#ffffff"), [I, L] = i(1), [R, z] = i(!1), [B, V] = i(!1), H = r(k);
|
|
7063
|
+
H.current = k, t(() => (ft((e) => H.current(String(e))), () => ft(null)), []);
|
|
7064
|
+
let ee = r(m);
|
|
7065
|
+
ee.current = m;
|
|
7066
|
+
let te = r(g);
|
|
7067
|
+
te.current = g;
|
|
7068
|
+
let ne = r(v);
|
|
7069
|
+
ne.current = v, t(() => {
|
|
7070
7070
|
let e = a, t = l;
|
|
7071
7071
|
return () => {
|
|
7072
|
-
let n = !1, r =
|
|
7073
|
-
r !== e.symbol && (
|
|
7072
|
+
let n = !1, r = ne.current;
|
|
7073
|
+
r !== e.symbol && (X({
|
|
7074
7074
|
kind: "setRoomField",
|
|
7075
7075
|
id: t,
|
|
7076
7076
|
field: "symbol",
|
|
7077
7077
|
from: e.symbol,
|
|
7078
7078
|
to: r
|
|
7079
7079
|
}, s.current), n = !0);
|
|
7080
|
-
let i =
|
|
7081
|
-
i !== e.name && (
|
|
7080
|
+
let i = ee.current;
|
|
7081
|
+
i !== e.name && (X({
|
|
7082
7082
|
kind: "setRoomField",
|
|
7083
7083
|
id: t,
|
|
7084
7084
|
field: "name",
|
|
7085
7085
|
from: e.name,
|
|
7086
7086
|
to: i
|
|
7087
7087
|
}, s.current), n = !0);
|
|
7088
|
-
let a = Number(
|
|
7089
|
-
!Number.isNaN(a) && a !== e.weight && (
|
|
7088
|
+
let a = Number(te.current);
|
|
7089
|
+
!Number.isNaN(a) && a !== e.weight && (X({
|
|
7090
7090
|
kind: "setRoomField",
|
|
7091
7091
|
id: t,
|
|
7092
7092
|
field: "weight",
|
|
@@ -7095,45 +7095,45 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7095
7095
|
}, s.current), n = !0), n && (s.current?.refresh(), D.bumpData());
|
|
7096
7096
|
};
|
|
7097
7097
|
}, [a]), t(() => {
|
|
7098
|
-
h(a.name ?? ""), _(String(a.weight ?? 1)), y(a.symbol ?? ""), x(a.userData?.["system.fallback_symbol_color"] ?? null), C(!1), T(""), k(""), j({}), N(null),
|
|
7098
|
+
h(a.name ?? ""), _(String(a.weight ?? 1)), y(a.symbol ?? ""), x(a.userData?.["system.fallback_symbol_color"] ?? null), C(!1), T(""), k(""), j({}), N(null), V(!1);
|
|
7099
7099
|
let e = D.getState().pending;
|
|
7100
7100
|
(e?.kind === "pickExit" || e?.kind === "pickSpecialExit") && D.setState({ pending: null });
|
|
7101
7101
|
}, [a]);
|
|
7102
|
-
let
|
|
7102
|
+
let re = (e, t) => {
|
|
7103
7103
|
let n = a[e], r = t;
|
|
7104
7104
|
if (e === "weight" || e === "environment") {
|
|
7105
7105
|
let e = Number(t);
|
|
7106
7106
|
if (Number.isNaN(e)) return;
|
|
7107
7107
|
r = e;
|
|
7108
7108
|
}
|
|
7109
|
-
r !== n && (
|
|
7109
|
+
r !== n && (X({
|
|
7110
7110
|
kind: "setRoomField",
|
|
7111
7111
|
id: l,
|
|
7112
7112
|
field: e,
|
|
7113
7113
|
from: n,
|
|
7114
7114
|
to: r
|
|
7115
7115
|
}, s.current), s.current?.refresh(), D.bumpData(), D.setState({ status: `Updated ${e} on room ${l}` }));
|
|
7116
|
-
},
|
|
7117
|
-
e !== a.environment && (
|
|
7116
|
+
}, U = (e) => {
|
|
7117
|
+
e !== a.environment && (X({
|
|
7118
7118
|
kind: "setRoomField",
|
|
7119
7119
|
id: l,
|
|
7120
7120
|
field: "environment",
|
|
7121
7121
|
from: a.environment,
|
|
7122
7122
|
to: e
|
|
7123
7123
|
}, s.current), s.current?.refresh(), D.bumpData(), D.setState({ status: `Room ${l} environment → ${e}` }));
|
|
7124
|
-
},
|
|
7124
|
+
}, W = (e) => {
|
|
7125
7125
|
let t = "system.fallback_symbol_color", n = a.userData?.[t] ?? null, r = e;
|
|
7126
|
-
n !== r && (
|
|
7126
|
+
n !== r && (X({
|
|
7127
7127
|
kind: "setUserDataEntry",
|
|
7128
7128
|
roomId: l,
|
|
7129
7129
|
key: t,
|
|
7130
7130
|
from: n,
|
|
7131
7131
|
to: r
|
|
7132
7132
|
}, s.current), s.current?.refresh(), D.bumpData());
|
|
7133
|
-
},
|
|
7133
|
+
}, G = (e, t) => {
|
|
7134
7134
|
if (!o.rooms[t]) return;
|
|
7135
7135
|
let n = a[e];
|
|
7136
|
-
|
|
7136
|
+
X({
|
|
7137
7137
|
kind: "addExit",
|
|
7138
7138
|
fromId: l,
|
|
7139
7139
|
dir: e,
|
|
@@ -7141,54 +7141,54 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7141
7141
|
previous: n,
|
|
7142
7142
|
reverse: null
|
|
7143
7143
|
}, s.current), s.current?.refresh(), D.bumpData(), D.setState({ status: `Exit ${e} → room ${t} added.` });
|
|
7144
|
-
},
|
|
7145
|
-
|
|
7144
|
+
}, K = (e, t, n) => {
|
|
7145
|
+
X({
|
|
7146
7146
|
kind: "setDoor",
|
|
7147
7147
|
roomId: l,
|
|
7148
7148
|
dir: e,
|
|
7149
7149
|
from: t,
|
|
7150
7150
|
to: n
|
|
7151
7151
|
}, s.current), s.current?.refresh(), D.bumpData();
|
|
7152
|
-
},
|
|
7153
|
-
t !== n && (
|
|
7152
|
+
}, ie = (e, t, n) => {
|
|
7153
|
+
t !== n && (X({
|
|
7154
7154
|
kind: "setExitWeight",
|
|
7155
7155
|
roomId: l,
|
|
7156
7156
|
dir: e,
|
|
7157
7157
|
from: t,
|
|
7158
7158
|
to: n
|
|
7159
7159
|
}, s.current), s.current?.refresh(), D.bumpData());
|
|
7160
|
-
},
|
|
7161
|
-
|
|
7160
|
+
}, ae = (e, t) => {
|
|
7161
|
+
X({
|
|
7162
7162
|
kind: "setExitLock",
|
|
7163
7163
|
roomId: l,
|
|
7164
7164
|
dir: e,
|
|
7165
7165
|
lock: !t
|
|
7166
7166
|
}, s.current), s.current?.refresh(), D.bumpData();
|
|
7167
|
-
},
|
|
7168
|
-
t ?
|
|
7167
|
+
}, oe = (e, t, n, r) => {
|
|
7168
|
+
t ? X({
|
|
7169
7169
|
kind: "removeExit",
|
|
7170
7170
|
fromId: l,
|
|
7171
7171
|
dir: e,
|
|
7172
7172
|
was: n,
|
|
7173
7173
|
reverse: null
|
|
7174
|
-
}, s.current) : r &&
|
|
7174
|
+
}, s.current) : r && X({
|
|
7175
7175
|
kind: "setStub",
|
|
7176
7176
|
roomId: l,
|
|
7177
7177
|
dir: e,
|
|
7178
7178
|
stub: !1
|
|
7179
7179
|
}, s.current), s.current?.refresh(), D.bumpData();
|
|
7180
|
-
},
|
|
7181
|
-
t ?
|
|
7180
|
+
}, se = (e, t, n) => {
|
|
7181
|
+
t ? X({
|
|
7182
7182
|
kind: "setStub",
|
|
7183
7183
|
roomId: l,
|
|
7184
7184
|
dir: e,
|
|
7185
7185
|
stub: !1
|
|
7186
|
-
}, s.current) : n === -1 ?
|
|
7186
|
+
}, s.current) : n === -1 ? X({
|
|
7187
7187
|
kind: "setStub",
|
|
7188
7188
|
roomId: l,
|
|
7189
7189
|
dir: e,
|
|
7190
7190
|
stub: !0
|
|
7191
|
-
}, s.current) :
|
|
7191
|
+
}, s.current) : Ee([{
|
|
7192
7192
|
kind: "removeExit",
|
|
7193
7193
|
fromId: l,
|
|
7194
7194
|
dir: e,
|
|
@@ -7200,40 +7200,40 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7200
7200
|
dir: e,
|
|
7201
7201
|
stub: !0
|
|
7202
7202
|
}], s.current), s.current?.refresh(), D.bumpData();
|
|
7203
|
-
},
|
|
7203
|
+
}, ce = () => {
|
|
7204
7204
|
let e = w.trim(), t = parseInt(E, 10);
|
|
7205
|
-
!e || Number.isNaN(t) || t <= 0 || (
|
|
7205
|
+
!e || Number.isNaN(t) || t <= 0 || (X({
|
|
7206
7206
|
kind: "addSpecialExit",
|
|
7207
7207
|
roomId: l,
|
|
7208
7208
|
name: e,
|
|
7209
7209
|
toId: t
|
|
7210
7210
|
}, s.current), s.current?.refresh(), D.bumpData(), D.setState({ status: `Special exit '${e}' → ${t} added` }), T(""), k(""));
|
|
7211
|
-
},
|
|
7212
|
-
|
|
7211
|
+
}, le = (e, t) => {
|
|
7212
|
+
X({
|
|
7213
7213
|
kind: "removeSpecialExit",
|
|
7214
7214
|
roomId: l,
|
|
7215
7215
|
name: e,
|
|
7216
7216
|
toId: t
|
|
7217
7217
|
}, s.current), s.current?.refresh(), D.bumpData(), D.setState({ status: `Special exit '${e}' removed` });
|
|
7218
|
-
},
|
|
7219
|
-
|
|
7218
|
+
}, ue = (e, t, n) => {
|
|
7219
|
+
X({
|
|
7220
7220
|
kind: "setSpecialExitDoor",
|
|
7221
7221
|
roomId: l,
|
|
7222
7222
|
name: e,
|
|
7223
7223
|
from: t,
|
|
7224
7224
|
to: n
|
|
7225
7225
|
}, s.current), s.current?.refresh(), D.bumpData();
|
|
7226
|
-
},
|
|
7227
|
-
t !== n && (
|
|
7226
|
+
}, de = (e, t, n) => {
|
|
7227
|
+
t !== n && (X({
|
|
7228
7228
|
kind: "setSpecialExitWeight",
|
|
7229
7229
|
roomId: l,
|
|
7230
7230
|
name: e,
|
|
7231
7231
|
from: t,
|
|
7232
7232
|
to: n
|
|
7233
7233
|
}, s.current), s.current?.refresh(), D.bumpData());
|
|
7234
|
-
},
|
|
7234
|
+
}, fe = (e) => {
|
|
7235
7235
|
let t = o.rooms[l];
|
|
7236
|
-
t?.customLines?.[e] && (
|
|
7236
|
+
t?.customLines?.[e] && (X({
|
|
7237
7237
|
kind: "removeCustomLine",
|
|
7238
7238
|
roomId: l,
|
|
7239
7239
|
exitName: e,
|
|
@@ -7250,7 +7250,7 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7250
7250
|
arrow: t.customLinesArrow?.[e] ?? !1
|
|
7251
7251
|
}
|
|
7252
7252
|
}, s.current), s.current?.refresh(), D.bumpData(), D.setState({ status: `Custom line '${e}' removed` }));
|
|
7253
|
-
},
|
|
7253
|
+
}, me = (e) => {
|
|
7254
7254
|
let t = e.trim();
|
|
7255
7255
|
if (!t) {
|
|
7256
7256
|
D.setState({ status: "Enter exit name first." });
|
|
@@ -7258,7 +7258,7 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7258
7258
|
}
|
|
7259
7259
|
let n = s.current, r = n?.reader.getRoom(l);
|
|
7260
7260
|
if (!n || !r) return;
|
|
7261
|
-
let i =
|
|
7261
|
+
let i = _e(t), a = o.rooms[l], c = a?.customLines?.[i] ? {
|
|
7262
7262
|
points: a.customLines[i],
|
|
7263
7263
|
color: a.customLinesColor?.[i] ?? {
|
|
7264
7264
|
spec: 1,
|
|
@@ -7269,13 +7269,13 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7269
7269
|
},
|
|
7270
7270
|
style: a.customLinesStyle?.[i] ?? 1,
|
|
7271
7271
|
arrow: a.customLinesArrow?.[i] ?? !1
|
|
7272
|
-
} : null, u = Le(P), d = null, f =
|
|
7273
|
-
if (
|
|
7272
|
+
} : null, u = Le(P), d = null, f = ge[i];
|
|
7273
|
+
if (B && f) {
|
|
7274
7274
|
let e = a?.[f];
|
|
7275
7275
|
if (e !== void 0 && e !== -1) {
|
|
7276
|
-
let t = o.rooms[e], r =
|
|
7276
|
+
let t = o.rooms[e], r = pe[f];
|
|
7277
7277
|
if (t && t[r] === l) {
|
|
7278
|
-
let i =
|
|
7278
|
+
let i = q[r];
|
|
7279
7279
|
d = {
|
|
7280
7280
|
roomId: e,
|
|
7281
7281
|
exitName: i,
|
|
@@ -7311,14 +7311,14 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7311
7311
|
},
|
|
7312
7312
|
status: "Click canvas to add waypoints · double-click or Enter to finish · Esc cancels"
|
|
7313
7313
|
}), D.bumpData(), N(null);
|
|
7314
|
-
},
|
|
7315
|
-
let t =
|
|
7314
|
+
}, he = (e) => {
|
|
7315
|
+
let t = _e(e);
|
|
7316
7316
|
return a.customLines?.[t] ? {
|
|
7317
7317
|
key: t,
|
|
7318
7318
|
color: a.customLinesColor?.[t]
|
|
7319
7319
|
} : null;
|
|
7320
|
-
},
|
|
7321
|
-
let t =
|
|
7320
|
+
}, ve = (e) => {
|
|
7321
|
+
let t = he(e);
|
|
7322
7322
|
if (t) {
|
|
7323
7323
|
D.setState({ selection: {
|
|
7324
7324
|
kind: "customLine",
|
|
@@ -7327,8 +7327,8 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7327
7327
|
} });
|
|
7328
7328
|
return;
|
|
7329
7329
|
}
|
|
7330
|
-
F("#ffffff"), L(1),
|
|
7331
|
-
},
|
|
7330
|
+
F("#ffffff"), L(1), z(!1), V(!1), N(e);
|
|
7331
|
+
}, ye = (e) => /* @__PURE__ */ f("div", {
|
|
7332
7332
|
className: "cl-form cl-form-inline",
|
|
7333
7333
|
children: [
|
|
7334
7334
|
/* @__PURE__ */ f("div", {
|
|
@@ -7382,7 +7382,7 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7382
7382
|
}), /* @__PURE__ */ d("input", {
|
|
7383
7383
|
type: "checkbox",
|
|
7384
7384
|
checked: R,
|
|
7385
|
-
onChange: (e) =>
|
|
7385
|
+
onChange: (e) => z(e.target.checked)
|
|
7386
7386
|
})]
|
|
7387
7387
|
}),
|
|
7388
7388
|
/* @__PURE__ */ f("div", {
|
|
@@ -7393,8 +7393,8 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7393
7393
|
children: "Both ways"
|
|
7394
7394
|
}), /* @__PURE__ */ d("input", {
|
|
7395
7395
|
type: "checkbox",
|
|
7396
|
-
checked:
|
|
7397
|
-
onChange: (e) =>
|
|
7396
|
+
checked: B,
|
|
7397
|
+
onChange: (e) => V(e.target.checked)
|
|
7398
7398
|
})]
|
|
7399
7399
|
}),
|
|
7400
7400
|
/* @__PURE__ */ f("div", {
|
|
@@ -7405,7 +7405,7 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7405
7405
|
},
|
|
7406
7406
|
children: [/* @__PURE__ */ d("button", {
|
|
7407
7407
|
type: "button",
|
|
7408
|
-
onClick: () =>
|
|
7408
|
+
onClick: () => me(e),
|
|
7409
7409
|
style: { flex: 1 },
|
|
7410
7410
|
children: "Start Drawing"
|
|
7411
7411
|
}), /* @__PURE__ */ d("button", {
|
|
@@ -7415,8 +7415,8 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7415
7415
|
})]
|
|
7416
7416
|
})
|
|
7417
7417
|
]
|
|
7418
|
-
}),
|
|
7419
|
-
let t = e, n = a[e], r = n !== -1, i =
|
|
7418
|
+
}), be = (e) => {
|
|
7419
|
+
let t = e, n = a[e], r = n !== -1, i = q[t], o = J[t], s = a.stubs?.includes(o) ?? !1, c = r || s, u = a.doors?.[i] ?? 0, m = a.exitWeights?.[i] ?? 1, h = a.exitLocks?.includes(o) ?? !1, g = !!a.customLines?.[i], _ = p?.kind === "pickExit" && p.fromId === l && p.dir === t;
|
|
7420
7420
|
return /* @__PURE__ */ f("div", {
|
|
7421
7421
|
className: `compass-cell${c ? " has-exit" : ""}${M === e ? " active" : ""}${_ ? " picking-exit" : ""}`,
|
|
7422
7422
|
children: [
|
|
@@ -7431,7 +7431,7 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7431
7431
|
c && /* @__PURE__ */ d("button", {
|
|
7432
7432
|
type: "button",
|
|
7433
7433
|
className: `exit-line-btn${g ? " has-line" : ""}`,
|
|
7434
|
-
onClick: () =>
|
|
7434
|
+
onClick: () => ve(e),
|
|
7435
7435
|
title: g ? "Edit custom line" : "Draw custom line",
|
|
7436
7436
|
children: g ? (() => {
|
|
7437
7437
|
let e = a.customLinesColor?.[i];
|
|
@@ -7448,14 +7448,14 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7448
7448
|
type: "button",
|
|
7449
7449
|
className: `cc-icon-btn cc-stub-btn${s ? " stub-active" : ""}`,
|
|
7450
7450
|
title: s ? "Remove stub" : r ? "Convert to stub" : "Add stub",
|
|
7451
|
-
onClick: () =>
|
|
7451
|
+
onClick: () => se(t, s, n),
|
|
7452
7452
|
children: "S"
|
|
7453
7453
|
}),
|
|
7454
7454
|
c && /* @__PURE__ */ d("button", {
|
|
7455
7455
|
type: "button",
|
|
7456
7456
|
className: "cc-icon-btn cc-delete-btn",
|
|
7457
7457
|
title: r ? "Remove exit" : "Remove stub",
|
|
7458
|
-
onClick: () =>
|
|
7458
|
+
onClick: () => oe(t, r, n, s),
|
|
7459
7459
|
children: "×"
|
|
7460
7460
|
})
|
|
7461
7461
|
]
|
|
@@ -7485,7 +7485,7 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7485
7485
|
})),
|
|
7486
7486
|
onBlur: (n) => {
|
|
7487
7487
|
let r = parseInt(n.target.value, 10);
|
|
7488
|
-
isNaN(r) || (
|
|
7488
|
+
isNaN(r) || (G(t, r), j((t) => ({
|
|
7489
7489
|
...t,
|
|
7490
7490
|
[e]: ""
|
|
7491
7491
|
})));
|
|
@@ -7515,7 +7515,7 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7515
7515
|
className: `cc-door-btn ${un[u]}${c ? "" : " cc-dim"}`,
|
|
7516
7516
|
title: c ? ln[u] : void 0,
|
|
7517
7517
|
disabled: !c,
|
|
7518
|
-
onClick: c ? () =>
|
|
7518
|
+
onClick: c ? () => K(t, u, (u + 1) % 4) : void 0,
|
|
7519
7519
|
children: /* @__PURE__ */ d($t, {})
|
|
7520
7520
|
}),
|
|
7521
7521
|
/* @__PURE__ */ d("button", {
|
|
@@ -7523,7 +7523,7 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7523
7523
|
className: `cc-icon-btn${h ? " lock-active" : ""}${c ? "" : " cc-dim"}`,
|
|
7524
7524
|
title: c ? h ? "Locked — click to unlock" : "Unlocked — click to lock" : void 0,
|
|
7525
7525
|
disabled: !c,
|
|
7526
|
-
onClick: c ? () =>
|
|
7526
|
+
onClick: c ? () => ae(t, h) : void 0,
|
|
7527
7527
|
children: /* @__PURE__ */ d(en, { locked: h })
|
|
7528
7528
|
}),
|
|
7529
7529
|
/* @__PURE__ */ f("span", {
|
|
@@ -7535,7 +7535,7 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7535
7535
|
defaultValue: m,
|
|
7536
7536
|
disabled: !c,
|
|
7537
7537
|
title: "Exit weight",
|
|
7538
|
-
onBlur: (e) =>
|
|
7538
|
+
onBlur: (e) => ie(t, m, Math.max(1, parseInt(e.target.value, 10) || 1)),
|
|
7539
7539
|
onKeyDown: (e) => e.key === "Enter" && e.target.blur()
|
|
7540
7540
|
}, `${l}-${e}-${m}`)]
|
|
7541
7541
|
})
|
|
@@ -7543,7 +7543,7 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7543
7543
|
})
|
|
7544
7544
|
]
|
|
7545
7545
|
}, e);
|
|
7546
|
-
},
|
|
7546
|
+
}, xe = s.current?.reader.getColorValue(a.environment) ?? "rgb(114,1,0)", Y = Object.entries(a.mSpecialExits ?? {}), Se = Object.entries(a.customLines ?? {});
|
|
7547
7547
|
return /* @__PURE__ */ f("div", {
|
|
7548
7548
|
className: "panel-content",
|
|
7549
7549
|
children: [
|
|
@@ -7579,7 +7579,7 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7579
7579
|
children: /* @__PURE__ */ d("input", {
|
|
7580
7580
|
value: m,
|
|
7581
7581
|
onChange: (e) => h(e.target.value),
|
|
7582
|
-
onBlur: () =>
|
|
7582
|
+
onBlur: () => re("name", m),
|
|
7583
7583
|
onKeyDown: (e) => {
|
|
7584
7584
|
e.key === "Enter" && e.target.blur();
|
|
7585
7585
|
}
|
|
@@ -7598,7 +7598,7 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7598
7598
|
/* @__PURE__ */ d("button", {
|
|
7599
7599
|
type: "button",
|
|
7600
7600
|
className: "env-pick-btn",
|
|
7601
|
-
style: { background:
|
|
7601
|
+
style: { background: xe },
|
|
7602
7602
|
onClick: () => C((e) => !e),
|
|
7603
7603
|
title: `Env ${a.environment} — click to change`
|
|
7604
7604
|
}),
|
|
@@ -7610,7 +7610,7 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7610
7610
|
map: o,
|
|
7611
7611
|
sceneRef: s,
|
|
7612
7612
|
currentEnvId: a.environment,
|
|
7613
|
-
onSelect:
|
|
7613
|
+
onSelect: U,
|
|
7614
7614
|
onClose: () => C(!1)
|
|
7615
7615
|
})
|
|
7616
7616
|
]
|
|
@@ -7624,7 +7624,7 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7624
7624
|
value: v,
|
|
7625
7625
|
maxLength: 4,
|
|
7626
7626
|
onChange: (e) => y(e.target.value),
|
|
7627
|
-
onBlur: () =>
|
|
7627
|
+
onBlur: () => re("symbol", v)
|
|
7628
7628
|
}),
|
|
7629
7629
|
/* @__PURE__ */ d("input", {
|
|
7630
7630
|
type: "color",
|
|
@@ -7633,7 +7633,7 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7633
7633
|
title: "Symbol color (stored in userData as system.fallback_symbol_color)",
|
|
7634
7634
|
onChange: (e) => x(e.target.value),
|
|
7635
7635
|
onBlur: () => {
|
|
7636
|
-
b !== null &&
|
|
7636
|
+
b !== null && W(b);
|
|
7637
7637
|
}
|
|
7638
7638
|
}),
|
|
7639
7639
|
/* @__PURE__ */ d("button", {
|
|
@@ -7642,7 +7642,7 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7642
7642
|
style: { visibility: b === null ? "hidden" : "visible" },
|
|
7643
7643
|
title: "Clear symbol color",
|
|
7644
7644
|
onClick: () => {
|
|
7645
|
-
x(null),
|
|
7645
|
+
x(null), W(null);
|
|
7646
7646
|
},
|
|
7647
7647
|
children: "×"
|
|
7648
7648
|
})
|
|
@@ -7660,7 +7660,7 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7660
7660
|
className: `cc-room-lock-btn${a.isLocked ? " lock-active" : ""}`,
|
|
7661
7661
|
title: a.isLocked ? "Room locked — click to unlock" : "Room unlocked — click to lock",
|
|
7662
7662
|
onClick: () => {
|
|
7663
|
-
|
|
7663
|
+
X({
|
|
7664
7664
|
kind: "setRoomLock",
|
|
7665
7665
|
id: l,
|
|
7666
7666
|
lock: !a.isLocked
|
|
@@ -7674,20 +7674,20 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7674
7674
|
value: g,
|
|
7675
7675
|
title: "Room weight",
|
|
7676
7676
|
onChange: (e) => _(e.target.value),
|
|
7677
|
-
onBlur: () =>
|
|
7677
|
+
onBlur: () => re("weight", g),
|
|
7678
7678
|
onKeyDown: (e) => e.key === "Enter" && e.target.blur()
|
|
7679
7679
|
}, `${l}-w`)]
|
|
7680
|
-
}, t) :
|
|
7680
|
+
}, t) : be(e))
|
|
7681
7681
|
}),
|
|
7682
7682
|
/* @__PURE__ */ d("div", {
|
|
7683
7683
|
className: "compass-extra",
|
|
7684
|
-
children: sn.flat().map((e, t) => e === null ? /* @__PURE__ */ d("div", { className: "compass-vert-spacer" }, t) :
|
|
7684
|
+
children: sn.flat().map((e, t) => e === null ? /* @__PURE__ */ d("div", { className: "compass-vert-spacer" }, t) : be(e))
|
|
7685
7685
|
}),
|
|
7686
|
-
M !== null && an.includes(M) &&
|
|
7686
|
+
M !== null && an.includes(M) && ye(M),
|
|
7687
7687
|
/* @__PURE__ */ d("h4", { children: "Special Exits" }),
|
|
7688
7688
|
/* @__PURE__ */ f("div", {
|
|
7689
7689
|
className: "special-exits-list",
|
|
7690
|
-
children: [
|
|
7690
|
+
children: [Y.map(([t, n]) => {
|
|
7691
7691
|
let r = a.doors?.[t] ?? 0, i = a.exitWeights?.[t] ?? 1, o = !!a.customLines?.[t];
|
|
7692
7692
|
return /* @__PURE__ */ f(e, { children: [/* @__PURE__ */ f("div", {
|
|
7693
7693
|
className: `compass-cell has-exit${M === t ? " active" : ""}`,
|
|
@@ -7703,7 +7703,7 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7703
7703
|
children: /* @__PURE__ */ d("button", {
|
|
7704
7704
|
type: "button",
|
|
7705
7705
|
className: `exit-line-btn${o ? " has-line" : ""}`,
|
|
7706
|
-
onClick: () =>
|
|
7706
|
+
onClick: () => ve(t),
|
|
7707
7707
|
title: o ? "Edit custom line" : "Draw custom line",
|
|
7708
7708
|
children: o ? (() => {
|
|
7709
7709
|
let e = a.customLinesColor?.[t];
|
|
@@ -7732,7 +7732,7 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7732
7732
|
type: "button",
|
|
7733
7733
|
className: `cc-door-btn ${un[r]}`,
|
|
7734
7734
|
title: ln[r],
|
|
7735
|
-
onClick: () =>
|
|
7735
|
+
onClick: () => ue(t, r, (r + 1) % 4),
|
|
7736
7736
|
children: /* @__PURE__ */ d($t, {})
|
|
7737
7737
|
}),
|
|
7738
7738
|
/* @__PURE__ */ f("span", {
|
|
@@ -7743,7 +7743,7 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7743
7743
|
min: 1,
|
|
7744
7744
|
defaultValue: i,
|
|
7745
7745
|
title: "Exit weight",
|
|
7746
|
-
onBlur: (e) =>
|
|
7746
|
+
onBlur: (e) => de(t, i, Math.max(1, parseInt(e.target.value, 10) || 1)),
|
|
7747
7747
|
onKeyDown: (e) => e.key === "Enter" && e.target.blur()
|
|
7748
7748
|
}, `${l}-${t}-${i}`)]
|
|
7749
7749
|
}),
|
|
@@ -7751,13 +7751,13 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7751
7751
|
type: "button",
|
|
7752
7752
|
className: "cc-icon-btn",
|
|
7753
7753
|
title: "Remove special exit",
|
|
7754
|
-
onClick: () =>
|
|
7754
|
+
onClick: () => le(t, n),
|
|
7755
7755
|
children: "✕"
|
|
7756
7756
|
})
|
|
7757
7757
|
]
|
|
7758
7758
|
})
|
|
7759
7759
|
]
|
|
7760
|
-
}), M === t &&
|
|
7760
|
+
}), M === t && ye(t)] }, t);
|
|
7761
7761
|
}), /* @__PURE__ */ f("div", {
|
|
7762
7762
|
className: "special-exit-add",
|
|
7763
7763
|
children: [
|
|
@@ -7765,7 +7765,7 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7765
7765
|
placeholder: "exit name",
|
|
7766
7766
|
value: w,
|
|
7767
7767
|
onChange: (e) => T(e.target.value),
|
|
7768
|
-
onKeyDown: (e) => e.key === "Enter" && E &&
|
|
7768
|
+
onKeyDown: (e) => e.key === "Enter" && E && ce()
|
|
7769
7769
|
}),
|
|
7770
7770
|
/* @__PURE__ */ f("div", {
|
|
7771
7771
|
className: "cc-exit-add",
|
|
@@ -7775,7 +7775,7 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7775
7775
|
placeholder: "#",
|
|
7776
7776
|
value: E,
|
|
7777
7777
|
onChange: (e) => k(e.target.value),
|
|
7778
|
-
onKeyDown: (e) => e.key === "Enter" && w &&
|
|
7778
|
+
onKeyDown: (e) => e.key === "Enter" && w && ce()
|
|
7779
7779
|
}), /* @__PURE__ */ d("button", {
|
|
7780
7780
|
type: "button",
|
|
7781
7781
|
className: `cc-pick-btn${p?.kind === "pickSpecialExit" && p.fromId === l ? " picking" : ""}`,
|
|
@@ -7792,16 +7792,16 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7792
7792
|
}),
|
|
7793
7793
|
/* @__PURE__ */ d("button", {
|
|
7794
7794
|
type: "button",
|
|
7795
|
-
onClick:
|
|
7795
|
+
onClick: ce,
|
|
7796
7796
|
disabled: !w.trim() || !E,
|
|
7797
7797
|
children: "Add"
|
|
7798
7798
|
})
|
|
7799
7799
|
]
|
|
7800
7800
|
})]
|
|
7801
7801
|
}),
|
|
7802
|
-
|
|
7802
|
+
Se.length > 0 && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("h4", { children: "Custom Lines" }), /* @__PURE__ */ d("div", {
|
|
7803
7803
|
className: "exit-list",
|
|
7804
|
-
children:
|
|
7804
|
+
children: Se.map(([e, t]) => {
|
|
7805
7805
|
let n = a.customLinesColor?.[e];
|
|
7806
7806
|
return /* @__PURE__ */ f("div", {
|
|
7807
7807
|
className: "customline-row",
|
|
@@ -7829,7 +7829,7 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7829
7829
|
/* @__PURE__ */ d("button", {
|
|
7830
7830
|
type: "button",
|
|
7831
7831
|
className: "customline-remove",
|
|
7832
|
-
onClick: () =>
|
|
7832
|
+
onClick: () => fe(e),
|
|
7833
7833
|
title: "Remove",
|
|
7834
7834
|
children: "✕"
|
|
7835
7835
|
})
|
|
@@ -7847,7 +7847,7 @@ function dn({ selection: n, room: a, map: o, sceneRef: s, pluginSections: c = []
|
|
|
7847
7847
|
/* @__PURE__ */ d(Fe, {
|
|
7848
7848
|
data: a.userData,
|
|
7849
7849
|
onCommit: (e, t, n) => {
|
|
7850
|
-
|
|
7850
|
+
X({
|
|
7851
7851
|
kind: "setUserDataEntry",
|
|
7852
7852
|
roomId: l,
|
|
7853
7853
|
key: e,
|
|
@@ -7871,25 +7871,25 @@ function fn(e) {
|
|
|
7871
7871
|
}
|
|
7872
7872
|
var pn = "system.fallback_symbol_color";
|
|
7873
7873
|
function mn({ selection: e, map: t, sceneRef: n }) {
|
|
7874
|
-
let r = e.ids, a = r.map((e) => t.rooms[e]).filter((e) => e != null), o = fn(a.map((e) => e.name ?? "")), s = fn(a.map((e) => e.symbol ?? "")), c = fn(a.map((e) => e.userData?.[pn] ?? null)), l = fn(a.map((e) => e.environment)), u = fn(a.map((e) => e.isLocked ?? !1)),
|
|
7874
|
+
let r = e.ids, a = r.map((e) => t.rooms[e]).filter((e) => e != null), o = fn(a.map((e) => e.name ?? "")), s = fn(a.map((e) => e.symbol ?? "")), c = fn(a.map((e) => e.userData?.[pn] ?? null)), l = fn(a.map((e) => e.environment)), u = fn(a.map((e) => e.isLocked ?? !1)), p = fn(a.map((e) => e.weight ?? 1)), [m, h] = i(!1), [g, _] = i(() => o.same ? o.value : ""), [v, y] = i(!1), [b, x] = i(() => s.same ? s.value : ""), [S, C] = i(!1), [w, T] = i(() => c.same && c.value !== null ? c.value : "#ffffff"), [E, O] = i(!1), [k, A] = i(() => l.same ? l.value : -1), [j, M] = i(!1), [N, P] = i(!1), [F, I] = i(() => u.same ? u.value : !1), [L, R] = i(!1), [z, B] = i(() => String(p.same ? p.value : 1)), V = m || v || S || E || N || L, H = () => {
|
|
7875
7875
|
let e = [];
|
|
7876
7876
|
for (let n of r) {
|
|
7877
7877
|
let r = t.rooms[n];
|
|
7878
7878
|
if (r) {
|
|
7879
|
-
if (
|
|
7879
|
+
if (m && g !== r.name && e.push({
|
|
7880
7880
|
kind: "setRoomField",
|
|
7881
7881
|
id: n,
|
|
7882
7882
|
field: "name",
|
|
7883
7883
|
from: r.name,
|
|
7884
|
-
to:
|
|
7885
|
-
}),
|
|
7884
|
+
to: g
|
|
7885
|
+
}), v && b !== r.symbol && e.push({
|
|
7886
7886
|
kind: "setRoomField",
|
|
7887
7887
|
id: n,
|
|
7888
7888
|
field: "symbol",
|
|
7889
7889
|
from: r.symbol,
|
|
7890
|
-
to:
|
|
7891
|
-
}),
|
|
7892
|
-
let t = r.userData?.[pn] ?? null, i =
|
|
7890
|
+
to: b
|
|
7891
|
+
}), S) {
|
|
7892
|
+
let t = r.userData?.[pn] ?? null, i = w;
|
|
7893
7893
|
t !== i && e.push({
|
|
7894
7894
|
kind: "setUserDataEntry",
|
|
7895
7895
|
roomId: n,
|
|
@@ -7898,24 +7898,33 @@ function mn({ selection: e, map: t, sceneRef: n }) {
|
|
|
7898
7898
|
to: i
|
|
7899
7899
|
});
|
|
7900
7900
|
}
|
|
7901
|
-
|
|
7901
|
+
if (E && k !== r.environment && e.push({
|
|
7902
7902
|
kind: "setRoomField",
|
|
7903
7903
|
id: n,
|
|
7904
7904
|
field: "environment",
|
|
7905
7905
|
from: r.environment,
|
|
7906
|
-
to:
|
|
7907
|
-
}),
|
|
7906
|
+
to: k
|
|
7907
|
+
}), N && F !== r.isLocked && e.push({
|
|
7908
7908
|
kind: "setRoomLock",
|
|
7909
7909
|
id: n,
|
|
7910
|
-
lock:
|
|
7911
|
-
})
|
|
7910
|
+
lock: F
|
|
7911
|
+
}), L) {
|
|
7912
|
+
let t = Math.max(1, parseInt(z, 10) || 1);
|
|
7913
|
+
t !== (r.weight ?? 1) && e.push({
|
|
7914
|
+
kind: "setRoomField",
|
|
7915
|
+
id: n,
|
|
7916
|
+
field: "weight",
|
|
7917
|
+
from: r.weight ?? 1,
|
|
7918
|
+
to: t
|
|
7919
|
+
});
|
|
7920
|
+
}
|
|
7912
7921
|
}
|
|
7913
7922
|
}
|
|
7914
|
-
e.length !== 0 && (
|
|
7923
|
+
e.length !== 0 && (X({
|
|
7915
7924
|
kind: "batch",
|
|
7916
7925
|
cmds: e
|
|
7917
7926
|
}, n.current), n.current?.refresh(), D.bumpData(), D.setState({ status: `Applied bulk edit to ${r.length} rooms` }));
|
|
7918
|
-
},
|
|
7927
|
+
}, ee = n.current?.reader.getColorValue(k) ?? "rgb(114,1,0)";
|
|
7919
7928
|
return /* @__PURE__ */ f("div", {
|
|
7920
7929
|
className: "panel-content",
|
|
7921
7930
|
children: [
|
|
@@ -7934,8 +7943,8 @@ function mn({ selection: e, map: t, sceneRef: n }) {
|
|
|
7934
7943
|
/* @__PURE__ */ d("input", {
|
|
7935
7944
|
type: "checkbox",
|
|
7936
7945
|
className: "multi-field-check",
|
|
7937
|
-
checked:
|
|
7938
|
-
onChange: (e) =>
|
|
7946
|
+
checked: m,
|
|
7947
|
+
onChange: (e) => h(e.target.checked),
|
|
7939
7948
|
title: "Enable name override"
|
|
7940
7949
|
}),
|
|
7941
7950
|
/* @__PURE__ */ f("span", {
|
|
@@ -7948,9 +7957,9 @@ function mn({ selection: e, map: t, sceneRef: n }) {
|
|
|
7948
7957
|
}),
|
|
7949
7958
|
/* @__PURE__ */ d("input", {
|
|
7950
7959
|
className: "multi-field-input",
|
|
7951
|
-
disabled: !
|
|
7952
|
-
value:
|
|
7953
|
-
onChange: (e) =>
|
|
7960
|
+
disabled: !m,
|
|
7961
|
+
value: g,
|
|
7962
|
+
onChange: (e) => _(e.target.value),
|
|
7954
7963
|
placeholder: o.same ? "" : "mixed"
|
|
7955
7964
|
})
|
|
7956
7965
|
]
|
|
@@ -7961,8 +7970,8 @@ function mn({ selection: e, map: t, sceneRef: n }) {
|
|
|
7961
7970
|
/* @__PURE__ */ d("input", {
|
|
7962
7971
|
type: "checkbox",
|
|
7963
7972
|
className: "multi-field-check",
|
|
7964
|
-
checked:
|
|
7965
|
-
onChange: (e) =>
|
|
7973
|
+
checked: v,
|
|
7974
|
+
onChange: (e) => y(e.target.checked),
|
|
7966
7975
|
title: "Enable symbol override"
|
|
7967
7976
|
}),
|
|
7968
7977
|
/* @__PURE__ */ f("span", {
|
|
@@ -7975,10 +7984,10 @@ function mn({ selection: e, map: t, sceneRef: n }) {
|
|
|
7975
7984
|
}),
|
|
7976
7985
|
/* @__PURE__ */ d("input", {
|
|
7977
7986
|
className: "multi-field-input multi-field-symbol",
|
|
7978
|
-
disabled: !
|
|
7979
|
-
value:
|
|
7987
|
+
disabled: !v,
|
|
7988
|
+
value: b,
|
|
7980
7989
|
maxLength: 4,
|
|
7981
|
-
onChange: (e) =>
|
|
7990
|
+
onChange: (e) => x(e.target.value),
|
|
7982
7991
|
placeholder: s.same ? "" : "mixed"
|
|
7983
7992
|
})
|
|
7984
7993
|
]
|
|
@@ -7989,8 +7998,8 @@ function mn({ selection: e, map: t, sceneRef: n }) {
|
|
|
7989
7998
|
/* @__PURE__ */ d("input", {
|
|
7990
7999
|
type: "checkbox",
|
|
7991
8000
|
className: "multi-field-check",
|
|
7992
|
-
checked:
|
|
7993
|
-
onChange: (e) =>
|
|
8001
|
+
checked: S,
|
|
8002
|
+
onChange: (e) => C(e.target.checked),
|
|
7994
8003
|
title: "Enable symbol color override"
|
|
7995
8004
|
}),
|
|
7996
8005
|
/* @__PURE__ */ f("span", {
|
|
@@ -8004,17 +8013,17 @@ function mn({ selection: e, map: t, sceneRef: n }) {
|
|
|
8004
8013
|
/* @__PURE__ */ d("input", {
|
|
8005
8014
|
type: "color",
|
|
8006
8015
|
className: "symbol-color-input",
|
|
8007
|
-
disabled: !
|
|
8008
|
-
value:
|
|
8009
|
-
onChange: (e) =>
|
|
8016
|
+
disabled: !S || w === null,
|
|
8017
|
+
value: w ?? "#ffffff",
|
|
8018
|
+
onChange: (e) => T(e.target.value)
|
|
8010
8019
|
}),
|
|
8011
8020
|
/* @__PURE__ */ d("button", {
|
|
8012
8021
|
type: "button",
|
|
8013
8022
|
className: "symbol-color-clear",
|
|
8014
|
-
disabled: !
|
|
8015
|
-
title:
|
|
8016
|
-
onClick: () =>
|
|
8017
|
-
children:
|
|
8023
|
+
disabled: !S,
|
|
8024
|
+
title: w === null ? "Restore: set a color instead of clearing" : "Clear: remove symbol color from all rooms",
|
|
8025
|
+
onClick: () => T((e) => e === null ? "#ffffff" : null),
|
|
8026
|
+
children: w === null ? "+" : "×"
|
|
8018
8027
|
})
|
|
8019
8028
|
]
|
|
8020
8029
|
}),
|
|
@@ -8024,8 +8033,8 @@ function mn({ selection: e, map: t, sceneRef: n }) {
|
|
|
8024
8033
|
/* @__PURE__ */ d("input", {
|
|
8025
8034
|
type: "checkbox",
|
|
8026
8035
|
className: "multi-field-check",
|
|
8027
|
-
checked:
|
|
8028
|
-
onChange: (e) =>
|
|
8036
|
+
checked: E,
|
|
8037
|
+
onChange: (e) => O(e.target.checked),
|
|
8029
8038
|
title: "Enable environment override"
|
|
8030
8039
|
}),
|
|
8031
8040
|
/* @__PURE__ */ f("span", {
|
|
@@ -8043,21 +8052,21 @@ function mn({ selection: e, map: t, sceneRef: n }) {
|
|
|
8043
8052
|
/* @__PURE__ */ d("button", {
|
|
8044
8053
|
type: "button",
|
|
8045
8054
|
className: "env-pick-btn",
|
|
8046
|
-
style: { background:
|
|
8047
|
-
disabled: !
|
|
8048
|
-
onClick: () =>
|
|
8049
|
-
title:
|
|
8055
|
+
style: { background: E ? ee : "rgba(80,80,90,0.5)" },
|
|
8056
|
+
disabled: !E,
|
|
8057
|
+
onClick: () => M((e) => !e),
|
|
8058
|
+
title: E ? `Env ${k} — click to change` : "Enable to set"
|
|
8050
8059
|
}),
|
|
8051
8060
|
/* @__PURE__ */ f("span", {
|
|
8052
8061
|
className: "env-id-label",
|
|
8053
|
-
children: ["#",
|
|
8062
|
+
children: ["#", k]
|
|
8054
8063
|
}),
|
|
8055
|
-
|
|
8064
|
+
j && E && /* @__PURE__ */ d(Qt, {
|
|
8056
8065
|
map: t,
|
|
8057
8066
|
sceneRef: n,
|
|
8058
|
-
currentEnvId:
|
|
8059
|
-
onSelect: (e) =>
|
|
8060
|
-
onClose: () =>
|
|
8067
|
+
currentEnvId: k,
|
|
8068
|
+
onSelect: (e) => A(e),
|
|
8069
|
+
onClose: () => M(!1)
|
|
8061
8070
|
})
|
|
8062
8071
|
]
|
|
8063
8072
|
})
|
|
@@ -8069,8 +8078,38 @@ function mn({ selection: e, map: t, sceneRef: n }) {
|
|
|
8069
8078
|
/* @__PURE__ */ d("input", {
|
|
8070
8079
|
type: "checkbox",
|
|
8071
8080
|
className: "multi-field-check",
|
|
8072
|
-
checked:
|
|
8073
|
-
onChange: (e) =>
|
|
8081
|
+
checked: L,
|
|
8082
|
+
onChange: (e) => R(e.target.checked),
|
|
8083
|
+
title: "Enable weight override"
|
|
8084
|
+
}),
|
|
8085
|
+
/* @__PURE__ */ f("span", {
|
|
8086
|
+
className: "multi-field-label",
|
|
8087
|
+
children: ["Weight", !p.same && /* @__PURE__ */ d("span", {
|
|
8088
|
+
className: "multi-field-mixed",
|
|
8089
|
+
title: "Rooms have different values",
|
|
8090
|
+
children: "~"
|
|
8091
|
+
})]
|
|
8092
|
+
}),
|
|
8093
|
+
/* @__PURE__ */ d("input", {
|
|
8094
|
+
type: "number",
|
|
8095
|
+
className: "multi-field-input multi-field-weight",
|
|
8096
|
+
disabled: !L,
|
|
8097
|
+
min: 1,
|
|
8098
|
+
value: z,
|
|
8099
|
+
onChange: (e) => B(e.target.value),
|
|
8100
|
+
onKeyDown: (e) => e.key === "Enter" && e.target.blur(),
|
|
8101
|
+
placeholder: p.same ? "" : "mixed"
|
|
8102
|
+
})
|
|
8103
|
+
]
|
|
8104
|
+
}),
|
|
8105
|
+
/* @__PURE__ */ f("div", {
|
|
8106
|
+
className: "multi-field-row",
|
|
8107
|
+
children: [
|
|
8108
|
+
/* @__PURE__ */ d("input", {
|
|
8109
|
+
type: "checkbox",
|
|
8110
|
+
className: "multi-field-check",
|
|
8111
|
+
checked: N,
|
|
8112
|
+
onChange: (e) => P(e.target.checked),
|
|
8074
8113
|
title: "Enable lock override"
|
|
8075
8114
|
}),
|
|
8076
8115
|
/* @__PURE__ */ f("span", {
|
|
@@ -8083,11 +8122,11 @@ function mn({ selection: e, map: t, sceneRef: n }) {
|
|
|
8083
8122
|
}),
|
|
8084
8123
|
/* @__PURE__ */ d("button", {
|
|
8085
8124
|
type: "button",
|
|
8086
|
-
className: `multi-lock-btn${
|
|
8087
|
-
disabled: !
|
|
8088
|
-
title:
|
|
8089
|
-
onClick: () =>
|
|
8090
|
-
children: /* @__PURE__ */ d(en, { locked:
|
|
8125
|
+
className: `multi-lock-btn${F ? " lock-active" : ""}`,
|
|
8126
|
+
disabled: !N,
|
|
8127
|
+
title: F ? "Locked — click to set unlocked" : "Unlocked — click to set locked",
|
|
8128
|
+
onClick: () => I((e) => !e),
|
|
8129
|
+
children: /* @__PURE__ */ d(en, { locked: F })
|
|
8091
8130
|
})
|
|
8092
8131
|
]
|
|
8093
8132
|
})
|
|
@@ -8098,14 +8137,14 @@ function mn({ selection: e, map: t, sceneRef: n }) {
|
|
|
8098
8137
|
children: [/* @__PURE__ */ f("button", {
|
|
8099
8138
|
type: "button",
|
|
8100
8139
|
className: "multi-room-apply-btn",
|
|
8101
|
-
disabled: !
|
|
8102
|
-
onClick:
|
|
8140
|
+
disabled: !V,
|
|
8141
|
+
onClick: H,
|
|
8103
8142
|
children: [
|
|
8104
8143
|
"Apply to ",
|
|
8105
8144
|
r.length,
|
|
8106
8145
|
" rooms"
|
|
8107
8146
|
]
|
|
8108
|
-
}),
|
|
8147
|
+
}), V && /* @__PURE__ */ f("p", {
|
|
8109
8148
|
className: "multi-room-warning",
|
|
8110
8149
|
children: [
|
|
8111
8150
|
"This will overwrite the checked properties on all ",
|
|
@@ -8344,7 +8383,7 @@ function _n({ sceneRef: e }) {
|
|
|
8344
8383
|
g: 255,
|
|
8345
8384
|
b: 255
|
|
8346
8385
|
}, o = r.customLinesStyle?.[n.exitName] ?? 1, s = r.customLinesArrow?.[n.exitName] ?? !1, c = i.filter((e, t) => t !== n.pointIndex);
|
|
8347
|
-
|
|
8386
|
+
X({
|
|
8348
8387
|
kind: "setCustomLine",
|
|
8349
8388
|
roomId: n.roomId,
|
|
8350
8389
|
exitName: n.exitName,
|
|
@@ -8512,7 +8551,7 @@ function _n({ sceneRef: e }) {
|
|
|
8512
8551
|
onClick: () => {
|
|
8513
8552
|
if (!c || !t) return;
|
|
8514
8553
|
let r = parseInt(c.x, 10), i = parseInt(c.y, 10), a = parseInt(c.z, 10);
|
|
8515
|
-
isNaN(r) || isNaN(i) || isNaN(a) || ((r !== t.pos[0] || i !== t.pos[1] || a !== t.pos[2]) && (
|
|
8554
|
+
isNaN(r) || isNaN(i) || isNaN(a) || ((r !== t.pos[0] || i !== t.pos[1] || a !== t.pos[2]) && (X({
|
|
8516
8555
|
kind: "moveLabel",
|
|
8517
8556
|
areaId: n.areaId,
|
|
8518
8557
|
id: n.labelId,
|
|
@@ -8562,7 +8601,7 @@ function _n({ sceneRef: e }) {
|
|
|
8562
8601
|
className: "context-menu-item danger",
|
|
8563
8602
|
onClick: () => {
|
|
8564
8603
|
if (!t) return p();
|
|
8565
|
-
|
|
8604
|
+
X({
|
|
8566
8605
|
kind: "deleteLabel",
|
|
8567
8606
|
areaId: n.areaId,
|
|
8568
8607
|
label: t
|
|
@@ -8591,7 +8630,7 @@ function _n({ sceneRef: e }) {
|
|
|
8591
8630
|
if (!t.map) return p();
|
|
8592
8631
|
if (y) {
|
|
8593
8632
|
let n = je(t.map, y);
|
|
8594
|
-
|
|
8633
|
+
X({
|
|
8595
8634
|
kind: "batch",
|
|
8596
8635
|
cmds: y.map((e) => {
|
|
8597
8636
|
let r = t.map.rooms[e];
|
|
@@ -8613,7 +8652,7 @@ function _n({ sceneRef: e }) {
|
|
|
8613
8652
|
let r = t.map.rooms[n.roomId];
|
|
8614
8653
|
if (!r) return p();
|
|
8615
8654
|
let i = { ...r }, a = Ae(t.map, n.roomId);
|
|
8616
|
-
|
|
8655
|
+
X({
|
|
8617
8656
|
kind: "deleteRoom",
|
|
8618
8657
|
id: n.roomId,
|
|
8619
8658
|
room: i,
|
|
@@ -8680,7 +8719,7 @@ function _n({ sceneRef: e }) {
|
|
|
8680
8719
|
}
|
|
8681
8720
|
}), a.push(...ke(h.map, n.roomId, e, s));
|
|
8682
8721
|
}
|
|
8683
|
-
a.length > 0 && (
|
|
8722
|
+
a.length > 0 && (Ee(a, e.current), e.current?.refresh(), D.bumpStructure(), D.setState({ status: y ? `Moved ${y.length} rooms to area ${o.areaId} (${t}, ${r}, ${i})` : `Moved room ${n.roomId} to area ${o.areaId} (${t}, ${r}, ${i})` }));
|
|
8684
8723
|
let s = o.areaId !== (h.currentAreaId ?? g.area), c = i !== h.currentZ;
|
|
8685
8724
|
D.setState({
|
|
8686
8725
|
contextMenu: null,
|
|
@@ -8848,7 +8887,7 @@ function Sn(e) {
|
|
|
8848
8887
|
return t;
|
|
8849
8888
|
}
|
|
8850
8889
|
async function Cn(e, t, n, r, i, a) {
|
|
8851
|
-
let o =
|
|
8890
|
+
let o = U(t), s = o.buffer.slice(o.byteOffset, o.byteOffset + o.byteLength), c = a ?? crypto.randomUUID(), l = {
|
|
8852
8891
|
id: c,
|
|
8853
8892
|
fileName: e,
|
|
8854
8893
|
mapBytes: s,
|
|
@@ -8902,7 +8941,7 @@ async function En(e) {
|
|
|
8902
8941
|
});
|
|
8903
8942
|
}
|
|
8904
8943
|
function Dn(e) {
|
|
8905
|
-
let t =
|
|
8944
|
+
let t = re(e.mapBytes);
|
|
8906
8945
|
if (Object.keys(e.imageSrcs).length > 0) for (let n of Object.values(t.labels)) for (let t of n) {
|
|
8907
8946
|
let n = e.imageSrcs[String(t.id)];
|
|
8908
8947
|
n && (t.imageSrc = n);
|
|
@@ -9095,46 +9134,46 @@ function Nn({ sceneRef: e }) {
|
|
|
9095
9134
|
};
|
|
9096
9135
|
return window.addEventListener("editor:swatchRoomPicked", e), () => window.removeEventListener("editor:swatchRoomPicked", e);
|
|
9097
9136
|
}, []);
|
|
9098
|
-
let
|
|
9137
|
+
let z = (t) => {
|
|
9099
9138
|
let n = e.current?.reader;
|
|
9100
9139
|
return n ? n.getColorValue(t) : "rgb(114,1,0)";
|
|
9101
|
-
},
|
|
9140
|
+
}, B = (e, t, n) => {
|
|
9102
9141
|
let r = t === void 0 ? o : t, i = n === void 0 ? s : n;
|
|
9103
9142
|
D.setState({
|
|
9104
9143
|
swatchSets: e,
|
|
9105
9144
|
activeSwatchSetId: r,
|
|
9106
9145
|
activeSwatchId: i
|
|
9107
9146
|
}), w(e, r, i);
|
|
9108
|
-
},
|
|
9147
|
+
}, V = () => {
|
|
9109
9148
|
let e = v.trim() || "New Set", t = crypto.randomUUID();
|
|
9110
|
-
|
|
9149
|
+
B([...n, {
|
|
9111
9150
|
id: t,
|
|
9112
9151
|
name: e,
|
|
9113
9152
|
swatches: []
|
|
9114
9153
|
}], t, null), y(""), _(!1);
|
|
9115
|
-
},
|
|
9116
|
-
R &&
|
|
9154
|
+
}, H = (e) => {
|
|
9155
|
+
R && B(n.map((t) => t.id === R.id ? {
|
|
9117
9156
|
...t,
|
|
9118
9157
|
name: e
|
|
9119
9158
|
} : t));
|
|
9120
|
-
},
|
|
9159
|
+
}, ee = () => {
|
|
9121
9160
|
if (!R || n.length <= 1 || !window.confirm(`Delete set "${R.name}"?`)) return;
|
|
9122
9161
|
let e = n.filter((e) => e.id !== R.id);
|
|
9123
|
-
|
|
9124
|
-
},
|
|
9162
|
+
B(e, e[0]?.id ?? null, null);
|
|
9163
|
+
}, te = (e) => {
|
|
9125
9164
|
D.setState({
|
|
9126
9165
|
activeSwatchSetId: e,
|
|
9127
9166
|
activeSwatchId: null
|
|
9128
9167
|
}), w(n, e, null);
|
|
9129
|
-
},
|
|
9168
|
+
}, ne = (e) => {
|
|
9130
9169
|
D.setState({ activeSwatchId: e }), w(n, o, e);
|
|
9131
|
-
},
|
|
9170
|
+
}, re = (e) => {
|
|
9132
9171
|
E(e.id), A(e.name), M(e.symbol), P(e.environment), I(!1);
|
|
9133
|
-
}, H = () => {
|
|
9134
|
-
E("new"), A(""), M(""), P(-1), I(!1);
|
|
9135
9172
|
}, U = () => {
|
|
9136
|
-
E(
|
|
9173
|
+
E("new"), A(""), M(""), P(-1), I(!1);
|
|
9137
9174
|
}, W = () => {
|
|
9175
|
+
E(null), I(!1);
|
|
9176
|
+
}, G = () => {
|
|
9138
9177
|
if (!R || !T) return;
|
|
9139
9178
|
let e = k.trim() || "Swatch", t = j.slice(0, 4);
|
|
9140
9179
|
if (T === "new") {
|
|
@@ -9144,11 +9183,11 @@ function Nn({ sceneRef: e }) {
|
|
|
9144
9183
|
symbol: t,
|
|
9145
9184
|
environment: N
|
|
9146
9185
|
};
|
|
9147
|
-
|
|
9186
|
+
B(n.map((e) => e.id === R.id ? {
|
|
9148
9187
|
...e,
|
|
9149
9188
|
swatches: [...e.swatches, i]
|
|
9150
9189
|
} : e), o, r);
|
|
9151
|
-
} else
|
|
9190
|
+
} else B(n.map((n) => n.id === R.id ? {
|
|
9152
9191
|
...n,
|
|
9153
9192
|
swatches: n.swatches.map((n) => n.id === T ? {
|
|
9154
9193
|
...n,
|
|
@@ -9158,8 +9197,8 @@ function Nn({ sceneRef: e }) {
|
|
|
9158
9197
|
} : n)
|
|
9159
9198
|
} : n));
|
|
9160
9199
|
E(null), I(!1);
|
|
9161
|
-
},
|
|
9162
|
-
R &&
|
|
9200
|
+
}, K = (e) => {
|
|
9201
|
+
R && B(n.map((t) => t.id === R.id ? {
|
|
9163
9202
|
...t,
|
|
9164
9203
|
swatches: t.swatches.filter((t) => t.id !== e)
|
|
9165
9204
|
} : t), void 0, s === e ? null : void 0);
|
|
@@ -9202,7 +9241,7 @@ function Nn({ sceneRef: e }) {
|
|
|
9202
9241
|
value: S,
|
|
9203
9242
|
onChange: (e) => C(e.target.value),
|
|
9204
9243
|
onKeyDown: (e) => {
|
|
9205
|
-
e.key === "Enter" && (
|
|
9244
|
+
e.key === "Enter" && (H(S), x(!1)), e.key === "Escape" && x(!1);
|
|
9206
9245
|
},
|
|
9207
9246
|
autoFocus: !0
|
|
9208
9247
|
}),
|
|
@@ -9210,7 +9249,7 @@ function Nn({ sceneRef: e }) {
|
|
|
9210
9249
|
type: "button",
|
|
9211
9250
|
className: "swatch-icon-btn",
|
|
9212
9251
|
onClick: () => {
|
|
9213
|
-
|
|
9252
|
+
H(S), x(!1);
|
|
9214
9253
|
},
|
|
9215
9254
|
children: "✓"
|
|
9216
9255
|
}),
|
|
@@ -9223,7 +9262,7 @@ function Nn({ sceneRef: e }) {
|
|
|
9223
9262
|
] }) : /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("select", {
|
|
9224
9263
|
className: "swatch-set-select",
|
|
9225
9264
|
value: R?.id ?? "",
|
|
9226
|
-
onChange: (e) =>
|
|
9265
|
+
onChange: (e) => te(e.target.value),
|
|
9227
9266
|
children: L.map((e) => /* @__PURE__ */ d("option", {
|
|
9228
9267
|
value: e.id,
|
|
9229
9268
|
children: e.name
|
|
@@ -9241,7 +9280,7 @@ function Nn({ sceneRef: e }) {
|
|
|
9241
9280
|
className: "swatch-icon-btn swatch-icon-btn-danger",
|
|
9242
9281
|
title: "Delete set",
|
|
9243
9282
|
disabled: n.length <= 1,
|
|
9244
|
-
onClick:
|
|
9283
|
+
onClick: ee,
|
|
9245
9284
|
children: "🗑"
|
|
9246
9285
|
})] })] }), g ? /* @__PURE__ */ f(u, { children: [
|
|
9247
9286
|
/* @__PURE__ */ d("input", {
|
|
@@ -9250,14 +9289,14 @@ function Nn({ sceneRef: e }) {
|
|
|
9250
9289
|
value: v,
|
|
9251
9290
|
onChange: (e) => y(e.target.value),
|
|
9252
9291
|
onKeyDown: (e) => {
|
|
9253
|
-
e.key === "Enter" &&
|
|
9292
|
+
e.key === "Enter" && V(), e.key === "Escape" && (_(!1), y(""));
|
|
9254
9293
|
},
|
|
9255
9294
|
autoFocus: !0
|
|
9256
9295
|
}),
|
|
9257
9296
|
/* @__PURE__ */ d("button", {
|
|
9258
9297
|
type: "button",
|
|
9259
9298
|
className: "swatch-icon-btn",
|
|
9260
|
-
onClick:
|
|
9299
|
+
onClick: V,
|
|
9261
9300
|
children: "✓"
|
|
9262
9301
|
}),
|
|
9263
9302
|
/* @__PURE__ */ d("button", {
|
|
@@ -9280,12 +9319,12 @@ function Nn({ sceneRef: e }) {
|
|
|
9280
9319
|
className: "swatch-grid",
|
|
9281
9320
|
children: [R.swatches.map((e) => /* @__PURE__ */ f("div", {
|
|
9282
9321
|
className: `swatch-chip${s === e.id ? " active" : ""}${T === e.id ? " editing" : ""}`,
|
|
9283
|
-
onClick: () =>
|
|
9322
|
+
onClick: () => ne(e.id),
|
|
9284
9323
|
title: `${e.name} · env ${e.environment}${e.symbol ? ` · "${e.symbol}"` : ""}`,
|
|
9285
9324
|
children: [
|
|
9286
9325
|
/* @__PURE__ */ d("span", {
|
|
9287
9326
|
className: "swatch-chip-env",
|
|
9288
|
-
style: { background:
|
|
9327
|
+
style: { background: z(e.environment) }
|
|
9289
9328
|
}),
|
|
9290
9329
|
e.symbol && /* @__PURE__ */ d("span", {
|
|
9291
9330
|
className: "swatch-chip-symbol",
|
|
@@ -9300,7 +9339,7 @@ function Nn({ sceneRef: e }) {
|
|
|
9300
9339
|
className: "swatch-chip-edit",
|
|
9301
9340
|
title: "Edit",
|
|
9302
9341
|
onClick: (t) => {
|
|
9303
|
-
t.stopPropagation(),
|
|
9342
|
+
t.stopPropagation(), re(e);
|
|
9304
9343
|
},
|
|
9305
9344
|
children: "✏"
|
|
9306
9345
|
}), /* @__PURE__ */ d("button", {
|
|
@@ -9308,7 +9347,7 @@ function Nn({ sceneRef: e }) {
|
|
|
9308
9347
|
className: "swatch-chip-del",
|
|
9309
9348
|
title: "Delete",
|
|
9310
9349
|
onClick: (t) => {
|
|
9311
|
-
t.stopPropagation(),
|
|
9350
|
+
t.stopPropagation(), K(e.id);
|
|
9312
9351
|
},
|
|
9313
9352
|
children: "×"
|
|
9314
9353
|
})] })
|
|
@@ -9317,7 +9356,7 @@ function Nn({ sceneRef: e }) {
|
|
|
9317
9356
|
type: "button",
|
|
9318
9357
|
className: "swatch-add-btn",
|
|
9319
9358
|
title: "Add swatch",
|
|
9320
|
-
onClick:
|
|
9359
|
+
onClick: U,
|
|
9321
9360
|
children: "+"
|
|
9322
9361
|
})]
|
|
9323
9362
|
}),
|
|
@@ -9338,7 +9377,7 @@ function Nn({ sceneRef: e }) {
|
|
|
9338
9377
|
value: k,
|
|
9339
9378
|
onChange: (e) => A(e.target.value),
|
|
9340
9379
|
onKeyDown: (e) => {
|
|
9341
|
-
e.key === "Enter" &&
|
|
9380
|
+
e.key === "Enter" && G(), e.key === "Escape" && W();
|
|
9342
9381
|
},
|
|
9343
9382
|
autoFocus: !0
|
|
9344
9383
|
}),
|
|
@@ -9349,7 +9388,7 @@ function Nn({ sceneRef: e }) {
|
|
|
9349
9388
|
value: j,
|
|
9350
9389
|
onChange: (e) => M(e.target.value),
|
|
9351
9390
|
onKeyDown: (e) => {
|
|
9352
|
-
e.key === "Enter" &&
|
|
9391
|
+
e.key === "Enter" && G(), e.key === "Escape" && W();
|
|
9353
9392
|
}
|
|
9354
9393
|
}),
|
|
9355
9394
|
/* @__PURE__ */ f("div", {
|
|
@@ -9357,7 +9396,7 @@ function Nn({ sceneRef: e }) {
|
|
|
9357
9396
|
children: [/* @__PURE__ */ d("button", {
|
|
9358
9397
|
type: "button",
|
|
9359
9398
|
className: "swatch-env-btn",
|
|
9360
|
-
style: { background:
|
|
9399
|
+
style: { background: z(N) },
|
|
9361
9400
|
title: `Env ${N === -1 ? "none" : N} — click to change`,
|
|
9362
9401
|
onClick: () => I((e) => !e),
|
|
9363
9402
|
children: /* @__PURE__ */ d("span", {
|
|
@@ -9385,14 +9424,14 @@ function Nn({ sceneRef: e }) {
|
|
|
9385
9424
|
type: "button",
|
|
9386
9425
|
className: "swatch-edit-ok",
|
|
9387
9426
|
title: "Save",
|
|
9388
|
-
onClick:
|
|
9427
|
+
onClick: G,
|
|
9389
9428
|
children: "✓"
|
|
9390
9429
|
}),
|
|
9391
9430
|
/* @__PURE__ */ d("button", {
|
|
9392
9431
|
type: "button",
|
|
9393
9432
|
className: "swatch-edit-cancel",
|
|
9394
9433
|
title: "Cancel",
|
|
9395
|
-
onClick:
|
|
9434
|
+
onClick: W,
|
|
9396
9435
|
children: "✕"
|
|
9397
9436
|
})
|
|
9398
9437
|
]
|
|
@@ -9796,7 +9835,7 @@ function In({ sceneRef: e }) {
|
|
|
9796
9835
|
}
|
|
9797
9836
|
}), d.push(...ke(t.map, e, f - o.x, p - o.y)));
|
|
9798
9837
|
}
|
|
9799
|
-
d.length > 0 && (
|
|
9838
|
+
d.length > 0 && (Ee(d, r), r.refresh(), D.bumpStructure(), D.setState({ status: `${o === "spread" ? "Spread" : "Shrunk"} ${i.length} rooms (×${s.toFixed(2)})` })), D.setState({ spreadShrink: null });
|
|
9800
9839
|
},
|
|
9801
9840
|
children: "Apply"
|
|
9802
9841
|
})]
|
|
@@ -9868,7 +9907,7 @@ function Rn(e, t) {
|
|
|
9868
9907
|
}), Object.defineProperty(n, "exits", {
|
|
9869
9908
|
get() {
|
|
9870
9909
|
let e = {};
|
|
9871
|
-
for (let n of
|
|
9910
|
+
for (let n of fe) {
|
|
9872
9911
|
let r = t[n];
|
|
9873
9912
|
r !== void 0 && r !== -1 && (e[n] = r);
|
|
9874
9913
|
}
|
|
@@ -10000,8 +10039,8 @@ function Hn(e, t) {
|
|
|
10000
10039
|
if (t.length >= 4) {
|
|
10001
10040
|
let n = parseInt(t[1], 10), r = parseInt(t[2], 10), i = r < 100 ? r >= 63 : r >= 600;
|
|
10002
10041
|
e.font = {
|
|
10003
|
-
family: t[0] ||
|
|
10004
|
-
size: isNaN(n) || n <= 0 ?
|
|
10042
|
+
family: t[0] || de.family,
|
|
10043
|
+
size: isNaN(n) || n <= 0 ? de.size : n,
|
|
10005
10044
|
bold: i,
|
|
10006
10045
|
italic: t[3] === "1",
|
|
10007
10046
|
underline: !1,
|
|
@@ -10042,7 +10081,7 @@ function Wn(e) {
|
|
|
10042
10081
|
bgColor: { ...e.bgColor },
|
|
10043
10082
|
noScaling: e.noScaling ?? !1,
|
|
10044
10083
|
showOnTop: e.showOnTop ?? !1,
|
|
10045
|
-
font: e.font ? { ...e.font } : { ...
|
|
10084
|
+
font: e.font ? { ...e.font } : { ...de },
|
|
10046
10085
|
outlineColor: e.outlineColor ? { ...e.outlineColor } : void 0,
|
|
10047
10086
|
pixMap: e.pixMapBase64 ? `data:image/png;base64,${e.pixMapBase64}` : "",
|
|
10048
10087
|
imageSrc: e.imageSrc
|
|
@@ -10180,7 +10219,7 @@ var Jn = {
|
|
|
10180
10219
|
colors = {};
|
|
10181
10220
|
constructor(e) {
|
|
10182
10221
|
this.raw = e;
|
|
10183
|
-
let { colors: t } =
|
|
10222
|
+
let { colors: t } = W(e);
|
|
10184
10223
|
for (let e of t) this.colors[e.envId] = {
|
|
10185
10224
|
rgb: e.colors,
|
|
10186
10225
|
rgbValue: `rgb(${e.colors.join(",")})`,
|
|
@@ -10328,7 +10367,7 @@ var Jn = {
|
|
|
10328
10367
|
setDoor(e, t, n) {
|
|
10329
10368
|
let r = this.raw.rooms[e];
|
|
10330
10369
|
if (!r) return;
|
|
10331
|
-
let i =
|
|
10370
|
+
let i = q[t];
|
|
10332
10371
|
n === 0 ? delete r.doors[i] : r.doors[i] = n, this.areas[r.area]?.markDirty();
|
|
10333
10372
|
}
|
|
10334
10373
|
setSpecialExitDoor(e, t, n) {
|
|
@@ -10338,7 +10377,7 @@ var Jn = {
|
|
|
10338
10377
|
setExitWeight(e, t, n) {
|
|
10339
10378
|
let r = this.raw.rooms[e];
|
|
10340
10379
|
if (!r) return;
|
|
10341
|
-
let i =
|
|
10380
|
+
let i = q[t];
|
|
10342
10381
|
n <= 1 ? delete r.exitWeights[i] : r.exitWeights[i] = n, this.areas[r.area]?.markDirty();
|
|
10343
10382
|
}
|
|
10344
10383
|
setSpecialExitWeight(e, t, n) {
|
|
@@ -10348,7 +10387,7 @@ var Jn = {
|
|
|
10348
10387
|
setExitLock(e, t, n) {
|
|
10349
10388
|
let r = this.raw.rooms[e];
|
|
10350
10389
|
if (!r) return;
|
|
10351
|
-
let i =
|
|
10390
|
+
let i = J[t];
|
|
10352
10391
|
if (n) r.exitLocks.includes(i) || r.exitLocks.push(i);
|
|
10353
10392
|
else {
|
|
10354
10393
|
let e = r.exitLocks.indexOf(i);
|
|
@@ -10359,7 +10398,7 @@ var Jn = {
|
|
|
10359
10398
|
setStub(e, t, n) {
|
|
10360
10399
|
let r = this.raw.rooms[e];
|
|
10361
10400
|
if (!r) return;
|
|
10362
|
-
let i =
|
|
10401
|
+
let i = J[t];
|
|
10363
10402
|
if (n) r.stubs.includes(i) || r.stubs.push(i);
|
|
10364
10403
|
else {
|
|
10365
10404
|
let e = r.stubs.indexOf(i);
|
|
@@ -10434,7 +10473,7 @@ var Jn = {
|
|
|
10434
10473
|
}
|
|
10435
10474
|
setCustomEnvColor(e, t) {
|
|
10436
10475
|
t === null ? delete this.raw.mCustomEnvColors[e] : this.raw.mCustomEnvColors[e] = t;
|
|
10437
|
-
let { colors: n } =
|
|
10476
|
+
let { colors: n } = W(this.raw);
|
|
10438
10477
|
for (let e of n) this.colors[e.envId] = {
|
|
10439
10478
|
rgb: e.colors,
|
|
10440
10479
|
rgbValue: `rgb(${e.colors.join(",")})`,
|
|
@@ -10560,7 +10599,7 @@ var Jn = {
|
|
|
10560
10599
|
if (!t) return;
|
|
10561
10600
|
for (let t of Object.keys(this.raw.rooms)) {
|
|
10562
10601
|
let n = this.raw.rooms[Number(t)];
|
|
10563
|
-
if (n) for (let t of
|
|
10602
|
+
if (n) for (let t of fe) n[t] === e && (n[t] = -1);
|
|
10564
10603
|
}
|
|
10565
10604
|
let n = t.area;
|
|
10566
10605
|
delete this.raw.rooms[e];
|
|
@@ -10812,11 +10851,11 @@ var ir = class {
|
|
|
10812
10851
|
} else i ? (c = i.x, l = i.y) : (c = t.cursorMap?.x ?? r.x, l = t.cursorMap?.y ?? r.y);
|
|
10813
10852
|
let u = !0, d = "";
|
|
10814
10853
|
if (i && i !== r) {
|
|
10815
|
-
let n = t.sourceDir ??
|
|
10816
|
-
if (!
|
|
10854
|
+
let n = t.sourceDir ?? xe(r.x, r.y, i.x, i.y);
|
|
10855
|
+
if (!Ce(n)) u = !1, d = `${n}?`;
|
|
10817
10856
|
else {
|
|
10818
|
-
d = `${n} / ${t.targetDir ??
|
|
10819
|
-
let r = e.map.rooms[t.sourceId], i = r ?
|
|
10857
|
+
d = `${n} / ${t.targetDir ?? pe[n]}`;
|
|
10858
|
+
let r = e.map.rooms[t.sourceId], i = r ? Y(r, n) : -1;
|
|
10820
10859
|
i !== -1 && i !== t.hoverTargetId && (u = !1);
|
|
10821
10860
|
}
|
|
10822
10861
|
}
|
|
@@ -11048,9 +11087,9 @@ var ir = class {
|
|
|
11048
11087
|
if (!r || !i) return null;
|
|
11049
11088
|
let a = i.rooms[t];
|
|
11050
11089
|
if (!a) return null;
|
|
11051
|
-
let o, s =
|
|
11090
|
+
let o, s = ge[n];
|
|
11052
11091
|
if (s) {
|
|
11053
|
-
let e =
|
|
11092
|
+
let e = Y(a, s);
|
|
11054
11093
|
e > 0 && (o = e);
|
|
11055
11094
|
} else {
|
|
11056
11095
|
let e = a.mSpecialExits?.[n];
|
|
@@ -11829,11 +11868,11 @@ function Or({ plugins: a = [], title: o = "Mudlet Map Editor" }) {
|
|
|
11829
11868
|
return;
|
|
11830
11869
|
}
|
|
11831
11870
|
if ((t.ctrlKey || t.metaKey) && !t.shiftKey && t.key.toLowerCase() === "z") {
|
|
11832
|
-
t.preventDefault(),
|
|
11871
|
+
t.preventDefault(), B();
|
|
11833
11872
|
return;
|
|
11834
11873
|
}
|
|
11835
11874
|
if ((t.ctrlKey || t.metaKey) && (t.shiftKey && t.key.toLowerCase() === "z" || t.key.toLowerCase() === "y")) {
|
|
11836
|
-
t.preventDefault(),
|
|
11875
|
+
t.preventDefault(), V();
|
|
11837
11876
|
return;
|
|
11838
11877
|
}
|
|
11839
11878
|
if (t.key === "Enter") {
|
|
@@ -11851,7 +11890,7 @@ function Or({ plugins: a = [], title: o = "Mudlet Map Editor" }) {
|
|
|
11851
11890
|
return;
|
|
11852
11891
|
}
|
|
11853
11892
|
if (t.key === "Delete" || t.key === "Backspace") {
|
|
11854
|
-
|
|
11893
|
+
z();
|
|
11855
11894
|
return;
|
|
11856
11895
|
}
|
|
11857
11896
|
if (t.key === "g" || t.key === "G") {
|
|
@@ -11946,8 +11985,8 @@ function Or({ plugins: a = [], title: o = "Mudlet Map Editor" }) {
|
|
|
11946
11985
|
};
|
|
11947
11986
|
window.addEventListener("keydown", r), window.addEventListener("keyup", t), window.addEventListener("blur", n);
|
|
11948
11987
|
let i = () => c.current?.renderer.fitArea(Tr);
|
|
11949
|
-
return window.addEventListener("editor:undo",
|
|
11950
|
-
window.removeEventListener("keydown", r), window.removeEventListener("keyup", t), window.removeEventListener("blur", n), window.removeEventListener("editor:undo",
|
|
11988
|
+
return window.addEventListener("editor:undo", B), window.addEventListener("editor:redo", V), window.addEventListener("editor:fit", i), () => {
|
|
11989
|
+
window.removeEventListener("keydown", r), window.removeEventListener("keyup", t), window.removeEventListener("blur", n), window.removeEventListener("editor:undo", B), window.removeEventListener("editor:redo", V), window.removeEventListener("editor:fit", i);
|
|
11951
11990
|
};
|
|
11952
11991
|
}, []), t(() => {
|
|
11953
11992
|
let e = (e) => {
|
|
@@ -11955,13 +11994,13 @@ function Or({ plugins: a = [], title: o = "Mudlet Map Editor" }) {
|
|
|
11955
11994
|
}, t = (e) => {
|
|
11956
11995
|
e.preventDefault();
|
|
11957
11996
|
let t = Array.from(e.dataTransfer?.files ?? []).find((e) => e.name.endsWith(".dat"));
|
|
11958
|
-
t &&
|
|
11997
|
+
t && ie(t);
|
|
11959
11998
|
};
|
|
11960
11999
|
return window.addEventListener("dragover", e), window.addEventListener("drop", t), () => {
|
|
11961
12000
|
window.removeEventListener("dragover", e), window.removeEventListener("drop", t);
|
|
11962
12001
|
};
|
|
11963
12002
|
}, []);
|
|
11964
|
-
let
|
|
12003
|
+
let z = () => {
|
|
11965
12004
|
let e = D.getState();
|
|
11966
12005
|
if (!e.map) return;
|
|
11967
12006
|
let t = e.selection;
|
|
@@ -11981,7 +12020,7 @@ function Or({ plugins: a = [], title: o = "Mudlet Map Editor" }) {
|
|
|
11981
12020
|
});
|
|
11982
12021
|
}
|
|
11983
12022
|
if (r.length === 0) return;
|
|
11984
|
-
|
|
12023
|
+
X({
|
|
11985
12024
|
kind: "batch",
|
|
11986
12025
|
cmds: r
|
|
11987
12026
|
}, c.current), c.current?.refresh(), D.setState({
|
|
@@ -11993,7 +12032,7 @@ function Or({ plugins: a = [], title: o = "Mudlet Map Editor" }) {
|
|
|
11993
12032
|
let n = t.ids[0], r = e.map.rooms[n];
|
|
11994
12033
|
if (!r) return;
|
|
11995
12034
|
let i = { ...r }, a = Ae(e.map, n);
|
|
11996
|
-
|
|
12035
|
+
X({
|
|
11997
12036
|
kind: "deleteRoom",
|
|
11998
12037
|
id: n,
|
|
11999
12038
|
room: i,
|
|
@@ -12022,7 +12061,7 @@ function Or({ plugins: a = [], title: o = "Mudlet Map Editor" }) {
|
|
|
12022
12061
|
in: "out",
|
|
12023
12062
|
out: "in"
|
|
12024
12063
|
}[t.dir], a = r[i] === t.fromId;
|
|
12025
|
-
|
|
12064
|
+
X({
|
|
12026
12065
|
kind: "removeExit",
|
|
12027
12066
|
fromId: t.fromId,
|
|
12028
12067
|
dir: t.dir,
|
|
@@ -12050,7 +12089,7 @@ function Or({ plugins: a = [], title: o = "Mudlet Map Editor" }) {
|
|
|
12050
12089
|
}, a = n.customLinesStyle?.[t.exitName] ?? 1, o = n.customLinesArrow?.[t.exitName] ?? !1;
|
|
12051
12090
|
if (t.pointIndex != null && t.pointIndex >= 0 && t.pointIndex < r.length) {
|
|
12052
12091
|
let e = r.filter((e, n) => n !== t.pointIndex);
|
|
12053
|
-
|
|
12092
|
+
X({
|
|
12054
12093
|
kind: "setCustomLine",
|
|
12055
12094
|
roomId: t.roomId,
|
|
12056
12095
|
exitName: t.exitName,
|
|
@@ -12076,7 +12115,7 @@ function Or({ plugins: a = [], title: o = "Mudlet Map Editor" }) {
|
|
|
12076
12115
|
});
|
|
12077
12116
|
return;
|
|
12078
12117
|
}
|
|
12079
|
-
|
|
12118
|
+
X({
|
|
12080
12119
|
kind: "removeCustomLine",
|
|
12081
12120
|
roomId: t.roomId,
|
|
12082
12121
|
exitName: t.exitName,
|
|
@@ -12095,7 +12134,7 @@ function Or({ plugins: a = [], title: o = "Mudlet Map Editor" }) {
|
|
|
12095
12134
|
if (t.kind === "label") {
|
|
12096
12135
|
let e = c.current?.reader.getLabelSnapshot(t.areaId, t.id);
|
|
12097
12136
|
if (!e) return;
|
|
12098
|
-
|
|
12137
|
+
X({
|
|
12099
12138
|
kind: "deleteLabel",
|
|
12100
12139
|
areaId: t.areaId,
|
|
12101
12140
|
label: e
|
|
@@ -12106,10 +12145,10 @@ function Or({ plugins: a = [], title: o = "Mudlet Map Editor" }) {
|
|
|
12106
12145
|
return;
|
|
12107
12146
|
}
|
|
12108
12147
|
}
|
|
12109
|
-
},
|
|
12148
|
+
}, B = () => {
|
|
12110
12149
|
let { changed: e, structural: t } = De(c.current);
|
|
12111
12150
|
e && (c.current?.refresh(), t ? D.bumpStructure() : D.bumpData(), D.setState({ status: "Undone" }));
|
|
12112
|
-
},
|
|
12151
|
+
}, V = () => {
|
|
12113
12152
|
let { changed: e, structural: t } = Oe(c.current);
|
|
12114
12153
|
e && (c.current?.refresh(), t ? D.bumpStructure() : D.bumpData(), D.setState({ status: "Redone" }));
|
|
12115
12154
|
};
|
|
@@ -12124,7 +12163,7 @@ function Or({ plugins: a = [], title: o = "Mudlet Map Editor" }) {
|
|
|
12124
12163
|
className: "map-container"
|
|
12125
12164
|
}),
|
|
12126
12165
|
!m && /* @__PURE__ */ d(Mn, {}),
|
|
12127
|
-
/* @__PURE__ */ d(
|
|
12166
|
+
/* @__PURE__ */ d(le, {
|
|
12128
12167
|
title: o,
|
|
12129
12168
|
onHelpClick: () => E(!0),
|
|
12130
12169
|
onLoadFromUrl: () => A(!0),
|
|
@@ -12152,8 +12191,8 @@ function Or({ plugins: a = [], title: o = "Mudlet Map Editor" }) {
|
|
|
12152
12191
|
onMouseDown: () => M(!1)
|
|
12153
12192
|
}), /* @__PURE__ */ d(Fn, { onClose: () => M(!1) })] }),
|
|
12154
12193
|
/* @__PURE__ */ d(In, { sceneRef: c }),
|
|
12155
|
-
T && /* @__PURE__ */ d(
|
|
12156
|
-
(k || N) && /* @__PURE__ */ d(
|
|
12194
|
+
T && /* @__PURE__ */ d(ce, { onClose: () => E(!1) }),
|
|
12195
|
+
(k || N) && /* @__PURE__ */ d(ue, {
|
|
12157
12196
|
initialUrl: N ?? void 0,
|
|
12158
12197
|
onClose: () => {
|
|
12159
12198
|
A(!1), P(null);
|
|
@@ -12166,7 +12205,7 @@ function Or({ plugins: a = [], title: o = "Mudlet Map Editor" }) {
|
|
|
12166
12205
|
//#region src/editor/mapBytes.ts
|
|
12167
12206
|
function kr() {
|
|
12168
12207
|
let { map: e } = D.getState();
|
|
12169
|
-
return e ?
|
|
12208
|
+
return e ? U(e) : null;
|
|
12170
12209
|
}
|
|
12171
12210
|
//#endregion
|
|
12172
|
-
export { Or as App, kr as getMapBytes,
|
|
12211
|
+
export { Or as App, kr as getMapBytes, K as loadUrlIntoStore, X as pushCommand, D as store, O as useEditorState };
|