@canvasengine/presets 2.0.0-beta.50 → 2.0.0-beta.51
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/Weathers/fog.d.ts +1 -0
- package/dist/Weathers/fog.d.ts.map +1 -1
- package/dist/Weathers/index.d.ts.map +1 -1
- package/dist/Weathers/rain.d.ts +0 -17
- package/dist/Weathers/rain.d.ts.map +1 -1
- package/dist/Weathers/snow.d.ts +2 -7
- package/dist/Weathers/snow.d.ts.map +1 -1
- package/dist/index.global.js +251 -315
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +1260 -1301
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useProps as
|
|
2
|
-
import * as
|
|
3
|
-
import { Geometry as ti, Buffer as Se, BufferUsage as
|
|
1
|
+
import { useProps as kt, h as ht, Graphics as qt, tick as Ae, mount as Ie, on as pi, Container as Nt, animatedSignal as mi, signal as $, RadialGradient as _i, isObservable as gi, isSignal as oe, effect as Ze, DisplayObject as yi, registerComponent as xi, createComponent as Ei, loop as wi, TilingSprite as vi, Mesh as bi } from "canvasengine";
|
|
2
|
+
import * as _t from "pixi.js";
|
|
3
|
+
import { Geometry as ti, Buffer as Se, BufferUsage as Lt, ExtensionType as te, NOOP as Ti, UniformGroup as ie, Matrix as Ai, Texture as re, BindGroup as ei, Shader as Ce, GlProgram as $t, GpuProgram as Ii, ViewContainer as Si, State as Ci, Bounds as Mi, TextureSource as Bi, groupD8 as ot, Container as Fi, extensions as Me, AnimatedSprite as Ni, Assets as Di, Rectangle as Pi } from "pixi.js";
|
|
4
4
|
function le(h) {
|
|
5
5
|
var t = h.toString(16);
|
|
6
6
|
return t.length == 1 ? "0" + t : t;
|
|
@@ -8,7 +8,7 @@ function le(h) {
|
|
|
8
8
|
function Oi(h, t, e) {
|
|
9
9
|
return "#" + le(h) + le(t) + le(e);
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function Xr(h) {
|
|
12
12
|
const {
|
|
13
13
|
width: t,
|
|
14
14
|
height: e,
|
|
@@ -18,41 +18,41 @@ function Lr(h) {
|
|
|
18
18
|
foregroundColor: a,
|
|
19
19
|
border: o,
|
|
20
20
|
innerMargin: g,
|
|
21
|
-
borderRadius:
|
|
22
|
-
} =
|
|
21
|
+
borderRadius: A
|
|
22
|
+
} = kt(h, {
|
|
23
23
|
backgroundColor: "#000000",
|
|
24
24
|
foregroundColor: "#FFFFFF",
|
|
25
25
|
innerMargin: 0,
|
|
26
26
|
borderRadius: 0
|
|
27
27
|
});
|
|
28
|
-
return
|
|
29
|
-
|
|
28
|
+
return ht(
|
|
29
|
+
qt,
|
|
30
30
|
{
|
|
31
31
|
...h,
|
|
32
32
|
width: t,
|
|
33
33
|
height: e,
|
|
34
34
|
draw(E) {
|
|
35
|
-
|
|
35
|
+
A() ? E.roundRect(0, 0, t(), e(), A()) : E.rect(0, 0, t(), e()), o && E.stroke(o), E.fill(c());
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
|
-
|
|
38
|
+
ht(qt, {
|
|
39
39
|
width: t,
|
|
40
40
|
height: e,
|
|
41
41
|
draw(E) {
|
|
42
|
-
const S = g(),
|
|
42
|
+
const S = g(), I = A(), F = Math.max(
|
|
43
43
|
0,
|
|
44
44
|
Math.min(
|
|
45
45
|
t() - 2 * S,
|
|
46
46
|
i() / s() * (t() - 2 * S)
|
|
47
47
|
)
|
|
48
48
|
), B = e() - 2 * S;
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
const [P,
|
|
53
|
-
E.fill({ color: Oi(P,
|
|
49
|
+
A ? E.roundRect(S, S, F, B, I) : E.rect(S, S, F, B);
|
|
50
|
+
const N = a();
|
|
51
|
+
if (N.startsWith("rgba")) {
|
|
52
|
+
const [P, m, v, _] = N.match(/\d+(\.\d+)?/g).map(Number);
|
|
53
|
+
E.fill({ color: Oi(P, m, v), alpha: _ });
|
|
54
54
|
} else
|
|
55
|
-
E.fill(
|
|
55
|
+
E.fill(N);
|
|
56
56
|
}
|
|
57
57
|
})
|
|
58
58
|
);
|
|
@@ -105,7 +105,7 @@ class Ot {
|
|
|
105
105
|
}
|
|
106
106
|
class ii extends Ot {
|
|
107
107
|
constructor(t) {
|
|
108
|
-
super(), this.componentId = t, this.exhausted = !1, this.completed = !1, this.name = "", this.endTime = 0, this._x = 0, this._y = 0, this._rotation = 0, this._alpha = 0, this._scale = new
|
|
108
|
+
super(), this.componentId = t, this.exhausted = !1, this.completed = !1, this.name = "", this.endTime = 0, this._x = 0, this._y = 0, this._rotation = 0, this._alpha = 0, this._scale = new _t.Point(), this._time = 0, this._active = !1, this.__recycled = !0;
|
|
109
109
|
}
|
|
110
110
|
// *********************************************************************************************
|
|
111
111
|
// * Public *
|
|
@@ -188,7 +188,7 @@ class Be {
|
|
|
188
188
|
this._rotation = t, this._dx = Math.cos(t), this._dy = Math.sin(t);
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
class
|
|
191
|
+
class V {
|
|
192
192
|
static float(t, e) {
|
|
193
193
|
return Math.random() * (e - t) + t;
|
|
194
194
|
}
|
|
@@ -219,7 +219,7 @@ class Ri extends Be {
|
|
|
219
219
|
emit(t) {
|
|
220
220
|
const e = this._settings, i = this.emitter, s = e.width * 0.5 * this.__scaleMod, c = e.height * 0.5 * this.__scaleMod;
|
|
221
221
|
let a = i.rotation;
|
|
222
|
-
const o =
|
|
222
|
+
const o = V.float(-s, s), g = V.float(-c, c);
|
|
223
223
|
a != 0 ? (t.component.x = this.__x + this._t * (this.x - this.__x) + o * Math.cos(a) - g * Math.sin(a), t.component.y = this.__y + this._t * (this.y - this.__y) + o * Math.sin(a) + g * Math.cos(a)) : (t.component.x = this.__x + this._t * (this.x - this.__x) + o, t.component.y = this.__y + this._t * (this.y - this.__y) + g), e.radial ? (a += Math.atan2(g, o), t.dx = Math.cos(a), t.dy = Math.sin(a)) : (t.dx = this._dx, t.dy = this._dy), t.component.rotation = a, this._t += this._posInterpolationStep;
|
|
224
224
|
}
|
|
225
225
|
}
|
|
@@ -233,15 +233,15 @@ class Ui extends Be {
|
|
|
233
233
|
emit(t) {
|
|
234
234
|
const e = this._settings, i = this.emitter;
|
|
235
235
|
let s;
|
|
236
|
-
if (e.angle ? s =
|
|
237
|
-
let c =
|
|
236
|
+
if (e.angle ? s = V.float(-e.angle * 0.5, e.angle * 0.5) + i.rotation : s = V.float(0, 6.28319) + i.rotation, e.radius > 0) {
|
|
237
|
+
let c = V.float(0, e.radius) * this.__scaleMod;
|
|
238
238
|
t.component.x = this.__x + this._t * (this.x - this.__x) + Math.cos(s) * c, t.component.y = this.__y + this._t * (this.y - this.__y) + Math.sin(s) * c;
|
|
239
239
|
} else
|
|
240
240
|
t.component.x = this.__x + this._t * (this.x - this.__x), t.component.y = this.__y + this._t * (this.y - this.__y);
|
|
241
241
|
e.radial ? (t.dx = Math.cos(s), t.dy = Math.sin(s), t.component.rotation = s) : (t.dx = this._dx, t.dy = this._dy, t.component.rotation = i.rotation), this._t += this._posInterpolationStep;
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
-
class
|
|
244
|
+
class Li extends Be {
|
|
245
245
|
constructor() {
|
|
246
246
|
super(jt.Ring);
|
|
247
247
|
}
|
|
@@ -256,20 +256,20 @@ class ki extends Be {
|
|
|
256
256
|
emit(t) {
|
|
257
257
|
const e = this._settings, i = this.emitter;
|
|
258
258
|
let s;
|
|
259
|
-
e.uniform ? (s = this._angle + i.rotation, this._angle += this._uniformStep) : s =
|
|
259
|
+
e.uniform ? (s = this._angle + i.rotation, this._angle += this._uniformStep) : s = V.float(-e.angle * 0.5, e.angle * 0.5) + i.rotation;
|
|
260
260
|
const c = e.radius * this.__scaleMod;
|
|
261
261
|
t.component.x = this.__x + this._t * (this.x - this.__x) + Math.cos(s) * c, t.component.y = this.__y + this._t * (this.y - this.__y) + Math.sin(s) * c, e.radial ? (t.dx = Math.cos(s), t.dy = Math.sin(s), t.component.rotation = s) : (t.dx = this._dx, t.dy = this._dy, t.component.rotation = i.rotation), this._t += this._posInterpolationStep;
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
var
|
|
264
|
+
var bt;
|
|
265
265
|
(function(h) {
|
|
266
266
|
h[h.Sprite = 0] = "Sprite", h[h.MovieClip = 1] = "MovieClip", h[h.Emitter = 2] = "Emitter", h[h.Trigger = 3] = "Trigger";
|
|
267
|
-
})(
|
|
268
|
-
class
|
|
267
|
+
})(bt || (bt = {}));
|
|
268
|
+
class ki extends _t.AnimatedSprite {
|
|
269
269
|
constructor(t, e, i, s) {
|
|
270
270
|
let c = [], a = e.length;
|
|
271
271
|
for (let o = 0; o < a; o++)
|
|
272
|
-
c.push(
|
|
272
|
+
c.push(_t.Texture.from(e[o]));
|
|
273
273
|
super(c), this.componentId = t, this.anchor.set(0.5, 0.5), this.loop = !1, this.__sequenceEndTime = 0;
|
|
274
274
|
}
|
|
275
275
|
// *********************************************************************************************
|
|
@@ -299,7 +299,7 @@ var Re;
|
|
|
299
299
|
(function(h) {
|
|
300
300
|
h.Linear = "linear", h.EaseInQuad = "easeInQuad", h.EaseOutQuad = "easeOutQuad", h.EaseInOutQuad = "easeInOutQuad", h.EaseInCubic = "easeInCubic", h.EaseOutCubic = "easeOutCubic", h.EaseInOutCubic = "easeInOutCubic", h.EaseInQuart = "easeInQuart", h.EaseOutQuart = "easeOutQuart", h.EaseInOutQuart = "easeInOutQuart", h.EaseInQuint = "easeInQuint", h.EaseOutQuint = "easeOutQuint", h.EaseInOutQuint = "easeInOutQuint", h.EaseInSine = "easeInSine", h.EaseOutSine = "easeOutSine", h.EaseInOutSine = "easeInOutSine", h.EaseInExpo = "easeInExpo", h.EaseOutExpo = "easeOutExpo", h.EaseInOutExpo = "easeInOutExpo", h.EaseInCirc = "easeInCirc", h.EaseOutCirc = "easeOutCirc", h.EaseInOutCirc = "easeInOutCirc", h.EaseInElastic = "easeInElastic", h.EaseOutElastic = "easeOutElastic", h.EaseInOutElastic = "easeInOutElastic", h.EaseInBack = "easeInBack", h.EaseOutBack = "easeOutBack", h.EaseInOutBack = "easeInOutBack", h.EaseInBounce = "easeInBounce", h.EaseOutBounce = "easeOutBounce", h.EaseInOutBounce = "easeInOutBounce";
|
|
301
301
|
})(Re || (Re = {}));
|
|
302
|
-
class
|
|
302
|
+
class yt {
|
|
303
303
|
static linear(t, e, i, s) {
|
|
304
304
|
return i * t / s + e;
|
|
305
305
|
}
|
|
@@ -389,17 +389,17 @@ class gt {
|
|
|
389
389
|
}
|
|
390
390
|
static easeInBounce(t, e, i, s) {
|
|
391
391
|
let c;
|
|
392
|
-
return c =
|
|
392
|
+
return c = yt.easeOutBounce(s - t, 0, i, s), i - c + e;
|
|
393
393
|
}
|
|
394
394
|
static easeOutBounce(t, e, i, s) {
|
|
395
395
|
return (t /= s) < 1 / 2.75 ? i * (7.5625 * t * t) + e : t < 2 / 2.75 ? i * (7.5625 * (t -= 1.5 / 2.75) * t + 0.75) + e : t < 2.5 / 2.75 ? i * (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375) + e : i * (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375) + e;
|
|
396
396
|
}
|
|
397
397
|
static easeInOutBounce(t, e, i, s) {
|
|
398
398
|
let c;
|
|
399
|
-
return t < s / 2 ? (c =
|
|
399
|
+
return t < s / 2 ? (c = yt.easeInBounce(t * 2, 0, i, s), c * 0.5 + e) : (c = yt.easeOutBounce(t * 2 - s, 0, i, s), c * 0.5 + i * 0.5 + e);
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
|
-
class
|
|
402
|
+
class ut {
|
|
403
403
|
constructor() {
|
|
404
404
|
this.__hasCallback = !1, this._list = new se();
|
|
405
405
|
}
|
|
@@ -444,9 +444,9 @@ class Ue {
|
|
|
444
444
|
let Yi = class extends Ot {
|
|
445
445
|
constructor() {
|
|
446
446
|
super(), this.dx = 0, this.dy = 0, this._childEmitters = [], this._hasChildEmitters = !1, this._spawnOnHalfway = !1, this.__recycled = !0, this.__on = {
|
|
447
|
-
died: new
|
|
448
|
-
bounced: new
|
|
449
|
-
updated: new
|
|
447
|
+
died: new ut(),
|
|
448
|
+
bounced: new ut(),
|
|
449
|
+
updated: new ut()
|
|
450
450
|
}, this._color = new Xi();
|
|
451
451
|
}
|
|
452
452
|
// *********************************************************************************************
|
|
@@ -455,25 +455,25 @@ let Yi = class extends Ot {
|
|
|
455
455
|
init(t, e, i) {
|
|
456
456
|
const s = this.component, c = this.__fx;
|
|
457
457
|
this.emitter = t, this.settings = e;
|
|
458
|
-
const a = this.duration =
|
|
458
|
+
const a = this.duration = V.float(e.durationMin, e.durationMax) * i;
|
|
459
459
|
if (this._dt = 1 / this.duration, this.time = 0, this.__recycled = !1, e.addOnTop ? t.container.addChild(s) : t.container.addChildAt(s, 0), s.blendMode = c.__getBlendMode(e.blendMode), this.startX = s.x, this.startY = s.y, this.useGravity = t.settings.useGravity, this.useScale = e.useScale, this.useRotation = e.useRotation, this.useAlpha = e.useAlpha, this.useTint = e.useTint, this.useSpawns = e.useSpawns, this.useChilds = e.useChilds, this.useMotion = e.useMotion, this.useGravity)
|
|
460
|
-
if (this.gravity = t.settings.gravity, this.useFloor = t.settings.useFloor, this.floorY = t.settings.floorY, this.bounceFac =
|
|
461
|
-
const o =
|
|
460
|
+
if (this.gravity = t.settings.gravity, this.useFloor = t.settings.useFloor, this.floorY = t.settings.floorY, this.bounceFac = V.float(e.bounceFacMin, e.bounceFacMax) * i, this.friction = 1 - V.float(e.frictionMin, e.frictionMax) * i, this._spawnOnBounce = e.spawn.onBounce.length > 0, this.useAlign = e.align, e.useMotion) {
|
|
461
|
+
const o = V.float(e.moveSpeedMin, e.moveSpeedMax);
|
|
462
462
|
this.moveSpeedX = o * this.dx * i, this.moveSpeedY = o * this.dy * i;
|
|
463
463
|
} else
|
|
464
464
|
this.moveSpeedX = this.moveSpeedY = 0;
|
|
465
465
|
else if (e.useMotion) {
|
|
466
|
-
const o = this.distance =
|
|
467
|
-
this.deltaX = (s.x + o * this.dx - this.startX) * 0.8, this.deltaY = (s.y + o * this.dy - this.startY) * 0.8, this.distanceEase =
|
|
466
|
+
const o = this.distance = V.integer(e.distanceMin, e.distanceMax) * 0.8 * i;
|
|
467
|
+
this.deltaX = (s.x + o * this.dx - this.startX) * 0.8, this.deltaY = (s.y + o * this.dy - this.startY) * 0.8, this.distanceEase = yt[e.distanceEase], this.useAlign = !1;
|
|
468
468
|
} else
|
|
469
469
|
s.x = this.startX, s.y = this.startY;
|
|
470
|
-
if (e.useRotation && e.randomStartRotation && !this.useAlign && (s.rotation =
|
|
470
|
+
if (e.useRotation && e.randomStartRotation && !this.useAlign && (s.rotation = V.float(0, 6.28319)), e.useAlpha && (this.alphaStart = s.alpha = V.float(e.alphaStartMin, e.alphaStartMax), this.alphaDelta = V.float(e.alphaEndMin, e.alphaEndMax) - this.alphaStart, this.alphaEase = yt[e.alphaEase] || null, this.useFadeIn = e.fadeIn, e.fadeIn && (this.alphaDuration = a * (1 - e.fadeInDurationFac), this.fadeInDuration = a * e.fadeInDurationFac, this.fadeInEase = yt[e.fadeInEase || "easeInSine"])), e.useScale && (this.uniformScale = e.uniformScale, this.useScaleIn = e.scaleIn, e.useScale ? (this.uniformScale = e.uniformScale, this.scaleEase = yt[e.scaleEase], e.uniformScale ? (this.scaleStart = s.scale.x = s.scale.y = V.float(e.scaleStartMin, e.scaleStartMax) * i, this.scaleDelta = (V.float(e.scaleEndMin, e.scaleEndMax) - this.scaleStart) * i) : (this.scaleXStart = s.scale.x = V.float(e.scaleXStartMin, e.scaleXStartMax) * i, this.scaleXDelta = (V.float(e.scaleXEndMin, e.scaleXEndMax) - this.scaleXStart) * i, this.scaleXEase = yt[e.scaleXEase], this.scaleYStart = s.scale.y = V.float(e.scaleYStartMin, e.scaleYStartMax) * i, this.scaleYDelta = (V.float(e.scaleYEndMin, e.scaleYEndMax) - this.scaleYStart) * i, this.scaleYEase = yt[e.scaleYEase]), e.scaleIn && (this.scaleDuration = a * (1 - e.scaleInDurationFac), this.scaleInDuration = a * e.scaleInDurationFac, this.scaleInEase = yt[e.scaleInEase || "easeInSine"])) : e.uniformScale ? (s.scale.x = e.scaleStartMin, s.scale.y = e.scaleStartMin) : (s.scale.x = e.scaleXStartMin, s.scale.y = e.scaleYStartMin)), e.useRotation && (this.rotationSpeed = V.float(e.rotationSpeedMin, e.rotationSpeedMax) * i, e.randomRotationDirection && (this.rotationSpeed *= V.sign())), e.useTint && (this.tintEase = yt[e.tintEase], this._color.setRgb(e.tintStart, e.tintEnd)), e.useChilds) {
|
|
471
471
|
this._childEmitters.length = 0;
|
|
472
472
|
let o = e.childs.length;
|
|
473
473
|
if (this._hasChildEmitters = o > 0, this._childEmitters)
|
|
474
474
|
for (; --o > -1; ) {
|
|
475
|
-
const g = e.childs[o],
|
|
476
|
-
|
|
475
|
+
const g = e.childs[o], A = c.getParticleEmitterById(g.id);
|
|
476
|
+
A.init(t.container, !0, (g.scale || 1) * (i || 1)), g.adoptRotation && (A.rotation = s.rotation, A.__adoptRotation = !0), A.__parent = this, this._childEmitters.push(A);
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
479
|
return e.useSpawns && (e.spawn.onStart.length > 0 && t.__subSpawn(this, e.spawn.onStart), this._spawnOnHalfway = e.spawn.onHalfway.length > 0), t.__on.particleSpawned.__hasCallback && t.__on.particleSpawned.dispatch(this), this;
|
|
@@ -539,15 +539,15 @@ let Yi = class extends Ot {
|
|
|
539
539
|
e > -1 && (this._childEmitters.splice(e, 1), this._childEmitters.length == 0 && (this._hasChildEmitters = !1));
|
|
540
540
|
}
|
|
541
541
|
};
|
|
542
|
-
class
|
|
542
|
+
class Tt {
|
|
543
543
|
static sanitizeBundle(t) {
|
|
544
544
|
for (let e of t.emitters) {
|
|
545
|
-
const i =
|
|
546
|
-
|
|
545
|
+
const i = Tt._presetStructure.emitter;
|
|
546
|
+
Tt.parse(e, i, Tt._presetStructure.emitterSpawn);
|
|
547
547
|
}
|
|
548
548
|
for (let e of t.sequences) {
|
|
549
|
-
const i =
|
|
550
|
-
|
|
549
|
+
const i = Tt._presetStructure.sequence;
|
|
550
|
+
Tt.parse(e, i, Tt._presetStructure.sequenceEffect);
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
static parse(t, e, i) {
|
|
@@ -560,7 +560,7 @@ class bt {
|
|
|
560
560
|
continue;
|
|
561
561
|
const a = e[s];
|
|
562
562
|
if (!c.hasOwnProperty("length"))
|
|
563
|
-
|
|
563
|
+
Tt.parse(c, a, i);
|
|
564
564
|
else
|
|
565
565
|
for (let o of c)
|
|
566
566
|
for (let g in i)
|
|
@@ -568,7 +568,7 @@ class bt {
|
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
|
-
|
|
571
|
+
Tt._presetStructure = {
|
|
572
572
|
sequence: {
|
|
573
573
|
id: 0,
|
|
574
574
|
name: "",
|
|
@@ -714,9 +714,9 @@ bt._presetStructure = {
|
|
|
714
714
|
containerId: ""
|
|
715
715
|
}
|
|
716
716
|
};
|
|
717
|
-
class Vi extends
|
|
717
|
+
class Vi extends _t.Sprite {
|
|
718
718
|
constructor(t, e, i, s) {
|
|
719
|
-
super(
|
|
719
|
+
super(_t.Texture.from(e)), this.componentId = t, this.anchor.set(i || 0.5, s || 0.5), this.__sequenceEndTime = null;
|
|
720
720
|
}
|
|
721
721
|
// *********************************************************************************************
|
|
722
722
|
// * Public *
|
|
@@ -728,13 +728,13 @@ class Vi extends mt.Sprite {
|
|
|
728
728
|
this.__fx = null, this.recycle(), this.destroy(!1);
|
|
729
729
|
}
|
|
730
730
|
}
|
|
731
|
-
function
|
|
731
|
+
function Dt(h) {
|
|
732
732
|
if (typeof h != "object" || h === null)
|
|
733
733
|
return h;
|
|
734
734
|
const t = Array.isArray(h) ? [] : {};
|
|
735
735
|
for (const e in h) {
|
|
736
736
|
const i = h[e];
|
|
737
|
-
t[e] =
|
|
737
|
+
t[e] = Dt(i);
|
|
738
738
|
}
|
|
739
739
|
return t;
|
|
740
740
|
}
|
|
@@ -747,25 +747,25 @@ var Gi = function(h, t, e, i) {
|
|
|
747
747
|
return new (e || (e = Promise))(function(c, a) {
|
|
748
748
|
function o(E) {
|
|
749
749
|
try {
|
|
750
|
-
|
|
750
|
+
A(i.next(E));
|
|
751
751
|
} catch (S) {
|
|
752
752
|
a(S);
|
|
753
753
|
}
|
|
754
754
|
}
|
|
755
755
|
function g(E) {
|
|
756
756
|
try {
|
|
757
|
-
|
|
757
|
+
A(i.throw(E));
|
|
758
758
|
} catch (S) {
|
|
759
759
|
a(S);
|
|
760
760
|
}
|
|
761
761
|
}
|
|
762
|
-
function
|
|
762
|
+
function A(E) {
|
|
763
763
|
E.done ? c(E.value) : s(E.value).then(o, g);
|
|
764
764
|
}
|
|
765
|
-
|
|
765
|
+
A((i = i.apply(h, t || [])).next());
|
|
766
766
|
});
|
|
767
767
|
};
|
|
768
|
-
class
|
|
768
|
+
class gt {
|
|
769
769
|
constructor() {
|
|
770
770
|
this.useBlendModes = !0, this.particleCount = 0, this.emitterCount = 0, this.effectSequenceCount = 0, this.maxParticles = 5e3, this.particleFac = 1, this._active = !1, this._effects = new se(), this.__containers = {}, this.clearCache(), this.start();
|
|
771
771
|
}
|
|
@@ -866,9 +866,9 @@ class _t {
|
|
|
866
866
|
};
|
|
867
867
|
for (var g in s)
|
|
868
868
|
o[g] = s[g];
|
|
869
|
-
|
|
870
|
-
const
|
|
871
|
-
c(this.initBundle(
|
|
869
|
+
_t.Assets.addBundle("rfx_assets", o);
|
|
870
|
+
const A = yield _t.Assets.loadBundle("rfx_assets");
|
|
871
|
+
c(this.initBundle(A.rfx_bundleSettings));
|
|
872
872
|
}));
|
|
873
873
|
}
|
|
874
874
|
/**
|
|
@@ -879,11 +879,11 @@ class _t {
|
|
|
879
879
|
* @returns {IParseSpriteSheetResult} The result of parsing the sprite sheet.
|
|
880
880
|
*/
|
|
881
881
|
initBundle(t, e) {
|
|
882
|
-
if (t.__h !==
|
|
882
|
+
if (t.__h !== gt._bundleHash)
|
|
883
883
|
throw new Error("Invalid settings file.");
|
|
884
|
-
if (t.__v !=
|
|
884
|
+
if (t.__v != gt.settingsVersion)
|
|
885
885
|
throw new Error("Settings version mismatch.");
|
|
886
|
-
|
|
886
|
+
Tt.sanitizeBundle(t), e && this.clearCache();
|
|
887
887
|
for (let i in t.emitters) {
|
|
888
888
|
const s = t.emitters[i];
|
|
889
889
|
this.addParticleEmitter(s.id, s);
|
|
@@ -993,7 +993,7 @@ class _t {
|
|
|
993
993
|
let s, c = this._settingsCache.effectSequences[t];
|
|
994
994
|
if (!c)
|
|
995
995
|
throw new Error(`Settings not defined for '${t}'`);
|
|
996
|
-
return i.length == 0 ? (s = new
|
|
996
|
+
return i.length == 0 ? (s = new Le(t), s.__fx = this) : s = i.pop(), e && (c = Dt(c), c.__isClone = !0), s.__applySettings(c), s;
|
|
997
997
|
}
|
|
998
998
|
/**
|
|
999
999
|
* Retrieves a particle emitter by its name.
|
|
@@ -1022,7 +1022,7 @@ class _t {
|
|
|
1022
1022
|
let c, a = this._settingsCache.emitters[t];
|
|
1023
1023
|
if (!a)
|
|
1024
1024
|
throw new Error(`Settings not defined for '${t}'`);
|
|
1025
|
-
return s.length == 0 ? (c = new we(t), c.__fx = this) : c = s.pop(), i && (a =
|
|
1025
|
+
return s.length == 0 ? (c = new we(t), c.__fx = this) : c = s.pop(), i && (a = Dt(a), a.__isClone = !0), c.autoRecycleOnComplete = e, c.__applySettings(a), c;
|
|
1026
1026
|
}
|
|
1027
1027
|
/**
|
|
1028
1028
|
* Creates a particle emitter from the specified settings.
|
|
@@ -1039,7 +1039,7 @@ class _t {
|
|
|
1039
1039
|
createEffectSequenceEmitterFrom(t) {
|
|
1040
1040
|
const e = this._cache.effectSequences;
|
|
1041
1041
|
let i;
|
|
1042
|
-
return e.length == 0 ? (i = new
|
|
1042
|
+
return e.length == 0 ? (i = new Le(t.id), i.__fx = this) : i = e.pop(), i.__applySettings(t), i;
|
|
1043
1043
|
}
|
|
1044
1044
|
/**
|
|
1045
1045
|
* Stops the specified particle emitter.
|
|
@@ -1078,7 +1078,7 @@ class _t {
|
|
|
1078
1078
|
* @returns {IParseSpriteSheetResult} - The parsed sprite sheet result.
|
|
1079
1079
|
*/
|
|
1080
1080
|
parseTextureCache(t) {
|
|
1081
|
-
return this.parseObject(
|
|
1081
|
+
return this.parseObject(_t.Cache._cache, t);
|
|
1082
1082
|
}
|
|
1083
1083
|
/**
|
|
1084
1084
|
* Returns if the FX instance is active.
|
|
@@ -1116,7 +1116,7 @@ class _t {
|
|
|
1116
1116
|
let s = this._settingsCache.mcs[t];
|
|
1117
1117
|
if (s == null)
|
|
1118
1118
|
throw new Error(`Settings not defined for '${t}'`);
|
|
1119
|
-
const c = new
|
|
1119
|
+
const c = new ki(t, s.textures, s.anchorX, s.anchorY);
|
|
1120
1120
|
return c.__fx = this, c;
|
|
1121
1121
|
}
|
|
1122
1122
|
return i.pop();
|
|
@@ -1131,7 +1131,7 @@ class _t {
|
|
|
1131
1131
|
}
|
|
1132
1132
|
__getEmitterCore(t, e) {
|
|
1133
1133
|
let i = this._cache.cores, s = i[t];
|
|
1134
|
-
return s == null && (s = i[t] = []), s.length == 0 ? new
|
|
1134
|
+
return s == null && (s = i[t] = []), s.length == 0 ? new gt.__emitterCores[t](t) : s.pop();
|
|
1135
1135
|
}
|
|
1136
1136
|
__recycleParticle(t) {
|
|
1137
1137
|
this._cache.particles.push(t);
|
|
@@ -1152,7 +1152,7 @@ class _t {
|
|
|
1152
1152
|
this._cache.cores[t.type].push(t);
|
|
1153
1153
|
}
|
|
1154
1154
|
__getBlendMode(t) {
|
|
1155
|
-
return
|
|
1155
|
+
return _t.BLEND_MODES === void 0 && typeof t == "number" ? this.useBlendModes ? gt._blendModes[t] : "normal" : t;
|
|
1156
1156
|
}
|
|
1157
1157
|
__getSequenceSettings(t) {
|
|
1158
1158
|
let e = this._settingsCache.effectSequences[t];
|
|
@@ -1176,7 +1176,7 @@ class _t {
|
|
|
1176
1176
|
const a = t;
|
|
1177
1177
|
a.values();
|
|
1178
1178
|
for (const [o, g] of a)
|
|
1179
|
-
g instanceof
|
|
1179
|
+
g instanceof _t.Texture && (i[o] = g);
|
|
1180
1180
|
} else
|
|
1181
1181
|
i = t;
|
|
1182
1182
|
const s = {}, c = { sprites: [], movieClips: [] };
|
|
@@ -1192,16 +1192,16 @@ class _t {
|
|
|
1192
1192
|
return c;
|
|
1193
1193
|
}
|
|
1194
1194
|
}
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1195
|
+
gt.settingsVersion = 0;
|
|
1196
|
+
gt.version = "1.3.4";
|
|
1197
|
+
gt._bundleHash = "80c6df7fb0d3d898f34ce0031c037fef";
|
|
1198
|
+
gt.ComponentType = Ee;
|
|
1199
|
+
gt.EffectSequenceComponentType = bt;
|
|
1200
|
+
gt._blendModes = ["normal", "add", "multiply", "screen"];
|
|
1201
|
+
gt.__emitterCores = {
|
|
1202
1202
|
circle: Ui,
|
|
1203
1203
|
box: Ri,
|
|
1204
|
-
ring:
|
|
1204
|
+
ring: Li
|
|
1205
1205
|
};
|
|
1206
1206
|
var Rt;
|
|
1207
1207
|
(function(h) {
|
|
@@ -1210,13 +1210,13 @@ var Rt;
|
|
|
1210
1210
|
class we extends ii {
|
|
1211
1211
|
constructor(t) {
|
|
1212
1212
|
super(t), this.targetOffset = 0, this.autoRecycleOnComplete = !0, this._particles = new se(), this._particleCount = 0, this._childEmitters = [], this._hasChildEmitters = !1, this._paused = !1, this.__adoptRotation = !1, this.__on = {
|
|
1213
|
-
started: new
|
|
1214
|
-
completed: new
|
|
1215
|
-
exhausted: new
|
|
1216
|
-
particleUpdated: new
|
|
1217
|
-
particleSpawned: new
|
|
1218
|
-
particleBounced: new
|
|
1219
|
-
particleDied: new
|
|
1213
|
+
started: new ut(),
|
|
1214
|
+
completed: new ut(),
|
|
1215
|
+
exhausted: new ut(),
|
|
1216
|
+
particleUpdated: new ut(),
|
|
1217
|
+
particleSpawned: new ut(),
|
|
1218
|
+
particleBounced: new ut(),
|
|
1219
|
+
particleDied: new ut()
|
|
1220
1220
|
};
|
|
1221
1221
|
}
|
|
1222
1222
|
// *********************************************************************************************
|
|
@@ -1245,7 +1245,7 @@ class we extends ii {
|
|
|
1245
1245
|
if (!this._active)
|
|
1246
1246
|
return this;
|
|
1247
1247
|
const e = Date.now(), i = this.settings;
|
|
1248
|
-
this.exhausted ? this._particleCount == 0 && (this._active = !1, this.completed = !0, this.__on.completed.__hasCallback && this.__on.completed.dispatch(this), this.__fx.__removeActiveEffect(this), this.autoRecycleOnComplete && this.recycle()) : (this.settings.autoRotation !== 0 && (this.rotation += i.autoRotation * (t / 0.016666)), this.target && (this.rotation = this.target.rotation, this.targetOffset == 0 ? (this.x = this.target.x, this.y = this.target.y) : (this.x = this.target.x + Math.cos(this._rotation) * this.targetOffset, this.y = this.target.y + Math.sin(this._rotation) * this.targetOffset)), this.endTime == 0 && !this.infinite ? (this.spawn(), this.exhausted = !0) : this.infinite || e < this.endTime ? (this._time += t, this._time >= this._nextSpawnTime && (this._time = 0, this.spawn(), this._nextSpawnTime = this._time +
|
|
1248
|
+
this.exhausted ? this._particleCount == 0 && (this._active = !1, this.completed = !0, this.__on.completed.__hasCallback && this.__on.completed.dispatch(this), this.__fx.__removeActiveEffect(this), this.autoRecycleOnComplete && this.recycle()) : (this.settings.autoRotation !== 0 && (this.rotation += i.autoRotation * (t / 0.016666)), this.target && (this.rotation = this.target.rotation, this.targetOffset == 0 ? (this.x = this.target.x, this.y = this.target.y) : (this.x = this.target.x + Math.cos(this._rotation) * this.targetOffset, this.y = this.target.y + Math.sin(this._rotation) * this.targetOffset)), this.endTime == 0 && !this.infinite ? (this.spawn(), this.exhausted = !0) : this.infinite || e < this.endTime ? (this._time += t, this._time >= this._nextSpawnTime && (this._time = 0, this.spawn(), this._nextSpawnTime = this._time + V.float(i.spawnFrequencyMin, i.spawnFrequencyMax))) : (this.exhausted = !0, this.__on.exhausted.__hasCallback && this.__on.exhausted.dispatch(this)));
|
|
1249
1249
|
let c = this._particles.first, a;
|
|
1250
1250
|
for (; c; )
|
|
1251
1251
|
a = c.next, c.update(t), c = a;
|
|
@@ -1255,7 +1255,7 @@ class we extends ii {
|
|
|
1255
1255
|
if (this._paused)
|
|
1256
1256
|
return this;
|
|
1257
1257
|
const t = this.settings, e = this.__fx;
|
|
1258
|
-
let i =
|
|
1258
|
+
let i = V.integer(t.spawnCountMin, t.spawnCountMax) * e.particleFac;
|
|
1259
1259
|
for (this.core.prepare(i); --i > -1; ) {
|
|
1260
1260
|
if (this._particleCount >= t.maxParticles || e.particleCount >= e.maxParticles)
|
|
1261
1261
|
return this;
|
|
@@ -1266,12 +1266,12 @@ class we extends ii {
|
|
|
1266
1266
|
c.componentId = s.componentId, a = e.__getSprite(c.componentId);
|
|
1267
1267
|
break;
|
|
1268
1268
|
case 1:
|
|
1269
|
-
c.componentId = s.componentId, a = e.__getMovieClip(c.componentId), s.componentParams && (a.loop = !(s.componentParams.loop == null || !s.componentParams.loop), a.animationSpeed =
|
|
1269
|
+
c.componentId = s.componentId, a = e.__getMovieClip(c.componentId), s.componentParams && (a.loop = !(s.componentParams.loop == null || !s.componentParams.loop), a.animationSpeed = V.float(s.componentParams.animationSpeedMin || 1, s.componentParams.animationSpeedMax || 1)), a.gotoAndPlay(0);
|
|
1270
1270
|
break;
|
|
1271
1271
|
}
|
|
1272
1272
|
a.anchor.set(s.componentParams.anchorX, s.componentParams.anchorY), c.component = a, this.core.emit(c), c.init(this, s, this._scaleMod), this._particles.add(c), this._particleCount++, e.particleCount++;
|
|
1273
1273
|
}
|
|
1274
|
-
return this.core.step(), this._nextSpawnTime =
|
|
1274
|
+
return this.core.step(), this._nextSpawnTime = V.float(t.spawnFrequencyMin, t.spawnFrequencyMax), this;
|
|
1275
1275
|
}
|
|
1276
1276
|
recycle() {
|
|
1277
1277
|
if (this.__recycled)
|
|
@@ -1391,10 +1391,10 @@ class we extends ii {
|
|
|
1391
1391
|
for (const o of a) {
|
|
1392
1392
|
switch (o.type) {
|
|
1393
1393
|
case Rt.ParticleEmitter:
|
|
1394
|
-
o.settings =
|
|
1394
|
+
o.settings = Dt(e.__getEmitterSettings(o.id));
|
|
1395
1395
|
break;
|
|
1396
1396
|
case Rt.EffectSequence:
|
|
1397
|
-
o.settings =
|
|
1397
|
+
o.settings = Dt(e.__getSequenceSettings(o.id));
|
|
1398
1398
|
break;
|
|
1399
1399
|
}
|
|
1400
1400
|
o.settings.__isClone = !0;
|
|
@@ -1404,10 +1404,10 @@ class we extends ii {
|
|
|
1404
1404
|
for (const c of s) {
|
|
1405
1405
|
switch (c.type) {
|
|
1406
1406
|
case Rt.ParticleEmitter:
|
|
1407
|
-
c.settings =
|
|
1407
|
+
c.settings = Dt(e.__getEmitterSettings(c.id));
|
|
1408
1408
|
break;
|
|
1409
1409
|
case Rt.EffectSequence:
|
|
1410
|
-
c.settings =
|
|
1410
|
+
c.settings = Dt(e.__getSequenceSettings(c.id));
|
|
1411
1411
|
break;
|
|
1412
1412
|
}
|
|
1413
1413
|
c.settings.__isClone = !0;
|
|
@@ -1418,14 +1418,14 @@ class we extends ii {
|
|
|
1418
1418
|
this.core = this.__fx.__getEmitterCore(t, this), this.core.init(this), this.core.__scaleMod = this._scaleMod, this._xPosIntialized = this._yPosIntialized = !1;
|
|
1419
1419
|
}
|
|
1420
1420
|
}
|
|
1421
|
-
class
|
|
1421
|
+
class Le extends ii {
|
|
1422
1422
|
constructor(t) {
|
|
1423
1423
|
super(t), this._list = [], this._elements = new se(), this.__on = {
|
|
1424
|
-
started: new
|
|
1425
|
-
completed: new
|
|
1426
|
-
exhausted: new
|
|
1427
|
-
effectSpawned: new
|
|
1428
|
-
triggerActivated: new
|
|
1424
|
+
started: new ut(),
|
|
1425
|
+
completed: new ut(),
|
|
1426
|
+
exhausted: new ut(),
|
|
1427
|
+
effectSpawned: new ut(),
|
|
1428
|
+
triggerActivated: new ut()
|
|
1429
1429
|
};
|
|
1430
1430
|
}
|
|
1431
1431
|
// *********************************************************************************************
|
|
@@ -1444,18 +1444,18 @@ class ke extends ii {
|
|
|
1444
1444
|
return;
|
|
1445
1445
|
if (this._time += t, !this.exhausted && e >= this._effectStartTime) {
|
|
1446
1446
|
const c = this.__fx, a = this._nextEffectSettings;
|
|
1447
|
-
let o, g,
|
|
1447
|
+
let o, g, A;
|
|
1448
1448
|
switch (a.componentType) {
|
|
1449
|
-
case
|
|
1450
|
-
o = c.__getSprite(a.componentId),
|
|
1449
|
+
case bt.Sprite:
|
|
1450
|
+
o = c.__getSprite(a.componentId), A = c.__containers[a.containerId] || this.container, A.addChild(o), o.blendMode = c.__getBlendMode(a.blendMode), o.tint = a.tint, o.scale.set(V.float(a.scaleMin, a.scaleMax) * V.float(this.settings.scaleMin, this.settings.scaleMax) * this._scaleMod), o.alpha = V.float(a.alphaMin, a.alphaMax), o.anchor.set(a.componentParams.anchorX, a.componentParams.anchorY), g = new Ot({ component: o, endTime: e + a.duration * 1e3 }), this._elements.add(g), o.x = this._x, o.y = this._y, o.rotation = this._rotation + V.float(a.rotationMin, a.rotationMax), this.__on.effectSpawned.__hasCallback && this.__on.effectSpawned.dispatch(bt.Sprite, o);
|
|
1451
1451
|
break;
|
|
1452
|
-
case
|
|
1453
|
-
o = c.__getMovieClip(a.componentId), a.componentParams.loop ? (o.animationSpeed =
|
|
1452
|
+
case bt.MovieClip:
|
|
1453
|
+
o = c.__getMovieClip(a.componentId), a.componentParams.loop ? (o.animationSpeed = V.float(a.componentParams.animationSpeedMin || 1, a.componentParams.animationSpeedMax || 1), o.loop = a.componentParams.loop || !1) : a.duration, o.anchor.set(a.componentParams.anchorX, a.componentParams.anchorY), o.gotoAndPlay(0), A = c.__containers[a.containerId] || this.container, A.addChild(o), o.blendMode = c.__getBlendMode(a.blendMode), o.tint = a.tint, o.scale.set(V.float(a.scaleMin, a.scaleMax) * V.float(this.settings.scaleMin, this.settings.scaleMax) * this._scaleMod), o.alpha = V.float(a.alphaMin, a.alphaMax), g = new Ot({ component: o, endTime: e + a.duration * 1e3 }), this._elements.add(g), o.x = this._x, o.y = this._y, o.rotation = this._rotation + V.float(a.rotationMin, a.rotationMax), this.__on.effectSpawned.__hasCallback && this.__on.effectSpawned.dispatch(bt.MovieClip, o);
|
|
1454
1454
|
break;
|
|
1455
|
-
case
|
|
1456
|
-
o = c.getParticleEmitterById(a.componentId),
|
|
1455
|
+
case bt.Emitter:
|
|
1456
|
+
o = c.getParticleEmitterById(a.componentId), A = c.__containers[a.containerId] || this.container, o.init(A, !0, V.float(a.scaleMin, a.scaleMax) * V.float(this.settings.scaleMin, this.settings.scaleMax) * this._scaleMod), g = new Ot({ component: o, endTime: o.endTime }), this._elements.add(g), o.x = this._x, o.y = this._y, o.rotation = this._rotation + o.settings.rotation, this.__on.effectSpawned.__hasCallback && this.__on.effectSpawned.dispatch(bt.Emitter, o);
|
|
1457
1457
|
break;
|
|
1458
|
-
case
|
|
1458
|
+
case bt.Trigger:
|
|
1459
1459
|
this.__on.triggerActivated.__hasCallback && this.__on.triggerActivated.dispatch(a.triggerValue);
|
|
1460
1460
|
break;
|
|
1461
1461
|
}
|
|
@@ -1536,21 +1536,21 @@ class ke extends ii {
|
|
|
1536
1536
|
this.settings = t, this.name = t.name, this._list = t.effects.slice(), this.__recycled = !1;
|
|
1537
1537
|
}
|
|
1538
1538
|
}
|
|
1539
|
-
function
|
|
1540
|
-
const { emit: t, settings: e = {} } = h, { name: i } =
|
|
1539
|
+
function Vr(h) {
|
|
1540
|
+
const { emit: t, settings: e = {} } = h, { name: i } = kt(h), s = new gt();
|
|
1541
1541
|
let c;
|
|
1542
|
-
return
|
|
1542
|
+
return _t.Assets.add({ alias: "fx_settings", src: "/default-bundle.json" }), _t.Assets.add({
|
|
1543
1543
|
alias: "fx_spritesheet",
|
|
1544
1544
|
src: "/revoltfx-spritesheet.json"
|
|
1545
|
-
}),
|
|
1545
|
+
}), Ae(({ deltaRatio: a }) => {
|
|
1546
1546
|
s.update(a);
|
|
1547
|
-
}),
|
|
1547
|
+
}), Ie(async (a) => {
|
|
1548
1548
|
c = a;
|
|
1549
|
-
let g = { ...(await
|
|
1549
|
+
let g = { ...(await _t.Assets.load(["fx_settings", "fx_spritesheet"])).fx_settings };
|
|
1550
1550
|
if (e.emitters) {
|
|
1551
|
-
const E = e.emitters.map((S,
|
|
1551
|
+
const E = e.emitters.map((S, I) => ({
|
|
1552
1552
|
...S,
|
|
1553
|
-
id: 1e4 +
|
|
1553
|
+
id: 1e4 + I
|
|
1554
1554
|
}));
|
|
1555
1555
|
g.emitters = [
|
|
1556
1556
|
...g.emitters,
|
|
@@ -1560,19 +1560,19 @@ function Yr(h) {
|
|
|
1560
1560
|
s.initBundle(g, !0);
|
|
1561
1561
|
}), pi(t, () => {
|
|
1562
1562
|
s.getParticleEmitter(i()).init(c.componentInstance);
|
|
1563
|
-
}),
|
|
1563
|
+
}), ht(Nt);
|
|
1564
1564
|
}
|
|
1565
|
-
function
|
|
1566
|
-
const { radius: t } =
|
|
1567
|
-
const g = Date.now() * c,
|
|
1565
|
+
function Gr(h) {
|
|
1566
|
+
const { radius: t } = kt(h), e = mi(1), i = 1, s = 2, c = 1e-3, a = () => {
|
|
1567
|
+
const g = Date.now() * c, A = (Math.sin(g) + Math.sin(g * 1.3) + Math.sin(g * 0.7)) / 3, E = i + (s - i) * (A * 0.5 + 0.5);
|
|
1568
1568
|
e.update(() => E), requestAnimationFrame(a);
|
|
1569
1569
|
};
|
|
1570
|
-
return a(),
|
|
1570
|
+
return a(), ht(qt, {
|
|
1571
1571
|
draw: (g) => {
|
|
1572
|
-
const
|
|
1572
|
+
const A = t() * 2, E = new _i(A, A, 0, A, A, 0);
|
|
1573
1573
|
E.addColorStop(0, "rgba(255, 255, 0, 1)"), E.addColorStop(0.5, "rgba(255, 255, 0, 0.3)"), E.addColorStop(0.8, "rgba(255, 255, 0, 0)");
|
|
1574
|
-
const S =
|
|
1575
|
-
g.rect(-S, -S,
|
|
1574
|
+
const S = A / 2;
|
|
1575
|
+
g.rect(-S, -S, A, A).fill(
|
|
1576
1576
|
E.render({ translate: { x: S, y: S } })
|
|
1577
1577
|
);
|
|
1578
1578
|
},
|
|
@@ -1580,38 +1580,38 @@ function Vr(h) {
|
|
|
1580
1580
|
scale: e
|
|
1581
1581
|
});
|
|
1582
1582
|
}
|
|
1583
|
-
function
|
|
1584
|
-
const { children: t } = h, e =
|
|
1583
|
+
function Kr(h) {
|
|
1584
|
+
const { children: t } = h, e = $(0), i = $(0);
|
|
1585
1585
|
let s;
|
|
1586
1586
|
const c = (a) => {
|
|
1587
1587
|
a.rect(-80, -80, e() + 160, i() + 160), a.fill(0);
|
|
1588
|
-
const g = (
|
|
1589
|
-
const E = oe(
|
|
1590
|
-
a.circle(E, S,
|
|
1588
|
+
const g = (A) => {
|
|
1589
|
+
const E = oe(A.propObservables.x) ? A.propObservables.x() : A.props.x, S = oe(A.propObservables.y) ? A.propObservables.y() : A.props.y, I = oe(A.propObservables.radius) ? A.propObservables.radius() : A.props.radius;
|
|
1590
|
+
a.circle(E, S, I), a.cut();
|
|
1591
1591
|
};
|
|
1592
|
-
for (let
|
|
1593
|
-
if (gi(
|
|
1594
|
-
s && s.unsubscribe(), s =
|
|
1592
|
+
for (let A of t) {
|
|
1593
|
+
if (gi(A)) {
|
|
1594
|
+
s && s.unsubscribe(), s = A.subscribe((E) => {
|
|
1595
1595
|
for (let S of E.fullElements)
|
|
1596
1596
|
g(S);
|
|
1597
1597
|
});
|
|
1598
1598
|
return;
|
|
1599
1599
|
}
|
|
1600
|
-
g(
|
|
1600
|
+
g(A);
|
|
1601
1601
|
}
|
|
1602
1602
|
};
|
|
1603
|
-
return
|
|
1603
|
+
return Ie((a) => {
|
|
1604
1604
|
a.componentInstance.on("layout", (o) => {
|
|
1605
1605
|
e.update(() => a.componentInstance.getWidth()), i.update(() => a.componentInstance.getHeight());
|
|
1606
1606
|
});
|
|
1607
|
-
}),
|
|
1608
|
-
|
|
1607
|
+
}), ht(
|
|
1608
|
+
Nt,
|
|
1609
1609
|
{
|
|
1610
1610
|
width: "100%",
|
|
1611
1611
|
height: "100%",
|
|
1612
1612
|
...h
|
|
1613
1613
|
},
|
|
1614
|
-
|
|
1614
|
+
ht(qt, {
|
|
1615
1615
|
draw: c,
|
|
1616
1616
|
alpha: 0.8,
|
|
1617
1617
|
blur: 80
|
|
@@ -1628,40 +1628,40 @@ function qr(h = {}) {
|
|
|
1628
1628
|
segments: c = 8,
|
|
1629
1629
|
segmentWidth: a = 3,
|
|
1630
1630
|
inactiveAlpha: o = 0.15
|
|
1631
|
-
} =
|
|
1631
|
+
} = kt(h, {
|
|
1632
1632
|
size: 30,
|
|
1633
1633
|
color: "#3498db",
|
|
1634
1634
|
speed: 180,
|
|
1635
1635
|
segments: 8,
|
|
1636
1636
|
segmentWidth: 3,
|
|
1637
1637
|
inactiveAlpha: 0.15
|
|
1638
|
-
}), g =
|
|
1639
|
-
|
|
1638
|
+
}), g = $(0);
|
|
1639
|
+
Ae(({ deltaTime: B }) => {
|
|
1640
1640
|
const P = (typeof s == "function" ? s() : s) * B / 1e3;
|
|
1641
1641
|
g.set(g() + P);
|
|
1642
1642
|
});
|
|
1643
|
-
const
|
|
1644
|
-
const
|
|
1643
|
+
const A = (B) => {
|
|
1644
|
+
const N = typeof t == "function" ? t() : t, P = typeof e == "function" ? e() : e, m = i ? typeof i == "function" ? i() : i : null, v = typeof c == "function" ? c() : c;
|
|
1645
1645
|
typeof a == "function" && a();
|
|
1646
|
-
const
|
|
1647
|
-
|
|
1648
|
-
const b = 360 / v,
|
|
1646
|
+
const _ = typeof o == "function" ? o() : o, d = g();
|
|
1647
|
+
m && B.circle(0, 0, N).fill(m);
|
|
1648
|
+
const b = 360 / v, D = N * 0.4, O = N;
|
|
1649
1649
|
for (let R = 0; R < v; R++) {
|
|
1650
|
-
const y = R * b,
|
|
1651
|
-
let
|
|
1652
|
-
|
|
1653
|
-
let
|
|
1654
|
-
|
|
1655
|
-
const lt =
|
|
1656
|
-
B.arc(0, 0,
|
|
1657
|
-
}
|
|
1658
|
-
}, S = (typeof t == "function" ? t() : t) * 2,
|
|
1650
|
+
const y = R * b, k = (d % 360 + 360) % 360;
|
|
1651
|
+
let et = Math.abs(k - y);
|
|
1652
|
+
et > 180 && (et = 360 - et);
|
|
1653
|
+
let j = et / 120;
|
|
1654
|
+
j = Math.min(1, j), j = j * j * j;
|
|
1655
|
+
const lt = _ + (1 - j) * (1 - _), nt = y * (Math.PI / 180), ft = b * (Math.PI / 180), L = nt - ft / 2, at = nt + ft / 2;
|
|
1656
|
+
B.arc(0, 0, D, L, at).arc(0, 0, O, at, L, !0).fill({ color: P, alpha: lt });
|
|
1657
|
+
}
|
|
1658
|
+
}, S = (typeof t == "function" ? t() : t) * 2, I = typeof t == "function" ? $(S) : $(S), F = typeof t == "function" ? $(S) : $(S);
|
|
1659
1659
|
return typeof t == "function" && Ze(() => {
|
|
1660
1660
|
const B = t();
|
|
1661
|
-
|
|
1662
|
-
}),
|
|
1663
|
-
|
|
1664
|
-
draw:
|
|
1661
|
+
I.set(B * 2), F.set(B * 2);
|
|
1662
|
+
}), ht(Nt, h, [
|
|
1663
|
+
ht(qt, {
|
|
1664
|
+
draw: A
|
|
1665
1665
|
})
|
|
1666
1666
|
]);
|
|
1667
1667
|
}
|
|
@@ -1669,7 +1669,7 @@ var Ut = /* @__PURE__ */ ((h) => (h.Tile = "tilelayer", h.ObjectGroup = "objectg
|
|
|
1669
1669
|
function ri(...h) {
|
|
1670
1670
|
return h.filter((t) => t && t.length > 0).join("/").replace(/\/+/g, "/");
|
|
1671
1671
|
}
|
|
1672
|
-
function
|
|
1672
|
+
function Ki(h) {
|
|
1673
1673
|
if (Object.prototype.hasOwnProperty.call(h, "__esModule")) return h;
|
|
1674
1674
|
var t = h.default;
|
|
1675
1675
|
if (typeof t == "function") {
|
|
@@ -1689,14 +1689,14 @@ function qi(h) {
|
|
|
1689
1689
|
}), e;
|
|
1690
1690
|
}
|
|
1691
1691
|
var ce = {};
|
|
1692
|
-
const
|
|
1692
|
+
const qi = {}, ji = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1693
1693
|
__proto__: null,
|
|
1694
|
-
default:
|
|
1695
|
-
}, Symbol.toStringTag, { value: "Module" })), zi = /* @__PURE__ */
|
|
1696
|
-
var ue = {},
|
|
1697
|
-
function
|
|
1698
|
-
if (
|
|
1699
|
-
|
|
1694
|
+
default: qi
|
|
1695
|
+
}, Symbol.toStringTag, { value: "Module" })), zi = /* @__PURE__ */ Ki(ji);
|
|
1696
|
+
var ue = {}, Qt = { exports: {} }, he = {}, Vt = {}, ke;
|
|
1697
|
+
function $i() {
|
|
1698
|
+
if (ke) return Vt;
|
|
1699
|
+
ke = 1, Vt.byteLength = o, Vt.toByteArray = A, Vt.fromByteArray = I;
|
|
1700
1700
|
for (var h = [], t = [], e = typeof Uint8Array < "u" ? Uint8Array : Array, i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", s = 0, c = i.length; s < c; ++s)
|
|
1701
1701
|
h[s] = i[s], t[i.charCodeAt(s)] = s;
|
|
1702
1702
|
t[45] = 62, t[95] = 63;
|
|
@@ -1704,73 +1704,73 @@ function Wi() {
|
|
|
1704
1704
|
var B = F.length;
|
|
1705
1705
|
if (B % 4 > 0)
|
|
1706
1706
|
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
1707
|
-
var
|
|
1708
|
-
|
|
1709
|
-
var P =
|
|
1710
|
-
return [
|
|
1707
|
+
var N = F.indexOf("=");
|
|
1708
|
+
N === -1 && (N = B);
|
|
1709
|
+
var P = N === B ? 0 : 4 - N % 4;
|
|
1710
|
+
return [N, P];
|
|
1711
1711
|
}
|
|
1712
1712
|
function o(F) {
|
|
1713
|
-
var B = a(F),
|
|
1714
|
-
return (
|
|
1713
|
+
var B = a(F), N = B[0], P = B[1];
|
|
1714
|
+
return (N + P) * 3 / 4 - P;
|
|
1715
1715
|
}
|
|
1716
|
-
function g(F, B,
|
|
1717
|
-
return (B +
|
|
1716
|
+
function g(F, B, N) {
|
|
1717
|
+
return (B + N) * 3 / 4 - N;
|
|
1718
1718
|
}
|
|
1719
|
-
function
|
|
1720
|
-
var B,
|
|
1719
|
+
function A(F) {
|
|
1720
|
+
var B, N = a(F), P = N[0], m = N[1], v = new e(g(F, P, m)), _ = 0, d = m > 0 ? P - 4 : P, b;
|
|
1721
1721
|
for (b = 0; b < d; b += 4)
|
|
1722
|
-
B = t[F.charCodeAt(b)] << 18 | t[F.charCodeAt(b + 1)] << 12 | t[F.charCodeAt(b + 2)] << 6 | t[F.charCodeAt(b + 3)], v[
|
|
1723
|
-
return
|
|
1722
|
+
B = t[F.charCodeAt(b)] << 18 | t[F.charCodeAt(b + 1)] << 12 | t[F.charCodeAt(b + 2)] << 6 | t[F.charCodeAt(b + 3)], v[_++] = B >> 16 & 255, v[_++] = B >> 8 & 255, v[_++] = B & 255;
|
|
1723
|
+
return m === 2 && (B = t[F.charCodeAt(b)] << 2 | t[F.charCodeAt(b + 1)] >> 4, v[_++] = B & 255), m === 1 && (B = t[F.charCodeAt(b)] << 10 | t[F.charCodeAt(b + 1)] << 4 | t[F.charCodeAt(b + 2)] >> 2, v[_++] = B >> 8 & 255, v[_++] = B & 255), v;
|
|
1724
1724
|
}
|
|
1725
1725
|
function E(F) {
|
|
1726
1726
|
return h[F >> 18 & 63] + h[F >> 12 & 63] + h[F >> 6 & 63] + h[F & 63];
|
|
1727
1727
|
}
|
|
1728
|
-
function S(F, B,
|
|
1729
|
-
for (var P,
|
|
1730
|
-
P = (F[v] << 16 & 16711680) + (F[v + 1] << 8 & 65280) + (F[v + 2] & 255),
|
|
1731
|
-
return
|
|
1728
|
+
function S(F, B, N) {
|
|
1729
|
+
for (var P, m = [], v = B; v < N; v += 3)
|
|
1730
|
+
P = (F[v] << 16 & 16711680) + (F[v + 1] << 8 & 65280) + (F[v + 2] & 255), m.push(E(P));
|
|
1731
|
+
return m.join("");
|
|
1732
1732
|
}
|
|
1733
|
-
function
|
|
1734
|
-
for (var B,
|
|
1735
|
-
|
|
1736
|
-
return P === 1 ? (B = F[
|
|
1733
|
+
function I(F) {
|
|
1734
|
+
for (var B, N = F.length, P = N % 3, m = [], v = 16383, _ = 0, d = N - P; _ < d; _ += v)
|
|
1735
|
+
m.push(S(F, _, _ + v > d ? d : _ + v));
|
|
1736
|
+
return P === 1 ? (B = F[N - 1], m.push(
|
|
1737
1737
|
h[B >> 2] + h[B << 4 & 63] + "=="
|
|
1738
|
-
)) : P === 2 && (B = (F[
|
|
1738
|
+
)) : P === 2 && (B = (F[N - 2] << 8) + F[N - 1], m.push(
|
|
1739
1739
|
h[B >> 10] + h[B >> 4 & 63] + h[B << 2 & 63] + "="
|
|
1740
|
-
)),
|
|
1740
|
+
)), m.join("");
|
|
1741
1741
|
}
|
|
1742
1742
|
return Vt;
|
|
1743
1743
|
}
|
|
1744
|
-
var
|
|
1744
|
+
var Jt = {};
|
|
1745
1745
|
var Xe;
|
|
1746
|
-
function
|
|
1747
|
-
return Xe || (Xe = 1,
|
|
1748
|
-
var c, a, o = s * 8 - i - 1, g = (1 << o) - 1,
|
|
1749
|
-
for (S +=
|
|
1746
|
+
function Wi() {
|
|
1747
|
+
return Xe || (Xe = 1, Jt.read = function(h, t, e, i, s) {
|
|
1748
|
+
var c, a, o = s * 8 - i - 1, g = (1 << o) - 1, A = g >> 1, E = -7, S = e ? s - 1 : 0, I = e ? -1 : 1, F = h[t + S];
|
|
1749
|
+
for (S += I, c = F & (1 << -E) - 1, F >>= -E, E += o; E > 0; c = c * 256 + h[t + S], S += I, E -= 8)
|
|
1750
1750
|
;
|
|
1751
|
-
for (a = c & (1 << -E) - 1, c >>= -E, E += i; E > 0; a = a * 256 + h[t + S], S +=
|
|
1751
|
+
for (a = c & (1 << -E) - 1, c >>= -E, E += i; E > 0; a = a * 256 + h[t + S], S += I, E -= 8)
|
|
1752
1752
|
;
|
|
1753
1753
|
if (c === 0)
|
|
1754
|
-
c = 1 -
|
|
1754
|
+
c = 1 - A;
|
|
1755
1755
|
else {
|
|
1756
1756
|
if (c === g)
|
|
1757
1757
|
return a ? NaN : (F ? -1 : 1) * (1 / 0);
|
|
1758
|
-
a = a + Math.pow(2, i), c = c -
|
|
1758
|
+
a = a + Math.pow(2, i), c = c - A;
|
|
1759
1759
|
}
|
|
1760
1760
|
return (F ? -1 : 1) * a * Math.pow(2, c - i);
|
|
1761
|
-
},
|
|
1762
|
-
var a, o, g,
|
|
1763
|
-
for (t = Math.abs(t), isNaN(t) || t === 1 / 0 ? (o = isNaN(t) ? 1 : 0, a = E) : (a = Math.floor(Math.log(t) / Math.LN2), t * (g = Math.pow(2, -a)) < 1 && (a--, g *= 2), a + S >= 1 ? t +=
|
|
1761
|
+
}, Jt.write = function(h, t, e, i, s, c) {
|
|
1762
|
+
var a, o, g, A = c * 8 - s - 1, E = (1 << A) - 1, S = E >> 1, I = s === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, F = i ? 0 : c - 1, B = i ? 1 : -1, N = t < 0 || t === 0 && 1 / t < 0 ? 1 : 0;
|
|
1763
|
+
for (t = Math.abs(t), isNaN(t) || t === 1 / 0 ? (o = isNaN(t) ? 1 : 0, a = E) : (a = Math.floor(Math.log(t) / Math.LN2), t * (g = Math.pow(2, -a)) < 1 && (a--, g *= 2), a + S >= 1 ? t += I / g : t += I * Math.pow(2, 1 - S), t * g >= 2 && (a++, g /= 2), a + S >= E ? (o = 0, a = E) : a + S >= 1 ? (o = (t * g - 1) * Math.pow(2, s), a = a + S) : (o = t * Math.pow(2, S - 1) * Math.pow(2, s), a = 0)); s >= 8; h[e + F] = o & 255, F += B, o /= 256, s -= 8)
|
|
1764
1764
|
;
|
|
1765
|
-
for (a = a << s | o,
|
|
1765
|
+
for (a = a << s | o, A += s; A > 0; h[e + F] = a & 255, F += B, a /= 256, A -= 8)
|
|
1766
1766
|
;
|
|
1767
|
-
h[e + F - B] |=
|
|
1768
|
-
}),
|
|
1767
|
+
h[e + F - B] |= N * 128;
|
|
1768
|
+
}), Jt;
|
|
1769
1769
|
}
|
|
1770
1770
|
var Ye;
|
|
1771
1771
|
function si() {
|
|
1772
1772
|
return Ye || (Ye = 1, (function(h) {
|
|
1773
|
-
const t =
|
|
1773
|
+
const t = $i(), e = Wi(), i = typeof Symbol == "function" && typeof Symbol.for == "function" ? /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom") : null;
|
|
1774
1774
|
h.Buffer = o, h.SlowBuffer = v, h.INSPECT_MAX_BYTES = 50;
|
|
1775
1775
|
const s = 2147483647;
|
|
1776
1776
|
h.kMaxLength = s, o.TYPED_ARRAY_SUPPORT = c(), !o.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
|
|
@@ -1818,15 +1818,15 @@ function si() {
|
|
|
1818
1818
|
o.poolSize = 8192;
|
|
1819
1819
|
function g(u, r, n) {
|
|
1820
1820
|
if (typeof u == "string")
|
|
1821
|
-
return
|
|
1821
|
+
return I(u, r);
|
|
1822
1822
|
if (ArrayBuffer.isView(u))
|
|
1823
1823
|
return B(u);
|
|
1824
1824
|
if (u == null)
|
|
1825
1825
|
throw new TypeError(
|
|
1826
1826
|
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof u
|
|
1827
1827
|
);
|
|
1828
|
-
if (
|
|
1829
|
-
return
|
|
1828
|
+
if (mt(u, ArrayBuffer) || u && mt(u.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (mt(u, SharedArrayBuffer) || u && mt(u.buffer, SharedArrayBuffer)))
|
|
1829
|
+
return N(u, r, n);
|
|
1830
1830
|
if (typeof u == "number")
|
|
1831
1831
|
throw new TypeError(
|
|
1832
1832
|
'The "value" argument must not be of type number. Received type number'
|
|
@@ -1845,48 +1845,48 @@ function si() {
|
|
|
1845
1845
|
o.from = function(u, r, n) {
|
|
1846
1846
|
return g(u, r, n);
|
|
1847
1847
|
}, Object.setPrototypeOf(o.prototype, Uint8Array.prototype), Object.setPrototypeOf(o, Uint8Array);
|
|
1848
|
-
function
|
|
1848
|
+
function A(u) {
|
|
1849
1849
|
if (typeof u != "number")
|
|
1850
1850
|
throw new TypeError('"size" argument must be of type number');
|
|
1851
1851
|
if (u < 0)
|
|
1852
1852
|
throw new RangeError('The value "' + u + '" is invalid for option "size"');
|
|
1853
1853
|
}
|
|
1854
1854
|
function E(u, r, n) {
|
|
1855
|
-
return
|
|
1855
|
+
return A(u), u <= 0 ? a(u) : r !== void 0 ? typeof n == "string" ? a(u).fill(r, n) : a(u).fill(r) : a(u);
|
|
1856
1856
|
}
|
|
1857
1857
|
o.alloc = function(u, r, n) {
|
|
1858
1858
|
return E(u, r, n);
|
|
1859
1859
|
};
|
|
1860
1860
|
function S(u) {
|
|
1861
|
-
return
|
|
1861
|
+
return A(u), a(u < 0 ? 0 : m(u) | 0);
|
|
1862
1862
|
}
|
|
1863
1863
|
o.allocUnsafe = function(u) {
|
|
1864
1864
|
return S(u);
|
|
1865
1865
|
}, o.allocUnsafeSlow = function(u) {
|
|
1866
1866
|
return S(u);
|
|
1867
1867
|
};
|
|
1868
|
-
function
|
|
1868
|
+
function I(u, r) {
|
|
1869
1869
|
if ((typeof r != "string" || r === "") && (r = "utf8"), !o.isEncoding(r))
|
|
1870
1870
|
throw new TypeError("Unknown encoding: " + r);
|
|
1871
|
-
const n =
|
|
1871
|
+
const n = _(u, r) | 0;
|
|
1872
1872
|
let p = a(n);
|
|
1873
1873
|
const x = p.write(u, r);
|
|
1874
1874
|
return x !== n && (p = p.slice(0, x)), p;
|
|
1875
1875
|
}
|
|
1876
1876
|
function F(u) {
|
|
1877
|
-
const r = u.length < 0 ? 0 :
|
|
1877
|
+
const r = u.length < 0 ? 0 : m(u.length) | 0, n = a(r);
|
|
1878
1878
|
for (let p = 0; p < r; p += 1)
|
|
1879
1879
|
n[p] = u[p] & 255;
|
|
1880
1880
|
return n;
|
|
1881
1881
|
}
|
|
1882
1882
|
function B(u) {
|
|
1883
|
-
if (
|
|
1883
|
+
if (mt(u, Uint8Array)) {
|
|
1884
1884
|
const r = new Uint8Array(u);
|
|
1885
|
-
return
|
|
1885
|
+
return N(r.buffer, r.byteOffset, r.byteLength);
|
|
1886
1886
|
}
|
|
1887
1887
|
return F(u);
|
|
1888
1888
|
}
|
|
1889
|
-
function
|
|
1889
|
+
function N(u, r, n) {
|
|
1890
1890
|
if (r < 0 || u.byteLength < r)
|
|
1891
1891
|
throw new RangeError('"offset" is outside of buffer bounds');
|
|
1892
1892
|
if (u.byteLength < r + (n || 0))
|
|
@@ -1896,7 +1896,7 @@ function si() {
|
|
|
1896
1896
|
}
|
|
1897
1897
|
function P(u) {
|
|
1898
1898
|
if (o.isBuffer(u)) {
|
|
1899
|
-
const r =
|
|
1899
|
+
const r = m(u.length) | 0, n = a(r);
|
|
1900
1900
|
return n.length === 0 || u.copy(n, 0, 0, r), n;
|
|
1901
1901
|
}
|
|
1902
1902
|
if (u.length !== void 0)
|
|
@@ -1904,7 +1904,7 @@ function si() {
|
|
|
1904
1904
|
if (u.type === "Buffer" && Array.isArray(u.data))
|
|
1905
1905
|
return F(u.data);
|
|
1906
1906
|
}
|
|
1907
|
-
function
|
|
1907
|
+
function m(u) {
|
|
1908
1908
|
if (u >= s)
|
|
1909
1909
|
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + s.toString(16) + " bytes");
|
|
1910
1910
|
return u | 0;
|
|
@@ -1915,15 +1915,15 @@ function si() {
|
|
|
1915
1915
|
o.isBuffer = function(r) {
|
|
1916
1916
|
return r != null && r._isBuffer === !0 && r !== o.prototype;
|
|
1917
1917
|
}, o.compare = function(r, n) {
|
|
1918
|
-
if (
|
|
1918
|
+
if (mt(r, Uint8Array) && (r = o.from(r, r.offset, r.byteLength)), mt(n, Uint8Array) && (n = o.from(n, n.offset, n.byteLength)), !o.isBuffer(r) || !o.isBuffer(n))
|
|
1919
1919
|
throw new TypeError(
|
|
1920
1920
|
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
|
|
1921
1921
|
);
|
|
1922
1922
|
if (r === n) return 0;
|
|
1923
1923
|
let p = r.length, x = n.length;
|
|
1924
|
-
for (let
|
|
1925
|
-
if (r[
|
|
1926
|
-
p = r[
|
|
1924
|
+
for (let T = 0, C = Math.min(p, x); T < C; ++T)
|
|
1925
|
+
if (r[T] !== n[T]) {
|
|
1926
|
+
p = r[T], x = n[T];
|
|
1927
1927
|
break;
|
|
1928
1928
|
}
|
|
1929
1929
|
return p < x ? -1 : x < p ? 1 : 0;
|
|
@@ -1954,27 +1954,27 @@ function si() {
|
|
|
1954
1954
|
for (n = 0, p = 0; p < r.length; ++p)
|
|
1955
1955
|
n += r[p].length;
|
|
1956
1956
|
const x = o.allocUnsafe(n);
|
|
1957
|
-
let
|
|
1957
|
+
let T = 0;
|
|
1958
1958
|
for (p = 0; p < r.length; ++p) {
|
|
1959
1959
|
let C = r[p];
|
|
1960
|
-
if (
|
|
1961
|
-
|
|
1960
|
+
if (mt(C, Uint8Array))
|
|
1961
|
+
T + C.length > x.length ? (o.isBuffer(C) || (C = o.from(C)), C.copy(x, T)) : Uint8Array.prototype.set.call(
|
|
1962
1962
|
x,
|
|
1963
1963
|
C,
|
|
1964
|
-
|
|
1964
|
+
T
|
|
1965
1965
|
);
|
|
1966
1966
|
else if (o.isBuffer(C))
|
|
1967
|
-
C.copy(x,
|
|
1967
|
+
C.copy(x, T);
|
|
1968
1968
|
else
|
|
1969
1969
|
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
1970
|
-
|
|
1970
|
+
T += C.length;
|
|
1971
1971
|
}
|
|
1972
1972
|
return x;
|
|
1973
1973
|
};
|
|
1974
|
-
function
|
|
1974
|
+
function _(u, r) {
|
|
1975
1975
|
if (o.isBuffer(u))
|
|
1976
1976
|
return u.length;
|
|
1977
|
-
if (ArrayBuffer.isView(u) ||
|
|
1977
|
+
if (ArrayBuffer.isView(u) || mt(u, ArrayBuffer))
|
|
1978
1978
|
return u.byteLength;
|
|
1979
1979
|
if (typeof u != "string")
|
|
1980
1980
|
throw new TypeError(
|
|
@@ -1991,7 +1991,7 @@ function si() {
|
|
|
1991
1991
|
return n;
|
|
1992
1992
|
case "utf8":
|
|
1993
1993
|
case "utf-8":
|
|
1994
|
-
return
|
|
1994
|
+
return tt(u).length;
|
|
1995
1995
|
case "ucs2":
|
|
1996
1996
|
case "ucs-2":
|
|
1997
1997
|
case "utf16le":
|
|
@@ -2003,11 +2003,11 @@ function si() {
|
|
|
2003
2003
|
return Yt(u).length;
|
|
2004
2004
|
default:
|
|
2005
2005
|
if (x)
|
|
2006
|
-
return p ? -1 :
|
|
2006
|
+
return p ? -1 : tt(u).length;
|
|
2007
2007
|
r = ("" + r).toLowerCase(), x = !0;
|
|
2008
2008
|
}
|
|
2009
2009
|
}
|
|
2010
|
-
o.byteLength =
|
|
2010
|
+
o.byteLength = _;
|
|
2011
2011
|
function d(u, r, n) {
|
|
2012
2012
|
let p = !1;
|
|
2013
2013
|
if ((r === void 0 || r < 0) && (r = 0), r > this.length || ((n === void 0 || n > this.length) && (n = this.length), n <= 0) || (n >>>= 0, r >>>= 0, n <= r))
|
|
@@ -2015,22 +2015,22 @@ function si() {
|
|
|
2015
2015
|
for (u || (u = "utf8"); ; )
|
|
2016
2016
|
switch (u) {
|
|
2017
2017
|
case "hex":
|
|
2018
|
-
return
|
|
2018
|
+
return rt(this, r, n);
|
|
2019
2019
|
case "utf8":
|
|
2020
2020
|
case "utf-8":
|
|
2021
2021
|
return lt(this, r, n);
|
|
2022
2022
|
case "ascii":
|
|
2023
|
-
return
|
|
2023
|
+
return L(this, r, n);
|
|
2024
2024
|
case "latin1":
|
|
2025
2025
|
case "binary":
|
|
2026
|
-
return
|
|
2026
|
+
return at(this, r, n);
|
|
2027
2027
|
case "base64":
|
|
2028
|
-
return
|
|
2028
|
+
return j(this, r, n);
|
|
2029
2029
|
case "ucs2":
|
|
2030
2030
|
case "ucs-2":
|
|
2031
2031
|
case "utf16le":
|
|
2032
2032
|
case "utf-16le":
|
|
2033
|
-
return
|
|
2033
|
+
return W(this, r, n);
|
|
2034
2034
|
default:
|
|
2035
2035
|
if (p) throw new TypeError("Unknown encoding: " + u);
|
|
2036
2036
|
u = (u + "").toLowerCase(), p = !0;
|
|
@@ -2072,30 +2072,30 @@ function si() {
|
|
|
2072
2072
|
let r = "";
|
|
2073
2073
|
const n = h.INSPECT_MAX_BYTES;
|
|
2074
2074
|
return r = this.toString("hex", 0, n).replace(/(.{2})/g, "$1 ").trim(), this.length > n && (r += " ... "), "<Buffer " + r + ">";
|
|
2075
|
-
}, i && (o.prototype[i] = o.prototype.inspect), o.prototype.compare = function(r, n, p, x,
|
|
2076
|
-
if (
|
|
2075
|
+
}, i && (o.prototype[i] = o.prototype.inspect), o.prototype.compare = function(r, n, p, x, T) {
|
|
2076
|
+
if (mt(r, Uint8Array) && (r = o.from(r, r.offset, r.byteLength)), !o.isBuffer(r))
|
|
2077
2077
|
throw new TypeError(
|
|
2078
2078
|
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof r
|
|
2079
2079
|
);
|
|
2080
|
-
if (n === void 0 && (n = 0), p === void 0 && (p = r ? r.length : 0), x === void 0 && (x = 0),
|
|
2080
|
+
if (n === void 0 && (n = 0), p === void 0 && (p = r ? r.length : 0), x === void 0 && (x = 0), T === void 0 && (T = this.length), n < 0 || p > r.length || x < 0 || T > this.length)
|
|
2081
2081
|
throw new RangeError("out of range index");
|
|
2082
|
-
if (x >=
|
|
2082
|
+
if (x >= T && n >= p)
|
|
2083
2083
|
return 0;
|
|
2084
|
-
if (x >=
|
|
2084
|
+
if (x >= T)
|
|
2085
2085
|
return -1;
|
|
2086
2086
|
if (n >= p)
|
|
2087
2087
|
return 1;
|
|
2088
|
-
if (n >>>= 0, p >>>= 0, x >>>= 0,
|
|
2089
|
-
let C =
|
|
2090
|
-
const J = Math.min(C,
|
|
2088
|
+
if (n >>>= 0, p >>>= 0, x >>>= 0, T >>>= 0, this === r) return 0;
|
|
2089
|
+
let C = T - x, Y = p - n;
|
|
2090
|
+
const J = Math.min(C, Y), H = this.slice(x, T), Z = r.slice(n, p);
|
|
2091
2091
|
for (let q = 0; q < J; ++q)
|
|
2092
2092
|
if (H[q] !== Z[q]) {
|
|
2093
|
-
C = H[q],
|
|
2093
|
+
C = H[q], Y = Z[q];
|
|
2094
2094
|
break;
|
|
2095
2095
|
}
|
|
2096
|
-
return C <
|
|
2096
|
+
return C < Y ? -1 : Y < C ? 1 : 0;
|
|
2097
2097
|
};
|
|
2098
|
-
function
|
|
2098
|
+
function D(u, r, n, p, x) {
|
|
2099
2099
|
if (u.length === 0) return -1;
|
|
2100
2100
|
if (typeof n == "string" ? (p = n, n = 0) : n > 2147483647 ? n = 2147483647 : n < -2147483648 && (n = -2147483648), n = +n, ae(n) && (n = x ? 0 : u.length - 1), n < 0 && (n = u.length + n), n >= u.length) {
|
|
2101
2101
|
if (x) return -1;
|
|
@@ -2110,27 +2110,27 @@ function si() {
|
|
|
2110
2110
|
throw new TypeError("val must be string, number or Buffer");
|
|
2111
2111
|
}
|
|
2112
2112
|
function O(u, r, n, p, x) {
|
|
2113
|
-
let
|
|
2113
|
+
let T = 1, C = u.length, Y = r.length;
|
|
2114
2114
|
if (p !== void 0 && (p = String(p).toLowerCase(), p === "ucs2" || p === "ucs-2" || p === "utf16le" || p === "utf-16le")) {
|
|
2115
2115
|
if (u.length < 2 || r.length < 2)
|
|
2116
2116
|
return -1;
|
|
2117
|
-
|
|
2117
|
+
T = 2, C /= 2, Y /= 2, n /= 2;
|
|
2118
2118
|
}
|
|
2119
2119
|
function J(Z, q) {
|
|
2120
|
-
return
|
|
2120
|
+
return T === 1 ? Z[q] : Z.readUInt16BE(q * T);
|
|
2121
2121
|
}
|
|
2122
2122
|
let H;
|
|
2123
2123
|
if (x) {
|
|
2124
2124
|
let Z = -1;
|
|
2125
2125
|
for (H = n; H < C; H++)
|
|
2126
2126
|
if (J(u, H) === J(r, Z === -1 ? 0 : H - Z)) {
|
|
2127
|
-
if (Z === -1 && (Z = H), H - Z + 1 ===
|
|
2127
|
+
if (Z === -1 && (Z = H), H - Z + 1 === Y) return Z * T;
|
|
2128
2128
|
} else
|
|
2129
2129
|
Z !== -1 && (H -= H - Z), Z = -1;
|
|
2130
2130
|
} else
|
|
2131
|
-
for (n +
|
|
2131
|
+
for (n + Y > C && (n = C - Y), H = n; H >= 0; H--) {
|
|
2132
2132
|
let Z = !0;
|
|
2133
|
-
for (let q = 0; q <
|
|
2133
|
+
for (let q = 0; q < Y; q++)
|
|
2134
2134
|
if (J(u, H + q) !== J(r, q)) {
|
|
2135
2135
|
Z = !1;
|
|
2136
2136
|
break;
|
|
@@ -2142,34 +2142,34 @@ function si() {
|
|
|
2142
2142
|
o.prototype.includes = function(r, n, p) {
|
|
2143
2143
|
return this.indexOf(r, n, p) !== -1;
|
|
2144
2144
|
}, o.prototype.indexOf = function(r, n, p) {
|
|
2145
|
-
return
|
|
2145
|
+
return D(this, r, n, p, !0);
|
|
2146
2146
|
}, o.prototype.lastIndexOf = function(r, n, p) {
|
|
2147
|
-
return
|
|
2147
|
+
return D(this, r, n, p, !1);
|
|
2148
2148
|
};
|
|
2149
2149
|
function R(u, r, n, p) {
|
|
2150
2150
|
n = Number(n) || 0;
|
|
2151
2151
|
const x = u.length - n;
|
|
2152
2152
|
p ? (p = Number(p), p > x && (p = x)) : p = x;
|
|
2153
|
-
const
|
|
2154
|
-
p >
|
|
2153
|
+
const T = r.length;
|
|
2154
|
+
p > T / 2 && (p = T / 2);
|
|
2155
2155
|
let C;
|
|
2156
2156
|
for (C = 0; C < p; ++C) {
|
|
2157
|
-
const
|
|
2158
|
-
if (ae(
|
|
2159
|
-
u[n + C] =
|
|
2157
|
+
const Y = parseInt(r.substr(C * 2, 2), 16);
|
|
2158
|
+
if (ae(Y)) return C;
|
|
2159
|
+
u[n + C] = Y;
|
|
2160
2160
|
}
|
|
2161
2161
|
return C;
|
|
2162
2162
|
}
|
|
2163
2163
|
function y(u, r, n, p) {
|
|
2164
|
-
return St(
|
|
2164
|
+
return St(tt(r, u.length - n), u, n, p);
|
|
2165
2165
|
}
|
|
2166
|
-
function
|
|
2167
|
-
return St(
|
|
2166
|
+
function k(u, r, n, p) {
|
|
2167
|
+
return St(xt(r), u, n, p);
|
|
2168
2168
|
}
|
|
2169
|
-
function
|
|
2169
|
+
function et(u, r, n, p) {
|
|
2170
2170
|
return St(Yt(r), u, n, p);
|
|
2171
2171
|
}
|
|
2172
|
-
function
|
|
2172
|
+
function G(u, r, n, p) {
|
|
2173
2173
|
return St(ne(r, u.length - n), u, n, p);
|
|
2174
2174
|
}
|
|
2175
2175
|
o.prototype.write = function(r, n, p, x) {
|
|
@@ -2183,8 +2183,8 @@ function si() {
|
|
|
2183
2183
|
throw new Error(
|
|
2184
2184
|
"Buffer.write(string, encoding, offset[, length]) is no longer supported"
|
|
2185
2185
|
);
|
|
2186
|
-
const
|
|
2187
|
-
if ((p === void 0 || p >
|
|
2186
|
+
const T = this.length - n;
|
|
2187
|
+
if ((p === void 0 || p > T) && (p = T), r.length > 0 && (p < 0 || n < 0) || n > this.length)
|
|
2188
2188
|
throw new RangeError("Attempt to write outside buffer bounds");
|
|
2189
2189
|
x || (x = "utf8");
|
|
2190
2190
|
let C = !1;
|
|
@@ -2198,14 +2198,14 @@ function si() {
|
|
|
2198
2198
|
case "ascii":
|
|
2199
2199
|
case "latin1":
|
|
2200
2200
|
case "binary":
|
|
2201
|
-
return
|
|
2201
|
+
return k(this, r, n, p);
|
|
2202
2202
|
case "base64":
|
|
2203
|
-
return
|
|
2203
|
+
return et(this, r, n, p);
|
|
2204
2204
|
case "ucs2":
|
|
2205
2205
|
case "ucs-2":
|
|
2206
2206
|
case "utf16le":
|
|
2207
2207
|
case "utf-16le":
|
|
2208
|
-
return
|
|
2208
|
+
return G(this, r, n, p);
|
|
2209
2209
|
default:
|
|
2210
2210
|
if (C) throw new TypeError("Unknown encoding: " + x);
|
|
2211
2211
|
x = ("" + x).toLowerCase(), C = !0;
|
|
@@ -2216,7 +2216,7 @@ function si() {
|
|
|
2216
2216
|
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
2217
2217
|
};
|
|
2218
2218
|
};
|
|
2219
|
-
function
|
|
2219
|
+
function j(u, r, n) {
|
|
2220
2220
|
return r === 0 && n === u.length ? t.fromByteArray(u) : t.fromByteArray(u.slice(r, n));
|
|
2221
2221
|
}
|
|
2222
2222
|
function lt(u, r, n) {
|
|
@@ -2224,68 +2224,68 @@ function si() {
|
|
|
2224
2224
|
const p = [];
|
|
2225
2225
|
let x = r;
|
|
2226
2226
|
for (; x < n; ) {
|
|
2227
|
-
const
|
|
2228
|
-
let C = null,
|
|
2229
|
-
if (x +
|
|
2227
|
+
const T = u[x];
|
|
2228
|
+
let C = null, Y = T > 239 ? 4 : T > 223 ? 3 : T > 191 ? 2 : 1;
|
|
2229
|
+
if (x + Y <= n) {
|
|
2230
2230
|
let J, H, Z, q;
|
|
2231
|
-
switch (
|
|
2231
|
+
switch (Y) {
|
|
2232
2232
|
case 1:
|
|
2233
|
-
|
|
2233
|
+
T < 128 && (C = T);
|
|
2234
2234
|
break;
|
|
2235
2235
|
case 2:
|
|
2236
|
-
J = u[x + 1], (J & 192) === 128 && (q = (
|
|
2236
|
+
J = u[x + 1], (J & 192) === 128 && (q = (T & 31) << 6 | J & 63, q > 127 && (C = q));
|
|
2237
2237
|
break;
|
|
2238
2238
|
case 3:
|
|
2239
|
-
J = u[x + 1], H = u[x + 2], (J & 192) === 128 && (H & 192) === 128 && (q = (
|
|
2239
|
+
J = u[x + 1], H = u[x + 2], (J & 192) === 128 && (H & 192) === 128 && (q = (T & 15) << 12 | (J & 63) << 6 | H & 63, q > 2047 && (q < 55296 || q > 57343) && (C = q));
|
|
2240
2240
|
break;
|
|
2241
2241
|
case 4:
|
|
2242
|
-
J = u[x + 1], H = u[x + 2], Z = u[x + 3], (J & 192) === 128 && (H & 192) === 128 && (Z & 192) === 128 && (q = (
|
|
2242
|
+
J = u[x + 1], H = u[x + 2], Z = u[x + 3], (J & 192) === 128 && (H & 192) === 128 && (Z & 192) === 128 && (q = (T & 15) << 18 | (J & 63) << 12 | (H & 63) << 6 | Z & 63, q > 65535 && q < 1114112 && (C = q));
|
|
2243
2243
|
}
|
|
2244
2244
|
}
|
|
2245
|
-
C === null ? (C = 65533,
|
|
2245
|
+
C === null ? (C = 65533, Y = 1) : C > 65535 && (C -= 65536, p.push(C >>> 10 & 1023 | 55296), C = 56320 | C & 1023), p.push(C), x += Y;
|
|
2246
2246
|
}
|
|
2247
|
-
return
|
|
2247
|
+
return ft(p);
|
|
2248
2248
|
}
|
|
2249
|
-
const
|
|
2250
|
-
function
|
|
2249
|
+
const nt = 4096;
|
|
2250
|
+
function ft(u) {
|
|
2251
2251
|
const r = u.length;
|
|
2252
|
-
if (r <=
|
|
2252
|
+
if (r <= nt)
|
|
2253
2253
|
return String.fromCharCode.apply(String, u);
|
|
2254
2254
|
let n = "", p = 0;
|
|
2255
2255
|
for (; p < r; )
|
|
2256
2256
|
n += String.fromCharCode.apply(
|
|
2257
2257
|
String,
|
|
2258
|
-
u.slice(p, p +=
|
|
2258
|
+
u.slice(p, p += nt)
|
|
2259
2259
|
);
|
|
2260
2260
|
return n;
|
|
2261
2261
|
}
|
|
2262
|
-
function
|
|
2262
|
+
function L(u, r, n) {
|
|
2263
2263
|
let p = "";
|
|
2264
2264
|
n = Math.min(u.length, n);
|
|
2265
2265
|
for (let x = r; x < n; ++x)
|
|
2266
2266
|
p += String.fromCharCode(u[x] & 127);
|
|
2267
2267
|
return p;
|
|
2268
2268
|
}
|
|
2269
|
-
function
|
|
2269
|
+
function at(u, r, n) {
|
|
2270
2270
|
let p = "";
|
|
2271
2271
|
n = Math.min(u.length, n);
|
|
2272
2272
|
for (let x = r; x < n; ++x)
|
|
2273
2273
|
p += String.fromCharCode(u[x]);
|
|
2274
2274
|
return p;
|
|
2275
2275
|
}
|
|
2276
|
-
function
|
|
2276
|
+
function rt(u, r, n) {
|
|
2277
2277
|
const p = u.length;
|
|
2278
2278
|
(!r || r < 0) && (r = 0), (!n || n < 0 || n > p) && (n = p);
|
|
2279
2279
|
let x = "";
|
|
2280
|
-
for (let
|
|
2281
|
-
x += fi[u[
|
|
2280
|
+
for (let T = r; T < n; ++T)
|
|
2281
|
+
x += fi[u[T]];
|
|
2282
2282
|
return x;
|
|
2283
2283
|
}
|
|
2284
|
-
function
|
|
2284
|
+
function W(u, r, n) {
|
|
2285
2285
|
const p = u.slice(r, n);
|
|
2286
2286
|
let x = "";
|
|
2287
|
-
for (let
|
|
2288
|
-
x += String.fromCharCode(p[
|
|
2287
|
+
for (let T = 0; T < p.length - 1; T += 2)
|
|
2288
|
+
x += String.fromCharCode(p[T] + p[T + 1] * 256);
|
|
2289
2289
|
return x;
|
|
2290
2290
|
}
|
|
2291
2291
|
o.prototype.slice = function(r, n) {
|
|
@@ -2300,15 +2300,15 @@ function si() {
|
|
|
2300
2300
|
}
|
|
2301
2301
|
o.prototype.readUintLE = o.prototype.readUIntLE = function(r, n, p) {
|
|
2302
2302
|
r = r >>> 0, n = n >>> 0, p || U(r, n, this.length);
|
|
2303
|
-
let x = this[r],
|
|
2304
|
-
for (; ++C < n && (
|
|
2305
|
-
x += this[r + C] *
|
|
2303
|
+
let x = this[r], T = 1, C = 0;
|
|
2304
|
+
for (; ++C < n && (T *= 256); )
|
|
2305
|
+
x += this[r + C] * T;
|
|
2306
2306
|
return x;
|
|
2307
2307
|
}, o.prototype.readUintBE = o.prototype.readUIntBE = function(r, n, p) {
|
|
2308
2308
|
r = r >>> 0, n = n >>> 0, p || U(r, n, this.length);
|
|
2309
|
-
let x = this[r + --n],
|
|
2310
|
-
for (; n > 0 && (
|
|
2311
|
-
x += this[r + --n] *
|
|
2309
|
+
let x = this[r + --n], T = 1;
|
|
2310
|
+
for (; n > 0 && (T *= 256); )
|
|
2311
|
+
x += this[r + --n] * T;
|
|
2312
2312
|
return x;
|
|
2313
2313
|
}, o.prototype.readUint8 = o.prototype.readUInt8 = function(r, n) {
|
|
2314
2314
|
return r = r >>> 0, n || U(r, 1, this.length), this[r];
|
|
@@ -2321,29 +2321,29 @@ function si() {
|
|
|
2321
2321
|
}, o.prototype.readUint32BE = o.prototype.readUInt32BE = function(r, n) {
|
|
2322
2322
|
return r = r >>> 0, n || U(r, 4, this.length), this[r] * 16777216 + (this[r + 1] << 16 | this[r + 2] << 8 | this[r + 3]);
|
|
2323
2323
|
}, o.prototype.readBigUInt64LE = Ct(function(r) {
|
|
2324
|
-
r = r >>> 0,
|
|
2324
|
+
r = r >>> 0, z(r, "offset");
|
|
2325
2325
|
const n = this[r], p = this[r + 7];
|
|
2326
|
-
(n === void 0 || p === void 0) &&
|
|
2327
|
-
const x = n + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + this[++r] * 2 ** 24,
|
|
2328
|
-
return BigInt(x) + (BigInt(
|
|
2326
|
+
(n === void 0 || p === void 0) && it(r, this.length - 8);
|
|
2327
|
+
const x = n + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + this[++r] * 2 ** 24, T = this[++r] + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + p * 2 ** 24;
|
|
2328
|
+
return BigInt(x) + (BigInt(T) << BigInt(32));
|
|
2329
2329
|
}), o.prototype.readBigUInt64BE = Ct(function(r) {
|
|
2330
|
-
r = r >>> 0,
|
|
2330
|
+
r = r >>> 0, z(r, "offset");
|
|
2331
2331
|
const n = this[r], p = this[r + 7];
|
|
2332
|
-
(n === void 0 || p === void 0) &&
|
|
2333
|
-
const x = n * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + this[++r],
|
|
2334
|
-
return (BigInt(x) << BigInt(32)) + BigInt(
|
|
2332
|
+
(n === void 0 || p === void 0) && it(r, this.length - 8);
|
|
2333
|
+
const x = n * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + this[++r], T = this[++r] * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + p;
|
|
2334
|
+
return (BigInt(x) << BigInt(32)) + BigInt(T);
|
|
2335
2335
|
}), o.prototype.readIntLE = function(r, n, p) {
|
|
2336
2336
|
r = r >>> 0, n = n >>> 0, p || U(r, n, this.length);
|
|
2337
|
-
let x = this[r],
|
|
2338
|
-
for (; ++C < n && (
|
|
2339
|
-
x += this[r + C] *
|
|
2340
|
-
return
|
|
2337
|
+
let x = this[r], T = 1, C = 0;
|
|
2338
|
+
for (; ++C < n && (T *= 256); )
|
|
2339
|
+
x += this[r + C] * T;
|
|
2340
|
+
return T *= 128, x >= T && (x -= Math.pow(2, 8 * n)), x;
|
|
2341
2341
|
}, o.prototype.readIntBE = function(r, n, p) {
|
|
2342
2342
|
r = r >>> 0, n = n >>> 0, p || U(r, n, this.length);
|
|
2343
|
-
let x = n,
|
|
2344
|
-
for (; x > 0 && (
|
|
2345
|
-
C += this[r + --x] *
|
|
2346
|
-
return
|
|
2343
|
+
let x = n, T = 1, C = this[r + --x];
|
|
2344
|
+
for (; x > 0 && (T *= 256); )
|
|
2345
|
+
C += this[r + --x] * T;
|
|
2346
|
+
return T *= 128, C >= T && (C -= Math.pow(2, 8 * n)), C;
|
|
2347
2347
|
}, o.prototype.readInt8 = function(r, n) {
|
|
2348
2348
|
return r = r >>> 0, n || U(r, 1, this.length), this[r] & 128 ? (255 - this[r] + 1) * -1 : this[r];
|
|
2349
2349
|
}, o.prototype.readInt16LE = function(r, n) {
|
|
@@ -2359,15 +2359,15 @@ function si() {
|
|
|
2359
2359
|
}, o.prototype.readInt32BE = function(r, n) {
|
|
2360
2360
|
return r = r >>> 0, n || U(r, 4, this.length), this[r] << 24 | this[r + 1] << 16 | this[r + 2] << 8 | this[r + 3];
|
|
2361
2361
|
}, o.prototype.readBigInt64LE = Ct(function(r) {
|
|
2362
|
-
r = r >>> 0,
|
|
2362
|
+
r = r >>> 0, z(r, "offset");
|
|
2363
2363
|
const n = this[r], p = this[r + 7];
|
|
2364
|
-
(n === void 0 || p === void 0) &&
|
|
2364
|
+
(n === void 0 || p === void 0) && it(r, this.length - 8);
|
|
2365
2365
|
const x = this[r + 4] + this[r + 5] * 2 ** 8 + this[r + 6] * 2 ** 16 + (p << 24);
|
|
2366
2366
|
return (BigInt(x) << BigInt(32)) + BigInt(n + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + this[++r] * 2 ** 24);
|
|
2367
2367
|
}), o.prototype.readBigInt64BE = Ct(function(r) {
|
|
2368
|
-
r = r >>> 0,
|
|
2368
|
+
r = r >>> 0, z(r, "offset");
|
|
2369
2369
|
const n = this[r], p = this[r + 7];
|
|
2370
|
-
(n === void 0 || p === void 0) &&
|
|
2370
|
+
(n === void 0 || p === void 0) && it(r, this.length - 8);
|
|
2371
2371
|
const x = (n << 24) + // Overflow
|
|
2372
2372
|
this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + this[++r];
|
|
2373
2373
|
return (BigInt(x) << BigInt(32)) + BigInt(this[++r] * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + p);
|
|
@@ -2380,102 +2380,102 @@ function si() {
|
|
|
2380
2380
|
}, o.prototype.readDoubleBE = function(r, n) {
|
|
2381
2381
|
return r = r >>> 0, n || U(r, 8, this.length), e.read(this, r, !1, 52, 8);
|
|
2382
2382
|
};
|
|
2383
|
-
function
|
|
2383
|
+
function X(u, r, n, p, x, T) {
|
|
2384
2384
|
if (!o.isBuffer(u)) throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
2385
|
-
if (r > x || r <
|
|
2385
|
+
if (r > x || r < T) throw new RangeError('"value" argument is out of bounds');
|
|
2386
2386
|
if (n + p > u.length) throw new RangeError("Index out of range");
|
|
2387
2387
|
}
|
|
2388
2388
|
o.prototype.writeUintLE = o.prototype.writeUIntLE = function(r, n, p, x) {
|
|
2389
2389
|
if (r = +r, n = n >>> 0, p = p >>> 0, !x) {
|
|
2390
|
-
const
|
|
2391
|
-
|
|
2390
|
+
const Y = Math.pow(2, 8 * p) - 1;
|
|
2391
|
+
X(this, r, n, p, Y, 0);
|
|
2392
2392
|
}
|
|
2393
|
-
let
|
|
2394
|
-
for (this[n] = r & 255; ++C < p && (
|
|
2395
|
-
this[n + C] = r /
|
|
2393
|
+
let T = 1, C = 0;
|
|
2394
|
+
for (this[n] = r & 255; ++C < p && (T *= 256); )
|
|
2395
|
+
this[n + C] = r / T & 255;
|
|
2396
2396
|
return n + p;
|
|
2397
2397
|
}, o.prototype.writeUintBE = o.prototype.writeUIntBE = function(r, n, p, x) {
|
|
2398
2398
|
if (r = +r, n = n >>> 0, p = p >>> 0, !x) {
|
|
2399
|
-
const
|
|
2400
|
-
|
|
2399
|
+
const Y = Math.pow(2, 8 * p) - 1;
|
|
2400
|
+
X(this, r, n, p, Y, 0);
|
|
2401
2401
|
}
|
|
2402
|
-
let
|
|
2403
|
-
for (this[n +
|
|
2404
|
-
this[n +
|
|
2402
|
+
let T = p - 1, C = 1;
|
|
2403
|
+
for (this[n + T] = r & 255; --T >= 0 && (C *= 256); )
|
|
2404
|
+
this[n + T] = r / C & 255;
|
|
2405
2405
|
return n + p;
|
|
2406
2406
|
}, o.prototype.writeUint8 = o.prototype.writeUInt8 = function(r, n, p) {
|
|
2407
|
-
return r = +r, n = n >>> 0, p ||
|
|
2407
|
+
return r = +r, n = n >>> 0, p || X(this, r, n, 1, 255, 0), this[n] = r & 255, n + 1;
|
|
2408
2408
|
}, o.prototype.writeUint16LE = o.prototype.writeUInt16LE = function(r, n, p) {
|
|
2409
|
-
return r = +r, n = n >>> 0, p ||
|
|
2409
|
+
return r = +r, n = n >>> 0, p || X(this, r, n, 2, 65535, 0), this[n] = r & 255, this[n + 1] = r >>> 8, n + 2;
|
|
2410
2410
|
}, o.prototype.writeUint16BE = o.prototype.writeUInt16BE = function(r, n, p) {
|
|
2411
|
-
return r = +r, n = n >>> 0, p ||
|
|
2411
|
+
return r = +r, n = n >>> 0, p || X(this, r, n, 2, 65535, 0), this[n] = r >>> 8, this[n + 1] = r & 255, n + 2;
|
|
2412
2412
|
}, o.prototype.writeUint32LE = o.prototype.writeUInt32LE = function(r, n, p) {
|
|
2413
|
-
return r = +r, n = n >>> 0, p ||
|
|
2413
|
+
return r = +r, n = n >>> 0, p || X(this, r, n, 4, 4294967295, 0), this[n + 3] = r >>> 24, this[n + 2] = r >>> 16, this[n + 1] = r >>> 8, this[n] = r & 255, n + 4;
|
|
2414
2414
|
}, o.prototype.writeUint32BE = o.prototype.writeUInt32BE = function(r, n, p) {
|
|
2415
|
-
return r = +r, n = n >>> 0, p ||
|
|
2415
|
+
return r = +r, n = n >>> 0, p || X(this, r, n, 4, 4294967295, 0), this[n] = r >>> 24, this[n + 1] = r >>> 16, this[n + 2] = r >>> 8, this[n + 3] = r & 255, n + 4;
|
|
2416
2416
|
};
|
|
2417
|
-
function
|
|
2417
|
+
function pt(u, r, n, p, x) {
|
|
2418
2418
|
Q(r, p, x, u, n, 7);
|
|
2419
|
-
let
|
|
2420
|
-
u[n++] =
|
|
2419
|
+
let T = Number(r & BigInt(4294967295));
|
|
2420
|
+
u[n++] = T, T = T >> 8, u[n++] = T, T = T >> 8, u[n++] = T, T = T >> 8, u[n++] = T;
|
|
2421
2421
|
let C = Number(r >> BigInt(32) & BigInt(4294967295));
|
|
2422
2422
|
return u[n++] = C, C = C >> 8, u[n++] = C, C = C >> 8, u[n++] = C, C = C >> 8, u[n++] = C, n;
|
|
2423
2423
|
}
|
|
2424
|
-
function
|
|
2424
|
+
function wt(u, r, n, p, x) {
|
|
2425
2425
|
Q(r, p, x, u, n, 7);
|
|
2426
|
-
let
|
|
2427
|
-
u[n + 7] =
|
|
2426
|
+
let T = Number(r & BigInt(4294967295));
|
|
2427
|
+
u[n + 7] = T, T = T >> 8, u[n + 6] = T, T = T >> 8, u[n + 5] = T, T = T >> 8, u[n + 4] = T;
|
|
2428
2428
|
let C = Number(r >> BigInt(32) & BigInt(4294967295));
|
|
2429
2429
|
return u[n + 3] = C, C = C >> 8, u[n + 2] = C, C = C >> 8, u[n + 1] = C, C = C >> 8, u[n] = C, n + 8;
|
|
2430
2430
|
}
|
|
2431
2431
|
o.prototype.writeBigUInt64LE = Ct(function(r, n = 0) {
|
|
2432
|
-
return
|
|
2432
|
+
return pt(this, r, n, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
2433
2433
|
}), o.prototype.writeBigUInt64BE = Ct(function(r, n = 0) {
|
|
2434
|
-
return
|
|
2434
|
+
return wt(this, r, n, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
2435
2435
|
}), o.prototype.writeIntLE = function(r, n, p, x) {
|
|
2436
2436
|
if (r = +r, n = n >>> 0, !x) {
|
|
2437
2437
|
const J = Math.pow(2, 8 * p - 1);
|
|
2438
|
-
|
|
2438
|
+
X(this, r, n, p, J - 1, -J);
|
|
2439
2439
|
}
|
|
2440
|
-
let
|
|
2441
|
-
for (this[n] = r & 255; ++
|
|
2442
|
-
r < 0 &&
|
|
2440
|
+
let T = 0, C = 1, Y = 0;
|
|
2441
|
+
for (this[n] = r & 255; ++T < p && (C *= 256); )
|
|
2442
|
+
r < 0 && Y === 0 && this[n + T - 1] !== 0 && (Y = 1), this[n + T] = (r / C >> 0) - Y & 255;
|
|
2443
2443
|
return n + p;
|
|
2444
2444
|
}, o.prototype.writeIntBE = function(r, n, p, x) {
|
|
2445
2445
|
if (r = +r, n = n >>> 0, !x) {
|
|
2446
2446
|
const J = Math.pow(2, 8 * p - 1);
|
|
2447
|
-
|
|
2447
|
+
X(this, r, n, p, J - 1, -J);
|
|
2448
2448
|
}
|
|
2449
|
-
let
|
|
2450
|
-
for (this[n +
|
|
2451
|
-
r < 0 &&
|
|
2449
|
+
let T = p - 1, C = 1, Y = 0;
|
|
2450
|
+
for (this[n + T] = r & 255; --T >= 0 && (C *= 256); )
|
|
2451
|
+
r < 0 && Y === 0 && this[n + T + 1] !== 0 && (Y = 1), this[n + T] = (r / C >> 0) - Y & 255;
|
|
2452
2452
|
return n + p;
|
|
2453
2453
|
}, o.prototype.writeInt8 = function(r, n, p) {
|
|
2454
|
-
return r = +r, n = n >>> 0, p ||
|
|
2454
|
+
return r = +r, n = n >>> 0, p || X(this, r, n, 1, 127, -128), r < 0 && (r = 255 + r + 1), this[n] = r & 255, n + 1;
|
|
2455
2455
|
}, o.prototype.writeInt16LE = function(r, n, p) {
|
|
2456
|
-
return r = +r, n = n >>> 0, p ||
|
|
2456
|
+
return r = +r, n = n >>> 0, p || X(this, r, n, 2, 32767, -32768), this[n] = r & 255, this[n + 1] = r >>> 8, n + 2;
|
|
2457
2457
|
}, o.prototype.writeInt16BE = function(r, n, p) {
|
|
2458
|
-
return r = +r, n = n >>> 0, p ||
|
|
2458
|
+
return r = +r, n = n >>> 0, p || X(this, r, n, 2, 32767, -32768), this[n] = r >>> 8, this[n + 1] = r & 255, n + 2;
|
|
2459
2459
|
}, o.prototype.writeInt32LE = function(r, n, p) {
|
|
2460
|
-
return r = +r, n = n >>> 0, p ||
|
|
2460
|
+
return r = +r, n = n >>> 0, p || X(this, r, n, 4, 2147483647, -2147483648), this[n] = r & 255, this[n + 1] = r >>> 8, this[n + 2] = r >>> 16, this[n + 3] = r >>> 24, n + 4;
|
|
2461
2461
|
}, o.prototype.writeInt32BE = function(r, n, p) {
|
|
2462
|
-
return r = +r, n = n >>> 0, p ||
|
|
2462
|
+
return r = +r, n = n >>> 0, p || X(this, r, n, 4, 2147483647, -2147483648), r < 0 && (r = 4294967295 + r + 1), this[n] = r >>> 24, this[n + 1] = r >>> 16, this[n + 2] = r >>> 8, this[n + 3] = r & 255, n + 4;
|
|
2463
2463
|
}, o.prototype.writeBigInt64LE = Ct(function(r, n = 0) {
|
|
2464
|
-
return
|
|
2464
|
+
return pt(this, r, n, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
2465
2465
|
}), o.prototype.writeBigInt64BE = Ct(function(r, n = 0) {
|
|
2466
|
-
return
|
|
2466
|
+
return wt(this, r, n, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
2467
2467
|
});
|
|
2468
|
-
function Xt(u, r, n, p, x,
|
|
2468
|
+
function Xt(u, r, n, p, x, T) {
|
|
2469
2469
|
if (n + p > u.length) throw new RangeError("Index out of range");
|
|
2470
2470
|
if (n < 0) throw new RangeError("Index out of range");
|
|
2471
2471
|
}
|
|
2472
|
-
function
|
|
2472
|
+
function Ht(u, r, n, p, x) {
|
|
2473
2473
|
return r = +r, n = n >>> 0, x || Xt(u, r, n, 4), e.write(u, r, n, p, 23, 4), n + 4;
|
|
2474
2474
|
}
|
|
2475
2475
|
o.prototype.writeFloatLE = function(r, n, p) {
|
|
2476
|
-
return
|
|
2476
|
+
return Ht(this, r, n, !0, p);
|
|
2477
2477
|
}, o.prototype.writeFloatBE = function(r, n, p) {
|
|
2478
|
-
return
|
|
2478
|
+
return Ht(this, r, n, !1, p);
|
|
2479
2479
|
};
|
|
2480
2480
|
function f(u, r, n, p, x) {
|
|
2481
2481
|
return r = +r, n = n >>> 0, x || Xt(u, r, n, 8), e.write(u, r, n, p, 52, 8), n + 8;
|
|
@@ -2492,12 +2492,12 @@ function si() {
|
|
|
2492
2492
|
if (p < 0 || p >= this.length) throw new RangeError("Index out of range");
|
|
2493
2493
|
if (x < 0) throw new RangeError("sourceEnd out of bounds");
|
|
2494
2494
|
x > this.length && (x = this.length), r.length - n < x - p && (x = r.length - n + p);
|
|
2495
|
-
const
|
|
2495
|
+
const T = x - p;
|
|
2496
2496
|
return this === r && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(n, p, x) : Uint8Array.prototype.set.call(
|
|
2497
2497
|
r,
|
|
2498
2498
|
this.subarray(p, x),
|
|
2499
2499
|
n
|
|
2500
|
-
),
|
|
2500
|
+
), T;
|
|
2501
2501
|
}, o.prototype.fill = function(r, n, p, x) {
|
|
2502
2502
|
if (typeof r == "string") {
|
|
2503
2503
|
if (typeof n == "string" ? (x = n, n = 0, p = this.length) : typeof p == "string" && (x = p, p = this.length), x !== void 0 && typeof x != "string")
|
|
@@ -2514,16 +2514,16 @@ function si() {
|
|
|
2514
2514
|
if (p <= n)
|
|
2515
2515
|
return this;
|
|
2516
2516
|
n = n >>> 0, p = p === void 0 ? this.length : p >>> 0, r || (r = 0);
|
|
2517
|
-
let
|
|
2517
|
+
let T;
|
|
2518
2518
|
if (typeof r == "number")
|
|
2519
|
-
for (
|
|
2520
|
-
this[
|
|
2519
|
+
for (T = n; T < p; ++T)
|
|
2520
|
+
this[T] = r;
|
|
2521
2521
|
else {
|
|
2522
|
-
const C = o.isBuffer(r) ? r : o.from(r, x),
|
|
2523
|
-
if (
|
|
2522
|
+
const C = o.isBuffer(r) ? r : o.from(r, x), Y = C.length;
|
|
2523
|
+
if (Y === 0)
|
|
2524
2524
|
throw new TypeError('The value "' + r + '" is invalid for argument "value"');
|
|
2525
|
-
for (
|
|
2526
|
-
this[
|
|
2525
|
+
for (T = 0; T < p - n; ++T)
|
|
2526
|
+
this[T + n] = C[T % Y];
|
|
2527
2527
|
}
|
|
2528
2528
|
return this;
|
|
2529
2529
|
};
|
|
@@ -2580,79 +2580,79 @@ function si() {
|
|
|
2580
2580
|
r = `_${u.slice(n - 3, n)}${r}`;
|
|
2581
2581
|
return `${u.slice(0, n)}${r}`;
|
|
2582
2582
|
}
|
|
2583
|
-
function
|
|
2584
|
-
|
|
2583
|
+
function K(u, r, n) {
|
|
2584
|
+
z(r, "offset"), (u[r] === void 0 || u[r + n] === void 0) && it(r, u.length - (n + 1));
|
|
2585
2585
|
}
|
|
2586
|
-
function Q(u, r, n, p, x,
|
|
2586
|
+
function Q(u, r, n, p, x, T) {
|
|
2587
2587
|
if (u > n || u < r) {
|
|
2588
2588
|
const C = typeof r == "bigint" ? "n" : "";
|
|
2589
|
-
let
|
|
2590
|
-
throw r === 0 || r === BigInt(0) ?
|
|
2589
|
+
let Y;
|
|
2590
|
+
throw r === 0 || r === BigInt(0) ? Y = `>= 0${C} and < 2${C} ** ${(T + 1) * 8}${C}` : Y = `>= -(2${C} ** ${(T + 1) * 8 - 1}${C}) and < 2 ** ${(T + 1) * 8 - 1}${C}`, new l.ERR_OUT_OF_RANGE("value", Y, u);
|
|
2591
2591
|
}
|
|
2592
|
-
|
|
2592
|
+
K(p, x, T);
|
|
2593
2593
|
}
|
|
2594
|
-
function
|
|
2594
|
+
function z(u, r) {
|
|
2595
2595
|
if (typeof u != "number")
|
|
2596
2596
|
throw new l.ERR_INVALID_ARG_TYPE(r, "number", u);
|
|
2597
2597
|
}
|
|
2598
|
-
function
|
|
2599
|
-
throw Math.floor(u) !== u ? (
|
|
2598
|
+
function it(u, r, n) {
|
|
2599
|
+
throw Math.floor(u) !== u ? (z(u, n), new l.ERR_OUT_OF_RANGE("offset", "an integer", u)) : r < 0 ? new l.ERR_BUFFER_OUT_OF_BOUNDS() : new l.ERR_OUT_OF_RANGE(
|
|
2600
2600
|
"offset",
|
|
2601
2601
|
`>= 0 and <= ${r}`,
|
|
2602
2602
|
u
|
|
2603
2603
|
);
|
|
2604
2604
|
}
|
|
2605
2605
|
const ct = /[^+/0-9A-Za-z-_]/g;
|
|
2606
|
-
function
|
|
2606
|
+
function It(u) {
|
|
2607
2607
|
if (u = u.split("=")[0], u = u.trim().replace(ct, ""), u.length < 2) return "";
|
|
2608
2608
|
for (; u.length % 4 !== 0; )
|
|
2609
2609
|
u = u + "=";
|
|
2610
2610
|
return u;
|
|
2611
2611
|
}
|
|
2612
|
-
function
|
|
2612
|
+
function tt(u, r) {
|
|
2613
2613
|
r = r || 1 / 0;
|
|
2614
2614
|
let n;
|
|
2615
2615
|
const p = u.length;
|
|
2616
2616
|
let x = null;
|
|
2617
|
-
const
|
|
2617
|
+
const T = [];
|
|
2618
2618
|
for (let C = 0; C < p; ++C) {
|
|
2619
2619
|
if (n = u.charCodeAt(C), n > 55295 && n < 57344) {
|
|
2620
2620
|
if (!x) {
|
|
2621
2621
|
if (n > 56319) {
|
|
2622
|
-
(r -= 3) > -1 &&
|
|
2622
|
+
(r -= 3) > -1 && T.push(239, 191, 189);
|
|
2623
2623
|
continue;
|
|
2624
2624
|
} else if (C + 1 === p) {
|
|
2625
|
-
(r -= 3) > -1 &&
|
|
2625
|
+
(r -= 3) > -1 && T.push(239, 191, 189);
|
|
2626
2626
|
continue;
|
|
2627
2627
|
}
|
|
2628
2628
|
x = n;
|
|
2629
2629
|
continue;
|
|
2630
2630
|
}
|
|
2631
2631
|
if (n < 56320) {
|
|
2632
|
-
(r -= 3) > -1 &&
|
|
2632
|
+
(r -= 3) > -1 && T.push(239, 191, 189), x = n;
|
|
2633
2633
|
continue;
|
|
2634
2634
|
}
|
|
2635
2635
|
n = (x - 55296 << 10 | n - 56320) + 65536;
|
|
2636
|
-
} else x && (r -= 3) > -1 &&
|
|
2636
|
+
} else x && (r -= 3) > -1 && T.push(239, 191, 189);
|
|
2637
2637
|
if (x = null, n < 128) {
|
|
2638
2638
|
if ((r -= 1) < 0) break;
|
|
2639
|
-
|
|
2639
|
+
T.push(n);
|
|
2640
2640
|
} else if (n < 2048) {
|
|
2641
2641
|
if ((r -= 2) < 0) break;
|
|
2642
|
-
|
|
2642
|
+
T.push(
|
|
2643
2643
|
n >> 6 | 192,
|
|
2644
2644
|
n & 63 | 128
|
|
2645
2645
|
);
|
|
2646
2646
|
} else if (n < 65536) {
|
|
2647
2647
|
if ((r -= 3) < 0) break;
|
|
2648
|
-
|
|
2648
|
+
T.push(
|
|
2649
2649
|
n >> 12 | 224,
|
|
2650
2650
|
n >> 6 & 63 | 128,
|
|
2651
2651
|
n & 63 | 128
|
|
2652
2652
|
);
|
|
2653
2653
|
} else if (n < 1114112) {
|
|
2654
2654
|
if ((r -= 4) < 0) break;
|
|
2655
|
-
|
|
2655
|
+
T.push(
|
|
2656
2656
|
n >> 18 | 240,
|
|
2657
2657
|
n >> 12 & 63 | 128,
|
|
2658
2658
|
n >> 6 & 63 | 128,
|
|
@@ -2661,9 +2661,9 @@ function si() {
|
|
|
2661
2661
|
} else
|
|
2662
2662
|
throw new Error("Invalid code point");
|
|
2663
2663
|
}
|
|
2664
|
-
return
|
|
2664
|
+
return T;
|
|
2665
2665
|
}
|
|
2666
|
-
function
|
|
2666
|
+
function xt(u) {
|
|
2667
2667
|
const r = [];
|
|
2668
2668
|
for (let n = 0; n < u.length; ++n)
|
|
2669
2669
|
r.push(u.charCodeAt(n) & 255);
|
|
@@ -2671,13 +2671,13 @@ function si() {
|
|
|
2671
2671
|
}
|
|
2672
2672
|
function ne(u, r) {
|
|
2673
2673
|
let n, p, x;
|
|
2674
|
-
const
|
|
2674
|
+
const T = [];
|
|
2675
2675
|
for (let C = 0; C < u.length && !((r -= 2) < 0); ++C)
|
|
2676
|
-
n = u.charCodeAt(C), p = n >> 8, x = n % 256,
|
|
2677
|
-
return
|
|
2676
|
+
n = u.charCodeAt(C), p = n >> 8, x = n % 256, T.push(x), T.push(p);
|
|
2677
|
+
return T;
|
|
2678
2678
|
}
|
|
2679
2679
|
function Yt(u) {
|
|
2680
|
-
return t.toByteArray(
|
|
2680
|
+
return t.toByteArray(It(u));
|
|
2681
2681
|
}
|
|
2682
2682
|
function St(u, r, n, p) {
|
|
2683
2683
|
let x;
|
|
@@ -2685,7 +2685,7 @@ function si() {
|
|
|
2685
2685
|
r[x + n] = u[x];
|
|
2686
2686
|
return x;
|
|
2687
2687
|
}
|
|
2688
|
-
function
|
|
2688
|
+
function mt(u, r) {
|
|
2689
2689
|
return u instanceof r || u != null && u.constructor != null && u.constructor.name != null && u.constructor.name === r.name;
|
|
2690
2690
|
}
|
|
2691
2691
|
function ae(u) {
|
|
@@ -2727,8 +2727,8 @@ function Hi() {
|
|
|
2727
2727
|
}, c.alloc = function(a, o, g) {
|
|
2728
2728
|
if (typeof a != "number")
|
|
2729
2729
|
throw new TypeError("Argument must be a number");
|
|
2730
|
-
var
|
|
2731
|
-
return o !== void 0 ? typeof g == "string" ?
|
|
2730
|
+
var A = i(a);
|
|
2731
|
+
return o !== void 0 ? typeof g == "string" ? A.fill(o, g) : A.fill(o) : A.fill(0), A;
|
|
2732
2732
|
}, c.allocUnsafe = function(a) {
|
|
2733
2733
|
if (typeof a != "number")
|
|
2734
2734
|
throw new TypeError("Argument must be a number");
|
|
@@ -2738,14 +2738,14 @@ function Hi() {
|
|
|
2738
2738
|
throw new TypeError("Argument must be a number");
|
|
2739
2739
|
return e.SlowBuffer(a);
|
|
2740
2740
|
};
|
|
2741
|
-
})(
|
|
2741
|
+
})(Qt, Qt.exports)), Qt.exports;
|
|
2742
2742
|
}
|
|
2743
2743
|
var Ge;
|
|
2744
2744
|
function Qi() {
|
|
2745
2745
|
if (Ge) return ue;
|
|
2746
2746
|
Ge = 1;
|
|
2747
|
-
var h = Hi().Buffer, t = h.isEncoding || function(
|
|
2748
|
-
switch (
|
|
2747
|
+
var h = Hi().Buffer, t = h.isEncoding || function(m) {
|
|
2748
|
+
switch (m = "" + m, m && m.toLowerCase()) {
|
|
2749
2749
|
case "hex":
|
|
2750
2750
|
case "utf8":
|
|
2751
2751
|
case "utf-8":
|
|
@@ -2762,10 +2762,10 @@ function Qi() {
|
|
|
2762
2762
|
return !1;
|
|
2763
2763
|
}
|
|
2764
2764
|
};
|
|
2765
|
-
function e(
|
|
2766
|
-
if (!
|
|
2765
|
+
function e(m) {
|
|
2766
|
+
if (!m) return "utf8";
|
|
2767
2767
|
for (var v; ; )
|
|
2768
|
-
switch (
|
|
2768
|
+
switch (m) {
|
|
2769
2769
|
case "utf8":
|
|
2770
2770
|
case "utf-8":
|
|
2771
2771
|
return "utf8";
|
|
@@ -2780,24 +2780,24 @@ function Qi() {
|
|
|
2780
2780
|
case "base64":
|
|
2781
2781
|
case "ascii":
|
|
2782
2782
|
case "hex":
|
|
2783
|
-
return
|
|
2783
|
+
return m;
|
|
2784
2784
|
default:
|
|
2785
2785
|
if (v) return;
|
|
2786
|
-
|
|
2786
|
+
m = ("" + m).toLowerCase(), v = !0;
|
|
2787
2787
|
}
|
|
2788
2788
|
}
|
|
2789
|
-
function i(
|
|
2790
|
-
var v = e(
|
|
2791
|
-
if (typeof v != "string" && (h.isEncoding === t || !t(
|
|
2792
|
-
return v ||
|
|
2789
|
+
function i(m) {
|
|
2790
|
+
var v = e(m);
|
|
2791
|
+
if (typeof v != "string" && (h.isEncoding === t || !t(m))) throw new Error("Unknown encoding: " + m);
|
|
2792
|
+
return v || m;
|
|
2793
2793
|
}
|
|
2794
2794
|
ue.StringDecoder = s;
|
|
2795
|
-
function s(
|
|
2796
|
-
this.encoding = i(
|
|
2795
|
+
function s(m) {
|
|
2796
|
+
this.encoding = i(m);
|
|
2797
2797
|
var v;
|
|
2798
2798
|
switch (this.encoding) {
|
|
2799
2799
|
case "utf16le":
|
|
2800
|
-
this.text = S, this.end =
|
|
2800
|
+
this.text = S, this.end = I, v = 4;
|
|
2801
2801
|
break;
|
|
2802
2802
|
case "utf8":
|
|
2803
2803
|
this.fillLast = g, v = 4;
|
|
@@ -2806,105 +2806,105 @@ function Qi() {
|
|
|
2806
2806
|
this.text = F, this.end = B, v = 3;
|
|
2807
2807
|
break;
|
|
2808
2808
|
default:
|
|
2809
|
-
this.write =
|
|
2809
|
+
this.write = N, this.end = P;
|
|
2810
2810
|
return;
|
|
2811
2811
|
}
|
|
2812
2812
|
this.lastNeed = 0, this.lastTotal = 0, this.lastChar = h.allocUnsafe(v);
|
|
2813
2813
|
}
|
|
2814
|
-
s.prototype.write = function(
|
|
2815
|
-
if (
|
|
2816
|
-
var v,
|
|
2814
|
+
s.prototype.write = function(m) {
|
|
2815
|
+
if (m.length === 0) return "";
|
|
2816
|
+
var v, _;
|
|
2817
2817
|
if (this.lastNeed) {
|
|
2818
|
-
if (v = this.fillLast(
|
|
2819
|
-
|
|
2818
|
+
if (v = this.fillLast(m), v === void 0) return "";
|
|
2819
|
+
_ = this.lastNeed, this.lastNeed = 0;
|
|
2820
2820
|
} else
|
|
2821
|
-
|
|
2822
|
-
return
|
|
2823
|
-
}, s.prototype.end = E, s.prototype.text =
|
|
2824
|
-
if (this.lastNeed <=
|
|
2825
|
-
return
|
|
2826
|
-
|
|
2821
|
+
_ = 0;
|
|
2822
|
+
return _ < m.length ? v ? v + this.text(m, _) : this.text(m, _) : v || "";
|
|
2823
|
+
}, s.prototype.end = E, s.prototype.text = A, s.prototype.fillLast = function(m) {
|
|
2824
|
+
if (this.lastNeed <= m.length)
|
|
2825
|
+
return m.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
2826
|
+
m.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, m.length), this.lastNeed -= m.length;
|
|
2827
2827
|
};
|
|
2828
|
-
function c(
|
|
2829
|
-
return
|
|
2828
|
+
function c(m) {
|
|
2829
|
+
return m <= 127 ? 0 : m >> 5 === 6 ? 2 : m >> 4 === 14 ? 3 : m >> 3 === 30 ? 4 : m >> 6 === 2 ? -1 : -2;
|
|
2830
2830
|
}
|
|
2831
|
-
function a(
|
|
2831
|
+
function a(m, v, _) {
|
|
2832
2832
|
var d = v.length - 1;
|
|
2833
|
-
if (d <
|
|
2833
|
+
if (d < _) return 0;
|
|
2834
2834
|
var b = c(v[d]);
|
|
2835
|
-
return b >= 0 ? (b > 0 && (
|
|
2835
|
+
return b >= 0 ? (b > 0 && (m.lastNeed = b - 1), b) : --d < _ || b === -2 ? 0 : (b = c(v[d]), b >= 0 ? (b > 0 && (m.lastNeed = b - 2), b) : --d < _ || b === -2 ? 0 : (b = c(v[d]), b >= 0 ? (b > 0 && (b === 2 ? b = 0 : m.lastNeed = b - 3), b) : 0));
|
|
2836
2836
|
}
|
|
2837
|
-
function o(
|
|
2837
|
+
function o(m, v, _) {
|
|
2838
2838
|
if ((v[0] & 192) !== 128)
|
|
2839
|
-
return
|
|
2840
|
-
if (
|
|
2839
|
+
return m.lastNeed = 0, "�";
|
|
2840
|
+
if (m.lastNeed > 1 && v.length > 1) {
|
|
2841
2841
|
if ((v[1] & 192) !== 128)
|
|
2842
|
-
return
|
|
2843
|
-
if (
|
|
2844
|
-
return
|
|
2845
|
-
}
|
|
2846
|
-
}
|
|
2847
|
-
function g(
|
|
2848
|
-
var v = this.lastTotal - this.lastNeed,
|
|
2849
|
-
if (
|
|
2850
|
-
if (this.lastNeed <=
|
|
2851
|
-
return
|
|
2852
|
-
|
|
2853
|
-
}
|
|
2854
|
-
function
|
|
2855
|
-
var
|
|
2856
|
-
if (!this.lastNeed) return
|
|
2857
|
-
this.lastTotal =
|
|
2858
|
-
var d =
|
|
2859
|
-
return
|
|
2860
|
-
}
|
|
2861
|
-
function E(
|
|
2862
|
-
var v =
|
|
2842
|
+
return m.lastNeed = 1, "�";
|
|
2843
|
+
if (m.lastNeed > 2 && v.length > 2 && (v[2] & 192) !== 128)
|
|
2844
|
+
return m.lastNeed = 2, "�";
|
|
2845
|
+
}
|
|
2846
|
+
}
|
|
2847
|
+
function g(m) {
|
|
2848
|
+
var v = this.lastTotal - this.lastNeed, _ = o(this, m);
|
|
2849
|
+
if (_ !== void 0) return _;
|
|
2850
|
+
if (this.lastNeed <= m.length)
|
|
2851
|
+
return m.copy(this.lastChar, v, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
2852
|
+
m.copy(this.lastChar, v, 0, m.length), this.lastNeed -= m.length;
|
|
2853
|
+
}
|
|
2854
|
+
function A(m, v) {
|
|
2855
|
+
var _ = a(this, m, v);
|
|
2856
|
+
if (!this.lastNeed) return m.toString("utf8", v);
|
|
2857
|
+
this.lastTotal = _;
|
|
2858
|
+
var d = m.length - (_ - this.lastNeed);
|
|
2859
|
+
return m.copy(this.lastChar, 0, d), m.toString("utf8", v, d);
|
|
2860
|
+
}
|
|
2861
|
+
function E(m) {
|
|
2862
|
+
var v = m && m.length ? this.write(m) : "";
|
|
2863
2863
|
return this.lastNeed ? v + "�" : v;
|
|
2864
2864
|
}
|
|
2865
|
-
function S(
|
|
2866
|
-
if ((
|
|
2867
|
-
var
|
|
2868
|
-
if (
|
|
2869
|
-
var d =
|
|
2865
|
+
function S(m, v) {
|
|
2866
|
+
if ((m.length - v) % 2 === 0) {
|
|
2867
|
+
var _ = m.toString("utf16le", v);
|
|
2868
|
+
if (_) {
|
|
2869
|
+
var d = _.charCodeAt(_.length - 1);
|
|
2870
2870
|
if (d >= 55296 && d <= 56319)
|
|
2871
|
-
return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] =
|
|
2871
|
+
return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] = m[m.length - 2], this.lastChar[1] = m[m.length - 1], _.slice(0, -1);
|
|
2872
2872
|
}
|
|
2873
|
-
return
|
|
2873
|
+
return _;
|
|
2874
2874
|
}
|
|
2875
|
-
return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] =
|
|
2875
|
+
return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] = m[m.length - 1], m.toString("utf16le", v, m.length - 1);
|
|
2876
2876
|
}
|
|
2877
|
-
function
|
|
2878
|
-
var v =
|
|
2877
|
+
function I(m) {
|
|
2878
|
+
var v = m && m.length ? this.write(m) : "";
|
|
2879
2879
|
if (this.lastNeed) {
|
|
2880
|
-
var
|
|
2881
|
-
return v + this.lastChar.toString("utf16le", 0,
|
|
2880
|
+
var _ = this.lastTotal - this.lastNeed;
|
|
2881
|
+
return v + this.lastChar.toString("utf16le", 0, _);
|
|
2882
2882
|
}
|
|
2883
2883
|
return v;
|
|
2884
2884
|
}
|
|
2885
|
-
function F(
|
|
2886
|
-
var
|
|
2887
|
-
return
|
|
2885
|
+
function F(m, v) {
|
|
2886
|
+
var _ = (m.length - v) % 3;
|
|
2887
|
+
return _ === 0 ? m.toString("base64", v) : (this.lastNeed = 3 - _, this.lastTotal = 3, _ === 1 ? this.lastChar[0] = m[m.length - 1] : (this.lastChar[0] = m[m.length - 2], this.lastChar[1] = m[m.length - 1]), m.toString("base64", v, m.length - _));
|
|
2888
2888
|
}
|
|
2889
|
-
function B(
|
|
2890
|
-
var v =
|
|
2889
|
+
function B(m) {
|
|
2890
|
+
var v = m && m.length ? this.write(m) : "";
|
|
2891
2891
|
return this.lastNeed ? v + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : v;
|
|
2892
2892
|
}
|
|
2893
|
-
function
|
|
2894
|
-
return
|
|
2893
|
+
function N(m) {
|
|
2894
|
+
return m.toString(this.encoding);
|
|
2895
2895
|
}
|
|
2896
|
-
function P(
|
|
2897
|
-
return
|
|
2896
|
+
function P(m) {
|
|
2897
|
+
return m && m.length ? this.write(m) : "";
|
|
2898
2898
|
}
|
|
2899
2899
|
return ue;
|
|
2900
2900
|
}
|
|
2901
|
-
var
|
|
2901
|
+
var Ke;
|
|
2902
2902
|
function Ji() {
|
|
2903
|
-
return
|
|
2903
|
+
return Ke || (Ke = 1, (function(h) {
|
|
2904
2904
|
(function(t) {
|
|
2905
2905
|
t.parser = function(f, l) {
|
|
2906
2906
|
return new i(f, l);
|
|
2907
|
-
}, t.SAXParser = i, t.SAXStream = E, t.createStream =
|
|
2907
|
+
}, t.SAXParser = i, t.SAXStream = E, t.createStream = A, t.MAX_BUFFER_LENGTH = 64 * 1024;
|
|
2908
2908
|
var e = [
|
|
2909
2909
|
"comment",
|
|
2910
2910
|
"sgmlDecl",
|
|
@@ -2943,7 +2943,7 @@ function Ji() {
|
|
|
2943
2943
|
if (!(this instanceof i))
|
|
2944
2944
|
return new i(f, l);
|
|
2945
2945
|
var M = this;
|
|
2946
|
-
c(M), M.q = M.c = "", M.bufferCheckPosition = t.MAX_BUFFER_LENGTH, M.opt = l || {}, M.opt.lowercase = M.opt.lowercase || M.opt.lowercasetags, M.looseCase = M.opt.lowercase ? "toLowerCase" : "toUpperCase", M.tags = [], M.closed = M.closedRoot = M.sawRoot = !1, M.tag = M.error = null, M.strict = !!f, M.noscript = !!(f || M.opt.noscript), M.state = y.BEGIN, M.strictEntities = M.opt.strictEntities, M.ENTITIES = M.strictEntities ? Object.create(t.XML_ENTITIES) : Object.create(t.ENTITIES), M.attribList = [], M.opt.xmlns && (M.ns = Object.create(
|
|
2946
|
+
c(M), M.q = M.c = "", M.bufferCheckPosition = t.MAX_BUFFER_LENGTH, M.opt = l || {}, M.opt.lowercase = M.opt.lowercase || M.opt.lowercasetags, M.looseCase = M.opt.lowercase ? "toLowerCase" : "toUpperCase", M.tags = [], M.closed = M.closedRoot = M.sawRoot = !1, M.tag = M.error = null, M.strict = !!f, M.noscript = !!(f || M.opt.noscript), M.state = y.BEGIN, M.strictEntities = M.opt.strictEntities, M.ENTITIES = M.strictEntities ? Object.create(t.XML_ENTITIES) : Object.create(t.ENTITIES), M.attribList = [], M.opt.xmlns && (M.ns = Object.create(N)), M.opt.unquotedAttributeValues === void 0 && (M.opt.unquotedAttributeValues = !f), M.trackPosition = M.opt.position !== !1, M.trackPosition && (M.position = M.line = M.column = 0), et(M, "onready");
|
|
2947
2947
|
}
|
|
2948
2948
|
Object.create || (Object.create = function(f) {
|
|
2949
2949
|
function l() {
|
|
@@ -2957,39 +2957,39 @@ function Ji() {
|
|
|
2957
2957
|
return l;
|
|
2958
2958
|
});
|
|
2959
2959
|
function s(f) {
|
|
2960
|
-
for (var l = Math.max(t.MAX_BUFFER_LENGTH, 10), M = 0, w = 0,
|
|
2960
|
+
for (var l = Math.max(t.MAX_BUFFER_LENGTH, 10), M = 0, w = 0, K = e.length; w < K; w++) {
|
|
2961
2961
|
var Q = f[e[w]].length;
|
|
2962
2962
|
if (Q > l)
|
|
2963
2963
|
switch (e[w]) {
|
|
2964
2964
|
case "textNode":
|
|
2965
|
-
|
|
2965
|
+
j(f);
|
|
2966
2966
|
break;
|
|
2967
2967
|
case "cdata":
|
|
2968
|
-
|
|
2968
|
+
G(f, "oncdata", f.cdata), f.cdata = "";
|
|
2969
2969
|
break;
|
|
2970
2970
|
case "script":
|
|
2971
|
-
|
|
2971
|
+
G(f, "onscript", f.script), f.script = "";
|
|
2972
2972
|
break;
|
|
2973
2973
|
default:
|
|
2974
|
-
|
|
2974
|
+
nt(f, "Max buffer length exceeded: " + e[w]);
|
|
2975
2975
|
}
|
|
2976
2976
|
M = Math.max(M, Q);
|
|
2977
2977
|
}
|
|
2978
|
-
var
|
|
2979
|
-
f.bufferCheckPosition =
|
|
2978
|
+
var z = t.MAX_BUFFER_LENGTH - M;
|
|
2979
|
+
f.bufferCheckPosition = z + f.position;
|
|
2980
2980
|
}
|
|
2981
2981
|
function c(f) {
|
|
2982
2982
|
for (var l = 0, M = e.length; l < M; l++)
|
|
2983
2983
|
f[e[l]] = "";
|
|
2984
2984
|
}
|
|
2985
2985
|
function a(f) {
|
|
2986
|
-
|
|
2986
|
+
j(f), f.cdata !== "" && (G(f, "oncdata", f.cdata), f.cdata = ""), f.script !== "" && (G(f, "onscript", f.script), f.script = "");
|
|
2987
2987
|
}
|
|
2988
2988
|
i.prototype = {
|
|
2989
2989
|
end: function() {
|
|
2990
|
-
|
|
2990
|
+
ft(this);
|
|
2991
2991
|
},
|
|
2992
|
-
write:
|
|
2992
|
+
write: Ht,
|
|
2993
2993
|
resume: function() {
|
|
2994
2994
|
return this.error = null, this;
|
|
2995
2995
|
},
|
|
@@ -3012,7 +3012,7 @@ function Ji() {
|
|
|
3012
3012
|
var g = t.EVENTS.filter(function(f) {
|
|
3013
3013
|
return f !== "error" && f !== "end";
|
|
3014
3014
|
});
|
|
3015
|
-
function
|
|
3015
|
+
function A(f, l) {
|
|
3016
3016
|
return new E(f, l);
|
|
3017
3017
|
}
|
|
3018
3018
|
function E(f, l) {
|
|
@@ -3029,10 +3029,10 @@ function Ji() {
|
|
|
3029
3029
|
get: function() {
|
|
3030
3030
|
return M._parser["on" + w];
|
|
3031
3031
|
},
|
|
3032
|
-
set: function(
|
|
3033
|
-
if (!
|
|
3034
|
-
return M.removeAllListeners(w), M._parser["on" + w] =
|
|
3035
|
-
M.on(w,
|
|
3032
|
+
set: function(K) {
|
|
3033
|
+
if (!K)
|
|
3034
|
+
return M.removeAllListeners(w), M._parser["on" + w] = K, K;
|
|
3035
|
+
M.on(w, K);
|
|
3036
3036
|
},
|
|
3037
3037
|
enumerable: !0,
|
|
3038
3038
|
configurable: !1
|
|
@@ -3061,7 +3061,7 @@ function Ji() {
|
|
|
3061
3061
|
w.splice(0, 0, f), M.emit.apply(M, w);
|
|
3062
3062
|
}), o.prototype.on.call(M, f, l);
|
|
3063
3063
|
};
|
|
3064
|
-
var S = "[CDATA[",
|
|
3064
|
+
var S = "[CDATA[", I = "DOCTYPE", F = "http://www.w3.org/XML/1998/namespace", B = "http://www.w3.org/2000/xmlns/", N = { xml: F, xmlns: B }, P = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, m = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/, v = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, _ = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;
|
|
3065
3065
|
function d(f) {
|
|
3066
3066
|
return f === " " || f === `
|
|
3067
3067
|
` || f === "\r" || f === " ";
|
|
@@ -3069,7 +3069,7 @@ function Ji() {
|
|
|
3069
3069
|
function b(f) {
|
|
3070
3070
|
return f === '"' || f === "'";
|
|
3071
3071
|
}
|
|
3072
|
-
function
|
|
3072
|
+
function D(f) {
|
|
3073
3073
|
return f === ">" || d(f);
|
|
3074
3074
|
}
|
|
3075
3075
|
function O(f, l) {
|
|
@@ -3416,71 +3416,71 @@ function Ji() {
|
|
|
3416
3416
|
var l = t.ENTITIES[f], M = typeof l == "number" ? String.fromCharCode(l) : l;
|
|
3417
3417
|
t.ENTITIES[f] = M;
|
|
3418
3418
|
});
|
|
3419
|
-
for (var
|
|
3420
|
-
t.STATE[t.STATE[
|
|
3419
|
+
for (var k in t.STATE)
|
|
3420
|
+
t.STATE[t.STATE[k]] = k;
|
|
3421
3421
|
y = t.STATE;
|
|
3422
|
-
function
|
|
3422
|
+
function et(f, l, M) {
|
|
3423
3423
|
f[l] && f[l](M);
|
|
3424
3424
|
}
|
|
3425
|
-
function
|
|
3426
|
-
f.textNode &&
|
|
3425
|
+
function G(f, l, M) {
|
|
3426
|
+
f.textNode && j(f), et(f, l, M);
|
|
3427
3427
|
}
|
|
3428
|
-
function
|
|
3429
|
-
f.textNode = lt(f.opt, f.textNode), f.textNode &&
|
|
3428
|
+
function j(f) {
|
|
3429
|
+
f.textNode = lt(f.opt, f.textNode), f.textNode && et(f, "ontext", f.textNode), f.textNode = "";
|
|
3430
3430
|
}
|
|
3431
3431
|
function lt(f, l) {
|
|
3432
3432
|
return f.trim && (l = l.trim()), f.normalize && (l = l.replace(/\s+/g, " ")), l;
|
|
3433
3433
|
}
|
|
3434
|
-
function
|
|
3435
|
-
return
|
|
3434
|
+
function nt(f, l) {
|
|
3435
|
+
return j(f), f.trackPosition && (l += `
|
|
3436
3436
|
Line: ` + f.line + `
|
|
3437
3437
|
Column: ` + f.column + `
|
|
3438
|
-
Char: ` + f.c), l = new Error(l), f.error = l,
|
|
3438
|
+
Char: ` + f.c), l = new Error(l), f.error = l, et(f, "onerror", l), f;
|
|
3439
3439
|
}
|
|
3440
|
-
function
|
|
3441
|
-
return f.sawRoot && !f.closedRoot &&
|
|
3440
|
+
function ft(f) {
|
|
3441
|
+
return f.sawRoot && !f.closedRoot && L(f, "Unclosed root tag"), f.state !== y.BEGIN && f.state !== y.BEGIN_WHITESPACE && f.state !== y.TEXT && nt(f, "Unexpected end"), j(f), f.c = "", f.closed = !0, et(f, "onend"), i.call(f, f.strict, f.opt), f;
|
|
3442
3442
|
}
|
|
3443
|
-
function
|
|
3443
|
+
function L(f, l) {
|
|
3444
3444
|
if (typeof f != "object" || !(f instanceof i))
|
|
3445
3445
|
throw new Error("bad call to strictFail");
|
|
3446
|
-
f.strict &&
|
|
3446
|
+
f.strict && nt(f, l);
|
|
3447
3447
|
}
|
|
3448
|
-
function
|
|
3448
|
+
function at(f) {
|
|
3449
3449
|
f.strict || (f.tagName = f.tagName[f.looseCase]());
|
|
3450
3450
|
var l = f.tags[f.tags.length - 1] || f, M = f.tag = { name: f.tagName, attributes: {} };
|
|
3451
|
-
f.opt.xmlns && (M.ns = l.ns), f.attribList.length = 0,
|
|
3451
|
+
f.opt.xmlns && (M.ns = l.ns), f.attribList.length = 0, G(f, "onopentagstart", M);
|
|
3452
3452
|
}
|
|
3453
|
-
function
|
|
3454
|
-
var M = f.indexOf(":"), w = M < 0 ? ["", f] : f.split(":"),
|
|
3455
|
-
return l && f === "xmlns" && (
|
|
3453
|
+
function rt(f, l) {
|
|
3454
|
+
var M = f.indexOf(":"), w = M < 0 ? ["", f] : f.split(":"), K = w[0], Q = w[1];
|
|
3455
|
+
return l && f === "xmlns" && (K = "xmlns", Q = ""), { prefix: K, local: Q };
|
|
3456
3456
|
}
|
|
3457
|
-
function
|
|
3457
|
+
function W(f) {
|
|
3458
3458
|
if (f.strict || (f.attribName = f.attribName[f.looseCase]()), f.attribList.indexOf(f.attribName) !== -1 || f.tag.attributes.hasOwnProperty(f.attribName)) {
|
|
3459
3459
|
f.attribName = f.attribValue = "";
|
|
3460
3460
|
return;
|
|
3461
3461
|
}
|
|
3462
3462
|
if (f.opt.xmlns) {
|
|
3463
|
-
var l =
|
|
3463
|
+
var l = rt(f.attribName, !0), M = l.prefix, w = l.local;
|
|
3464
3464
|
if (M === "xmlns")
|
|
3465
3465
|
if (w === "xml" && f.attribValue !== F)
|
|
3466
|
-
|
|
3466
|
+
L(
|
|
3467
3467
|
f,
|
|
3468
3468
|
"xml: prefix must be bound to " + F + `
|
|
3469
3469
|
Actual: ` + f.attribValue
|
|
3470
3470
|
);
|
|
3471
3471
|
else if (w === "xmlns" && f.attribValue !== B)
|
|
3472
|
-
|
|
3472
|
+
L(
|
|
3473
3473
|
f,
|
|
3474
3474
|
"xmlns: prefix must be bound to " + B + `
|
|
3475
3475
|
Actual: ` + f.attribValue
|
|
3476
3476
|
);
|
|
3477
3477
|
else {
|
|
3478
|
-
var
|
|
3479
|
-
|
|
3478
|
+
var K = f.tag, Q = f.tags[f.tags.length - 1] || f;
|
|
3479
|
+
K.ns === Q.ns && (K.ns = Object.create(Q.ns)), K.ns[w] = f.attribValue;
|
|
3480
3480
|
}
|
|
3481
3481
|
f.attribList.push([f.attribName, f.attribValue]);
|
|
3482
3482
|
} else
|
|
3483
|
-
f.tag.attributes[f.attribName] = f.attribValue,
|
|
3483
|
+
f.tag.attributes[f.attribName] = f.attribValue, G(f, "onattribute", {
|
|
3484
3484
|
name: f.attribName,
|
|
3485
3485
|
value: f.attribValue
|
|
3486
3486
|
});
|
|
@@ -3488,32 +3488,32 @@ Actual: ` + f.attribValue
|
|
|
3488
3488
|
}
|
|
3489
3489
|
function U(f, l) {
|
|
3490
3490
|
if (f.opt.xmlns) {
|
|
3491
|
-
var M = f.tag, w =
|
|
3492
|
-
M.prefix = w.prefix, M.local = w.local, M.uri = M.ns[w.prefix] || "", M.prefix && !M.uri && (
|
|
3493
|
-
var
|
|
3494
|
-
M.ns &&
|
|
3495
|
-
|
|
3496
|
-
prefix:
|
|
3497
|
-
uri: M.ns[
|
|
3491
|
+
var M = f.tag, w = rt(f.tagName);
|
|
3492
|
+
M.prefix = w.prefix, M.local = w.local, M.uri = M.ns[w.prefix] || "", M.prefix && !M.uri && (L(f, "Unbound namespace prefix: " + JSON.stringify(f.tagName)), M.uri = w.prefix);
|
|
3493
|
+
var K = f.tags[f.tags.length - 1] || f;
|
|
3494
|
+
M.ns && K.ns !== M.ns && Object.keys(M.ns).forEach(function(mt) {
|
|
3495
|
+
G(f, "onopennamespace", {
|
|
3496
|
+
prefix: mt,
|
|
3497
|
+
uri: M.ns[mt]
|
|
3498
3498
|
});
|
|
3499
3499
|
});
|
|
3500
|
-
for (var Q = 0,
|
|
3501
|
-
var
|
|
3500
|
+
for (var Q = 0, z = f.attribList.length; Q < z; Q++) {
|
|
3501
|
+
var it = f.attribList[Q], ct = it[0], It = it[1], tt = rt(ct, !0), xt = tt.prefix, ne = tt.local, Yt = xt === "" ? "" : M.ns[xt] || "", St = {
|
|
3502
3502
|
name: ct,
|
|
3503
|
-
value:
|
|
3504
|
-
prefix:
|
|
3503
|
+
value: It,
|
|
3504
|
+
prefix: xt,
|
|
3505
3505
|
local: ne,
|
|
3506
3506
|
uri: Yt
|
|
3507
3507
|
};
|
|
3508
|
-
|
|
3508
|
+
xt && xt !== "xmlns" && !Yt && (L(f, "Unbound namespace prefix: " + JSON.stringify(xt)), St.uri = xt), f.tag.attributes[ct] = St, G(f, "onattribute", St);
|
|
3509
3509
|
}
|
|
3510
3510
|
f.attribList.length = 0;
|
|
3511
3511
|
}
|
|
3512
|
-
f.tag.isSelfClosing = !!l, f.sawRoot = !0, f.tags.push(f.tag),
|
|
3512
|
+
f.tag.isSelfClosing = !!l, f.sawRoot = !0, f.tags.push(f.tag), G(f, "onopentag", f.tag), l || (!f.noscript && f.tagName.toLowerCase() === "script" ? f.state = y.SCRIPT : f.state = y.TEXT, f.tag = null, f.tagName = ""), f.attribName = f.attribValue = "", f.attribList.length = 0;
|
|
3513
3513
|
}
|
|
3514
|
-
function
|
|
3514
|
+
function X(f) {
|
|
3515
3515
|
if (!f.tagName) {
|
|
3516
|
-
|
|
3516
|
+
L(f, "Weird empty close tag."), f.textNode += "</>", f.state = y.TEXT;
|
|
3517
3517
|
return;
|
|
3518
3518
|
}
|
|
3519
3519
|
if (f.script) {
|
|
@@ -3521,58 +3521,58 @@ Actual: ` + f.attribValue
|
|
|
3521
3521
|
f.script += "</" + f.tagName + ">", f.tagName = "", f.state = y.SCRIPT;
|
|
3522
3522
|
return;
|
|
3523
3523
|
}
|
|
3524
|
-
|
|
3524
|
+
G(f, "onscript", f.script), f.script = "";
|
|
3525
3525
|
}
|
|
3526
3526
|
var l = f.tags.length, M = f.tagName;
|
|
3527
3527
|
f.strict || (M = M[f.looseCase]());
|
|
3528
3528
|
for (var w = M; l--; ) {
|
|
3529
|
-
var
|
|
3530
|
-
if (
|
|
3531
|
-
|
|
3529
|
+
var K = f.tags[l];
|
|
3530
|
+
if (K.name !== w)
|
|
3531
|
+
L(f, "Unexpected close tag");
|
|
3532
3532
|
else
|
|
3533
3533
|
break;
|
|
3534
3534
|
}
|
|
3535
3535
|
if (l < 0) {
|
|
3536
|
-
|
|
3536
|
+
L(f, "Unmatched closing tag: " + f.tagName), f.textNode += "</" + f.tagName + ">", f.state = y.TEXT;
|
|
3537
3537
|
return;
|
|
3538
3538
|
}
|
|
3539
3539
|
f.tagName = M;
|
|
3540
3540
|
for (var Q = f.tags.length; Q-- > l; ) {
|
|
3541
|
-
var
|
|
3542
|
-
f.tagName = f.tag.name,
|
|
3543
|
-
var
|
|
3544
|
-
for (var ct in
|
|
3545
|
-
|
|
3546
|
-
var
|
|
3547
|
-
f.opt.xmlns &&
|
|
3548
|
-
var
|
|
3549
|
-
|
|
3541
|
+
var z = f.tag = f.tags.pop();
|
|
3542
|
+
f.tagName = f.tag.name, G(f, "onclosetag", f.tagName);
|
|
3543
|
+
var it = {};
|
|
3544
|
+
for (var ct in z.ns)
|
|
3545
|
+
it[ct] = z.ns[ct];
|
|
3546
|
+
var It = f.tags[f.tags.length - 1] || f;
|
|
3547
|
+
f.opt.xmlns && z.ns !== It.ns && Object.keys(z.ns).forEach(function(tt) {
|
|
3548
|
+
var xt = z.ns[tt];
|
|
3549
|
+
G(f, "onclosenamespace", { prefix: tt, uri: xt });
|
|
3550
3550
|
});
|
|
3551
3551
|
}
|
|
3552
3552
|
l === 0 && (f.closedRoot = !0), f.tagName = f.attribValue = f.attribName = "", f.attribList.length = 0, f.state = y.TEXT;
|
|
3553
3553
|
}
|
|
3554
|
-
function
|
|
3555
|
-
var l = f.entity, M = l.toLowerCase(), w,
|
|
3556
|
-
return f.ENTITIES[l] ? f.ENTITIES[l] : f.ENTITIES[M] ? f.ENTITIES[M] : (l = M, l.charAt(0) === "#" && (l.charAt(1) === "x" ? (l = l.slice(2), w = parseInt(l, 16),
|
|
3554
|
+
function pt(f) {
|
|
3555
|
+
var l = f.entity, M = l.toLowerCase(), w, K = "";
|
|
3556
|
+
return f.ENTITIES[l] ? f.ENTITIES[l] : f.ENTITIES[M] ? f.ENTITIES[M] : (l = M, l.charAt(0) === "#" && (l.charAt(1) === "x" ? (l = l.slice(2), w = parseInt(l, 16), K = w.toString(16)) : (l = l.slice(1), w = parseInt(l, 10), K = w.toString(10))), l = l.replace(/^0+/, ""), isNaN(w) || K.toLowerCase() !== l ? (L(f, "Invalid character entity"), "&" + f.entity + ";") : String.fromCodePoint(w));
|
|
3557
3557
|
}
|
|
3558
|
-
function
|
|
3559
|
-
l === "<" ? (f.state = y.OPEN_WAKA, f.startTagPosition = f.position) : d(l) || (
|
|
3558
|
+
function wt(f, l) {
|
|
3559
|
+
l === "<" ? (f.state = y.OPEN_WAKA, f.startTagPosition = f.position) : d(l) || (L(f, "Non-whitespace before first tag."), f.textNode = l, f.state = y.TEXT);
|
|
3560
3560
|
}
|
|
3561
3561
|
function Xt(f, l) {
|
|
3562
3562
|
var M = "";
|
|
3563
3563
|
return l < f.length && (M = f.charAt(l)), M;
|
|
3564
3564
|
}
|
|
3565
|
-
function
|
|
3565
|
+
function Ht(f) {
|
|
3566
3566
|
var l = this;
|
|
3567
3567
|
if (this.error)
|
|
3568
3568
|
throw this.error;
|
|
3569
3569
|
if (l.closed)
|
|
3570
|
-
return
|
|
3570
|
+
return nt(
|
|
3571
3571
|
l,
|
|
3572
3572
|
"Cannot write after close. Assign an onready handler."
|
|
3573
3573
|
);
|
|
3574
3574
|
if (f === null)
|
|
3575
|
-
return
|
|
3575
|
+
return ft(l);
|
|
3576
3576
|
typeof f == "object" && (f = f.toString());
|
|
3577
3577
|
for (var M = 0, w = ""; w = Xt(f, M++), l.c = w, !!w; )
|
|
3578
3578
|
switch (l.trackPosition && (l.position++, w === `
|
|
@@ -3580,19 +3580,19 @@ Actual: ` + f.attribValue
|
|
|
3580
3580
|
case y.BEGIN:
|
|
3581
3581
|
if (l.state = y.BEGIN_WHITESPACE, w === "\uFEFF")
|
|
3582
3582
|
continue;
|
|
3583
|
-
|
|
3583
|
+
wt(l, w);
|
|
3584
3584
|
continue;
|
|
3585
3585
|
case y.BEGIN_WHITESPACE:
|
|
3586
|
-
|
|
3586
|
+
wt(l, w);
|
|
3587
3587
|
continue;
|
|
3588
3588
|
case y.TEXT:
|
|
3589
3589
|
if (l.sawRoot && !l.closedRoot) {
|
|
3590
|
-
for (var
|
|
3590
|
+
for (var K = M - 1; w && w !== "<" && w !== "&"; )
|
|
3591
3591
|
w = Xt(f, M++), w && l.trackPosition && (l.position++, w === `
|
|
3592
3592
|
` ? (l.line++, l.column = 0) : l.column++);
|
|
3593
|
-
l.textNode += f.substring(
|
|
3593
|
+
l.textNode += f.substring(K, M - 1);
|
|
3594
3594
|
}
|
|
3595
|
-
w === "<" && !(l.sawRoot && l.closedRoot && !l.strict) ? (l.state = y.OPEN_WAKA, l.startTagPosition = l.position) : (!d(w) && (!l.sawRoot || l.closedRoot) &&
|
|
3595
|
+
w === "<" && !(l.sawRoot && l.closedRoot && !l.strict) ? (l.state = y.OPEN_WAKA, l.startTagPosition = l.position) : (!d(w) && (!l.sawRoot || l.closedRoot) && L(l, "Text data outside of root node."), w === "&" ? l.state = y.TEXT_ENTITY : l.textNode += w);
|
|
3596
3596
|
continue;
|
|
3597
3597
|
case y.SCRIPT:
|
|
3598
3598
|
w === "<" ? l.state = y.SCRIPT_ENDING : l.script += w;
|
|
@@ -3610,7 +3610,7 @@ Actual: ` + f.attribValue
|
|
|
3610
3610
|
else if (w === "?")
|
|
3611
3611
|
l.state = y.PROC_INST, l.procInstName = l.procInstBody = "";
|
|
3612
3612
|
else {
|
|
3613
|
-
if (
|
|
3613
|
+
if (L(l, "Unencoded <"), l.startTagPosition + 1 < l.position) {
|
|
3614
3614
|
var Q = l.position - l.startTagPosition;
|
|
3615
3615
|
w = new Array(Q).join(" ") + w;
|
|
3616
3616
|
}
|
|
@@ -3622,16 +3622,16 @@ Actual: ` + f.attribValue
|
|
|
3622
3622
|
l.state = y.COMMENT, l.comment = "", l.sgmlDecl = "";
|
|
3623
3623
|
continue;
|
|
3624
3624
|
}
|
|
3625
|
-
l.doctype && l.doctype !== !0 && l.sgmlDecl ? (l.state = y.DOCTYPE_DTD, l.doctype += "<!" + l.sgmlDecl + w, l.sgmlDecl = "") : (l.sgmlDecl + w).toUpperCase() === S ? (
|
|
3625
|
+
l.doctype && l.doctype !== !0 && l.sgmlDecl ? (l.state = y.DOCTYPE_DTD, l.doctype += "<!" + l.sgmlDecl + w, l.sgmlDecl = "") : (l.sgmlDecl + w).toUpperCase() === S ? (G(l, "onopencdata"), l.state = y.CDATA, l.sgmlDecl = "", l.cdata = "") : (l.sgmlDecl + w).toUpperCase() === I ? (l.state = y.DOCTYPE, (l.doctype || l.sawRoot) && L(
|
|
3626
3626
|
l,
|
|
3627
3627
|
"Inappropriately located doctype declaration"
|
|
3628
|
-
), l.doctype = "", l.sgmlDecl = "") : w === ">" ? (
|
|
3628
|
+
), l.doctype = "", l.sgmlDecl = "") : w === ">" ? (G(l, "onsgmldeclaration", l.sgmlDecl), l.sgmlDecl = "", l.state = y.TEXT) : (b(w) && (l.state = y.SGML_DECL_QUOTED), l.sgmlDecl += w);
|
|
3629
3629
|
continue;
|
|
3630
3630
|
case y.SGML_DECL_QUOTED:
|
|
3631
3631
|
w === l.q && (l.state = y.SGML_DECL, l.q = ""), l.sgmlDecl += w;
|
|
3632
3632
|
continue;
|
|
3633
3633
|
case y.DOCTYPE:
|
|
3634
|
-
w === ">" ? (l.state = y.TEXT,
|
|
3634
|
+
w === ">" ? (l.state = y.TEXT, G(l, "ondoctype", l.doctype), l.doctype = !0) : (l.doctype += w, w === "[" ? l.state = y.DOCTYPE_DTD : b(w) && (l.state = y.DOCTYPE_QUOTED, l.q = w));
|
|
3635
3635
|
continue;
|
|
3636
3636
|
case y.DOCTYPE_QUOTED:
|
|
3637
3637
|
l.doctype += w, w === l.q && (l.q = "", l.state = y.DOCTYPE);
|
|
@@ -3646,10 +3646,10 @@ Actual: ` + f.attribValue
|
|
|
3646
3646
|
w === "-" ? l.state = y.COMMENT_ENDING : l.comment += w;
|
|
3647
3647
|
continue;
|
|
3648
3648
|
case y.COMMENT_ENDING:
|
|
3649
|
-
w === "-" ? (l.state = y.COMMENT_ENDED, l.comment = lt(l.opt, l.comment), l.comment &&
|
|
3649
|
+
w === "-" ? (l.state = y.COMMENT_ENDED, l.comment = lt(l.opt, l.comment), l.comment && G(l, "oncomment", l.comment), l.comment = "") : (l.comment += "-" + w, l.state = y.COMMENT);
|
|
3650
3650
|
continue;
|
|
3651
3651
|
case y.COMMENT_ENDED:
|
|
3652
|
-
w !== ">" ? (
|
|
3652
|
+
w !== ">" ? (L(l, "Malformed comment"), l.comment += "--" + w, l.state = y.COMMENT) : l.doctype && l.doctype !== !0 ? l.state = y.DOCTYPE_DTD : l.state = y.TEXT;
|
|
3653
3653
|
continue;
|
|
3654
3654
|
case y.CDATA:
|
|
3655
3655
|
w === "]" ? l.state = y.CDATA_ENDING : l.cdata += w;
|
|
@@ -3658,7 +3658,7 @@ Actual: ` + f.attribValue
|
|
|
3658
3658
|
w === "]" ? l.state = y.CDATA_ENDING_2 : (l.cdata += "]" + w, l.state = y.CDATA);
|
|
3659
3659
|
continue;
|
|
3660
3660
|
case y.CDATA_ENDING_2:
|
|
3661
|
-
w === ">" ? (l.cdata &&
|
|
3661
|
+
w === ">" ? (l.cdata && G(l, "oncdata", l.cdata), G(l, "onclosecdata"), l.cdata = "", l.state = y.TEXT) : w === "]" ? l.cdata += "]" : (l.cdata += "]]" + w, l.state = y.CDATA);
|
|
3662
3662
|
continue;
|
|
3663
3663
|
case y.PROC_INST:
|
|
3664
3664
|
w === "?" ? l.state = y.PROC_INST_ENDING : d(w) ? l.state = y.PROC_INST_BODY : l.procInstName += w;
|
|
@@ -3669,24 +3669,24 @@ Actual: ` + f.attribValue
|
|
|
3669
3669
|
w === "?" ? l.state = y.PROC_INST_ENDING : l.procInstBody += w;
|
|
3670
3670
|
continue;
|
|
3671
3671
|
case y.PROC_INST_ENDING:
|
|
3672
|
-
w === ">" ? (
|
|
3672
|
+
w === ">" ? (G(l, "onprocessinginstruction", {
|
|
3673
3673
|
name: l.procInstName,
|
|
3674
3674
|
body: l.procInstBody
|
|
3675
3675
|
}), l.procInstName = l.procInstBody = "", l.state = y.TEXT) : (l.procInstBody += "?" + w, l.state = y.PROC_INST_BODY);
|
|
3676
3676
|
continue;
|
|
3677
3677
|
case y.OPEN_TAG:
|
|
3678
|
-
O(
|
|
3678
|
+
O(m, w) ? l.tagName += w : (at(l), w === ">" ? U(l) : w === "/" ? l.state = y.OPEN_TAG_SLASH : (d(w) || L(l, "Invalid character in tag name"), l.state = y.ATTRIB));
|
|
3679
3679
|
continue;
|
|
3680
3680
|
case y.OPEN_TAG_SLASH:
|
|
3681
|
-
w === ">" ? (U(l, !0),
|
|
3681
|
+
w === ">" ? (U(l, !0), X(l)) : (L(l, "Forward-slash in opening tag not followed by >"), l.state = y.ATTRIB);
|
|
3682
3682
|
continue;
|
|
3683
3683
|
case y.ATTRIB:
|
|
3684
3684
|
if (d(w))
|
|
3685
3685
|
continue;
|
|
3686
|
-
w === ">" ? U(l) : w === "/" ? l.state = y.OPEN_TAG_SLASH : O(P, w) ? (l.attribName = w, l.attribValue = "", l.state = y.ATTRIB_NAME) :
|
|
3686
|
+
w === ">" ? U(l) : w === "/" ? l.state = y.OPEN_TAG_SLASH : O(P, w) ? (l.attribName = w, l.attribValue = "", l.state = y.ATTRIB_NAME) : L(l, "Invalid attribute name");
|
|
3687
3687
|
continue;
|
|
3688
3688
|
case y.ATTRIB_NAME:
|
|
3689
|
-
w === "=" ? l.state = y.ATTRIB_VALUE : w === ">" ? (
|
|
3689
|
+
w === "=" ? l.state = y.ATTRIB_VALUE : w === ">" ? (L(l, "Attribute without value"), l.attribValue = l.attribName, W(l), U(l)) : d(w) ? l.state = y.ATTRIB_NAME_SAW_WHITE : O(m, w) ? l.attribName += w : L(l, "Invalid attribute name");
|
|
3690
3690
|
continue;
|
|
3691
3691
|
case y.ATTRIB_NAME_SAW_WHITE:
|
|
3692
3692
|
if (w === "=")
|
|
@@ -3694,67 +3694,67 @@ Actual: ` + f.attribValue
|
|
|
3694
3694
|
else {
|
|
3695
3695
|
if (d(w))
|
|
3696
3696
|
continue;
|
|
3697
|
-
|
|
3697
|
+
L(l, "Attribute without value"), l.tag.attributes[l.attribName] = "", l.attribValue = "", G(l, "onattribute", {
|
|
3698
3698
|
name: l.attribName,
|
|
3699
3699
|
value: ""
|
|
3700
|
-
}), l.attribName = "", w === ">" ? U(l) : O(P, w) ? (l.attribName = w, l.state = y.ATTRIB_NAME) : (
|
|
3700
|
+
}), l.attribName = "", w === ">" ? U(l) : O(P, w) ? (l.attribName = w, l.state = y.ATTRIB_NAME) : (L(l, "Invalid attribute name"), l.state = y.ATTRIB);
|
|
3701
3701
|
}
|
|
3702
3702
|
continue;
|
|
3703
3703
|
case y.ATTRIB_VALUE:
|
|
3704
3704
|
if (d(w))
|
|
3705
3705
|
continue;
|
|
3706
|
-
b(w) ? (l.q = w, l.state = y.ATTRIB_VALUE_QUOTED) : (l.opt.unquotedAttributeValues ||
|
|
3706
|
+
b(w) ? (l.q = w, l.state = y.ATTRIB_VALUE_QUOTED) : (l.opt.unquotedAttributeValues || nt(l, "Unquoted attribute value"), l.state = y.ATTRIB_VALUE_UNQUOTED, l.attribValue = w);
|
|
3707
3707
|
continue;
|
|
3708
3708
|
case y.ATTRIB_VALUE_QUOTED:
|
|
3709
3709
|
if (w !== l.q) {
|
|
3710
3710
|
w === "&" ? l.state = y.ATTRIB_VALUE_ENTITY_Q : l.attribValue += w;
|
|
3711
3711
|
continue;
|
|
3712
3712
|
}
|
|
3713
|
-
|
|
3713
|
+
W(l), l.q = "", l.state = y.ATTRIB_VALUE_CLOSED;
|
|
3714
3714
|
continue;
|
|
3715
3715
|
case y.ATTRIB_VALUE_CLOSED:
|
|
3716
|
-
d(w) ? l.state = y.ATTRIB : w === ">" ? U(l) : w === "/" ? l.state = y.OPEN_TAG_SLASH : O(P, w) ? (
|
|
3716
|
+
d(w) ? l.state = y.ATTRIB : w === ">" ? U(l) : w === "/" ? l.state = y.OPEN_TAG_SLASH : O(P, w) ? (L(l, "No whitespace between attributes"), l.attribName = w, l.attribValue = "", l.state = y.ATTRIB_NAME) : L(l, "Invalid attribute name");
|
|
3717
3717
|
continue;
|
|
3718
3718
|
case y.ATTRIB_VALUE_UNQUOTED:
|
|
3719
|
-
if (!
|
|
3719
|
+
if (!D(w)) {
|
|
3720
3720
|
w === "&" ? l.state = y.ATTRIB_VALUE_ENTITY_U : l.attribValue += w;
|
|
3721
3721
|
continue;
|
|
3722
3722
|
}
|
|
3723
|
-
|
|
3723
|
+
W(l), w === ">" ? U(l) : l.state = y.ATTRIB;
|
|
3724
3724
|
continue;
|
|
3725
3725
|
case y.CLOSE_TAG:
|
|
3726
3726
|
if (l.tagName)
|
|
3727
|
-
w === ">" ?
|
|
3727
|
+
w === ">" ? X(l) : O(m, w) ? l.tagName += w : l.script ? (l.script += "</" + l.tagName, l.tagName = "", l.state = y.SCRIPT) : (d(w) || L(l, "Invalid tagname in closing tag"), l.state = y.CLOSE_TAG_SAW_WHITE);
|
|
3728
3728
|
else {
|
|
3729
3729
|
if (d(w))
|
|
3730
3730
|
continue;
|
|
3731
|
-
R(P, w) ? l.script ? (l.script += "</" + w, l.state = y.SCRIPT) :
|
|
3731
|
+
R(P, w) ? l.script ? (l.script += "</" + w, l.state = y.SCRIPT) : L(l, "Invalid tagname in closing tag.") : l.tagName = w;
|
|
3732
3732
|
}
|
|
3733
3733
|
continue;
|
|
3734
3734
|
case y.CLOSE_TAG_SAW_WHITE:
|
|
3735
3735
|
if (d(w))
|
|
3736
3736
|
continue;
|
|
3737
|
-
w === ">" ?
|
|
3737
|
+
w === ">" ? X(l) : L(l, "Invalid characters in closing tag");
|
|
3738
3738
|
continue;
|
|
3739
3739
|
case y.TEXT_ENTITY:
|
|
3740
3740
|
case y.ATTRIB_VALUE_ENTITY_Q:
|
|
3741
3741
|
case y.ATTRIB_VALUE_ENTITY_U:
|
|
3742
|
-
var
|
|
3742
|
+
var z, it;
|
|
3743
3743
|
switch (l.state) {
|
|
3744
3744
|
case y.TEXT_ENTITY:
|
|
3745
|
-
|
|
3745
|
+
z = y.TEXT, it = "textNode";
|
|
3746
3746
|
break;
|
|
3747
3747
|
case y.ATTRIB_VALUE_ENTITY_Q:
|
|
3748
|
-
|
|
3748
|
+
z = y.ATTRIB_VALUE_QUOTED, it = "attribValue";
|
|
3749
3749
|
break;
|
|
3750
3750
|
case y.ATTRIB_VALUE_ENTITY_U:
|
|
3751
|
-
|
|
3751
|
+
z = y.ATTRIB_VALUE_UNQUOTED, it = "attribValue";
|
|
3752
3752
|
break;
|
|
3753
3753
|
}
|
|
3754
3754
|
if (w === ";") {
|
|
3755
|
-
var ct =
|
|
3756
|
-
l.opt.unparsedEntities && !Object.values(t.XML_ENTITIES).includes(ct) ? (l.entity = "", l.state =
|
|
3757
|
-
} else O(l.entity.length ?
|
|
3755
|
+
var ct = pt(l);
|
|
3756
|
+
l.opt.unparsedEntities && !Object.values(t.XML_ENTITIES).includes(ct) ? (l.entity = "", l.state = z, l.write(ct)) : (l[it] += ct, l.entity = "", l.state = z);
|
|
3757
|
+
} else O(l.entity.length ? _ : v, w) ? l.entity += w : (L(l, "Invalid character in entity name"), l[it] += "&" + l.entity + w, l.entity = "", l.state = z);
|
|
3758
3758
|
continue;
|
|
3759
3759
|
default:
|
|
3760
3760
|
throw new Error(l, "Unknown state: " + l.state);
|
|
@@ -3763,19 +3763,19 @@ Actual: ` + f.attribValue
|
|
|
3763
3763
|
}
|
|
3764
3764
|
String.fromCodePoint || (function() {
|
|
3765
3765
|
var f = String.fromCharCode, l = Math.floor, M = function() {
|
|
3766
|
-
var w = 16384,
|
|
3766
|
+
var w = 16384, K = [], Q, z, it = -1, ct = arguments.length;
|
|
3767
3767
|
if (!ct)
|
|
3768
3768
|
return "";
|
|
3769
|
-
for (var
|
|
3770
|
-
var
|
|
3771
|
-
if (!isFinite(
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
l(
|
|
3775
|
-
throw RangeError("Invalid code point: " +
|
|
3776
|
-
|
|
3769
|
+
for (var It = ""; ++it < ct; ) {
|
|
3770
|
+
var tt = Number(arguments[it]);
|
|
3771
|
+
if (!isFinite(tt) || // `NaN`, `+Infinity`, or `-Infinity`
|
|
3772
|
+
tt < 0 || // not a valid Unicode code point
|
|
3773
|
+
tt > 1114111 || // not a valid Unicode code point
|
|
3774
|
+
l(tt) !== tt)
|
|
3775
|
+
throw RangeError("Invalid code point: " + tt);
|
|
3776
|
+
tt <= 65535 ? K.push(tt) : (tt -= 65536, Q = (tt >> 10) + 55296, z = tt % 1024 + 56320, K.push(Q, z)), (it + 1 === ct || K.length > w) && (It += f.apply(null, K), K.length = 0);
|
|
3777
3777
|
}
|
|
3778
|
-
return
|
|
3778
|
+
return It;
|
|
3779
3779
|
};
|
|
3780
3780
|
Object.defineProperty ? Object.defineProperty(String, "fromCodePoint", {
|
|
3781
3781
|
value: M,
|
|
@@ -3786,16 +3786,16 @@ Actual: ` + f.attribValue
|
|
|
3786
3786
|
})(h);
|
|
3787
3787
|
})(ce)), ce;
|
|
3788
3788
|
}
|
|
3789
|
-
var fe,
|
|
3789
|
+
var fe, qe;
|
|
3790
3790
|
function Fe() {
|
|
3791
|
-
return
|
|
3791
|
+
return qe || (qe = 1, fe = {
|
|
3792
3792
|
isArray: function(h) {
|
|
3793
3793
|
return Array.isArray ? Array.isArray(h) : Object.prototype.toString.call(h) === "[object Array]";
|
|
3794
3794
|
}
|
|
3795
3795
|
}), fe;
|
|
3796
3796
|
}
|
|
3797
3797
|
var de, je;
|
|
3798
|
-
function
|
|
3798
|
+
function Ne() {
|
|
3799
3799
|
if (je) return de;
|
|
3800
3800
|
je = 1;
|
|
3801
3801
|
var h = Fe().isArray;
|
|
@@ -3827,187 +3827,187 @@ var pe, ze;
|
|
|
3827
3827
|
function ni() {
|
|
3828
3828
|
if (ze) return pe;
|
|
3829
3829
|
ze = 1;
|
|
3830
|
-
var h = Ji(), t =
|
|
3831
|
-
function c(
|
|
3832
|
-
return i = t.copyOptions(
|
|
3830
|
+
var h = Ji(), t = Ne(), e = Fe().isArray, i, s;
|
|
3831
|
+
function c(m) {
|
|
3832
|
+
return i = t.copyOptions(m), t.ensureFlagExists("ignoreDeclaration", i), t.ensureFlagExists("ignoreInstruction", i), t.ensureFlagExists("ignoreAttributes", i), t.ensureFlagExists("ignoreText", i), t.ensureFlagExists("ignoreComment", i), t.ensureFlagExists("ignoreCdata", i), t.ensureFlagExists("ignoreDoctype", i), t.ensureFlagExists("compact", i), t.ensureFlagExists("alwaysChildren", i), t.ensureFlagExists("addParent", i), t.ensureFlagExists("trim", i), t.ensureFlagExists("nativeType", i), t.ensureFlagExists("nativeTypeAttributes", i), t.ensureFlagExists("sanitize", i), t.ensureFlagExists("instructionHasAttributes", i), t.ensureFlagExists("captureSpacesBetweenElements", i), t.ensureAlwaysArrayExists(i), t.ensureKeyExists("declaration", i), t.ensureKeyExists("instruction", i), t.ensureKeyExists("attributes", i), t.ensureKeyExists("text", i), t.ensureKeyExists("comment", i), t.ensureKeyExists("cdata", i), t.ensureKeyExists("doctype", i), t.ensureKeyExists("type", i), t.ensureKeyExists("name", i), t.ensureKeyExists("elements", i), t.ensureKeyExists("parent", i), t.checkFnExists("doctype", i), t.checkFnExists("instruction", i), t.checkFnExists("cdata", i), t.checkFnExists("comment", i), t.checkFnExists("text", i), t.checkFnExists("instructionName", i), t.checkFnExists("elementName", i), t.checkFnExists("attributeName", i), t.checkFnExists("attributeValue", i), t.checkFnExists("attributes", i), i;
|
|
3833
3833
|
}
|
|
3834
|
-
function a(
|
|
3835
|
-
var v = Number(
|
|
3834
|
+
function a(m) {
|
|
3835
|
+
var v = Number(m);
|
|
3836
3836
|
if (!isNaN(v))
|
|
3837
3837
|
return v;
|
|
3838
|
-
var
|
|
3839
|
-
return
|
|
3838
|
+
var _ = m.toLowerCase();
|
|
3839
|
+
return _ === "true" ? !0 : _ === "false" ? !1 : m;
|
|
3840
3840
|
}
|
|
3841
|
-
function o(
|
|
3842
|
-
var
|
|
3841
|
+
function o(m, v) {
|
|
3842
|
+
var _;
|
|
3843
3843
|
if (i.compact) {
|
|
3844
|
-
if (!s[i[
|
|
3845
|
-
for (
|
|
3846
|
-
if (v.hasOwnProperty(
|
|
3844
|
+
if (!s[i[m + "Key"]] && (e(i.alwaysArray) ? i.alwaysArray.indexOf(i[m + "Key"]) !== -1 : i.alwaysArray) && (s[i[m + "Key"]] = []), s[i[m + "Key"]] && !e(s[i[m + "Key"]]) && (s[i[m + "Key"]] = [s[i[m + "Key"]]]), m + "Fn" in i && typeof v == "string" && (v = i[m + "Fn"](v, s)), m === "instruction" && ("instructionFn" in i || "instructionNameFn" in i)) {
|
|
3845
|
+
for (_ in v)
|
|
3846
|
+
if (v.hasOwnProperty(_))
|
|
3847
3847
|
if ("instructionFn" in i)
|
|
3848
|
-
v[
|
|
3848
|
+
v[_] = i.instructionFn(v[_], _, s);
|
|
3849
3849
|
else {
|
|
3850
|
-
var d = v[
|
|
3851
|
-
delete v[
|
|
3850
|
+
var d = v[_];
|
|
3851
|
+
delete v[_], v[i.instructionNameFn(_, d, s)] = d;
|
|
3852
3852
|
}
|
|
3853
3853
|
}
|
|
3854
|
-
e(s[i[
|
|
3854
|
+
e(s[i[m + "Key"]]) ? s[i[m + "Key"]].push(v) : s[i[m + "Key"]] = v;
|
|
3855
3855
|
} else {
|
|
3856
3856
|
s[i.elementsKey] || (s[i.elementsKey] = []);
|
|
3857
3857
|
var b = {};
|
|
3858
|
-
if (b[i.typeKey] =
|
|
3859
|
-
for (
|
|
3860
|
-
if (v.hasOwnProperty(
|
|
3858
|
+
if (b[i.typeKey] = m, m === "instruction") {
|
|
3859
|
+
for (_ in v)
|
|
3860
|
+
if (v.hasOwnProperty(_))
|
|
3861
3861
|
break;
|
|
3862
|
-
b[i.nameKey] = "instructionNameFn" in i ? i.instructionNameFn(
|
|
3862
|
+
b[i.nameKey] = "instructionNameFn" in i ? i.instructionNameFn(_, v, s) : _, i.instructionHasAttributes ? (b[i.attributesKey] = v[_][i.attributesKey], "instructionFn" in i && (b[i.attributesKey] = i.instructionFn(b[i.attributesKey], _, s))) : ("instructionFn" in i && (v[_] = i.instructionFn(v[_], _, s)), b[i.instructionKey] = v[_]);
|
|
3863
3863
|
} else
|
|
3864
|
-
|
|
3864
|
+
m + "Fn" in i && (v = i[m + "Fn"](v, s)), b[i[m + "Key"]] = v;
|
|
3865
3865
|
i.addParent && (b[i.parentKey] = s), s[i.elementsKey].push(b);
|
|
3866
3866
|
}
|
|
3867
3867
|
}
|
|
3868
|
-
function g(
|
|
3869
|
-
if ("attributesFn" in i &&
|
|
3868
|
+
function g(m) {
|
|
3869
|
+
if ("attributesFn" in i && m && (m = i.attributesFn(m, s)), (i.trim || "attributeValueFn" in i || "attributeNameFn" in i || i.nativeTypeAttributes) && m) {
|
|
3870
3870
|
var v;
|
|
3871
|
-
for (v in
|
|
3872
|
-
if (
|
|
3873
|
-
var
|
|
3874
|
-
delete
|
|
3871
|
+
for (v in m)
|
|
3872
|
+
if (m.hasOwnProperty(v) && (i.trim && (m[v] = m[v].trim()), i.nativeTypeAttributes && (m[v] = a(m[v])), "attributeValueFn" in i && (m[v] = i.attributeValueFn(m[v], v, s)), "attributeNameFn" in i)) {
|
|
3873
|
+
var _ = m[v];
|
|
3874
|
+
delete m[v], m[i.attributeNameFn(v, m[v], s)] = _;
|
|
3875
3875
|
}
|
|
3876
3876
|
}
|
|
3877
|
-
return
|
|
3877
|
+
return m;
|
|
3878
3878
|
}
|
|
3879
|
-
function
|
|
3879
|
+
function A(m) {
|
|
3880
3880
|
var v = {};
|
|
3881
|
-
if (
|
|
3882
|
-
for (var
|
|
3881
|
+
if (m.body && (m.name.toLowerCase() === "xml" || i.instructionHasAttributes)) {
|
|
3882
|
+
for (var _ = /([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g, d; (d = _.exec(m.body)) !== null; )
|
|
3883
3883
|
v[d[1]] = d[2] || d[3] || d[4];
|
|
3884
3884
|
v = g(v);
|
|
3885
3885
|
}
|
|
3886
|
-
if (
|
|
3886
|
+
if (m.name.toLowerCase() === "xml") {
|
|
3887
3887
|
if (i.ignoreDeclaration)
|
|
3888
3888
|
return;
|
|
3889
3889
|
s[i.declarationKey] = {}, Object.keys(v).length && (s[i.declarationKey][i.attributesKey] = v), i.addParent && (s[i.declarationKey][i.parentKey] = s);
|
|
3890
3890
|
} else {
|
|
3891
3891
|
if (i.ignoreInstruction)
|
|
3892
3892
|
return;
|
|
3893
|
-
i.trim && (
|
|
3893
|
+
i.trim && (m.body = m.body.trim());
|
|
3894
3894
|
var b = {};
|
|
3895
|
-
i.instructionHasAttributes && Object.keys(v).length ? (b[
|
|
3895
|
+
i.instructionHasAttributes && Object.keys(v).length ? (b[m.name] = {}, b[m.name][i.attributesKey] = v) : b[m.name] = m.body, o("instruction", b);
|
|
3896
3896
|
}
|
|
3897
3897
|
}
|
|
3898
|
-
function E(
|
|
3899
|
-
var
|
|
3900
|
-
if (typeof
|
|
3901
|
-
if (
|
|
3902
|
-
|
|
3898
|
+
function E(m, v) {
|
|
3899
|
+
var _;
|
|
3900
|
+
if (typeof m == "object" && (v = m.attributes, m = m.name), v = g(v), "elementNameFn" in i && (m = i.elementNameFn(m, s)), i.compact) {
|
|
3901
|
+
if (_ = {}, !i.ignoreAttributes && v && Object.keys(v).length) {
|
|
3902
|
+
_[i.attributesKey] = {};
|
|
3903
3903
|
var d;
|
|
3904
3904
|
for (d in v)
|
|
3905
|
-
v.hasOwnProperty(d) && (
|
|
3905
|
+
v.hasOwnProperty(d) && (_[i.attributesKey][d] = v[d]);
|
|
3906
3906
|
}
|
|
3907
|
-
!(
|
|
3907
|
+
!(m in s) && (e(i.alwaysArray) ? i.alwaysArray.indexOf(m) !== -1 : i.alwaysArray) && (s[m] = []), s[m] && !e(s[m]) && (s[m] = [s[m]]), e(s[m]) ? s[m].push(_) : s[m] = _;
|
|
3908
3908
|
} else
|
|
3909
|
-
s[i.elementsKey] || (s[i.elementsKey] = []),
|
|
3910
|
-
|
|
3909
|
+
s[i.elementsKey] || (s[i.elementsKey] = []), _ = {}, _[i.typeKey] = "element", _[i.nameKey] = m, !i.ignoreAttributes && v && Object.keys(v).length && (_[i.attributesKey] = v), i.alwaysChildren && (_[i.elementsKey] = []), s[i.elementsKey].push(_);
|
|
3910
|
+
_[i.parentKey] = s, s = _;
|
|
3911
3911
|
}
|
|
3912
|
-
function S(
|
|
3913
|
-
i.ignoreText || !
|
|
3912
|
+
function S(m) {
|
|
3913
|
+
i.ignoreText || !m.trim() && !i.captureSpacesBetweenElements || (i.trim && (m = m.trim()), i.nativeType && (m = a(m)), i.sanitize && (m = m.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">")), o("text", m));
|
|
3914
3914
|
}
|
|
3915
|
-
function
|
|
3916
|
-
i.ignoreComment || (i.trim && (
|
|
3915
|
+
function I(m) {
|
|
3916
|
+
i.ignoreComment || (i.trim && (m = m.trim()), o("comment", m));
|
|
3917
3917
|
}
|
|
3918
|
-
function F(
|
|
3918
|
+
function F(m) {
|
|
3919
3919
|
var v = s[i.parentKey];
|
|
3920
3920
|
i.addParent || delete s[i.parentKey], s = v;
|
|
3921
3921
|
}
|
|
3922
|
-
function B(
|
|
3923
|
-
i.ignoreCdata || (i.trim && (
|
|
3922
|
+
function B(m) {
|
|
3923
|
+
i.ignoreCdata || (i.trim && (m = m.trim()), o("cdata", m));
|
|
3924
3924
|
}
|
|
3925
|
-
function
|
|
3926
|
-
i.ignoreDoctype || (
|
|
3925
|
+
function N(m) {
|
|
3926
|
+
i.ignoreDoctype || (m = m.replace(/^ /, ""), i.trim && (m = m.trim()), o("doctype", m));
|
|
3927
3927
|
}
|
|
3928
|
-
function P(
|
|
3929
|
-
|
|
3928
|
+
function P(m) {
|
|
3929
|
+
m.note = m;
|
|
3930
3930
|
}
|
|
3931
|
-
return pe = function(
|
|
3932
|
-
var
|
|
3933
|
-
if (s = d, i = c(v),
|
|
3931
|
+
return pe = function(m, v) {
|
|
3932
|
+
var _ = h.parser(!0, {}), d = {};
|
|
3933
|
+
if (s = d, i = c(v), _.opt = { strictEntities: !0 }, _.onopentag = E, _.ontext = S, _.oncomment = I, _.onclosetag = F, _.onerror = P, _.oncdata = B, _.ondoctype = N, _.onprocessinginstruction = A, _.write(m).close(), d[i.elementsKey]) {
|
|
3934
3934
|
var b = d[i.elementsKey];
|
|
3935
3935
|
delete d[i.elementsKey], d[i.elementsKey] = b, delete d.text;
|
|
3936
3936
|
}
|
|
3937
3937
|
return d;
|
|
3938
3938
|
}, pe;
|
|
3939
3939
|
}
|
|
3940
|
-
var me,
|
|
3940
|
+
var me, $e;
|
|
3941
3941
|
function Zi() {
|
|
3942
|
-
if (
|
|
3943
|
-
|
|
3944
|
-
var h =
|
|
3942
|
+
if ($e) return me;
|
|
3943
|
+
$e = 1;
|
|
3944
|
+
var h = Ne(), t = ni();
|
|
3945
3945
|
function e(i) {
|
|
3946
3946
|
var s = h.copyOptions(i);
|
|
3947
3947
|
return h.ensureSpacesExists(s), s;
|
|
3948
3948
|
}
|
|
3949
3949
|
return me = function(i, s) {
|
|
3950
3950
|
var c, a, o, g;
|
|
3951
|
-
return c = e(s), a = t(i, c), g = "compact" in c && c.compact ? "_parent" : "parent", "addParent" in c && c.addParent ? o = JSON.stringify(a, function(
|
|
3952
|
-
return
|
|
3951
|
+
return c = e(s), a = t(i, c), g = "compact" in c && c.compact ? "_parent" : "parent", "addParent" in c && c.addParent ? o = JSON.stringify(a, function(A, E) {
|
|
3952
|
+
return A === g ? "_" : E;
|
|
3953
3953
|
}, c.spaces) : o = JSON.stringify(a, null, c.spaces), o.replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
3954
3954
|
}, me;
|
|
3955
3955
|
}
|
|
3956
|
-
var _e,
|
|
3956
|
+
var _e, We;
|
|
3957
3957
|
function ai() {
|
|
3958
|
-
if (
|
|
3959
|
-
|
|
3960
|
-
var h =
|
|
3961
|
-
function s(
|
|
3962
|
-
var d = h.copyOptions(
|
|
3958
|
+
if (We) return _e;
|
|
3959
|
+
We = 1;
|
|
3960
|
+
var h = Ne(), t = Fe().isArray, e, i;
|
|
3961
|
+
function s(_) {
|
|
3962
|
+
var d = h.copyOptions(_);
|
|
3963
3963
|
return h.ensureFlagExists("ignoreDeclaration", d), h.ensureFlagExists("ignoreInstruction", d), h.ensureFlagExists("ignoreAttributes", d), h.ensureFlagExists("ignoreText", d), h.ensureFlagExists("ignoreComment", d), h.ensureFlagExists("ignoreCdata", d), h.ensureFlagExists("ignoreDoctype", d), h.ensureFlagExists("compact", d), h.ensureFlagExists("indentText", d), h.ensureFlagExists("indentCdata", d), h.ensureFlagExists("indentAttributes", d), h.ensureFlagExists("indentInstruction", d), h.ensureFlagExists("fullTagEmptyElement", d), h.ensureFlagExists("noQuotesForNativeAttributes", d), h.ensureSpacesExists(d), typeof d.spaces == "number" && (d.spaces = Array(d.spaces + 1).join(" ")), h.ensureKeyExists("declaration", d), h.ensureKeyExists("instruction", d), h.ensureKeyExists("attributes", d), h.ensureKeyExists("text", d), h.ensureKeyExists("comment", d), h.ensureKeyExists("cdata", d), h.ensureKeyExists("doctype", d), h.ensureKeyExists("type", d), h.ensureKeyExists("name", d), h.ensureKeyExists("elements", d), h.checkFnExists("doctype", d), h.checkFnExists("instruction", d), h.checkFnExists("cdata", d), h.checkFnExists("comment", d), h.checkFnExists("text", d), h.checkFnExists("instructionName", d), h.checkFnExists("elementName", d), h.checkFnExists("attributeName", d), h.checkFnExists("attributeValue", d), h.checkFnExists("attributes", d), h.checkFnExists("fullTagEmptyElement", d), d;
|
|
3964
3964
|
}
|
|
3965
|
-
function c(
|
|
3966
|
-
return (!b &&
|
|
3967
|
-
` : "") + Array(d + 1).join(
|
|
3965
|
+
function c(_, d, b) {
|
|
3966
|
+
return (!b && _.spaces ? `
|
|
3967
|
+
` : "") + Array(d + 1).join(_.spaces);
|
|
3968
3968
|
}
|
|
3969
|
-
function a(
|
|
3969
|
+
function a(_, d, b) {
|
|
3970
3970
|
if (d.ignoreAttributes)
|
|
3971
3971
|
return "";
|
|
3972
|
-
"attributesFn" in d && (
|
|
3973
|
-
var
|
|
3974
|
-
for (
|
|
3975
|
-
|
|
3976
|
-
return
|
|
3972
|
+
"attributesFn" in d && (_ = d.attributesFn(_, i, e));
|
|
3973
|
+
var D, O, R, y, k = [];
|
|
3974
|
+
for (D in _)
|
|
3975
|
+
_.hasOwnProperty(D) && _[D] !== null && _[D] !== void 0 && (y = d.noQuotesForNativeAttributes && typeof _[D] != "string" ? "" : '"', O = "" + _[D], O = O.replace(/"/g, """), R = "attributeNameFn" in d ? d.attributeNameFn(D, O, i, e) : D, k.push(d.spaces && d.indentAttributes ? c(d, b + 1, !1) : " "), k.push(R + "=" + y + ("attributeValueFn" in d ? d.attributeValueFn(O, D, i, e) : O) + y));
|
|
3976
|
+
return _ && Object.keys(_).length && d.spaces && d.indentAttributes && k.push(c(d, b, !1)), k.join("");
|
|
3977
3977
|
}
|
|
3978
|
-
function o(
|
|
3979
|
-
return e =
|
|
3978
|
+
function o(_, d, b) {
|
|
3979
|
+
return e = _, i = "xml", d.ignoreDeclaration ? "" : "<?xml" + a(_[d.attributesKey], d, b) + "?>";
|
|
3980
3980
|
}
|
|
3981
|
-
function g(
|
|
3981
|
+
function g(_, d, b) {
|
|
3982
3982
|
if (d.ignoreInstruction)
|
|
3983
3983
|
return "";
|
|
3984
|
-
var
|
|
3985
|
-
for (
|
|
3986
|
-
if (
|
|
3984
|
+
var D;
|
|
3985
|
+
for (D in _)
|
|
3986
|
+
if (_.hasOwnProperty(D))
|
|
3987
3987
|
break;
|
|
3988
|
-
var O = "instructionNameFn" in d ? d.instructionNameFn(
|
|
3989
|
-
if (typeof
|
|
3990
|
-
return e =
|
|
3991
|
-
var R =
|
|
3992
|
-
return "instructionFn" in d && (R = d.instructionFn(R,
|
|
3988
|
+
var O = "instructionNameFn" in d ? d.instructionNameFn(D, _[D], i, e) : D;
|
|
3989
|
+
if (typeof _[D] == "object")
|
|
3990
|
+
return e = _, i = O, "<?" + O + a(_[D][d.attributesKey], d, b) + "?>";
|
|
3991
|
+
var R = _[D] ? _[D] : "";
|
|
3992
|
+
return "instructionFn" in d && (R = d.instructionFn(R, D, i, e)), "<?" + O + (R ? " " + R : "") + "?>";
|
|
3993
3993
|
}
|
|
3994
|
-
function
|
|
3995
|
-
return d.ignoreComment ? "" : "<!--" + ("commentFn" in d ? d.commentFn(
|
|
3994
|
+
function A(_, d) {
|
|
3995
|
+
return d.ignoreComment ? "" : "<!--" + ("commentFn" in d ? d.commentFn(_, i, e) : _) + "-->";
|
|
3996
3996
|
}
|
|
3997
|
-
function E(
|
|
3998
|
-
return d.ignoreCdata ? "" : "<![CDATA[" + ("cdataFn" in d ? d.cdataFn(
|
|
3997
|
+
function E(_, d) {
|
|
3998
|
+
return d.ignoreCdata ? "" : "<![CDATA[" + ("cdataFn" in d ? d.cdataFn(_, i, e) : _.replace("]]>", "]]]]><![CDATA[>")) + "]]>";
|
|
3999
3999
|
}
|
|
4000
|
-
function S(
|
|
4001
|
-
return d.ignoreDoctype ? "" : "<!DOCTYPE " + ("doctypeFn" in d ? d.doctypeFn(
|
|
4000
|
+
function S(_, d) {
|
|
4001
|
+
return d.ignoreDoctype ? "" : "<!DOCTYPE " + ("doctypeFn" in d ? d.doctypeFn(_, i, e) : _) + ">";
|
|
4002
4002
|
}
|
|
4003
|
-
function
|
|
4004
|
-
return d.ignoreText ? "" : (
|
|
4003
|
+
function I(_, d) {
|
|
4004
|
+
return d.ignoreText ? "" : (_ = "" + _, _ = _.replace(/&/g, "&"), _ = _.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), "textFn" in d ? d.textFn(_, i, e) : _);
|
|
4005
4005
|
}
|
|
4006
|
-
function F(
|
|
4006
|
+
function F(_, d) {
|
|
4007
4007
|
var b;
|
|
4008
|
-
if (
|
|
4009
|
-
for (b = 0; b <
|
|
4010
|
-
switch (
|
|
4008
|
+
if (_.elements && _.elements.length)
|
|
4009
|
+
for (b = 0; b < _.elements.length; ++b)
|
|
4010
|
+
switch (_.elements[b][d.typeKey]) {
|
|
4011
4011
|
case "text":
|
|
4012
4012
|
if (d.indentText)
|
|
4013
4013
|
return !0;
|
|
@@ -4032,39 +4032,39 @@ function ai() {
|
|
|
4032
4032
|
}
|
|
4033
4033
|
return !1;
|
|
4034
4034
|
}
|
|
4035
|
-
function B(
|
|
4036
|
-
e =
|
|
4037
|
-
var
|
|
4038
|
-
|
|
4039
|
-
var R =
|
|
4040
|
-
return R || ("fullTagEmptyElementFn" in d ? R = d.fullTagEmptyElementFn(
|
|
4041
|
-
` + Array(b + 1).join(d.spaces) : ""),
|
|
4042
|
-
}
|
|
4043
|
-
function
|
|
4044
|
-
return
|
|
4045
|
-
var y = c(d, b,
|
|
4035
|
+
function B(_, d, b) {
|
|
4036
|
+
e = _, i = _.name;
|
|
4037
|
+
var D = [], O = "elementNameFn" in d ? d.elementNameFn(_.name, _) : _.name;
|
|
4038
|
+
D.push("<" + O), _[d.attributesKey] && D.push(a(_[d.attributesKey], d, b));
|
|
4039
|
+
var R = _[d.elementsKey] && _[d.elementsKey].length || _[d.attributesKey] && _[d.attributesKey]["xml:space"] === "preserve";
|
|
4040
|
+
return R || ("fullTagEmptyElementFn" in d ? R = d.fullTagEmptyElementFn(_.name, _) : R = d.fullTagEmptyElement), R ? (D.push(">"), _[d.elementsKey] && _[d.elementsKey].length && (D.push(N(_[d.elementsKey], d, b + 1)), e = _, i = _.name), D.push(d.spaces && F(_, d) ? `
|
|
4041
|
+
` + Array(b + 1).join(d.spaces) : ""), D.push("</" + O + ">")) : D.push("/>"), D.join("");
|
|
4042
|
+
}
|
|
4043
|
+
function N(_, d, b, D) {
|
|
4044
|
+
return _.reduce(function(O, R) {
|
|
4045
|
+
var y = c(d, b, D && !O);
|
|
4046
4046
|
switch (R.type) {
|
|
4047
4047
|
case "element":
|
|
4048
4048
|
return O + y + B(R, d, b);
|
|
4049
4049
|
case "comment":
|
|
4050
|
-
return O + y +
|
|
4050
|
+
return O + y + A(R[d.commentKey], d);
|
|
4051
4051
|
case "doctype":
|
|
4052
4052
|
return O + y + S(R[d.doctypeKey], d);
|
|
4053
4053
|
case "cdata":
|
|
4054
4054
|
return O + (d.indentCdata ? y : "") + E(R[d.cdataKey], d);
|
|
4055
4055
|
case "text":
|
|
4056
|
-
return O + (d.indentText ? y : "") +
|
|
4056
|
+
return O + (d.indentText ? y : "") + I(R[d.textKey], d);
|
|
4057
4057
|
case "instruction":
|
|
4058
|
-
var
|
|
4059
|
-
return
|
|
4058
|
+
var k = {};
|
|
4059
|
+
return k[R[d.nameKey]] = R[d.attributesKey] ? R : R[d.instructionKey], O + (d.indentInstruction ? y : "") + g(k, d, b);
|
|
4060
4060
|
}
|
|
4061
4061
|
}, "");
|
|
4062
4062
|
}
|
|
4063
|
-
function P(
|
|
4064
|
-
var
|
|
4065
|
-
for (
|
|
4066
|
-
if (
|
|
4067
|
-
switch (
|
|
4063
|
+
function P(_, d, b) {
|
|
4064
|
+
var D;
|
|
4065
|
+
for (D in _)
|
|
4066
|
+
if (_.hasOwnProperty(D))
|
|
4067
|
+
switch (D) {
|
|
4068
4068
|
case d.parentKey:
|
|
4069
4069
|
case d.attributesKey:
|
|
4070
4070
|
break;
|
|
@@ -4092,63 +4092,63 @@ function ai() {
|
|
|
4092
4092
|
}
|
|
4093
4093
|
return !1;
|
|
4094
4094
|
}
|
|
4095
|
-
function _
|
|
4096
|
-
e =
|
|
4097
|
-
var R = "elementNameFn" in b ? b.elementNameFn(d,
|
|
4098
|
-
if (typeof
|
|
4099
|
-
return "fullTagEmptyElementFn" in b && b.fullTagEmptyElementFn(d,
|
|
4095
|
+
function m(_, d, b, D, O) {
|
|
4096
|
+
e = _, i = d;
|
|
4097
|
+
var R = "elementNameFn" in b ? b.elementNameFn(d, _) : d;
|
|
4098
|
+
if (typeof _ > "u" || _ === null || _ === "")
|
|
4099
|
+
return "fullTagEmptyElementFn" in b && b.fullTagEmptyElementFn(d, _) || b.fullTagEmptyElement ? "<" + R + "></" + R + ">" : "<" + R + "/>";
|
|
4100
4100
|
var y = [];
|
|
4101
4101
|
if (d) {
|
|
4102
|
-
if (y.push("<" + R), typeof
|
|
4103
|
-
return y.push(">" +
|
|
4104
|
-
|
|
4105
|
-
var
|
|
4106
|
-
if (
|
|
4102
|
+
if (y.push("<" + R), typeof _ != "object")
|
|
4103
|
+
return y.push(">" + I(_, b) + "</" + R + ">"), y.join("");
|
|
4104
|
+
_[b.attributesKey] && y.push(a(_[b.attributesKey], b, D));
|
|
4105
|
+
var k = P(_, b, !0) || _[b.attributesKey] && _[b.attributesKey]["xml:space"] === "preserve";
|
|
4106
|
+
if (k || ("fullTagEmptyElementFn" in b ? k = b.fullTagEmptyElementFn(d, _) : k = b.fullTagEmptyElement), k)
|
|
4107
4107
|
y.push(">");
|
|
4108
4108
|
else
|
|
4109
4109
|
return y.push("/>"), y.join("");
|
|
4110
4110
|
}
|
|
4111
|
-
return y.push(v(
|
|
4111
|
+
return y.push(v(_, b, D + 1, !1)), e = _, i = d, d && y.push((O ? c(b, D, !1) : "") + "</" + R + ">"), y.join("");
|
|
4112
4112
|
}
|
|
4113
|
-
function v(
|
|
4114
|
-
var O, R, y,
|
|
4115
|
-
for (R in
|
|
4116
|
-
if (
|
|
4117
|
-
for (y = t(
|
|
4113
|
+
function v(_, d, b, D) {
|
|
4114
|
+
var O, R, y, k = [];
|
|
4115
|
+
for (R in _)
|
|
4116
|
+
if (_.hasOwnProperty(R))
|
|
4117
|
+
for (y = t(_[R]) ? _[R] : [_[R]], O = 0; O < y.length; ++O) {
|
|
4118
4118
|
switch (R) {
|
|
4119
4119
|
case d.declarationKey:
|
|
4120
|
-
|
|
4120
|
+
k.push(o(y[O], d, b));
|
|
4121
4121
|
break;
|
|
4122
4122
|
case d.instructionKey:
|
|
4123
|
-
|
|
4123
|
+
k.push((d.indentInstruction ? c(d, b, D) : "") + g(y[O], d, b));
|
|
4124
4124
|
break;
|
|
4125
4125
|
case d.attributesKey:
|
|
4126
4126
|
case d.parentKey:
|
|
4127
4127
|
break;
|
|
4128
4128
|
// skip
|
|
4129
4129
|
case d.textKey:
|
|
4130
|
-
|
|
4130
|
+
k.push((d.indentText ? c(d, b, D) : "") + I(y[O], d));
|
|
4131
4131
|
break;
|
|
4132
4132
|
case d.cdataKey:
|
|
4133
|
-
|
|
4133
|
+
k.push((d.indentCdata ? c(d, b, D) : "") + E(y[O], d));
|
|
4134
4134
|
break;
|
|
4135
4135
|
case d.doctypeKey:
|
|
4136
|
-
|
|
4136
|
+
k.push(c(d, b, D) + S(y[O], d));
|
|
4137
4137
|
break;
|
|
4138
4138
|
case d.commentKey:
|
|
4139
|
-
|
|
4139
|
+
k.push(c(d, b, D) + A(y[O], d));
|
|
4140
4140
|
break;
|
|
4141
4141
|
default:
|
|
4142
|
-
|
|
4142
|
+
k.push(c(d, b, D) + m(y[O], R, d, b, P(y[O], d)));
|
|
4143
4143
|
}
|
|
4144
|
-
|
|
4144
|
+
D = D && !k.length;
|
|
4145
4145
|
}
|
|
4146
|
-
return
|
|
4146
|
+
return k.join("");
|
|
4147
4147
|
}
|
|
4148
|
-
return _e = function(
|
|
4148
|
+
return _e = function(_, d) {
|
|
4149
4149
|
d = s(d);
|
|
4150
4150
|
var b = [];
|
|
4151
|
-
return e =
|
|
4151
|
+
return e = _, i = "_root_", d.compact ? b.push(v(_, d, 0, !0)) : (_[d.declarationKey] && b.push(o(_[d.declarationKey], d, 0)), _[d.elementsKey] && _[d.elementsKey].length && b.push(N(_[d.elementsKey], d, 0, !b.length))), b.join("");
|
|
4152
4152
|
}, _e;
|
|
4153
4153
|
}
|
|
4154
4154
|
var ge, He;
|
|
@@ -4239,39 +4239,39 @@ const dt = class dt {
|
|
|
4239
4239
|
])
|
|
4240
4240
|
};
|
|
4241
4241
|
if (a.properties) {
|
|
4242
|
-
const g = dt.toArray(a.properties.property),
|
|
4242
|
+
const g = dt.toArray(a.properties.property), A = {};
|
|
4243
4243
|
for (let E of g) {
|
|
4244
4244
|
const S = E._attributes;
|
|
4245
4245
|
if (!S) continue;
|
|
4246
|
-
let
|
|
4246
|
+
let I;
|
|
4247
4247
|
switch (S.type) {
|
|
4248
4248
|
case "file":
|
|
4249
|
-
|
|
4249
|
+
I = this.getImagePath(S.value);
|
|
4250
4250
|
break;
|
|
4251
4251
|
case "object":
|
|
4252
4252
|
case "float":
|
|
4253
4253
|
case "int":
|
|
4254
|
-
|
|
4254
|
+
I = +S.value;
|
|
4255
4255
|
break;
|
|
4256
4256
|
case "bool":
|
|
4257
|
-
|
|
4257
|
+
I = S.value == "true";
|
|
4258
4258
|
break;
|
|
4259
4259
|
case "class":
|
|
4260
|
-
|
|
4260
|
+
I = {
|
|
4261
4261
|
...this.transform(E)?.properties ?? {},
|
|
4262
4262
|
_classname: S.propertytype
|
|
4263
4263
|
};
|
|
4264
4264
|
break;
|
|
4265
4265
|
default:
|
|
4266
|
-
|
|
4266
|
+
I = S.value;
|
|
4267
4267
|
}
|
|
4268
|
-
|
|
4268
|
+
A[S.name] = I;
|
|
4269
4269
|
}
|
|
4270
|
-
a.properties =
|
|
4270
|
+
a.properties = A;
|
|
4271
4271
|
}
|
|
4272
4272
|
a.polygon && (a.polygon = this.transform(a.polygon)), a.polyline && (a.polyline = this.transform(a.polyline)), a.points && (a = a.points.split(" ").map((g) => {
|
|
4273
|
-
const
|
|
4274
|
-
return { x: +
|
|
4273
|
+
const A = g.split(",");
|
|
4274
|
+
return { x: +A[0], y: +A[1] };
|
|
4275
4275
|
})), a.point && (a.point = !0), a.ellipse && (a.ellipse = !0), a.text && (a.text = {
|
|
4276
4276
|
text: a.text._text,
|
|
4277
4277
|
...this.transform(a.text)
|
|
@@ -4310,23 +4310,23 @@ const dt = class dt {
|
|
|
4310
4310
|
parseMap() {
|
|
4311
4311
|
const t = xe.xml2js(this.xml, { compact: !0 }), e = xe.xml2js(this.xml), i = t.map.tileset;
|
|
4312
4312
|
t.map.group;
|
|
4313
|
-
const s = (
|
|
4314
|
-
const { objectgroup: E, group: S, layer:
|
|
4315
|
-
|
|
4313
|
+
const s = (A) => {
|
|
4314
|
+
const { objectgroup: E, group: S, layer: I, imagelayer: F } = A, B = (N) => {
|
|
4315
|
+
N && dt.toArray(N).forEach((P) => {
|
|
4316
4316
|
if (this.layers.has(+P._attributes.id))
|
|
4317
4317
|
throw new Error(`Tiled Parser Error: Layer with id ${P._attributes.id} already exists`);
|
|
4318
4318
|
this.layers.set(+P._attributes.id, P);
|
|
4319
4319
|
});
|
|
4320
4320
|
};
|
|
4321
|
-
B(E), B(
|
|
4321
|
+
B(E), B(I), B(S), B(F), S && s(S);
|
|
4322
4322
|
};
|
|
4323
4323
|
s(t.map);
|
|
4324
|
-
const c = (
|
|
4325
|
-
if (!
|
|
4326
|
-
for (let S of
|
|
4327
|
-
const { name:
|
|
4328
|
-
if (!["layer", "group", "imagelayer", "objectgroup"].includes(
|
|
4329
|
-
const F = S.elements?.find((
|
|
4324
|
+
const c = (A, E = []) => {
|
|
4325
|
+
if (!A) return E;
|
|
4326
|
+
for (let S of A) {
|
|
4327
|
+
const { name: I } = S;
|
|
4328
|
+
if (!["layer", "group", "imagelayer", "objectgroup"].includes(I)) continue;
|
|
4329
|
+
const F = S.elements?.find((N) => N.name == "data");
|
|
4330
4330
|
S.layer = this.layers.get(+S.attributes.id);
|
|
4331
4331
|
const B = {
|
|
4332
4332
|
...this.transform(F) ?? {},
|
|
@@ -4334,12 +4334,12 @@ const dt = class dt {
|
|
|
4334
4334
|
...this.transform(S.layer),
|
|
4335
4335
|
layers: c(S.elements),
|
|
4336
4336
|
data: F ? F.elements[0].text : void 0,
|
|
4337
|
-
type:
|
|
4337
|
+
type: I == "layer" ? "tilelayer" : I
|
|
4338
4338
|
};
|
|
4339
4339
|
delete B.elements, delete B.layer, B.data && (B.data = dt.decode(B, B.width * B.height)), E.push(B);
|
|
4340
4340
|
}
|
|
4341
4341
|
return E;
|
|
4342
|
-
}, a = c(e.elements[0].elements), o = dt.toArray(i).map((
|
|
4342
|
+
}, a = c(e.elements[0].elements), o = dt.toArray(i).map((A) => this.transform(A)), g = {
|
|
4343
4343
|
...this.transform(t.map),
|
|
4344
4344
|
layers: a,
|
|
4345
4345
|
tilesets: o
|
|
@@ -4368,7 +4368,7 @@ dt.propToNumber = (t, e) => {
|
|
|
4368
4368
|
return t;
|
|
4369
4369
|
};
|
|
4370
4370
|
let ve = dt;
|
|
4371
|
-
class
|
|
4371
|
+
class De {
|
|
4372
4372
|
constructor(t) {
|
|
4373
4373
|
this.properties = {}, this.properties = t?.properties ?? {};
|
|
4374
4374
|
}
|
|
@@ -4387,7 +4387,7 @@ class Ne {
|
|
|
4387
4387
|
}
|
|
4388
4388
|
}
|
|
4389
4389
|
const rr = 2147483648, sr = 1073741824, nr = 536870912, ar = 268435456;
|
|
4390
|
-
class Wt extends
|
|
4390
|
+
class Wt extends De {
|
|
4391
4391
|
constructor(t) {
|
|
4392
4392
|
super(t), this.obj = t, this._gid = t?.gid;
|
|
4393
4393
|
}
|
|
@@ -4425,7 +4425,7 @@ class or extends Wt {
|
|
|
4425
4425
|
super(t), this.layerName = "", Object.assign(this, t), t?.gid && (this.y -= this.height);
|
|
4426
4426
|
}
|
|
4427
4427
|
}
|
|
4428
|
-
class Pe extends
|
|
4428
|
+
class Pe extends De {
|
|
4429
4429
|
constructor(t, e, i) {
|
|
4430
4430
|
super(t), this.tilesets = e, this.parent = i, this.cacheTiles = !1, this.tiles = [], Object.assign(this, t), this.mapObjects(), this.mergePropertiesWithParent(), this.cacheTiles = this.getProperty("cache-tiles", !1), this.cacheTiles && this.propertiesTiles();
|
|
4431
4431
|
}
|
|
@@ -4504,7 +4504,7 @@ class Pe extends Ne {
|
|
|
4504
4504
|
this.data[t] = e;
|
|
4505
4505
|
}
|
|
4506
4506
|
}
|
|
4507
|
-
class lr extends
|
|
4507
|
+
class lr extends De {
|
|
4508
4508
|
constructor(t) {
|
|
4509
4509
|
super(t), this.tileset = t, this.cacheTileId = /* @__PURE__ */ new Map(), Object.assign(this, t), this.margin = this.margin ?? 0, this.spacing = this.spacing ?? 0;
|
|
4510
4510
|
const e = t.tiles || t.tile || [];
|
|
@@ -4520,7 +4520,7 @@ class lr extends Ne {
|
|
|
4520
4520
|
return this.cacheTileId.get(+t);
|
|
4521
4521
|
}
|
|
4522
4522
|
}
|
|
4523
|
-
class
|
|
4523
|
+
class At {
|
|
4524
4524
|
constructor(t, {
|
|
4525
4525
|
basePath: e = "",
|
|
4526
4526
|
staticDir: i = "",
|
|
@@ -4544,29 +4544,29 @@ class It {
|
|
|
4544
4544
|
};
|
|
4545
4545
|
}
|
|
4546
4546
|
_parseFile(t, e, i) {
|
|
4547
|
-
const s = (o) =>
|
|
4547
|
+
const s = (o) => At.typeOfFile(o).isXml, c = (o) => {
|
|
4548
4548
|
if (!o)
|
|
4549
4549
|
return i(null);
|
|
4550
4550
|
if (s(o)) {
|
|
4551
4551
|
const g = new ve(o, t, this.basePath);
|
|
4552
4552
|
if (e == "map") {
|
|
4553
|
-
const
|
|
4554
|
-
return i(
|
|
4553
|
+
const A = g.parseMap();
|
|
4554
|
+
return i(A);
|
|
4555
4555
|
} else if (e == "tileset") {
|
|
4556
|
-
const
|
|
4557
|
-
return i(
|
|
4556
|
+
const A = g.parseTileset();
|
|
4557
|
+
return i(A);
|
|
4558
4558
|
}
|
|
4559
4559
|
}
|
|
4560
4560
|
return i(JSON.parse(o));
|
|
4561
4561
|
};
|
|
4562
|
-
if (
|
|
4562
|
+
if (At.typeOfFile(t).isObject)
|
|
4563
4563
|
return i(t);
|
|
4564
|
-
const { isHttp: a } =
|
|
4564
|
+
const { isHttp: a } = At.typeOfFile(t);
|
|
4565
4565
|
if (s(t))
|
|
4566
4566
|
c(t);
|
|
4567
|
-
else if (a ||
|
|
4567
|
+
else if (a || At.isBrowser()) {
|
|
4568
4568
|
let o = a ? t : ri(this.basePath, t);
|
|
4569
|
-
|
|
4569
|
+
At.isBrowser() && window.urlCache && (o = window.urlCache[t]), fetch(o, {
|
|
4570
4570
|
headers: {
|
|
4571
4571
|
"Content-Type": "application/xml"
|
|
4572
4572
|
}
|
|
@@ -4575,27 +4575,27 @@ class It {
|
|
|
4575
4575
|
}
|
|
4576
4576
|
parseFile(t, e = {}) {
|
|
4577
4577
|
const { getOnlyBasename: i } = e, s = (c) => c.substring(c.lastIndexOf("/") + 1);
|
|
4578
|
-
i &&
|
|
4578
|
+
i && At.typeOfFile(this.file).isPath && (this.file = s(this.file)), this._parseFile(this.file, "map", (c, a) => {
|
|
4579
4579
|
let o = !1;
|
|
4580
4580
|
if (a) return t(null, a);
|
|
4581
4581
|
if (c.tilesets) {
|
|
4582
|
-
const g = [],
|
|
4582
|
+
const g = [], A = () => {
|
|
4583
4583
|
E++, E == c.tilesets.length && !o && (c.tilesets = g, t(c));
|
|
4584
4584
|
};
|
|
4585
4585
|
let E = 0;
|
|
4586
4586
|
for (let S = 0; S < c.tilesets.length; S++) {
|
|
4587
|
-
const
|
|
4588
|
-
if (!
|
|
4589
|
-
g[S] =
|
|
4587
|
+
const I = c.tilesets[S];
|
|
4588
|
+
if (!I.source || I.tiles || I.image || I.tile) {
|
|
4589
|
+
g[S] = I, A();
|
|
4590
4590
|
continue;
|
|
4591
4591
|
}
|
|
4592
|
-
i &&
|
|
4592
|
+
i && At.typeOfFile(I.source).isPath && (I.source = s(I.source)), this._parseFile(I.source, "tileset", (F, B) => {
|
|
4593
4593
|
if (B)
|
|
4594
4594
|
return o = !0, t(null, B);
|
|
4595
4595
|
g[S] = {
|
|
4596
4596
|
...F,
|
|
4597
|
-
firstgid:
|
|
4598
|
-
},
|
|
4597
|
+
firstgid: I.firstgid
|
|
4598
|
+
}, A();
|
|
4599
4599
|
});
|
|
4600
4600
|
}
|
|
4601
4601
|
}
|
|
@@ -4616,14 +4616,14 @@ const Ft = {
|
|
|
4616
4616
|
use32bitIndex: !1
|
|
4617
4617
|
};
|
|
4618
4618
|
var cr = Object.defineProperty, ur = (h, t, e) => t in h ? cr(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e, Bt = (h, t, e) => (ur(h, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4619
|
-
const zt = class
|
|
4619
|
+
const zt = class Kt extends ti {
|
|
4620
4620
|
constructor(t) {
|
|
4621
4621
|
const e = new Se({
|
|
4622
4622
|
data: new Float32Array(2),
|
|
4623
4623
|
label: "tilemap-buffer",
|
|
4624
|
-
usage:
|
|
4624
|
+
usage: Lt.VERTEX | Lt.COPY_DST,
|
|
4625
4625
|
shrinkToFit: !1
|
|
4626
|
-
}), i =
|
|
4626
|
+
}), i = Kt.stride;
|
|
4627
4627
|
super({
|
|
4628
4628
|
indexBuffer: t,
|
|
4629
4629
|
attributes: {
|
|
@@ -4677,7 +4677,7 @@ const zt = class qt extends ti {
|
|
|
4677
4677
|
// location: 0
|
|
4678
4678
|
}
|
|
4679
4679
|
}
|
|
4680
|
-
}), Bt(this, "lastTimeAccess", 0), Bt(this, "vertSize",
|
|
4680
|
+
}), Bt(this, "lastTimeAccess", 0), Bt(this, "vertSize", Kt.vertSize), Bt(this, "vertPerQuad", Kt.vertPerQuad), Bt(this, "stride", Kt.stride), Bt(this, "buf"), this.buf = e;
|
|
4681
4681
|
}
|
|
4682
4682
|
};
|
|
4683
4683
|
Bt(zt, "vertSize", 13);
|
|
@@ -4687,8 +4687,8 @@ let hr = zt;
|
|
|
4687
4687
|
var fr = Object.defineProperty, dr = (h, t, e) => t in h ? fr(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e, Mt = (h, t, e) => (dr(h, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4688
4688
|
class oi {
|
|
4689
4689
|
constructor() {
|
|
4690
|
-
Mt(this, "pipe_uniforms", new
|
|
4691
|
-
u_proj_trans: { value: new
|
|
4690
|
+
Mt(this, "pipe_uniforms", new ie({
|
|
4691
|
+
u_proj_trans: { value: new Ai(), type: "mat3x3<f32>" },
|
|
4692
4692
|
u_anim_frame: { value: new Float32Array(2), type: "vec2<f32>" }
|
|
4693
4693
|
}));
|
|
4694
4694
|
}
|
|
@@ -4698,8 +4698,8 @@ class li {
|
|
|
4698
4698
|
Mt(this, "renderer"), Mt(this, "tileAnim", [0, 0]), Mt(this, "ibLen", 0), Mt(this, "indexBuffer", null), Mt(this, "shader"), Mt(this, "adaptor"), this.renderer = t, this.adaptor = e, this.adaptor.init(), this.indexBuffer = new Se({
|
|
4699
4699
|
data: new Uint16Array([0, 1, 2, 0, 2, 3]),
|
|
4700
4700
|
label: "index-tilemap-buffer",
|
|
4701
|
-
usage:
|
|
4702
|
-
}), this.indexBuffer.destroy =
|
|
4701
|
+
usage: Lt.INDEX | Lt.COPY_DST
|
|
4702
|
+
}), this.indexBuffer.destroy = Ti, this.checkIndexBuffer(2e3);
|
|
4703
4703
|
}
|
|
4704
4704
|
start() {
|
|
4705
4705
|
}
|
|
@@ -4751,8 +4751,8 @@ class li {
|
|
|
4751
4751
|
}
|
|
4752
4752
|
Mt(li, "extension", {
|
|
4753
4753
|
type: [
|
|
4754
|
-
|
|
4755
|
-
|
|
4754
|
+
te.WebGLPipes,
|
|
4755
|
+
te.WebGPUPipes
|
|
4756
4756
|
],
|
|
4757
4757
|
name: "tilemap"
|
|
4758
4758
|
});
|
|
@@ -4764,11 +4764,11 @@ function pr(h, t) {
|
|
|
4764
4764
|
t[i + 0] = s + 0, t[i + 1] = s + 1, t[i + 2] = s + 2, t[i + 3] = s + 0, t[i + 4] = s + 2, t[i + 5] = s + 3;
|
|
4765
4765
|
return t;
|
|
4766
4766
|
}
|
|
4767
|
-
var mr = Object.defineProperty, _r = (h, t, e) => t in h ? mr(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e,
|
|
4767
|
+
var mr = Object.defineProperty, _r = (h, t, e) => t in h ? mr(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e, vt = (h, t, e) => (_r(h, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4768
4768
|
class Pt {
|
|
4769
4769
|
constructor(t) {
|
|
4770
|
-
|
|
4771
|
-
usage:
|
|
4770
|
+
vt(this, "max_textures"), vt(this, "arr", []), vt(this, "count", 0), vt(this, "dirty", !1), vt(this, "dirty_gpu", !1), vt(this, "bind_group", null), vt(this, "bind_group_resources", {}), vt(this, "tex_sizes", null), vt(this, "null_color", new Float32Array([0, 0, 0, 0.5])), vt(this, "tex_buf", null), this.max_textures = t, this.tex_sizes = new Float32Array(this.max_textures * 4 + 4), this.tex_buf = new Se({
|
|
4771
|
+
usage: Lt.UNIFORM | Lt.COPY_DST
|
|
4772
4772
|
});
|
|
4773
4773
|
}
|
|
4774
4774
|
get length() {
|
|
@@ -4799,7 +4799,7 @@ class Pt {
|
|
|
4799
4799
|
return this.bind_group;
|
|
4800
4800
|
const { bind_group_resources: t, max_textures: e, arr: i, count: s } = this;
|
|
4801
4801
|
let c = 0;
|
|
4802
|
-
t[c++] = new
|
|
4802
|
+
t[c++] = new ie({
|
|
4803
4803
|
u_texture_size: {
|
|
4804
4804
|
value: this.tex_sizes,
|
|
4805
4805
|
type: "vec4<f32>",
|
|
@@ -4811,7 +4811,7 @@ class Pt {
|
|
|
4811
4811
|
}
|
|
4812
4812
|
});
|
|
4813
4813
|
for (let a = 0; a < e; a++) {
|
|
4814
|
-
const o = (a < s ? i[a] : null) ||
|
|
4814
|
+
const o = (a < s ? i[a] : null) || re.EMPTY.source;
|
|
4815
4815
|
t[c++] = o.source, t[c++] = o.style;
|
|
4816
4816
|
}
|
|
4817
4817
|
return this.bind_group || (this.bind_group = new ei(t)), this.bind_group;
|
|
@@ -4856,7 +4856,7 @@ class Pt {
|
|
|
4856
4856
|
};
|
|
4857
4857
|
}
|
|
4858
4858
|
}
|
|
4859
|
-
var gr = Object.defineProperty, yr = (h, t, e) => t in h ? gr(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e,
|
|
4859
|
+
var gr = Object.defineProperty, yr = (h, t, e) => t in h ? gr(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e, Te = (h, t, e) => (yr(h, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4860
4860
|
const xr = `
|
|
4861
4861
|
in vec2 aVertexPosition;
|
|
4862
4862
|
in vec2 aTextureCoord;
|
|
@@ -4911,7 +4911,7 @@ void main(void)
|
|
|
4911
4911
|
`;
|
|
4912
4912
|
class ci extends oi {
|
|
4913
4913
|
constructor() {
|
|
4914
|
-
super(...arguments),
|
|
4914
|
+
super(...arguments), Te(this, "_shader", null), Te(this, "max_textures", Ft.TEXTURES_PER_TILEMAP);
|
|
4915
4915
|
}
|
|
4916
4916
|
destroy() {
|
|
4917
4917
|
this._shader.destroy(!0), this._shader = null;
|
|
@@ -4930,7 +4930,7 @@ class ci extends oi {
|
|
|
4930
4930
|
}
|
|
4931
4931
|
init() {
|
|
4932
4932
|
this._shader = new Ce({
|
|
4933
|
-
glProgram:
|
|
4933
|
+
glProgram: $t.from({
|
|
4934
4934
|
vertex: xr,
|
|
4935
4935
|
fragment: Er.replace(
|
|
4936
4936
|
"//include_textures",
|
|
@@ -4938,19 +4938,19 @@ class ci extends oi {
|
|
|
4938
4938
|
)
|
|
4939
4939
|
}),
|
|
4940
4940
|
resources: {
|
|
4941
|
-
texture_uniforms: new
|
|
4941
|
+
texture_uniforms: new ie(Pt.gl_gen_resources(this.max_textures), { isStatic: !0 }),
|
|
4942
4942
|
pipe_uniforms: this.pipe_uniforms.uniformStructures
|
|
4943
4943
|
}
|
|
4944
4944
|
});
|
|
4945
4945
|
}
|
|
4946
4946
|
}
|
|
4947
|
-
|
|
4947
|
+
Te(ci, "extension", {
|
|
4948
4948
|
type: [
|
|
4949
|
-
|
|
4949
|
+
te.WebGLPipesAdaptor
|
|
4950
4950
|
],
|
|
4951
4951
|
name: "tilemap"
|
|
4952
4952
|
});
|
|
4953
|
-
var wr = Object.defineProperty, vr = (h, t, e) => t in h ? wr(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e,
|
|
4953
|
+
var wr = Object.defineProperty, vr = (h, t, e) => t in h ? wr(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e, Zt = (h, t, e) => (vr(h, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4954
4954
|
const br = `
|
|
4955
4955
|
struct GlobalUniforms {
|
|
4956
4956
|
uProjectionMatrix:mat3x3f,
|
|
@@ -4997,7 +4997,7 @@ fn mainVert(
|
|
|
4997
4997
|
|
|
4998
4998
|
return VSOutput(vPosition, aTextureId, vTextureCoord, vFrame, aAlpha);
|
|
4999
4999
|
};
|
|
5000
|
-
`,
|
|
5000
|
+
`, Tr = `
|
|
5001
5001
|
//include_textures
|
|
5002
5002
|
|
|
5003
5003
|
@fragment
|
|
@@ -5017,7 +5017,7 @@ fn mainFrag(
|
|
|
5017
5017
|
`;
|
|
5018
5018
|
class ui extends oi {
|
|
5019
5019
|
constructor() {
|
|
5020
|
-
super(...arguments),
|
|
5020
|
+
super(...arguments), Zt(this, "_shader", null), Zt(this, "max_textures", Ft.TEXTURES_PER_TILEMAP), Zt(this, "bind_group", null);
|
|
5021
5021
|
}
|
|
5022
5022
|
destroy() {
|
|
5023
5023
|
this._shader.destroy(!0), this._shader = null;
|
|
@@ -5033,10 +5033,10 @@ class ui extends oi {
|
|
|
5033
5033
|
}
|
|
5034
5034
|
init() {
|
|
5035
5035
|
this._shader = new Ce({
|
|
5036
|
-
gpuProgram:
|
|
5036
|
+
gpuProgram: Ii.from({
|
|
5037
5037
|
vertex: { source: br, entryPoint: "mainVert" },
|
|
5038
5038
|
fragment: {
|
|
5039
|
-
source:
|
|
5039
|
+
source: Tr.replace("//include_textures", Pt.generate_gpu_textures(this.max_textures))
|
|
5040
5040
|
}
|
|
5041
5041
|
})
|
|
5042
5042
|
}), this.bind_group = new ei({
|
|
@@ -5044,24 +5044,24 @@ class ui extends oi {
|
|
|
5044
5044
|
});
|
|
5045
5045
|
}
|
|
5046
5046
|
}
|
|
5047
|
-
|
|
5047
|
+
Zt(ui, "extension", {
|
|
5048
5048
|
type: [
|
|
5049
|
-
|
|
5049
|
+
te.WebGPUPipesAdaptor
|
|
5050
5050
|
],
|
|
5051
5051
|
name: "tilemap"
|
|
5052
5052
|
});
|
|
5053
|
-
var
|
|
5054
|
-
const
|
|
5053
|
+
var Ar = Object.defineProperty, Ir = (h, t, e) => t in h ? Ar(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e, st = (h, t, e) => (Ir(h, typeof t != "symbol" ? t + "" : t, e), e), hi = /* @__PURE__ */ ((h) => (h[h.U = 0] = "U", h[h.V = 1] = "V", h[h.X = 2] = "X", h[h.Y = 3] = "Y", h[h.TILE_WIDTH = 4] = "TILE_WIDTH", h[h.TILE_HEIGHT = 5] = "TILE_HEIGHT", h[h.ROTATE = 6] = "ROTATE", h[h.ANIM_X = 7] = "ANIM_X", h[h.ANIM_Y = 8] = "ANIM_Y", h[h.TEXTURE_INDEX = 9] = "TEXTURE_INDEX", h[h.ANIM_COUNT_X = 10] = "ANIM_COUNT_X", h[h.ANIM_COUNT_Y = 11] = "ANIM_COUNT_Y", h[h.ANIM_DIVISOR = 12] = "ANIM_DIVISOR", h[h.ALPHA = 13] = "ALPHA", h))(hi || {});
|
|
5054
|
+
const Et = Object.keys(hi).length / 2;
|
|
5055
5055
|
class Je extends Si {
|
|
5056
5056
|
/**
|
|
5057
5057
|
* @param tileset - The tileset to use for the tilemap. This can be reset later with {@link Tilemap.setTileset}. The
|
|
5058
5058
|
* base-textures in this array must not be duplicated.
|
|
5059
5059
|
*/
|
|
5060
5060
|
constructor(t) {
|
|
5061
|
-
super({}),
|
|
5061
|
+
super({}), st(this, "shadowColor", new Float32Array([0, 0, 0, 0.5])), st(this, "state", Ci.for2d()), st(this, "is_valid", !1), st(this, "renderPipeId", "tilemap"), st(this, "canBundle", !0), st(this, "_instruction", {
|
|
5062
5062
|
renderPipeId: "tilemap",
|
|
5063
5063
|
tilemap: this
|
|
5064
|
-
}),
|
|
5064
|
+
}), st(this, "tileAnim", null), st(this, "rects_count", 0), st(this, "compositeParent", !1), st(this, "tileset", new Pt(Ft.TEXTURES_PER_TILEMAP)), st(this, "tilemapBounds", new Mi()), st(this, "hasAnimatedTile", !1), st(this, "pointsBuf", []), st(this, "batched"), st(this, "vbId", 0), st(this, "vb", null), st(this, "vbBuffer", null), st(this, "vbArray", null), st(this, "vbInts", null), this.setTileset(t);
|
|
5065
5065
|
}
|
|
5066
5066
|
/**
|
|
5067
5067
|
* @internal
|
|
@@ -5148,11 +5148,11 @@ class Je extends Si {
|
|
|
5148
5148
|
a = t, o = !0, c = this.tileset.arr[a];
|
|
5149
5149
|
else {
|
|
5150
5150
|
let d;
|
|
5151
|
-
typeof t == "string" ? d =
|
|
5151
|
+
typeof t == "string" ? d = re.from(t) : d = t;
|
|
5152
5152
|
const b = this.tileset;
|
|
5153
|
-
for (let
|
|
5154
|
-
if (b.arr[
|
|
5155
|
-
a =
|
|
5153
|
+
for (let D = 0; D < b.count; D++)
|
|
5154
|
+
if (b.arr[D] === d.source) {
|
|
5155
|
+
a = D;
|
|
5156
5156
|
break;
|
|
5157
5157
|
}
|
|
5158
5158
|
"frame" in d && (s.u = s.u ?? d.frame.x, s.v = s.v ?? d.frame.y, s.tileWidth = s.tileWidth ?? d.orig.width, s.tileHeight = s.tileHeight ?? d.orig.height), c = d.source;
|
|
@@ -5161,48 +5161,48 @@ class Je extends Si {
|
|
|
5161
5161
|
return console.error("The tile texture was not found in the tilemap tileset."), this;
|
|
5162
5162
|
const {
|
|
5163
5163
|
u: g = 0,
|
|
5164
|
-
v:
|
|
5164
|
+
v: A = 0,
|
|
5165
5165
|
tileWidth: E = c.width,
|
|
5166
5166
|
tileHeight: S = c.height,
|
|
5167
|
-
animX:
|
|
5167
|
+
animX: I = 0,
|
|
5168
5168
|
animY: F = 0,
|
|
5169
5169
|
rotate: B = 0,
|
|
5170
|
-
animCountX:
|
|
5170
|
+
animCountX: N = 1024,
|
|
5171
5171
|
animCountY: P = 1024,
|
|
5172
|
-
animDivisor:
|
|
5172
|
+
animDivisor: m = 1,
|
|
5173
5173
|
alpha: v = 1
|
|
5174
|
-
} = s,
|
|
5175
|
-
return this.hasAnimatedTile = this.hasAnimatedTile ||
|
|
5174
|
+
} = s, _ = this.pointsBuf;
|
|
5175
|
+
return this.hasAnimatedTile = this.hasAnimatedTile || I > 0 || F > 0, _.push(g), _.push(A), _.push(e), _.push(i), _.push(E), _.push(S), _.push(B), _.push(I | 0), _.push(F | 0), _.push(a), _.push(N), _.push(P), _.push(m), _.push(v), this.tilemapBounds.addFrame(e, i, e + E, i + S), this;
|
|
5176
5176
|
}
|
|
5177
5177
|
/** Changes the rotation of the last tile. */
|
|
5178
5178
|
tileRotate(t) {
|
|
5179
5179
|
const e = this.pointsBuf;
|
|
5180
|
-
e[e.length - (
|
|
5180
|
+
e[e.length - (Et - 9)] = t;
|
|
5181
5181
|
}
|
|
5182
5182
|
/** Changes the `animX`, `animCountX` of the last tile. */
|
|
5183
5183
|
tileAnimX(t, e) {
|
|
5184
5184
|
const i = this.pointsBuf;
|
|
5185
|
-
i[i.length - (
|
|
5185
|
+
i[i.length - (Et - 7)] = t, i[i.length - (Et - 10)] = e;
|
|
5186
5186
|
}
|
|
5187
5187
|
/** Changes the `animY`, `animCountY` of the last tile. */
|
|
5188
5188
|
tileAnimY(t, e) {
|
|
5189
5189
|
const i = this.pointsBuf;
|
|
5190
|
-
i[i.length - (
|
|
5190
|
+
i[i.length - (Et - 8)] = t, i[i.length - (Et - 11)] = e;
|
|
5191
5191
|
}
|
|
5192
5192
|
/** Changes the `animDivisor` value of the last tile. */
|
|
5193
5193
|
tileAnimDivisor(t) {
|
|
5194
5194
|
const e = this.pointsBuf;
|
|
5195
|
-
e[e.length - (
|
|
5195
|
+
e[e.length - (Et - 12)] = t;
|
|
5196
5196
|
}
|
|
5197
5197
|
tileAlpha(t) {
|
|
5198
5198
|
const e = this.pointsBuf;
|
|
5199
|
-
e[e.length - (
|
|
5199
|
+
e[e.length - (Et - 13)] = t;
|
|
5200
5200
|
}
|
|
5201
5201
|
destroyVb() {
|
|
5202
5202
|
this.vb && (this.vb.destroy(), this.vb = null);
|
|
5203
5203
|
}
|
|
5204
5204
|
updateBuffer(t) {
|
|
5205
|
-
const e = this.pointsBuf, i = e.length /
|
|
5205
|
+
const e = this.pointsBuf, i = e.length / Et;
|
|
5206
5206
|
let s = this.vb;
|
|
5207
5207
|
if (this.tileset.count === 0 || i === 0 || this.rects_count === i && s)
|
|
5208
5208
|
return;
|
|
@@ -5211,70 +5211,70 @@ class Je extends Si {
|
|
|
5211
5211
|
t.checkIndexBuffer(i);
|
|
5212
5212
|
const a = s.getBuffer("aVertexPosition"), o = s.stride * c;
|
|
5213
5213
|
if (!this.vbBuffer || this.vbBuffer.byteLength < o) {
|
|
5214
|
-
let
|
|
5215
|
-
for (;
|
|
5216
|
-
|
|
5217
|
-
this.vbBuffer = new ArrayBuffer(
|
|
5214
|
+
let I = s.stride;
|
|
5215
|
+
for (; I < o; )
|
|
5216
|
+
I *= 2;
|
|
5217
|
+
this.vbBuffer = new ArrayBuffer(I), this.vbArray = new Float32Array(this.vbBuffer), this.vbInts = new Uint32Array(this.vbBuffer);
|
|
5218
5218
|
}
|
|
5219
|
-
const g = this.vbArray,
|
|
5219
|
+
const g = this.vbArray, A = this.vbInts;
|
|
5220
5220
|
let E = 0, S = 0;
|
|
5221
|
-
for (let
|
|
5221
|
+
for (let I = 0; I < e.length; I += Et) {
|
|
5222
5222
|
this.compositeParent && (S = e[
|
|
5223
|
-
|
|
5223
|
+
I + 9
|
|
5224
5224
|
/* TEXTURE_INDEX */
|
|
5225
5225
|
]);
|
|
5226
5226
|
const B = e[
|
|
5227
|
-
|
|
5227
|
+
I + 2
|
|
5228
5228
|
/* X */
|
|
5229
|
-
],
|
|
5230
|
-
|
|
5229
|
+
], N = e[
|
|
5230
|
+
I + 3
|
|
5231
5231
|
/* Y */
|
|
5232
5232
|
], P = e[
|
|
5233
|
-
|
|
5233
|
+
I + 4
|
|
5234
5234
|
/* TILE_WIDTH */
|
|
5235
|
-
],
|
|
5236
|
-
|
|
5235
|
+
], m = e[
|
|
5236
|
+
I + 5
|
|
5237
5237
|
/* TILE_HEIGHT */
|
|
5238
5238
|
], v = e[
|
|
5239
|
-
|
|
5239
|
+
I + 0
|
|
5240
5240
|
/* U */
|
|
5241
|
-
],
|
|
5242
|
-
|
|
5241
|
+
], _ = e[
|
|
5242
|
+
I + 1
|
|
5243
5243
|
/* V */
|
|
5244
5244
|
];
|
|
5245
5245
|
let d = e[
|
|
5246
|
-
|
|
5246
|
+
I + 6
|
|
5247
5247
|
/* ROTATE */
|
|
5248
5248
|
];
|
|
5249
5249
|
const b = e[
|
|
5250
|
-
|
|
5250
|
+
I + 7
|
|
5251
5251
|
/* ANIM_X */
|
|
5252
|
-
],
|
|
5253
|
-
|
|
5252
|
+
], D = e[
|
|
5253
|
+
I + 8
|
|
5254
5254
|
/* ANIM_Y */
|
|
5255
5255
|
], O = e[
|
|
5256
|
-
|
|
5256
|
+
I + 10
|
|
5257
5257
|
/* ANIM_COUNT_X */
|
|
5258
5258
|
] || 1024, R = e[
|
|
5259
|
-
|
|
5259
|
+
I + 11
|
|
5260
5260
|
/* ANIM_COUNT_Y */
|
|
5261
|
-
] || 1024, y = b + O * 2048,
|
|
5262
|
-
|
|
5261
|
+
] || 1024, y = b + O * 2048, k = D + R * 2048, et = e[
|
|
5262
|
+
I + 12
|
|
5263
5263
|
/* ANIM_DIVISOR */
|
|
5264
|
-
],
|
|
5265
|
-
|
|
5264
|
+
], G = e[
|
|
5265
|
+
I + 13
|
|
5266
5266
|
/* ALPHA */
|
|
5267
5267
|
];
|
|
5268
|
-
let
|
|
5268
|
+
let j, lt, nt, ft, L, at, rt, W;
|
|
5269
5269
|
if (d === 0)
|
|
5270
|
-
|
|
5270
|
+
j = v, lt = _, nt = v + P, ft = _, L = v + P, at = _ + m, rt = v, W = _ + m;
|
|
5271
5271
|
else {
|
|
5272
|
-
let U = P / 2,
|
|
5273
|
-
d % 4 !== 0 && (U =
|
|
5274
|
-
const
|
|
5275
|
-
d = ot.add(d, ot.NW),
|
|
5272
|
+
let U = P / 2, X = m / 2;
|
|
5273
|
+
d % 4 !== 0 && (U = m / 2, X = P / 2);
|
|
5274
|
+
const pt = v + U, wt = _ + X;
|
|
5275
|
+
d = ot.add(d, ot.NW), j = pt + U * ot.uX(d), lt = wt + X * ot.uY(d), d = ot.add(d, 2), nt = pt + U * ot.uX(d), ft = wt + X * ot.uY(d), d = ot.add(d, 2), L = pt + U * ot.uX(d), at = wt + X * ot.uY(d), d = ot.add(d, 2), rt = pt + U * ot.uX(d), W = wt + X * ot.uY(d);
|
|
5276
5276
|
}
|
|
5277
|
-
g[E++] = B, g[E++] =
|
|
5277
|
+
g[E++] = B, g[E++] = N, g[E++] = j, g[E++] = lt, g[E++] = v + 0.5, g[E++] = _ + 0.5, g[E++] = v + P - 0.5, g[E++] = _ + m - 0.5, g[E++] = y, g[E++] = k, A[E++] = S, g[E++] = et, g[E++] = G, g[E++] = B + P, g[E++] = N, g[E++] = nt, g[E++] = ft, g[E++] = v + 0.5, g[E++] = _ + 0.5, g[E++] = v + P - 0.5, g[E++] = _ + m - 0.5, g[E++] = y, g[E++] = k, A[E++] = S, g[E++] = et, g[E++] = G, g[E++] = B + P, g[E++] = N + m, g[E++] = L, g[E++] = at, g[E++] = v + 0.5, g[E++] = _ + 0.5, g[E++] = v + P - 0.5, g[E++] = _ + m - 0.5, g[E++] = y, g[E++] = k, A[E++] = S, g[E++] = et, g[E++] = G, g[E++] = B, g[E++] = N + m, g[E++] = rt, g[E++] = W, g[E++] = v + 0.5, g[E++] = _ + 0.5, g[E++] = v + P - 0.5, g[E++] = _ + m - 0.5, g[E++] = y, g[E++] = k, A[E++] = S, g[E++] = et, g[E++] = G;
|
|
5278
5278
|
}
|
|
5279
5279
|
a.data = g;
|
|
5280
5280
|
}
|
|
@@ -5283,7 +5283,7 @@ class Je extends Si {
|
|
|
5283
5283
|
* @ignore
|
|
5284
5284
|
*/
|
|
5285
5285
|
isModified(t) {
|
|
5286
|
-
return !!(this.rects_count *
|
|
5286
|
+
return !!(this.rects_count * Et !== this.pointsBuf.length || t && this.hasAnimatedTile);
|
|
5287
5287
|
}
|
|
5288
5288
|
/**
|
|
5289
5289
|
* This will pull forward the modification marker.
|
|
@@ -5292,7 +5292,7 @@ class Je extends Si {
|
|
|
5292
5292
|
* @ignore
|
|
5293
5293
|
*/
|
|
5294
5294
|
clearModify() {
|
|
5295
|
-
this.rects_count = this.pointsBuf.length /
|
|
5295
|
+
this.rects_count = this.pointsBuf.length / Et;
|
|
5296
5296
|
}
|
|
5297
5297
|
addBounds(t) {
|
|
5298
5298
|
const e = this.tilemapBounds;
|
|
@@ -5327,7 +5327,7 @@ class Je extends Si {
|
|
|
5327
5327
|
* @deprecated Since @pixi/tilemap 3.
|
|
5328
5328
|
*/
|
|
5329
5329
|
// eslint-disable-next-line max-params
|
|
5330
|
-
addRect(t, e, i, s, c, a, o, g = 0,
|
|
5330
|
+
addRect(t, e, i, s, c, a, o, g = 0, A = 0, E = 0, S = 1024, I = 1024, F = 1, B = 1) {
|
|
5331
5331
|
return this.tile(
|
|
5332
5332
|
t,
|
|
5333
5333
|
s,
|
|
@@ -5338,10 +5338,10 @@ class Je extends Si {
|
|
|
5338
5338
|
tileWidth: a,
|
|
5339
5339
|
tileHeight: o,
|
|
5340
5340
|
animX: g,
|
|
5341
|
-
animY:
|
|
5341
|
+
animY: A,
|
|
5342
5342
|
rotate: E,
|
|
5343
5343
|
animCountX: S,
|
|
5344
|
-
animCountY:
|
|
5344
|
+
animCountY: I,
|
|
5345
5345
|
animDivisor: F,
|
|
5346
5346
|
alpha: B
|
|
5347
5347
|
}
|
|
@@ -5446,11 +5446,11 @@ class Mr extends Fi {
|
|
|
5446
5446
|
s
|
|
5447
5447
|
);
|
|
5448
5448
|
} else {
|
|
5449
|
-
typeof t == "string" && (t =
|
|
5449
|
+
typeof t == "string" && (t = re.from(t));
|
|
5450
5450
|
for (let o = 0; o < a.length; o++) {
|
|
5451
|
-
const g = a[o],
|
|
5452
|
-
for (let E = 0; E <
|
|
5453
|
-
if (
|
|
5451
|
+
const g = a[o], A = g.getTileset().arr;
|
|
5452
|
+
for (let E = 0; E < A.length; E++)
|
|
5453
|
+
if (A[E] === t.source) {
|
|
5454
5454
|
c = g;
|
|
5455
5455
|
break;
|
|
5456
5456
|
}
|
|
@@ -5503,7 +5503,7 @@ class Mr extends Fi {
|
|
|
5503
5503
|
* @deprecated Since @pixi/tilemap 3.
|
|
5504
5504
|
* @see CompositeTilemap.tile
|
|
5505
5505
|
*/
|
|
5506
|
-
addFrame(t, e, i, s, c, a, o, g,
|
|
5506
|
+
addFrame(t, e, i, s, c, a, o, g, A) {
|
|
5507
5507
|
return this.tile(
|
|
5508
5508
|
t,
|
|
5509
5509
|
e,
|
|
@@ -5514,7 +5514,7 @@ class Mr extends Fi {
|
|
|
5514
5514
|
animCountX: a,
|
|
5515
5515
|
animCountY: o,
|
|
5516
5516
|
animDivisor: g,
|
|
5517
|
-
alpha:
|
|
5517
|
+
alpha: A
|
|
5518
5518
|
}
|
|
5519
5519
|
);
|
|
5520
5520
|
}
|
|
@@ -5523,7 +5523,7 @@ class Mr extends Fi {
|
|
|
5523
5523
|
* @see CompositeTilemap.tile
|
|
5524
5524
|
*/
|
|
5525
5525
|
// eslint-disable-next-line max-params
|
|
5526
|
-
addRect(t, e, i, s, c, a, o, g,
|
|
5526
|
+
addRect(t, e, i, s, c, a, o, g, A, E, S, I) {
|
|
5527
5527
|
const F = t / this.texturesPerTilemap >> 0, B = t % this.texturesPerTilemap;
|
|
5528
5528
|
return this.children[F] && this.children[F].getTileset().count > 0 ? (this.lastModifiedTilemap = this.children[F], this.lastModifiedTilemap.addRect(
|
|
5529
5529
|
B,
|
|
@@ -5534,10 +5534,10 @@ class Mr extends Fi {
|
|
|
5534
5534
|
a,
|
|
5535
5535
|
o,
|
|
5536
5536
|
g,
|
|
5537
|
-
|
|
5537
|
+
A,
|
|
5538
5538
|
E,
|
|
5539
5539
|
S,
|
|
5540
|
-
|
|
5540
|
+
I
|
|
5541
5541
|
)) : this.lastModifiedTilemap = null, this;
|
|
5542
5542
|
}
|
|
5543
5543
|
/**
|
|
@@ -5552,9 +5552,9 @@ class Mr extends Fi {
|
|
|
5552
5552
|
Me.add(li);
|
|
5553
5553
|
Me.add(ci);
|
|
5554
5554
|
Me.add(ui);
|
|
5555
|
-
class
|
|
5555
|
+
class ee extends Ni {
|
|
5556
5556
|
constructor(t, e) {
|
|
5557
|
-
super(
|
|
5557
|
+
super(ee.getTextures(t, e)), this.tile = t, this.tileSet = e, this.animations = [], this._x = 0, this._y = 0, this.properties = {}, this.animations = t.animations || [], this.properties = t.properties, this.textures = ee.getTextures(t, e), this.texture = this.textures[0], this.flip();
|
|
5558
5558
|
}
|
|
5559
5559
|
static getTextures(t, e) {
|
|
5560
5560
|
const i = [];
|
|
@@ -5598,13 +5598,13 @@ class Oe extends yi(Mr) {
|
|
|
5598
5598
|
createTile(t, e, i = {}) {
|
|
5599
5599
|
const { real: s, filter: c } = i, { tilewidth: a, tileheight: o, width: g } = this._layer;
|
|
5600
5600
|
s && (t = Math.floor(t / a), e = Math.floor(e / o));
|
|
5601
|
-
const
|
|
5601
|
+
const A = t + e * g, E = this._layer.getTileByIndex(A);
|
|
5602
5602
|
if (!E || E && E.gid == 0) return;
|
|
5603
5603
|
const S = Oe.findTileSet(E.gid, this.tileSets);
|
|
5604
5604
|
if (!S) return;
|
|
5605
|
-
const
|
|
5606
|
-
if (
|
|
5607
|
-
return
|
|
5605
|
+
const I = new ee(E, S);
|
|
5606
|
+
if (I.x = t * a, I.y = e * o + (o - I.texture.height), I._x = t, I._y = e, S.tileoffset && (I.x += S.tileoffset.x ?? 0, I.y += S.tileoffset.y ?? 0), !(c && !c(I)))
|
|
5607
|
+
return I;
|
|
5608
5608
|
}
|
|
5609
5609
|
_addFrame(t, e, i) {
|
|
5610
5610
|
const s = this.tile(t.texture, t.x, t.y, {
|
|
@@ -5651,11 +5651,11 @@ class Fr extends lr {
|
|
|
5651
5651
|
}
|
|
5652
5652
|
/** @internal */
|
|
5653
5653
|
async load(t) {
|
|
5654
|
-
const e = await
|
|
5654
|
+
const e = await Di.load(t);
|
|
5655
5655
|
for (let i = this.margin; i < this.image.height; i += this.tileheight + this.spacing)
|
|
5656
5656
|
for (let s = this.margin; s < this.image.width; s += this.tilewidth + this.spacing)
|
|
5657
5657
|
this.textures.push(
|
|
5658
|
-
new
|
|
5658
|
+
new re({
|
|
5659
5659
|
source: e.source,
|
|
5660
5660
|
frame: new Pi(+s, +i, +this.tilewidth, +this.tileheight)
|
|
5661
5661
|
})
|
|
@@ -5663,7 +5663,7 @@ class Fr extends lr {
|
|
|
5663
5663
|
return this.loadGroup(), this;
|
|
5664
5664
|
}
|
|
5665
5665
|
}
|
|
5666
|
-
function
|
|
5666
|
+
function Nr(h, t, e) {
|
|
5667
5667
|
const i = [];
|
|
5668
5668
|
for (const s of h) {
|
|
5669
5669
|
if (s.type !== Ut.Tile) {
|
|
@@ -5679,30 +5679,30 @@ function Dr(h, t, e) {
|
|
|
5679
5679
|
continue;
|
|
5680
5680
|
}
|
|
5681
5681
|
for (let g = 0; g < a.length; g++) {
|
|
5682
|
-
const
|
|
5683
|
-
if (
|
|
5682
|
+
const A = a[g];
|
|
5683
|
+
if (A === 0) continue;
|
|
5684
5684
|
let E;
|
|
5685
5685
|
for (let B = t.length - 1; B >= 0; B--)
|
|
5686
|
-
if (t[B].firstgid && t[B].firstgid <=
|
|
5686
|
+
if (t[B].firstgid && t[B].firstgid <= A) {
|
|
5687
5687
|
E = t[B];
|
|
5688
5688
|
break;
|
|
5689
5689
|
}
|
|
5690
5690
|
if (!E) {
|
|
5691
|
-
c.has(0) || c.set(0, new Array(a.length).fill(0)), c.get(0)[g] =
|
|
5691
|
+
c.has(0) || c.set(0, new Array(a.length).fill(0)), c.get(0)[g] = A;
|
|
5692
5692
|
continue;
|
|
5693
5693
|
}
|
|
5694
|
-
const S =
|
|
5695
|
-
|
|
5694
|
+
const S = A - E.firstgid, I = E.tileset.tiles?.[S]?.properties, F = I?.z ?? 0;
|
|
5695
|
+
I?.z, c.has(F) || c.set(F, new Array(a.length).fill(0)), c.get(F)[g] = A;
|
|
5696
5696
|
}
|
|
5697
|
-
const o = Array.from(c.keys()).sort((g,
|
|
5697
|
+
const o = Array.from(c.keys()).sort((g, A) => g - A);
|
|
5698
5698
|
for (const g of o) {
|
|
5699
|
-
const
|
|
5700
|
-
if (
|
|
5699
|
+
const A = c.get(g);
|
|
5700
|
+
if (A.some((E) => E !== 0)) {
|
|
5701
5701
|
const E = {
|
|
5702
5702
|
...s,
|
|
5703
5703
|
name: `${s.name}_z${g}`,
|
|
5704
5704
|
// Always add _z suffix
|
|
5705
|
-
data:
|
|
5705
|
+
data: A,
|
|
5706
5706
|
properties: {
|
|
5707
5707
|
...s.properties,
|
|
5708
5708
|
z: g
|
|
@@ -5717,13 +5717,13 @@ function Dr(h, t, e) {
|
|
|
5717
5717
|
return a - o;
|
|
5718
5718
|
}), i;
|
|
5719
5719
|
}
|
|
5720
|
-
function
|
|
5721
|
-
const { map: t, basePath: e, createLayersPerTilesZ: i } =
|
|
5720
|
+
function $r(h) {
|
|
5721
|
+
const { map: t, basePath: e, createLayersPerTilesZ: i } = kt(h, {
|
|
5722
5722
|
createLayersPerTilesZ: !1,
|
|
5723
5723
|
basePath: ""
|
|
5724
|
-
}), s =
|
|
5724
|
+
}), s = $([]), c = h.objectLayer;
|
|
5725
5725
|
let a = [], o = {};
|
|
5726
|
-
const g = async (E, S = "") => typeof E != "string" ? E : await new
|
|
5726
|
+
const g = async (E, S = "") => typeof E != "string" ? E : await new At(
|
|
5727
5727
|
E,
|
|
5728
5728
|
{
|
|
5729
5729
|
basePath: S
|
|
@@ -5735,62 +5735,61 @@ function zr(h) {
|
|
|
5735
5735
|
const E = t();
|
|
5736
5736
|
if (E) {
|
|
5737
5737
|
o = await g(E, e()), a = [];
|
|
5738
|
-
for (let
|
|
5739
|
-
|
|
5738
|
+
for (let I of o.tilesets)
|
|
5739
|
+
I.tile && (I.tiles = I.tile), I.tiles || (I.tiles = []), a.push(await new Fr(I).load(I.image.source));
|
|
5740
5740
|
let S = o.layers;
|
|
5741
|
-
i() && (S =
|
|
5741
|
+
i() && (S = Nr(o.layers, a)), s.set(S);
|
|
5742
5742
|
}
|
|
5743
5743
|
});
|
|
5744
|
-
const
|
|
5745
|
-
switch (
|
|
5744
|
+
const A = (E, S = {}) => ht(Nt, S, wi(E, (I) => {
|
|
5745
|
+
switch (I.type) {
|
|
5746
5746
|
case Ut.Tile:
|
|
5747
|
-
return
|
|
5747
|
+
return ht(Br, {
|
|
5748
5748
|
tilewidth: o.tilewidth,
|
|
5749
5749
|
tileheight: o.tileheight,
|
|
5750
5750
|
// @ts-ignore
|
|
5751
5751
|
width: o.width,
|
|
5752
5752
|
// @ts-ignore
|
|
5753
5753
|
height: o.height,
|
|
5754
|
-
...
|
|
5754
|
+
...I,
|
|
5755
5755
|
tilesets: a
|
|
5756
5756
|
});
|
|
5757
5757
|
case Ut.Image:
|
|
5758
|
-
const { width: F, height: B, source:
|
|
5759
|
-
return
|
|
5760
|
-
image:
|
|
5761
|
-
...
|
|
5762
|
-
width:
|
|
5763
|
-
height:
|
|
5758
|
+
const { width: F, height: B, source: N } = I.image;
|
|
5759
|
+
return ht(vi, {
|
|
5760
|
+
image: N,
|
|
5761
|
+
...I,
|
|
5762
|
+
width: I.repeatx ? I.width * I.tilewidth : F,
|
|
5763
|
+
height: I.repeaty ? I.height * I.tileheight : B
|
|
5764
5764
|
});
|
|
5765
5765
|
case Ut.Group:
|
|
5766
|
-
return
|
|
5766
|
+
return A($(I.layers), I);
|
|
5767
5767
|
case Ut.ObjectGroup:
|
|
5768
|
-
const P = c?.(
|
|
5769
|
-
return
|
|
5768
|
+
const P = c?.(I);
|
|
5769
|
+
return ht(Nt, I, P);
|
|
5770
5770
|
default:
|
|
5771
|
-
return
|
|
5771
|
+
return ht(Nt);
|
|
5772
5772
|
}
|
|
5773
5773
|
}));
|
|
5774
|
-
return
|
|
5774
|
+
return ht(Nt, h, A(s));
|
|
5775
5775
|
}
|
|
5776
|
-
function
|
|
5776
|
+
function Dr() {
|
|
5777
5777
|
const h = (
|
|
5778
5778
|
/* glsl */
|
|
5779
5779
|
`
|
|
5780
5780
|
precision mediump float;
|
|
5781
5781
|
attribute vec2 aPosition;
|
|
5782
5782
|
attribute vec2 aUV;
|
|
5783
|
-
varying
|
|
5783
|
+
varying vec2 vUV;
|
|
5784
5784
|
void main() {
|
|
5785
|
-
|
|
5786
|
-
|
|
5785
|
+
vUV = aUV;
|
|
5786
|
+
gl_Position = vec4(aPosition, 0.0, 1.0);
|
|
5787
5787
|
}
|
|
5788
5788
|
`
|
|
5789
5789
|
), t = (
|
|
5790
5790
|
/* glsl */
|
|
5791
5791
|
`
|
|
5792
5792
|
precision mediump float;
|
|
5793
|
-
|
|
5794
5793
|
varying vec2 vUV;
|
|
5795
5794
|
|
|
5796
5795
|
uniform float uTime;
|
|
@@ -5801,130 +5800,75 @@ function Nr() {
|
|
|
5801
5800
|
uniform float uRainDensity;
|
|
5802
5801
|
uniform float uMaxDrops;
|
|
5803
5802
|
|
|
5804
|
-
|
|
5805
|
-
|
|
5806
|
-
return fract(n * 0.1031);
|
|
5803
|
+
float hash(vec2 p) {
|
|
5804
|
+
return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);
|
|
5807
5805
|
}
|
|
5808
5806
|
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
float speed = (0.4 + rnd1 * 0.6) * uRainSpeed;
|
|
5822
|
-
|
|
5823
|
-
// Simplified Y position calculation
|
|
5824
|
-
float yStructured = mod(dropIndex, maxDrops) / max(maxDrops, 1.0);
|
|
5825
|
-
float initialYOffset = mix(rnd2, yStructured, 0.7);
|
|
5826
|
-
float yProgress = mod(initialYOffset + t * speed, 1.0);
|
|
5827
|
-
float y = 1.2 - yProgress * 2.4;
|
|
5828
|
-
|
|
5829
|
-
// Aggressive early discard - check vertical bounds first
|
|
5830
|
-
if (y < -1.3 || y > 1.3) {
|
|
5831
|
-
return 0.0;
|
|
5832
|
-
}
|
|
5833
|
-
|
|
5834
|
-
// Simplified wind effect
|
|
5835
|
-
float windOffset = uWindDirection * uWindStrength * yProgress * 0.5;
|
|
5836
|
-
x += windOffset;
|
|
5837
|
-
|
|
5838
|
-
// Early discard for horizontal bounds
|
|
5839
|
-
if (x < -1.5 || x > 1.5) {
|
|
5840
|
-
return 0.0;
|
|
5841
|
-
}
|
|
5842
|
-
|
|
5843
|
-
// Fast distance check before expensive calculations
|
|
5844
|
-
vec2 diff = uv - vec2(x, y);
|
|
5845
|
-
float distSq = dot(diff, diff);
|
|
5846
|
-
|
|
5847
|
-
// Early discard if too far (major performance boost)
|
|
5848
|
-
if (distSq > 0.01) { // ~0.1 units distance
|
|
5849
|
-
return 0.0;
|
|
5850
|
-
}
|
|
5851
|
-
|
|
5852
|
-
// Only calculate expensive operations if we're close
|
|
5853
|
-
float dropWidth = 0.0012 + rnd0 * 0.0008;
|
|
5854
|
-
float dropLength = 0.035 + rnd1 * 0.020;
|
|
5807
|
+
float rainLayer(
|
|
5808
|
+
vec2 uv,
|
|
5809
|
+
float t,
|
|
5810
|
+
float scale,
|
|
5811
|
+
float speed,
|
|
5812
|
+
float slant,
|
|
5813
|
+
float density,
|
|
5814
|
+
float width,
|
|
5815
|
+
float length
|
|
5816
|
+
) {
|
|
5817
|
+
vec2 dir = normalize(vec2(slant, 1.0));
|
|
5818
|
+
vec2 perp = vec2(-dir.y, dir.x);
|
|
5855
5819
|
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
float rotY = diff.x * sinA + diff.y * cosA;
|
|
5820
|
+
float along = dot(uv, dir) * scale + t * speed;
|
|
5821
|
+
float across = dot(uv, perp) * scale;
|
|
5859
5822
|
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
float dist = max(distX, distY * 0.6);
|
|
5823
|
+
vec2 p = vec2(across, along);
|
|
5824
|
+
vec2 cell = floor(p);
|
|
5825
|
+
vec2 f = fract(p);
|
|
5864
5826
|
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
return 0.0;
|
|
5868
|
-
}
|
|
5827
|
+
float rnd = hash(cell);
|
|
5828
|
+
float rnd2 = hash(cell + 13.17);
|
|
5869
5829
|
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
|
|
5830
|
+
float x = rnd;
|
|
5831
|
+
float dropWidth = width * (0.7 + rnd2 * 0.6);
|
|
5832
|
+
float dropLength = length * (0.5 + rnd * 0.6);
|
|
5873
5833
|
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5834
|
+
float line = smoothstep(dropWidth, 0.0, abs(f.x - x));
|
|
5835
|
+
float segment = smoothstep(0.0, 0.03, f.y)
|
|
5836
|
+
* (1.0 - smoothstep(dropLength, dropLength + 0.03, f.y));
|
|
5877
5837
|
|
|
5878
|
-
|
|
5838
|
+
float visible = step(rnd, density);
|
|
5839
|
+
float intensity = line * segment * visible;
|
|
5840
|
+
return intensity * (0.6 + 0.4 * rnd2);
|
|
5879
5841
|
}
|
|
5880
5842
|
|
|
5881
5843
|
void main() {
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
float rain = 0.0;
|
|
5887
|
-
|
|
5888
|
-
// Clamp number of drops - reduced max for better performance
|
|
5889
|
-
float maxDrops = clamp(uMaxDrops, 10.0, 150.0);
|
|
5890
|
-
|
|
5891
|
-
// Pre-calculate wind angle & trig once per fragment
|
|
5892
|
-
float windAngle = uWindDirection * uWindStrength * 0.2;
|
|
5893
|
-
float cosA = cos(windAngle);
|
|
5894
|
-
float sinA = sin(windAngle);
|
|
5844
|
+
vec2 uv = gl_FragCoord.xy / uResolution.xy;
|
|
5845
|
+
float aspect = uResolution.x / uResolution.y;
|
|
5846
|
+
uv.x *= aspect;
|
|
5895
5847
|
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
float resolutionFactor = clamp(pixelCount / 500000.0, 0.5, 1.0); // LOD based on resolution
|
|
5899
|
-
float effectiveMaxDrops = maxDrops * resolutionFactor;
|
|
5900
|
-
float loopMax = min(effectiveMaxDrops, 150.0);
|
|
5848
|
+
float pixelCount = uResolution.x * uResolution.y;
|
|
5849
|
+
float resolutionFactor = clamp(pixelCount / 700000.0, 0.6, 1.0);
|
|
5901
5850
|
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
// Use larger prime number spacing for better seed distribution
|
|
5906
|
-
float seed = i * 23.47;
|
|
5907
|
-
float dropValue = rainDrop(uv, uTime, seed, i, maxDrops, cosA, sinA);
|
|
5908
|
-
rain += dropValue;
|
|
5909
|
-
|
|
5910
|
-
// Early exit if we've accumulated enough intensity (performance optimization)
|
|
5911
|
-
if (rain > 2.0) break;
|
|
5912
|
-
}
|
|
5851
|
+
float densityFactor = clamp(uRainDensity / 240.0, 0.2, 1.2);
|
|
5852
|
+
float maxDropFactor = clamp(uMaxDrops / 120.0, 0.3, 1.0);
|
|
5853
|
+
float density = clamp(densityFactor * maxDropFactor * resolutionFactor, 0.1, 1.0);
|
|
5913
5854
|
|
|
5914
|
-
|
|
5915
|
-
|
|
5855
|
+
float slant = uWindDirection * uWindStrength * 0.6;
|
|
5856
|
+
float speed = 1.3 * uRainSpeed + 0.4;
|
|
5916
5857
|
|
|
5917
|
-
|
|
5918
|
-
|
|
5858
|
+
float rain = 0.0;
|
|
5859
|
+
rain += rainLayer(uv, uTime, 24.0, speed * 1.2, slant, density, 0.018, 0.75);
|
|
5860
|
+
rain += rainLayer(uv, uTime, 36.0, speed * 1.5, slant * 1.2, density * 0.8, 0.014, 0.6);
|
|
5861
|
+
rain += rainLayer(uv, uTime, 52.0, speed * 1.8, slant * 1.4, density * 0.6, 0.012, 0.5);
|
|
5919
5862
|
|
|
5920
|
-
|
|
5921
|
-
|
|
5863
|
+
float heightFade = mix(0.65, 1.0, uv.y);
|
|
5864
|
+
rain *= heightFade;
|
|
5922
5865
|
|
|
5923
|
-
|
|
5866
|
+
vec3 rainColor = vec3(0.75, 0.85, 1.0);
|
|
5867
|
+
gl_FragColor = vec4(rainColor * rain, clamp(rain, 0.0, 0.9));
|
|
5924
5868
|
}
|
|
5925
5869
|
`
|
|
5926
5870
|
);
|
|
5927
|
-
return new
|
|
5871
|
+
return new $t({ vertex: h, fragment: t });
|
|
5928
5872
|
}
|
|
5929
5873
|
function Pr() {
|
|
5930
5874
|
const h = (
|
|
@@ -5933,7 +5877,7 @@ function Pr() {
|
|
|
5933
5877
|
precision mediump float;
|
|
5934
5878
|
attribute vec2 aPosition;
|
|
5935
5879
|
attribute vec2 aUV;
|
|
5936
|
-
varying
|
|
5880
|
+
varying vec2 vUV;
|
|
5937
5881
|
void main() {
|
|
5938
5882
|
vUV = aUV;
|
|
5939
5883
|
gl_Position = vec4(aPosition, 0.0, 1.0);
|
|
@@ -5943,7 +5887,6 @@ function Pr() {
|
|
|
5943
5887
|
/* glsl */
|
|
5944
5888
|
`
|
|
5945
5889
|
precision mediump float;
|
|
5946
|
-
|
|
5947
5890
|
varying vec2 vUV;
|
|
5948
5891
|
|
|
5949
5892
|
uniform float uTime;
|
|
@@ -5954,131 +5897,83 @@ function Pr() {
|
|
|
5954
5897
|
uniform float uSnowDensity;
|
|
5955
5898
|
uniform float uMaxFlakes;
|
|
5956
5899
|
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
return fract(sin(n) * 43758.5453);
|
|
5900
|
+
float hash(vec2 p) {
|
|
5901
|
+
return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);
|
|
5960
5902
|
}
|
|
5961
5903
|
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
5965
|
-
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
|
|
5969
|
-
|
|
5970
|
-
|
|
5971
|
-
|
|
5972
|
-
float
|
|
5973
|
-
|
|
5974
|
-
|
|
5975
|
-
float
|
|
5976
|
-
float
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
float
|
|
5988
|
-
|
|
5989
|
-
// Optimized oscillation - natural and subtle movement
|
|
5990
|
-
float oscillationPhase = t * 1.8 + seed * 6.28;
|
|
5991
|
-
float oscillation = sin(oscillationPhase) * 0.08 + sin(oscillationPhase * 1.4) * 0.04;
|
|
5992
|
-
oscillation *= (1.0 + fallProgress * 0.3);
|
|
5993
|
-
|
|
5994
|
-
// Wind effect - more pronounced and progressive with fall
|
|
5995
|
-
float windOffset = uWindDirection * uWindStrength * fallProgress * 0.8;
|
|
5996
|
-
|
|
5997
|
-
// Add horizontal drift due to wind (even at top)
|
|
5998
|
-
float windDrift = uWindDirection * uWindStrength * 0.2;
|
|
5999
|
-
|
|
6000
|
-
// Final X position with wind and oscillation
|
|
6001
|
-
x += windOffset + windDrift + oscillation;
|
|
6002
|
-
|
|
6003
|
-
// Early exit if flake is too far horizontally
|
|
6004
|
-
if (x < -1.4 || x > 1.4) {
|
|
6005
|
-
return 0.0;
|
|
6006
|
-
}
|
|
6007
|
-
|
|
6008
|
-
vec2 diff = uv - vec2(x, y);
|
|
6009
|
-
|
|
6010
|
-
// Fast distance check before expensive calculations
|
|
6011
|
-
float distSq = dot(diff, diff);
|
|
6012
|
-
|
|
6013
|
-
// Early exit if too far (major performance boost)
|
|
6014
|
-
if (distSq > 0.015) { // ~0.12 units distance
|
|
6015
|
-
return 0.0;
|
|
6016
|
-
}
|
|
6017
|
-
|
|
6018
|
-
// Flake size (circular) - only calculate if close
|
|
6019
|
-
float flakeSize = 0.008 + rnd3 * 0.006;
|
|
6020
|
-
float sizeSq = flakeSize * flakeSize;
|
|
6021
|
-
|
|
6022
|
-
// Additional early exit check
|
|
6023
|
-
if (distSq > sizeSq * 1.5) {
|
|
5904
|
+
vec2 hash2(vec2 p) {
|
|
5905
|
+
return vec2(
|
|
5906
|
+
hash(p),
|
|
5907
|
+
hash(p + 19.19)
|
|
5908
|
+
);
|
|
5909
|
+
}
|
|
5910
|
+
|
|
5911
|
+
float snowLayer(
|
|
5912
|
+
vec2 uv,
|
|
5913
|
+
float t,
|
|
5914
|
+
float scale,
|
|
5915
|
+
float speed,
|
|
5916
|
+
float wind,
|
|
5917
|
+
float density,
|
|
5918
|
+
float sizeMin,
|
|
5919
|
+
float sizeMax
|
|
5920
|
+
) {
|
|
5921
|
+
vec2 p = uv;
|
|
5922
|
+
p.x += wind * t;
|
|
5923
|
+
p.y += t * speed;
|
|
5924
|
+
|
|
5925
|
+
p *= scale;
|
|
5926
|
+
vec2 cell = floor(p);
|
|
5927
|
+
vec2 f = fract(p);
|
|
5928
|
+
|
|
5929
|
+
float rnd = hash(cell);
|
|
5930
|
+
if (rnd > density) {
|
|
6024
5931
|
return 0.0;
|
|
6025
5932
|
}
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
float
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
intensity *= smoothstep(-1.2, -0.8, y) * smoothstep(1.2, 0.8, y);
|
|
6039
|
-
|
|
6040
|
-
return intensity;
|
|
5933
|
+
|
|
5934
|
+
vec2 jitter = hash2(cell + 3.7);
|
|
5935
|
+
float wobble = (hash(cell + 9.1) - 0.5) * 0.3;
|
|
5936
|
+
vec2 center = jitter;
|
|
5937
|
+
center.x += sin(t * 0.7 + jitter.y * 6.283) * 0.15 + wobble;
|
|
5938
|
+
center.y += cos(t * 0.5 + jitter.x * 6.283) * 0.12;
|
|
5939
|
+
|
|
5940
|
+
float size = mix(sizeMin, sizeMax, rnd);
|
|
5941
|
+
float dist = length(f - center);
|
|
5942
|
+
float alpha = 1.0 - smoothstep(size * 0.4, size, dist);
|
|
5943
|
+
float twinkle = 0.7 + 0.3 * sin(t * 1.2 + rnd * 6.283);
|
|
5944
|
+
return alpha * twinkle;
|
|
6041
5945
|
}
|
|
6042
5946
|
|
|
6043
5947
|
void main() {
|
|
6044
|
-
vec2 uv =
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
// Calculate number of flakes based on density (optimized for performance)
|
|
6049
|
-
// Density 50-400 corresponds to approximately 40-150 flakes (reduced for performance)
|
|
6050
|
-
float targetFlakes = 40.0 + (uSnowDensity - 50.0) * (110.0 / 350.0);
|
|
6051
|
-
float maxFlakes = clamp(max(uMaxFlakes, targetFlakes), 30.0, 120.0);
|
|
6052
|
-
|
|
6053
|
-
// Performance optimization: reduce loop iterations based on resolution
|
|
5948
|
+
vec2 uv = gl_FragCoord.xy / uResolution.xy;
|
|
5949
|
+
float aspect = uResolution.x / uResolution.y;
|
|
5950
|
+
uv.x *= aspect;
|
|
5951
|
+
|
|
6054
5952
|
float pixelCount = uResolution.x * uResolution.y;
|
|
6055
|
-
float resolutionFactor = clamp(pixelCount /
|
|
6056
|
-
|
|
6057
|
-
float
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
vec3 snowColor = vec3(1.0, 1.0, 1.0);
|
|
6076
|
-
|
|
6077
|
-
gl_FragColor = vec4(snowColor * snow, snow * 0.9);
|
|
5953
|
+
float resolutionFactor = clamp(pixelCount / 900000.0, 0.5, 1.0);
|
|
5954
|
+
|
|
5955
|
+
float densityFactor = clamp(uSnowDensity / 220.0, 0.15, 1.2);
|
|
5956
|
+
float maxFlakeFactor = clamp(uMaxFlakes / 100.0, 0.3, 1.0);
|
|
5957
|
+
float density = clamp(densityFactor * maxFlakeFactor * resolutionFactor, 0.05, 1.0);
|
|
5958
|
+
|
|
5959
|
+
float wind = uWindDirection * uWindStrength * 0.45;
|
|
5960
|
+
float speed = uSnowSpeed * 0.9 + 0.15;
|
|
5961
|
+
|
|
5962
|
+
float snow = 0.0;
|
|
5963
|
+
snow += snowLayer(uv, uTime, 18.0, speed * 0.5, wind * 0.6, density, 0.08, 0.18) * 0.6;
|
|
5964
|
+
snow += snowLayer(uv, uTime, 28.0, speed * 0.75, wind * 0.9, density * 0.85, 0.06, 0.14) * 0.75;
|
|
5965
|
+
snow += snowLayer(uv, uTime, 40.0, speed, wind, density * 0.7, 0.04, 0.1);
|
|
5966
|
+
|
|
5967
|
+
float heightFade = mix(0.7, 1.0, uv.y);
|
|
5968
|
+
snow *= heightFade;
|
|
5969
|
+
|
|
5970
|
+
vec3 snowColor = vec3(0.92, 0.95, 1.0);
|
|
5971
|
+
float alpha = clamp(snow, 0.0, 0.9);
|
|
5972
|
+
gl_FragColor = vec4(snowColor * snow, alpha);
|
|
6078
5973
|
}
|
|
6079
5974
|
`
|
|
6080
5975
|
);
|
|
6081
|
-
return new
|
|
5976
|
+
return new $t({ vertex: h, fragment: t });
|
|
6082
5977
|
}
|
|
6083
5978
|
function Or() {
|
|
6084
5979
|
const h = (
|
|
@@ -6089,8 +5984,8 @@ function Or() {
|
|
|
6089
5984
|
attribute vec2 aUV;
|
|
6090
5985
|
varying vec2 vUV;
|
|
6091
5986
|
void main() {
|
|
6092
|
-
|
|
6093
|
-
|
|
5987
|
+
vUV = aUV;
|
|
5988
|
+
gl_Position = vec4(aPosition, 0.0, 1.0);
|
|
6094
5989
|
}
|
|
6095
5990
|
`
|
|
6096
5991
|
), t = (
|
|
@@ -6101,162 +5996,226 @@ function Or() {
|
|
|
6101
5996
|
|
|
6102
5997
|
uniform float uTime;
|
|
6103
5998
|
uniform vec2 uResolution;
|
|
6104
|
-
|
|
6105
|
-
uniform float
|
|
6106
|
-
uniform float
|
|
6107
|
-
uniform float
|
|
6108
|
-
|
|
6109
|
-
// ------------------- noise -----------------------------------
|
|
5999
|
+
uniform float uSpeed;
|
|
6000
|
+
uniform float uScale;
|
|
6001
|
+
uniform float uDensity;
|
|
6002
|
+
uniform float uHeight;
|
|
6110
6003
|
|
|
6111
6004
|
float hash(vec2 p) {
|
|
6112
|
-
return fract(sin(dot(p, vec2(127.1,311.7))) * 43758.5453);
|
|
6005
|
+
return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);
|
|
6113
6006
|
}
|
|
6114
6007
|
|
|
6115
6008
|
float noise(vec2 p) {
|
|
6116
6009
|
vec2 i = floor(p);
|
|
6117
6010
|
vec2 f = fract(p);
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
);
|
|
6011
|
+
float a = hash(i);
|
|
6012
|
+
float b = hash(i + vec2(1.0, 0.0));
|
|
6013
|
+
float c = hash(i + vec2(0.0, 1.0));
|
|
6014
|
+
float d = hash(i + vec2(1.0, 1.0));
|
|
6015
|
+
vec2 u = f * f * (3.0 - 2.0 * f);
|
|
6016
|
+
return mix(a, b, u.x) + (c - a) * u.y * (1.0 - u.x) + (d - b) * u.x * u.y;
|
|
6124
6017
|
}
|
|
6125
6018
|
|
|
6126
|
-
float fbm(vec2 p){
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6019
|
+
float fbm(vec2 p) {
|
|
6020
|
+
float v = 0.0;
|
|
6021
|
+
float a = 0.6;
|
|
6022
|
+
v += a * noise(p);
|
|
6023
|
+
p *= 2.02;
|
|
6024
|
+
a *= 0.5;
|
|
6025
|
+
v += a * noise(p + 23.7);
|
|
6026
|
+
p *= 2.03;
|
|
6027
|
+
a *= 0.5;
|
|
6028
|
+
v += a * noise(p + 11.3);
|
|
6029
|
+
return v;
|
|
6135
6030
|
}
|
|
6136
6031
|
|
|
6137
|
-
// --------------------------------------------------------------
|
|
6138
|
-
|
|
6139
6032
|
void main() {
|
|
6033
|
+
vec2 uv = vUV;
|
|
6034
|
+
float aspect = uResolution.x / uResolution.y;
|
|
6035
|
+
uv.x *= aspect;
|
|
6140
6036
|
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
// -------- multi-layer fog ----------------------
|
|
6146
|
-
|
|
6147
|
-
for(int i = 0; i < 3; i++){
|
|
6148
|
-
float layer = float(i);
|
|
6149
|
-
|
|
6150
|
-
vec2 p = uv;
|
|
6151
|
-
|
|
6152
|
-
float scale = uScale * (1.0 + layer * 0.6);
|
|
6153
|
-
float t = uTime * uSpeed * (0.3 + layer * 0.4);
|
|
6154
|
-
|
|
6155
|
-
// drift
|
|
6156
|
-
p.x += t * 0.2;
|
|
6157
|
-
p.y += sin(t + p.x * 2.0) * 0.03;
|
|
6158
|
-
|
|
6159
|
-
// extra wave motion
|
|
6160
|
-
p.x += cos(p.y * 2.5 + t) * 0.03;
|
|
6161
|
-
|
|
6162
|
-
fog += fbm(p * scale) * (1.0 - layer * 0.25);
|
|
6037
|
+
float normalizedDensity = uDensity;
|
|
6038
|
+
if (normalizedDensity > 4.0) {
|
|
6039
|
+
normalizedDensity = normalizedDensity / 100.0;
|
|
6163
6040
|
}
|
|
6041
|
+
float density = clamp(normalizedDensity, 0.0, 2.0);
|
|
6164
6042
|
|
|
6165
|
-
|
|
6166
|
-
|
|
6043
|
+
float scale = max(uScale, 0.3);
|
|
6044
|
+
vec2 drift = vec2(uTime * 0.02 * uSpeed, uTime * 0.015 * uSpeed);
|
|
6045
|
+
float fogNoise = fbm(uv * scale + drift);
|
|
6167
6046
|
|
|
6168
|
-
|
|
6047
|
+
float softness = smoothstep(0.35, 1.0, fogNoise);
|
|
6048
|
+
float baseHeight = 0.6 + 0.4 * (1.0 - uv.y);
|
|
6049
|
+
float heightFactor = mix(baseHeight, 1.0, clamp(uHeight, 0.0, 1.0));
|
|
6169
6050
|
|
|
6170
|
-
float
|
|
6171
|
-
|
|
6051
|
+
float fog = softness * density * 0.45 * heightFactor;
|
|
6052
|
+
float alpha = clamp(fog, 0.0, 0.35);
|
|
6053
|
+
|
|
6054
|
+
vec3 fogColor = vec3(1.0);
|
|
6055
|
+
gl_FragColor = vec4(fogColor * alpha, alpha);
|
|
6056
|
+
}
|
|
6057
|
+
`
|
|
6058
|
+
);
|
|
6059
|
+
return new $t({
|
|
6060
|
+
vertex: h,
|
|
6061
|
+
fragment: t
|
|
6062
|
+
});
|
|
6063
|
+
}
|
|
6064
|
+
function Rr() {
|
|
6065
|
+
const h = (
|
|
6066
|
+
/* glsl */
|
|
6067
|
+
`
|
|
6068
|
+
precision mediump float;
|
|
6069
|
+
attribute vec2 aPosition;
|
|
6070
|
+
attribute vec2 aUV;
|
|
6071
|
+
varying vec2 vUV;
|
|
6072
|
+
void main() {
|
|
6073
|
+
vUV = aUV;
|
|
6074
|
+
gl_Position = vec4(aPosition, 0.0, 1.0);
|
|
6075
|
+
}
|
|
6076
|
+
`
|
|
6077
|
+
), t = (
|
|
6078
|
+
/* glsl */
|
|
6079
|
+
`
|
|
6080
|
+
precision mediump float;
|
|
6081
|
+
varying vec2 vUV;
|
|
6172
6082
|
|
|
6173
|
-
|
|
6083
|
+
uniform float uTime;
|
|
6084
|
+
uniform vec2 uResolution;
|
|
6085
|
+
uniform float uSpeed;
|
|
6086
|
+
uniform float uScale;
|
|
6087
|
+
uniform float uDensity;
|
|
6088
|
+
uniform float uHeight;
|
|
6174
6089
|
|
|
6175
|
-
|
|
6090
|
+
float hash(vec2 p) {
|
|
6091
|
+
return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);
|
|
6092
|
+
}
|
|
6176
6093
|
|
|
6177
|
-
|
|
6178
|
-
|
|
6094
|
+
float noise(vec2 p) {
|
|
6095
|
+
vec2 i = floor(p);
|
|
6096
|
+
vec2 f = fract(p);
|
|
6097
|
+
float a = hash(i);
|
|
6098
|
+
float b = hash(i + vec2(1.0, 0.0));
|
|
6099
|
+
float c = hash(i + vec2(0.0, 1.0));
|
|
6100
|
+
float d = hash(i + vec2(1.0, 1.0));
|
|
6101
|
+
vec2 u = f * f * (3.0 - 2.0 * f);
|
|
6102
|
+
return mix(a, b, u.x) + (c - a) * u.y * (1.0 - u.x) + (d - b) * u.x * u.y;
|
|
6103
|
+
}
|
|
6179
6104
|
|
|
6180
|
-
|
|
6105
|
+
float fbm(vec2 p) {
|
|
6106
|
+
float v = 0.0;
|
|
6107
|
+
float a = 0.7;
|
|
6108
|
+
v += a * noise(p);
|
|
6109
|
+
p *= 2.1;
|
|
6110
|
+
a *= 0.5;
|
|
6111
|
+
v += a * noise(p + 17.0);
|
|
6112
|
+
p *= 2.2;
|
|
6113
|
+
a *= 0.5;
|
|
6114
|
+
v += a * noise(p + 29.0);
|
|
6115
|
+
return v;
|
|
6116
|
+
}
|
|
6181
6117
|
|
|
6182
|
-
|
|
6118
|
+
void main() {
|
|
6119
|
+
vec2 uv = vUV;
|
|
6120
|
+
float aspect = uResolution.x / uResolution.y;
|
|
6121
|
+
uv.x *= aspect;
|
|
6183
6122
|
|
|
6184
|
-
|
|
6185
|
-
|
|
6123
|
+
float normalizedDensity = uDensity;
|
|
6124
|
+
if (normalizedDensity > 4.0) {
|
|
6125
|
+
normalizedDensity = normalizedDensity / 100.0;
|
|
6126
|
+
}
|
|
6127
|
+
float density = clamp(normalizedDensity, 0.0, 2.0);
|
|
6186
6128
|
|
|
6187
|
-
|
|
6129
|
+
float scale = max(uScale, 0.2);
|
|
6130
|
+
vec2 drift = vec2(uTime * 0.03 * uSpeed, uTime * 0.01 * uSpeed);
|
|
6131
|
+
float cloudNoise = fbm(uv * scale + drift);
|
|
6132
|
+
float detailNoise = fbm(uv * (scale * 2.4) + drift * 1.7);
|
|
6188
6133
|
|
|
6189
|
-
|
|
6190
|
-
|
|
6134
|
+
float shape = smoothstep(0.45, 0.95, cloudNoise);
|
|
6135
|
+
float detail = smoothstep(0.4, 0.9, detailNoise);
|
|
6136
|
+
float puff = shape * (0.6 + 0.4 * detail);
|
|
6191
6137
|
|
|
6192
|
-
|
|
6138
|
+
float heightFactor = mix(0.6 + 0.4 * uv.y, 1.0, clamp(uHeight, 0.0, 1.0));
|
|
6139
|
+
float cloud = puff * density * 0.6 * heightFactor;
|
|
6140
|
+
float alpha = clamp(cloud, 0.0, 0.55);
|
|
6193
6141
|
|
|
6194
|
-
|
|
6142
|
+
vec3 cloudColor = vec3(1.0);
|
|
6143
|
+
gl_FragColor = vec4(cloudColor * alpha, alpha);
|
|
6195
6144
|
}
|
|
6196
6145
|
`
|
|
6197
6146
|
);
|
|
6198
|
-
return new
|
|
6147
|
+
return new $t({
|
|
6199
6148
|
vertex: h,
|
|
6200
6149
|
fragment: t
|
|
6201
6150
|
});
|
|
6202
6151
|
}
|
|
6203
|
-
const
|
|
6152
|
+
const Ur = (h) => {
|
|
6204
6153
|
const {
|
|
6205
|
-
effect: t =
|
|
6206
|
-
speed: e =
|
|
6207
|
-
windDirection: i =
|
|
6208
|
-
windStrength: s =
|
|
6209
|
-
density: c =
|
|
6154
|
+
effect: t = $("rain"),
|
|
6155
|
+
speed: e = $(0.5),
|
|
6156
|
+
windDirection: i = $(0),
|
|
6157
|
+
windStrength: s = $(0.2),
|
|
6158
|
+
density: c = $(120),
|
|
6210
6159
|
// Reduced default density for better performance
|
|
6211
|
-
maxDrops: a =
|
|
6160
|
+
maxDrops: a = $(80),
|
|
6212
6161
|
// Reduced default maxDrops for better performance
|
|
6213
|
-
height: o =
|
|
6214
|
-
// Fog height parameter (0 = bottom, 1 =
|
|
6215
|
-
scale: g =
|
|
6162
|
+
height: o = $(1),
|
|
6163
|
+
// Fog/cloud height parameter (0 = bottom, 1 = full)
|
|
6164
|
+
scale: g = $(2),
|
|
6216
6165
|
// Fog noise scale parameter
|
|
6217
|
-
resolution:
|
|
6218
|
-
} =
|
|
6219
|
-
|
|
6220
|
-
const
|
|
6221
|
-
|
|
6222
|
-
const rt =
|
|
6166
|
+
resolution: A
|
|
6167
|
+
} = kt(h), E = $([1e3, 1e3]), S = A ? typeof A == "function" ? A : $(A) : E;
|
|
6168
|
+
Ie((L) => {
|
|
6169
|
+
const at = L.props.context;
|
|
6170
|
+
at?.canvasSize && t(() => {
|
|
6171
|
+
const rt = at.canvasSize();
|
|
6223
6172
|
rt && rt.width > 0 && rt.height > 0 && E.set([rt.width, rt.height]);
|
|
6224
6173
|
});
|
|
6225
6174
|
});
|
|
6226
|
-
const
|
|
6227
|
-
let
|
|
6175
|
+
const I = typeof e == "function" ? e : $(e), F = typeof i == "function" ? i : $(i), B = typeof s == "function" ? s : $(s), N = typeof c == "function" ? c : $(c), P = typeof a == "function" ? a : $(a), m = typeof o == "function" ? o : $(o), v = typeof g == "function" ? g : $(g);
|
|
6176
|
+
let _, d;
|
|
6228
6177
|
if (t() === "rain")
|
|
6229
|
-
|
|
6178
|
+
_ = Dr(), d = {
|
|
6230
6179
|
uTime: { value: 0, type: "f32" },
|
|
6231
6180
|
uResolution: { value: S(), type: "vec2<f32>" },
|
|
6232
|
-
uRainSpeed: { value:
|
|
6181
|
+
uRainSpeed: { value: I(), type: "f32" },
|
|
6233
6182
|
uWindDirection: { value: F(), type: "f32" },
|
|
6234
6183
|
uWindStrength: { value: B(), type: "f32" },
|
|
6235
|
-
uRainDensity: { value:
|
|
6184
|
+
uRainDensity: { value: N(), type: "f32" },
|
|
6236
6185
|
uMaxDrops: { value: P(), type: "f32" }
|
|
6237
6186
|
};
|
|
6238
6187
|
else if (t() === "snow")
|
|
6239
|
-
|
|
6188
|
+
_ = Pr(), d = {
|
|
6240
6189
|
uTime: { value: 0, type: "f32" },
|
|
6241
6190
|
uResolution: { value: S(), type: "vec2<f32>" },
|
|
6242
|
-
uSnowSpeed: { value:
|
|
6191
|
+
uSnowSpeed: { value: I(), type: "f32" },
|
|
6243
6192
|
uWindDirection: { value: F(), type: "f32" },
|
|
6244
6193
|
uWindStrength: { value: B(), type: "f32" },
|
|
6245
|
-
uSnowDensity: { value:
|
|
6194
|
+
uSnowDensity: { value: N(), type: "f32" },
|
|
6246
6195
|
uMaxFlakes: { value: P(), type: "f32" }
|
|
6247
6196
|
};
|
|
6248
6197
|
else if (t() === "fog")
|
|
6249
|
-
|
|
6198
|
+
_ = Or(), d = {
|
|
6199
|
+
uTime: { value: 0, type: "f32" },
|
|
6200
|
+
uResolution: { value: S(), type: "vec2<f32>" },
|
|
6201
|
+
uSpeed: { value: I(), type: "f32" },
|
|
6202
|
+
uScale: { value: v(), type: "f32" },
|
|
6203
|
+
uDensity: { value: N(), type: "f32" },
|
|
6204
|
+
uHeight: { value: m(), type: "f32" }
|
|
6205
|
+
};
|
|
6206
|
+
else if (t() === "cloud")
|
|
6207
|
+
_ = Rr(), d = {
|
|
6250
6208
|
uTime: { value: 0, type: "f32" },
|
|
6251
6209
|
uResolution: { value: S(), type: "vec2<f32>" },
|
|
6252
|
-
uSpeed: { value:
|
|
6210
|
+
uSpeed: { value: I(), type: "f32" },
|
|
6253
6211
|
uScale: { value: v(), type: "f32" },
|
|
6254
|
-
uDensity: { value:
|
|
6212
|
+
uDensity: { value: N(), type: "f32" },
|
|
6213
|
+
uHeight: { value: m(), type: "f32" }
|
|
6255
6214
|
};
|
|
6256
6215
|
else
|
|
6257
|
-
throw new Error(`Unknown weather effect: ${t()}. Supported: rain, snow, fog`);
|
|
6258
|
-
const b = new
|
|
6259
|
-
glProgram:
|
|
6216
|
+
throw new Error(`Unknown weather effect: ${t()}. Supported: rain, snow, fog, cloud`);
|
|
6217
|
+
const b = new ie(d), D = new Ce({
|
|
6218
|
+
glProgram: _,
|
|
6260
6219
|
resources: { uniforms: b }
|
|
6261
6220
|
}), O = new ti({
|
|
6262
6221
|
attributes: {
|
|
@@ -6265,55 +6224,55 @@ const Rr = (h) => {
|
|
|
6265
6224
|
},
|
|
6266
6225
|
indexBuffer: [0, 1, 2, 0, 2, 3]
|
|
6267
6226
|
});
|
|
6268
|
-
let R = Math.random() * 10, y = [...S()],
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
const k = S();
|
|
6274
|
-
(k[0] !== y[0] || k[1] !== y[1]) && (b.uniforms.uResolution = k, y = [...k]);
|
|
6227
|
+
let R = Math.random() * 10, y = [...S()], k = F(), et = B(), G = I(), j = N(), lt = P(), nt = m(), ft = v();
|
|
6228
|
+
return Ae(({ deltaTime: L }) => {
|
|
6229
|
+
R += L / 600, b.uniforms.uTime = R;
|
|
6230
|
+
const at = S();
|
|
6231
|
+
(at[0] !== y[0] || at[1] !== y[1]) && (b.uniforms.uResolution = at, y = [...at]);
|
|
6275
6232
|
const rt = F();
|
|
6276
|
-
if (rt !==
|
|
6233
|
+
if (rt !== k && (b.uniforms.uWindDirection = rt, k = rt), t() === "rain" || t() === "snow") {
|
|
6277
6234
|
const W = B();
|
|
6278
|
-
W !==
|
|
6235
|
+
W !== et && (b.uniforms.uWindStrength = W, et = W);
|
|
6279
6236
|
}
|
|
6280
6237
|
if (t() === "rain") {
|
|
6281
|
-
const W =
|
|
6282
|
-
W !==
|
|
6283
|
-
const
|
|
6284
|
-
|
|
6285
|
-
const
|
|
6286
|
-
|
|
6238
|
+
const W = I();
|
|
6239
|
+
W !== G && (b.uniforms.uRainSpeed = W, G = W);
|
|
6240
|
+
const U = N();
|
|
6241
|
+
U !== j && (b.uniforms.uRainDensity = U, j = U);
|
|
6242
|
+
const X = P();
|
|
6243
|
+
X !== lt && (b.uniforms.uMaxDrops = X, lt = X);
|
|
6287
6244
|
} else if (t() === "snow") {
|
|
6288
|
-
const W =
|
|
6289
|
-
W !==
|
|
6290
|
-
const
|
|
6291
|
-
|
|
6292
|
-
const
|
|
6293
|
-
|
|
6294
|
-
} else if (t() === "fog") {
|
|
6295
|
-
const W =
|
|
6296
|
-
W !==
|
|
6297
|
-
const
|
|
6298
|
-
|
|
6299
|
-
const
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6245
|
+
const W = I();
|
|
6246
|
+
W !== G && (b.uniforms.uSnowSpeed = W, G = W);
|
|
6247
|
+
const U = N();
|
|
6248
|
+
U !== j && (b.uniforms.uSnowDensity = U, j = U);
|
|
6249
|
+
const X = P();
|
|
6250
|
+
X !== lt && (b.uniforms.uMaxFlakes = X, lt = X);
|
|
6251
|
+
} else if (t() === "fog" || t() === "cloud") {
|
|
6252
|
+
const W = I();
|
|
6253
|
+
W !== G && (b.uniforms.uSpeed = W, G = W);
|
|
6254
|
+
const U = v();
|
|
6255
|
+
U !== ft && (b.uniforms.uScale = U, ft = U);
|
|
6256
|
+
const X = N();
|
|
6257
|
+
X !== j && (b.uniforms.uDensity = X, j = X);
|
|
6258
|
+
const pt = m();
|
|
6259
|
+
pt !== nt && (b.uniforms.uHeight = pt, nt = pt);
|
|
6260
|
+
}
|
|
6261
|
+
}), ht(bi, {
|
|
6303
6262
|
geometry: O,
|
|
6304
|
-
shader:
|
|
6263
|
+
shader: D,
|
|
6305
6264
|
width: "100%",
|
|
6306
6265
|
height: "100%"
|
|
6307
6266
|
});
|
|
6308
|
-
}, Wr =
|
|
6267
|
+
}, Wr = Ur;
|
|
6309
6268
|
export {
|
|
6310
|
-
|
|
6311
|
-
|
|
6269
|
+
Xr as Bar,
|
|
6270
|
+
Gr as LightSpot,
|
|
6312
6271
|
qr as Loading,
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6272
|
+
Kr as NightAmbiant,
|
|
6273
|
+
Vr as Particle,
|
|
6274
|
+
$r as TiledMap,
|
|
6316
6275
|
Wr as Weather,
|
|
6317
|
-
|
|
6276
|
+
Ur as WeatherEffect
|
|
6318
6277
|
};
|
|
6319
6278
|
//# sourceMappingURL=index.js.map
|