@vunk/plus 1.13.0 → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,13 +1,462 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
import { TickerStatus as
|
|
3
|
-
import { TickerStatus as
|
|
4
|
-
import { Deferred as
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { useModelComputed as Q, useDeferred as he } from "@vunk/core/composables";
|
|
1
|
+
import { inject as fe, provide as de, watchEffect as B, onBeforeUnmount as S, defineComponent as C, useId as ne, ref as U, onMounted as ae, renderSlot as V, watch as Q, computed as J, createElementBlock as me, openBlock as H, resolveComponent as K, createBlock as Y, withCtx as he, createVNode as ve } from "vue";
|
|
2
|
+
import { TickerStatus as m } from "@vunk/shared/enum";
|
|
3
|
+
import { TickerStatus as Ye } from "@vunk/shared/enum";
|
|
4
|
+
import { Deferred as ge, sleep as Z } from "@vunk/shared/promise";
|
|
5
|
+
import { Application as _e, Sprite as ye, Assets as R, Texture as ee, ImageSource as oe, BufferImageSource as we } from "pixi.js";
|
|
6
|
+
import { pickObject as se } from "@vunk/shared/object";
|
|
7
|
+
import { useModelComputed as ie, useDeferred as be } from "@vunk/core/composables";
|
|
9
8
|
import { _ as xe } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
10
|
-
|
|
9
|
+
function Fe(o) {
|
|
10
|
+
return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
|
|
11
|
+
}
|
|
12
|
+
var X = { exports: {} }, ke = X.exports, ue;
|
|
13
|
+
function Pe() {
|
|
14
|
+
return ue || (ue = 1, (function(o, P) {
|
|
15
|
+
(function(r, p) {
|
|
16
|
+
o.exports = p();
|
|
17
|
+
})(ke, function() {
|
|
18
|
+
return (
|
|
19
|
+
/******/
|
|
20
|
+
(function(t) {
|
|
21
|
+
var r = {};
|
|
22
|
+
function p(l) {
|
|
23
|
+
if (r[l])
|
|
24
|
+
return r[l].exports;
|
|
25
|
+
var v = r[l] = {
|
|
26
|
+
/******/
|
|
27
|
+
exports: {},
|
|
28
|
+
/******/
|
|
29
|
+
id: l,
|
|
30
|
+
/******/
|
|
31
|
+
loaded: !1
|
|
32
|
+
/******/
|
|
33
|
+
};
|
|
34
|
+
return t[l].call(v.exports, v, v.exports, p), v.loaded = !0, v.exports;
|
|
35
|
+
}
|
|
36
|
+
return p.m = t, p.c = r, p.p = "", p(0);
|
|
37
|
+
})([
|
|
38
|
+
/* 0 */
|
|
39
|
+
/***/
|
|
40
|
+
(function(t, r, p) {
|
|
41
|
+
Object.defineProperty(r, "__esModule", {
|
|
42
|
+
value: !0
|
|
43
|
+
}), r.isNotPNG = a, r.isNotAPNG = u, r.default = s;
|
|
44
|
+
var l = p(1), v = w(l), _ = p(2);
|
|
45
|
+
function w(f) {
|
|
46
|
+
return f && f.__esModule ? f : { default: f };
|
|
47
|
+
}
|
|
48
|
+
var e = new Error("Not a PNG"), n = new Error("Not an animated PNG");
|
|
49
|
+
function a(f) {
|
|
50
|
+
return f === e;
|
|
51
|
+
}
|
|
52
|
+
function u(f) {
|
|
53
|
+
return f === n;
|
|
54
|
+
}
|
|
55
|
+
var i = new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10]);
|
|
56
|
+
function s(f) {
|
|
57
|
+
var g = new Uint8Array(f);
|
|
58
|
+
if (Array.prototype.some.call(i, function(T, D) {
|
|
59
|
+
return T !== g[D];
|
|
60
|
+
}))
|
|
61
|
+
return e;
|
|
62
|
+
var c = !1;
|
|
63
|
+
if (b(g, function(T) {
|
|
64
|
+
return !(c = T === "acTL");
|
|
65
|
+
}), !c)
|
|
66
|
+
return n;
|
|
67
|
+
var x = [], I = [], N = null, k = null, M = 0, O = new _.APNG();
|
|
68
|
+
if (b(g, function(T, D, E, $) {
|
|
69
|
+
var L = new DataView(D.buffer);
|
|
70
|
+
switch (T) {
|
|
71
|
+
case "IHDR":
|
|
72
|
+
N = D.subarray(E + 8, E + 8 + $), O.width = L.getUint32(E + 8), O.height = L.getUint32(E + 12);
|
|
73
|
+
break;
|
|
74
|
+
case "acTL":
|
|
75
|
+
O.numPlays = L.getUint32(E + 8 + 4);
|
|
76
|
+
break;
|
|
77
|
+
case "fcTL":
|
|
78
|
+
k && (O.frames.push(k), M++), k = new _.Frame(), k.width = L.getUint32(E + 8 + 4), k.height = L.getUint32(E + 8 + 8), k.left = L.getUint32(E + 8 + 12), k.top = L.getUint32(E + 8 + 16);
|
|
79
|
+
var pe = L.getUint16(E + 8 + 20), te = L.getUint16(E + 8 + 22);
|
|
80
|
+
te === 0 && (te = 100), k.delay = 1e3 * pe / te, k.delay <= 10 && (k.delay = 100), O.playTime += k.delay, k.disposeOp = L.getUint8(E + 8 + 24), k.blendOp = L.getUint8(E + 8 + 25), k.dataParts = [], M === 0 && k.disposeOp === 2 && (k.disposeOp = 1);
|
|
81
|
+
break;
|
|
82
|
+
case "fdAT":
|
|
83
|
+
k && k.dataParts.push(D.subarray(E + 8 + 4, E + 8 + $));
|
|
84
|
+
break;
|
|
85
|
+
case "IDAT":
|
|
86
|
+
k && k.dataParts.push(D.subarray(E + 8, E + 8 + $));
|
|
87
|
+
break;
|
|
88
|
+
case "IEND":
|
|
89
|
+
I.push(y(D, E, 12 + $));
|
|
90
|
+
break;
|
|
91
|
+
default:
|
|
92
|
+
x.push(y(D, E, 12 + $));
|
|
93
|
+
}
|
|
94
|
+
}), k && O.frames.push(k), O.frames.length == 0)
|
|
95
|
+
return n;
|
|
96
|
+
var G = new Blob(x), W = new Blob(I);
|
|
97
|
+
return O.frames.forEach(function(T) {
|
|
98
|
+
var D = [];
|
|
99
|
+
D.push(i), N.set(d(T.width), 0), N.set(d(T.height), 4), D.push(F("IHDR", N)), D.push(G), T.dataParts.forEach(function(E) {
|
|
100
|
+
return D.push(F("IDAT", E));
|
|
101
|
+
}), D.push(W), T.imageData = new Blob(D, { type: "image/png" }), delete T.dataParts, D = null;
|
|
102
|
+
}), O;
|
|
103
|
+
}
|
|
104
|
+
function b(f, g) {
|
|
105
|
+
var c = new DataView(f.buffer), x = 8, I = void 0, N = void 0, k = void 0;
|
|
106
|
+
do
|
|
107
|
+
N = c.getUint32(x), I = h(f, x + 4, 4), k = g(I, f, x, N), x += 12 + N;
|
|
108
|
+
while (k !== !1 && I != "IEND" && x < f.length);
|
|
109
|
+
}
|
|
110
|
+
function h(f, g, c) {
|
|
111
|
+
var x = Array.prototype.slice.call(f.subarray(g, g + c));
|
|
112
|
+
return String.fromCharCode.apply(String, x);
|
|
113
|
+
}
|
|
114
|
+
function A(f) {
|
|
115
|
+
for (var g = new Uint8Array(f.length), c = 0; c < f.length; c++)
|
|
116
|
+
g[c] = f.charCodeAt(c);
|
|
117
|
+
return g;
|
|
118
|
+
}
|
|
119
|
+
function y(f, g, c) {
|
|
120
|
+
var x = new Uint8Array(c);
|
|
121
|
+
return x.set(f.subarray(g, g + c)), x;
|
|
122
|
+
}
|
|
123
|
+
var F = function(g, c) {
|
|
124
|
+
var x = g.length + c.length, I = new Uint8Array(x + 8), N = new DataView(I.buffer);
|
|
125
|
+
N.setUint32(0, c.length), I.set(A(g), 4), I.set(c, 8);
|
|
126
|
+
var k = (0, v.default)(I, 4, x);
|
|
127
|
+
return N.setUint32(x + 4, k), I;
|
|
128
|
+
}, d = function(g) {
|
|
129
|
+
return new Uint8Array([g >>> 24 & 255, g >>> 16 & 255, g >>> 8 & 255, g & 255]);
|
|
130
|
+
};
|
|
131
|
+
}),
|
|
132
|
+
/* 1 */
|
|
133
|
+
/***/
|
|
134
|
+
(function(t, r) {
|
|
135
|
+
Object.defineProperty(r, "__esModule", {
|
|
136
|
+
value: !0
|
|
137
|
+
}), r.default = function(w) {
|
|
138
|
+
for (var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : w.length - e, a = -1, u = e, i = e + n; u < i; u++)
|
|
139
|
+
a = a >>> 8 ^ p[(a ^ w[u]) & 255];
|
|
140
|
+
return a ^ -1;
|
|
141
|
+
};
|
|
142
|
+
for (var p = new Uint32Array(256), l = 0; l < 256; l++) {
|
|
143
|
+
for (var v = l, _ = 0; _ < 8; _++)
|
|
144
|
+
v = (v & 1) !== 0 ? 3988292384 ^ v >>> 1 : v >>> 1;
|
|
145
|
+
p[l] = v;
|
|
146
|
+
}
|
|
147
|
+
}),
|
|
148
|
+
/* 2 */
|
|
149
|
+
/***/
|
|
150
|
+
(function(t, r, p) {
|
|
151
|
+
Object.defineProperty(r, "__esModule", {
|
|
152
|
+
value: !0
|
|
153
|
+
}), r.Frame = r.APNG = void 0;
|
|
154
|
+
var l = /* @__PURE__ */ (function() {
|
|
155
|
+
function n(a, u) {
|
|
156
|
+
for (var i = 0; i < u.length; i++) {
|
|
157
|
+
var s = u[i];
|
|
158
|
+
s.enumerable = s.enumerable || !1, s.configurable = !0, "value" in s && (s.writable = !0), Object.defineProperty(a, s.key, s);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return function(a, u, i) {
|
|
162
|
+
return u && n(a.prototype, u), i && n(a, i), a;
|
|
163
|
+
};
|
|
164
|
+
})(), v = p(3), _ = w(v);
|
|
165
|
+
function w(n) {
|
|
166
|
+
return n && n.__esModule ? n : { default: n };
|
|
167
|
+
}
|
|
168
|
+
function e(n, a) {
|
|
169
|
+
if (!(n instanceof a))
|
|
170
|
+
throw new TypeError("Cannot call a class as a function");
|
|
171
|
+
}
|
|
172
|
+
r.APNG = (function() {
|
|
173
|
+
function n() {
|
|
174
|
+
e(this, n), this.width = 0, this.height = 0, this.numPlays = 0, this.playTime = 0, this.frames = [];
|
|
175
|
+
}
|
|
176
|
+
return l(n, [{
|
|
177
|
+
key: "createImages",
|
|
178
|
+
/**
|
|
179
|
+
*
|
|
180
|
+
* @return {Promise.<*>}
|
|
181
|
+
*/
|
|
182
|
+
value: function() {
|
|
183
|
+
return Promise.all(this.frames.map(function(u) {
|
|
184
|
+
return u.createImage();
|
|
185
|
+
}));
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
*
|
|
189
|
+
* @param {CanvasRenderingContext2D} context
|
|
190
|
+
* @param {boolean} autoPlay
|
|
191
|
+
* @return {Promise.<Player>}
|
|
192
|
+
*/
|
|
193
|
+
}, {
|
|
194
|
+
key: "getPlayer",
|
|
195
|
+
value: function(u) {
|
|
196
|
+
var i = this, s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
197
|
+
return this.createImages().then(function() {
|
|
198
|
+
return new _.default(i, u, s);
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}]), n;
|
|
202
|
+
})(), r.Frame = (function() {
|
|
203
|
+
function n() {
|
|
204
|
+
e(this, n), this.left = 0, this.top = 0, this.width = 0, this.height = 0, this.delay = 0, this.disposeOp = 0, this.blendOp = 0, this.imageData = null, this.imageElement = null;
|
|
205
|
+
}
|
|
206
|
+
return l(n, [{
|
|
207
|
+
key: "createImage",
|
|
208
|
+
value: function() {
|
|
209
|
+
var u = this;
|
|
210
|
+
return this.imageElement ? Promise.resolve() : new Promise(function(i, s) {
|
|
211
|
+
var b = URL.createObjectURL(u.imageData);
|
|
212
|
+
u.imageElement = document.createElement("img"), u.imageElement.onload = function() {
|
|
213
|
+
URL.revokeObjectURL(b), i();
|
|
214
|
+
}, u.imageElement.onerror = function() {
|
|
215
|
+
URL.revokeObjectURL(b), u.imageElement = null, s(new Error("Image creation error"));
|
|
216
|
+
}, u.imageElement.src = b;
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
}]), n;
|
|
220
|
+
})();
|
|
221
|
+
}),
|
|
222
|
+
/* 3 */
|
|
223
|
+
/***/
|
|
224
|
+
(function(t, r, p) {
|
|
225
|
+
Object.defineProperty(r, "__esModule", {
|
|
226
|
+
value: !0
|
|
227
|
+
});
|
|
228
|
+
var l = /* @__PURE__ */ (function() {
|
|
229
|
+
function i(s, b) {
|
|
230
|
+
for (var h = 0; h < b.length; h++) {
|
|
231
|
+
var A = b[h];
|
|
232
|
+
A.enumerable = A.enumerable || !1, A.configurable = !0, "value" in A && (A.writable = !0), Object.defineProperty(s, A.key, A);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return function(s, b, h) {
|
|
236
|
+
return b && i(s.prototype, b), h && i(s, h), s;
|
|
237
|
+
};
|
|
238
|
+
})(), v = p(4), _ = w(v);
|
|
239
|
+
function w(i) {
|
|
240
|
+
return i && i.__esModule ? i : { default: i };
|
|
241
|
+
}
|
|
242
|
+
function e(i, s) {
|
|
243
|
+
if (!(i instanceof s))
|
|
244
|
+
throw new TypeError("Cannot call a class as a function");
|
|
245
|
+
}
|
|
246
|
+
function n(i, s) {
|
|
247
|
+
if (!i)
|
|
248
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
249
|
+
return s && (typeof s == "object" || typeof s == "function") ? s : i;
|
|
250
|
+
}
|
|
251
|
+
function a(i, s) {
|
|
252
|
+
if (typeof s != "function" && s !== null)
|
|
253
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof s);
|
|
254
|
+
i.prototype = Object.create(s && s.prototype, { constructor: { value: i, enumerable: !1, writable: !0, configurable: !0 } }), s && (Object.setPrototypeOf ? Object.setPrototypeOf(i, s) : i.__proto__ = s);
|
|
255
|
+
}
|
|
256
|
+
var u = (function(i) {
|
|
257
|
+
a(s, i);
|
|
258
|
+
function s(b, h, A) {
|
|
259
|
+
e(this, s);
|
|
260
|
+
var y = n(this, (s.__proto__ || Object.getPrototypeOf(s)).call(this));
|
|
261
|
+
return y.playbackRate = 1, y._currentFrameNumber = 0, y._ended = !1, y._paused = !0, y._numPlays = 0, y._rafId = null, y._apng = b, y.context = h, y.stop(), A && y.play(), y;
|
|
262
|
+
}
|
|
263
|
+
return l(s, [{
|
|
264
|
+
key: "renderNextFrame",
|
|
265
|
+
value: function() {
|
|
266
|
+
this._currentFrameNumber = (this._currentFrameNumber + 1) % this._apng.frames.length, this._currentFrameNumber === this._apng.frames.length - 1 && (this._numPlays++, this._apng.numPlays !== 0 && this._numPlays >= this._apng.numPlays && (this._ended = !0, this._paused = !0)), this._prevFrame && this._prevFrame.disposeOp == 1 ? this.context.clearRect(this._prevFrame.left, this._prevFrame.top, this._prevFrame.width, this._prevFrame.height) : this._prevFrame && this._prevFrame.disposeOp == 2 && this.context.putImageData(this._prevFrameData, this._prevFrame.left, this._prevFrame.top);
|
|
267
|
+
var h = this.currentFrame;
|
|
268
|
+
this._prevFrame = h, this._prevFrameData = null, h.disposeOp == 2 && (this._prevFrameData = this.context.getImageData(h.left, h.top, h.width, h.height)), h.blendOp == 0 && this.context.clearRect(h.left, h.top, h.width, h.height), this.context.drawImage(h.imageElement, h.left, h.top), this.emit("frame", this._currentFrameNumber), this._ended && this.emit("end");
|
|
269
|
+
}
|
|
270
|
+
// playback
|
|
271
|
+
}, {
|
|
272
|
+
key: "play",
|
|
273
|
+
value: function() {
|
|
274
|
+
var h = this;
|
|
275
|
+
this._rafId && cancelAnimationFrame(this._rafId), this.emit("play"), this._ended && this.stop(), this._paused = !1;
|
|
276
|
+
var A = performance.now() + this.currentFrame.delay / this.playbackRate, y = function F(d) {
|
|
277
|
+
if (!(h._ended || h._paused)) {
|
|
278
|
+
if (d >= A) {
|
|
279
|
+
for (; d - A >= h._apng.playTime / h.playbackRate; )
|
|
280
|
+
A += h._apng.playTime / h.playbackRate, h._numPlays++;
|
|
281
|
+
do
|
|
282
|
+
h.renderNextFrame(), A += h.currentFrame.delay / h.playbackRate;
|
|
283
|
+
while (!h._ended && !h._paused && d > A);
|
|
284
|
+
}
|
|
285
|
+
h._rafId = requestAnimationFrame(F);
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
this._rafId = requestAnimationFrame(y);
|
|
289
|
+
}
|
|
290
|
+
}, {
|
|
291
|
+
key: "pause",
|
|
292
|
+
value: function() {
|
|
293
|
+
this._paused || (this._rafId && (cancelAnimationFrame(this._rafId), this._rafId = null), this.emit("pause"), this._paused = !0);
|
|
294
|
+
}
|
|
295
|
+
}, {
|
|
296
|
+
key: "stop",
|
|
297
|
+
value: function() {
|
|
298
|
+
this._rafId && (cancelAnimationFrame(this._rafId), this._rafId = null), this.emit("stop"), this._numPlays = 0, this._ended = !1, this._paused = !0, this._currentFrameNumber = -1, this.context.clearRect(0, 0, this._apng.width, this._apng.height), this.renderNextFrame();
|
|
299
|
+
}
|
|
300
|
+
}, {
|
|
301
|
+
key: "currentFrameNumber",
|
|
302
|
+
get: function() {
|
|
303
|
+
return this._currentFrameNumber;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
*
|
|
307
|
+
* @return {Frame}
|
|
308
|
+
*/
|
|
309
|
+
}, {
|
|
310
|
+
key: "currentFrame",
|
|
311
|
+
get: function() {
|
|
312
|
+
return this._apng.frames[this._currentFrameNumber];
|
|
313
|
+
}
|
|
314
|
+
}, {
|
|
315
|
+
key: "paused",
|
|
316
|
+
get: function() {
|
|
317
|
+
return this._paused;
|
|
318
|
+
}
|
|
319
|
+
}, {
|
|
320
|
+
key: "ended",
|
|
321
|
+
get: function() {
|
|
322
|
+
return this._ended;
|
|
323
|
+
}
|
|
324
|
+
}]), s;
|
|
325
|
+
})(_.default);
|
|
326
|
+
r.default = u;
|
|
327
|
+
}),
|
|
328
|
+
/* 4 */
|
|
329
|
+
/***/
|
|
330
|
+
(function(t, r) {
|
|
331
|
+
function p() {
|
|
332
|
+
this._events = this._events || {}, this._maxListeners = this._maxListeners || void 0;
|
|
333
|
+
}
|
|
334
|
+
t.exports = p, p.EventEmitter = p, p.prototype._events = void 0, p.prototype._maxListeners = void 0, p.defaultMaxListeners = 10, p.prototype.setMaxListeners = function(e) {
|
|
335
|
+
if (!v(e) || e < 0 || isNaN(e))
|
|
336
|
+
throw TypeError("n must be a positive number");
|
|
337
|
+
return this._maxListeners = e, this;
|
|
338
|
+
}, p.prototype.emit = function(e) {
|
|
339
|
+
var n, a, u, i, s, b;
|
|
340
|
+
if (this._events || (this._events = {}), e === "error" && (!this._events.error || _(this._events.error) && !this._events.error.length)) {
|
|
341
|
+
if (n = arguments[1], n instanceof Error)
|
|
342
|
+
throw n;
|
|
343
|
+
var h = new Error('Uncaught, unspecified "error" event. (' + n + ")");
|
|
344
|
+
throw h.context = n, h;
|
|
345
|
+
}
|
|
346
|
+
if (a = this._events[e], w(a))
|
|
347
|
+
return !1;
|
|
348
|
+
if (l(a))
|
|
349
|
+
switch (arguments.length) {
|
|
350
|
+
// fast cases
|
|
351
|
+
case 1:
|
|
352
|
+
a.call(this);
|
|
353
|
+
break;
|
|
354
|
+
case 2:
|
|
355
|
+
a.call(this, arguments[1]);
|
|
356
|
+
break;
|
|
357
|
+
case 3:
|
|
358
|
+
a.call(this, arguments[1], arguments[2]);
|
|
359
|
+
break;
|
|
360
|
+
// slower
|
|
361
|
+
default:
|
|
362
|
+
i = Array.prototype.slice.call(arguments, 1), a.apply(this, i);
|
|
363
|
+
}
|
|
364
|
+
else if (_(a))
|
|
365
|
+
for (i = Array.prototype.slice.call(arguments, 1), b = a.slice(), u = b.length, s = 0; s < u; s++)
|
|
366
|
+
b[s].apply(this, i);
|
|
367
|
+
return !0;
|
|
368
|
+
}, p.prototype.addListener = function(e, n) {
|
|
369
|
+
var a;
|
|
370
|
+
if (!l(n))
|
|
371
|
+
throw TypeError("listener must be a function");
|
|
372
|
+
return this._events || (this._events = {}), this._events.newListener && this.emit(
|
|
373
|
+
"newListener",
|
|
374
|
+
e,
|
|
375
|
+
l(n.listener) ? n.listener : n
|
|
376
|
+
), this._events[e] ? _(this._events[e]) ? this._events[e].push(n) : this._events[e] = [this._events[e], n] : this._events[e] = n, _(this._events[e]) && !this._events[e].warned && (w(this._maxListeners) ? a = p.defaultMaxListeners : a = this._maxListeners, a && a > 0 && this._events[e].length > a && (this._events[e].warned = !0, console.error(
|
|
377
|
+
"(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",
|
|
378
|
+
this._events[e].length
|
|
379
|
+
), typeof console.trace == "function" && console.trace())), this;
|
|
380
|
+
}, p.prototype.on = p.prototype.addListener, p.prototype.once = function(e, n) {
|
|
381
|
+
if (!l(n))
|
|
382
|
+
throw TypeError("listener must be a function");
|
|
383
|
+
var a = !1;
|
|
384
|
+
function u() {
|
|
385
|
+
this.removeListener(e, u), a || (a = !0, n.apply(this, arguments));
|
|
386
|
+
}
|
|
387
|
+
return u.listener = n, this.on(e, u), this;
|
|
388
|
+
}, p.prototype.removeListener = function(e, n) {
|
|
389
|
+
var a, u, i, s;
|
|
390
|
+
if (!l(n))
|
|
391
|
+
throw TypeError("listener must be a function");
|
|
392
|
+
if (!this._events || !this._events[e])
|
|
393
|
+
return this;
|
|
394
|
+
if (a = this._events[e], i = a.length, u = -1, a === n || l(a.listener) && a.listener === n)
|
|
395
|
+
delete this._events[e], this._events.removeListener && this.emit("removeListener", e, n);
|
|
396
|
+
else if (_(a)) {
|
|
397
|
+
for (s = i; s-- > 0; )
|
|
398
|
+
if (a[s] === n || a[s].listener && a[s].listener === n) {
|
|
399
|
+
u = s;
|
|
400
|
+
break;
|
|
401
|
+
}
|
|
402
|
+
if (u < 0)
|
|
403
|
+
return this;
|
|
404
|
+
a.length === 1 ? (a.length = 0, delete this._events[e]) : a.splice(u, 1), this._events.removeListener && this.emit("removeListener", e, n);
|
|
405
|
+
}
|
|
406
|
+
return this;
|
|
407
|
+
}, p.prototype.removeAllListeners = function(e) {
|
|
408
|
+
var n, a;
|
|
409
|
+
if (!this._events)
|
|
410
|
+
return this;
|
|
411
|
+
if (!this._events.removeListener)
|
|
412
|
+
return arguments.length === 0 ? this._events = {} : this._events[e] && delete this._events[e], this;
|
|
413
|
+
if (arguments.length === 0) {
|
|
414
|
+
for (n in this._events)
|
|
415
|
+
n !== "removeListener" && this.removeAllListeners(n);
|
|
416
|
+
return this.removeAllListeners("removeListener"), this._events = {}, this;
|
|
417
|
+
}
|
|
418
|
+
if (a = this._events[e], l(a))
|
|
419
|
+
this.removeListener(e, a);
|
|
420
|
+
else if (a)
|
|
421
|
+
for (; a.length; )
|
|
422
|
+
this.removeListener(e, a[a.length - 1]);
|
|
423
|
+
return delete this._events[e], this;
|
|
424
|
+
}, p.prototype.listeners = function(e) {
|
|
425
|
+
var n;
|
|
426
|
+
return !this._events || !this._events[e] ? n = [] : l(this._events[e]) ? n = [this._events[e]] : n = this._events[e].slice(), n;
|
|
427
|
+
}, p.prototype.listenerCount = function(e) {
|
|
428
|
+
if (this._events) {
|
|
429
|
+
var n = this._events[e];
|
|
430
|
+
if (l(n))
|
|
431
|
+
return 1;
|
|
432
|
+
if (n)
|
|
433
|
+
return n.length;
|
|
434
|
+
}
|
|
435
|
+
return 0;
|
|
436
|
+
}, p.listenerCount = function(e, n) {
|
|
437
|
+
return e.listenerCount(n);
|
|
438
|
+
};
|
|
439
|
+
function l(e) {
|
|
440
|
+
return typeof e == "function";
|
|
441
|
+
}
|
|
442
|
+
function v(e) {
|
|
443
|
+
return typeof e == "number";
|
|
444
|
+
}
|
|
445
|
+
function _(e) {
|
|
446
|
+
return typeof e == "object" && e !== null;
|
|
447
|
+
}
|
|
448
|
+
function w(e) {
|
|
449
|
+
return e === void 0;
|
|
450
|
+
}
|
|
451
|
+
})
|
|
452
|
+
/******/
|
|
453
|
+
])
|
|
454
|
+
);
|
|
455
|
+
});
|
|
456
|
+
})(X)), X.exports;
|
|
457
|
+
}
|
|
458
|
+
var Ae = Pe();
|
|
459
|
+
const Ee = /* @__PURE__ */ Fe(Ae), q = {
|
|
11
460
|
url: {
|
|
12
461
|
type: String,
|
|
13
462
|
requierd: !1
|
|
@@ -28,7 +477,7 @@ const V = {
|
|
|
28
477
|
*/
|
|
29
478
|
status: {
|
|
30
479
|
type: String,
|
|
31
|
-
default:
|
|
480
|
+
default: m.pending
|
|
32
481
|
},
|
|
33
482
|
frameRate: {
|
|
34
483
|
type: Number,
|
|
@@ -53,157 +502,157 @@ const V = {
|
|
|
53
502
|
type: Boolean,
|
|
54
503
|
default: !0
|
|
55
504
|
}
|
|
56
|
-
},
|
|
505
|
+
}, j = {
|
|
57
506
|
"update:status": null,
|
|
58
507
|
"update:data": null,
|
|
59
508
|
setData: null
|
|
60
|
-
},
|
|
61
|
-
function
|
|
62
|
-
const
|
|
63
|
-
whenDef:
|
|
64
|
-
when: () =>
|
|
509
|
+
}, le = /* @__PURE__ */ Symbol("appInjectKey");
|
|
510
|
+
function Ie() {
|
|
511
|
+
const o = new _e(), P = new ge(), t = {
|
|
512
|
+
whenDef: P,
|
|
513
|
+
when: () => P.promise
|
|
65
514
|
};
|
|
66
|
-
return le
|
|
67
|
-
application:
|
|
68
|
-
context:
|
|
69
|
-
}), { application:
|
|
515
|
+
return de(le, {
|
|
516
|
+
application: o,
|
|
517
|
+
context: t
|
|
518
|
+
}), { application: o, context: t };
|
|
70
519
|
}
|
|
71
|
-
function
|
|
72
|
-
const
|
|
73
|
-
if (!
|
|
520
|
+
function ce() {
|
|
521
|
+
const o = fe(le);
|
|
522
|
+
if (!o)
|
|
74
523
|
throw new Error("Pixi app not provided");
|
|
75
|
-
return
|
|
524
|
+
return o;
|
|
76
525
|
}
|
|
77
|
-
function
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
l.visible =
|
|
81
|
-
}),
|
|
82
|
-
|
|
83
|
-
}),
|
|
84
|
-
l.texture && (
|
|
526
|
+
function z(o) {
|
|
527
|
+
const P = o.autoResize ?? !0, t = o.resize ?? _, { application: r, context: p } = ce(), l = new ye();
|
|
528
|
+
r.stage.addChild(l), B(() => {
|
|
529
|
+
l.visible = o.visible ?? !0;
|
|
530
|
+
}), B(() => {
|
|
531
|
+
o.label && (l.label = o.label);
|
|
532
|
+
}), P && p.when().then((w) => {
|
|
533
|
+
l.texture && (v(), w.renderer.on("resize", v));
|
|
85
534
|
});
|
|
86
|
-
function
|
|
87
|
-
if (!
|
|
535
|
+
function v() {
|
|
536
|
+
if (!r.renderer?.screen)
|
|
88
537
|
return;
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
application:
|
|
538
|
+
const w = l.texture._meta;
|
|
539
|
+
t({
|
|
540
|
+
application: r,
|
|
92
541
|
sprite: l,
|
|
93
|
-
meta:
|
|
542
|
+
meta: w
|
|
94
543
|
});
|
|
95
544
|
}
|
|
96
|
-
|
|
97
|
-
|
|
545
|
+
S(() => {
|
|
546
|
+
r.renderer.off("resize", v), r.stage.removeChild(l);
|
|
98
547
|
});
|
|
99
|
-
function
|
|
100
|
-
const
|
|
101
|
-
l.scale.set(
|
|
548
|
+
function _() {
|
|
549
|
+
const w = r.screen.width / l.texture.width, e = r.screen.height / l.texture.height, n = Math.min(w, e);
|
|
550
|
+
l.scale.set(n), l.x = (r.screen.width - l.width) / 2, l.y = (r.screen.height - l.height) / 2;
|
|
102
551
|
}
|
|
103
552
|
return {
|
|
104
553
|
sprite: l,
|
|
105
|
-
resizeSprite:
|
|
106
|
-
application:
|
|
554
|
+
resizeSprite: v,
|
|
555
|
+
application: r
|
|
107
556
|
};
|
|
108
557
|
}
|
|
109
|
-
const
|
|
558
|
+
const Ne = /* @__PURE__ */ C({
|
|
110
559
|
__name: "apng",
|
|
111
560
|
props: {
|
|
112
|
-
...
|
|
561
|
+
...q,
|
|
113
562
|
url: {
|
|
114
563
|
type: String,
|
|
115
564
|
required: !0
|
|
116
565
|
}
|
|
117
566
|
},
|
|
118
|
-
emits:
|
|
119
|
-
setup(
|
|
120
|
-
const
|
|
121
|
-
let
|
|
122
|
-
|
|
123
|
-
function
|
|
124
|
-
return
|
|
567
|
+
emits: j,
|
|
568
|
+
setup(o, { emit: P }) {
|
|
569
|
+
const t = o, r = P, p = ne(), l = (c) => `${p}-apng-frame-${c}`, { sprite: v, resizeSprite: _ } = z(t), w = U([]), e = U(0), n = U(!1), a = U(""), u = /* @__PURE__ */ new Map();
|
|
570
|
+
let i = null, s = null, b = null;
|
|
571
|
+
ae(() => A(t.url));
|
|
572
|
+
function h(c, x) {
|
|
573
|
+
return s || (s = document.createElement("canvas"), b = s.getContext("2d", {
|
|
125
574
|
willReadFrequently: !0
|
|
126
|
-
})), (
|
|
575
|
+
})), (s.width !== c || s.height !== x) && (s.width = c, s.height = x), { canvas: s, ctx: b };
|
|
127
576
|
}
|
|
128
|
-
async function
|
|
577
|
+
async function A(c) {
|
|
129
578
|
try {
|
|
130
|
-
|
|
131
|
-
const
|
|
132
|
-
if (!
|
|
133
|
-
throw new Error(`加载APNG失败: ${
|
|
134
|
-
const
|
|
135
|
-
if (
|
|
136
|
-
throw new TypeError(`APNG解析失败: ${
|
|
137
|
-
const { canvas:
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
const
|
|
146
|
-
return
|
|
579
|
+
a.value = "", n.value = !1, await g();
|
|
580
|
+
const x = await fetch(c);
|
|
581
|
+
if (!x.ok)
|
|
582
|
+
throw new Error(`加载APNG失败: ${x.status}`);
|
|
583
|
+
const I = await x.arrayBuffer(), N = Ee(I);
|
|
584
|
+
if (N instanceof Error)
|
|
585
|
+
throw new TypeError(`APNG解析失败: ${N.message}`);
|
|
586
|
+
const { canvas: k, ctx: M } = h(N.width, N.height), O = N.frames.map(async (G, W) => {
|
|
587
|
+
M.clearRect(0, 0, k.width, k.height), await G.createImage();
|
|
588
|
+
const T = G.imageElement;
|
|
589
|
+
M.drawImage(T, G.left, G.top);
|
|
590
|
+
const D = M.getImageData(0, 0, k.width, k.height), E = l(W);
|
|
591
|
+
u.set(E, void 0), M.putImageData(D, 0, 0);
|
|
592
|
+
const $ = k.toDataURL();
|
|
593
|
+
R.add({ alias: E, src: $ });
|
|
594
|
+
const L = await R.load(E);
|
|
595
|
+
return u.set(E, L), W === 0 && (v.texture = L, _()), E;
|
|
147
596
|
});
|
|
148
|
-
|
|
149
|
-
} catch (
|
|
150
|
-
console.error("加载APNG失败:",
|
|
597
|
+
w.value = await Promise.all(O), n.value = !0;
|
|
598
|
+
} catch (x) {
|
|
599
|
+
console.error("加载APNG失败:", x), a.value = x instanceof Error ? x.message : "加载APNG失败", r("update:status", m.stopped);
|
|
151
600
|
}
|
|
152
601
|
}
|
|
153
|
-
function
|
|
154
|
-
|
|
155
|
-
if (
|
|
602
|
+
function y() {
|
|
603
|
+
i === null && (i = window.setInterval(() => {
|
|
604
|
+
if (w.value.length === 0 || t.status !== m.playing)
|
|
156
605
|
return;
|
|
157
|
-
const
|
|
158
|
-
l(
|
|
606
|
+
const c = u.get(
|
|
607
|
+
l(e.value)
|
|
159
608
|
);
|
|
160
|
-
if (
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}),
|
|
609
|
+
if (c) {
|
|
610
|
+
const x = e.value - 1;
|
|
611
|
+
x >= 0 && !t.loop && Promise.resolve().then(() => Z(500)).then(() => {
|
|
612
|
+
R.unload(l(x)), u.delete(l(x));
|
|
613
|
+
}), v.texture = c, _(), e.value = t.loop ? (e.value + 1) % w.value.length : e.value + 1;
|
|
165
614
|
} else
|
|
166
|
-
|
|
167
|
-
}, 1e3 /
|
|
168
|
-
}
|
|
169
|
-
function p() {
|
|
170
|
-
!w.value || v.value.length <= 1 || (t("update:status", n.playing), h());
|
|
615
|
+
t.loop || r("update:status", m.paused);
|
|
616
|
+
}, 1e3 / t.frameRate));
|
|
171
617
|
}
|
|
172
|
-
function
|
|
173
|
-
|
|
618
|
+
function F() {
|
|
619
|
+
!n.value || w.value.length <= 1 || (r("update:status", m.playing), y());
|
|
174
620
|
}
|
|
175
621
|
function d() {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
case
|
|
193
|
-
|
|
622
|
+
i !== null && (clearInterval(i), i = null), r("update:status", m.paused);
|
|
623
|
+
}
|
|
624
|
+
function f() {
|
|
625
|
+
i !== null && (clearInterval(i), i = null), e.value = 0;
|
|
626
|
+
const c = u.get(l(0));
|
|
627
|
+
c && (v.texture = c, _()), r("update:status", m.stopped);
|
|
628
|
+
}
|
|
629
|
+
async function g() {
|
|
630
|
+
i !== null && (clearInterval(i), i = null);
|
|
631
|
+
const c = [];
|
|
632
|
+
for (const [x, I] of u)
|
|
633
|
+
I && I !== ee.EMPTY && c.push(R.unload(x));
|
|
634
|
+
await Promise.all(c), u.clear(), w.value = [], e.value = 0, n.value = !1, a.value = "", s && (s.width = 0, s.height = 0);
|
|
635
|
+
}
|
|
636
|
+
return B(() => {
|
|
637
|
+
switch (t.status) {
|
|
638
|
+
case m.play:
|
|
639
|
+
F();
|
|
194
640
|
break;
|
|
195
|
-
case
|
|
641
|
+
case m.pause:
|
|
196
642
|
d();
|
|
197
643
|
break;
|
|
644
|
+
case m.stop:
|
|
645
|
+
f();
|
|
646
|
+
break;
|
|
198
647
|
}
|
|
199
|
-
}),
|
|
200
|
-
await
|
|
201
|
-
}), (
|
|
648
|
+
}), S(async () => {
|
|
649
|
+
await g(), s = null, b = null;
|
|
650
|
+
}), (c, x) => V(c.$slots, "default");
|
|
202
651
|
}
|
|
203
|
-
}),
|
|
652
|
+
}), Ge = /* @__PURE__ */ C({
|
|
204
653
|
__name: "bitmap-generator",
|
|
205
654
|
props: {
|
|
206
|
-
...
|
|
655
|
+
...se(q, {
|
|
207
656
|
excludes: ["loop"]
|
|
208
657
|
}),
|
|
209
658
|
generator: {
|
|
@@ -213,50 +662,50 @@ const _e = /* @__PURE__ */ E({
|
|
|
213
662
|
},
|
|
214
663
|
emits: {
|
|
215
664
|
"update:status": null,
|
|
216
|
-
load: (
|
|
665
|
+
load: (o) => o
|
|
217
666
|
},
|
|
218
|
-
setup(
|
|
219
|
-
const
|
|
667
|
+
setup(o, { emit: P }) {
|
|
668
|
+
const t = o, r = P, { sprite: p, resizeSprite: l, application: v } = z(t), _ = new ee({
|
|
220
669
|
dynamic: !0
|
|
221
670
|
});
|
|
222
|
-
|
|
223
|
-
function
|
|
224
|
-
|
|
225
|
-
const
|
|
226
|
-
resource:
|
|
671
|
+
p.texture = _;
|
|
672
|
+
function w(i) {
|
|
673
|
+
_.source.destroy();
|
|
674
|
+
const s = new oe({
|
|
675
|
+
resource: i
|
|
227
676
|
});
|
|
228
|
-
|
|
677
|
+
_.source = s, _.update(), l();
|
|
229
678
|
}
|
|
230
|
-
|
|
231
|
-
application:
|
|
232
|
-
sprite:
|
|
233
|
-
}),
|
|
234
|
-
|
|
679
|
+
r("load", {
|
|
680
|
+
application: v,
|
|
681
|
+
sprite: p
|
|
682
|
+
}), Q(() => t.status, (i) => {
|
|
683
|
+
i === m.play && n(), i === m.pause && a(), i === m.stop && u();
|
|
235
684
|
}, { immediate: !0 });
|
|
236
|
-
function
|
|
237
|
-
|
|
238
|
-
if (
|
|
239
|
-
return
|
|
240
|
-
|
|
685
|
+
function e() {
|
|
686
|
+
t.status === m.playing && t.generator.next().then(({ value: i, done: s }) => {
|
|
687
|
+
if (s)
|
|
688
|
+
return r("update:status", m.stopped);
|
|
689
|
+
w(i);
|
|
241
690
|
});
|
|
242
691
|
}
|
|
243
|
-
function
|
|
244
|
-
|
|
692
|
+
function n() {
|
|
693
|
+
v.ticker.minFPS = t.frameRate, v.ticker.maxFPS = t.frameRate, r("update:status", m.playing), v.ticker.add(e);
|
|
245
694
|
}
|
|
246
|
-
function
|
|
247
|
-
|
|
695
|
+
function a() {
|
|
696
|
+
v.ticker.remove(e), r("update:status", m.paused);
|
|
248
697
|
}
|
|
249
|
-
function
|
|
250
|
-
|
|
698
|
+
function u() {
|
|
699
|
+
v.ticker.remove(e), r("update:status", m.stopped);
|
|
251
700
|
}
|
|
252
|
-
return
|
|
253
|
-
|
|
254
|
-
}), (
|
|
701
|
+
return S(() => {
|
|
702
|
+
u(), _.destroy();
|
|
703
|
+
}), (i, s) => V(i.$slots, "default");
|
|
255
704
|
}
|
|
256
|
-
}),
|
|
705
|
+
}), De = /* @__PURE__ */ C({
|
|
257
706
|
__name: "bitmap",
|
|
258
707
|
props: {
|
|
259
|
-
...
|
|
708
|
+
...se(q, {
|
|
260
709
|
excludes: ["loop"]
|
|
261
710
|
}),
|
|
262
711
|
data: {
|
|
@@ -268,92 +717,92 @@ const _e = /* @__PURE__ */ E({
|
|
|
268
717
|
}
|
|
269
718
|
},
|
|
270
719
|
emits: {
|
|
271
|
-
...
|
|
272
|
-
load: (
|
|
720
|
+
...j,
|
|
721
|
+
load: (o) => o,
|
|
273
722
|
"update:frameIndex": null,
|
|
274
|
-
notFound: (
|
|
723
|
+
notFound: (o) => !0
|
|
275
724
|
},
|
|
276
|
-
setup(
|
|
277
|
-
const
|
|
725
|
+
setup(o, { emit: P }) {
|
|
726
|
+
const t = o, r = P, { sprite: p, resizeSprite: l, application: v } = z(t), _ = new ee({
|
|
278
727
|
dynamic: !0
|
|
279
728
|
});
|
|
280
|
-
|
|
281
|
-
function
|
|
282
|
-
|
|
283
|
-
const
|
|
284
|
-
resource:
|
|
729
|
+
p.texture = _;
|
|
730
|
+
function w(d) {
|
|
731
|
+
_.source?.resource?.close(), _.source?.destroy();
|
|
732
|
+
const f = new oe({
|
|
733
|
+
resource: d
|
|
285
734
|
});
|
|
286
|
-
|
|
735
|
+
_.source = f, _.update(), l();
|
|
287
736
|
}
|
|
288
|
-
|
|
289
|
-
application:
|
|
290
|
-
sprite:
|
|
737
|
+
r("load", {
|
|
738
|
+
application: v,
|
|
739
|
+
sprite: p
|
|
291
740
|
});
|
|
292
|
-
const
|
|
741
|
+
const e = ie({
|
|
293
742
|
default: 0,
|
|
294
743
|
key: "frameIndex"
|
|
295
|
-
},
|
|
296
|
-
function
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
k:
|
|
744
|
+
}, t, r), n = U(-1);
|
|
745
|
+
function a(d) {
|
|
746
|
+
d <= n.value || (n.value = d, Z(0).then(() => {
|
|
747
|
+
r("setData", {
|
|
748
|
+
k: d,
|
|
300
749
|
v: null
|
|
301
750
|
});
|
|
302
751
|
}));
|
|
303
752
|
}
|
|
304
|
-
let
|
|
305
|
-
function
|
|
306
|
-
if (
|
|
753
|
+
let u = null, i = 0, s = 0, b = 0;
|
|
754
|
+
function h() {
|
|
755
|
+
if (u !== null)
|
|
307
756
|
return;
|
|
308
|
-
|
|
309
|
-
function
|
|
310
|
-
const
|
|
311
|
-
if (
|
|
312
|
-
|
|
313
|
-
const
|
|
314
|
-
if (
|
|
315
|
-
const
|
|
316
|
-
console.log(`[Bitmap] FPS: ${
|
|
757
|
+
i = performance.now(), b = i, s = 0;
|
|
758
|
+
function d() {
|
|
759
|
+
const g = performance.now(), c = 1e3 / t.frameRate, x = g - i;
|
|
760
|
+
if (x >= c) {
|
|
761
|
+
i = g - x % c, f(), s++;
|
|
762
|
+
const I = g - b;
|
|
763
|
+
if (I >= 1e3) {
|
|
764
|
+
const N = Math.round(s * 1e3 / I);
|
|
765
|
+
console.log(`[Bitmap] FPS: ${N}`), s = 0, b = g;
|
|
317
766
|
}
|
|
318
767
|
}
|
|
319
|
-
|
|
768
|
+
t.status === m.playing ? u = requestAnimationFrame(d) : u = null;
|
|
320
769
|
}
|
|
321
|
-
function
|
|
322
|
-
if (
|
|
770
|
+
function f() {
|
|
771
|
+
if (t.data.length === 0 || t.status !== m.playing)
|
|
323
772
|
return;
|
|
324
|
-
const
|
|
325
|
-
if (
|
|
326
|
-
const
|
|
327
|
-
|
|
773
|
+
const g = t.data[e.value];
|
|
774
|
+
if (g) {
|
|
775
|
+
const c = e.value - 1;
|
|
776
|
+
c >= 0 && a(c), w(g), e.value = e.value + 1;
|
|
328
777
|
} else
|
|
329
778
|
console.warn(
|
|
330
|
-
`Bitmap for index ${
|
|
331
|
-
),
|
|
779
|
+
`Bitmap for index ${e.value} not found. Ensure the data is loaded.`
|
|
780
|
+
), r("notFound", e.value);
|
|
332
781
|
}
|
|
333
|
-
|
|
782
|
+
u = requestAnimationFrame(d);
|
|
334
783
|
}
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
}),
|
|
338
|
-
|
|
784
|
+
B(() => {
|
|
785
|
+
t.prerender && e.value === 0 && t.data.length > 0 && t.data[0] && w(t.data[0]);
|
|
786
|
+
}), Q(() => t.status, (d) => {
|
|
787
|
+
d === m.play && A(), d === m.pause && y(), d === m.stop && F();
|
|
339
788
|
}, { immediate: !0 });
|
|
340
|
-
function
|
|
341
|
-
|
|
789
|
+
function A() {
|
|
790
|
+
t.data.length > 0 ? (r("update:status", m.playing), h()) : r("update:status", m.stopped);
|
|
342
791
|
}
|
|
343
|
-
function
|
|
344
|
-
|
|
792
|
+
function y() {
|
|
793
|
+
r("update:status", m.paused);
|
|
345
794
|
}
|
|
346
|
-
function
|
|
347
|
-
|
|
795
|
+
function F() {
|
|
796
|
+
r("update:status", m.stopped), u !== null && (cancelAnimationFrame(u), u = null), r("update:data", []), e.value = 0, n.value = -1;
|
|
348
797
|
}
|
|
349
|
-
return
|
|
350
|
-
|
|
351
|
-
}), (
|
|
798
|
+
return S(() => {
|
|
799
|
+
F(), _.destroy();
|
|
800
|
+
}), (d, f) => V(d.$slots, "default");
|
|
352
801
|
}
|
|
353
|
-
}),
|
|
802
|
+
}), je = /* @__PURE__ */ C({
|
|
354
803
|
__name: "buffer-image",
|
|
355
804
|
props: {
|
|
356
|
-
...
|
|
805
|
+
...se(q, {
|
|
357
806
|
excludes: ["loop"]
|
|
358
807
|
}),
|
|
359
808
|
data: {
|
|
@@ -381,95 +830,95 @@ const _e = /* @__PURE__ */ E({
|
|
|
381
830
|
}
|
|
382
831
|
},
|
|
383
832
|
emits: {
|
|
384
|
-
...
|
|
385
|
-
load: (
|
|
833
|
+
...j,
|
|
834
|
+
load: (o) => o,
|
|
386
835
|
"update:frameIndex": null,
|
|
387
|
-
notFound: (
|
|
836
|
+
notFound: (o) => !0
|
|
388
837
|
},
|
|
389
|
-
setup(
|
|
390
|
-
const
|
|
838
|
+
setup(o, { emit: P }) {
|
|
839
|
+
const t = o, r = P, { sprite: p, resizeSprite: l, application: v } = z(t), _ = new ee({
|
|
391
840
|
dynamic: !0
|
|
392
841
|
});
|
|
393
|
-
|
|
394
|
-
function
|
|
395
|
-
|
|
396
|
-
const
|
|
397
|
-
resource:
|
|
398
|
-
height:
|
|
399
|
-
width:
|
|
400
|
-
format:
|
|
842
|
+
p.texture = _;
|
|
843
|
+
function w(d) {
|
|
844
|
+
_.source?.destroy();
|
|
845
|
+
const f = new we({
|
|
846
|
+
resource: d,
|
|
847
|
+
height: t.height,
|
|
848
|
+
width: t.width,
|
|
849
|
+
format: t.format
|
|
401
850
|
});
|
|
402
|
-
|
|
851
|
+
_.source = f, _.update(), l();
|
|
403
852
|
}
|
|
404
|
-
|
|
405
|
-
application:
|
|
406
|
-
sprite:
|
|
853
|
+
r("load", {
|
|
854
|
+
application: v,
|
|
855
|
+
sprite: p
|
|
407
856
|
});
|
|
408
|
-
const
|
|
857
|
+
const e = ie({
|
|
409
858
|
default: 0,
|
|
410
859
|
key: "frameIndex"
|
|
411
|
-
},
|
|
412
|
-
function
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
k:
|
|
860
|
+
}, t, r), n = U(-1);
|
|
861
|
+
function a(d) {
|
|
862
|
+
d <= n.value || (n.value = d, Z(0).then(() => {
|
|
863
|
+
r("setData", {
|
|
864
|
+
k: d,
|
|
416
865
|
v: null
|
|
417
866
|
});
|
|
418
867
|
}));
|
|
419
868
|
}
|
|
420
|
-
let
|
|
421
|
-
function
|
|
422
|
-
if (
|
|
869
|
+
let u = null, i = 0, s = 0, b = 0;
|
|
870
|
+
function h() {
|
|
871
|
+
if (u !== null)
|
|
423
872
|
return;
|
|
424
|
-
|
|
425
|
-
function
|
|
426
|
-
const
|
|
427
|
-
if (
|
|
428
|
-
|
|
429
|
-
const
|
|
430
|
-
if (
|
|
431
|
-
const
|
|
432
|
-
console.log(`[Bitmap] FPS: ${
|
|
873
|
+
i = performance.now(), b = i, s = 0;
|
|
874
|
+
function d() {
|
|
875
|
+
const g = performance.now(), c = 1e3 / t.frameRate, x = g - i;
|
|
876
|
+
if (x >= c) {
|
|
877
|
+
i = g - x % c, f(), s++;
|
|
878
|
+
const I = g - b;
|
|
879
|
+
if (I >= 1e3) {
|
|
880
|
+
const N = Math.round(s * 1e3 / I);
|
|
881
|
+
console.log(`[Bitmap] FPS: ${N}`), s = 0, b = g;
|
|
433
882
|
}
|
|
434
883
|
}
|
|
435
|
-
|
|
884
|
+
t.status === m.playing ? u = requestAnimationFrame(d) : u = null;
|
|
436
885
|
}
|
|
437
|
-
function
|
|
438
|
-
if (
|
|
886
|
+
function f() {
|
|
887
|
+
if (t.data.length === 0 || t.status !== m.playing)
|
|
439
888
|
return;
|
|
440
|
-
const
|
|
441
|
-
if (
|
|
442
|
-
const
|
|
443
|
-
|
|
889
|
+
const g = t.data[e.value];
|
|
890
|
+
if (g) {
|
|
891
|
+
const c = e.value - 1;
|
|
892
|
+
c >= 0 && a(c), w(g), e.value = e.value + 1;
|
|
444
893
|
} else
|
|
445
894
|
console.warn(
|
|
446
|
-
`Bitmap for index ${
|
|
447
|
-
),
|
|
895
|
+
`Bitmap for index ${e.value} not found. Ensure the data is loaded.`
|
|
896
|
+
), r("notFound", e.value);
|
|
448
897
|
}
|
|
449
|
-
|
|
898
|
+
u = requestAnimationFrame(d);
|
|
450
899
|
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
}),
|
|
454
|
-
|
|
900
|
+
B(() => {
|
|
901
|
+
t.prerender && e.value === 0 && t.data.length > 0 && t.data[0] && w(t.data[0]);
|
|
902
|
+
}), Q(() => t.status, (d) => {
|
|
903
|
+
d === m.play && A(), d === m.pause && y(), d === m.stop && F();
|
|
455
904
|
}, { immediate: !0 });
|
|
456
|
-
function
|
|
457
|
-
|
|
905
|
+
function A() {
|
|
906
|
+
t.data.length > 0 ? (r("update:status", m.playing), h()) : r("update:status", m.stopped);
|
|
458
907
|
}
|
|
459
|
-
function
|
|
460
|
-
|
|
908
|
+
function y() {
|
|
909
|
+
r("update:status", m.paused);
|
|
461
910
|
}
|
|
462
|
-
function
|
|
463
|
-
|
|
911
|
+
function F() {
|
|
912
|
+
r("update:status", m.stopped), u !== null && (cancelAnimationFrame(u), u = null), r("update:data", []), e.value = 0, n.value = -1;
|
|
464
913
|
}
|
|
465
|
-
return
|
|
466
|
-
|
|
467
|
-
}), (
|
|
914
|
+
return S(() => {
|
|
915
|
+
F(), _.destroy();
|
|
916
|
+
}), (d, f) => V(d.$slots, "default");
|
|
468
917
|
}
|
|
469
|
-
}),
|
|
918
|
+
}), ze = /* @__PURE__ */ C({
|
|
470
919
|
__name: "core",
|
|
471
920
|
props: {
|
|
472
|
-
...
|
|
921
|
+
...q,
|
|
473
922
|
data: {
|
|
474
923
|
type: void 0,
|
|
475
924
|
required: !0
|
|
@@ -479,179 +928,179 @@ const _e = /* @__PURE__ */ E({
|
|
|
479
928
|
}
|
|
480
929
|
},
|
|
481
930
|
emits: {
|
|
482
|
-
...
|
|
483
|
-
load: (
|
|
931
|
+
...j,
|
|
932
|
+
load: (o) => o,
|
|
484
933
|
"update:frameIndex": null,
|
|
485
|
-
notFound: (
|
|
934
|
+
notFound: (o) => !0
|
|
486
935
|
},
|
|
487
|
-
setup(
|
|
488
|
-
const
|
|
489
|
-
|
|
490
|
-
for (const
|
|
491
|
-
const
|
|
492
|
-
|
|
493
|
-
alias:
|
|
494
|
-
src:
|
|
936
|
+
setup(o, { emit: P }) {
|
|
937
|
+
const t = o, r = P, p = ne(), l = (F) => `${p}-${F}`, { sprite: v, resizeSprite: _, application: w } = z(t), e = /* @__PURE__ */ new Map(), n = U(0), a = J(() => t.data.slice(n.value));
|
|
938
|
+
B(() => {
|
|
939
|
+
for (const F in a.value) {
|
|
940
|
+
const d = +F + n.value, f = `${p}-${d}`, g = typeof a.value[F] == "string" ? a.value[F] : a.value[F]?.src;
|
|
941
|
+
g && (e.has(f) || (R.add({
|
|
942
|
+
alias: f,
|
|
943
|
+
src: g,
|
|
495
944
|
loadParser: "loadTextures"
|
|
496
|
-
}),
|
|
497
|
-
|
|
945
|
+
}), e.set(f, void 0), R.load(f).then((c) => {
|
|
946
|
+
c._meta = a.value[F], e.set(f, c), t.prerender && d === 0 && (v.texture = c, _());
|
|
498
947
|
})));
|
|
499
948
|
}
|
|
500
|
-
}),
|
|
501
|
-
application:
|
|
502
|
-
sprite:
|
|
949
|
+
}), r("load", {
|
|
950
|
+
application: w,
|
|
951
|
+
sprite: v
|
|
503
952
|
});
|
|
504
|
-
const
|
|
953
|
+
const u = ie({
|
|
505
954
|
default: 0,
|
|
506
955
|
key: "frameIndex"
|
|
507
|
-
},
|
|
508
|
-
let
|
|
509
|
-
function
|
|
510
|
-
if (
|
|
956
|
+
}, t, r);
|
|
957
|
+
let i = null, s = 0;
|
|
958
|
+
function b() {
|
|
959
|
+
if (i !== null)
|
|
511
960
|
return;
|
|
512
|
-
|
|
513
|
-
function
|
|
514
|
-
const
|
|
515
|
-
|
|
961
|
+
s = performance.now();
|
|
962
|
+
function F() {
|
|
963
|
+
const f = performance.now(), g = 1e3 / t.frameRate, c = f - s;
|
|
964
|
+
c >= g && (s = f - c % g, d()), t.status === m.playing ? i = requestAnimationFrame(F) : i = null;
|
|
516
965
|
}
|
|
517
|
-
function
|
|
518
|
-
if (
|
|
966
|
+
function d() {
|
|
967
|
+
if (t.data.length === 0 || t.status !== m.playing)
|
|
519
968
|
return;
|
|
520
|
-
const
|
|
521
|
-
l(
|
|
969
|
+
const f = e.get(
|
|
970
|
+
l(u.value)
|
|
522
971
|
);
|
|
523
|
-
if (
|
|
524
|
-
const
|
|
525
|
-
|
|
526
|
-
l(
|
|
972
|
+
if (f) {
|
|
973
|
+
const g = v.texture, c = u.value - 1;
|
|
974
|
+
g && c >= 0 && !t.loop && Promise.resolve(Z(500)).then(() => R.unload(
|
|
975
|
+
l(c)
|
|
527
976
|
)).then(() => {
|
|
528
|
-
|
|
529
|
-
l(
|
|
977
|
+
e.set(
|
|
978
|
+
l(c),
|
|
530
979
|
void 0
|
|
531
|
-
),
|
|
532
|
-
k:
|
|
980
|
+
), r("setData", {
|
|
981
|
+
k: c,
|
|
533
982
|
v: ""
|
|
534
|
-
}),
|
|
535
|
-
}),
|
|
983
|
+
}), n.value = c;
|
|
984
|
+
}), v.texture = f, _(), u.value = t.loop ? (u.value + 1) % t.data.length : u.value + 1;
|
|
536
985
|
} else
|
|
537
986
|
console.warn(
|
|
538
|
-
`Texture for index ${
|
|
539
|
-
),
|
|
987
|
+
`Texture for index ${u.value} not found. Ensure the texture is loaded.`
|
|
988
|
+
), r("notFound", u.value), t.loop || r("update:status", m.paused);
|
|
540
989
|
}
|
|
541
|
-
|
|
990
|
+
i = requestAnimationFrame(F);
|
|
542
991
|
}
|
|
543
|
-
|
|
544
|
-
|
|
992
|
+
Q(() => t.status, (F) => {
|
|
993
|
+
F === m.play && h(), F === m.pause && A(), F === m.stop && y();
|
|
545
994
|
}, { immediate: !0 });
|
|
546
|
-
function
|
|
547
|
-
|
|
995
|
+
function h() {
|
|
996
|
+
t.data.length > 0 ? (r("update:status", m.playing), b()) : r("update:status", m.stopped);
|
|
548
997
|
}
|
|
549
|
-
function
|
|
550
|
-
|
|
998
|
+
function A() {
|
|
999
|
+
r("update:status", m.paused);
|
|
551
1000
|
}
|
|
552
|
-
function
|
|
553
|
-
|
|
1001
|
+
function y() {
|
|
1002
|
+
r("update:status", m.stopped), i !== null && (cancelAnimationFrame(i), i = null), r("update:data", []), e.clear(), u.value = 0;
|
|
554
1003
|
}
|
|
555
|
-
return
|
|
556
|
-
Array.from(
|
|
557
|
-
|
|
558
|
-
}),
|
|
559
|
-
}), (
|
|
1004
|
+
return S(() => {
|
|
1005
|
+
Array.from(e.entries()).forEach(([d, f]) => {
|
|
1006
|
+
f && R.unload(d);
|
|
1007
|
+
}), y();
|
|
1008
|
+
}), (F, d) => V(F.$slots, "default");
|
|
560
1009
|
}
|
|
561
|
-
}),
|
|
1010
|
+
}), Le = /* @__PURE__ */ C({
|
|
562
1011
|
__name: "provider",
|
|
563
|
-
setup(
|
|
564
|
-
return
|
|
1012
|
+
setup(o) {
|
|
1013
|
+
return Ie(), (P, t) => V(P.$slots, "default");
|
|
565
1014
|
}
|
|
566
|
-
}),
|
|
1015
|
+
}), Re = /* @__PURE__ */ C({
|
|
567
1016
|
__name: "video",
|
|
568
1017
|
props: {
|
|
569
|
-
...
|
|
1018
|
+
...q,
|
|
570
1019
|
url: {
|
|
571
1020
|
type: String,
|
|
572
1021
|
required: !0
|
|
573
1022
|
}
|
|
574
1023
|
},
|
|
575
|
-
emits:
|
|
576
|
-
setup(
|
|
577
|
-
const
|
|
578
|
-
if (
|
|
579
|
-
const
|
|
580
|
-
if (
|
|
581
|
-
return
|
|
1024
|
+
emits: j,
|
|
1025
|
+
setup(o, { emit: P }) {
|
|
1026
|
+
const t = o, r = P, p = ne(), l = () => `${p}-video`, { sprite: v, resizeSprite: _ } = z(t), w = U(), e = J(() => {
|
|
1027
|
+
if (w.value?.source && w.value.source.resource) {
|
|
1028
|
+
const y = w.value.source.resource;
|
|
1029
|
+
if (y instanceof HTMLVideoElement)
|
|
1030
|
+
return y;
|
|
582
1031
|
}
|
|
583
1032
|
return null;
|
|
584
|
-
}),
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
}),
|
|
588
|
-
|
|
589
|
-
}),
|
|
590
|
-
async function
|
|
1033
|
+
}), n = be(), a = U("");
|
|
1034
|
+
n.promise.then(() => {
|
|
1035
|
+
t.status === m.play && b();
|
|
1036
|
+
}), B(() => {
|
|
1037
|
+
e.value && (e.value.loop = t.loop);
|
|
1038
|
+
}), ae(() => u(t.url));
|
|
1039
|
+
async function u(y) {
|
|
591
1040
|
try {
|
|
592
|
-
|
|
593
|
-
const
|
|
594
|
-
|
|
595
|
-
const
|
|
596
|
-
return
|
|
597
|
-
} catch (
|
|
598
|
-
return console.error("加载视频纹理失败:",
|
|
1041
|
+
a.value = "";
|
|
1042
|
+
const F = l();
|
|
1043
|
+
R.cache.has(F) && await R.unload(F), R.add({ alias: F, src: y });
|
|
1044
|
+
const d = await R.load(F);
|
|
1045
|
+
return w.value = d, v.texture = d, e.value && (e.value.loop = t.loop, e.value.muted = !0, e.value.crossOrigin = "anonymous", i(e.value), n.resolve()), _(), d;
|
|
1046
|
+
} catch (F) {
|
|
1047
|
+
return console.error("加载视频纹理失败:", F), a.value = "视频加载失败", null;
|
|
599
1048
|
}
|
|
600
1049
|
}
|
|
601
|
-
function
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
}),
|
|
605
|
-
|
|
606
|
-
}),
|
|
607
|
-
|
|
608
|
-
}),
|
|
609
|
-
const
|
|
610
|
-
let
|
|
611
|
-
if (
|
|
612
|
-
switch (
|
|
613
|
-
case
|
|
614
|
-
|
|
1050
|
+
function i(y) {
|
|
1051
|
+
y.addEventListener("play", () => {
|
|
1052
|
+
t.status !== m.playing && r("update:status", m.playing);
|
|
1053
|
+
}), y.addEventListener("pause", () => {
|
|
1054
|
+
t.status !== m.paused && r("update:status", m.paused);
|
|
1055
|
+
}), y.addEventListener("ended", () => {
|
|
1056
|
+
t.loop ? (y.currentTime = 0, y.play()) : r("update:status", m.stopped);
|
|
1057
|
+
}), y.addEventListener("error", (F) => {
|
|
1058
|
+
const d = y.error;
|
|
1059
|
+
let f = "视频播放失败";
|
|
1060
|
+
if (d)
|
|
1061
|
+
switch (d.code) {
|
|
1062
|
+
case d.MEDIA_ERR_ABORTED:
|
|
1063
|
+
f = "视频播放被中止";
|
|
615
1064
|
break;
|
|
616
|
-
case
|
|
617
|
-
|
|
1065
|
+
case d.MEDIA_ERR_NETWORK:
|
|
1066
|
+
f = "网络错误导致视频播放失败";
|
|
618
1067
|
break;
|
|
619
|
-
case
|
|
620
|
-
|
|
1068
|
+
case d.MEDIA_ERR_DECODE:
|
|
1069
|
+
f = "视频解码失败";
|
|
621
1070
|
break;
|
|
622
|
-
case
|
|
623
|
-
|
|
1071
|
+
case d.MEDIA_ERR_SRC_NOT_SUPPORTED:
|
|
1072
|
+
f = "不支持的视频格式";
|
|
624
1073
|
break;
|
|
625
1074
|
}
|
|
626
|
-
console.error("视频播放错误:",
|
|
1075
|
+
console.error("视频播放错误:", f, F), a.value = f, r("update:status", m.stopped);
|
|
627
1076
|
});
|
|
628
1077
|
}
|
|
629
|
-
async function
|
|
630
|
-
if (
|
|
631
|
-
const
|
|
632
|
-
|
|
1078
|
+
async function s() {
|
|
1079
|
+
if (w.value) {
|
|
1080
|
+
const y = l();
|
|
1081
|
+
w.value.destroy(!0), w.value = void 0, R.cache.has(y) && await R.unload(y);
|
|
633
1082
|
}
|
|
634
|
-
|
|
1083
|
+
a.value = "";
|
|
635
1084
|
}
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
}),
|
|
639
|
-
|
|
1085
|
+
B(() => {
|
|
1086
|
+
t.status === m.play && b(), t.status === m.pause && h(), t.status === m.stop && A();
|
|
1087
|
+
}), S(() => {
|
|
1088
|
+
s();
|
|
640
1089
|
});
|
|
641
|
-
function
|
|
642
|
-
|
|
643
|
-
console.error("视频播放失败:",
|
|
1090
|
+
function b() {
|
|
1091
|
+
e.value && e.value.play().catch((y) => {
|
|
1092
|
+
console.error("视频播放失败:", y), a.value = "视频播放失败";
|
|
644
1093
|
});
|
|
645
1094
|
}
|
|
646
|
-
function
|
|
647
|
-
|
|
1095
|
+
function h() {
|
|
1096
|
+
e.value?.pause();
|
|
648
1097
|
}
|
|
649
|
-
function
|
|
650
|
-
|
|
1098
|
+
function A() {
|
|
1099
|
+
e.value && (e.value.pause(), e.value.currentTime = 0), r("update:status", m.stopped);
|
|
651
1100
|
}
|
|
652
|
-
return (
|
|
1101
|
+
return (y, F) => V(y.$slots, "default");
|
|
653
1102
|
}
|
|
654
|
-
}),
|
|
1103
|
+
}), Te = /* @__PURE__ */ C({
|
|
655
1104
|
__name: "view",
|
|
656
1105
|
props: {
|
|
657
1106
|
defaultOptions: {
|
|
@@ -659,97 +1108,97 @@ const _e = /* @__PURE__ */ E({
|
|
|
659
1108
|
default: () => ({})
|
|
660
1109
|
}
|
|
661
1110
|
},
|
|
662
|
-
setup(
|
|
663
|
-
const
|
|
664
|
-
return
|
|
665
|
-
await
|
|
666
|
-
resizeTo:
|
|
667
|
-
...
|
|
668
|
-
}),
|
|
669
|
-
}), (l,
|
|
1111
|
+
setup(o) {
|
|
1112
|
+
const P = o, { application: t, context: r } = ce(), p = U();
|
|
1113
|
+
return ae(async () => {
|
|
1114
|
+
await t.init({
|
|
1115
|
+
resizeTo: p.value,
|
|
1116
|
+
...P.defaultOptions
|
|
1117
|
+
}), r.whenDef.resolve(t), p.value.appendChild(t.canvas);
|
|
1118
|
+
}), (l, v) => (H(), me("div", {
|
|
670
1119
|
ref_key: "appRef",
|
|
671
|
-
ref:
|
|
1120
|
+
ref: p,
|
|
672
1121
|
class: "vk-pixi-frame"
|
|
673
1122
|
}, null, 512));
|
|
674
1123
|
}
|
|
675
|
-
}),
|
|
1124
|
+
}), Oe = C({
|
|
676
1125
|
name: "VkPixiFrame",
|
|
677
1126
|
components: {
|
|
678
|
-
ApngComp:
|
|
1127
|
+
ApngComp: Ne,
|
|
679
1128
|
// CoreComp,
|
|
680
|
-
ProviderComp:
|
|
681
|
-
ViewComp:
|
|
682
|
-
VideoComp:
|
|
683
|
-
Bitmap:
|
|
1129
|
+
ProviderComp: Le,
|
|
1130
|
+
ViewComp: Te,
|
|
1131
|
+
VideoComp: Re,
|
|
1132
|
+
Bitmap: De
|
|
684
1133
|
},
|
|
685
|
-
props:
|
|
686
|
-
emits:
|
|
687
|
-
setup(
|
|
688
|
-
const
|
|
689
|
-
if (!
|
|
1134
|
+
props: q,
|
|
1135
|
+
emits: j,
|
|
1136
|
+
setup(o) {
|
|
1137
|
+
const P = J(() => {
|
|
1138
|
+
if (!o.url)
|
|
690
1139
|
return !1;
|
|
691
|
-
const
|
|
692
|
-
return
|
|
693
|
-
}),
|
|
694
|
-
if (!
|
|
1140
|
+
const r = o.url.toLowerCase();
|
|
1141
|
+
return r.includes(".png") && !r.includes(".mp4") && !r.includes(".webm");
|
|
1142
|
+
}), t = J(() => {
|
|
1143
|
+
if (!o.url)
|
|
695
1144
|
return !1;
|
|
696
|
-
const
|
|
697
|
-
return
|
|
1145
|
+
const r = o.url.toLowerCase();
|
|
1146
|
+
return r.includes(".mp4") || r.includes(".webm") || r.includes(".mov");
|
|
698
1147
|
});
|
|
699
1148
|
return {
|
|
700
|
-
isApng:
|
|
701
|
-
isVideo:
|
|
1149
|
+
isApng: P,
|
|
1150
|
+
isVideo: t
|
|
702
1151
|
};
|
|
703
1152
|
}
|
|
704
1153
|
});
|
|
705
|
-
function
|
|
706
|
-
const
|
|
707
|
-
return
|
|
708
|
-
default:
|
|
709
|
-
|
|
710
|
-
|
|
1154
|
+
function Ue(o, P, t, r, p, l) {
|
|
1155
|
+
const v = K("ViewComp"), _ = K("ApngComp"), w = K("VideoComp"), e = K("Bitmap"), n = K("ProviderComp");
|
|
1156
|
+
return H(), Y(n, null, {
|
|
1157
|
+
default: he(() => [
|
|
1158
|
+
ve(v),
|
|
1159
|
+
o.isApng && o.url ? (H(), Y(_, {
|
|
711
1160
|
key: 0,
|
|
712
|
-
url:
|
|
713
|
-
loop:
|
|
714
|
-
status:
|
|
715
|
-
"onUpdate:status":
|
|
716
|
-
}, null, 8, ["url", "loop", "status"])) :
|
|
1161
|
+
url: o.url,
|
|
1162
|
+
loop: o.loop,
|
|
1163
|
+
status: o.status,
|
|
1164
|
+
"onUpdate:status": P[0] || (P[0] = (a) => o.$emit("update:status", a))
|
|
1165
|
+
}, null, 8, ["url", "loop", "status"])) : o.isVideo && o.url ? (H(), Y(w, {
|
|
717
1166
|
key: 1,
|
|
718
|
-
url:
|
|
719
|
-
loop:
|
|
720
|
-
status:
|
|
721
|
-
"onUpdate:status":
|
|
722
|
-
}, null, 8, ["url", "loop", "status"])) : (
|
|
1167
|
+
url: o.url,
|
|
1168
|
+
loop: o.loop,
|
|
1169
|
+
status: o.status,
|
|
1170
|
+
"onUpdate:status": P[1] || (P[1] = (a) => o.$emit("update:status", a))
|
|
1171
|
+
}, null, 8, ["url", "loop", "status"])) : (H(), Y(e, {
|
|
723
1172
|
key: 2,
|
|
724
|
-
data:
|
|
725
|
-
loop:
|
|
726
|
-
status:
|
|
727
|
-
onSetData:
|
|
728
|
-
"onUpdate:status":
|
|
1173
|
+
data: o.data,
|
|
1174
|
+
loop: o.loop,
|
|
1175
|
+
status: o.status,
|
|
1176
|
+
onSetData: P[2] || (P[2] = (a) => o.$emit("setData", a)),
|
|
1177
|
+
"onUpdate:status": P[3] || (P[3] = (a) => o.$emit("update:status", a))
|
|
729
1178
|
}, null, 8, ["data", "loop", "status"]))
|
|
730
1179
|
]),
|
|
731
1180
|
_: 1
|
|
732
1181
|
});
|
|
733
1182
|
}
|
|
734
|
-
const
|
|
1183
|
+
const re = /* @__PURE__ */ xe(Oe, [["render", Ue]]), Ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
735
1184
|
__proto__: null
|
|
736
1185
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
737
|
-
|
|
738
|
-
|
|
1186
|
+
re.install = (o) => {
|
|
1187
|
+
o.component(re.name || "VkPixiFrame", re);
|
|
739
1188
|
};
|
|
740
1189
|
export {
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
1190
|
+
Ye as TickerStatus,
|
|
1191
|
+
re as VkPixiFrame,
|
|
1192
|
+
Ne as VkPixiFrameApng,
|
|
1193
|
+
De as VkPixiFrameBitmap,
|
|
1194
|
+
Ge as VkPixiFrameBitmapGenerator,
|
|
1195
|
+
je as VkPixiFrameBufferImage,
|
|
1196
|
+
ze as VkPixiFrameCore,
|
|
1197
|
+
Le as VkPixiFrameProvider,
|
|
1198
|
+
Re as VkPixiFrameVideo,
|
|
1199
|
+
Te as VkPixiFrameView,
|
|
1200
|
+
Ke as __VkPixiFrame,
|
|
1201
|
+
re as default,
|
|
1202
|
+
ce as usePixiApp,
|
|
1203
|
+
z as useSprite
|
|
755
1204
|
};
|