@netless/app-slide 0.3.0-canary.11 → 0.3.0-canary.13
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/Logger.d.ts +12 -0
- package/dist/SlideViewer/footer.d.ts +11 -0
- package/dist/{SlideViewer.d.ts → SlideViewer/index.d.ts} +24 -31
- package/dist/SlideViewer/sidebar.d.ts +12 -0
- package/dist/SlideViewer/typings.d.ts +18 -0
- package/dist/SlideViewer/utils.d.ts +7 -0
- package/dist/connect.d.ts +14 -0
- package/dist/constants.d.ts +1 -1
- package/dist/icons/index.d.ts +5 -0
- package/dist/index.d.ts +5 -7
- package/dist/main.iife.js +2 -2
- package/dist/main.iife.js.map +1 -1
- package/dist/main.js +2 -2
- package/dist/main.js.map +1 -1
- package/dist/main.mjs +834 -664
- package/dist/main.mjs.map +1 -1
- package/dist/preview.d.ts +5 -0
- package/dist/typings.d.ts +0 -1
- package/dist/utils.d.ts +12 -0
- package/package.json +3 -2
- package/src/Logger.ts +38 -0
- package/src/SlideViewer/footer.ts +146 -0
- package/src/SlideViewer/index.ts +235 -0
- package/src/SlideViewer/sidebar.ts +139 -0
- package/src/SlideViewer/typings.ts +21 -0
- package/src/SlideViewer/utils.ts +37 -0
- package/src/connect.ts +116 -0
- package/src/constants.ts +1 -1
- package/src/icons/index.ts +5 -0
- package/src/index.ts +48 -211
- package/src/preview.ts +21 -0
- package/src/typings.ts +1 -3
- package/src/utils.ts +90 -0
- package/src/SlideViewer.ts +0 -576
package/dist/main.mjs
CHANGED
|
@@ -1,6 +1,188 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
1
|
+
var vt = Object.defineProperty;
|
|
2
|
+
var mt = (e, t, s) => t in e ? vt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
|
+
var u = (e, t, s) => (mt(e, typeof t != "symbol" ? t + "" : t, s), s);
|
|
4
|
+
import { Slide as ce } from "@netless/slide";
|
|
5
|
+
import { Slide as lr } from "@netless/slide";
|
|
6
|
+
const wt = "!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", _t = 87, yt = 20, Se = [], kt = () => {
|
|
7
|
+
for (let e = 0; e < yt; e++)
|
|
8
|
+
Se[e] = wt.charAt(Math.random() * _t);
|
|
9
|
+
return Se.join("");
|
|
10
|
+
};
|
|
11
|
+
function Ne(e) {
|
|
12
|
+
try {
|
|
13
|
+
return e();
|
|
14
|
+
} catch (t) {
|
|
15
|
+
console.error(t);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
class Me {
|
|
19
|
+
constructor() {
|
|
20
|
+
this.push = this.addDisposer, this.disposers = /* @__PURE__ */ new Map();
|
|
21
|
+
}
|
|
22
|
+
addDisposer(t, s = this.genUID()) {
|
|
23
|
+
return this.flush(s), this.disposers.set(s, Array.isArray(t) ? St(t) : t), s;
|
|
24
|
+
}
|
|
25
|
+
add(t, s = this.genUID()) {
|
|
26
|
+
const r = t();
|
|
27
|
+
return r ? this.addDisposer(r, s) : s;
|
|
28
|
+
}
|
|
29
|
+
addEventListener(t, s, r, o, i = this.genUID()) {
|
|
30
|
+
return t.addEventListener(s, r, o), this.addDisposer(() => t.removeEventListener(s, r, o), i), i;
|
|
31
|
+
}
|
|
32
|
+
setTimeout(t, s, r = this.genUID()) {
|
|
33
|
+
const o = window.setTimeout(() => {
|
|
34
|
+
this.remove(r), t();
|
|
35
|
+
}, s);
|
|
36
|
+
return this.addDisposer(() => window.clearTimeout(o), r);
|
|
37
|
+
}
|
|
38
|
+
setInterval(t, s, r = this.genUID()) {
|
|
39
|
+
const o = window.setInterval(t, s);
|
|
40
|
+
return this.addDisposer(() => window.clearInterval(o), r);
|
|
41
|
+
}
|
|
42
|
+
remove(t) {
|
|
43
|
+
const s = this.disposers.get(t);
|
|
44
|
+
return this.disposers.delete(t), s;
|
|
45
|
+
}
|
|
46
|
+
flush(t) {
|
|
47
|
+
const s = this.remove(t);
|
|
48
|
+
s && s();
|
|
49
|
+
}
|
|
50
|
+
flushAll() {
|
|
51
|
+
this.disposers.forEach(Ne), this.disposers.clear();
|
|
52
|
+
}
|
|
53
|
+
genUID() {
|
|
54
|
+
let t;
|
|
55
|
+
do
|
|
56
|
+
t = kt();
|
|
57
|
+
while (this.disposers.has(t));
|
|
58
|
+
return t;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function St(e) {
|
|
62
|
+
return () => e.forEach(Ne);
|
|
63
|
+
}
|
|
64
|
+
const H = "netless-app-slide", Pe = "https://convertcdn.netless.link/dynamicConvert";
|
|
65
|
+
class xt {
|
|
66
|
+
constructor() {
|
|
67
|
+
u(this, "threshold", 2);
|
|
68
|
+
u(this, "_map", /* @__PURE__ */ new Map());
|
|
69
|
+
u(this, "_queue", []);
|
|
70
|
+
}
|
|
71
|
+
set(t, s) {
|
|
72
|
+
return this._map.set(t, s), this._queue.includes(t) || this._queue.unshift(t), this._refresh(), () => {
|
|
73
|
+
this.delete(t);
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
delete(t) {
|
|
77
|
+
this._map.delete(t), this._queue = this._queue.filter((s) => s !== t), this._refresh();
|
|
78
|
+
}
|
|
79
|
+
focus(t) {
|
|
80
|
+
const s = this._queue.indexOf(t);
|
|
81
|
+
s >= 0 && this._queue.splice(s, 1), this._queue.unshift(t), this._refresh();
|
|
82
|
+
}
|
|
83
|
+
_refresh() {
|
|
84
|
+
let t;
|
|
85
|
+
this._queue.forEach((s, r) => {
|
|
86
|
+
!(t = this._map.get(s)) || (r < this.threshold ? t.unfreeze() : t.freeze());
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
const Te = new xt(), tr = function(t) {
|
|
91
|
+
t.on("focus", (s) => {
|
|
92
|
+
Te.focus(s.appId);
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
class Et {
|
|
96
|
+
constructor() {
|
|
97
|
+
this.a = /* @__PURE__ */ new Map(), this.b = /* @__PURE__ */ new Set();
|
|
98
|
+
}
|
|
99
|
+
emit(t, s) {
|
|
100
|
+
const r = this.a.get(t);
|
|
101
|
+
if (r)
|
|
102
|
+
for (const o of r)
|
|
103
|
+
try {
|
|
104
|
+
o(s);
|
|
105
|
+
} catch (i) {
|
|
106
|
+
console.error(i);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
on(t, s) {
|
|
110
|
+
let r = this.a.get(t);
|
|
111
|
+
if (r || (r = /* @__PURE__ */ new Set(), this.a.set(t, r)), r.add(s), r.size === 1)
|
|
112
|
+
for (const o of this.b)
|
|
113
|
+
o.e(t);
|
|
114
|
+
return () => {
|
|
115
|
+
this.off(t, s);
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
once(t, s) {
|
|
119
|
+
const r = (o) => (this.off(t, s), s(o));
|
|
120
|
+
return this.c = this.c || /* @__PURE__ */ new WeakMap(), this.c.set(s, r), this.on(t, r);
|
|
121
|
+
}
|
|
122
|
+
off(t, s) {
|
|
123
|
+
var r;
|
|
124
|
+
const o = this.a.get(t);
|
|
125
|
+
if (o) {
|
|
126
|
+
const i = o.delete(
|
|
127
|
+
((r = this.c) == null ? void 0 : r.get(s)) || s
|
|
128
|
+
);
|
|
129
|
+
if (o.size <= 0) {
|
|
130
|
+
this.a.delete(t);
|
|
131
|
+
for (const a of this.b)
|
|
132
|
+
a.d(t);
|
|
133
|
+
}
|
|
134
|
+
return i;
|
|
135
|
+
}
|
|
136
|
+
return !1;
|
|
137
|
+
}
|
|
138
|
+
clear(t) {
|
|
139
|
+
var s;
|
|
140
|
+
t ? (s = this.a.get(t)) == null || s.clear() : this.a.clear();
|
|
141
|
+
}
|
|
142
|
+
count(t) {
|
|
143
|
+
var s;
|
|
144
|
+
if (t)
|
|
145
|
+
return ((s = this.a.get(t)) == null ? void 0 : s.size) || 0;
|
|
146
|
+
{
|
|
147
|
+
let r = 0;
|
|
148
|
+
for (const o of this.a.values())
|
|
149
|
+
r += o.size;
|
|
150
|
+
return r;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
remit(t, s) {
|
|
154
|
+
var r;
|
|
155
|
+
let o;
|
|
156
|
+
const i = {
|
|
157
|
+
e: (a) => {
|
|
158
|
+
if (a === t)
|
|
159
|
+
try {
|
|
160
|
+
o = s(this);
|
|
161
|
+
} catch (n) {
|
|
162
|
+
console.error(n);
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
d: (a) => {
|
|
166
|
+
if (o && (!a || a === t))
|
|
167
|
+
try {
|
|
168
|
+
o();
|
|
169
|
+
} catch (n) {
|
|
170
|
+
console.error(n);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
return this.b.add(i), (r = this.a.get(t)) != null && r.size && i.e(t), () => {
|
|
175
|
+
this.b.delete(i), i.d();
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
destroy() {
|
|
179
|
+
this.clear();
|
|
180
|
+
for (const t of this.b)
|
|
181
|
+
t.d();
|
|
182
|
+
this.b.clear();
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
var Fe = { exports: {} }, It = {
|
|
4
186
|
aliceblue: [240, 248, 255],
|
|
5
187
|
antiquewhite: [250, 235, 215],
|
|
6
188
|
aqua: [0, 255, 255],
|
|
@@ -149,181 +331,312 @@ var Ce = { exports: {} }, ut = {
|
|
|
149
331
|
whitesmoke: [245, 245, 245],
|
|
150
332
|
yellow: [255, 255, 0],
|
|
151
333
|
yellowgreen: [154, 205, 50]
|
|
152
|
-
},
|
|
334
|
+
}, De = { exports: {} }, Ct = function(t) {
|
|
153
335
|
return !t || typeof t == "string" ? !1 : t instanceof Array || Array.isArray(t) || t.length >= 0 && (t.splice instanceof Function || Object.getOwnPropertyDescriptor(t, t.length - 1) && t.constructor.name !== "String");
|
|
154
|
-
},
|
|
336
|
+
}, $t = Ct, Lt = Array.prototype.concat, At = Array.prototype.slice, xe = De.exports = function(t) {
|
|
155
337
|
for (var s = [], r = 0, o = t.length; r < o; r++) {
|
|
156
|
-
var
|
|
157
|
-
|
|
338
|
+
var i = t[r];
|
|
339
|
+
$t(i) ? s = Lt.call(s, At.call(i)) : s.push(i);
|
|
158
340
|
}
|
|
159
341
|
return s;
|
|
160
342
|
};
|
|
161
|
-
|
|
343
|
+
xe.wrap = function(e) {
|
|
162
344
|
return function() {
|
|
163
|
-
return e(
|
|
345
|
+
return e(xe(arguments));
|
|
164
346
|
};
|
|
165
347
|
};
|
|
166
|
-
var
|
|
167
|
-
for (var
|
|
168
|
-
|
|
169
|
-
var
|
|
348
|
+
var Z = It, X = De.exports, Re = Object.hasOwnProperty, Ve = /* @__PURE__ */ Object.create(null);
|
|
349
|
+
for (var le in Z)
|
|
350
|
+
Re.call(Z, le) && (Ve[Z[le]] = le);
|
|
351
|
+
var y = Fe.exports = {
|
|
170
352
|
to: {},
|
|
171
353
|
get: {}
|
|
172
354
|
};
|
|
173
|
-
|
|
355
|
+
y.get = function(e) {
|
|
174
356
|
var t = e.substring(0, 3).toLowerCase(), s, r;
|
|
175
357
|
switch (t) {
|
|
176
358
|
case "hsl":
|
|
177
|
-
s =
|
|
359
|
+
s = y.get.hsl(e), r = "hsl";
|
|
178
360
|
break;
|
|
179
361
|
case "hwb":
|
|
180
|
-
s =
|
|
362
|
+
s = y.get.hwb(e), r = "hwb";
|
|
181
363
|
break;
|
|
182
364
|
default:
|
|
183
|
-
s =
|
|
365
|
+
s = y.get.rgb(e), r = "rgb";
|
|
184
366
|
break;
|
|
185
367
|
}
|
|
186
368
|
return s ? { model: r, value: s } : null;
|
|
187
369
|
};
|
|
188
|
-
|
|
370
|
+
y.get.rgb = function(e) {
|
|
189
371
|
if (!e)
|
|
190
372
|
return null;
|
|
191
|
-
var t = /^#([a-f0-9]{3,4})$/i, s = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i, r = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/, o = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,
|
|
192
|
-
if (
|
|
193
|
-
for (
|
|
194
|
-
var
|
|
195
|
-
|
|
373
|
+
var t = /^#([a-f0-9]{3,4})$/i, s = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i, r = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/, o = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/, i = /^(\w+)$/, a = [0, 0, 0, 1], n, l, p;
|
|
374
|
+
if (n = e.match(s)) {
|
|
375
|
+
for (p = n[2], n = n[1], l = 0; l < 3; l++) {
|
|
376
|
+
var c = l * 2;
|
|
377
|
+
a[l] = parseInt(n.slice(c, c + 2), 16);
|
|
196
378
|
}
|
|
197
|
-
|
|
198
|
-
} else if (
|
|
199
|
-
for (
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
} else if (
|
|
203
|
-
for (
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
} else if (
|
|
207
|
-
for (
|
|
208
|
-
|
|
209
|
-
|
|
379
|
+
p && (a[3] = parseInt(p, 16) / 255);
|
|
380
|
+
} else if (n = e.match(t)) {
|
|
381
|
+
for (n = n[1], p = n[3], l = 0; l < 3; l++)
|
|
382
|
+
a[l] = parseInt(n[l] + n[l], 16);
|
|
383
|
+
p && (a[3] = parseInt(p + p, 16) / 255);
|
|
384
|
+
} else if (n = e.match(r)) {
|
|
385
|
+
for (l = 0; l < 3; l++)
|
|
386
|
+
a[l] = parseInt(n[l + 1], 0);
|
|
387
|
+
n[4] && (n[5] ? a[3] = parseFloat(n[4]) * 0.01 : a[3] = parseFloat(n[4]));
|
|
388
|
+
} else if (n = e.match(o)) {
|
|
389
|
+
for (l = 0; l < 3; l++)
|
|
390
|
+
a[l] = Math.round(parseFloat(n[l + 1]) * 2.55);
|
|
391
|
+
n[4] && (n[5] ? a[3] = parseFloat(n[4]) * 0.01 : a[3] = parseFloat(n[4]));
|
|
210
392
|
} else
|
|
211
|
-
return (
|
|
212
|
-
for (
|
|
213
|
-
|
|
214
|
-
return
|
|
393
|
+
return (n = e.match(i)) ? n[1] === "transparent" ? [0, 0, 0, 0] : Re.call(Z, n[1]) ? (a = Z[n[1]], a[3] = 1, a) : null : null;
|
|
394
|
+
for (l = 0; l < 3; l++)
|
|
395
|
+
a[l] = N(a[l], 0, 255);
|
|
396
|
+
return a[3] = N(a[3], 0, 1), a;
|
|
215
397
|
};
|
|
216
|
-
|
|
398
|
+
y.get.hsl = function(e) {
|
|
217
399
|
if (!e)
|
|
218
400
|
return null;
|
|
219
401
|
var t = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, s = e.match(t);
|
|
220
402
|
if (s) {
|
|
221
|
-
var r = parseFloat(s[4]), o = (parseFloat(s[1]) % 360 + 360) % 360,
|
|
222
|
-
return [o,
|
|
403
|
+
var r = parseFloat(s[4]), o = (parseFloat(s[1]) % 360 + 360) % 360, i = N(parseFloat(s[2]), 0, 100), a = N(parseFloat(s[3]), 0, 100), n = N(isNaN(r) ? 1 : r, 0, 1);
|
|
404
|
+
return [o, i, a, n];
|
|
223
405
|
}
|
|
224
406
|
return null;
|
|
225
407
|
};
|
|
226
|
-
|
|
408
|
+
y.get.hwb = function(e) {
|
|
227
409
|
if (!e)
|
|
228
410
|
return null;
|
|
229
411
|
var t = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, s = e.match(t);
|
|
230
412
|
if (s) {
|
|
231
|
-
var r = parseFloat(s[4]), o = (parseFloat(s[1]) % 360 + 360) % 360,
|
|
232
|
-
return [o,
|
|
413
|
+
var r = parseFloat(s[4]), o = (parseFloat(s[1]) % 360 + 360) % 360, i = N(parseFloat(s[2]), 0, 100), a = N(parseFloat(s[3]), 0, 100), n = N(isNaN(r) ? 1 : r, 0, 1);
|
|
414
|
+
return [o, i, a, n];
|
|
233
415
|
}
|
|
234
416
|
return null;
|
|
235
417
|
};
|
|
236
|
-
|
|
237
|
-
var e =
|
|
238
|
-
return "#" +
|
|
418
|
+
y.to.hex = function() {
|
|
419
|
+
var e = X(arguments);
|
|
420
|
+
return "#" + se(e[0]) + se(e[1]) + se(e[2]) + (e[3] < 1 ? se(Math.round(e[3] * 255)) : "");
|
|
239
421
|
};
|
|
240
|
-
|
|
241
|
-
var e =
|
|
422
|
+
y.to.rgb = function() {
|
|
423
|
+
var e = X(arguments);
|
|
242
424
|
return e.length < 4 || e[3] === 1 ? "rgb(" + Math.round(e[0]) + ", " + Math.round(e[1]) + ", " + Math.round(e[2]) + ")" : "rgba(" + Math.round(e[0]) + ", " + Math.round(e[1]) + ", " + Math.round(e[2]) + ", " + e[3] + ")";
|
|
243
425
|
};
|
|
244
|
-
|
|
245
|
-
var e =
|
|
426
|
+
y.to.rgb.percent = function() {
|
|
427
|
+
var e = X(arguments), t = Math.round(e[0] / 255 * 100), s = Math.round(e[1] / 255 * 100), r = Math.round(e[2] / 255 * 100);
|
|
246
428
|
return e.length < 4 || e[3] === 1 ? "rgb(" + t + "%, " + s + "%, " + r + "%)" : "rgba(" + t + "%, " + s + "%, " + r + "%, " + e[3] + ")";
|
|
247
429
|
};
|
|
248
|
-
|
|
249
|
-
var e =
|
|
430
|
+
y.to.hsl = function() {
|
|
431
|
+
var e = X(arguments);
|
|
250
432
|
return e.length < 4 || e[3] === 1 ? "hsl(" + e[0] + ", " + e[1] + "%, " + e[2] + "%)" : "hsla(" + e[0] + ", " + e[1] + "%, " + e[2] + "%, " + e[3] + ")";
|
|
251
433
|
};
|
|
252
|
-
|
|
253
|
-
var e =
|
|
434
|
+
y.to.hwb = function() {
|
|
435
|
+
var e = X(arguments), t = "";
|
|
254
436
|
return e.length >= 4 && e[3] !== 1 && (t = ", " + e[3]), "hwb(" + e[0] + ", " + e[1] + "%, " + e[2] + "%" + t + ")";
|
|
255
437
|
};
|
|
256
|
-
|
|
257
|
-
return
|
|
438
|
+
y.to.keyword = function(e) {
|
|
439
|
+
return Ve[e.slice(0, 3)];
|
|
258
440
|
};
|
|
259
|
-
function
|
|
441
|
+
function N(e, t, s) {
|
|
260
442
|
return Math.min(Math.max(t, e), s);
|
|
261
443
|
}
|
|
262
|
-
function
|
|
444
|
+
function se(e) {
|
|
263
445
|
var t = Math.round(e).toString(16).toUpperCase();
|
|
264
446
|
return t.length < 2 ? "0" + t : t;
|
|
265
447
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
return
|
|
270
|
-
}
|
|
271
|
-
function
|
|
448
|
+
function K() {
|
|
449
|
+
}
|
|
450
|
+
function g(e) {
|
|
451
|
+
return document.createElement(e);
|
|
452
|
+
}
|
|
453
|
+
function Ee(e, t) {
|
|
454
|
+
const s = g(e);
|
|
455
|
+
return _(s, t), s;
|
|
456
|
+
}
|
|
457
|
+
function F(e, t) {
|
|
458
|
+
return e.appendChild(t);
|
|
459
|
+
}
|
|
460
|
+
function b(e) {
|
|
461
|
+
return `${H}-${e}`;
|
|
462
|
+
}
|
|
463
|
+
function _(e, t) {
|
|
464
|
+
e.className = b(t);
|
|
465
|
+
}
|
|
466
|
+
function zt(e) {
|
|
467
|
+
return e.endsWith("/") ? e.slice(0, -1) : e;
|
|
468
|
+
}
|
|
469
|
+
function Ie(e, t) {
|
|
470
|
+
if (typeof e == "object" && e !== null)
|
|
471
|
+
return e[t];
|
|
472
|
+
}
|
|
473
|
+
function Ce() {
|
|
474
|
+
let e;
|
|
475
|
+
return [new Promise((s) => {
|
|
476
|
+
e = s;
|
|
477
|
+
}), e];
|
|
478
|
+
}
|
|
479
|
+
function Ot(e) {
|
|
480
|
+
const t = e.room, s = e.displayer;
|
|
481
|
+
return t ? () => t.calibrationTimestamp : s ? () => s.beginTimestamp + s.progressTime : () => Date.now();
|
|
482
|
+
}
|
|
483
|
+
function Ue(e) {
|
|
272
484
|
try {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
485
|
+
let t = window.getComputedStyle(e).backgroundColor;
|
|
486
|
+
if (t !== "rgba(0, 0, 0, 0)" && t !== "transparent")
|
|
487
|
+
return t = Nt(t), console.log("[Slide] guess bg color:", t), t;
|
|
488
|
+
if (e.parentElement)
|
|
489
|
+
return Ue(e.parentElement);
|
|
490
|
+
} catch {
|
|
276
491
|
}
|
|
492
|
+
return "#ffffff";
|
|
277
493
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
return this.addDisposer(() => window.clearInterval(o), r);
|
|
494
|
+
function Nt(e) {
|
|
495
|
+
const t = Fe.exports.get(e);
|
|
496
|
+
if (t && t.model === "rgb") {
|
|
497
|
+
const s = t.value, o = (((Math.round(s[0]) & 255) << 16) + ((Math.round(s[1]) & 255) << 8) + (Math.round(s[2]) & 255)).toString(16);
|
|
498
|
+
return "#" + "000000".substring(o.length) + o;
|
|
499
|
+
} else
|
|
500
|
+
return e;
|
|
501
|
+
}
|
|
502
|
+
function qe(e, t) {
|
|
503
|
+
return `${zt(t || Pe)}/${e}`;
|
|
504
|
+
}
|
|
505
|
+
async function Mt({ taskId: e, url: t }) {
|
|
506
|
+
const s = qe(e, t), r = `${s}/preview/1.png`, o = `${s}/jsonOutput/slide-1.json`, i = new Promise((n) => {
|
|
507
|
+
const l = new Image();
|
|
508
|
+
l.onload = () => n(l), l.onerror = () => n(null), l.src = r;
|
|
509
|
+
}), a = fetch(o).then((n) => n.json());
|
|
510
|
+
return { preview: await i, slide: await a };
|
|
511
|
+
}
|
|
512
|
+
function Pt(e) {
|
|
513
|
+
if (typeof document < "u") {
|
|
514
|
+
const t = () => e(document.visibilityState === "visible");
|
|
515
|
+
return document.addEventListener("visibilitychange", t), () => document.removeEventListener("visibilitychange", t);
|
|
301
516
|
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
517
|
+
return K;
|
|
518
|
+
}
|
|
519
|
+
const Tt = `.netless-app-slide-tele-fancy-scrollbar{overscroll-behavior:contain;overflow:auto;overflow-y:scroll;overflow-y:overlay;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;scrollbar-width:auto}.netless-app-slide-tele-fancy-scrollbar::-webkit-scrollbar{height:8px;width:8px}.netless-app-slide-tele-fancy-scrollbar::-webkit-scrollbar-track{background-color:transparent}.netless-app-slide-tele-fancy-scrollbar::-webkit-scrollbar-thumb{background-color:#444e601a;background-color:transparent;border-radius:4px;transition:background-color .4s}.netless-app-slide-tele-fancy-scrollbar:hover::-webkit-scrollbar-thumb{background-color:#444e601a}.netless-app-slide-tele-fancy-scrollbar::-webkit-scrollbar-thumb:hover{background-color:#444e6033}.netless-app-slide-tele-fancy-scrollbar::-webkit-scrollbar-thumb:active{background-color:#444e6033}.netless-app-slide-tele-fancy-scrollbar::-webkit-scrollbar-thumb:vertical{min-height:50px}.netless-app-slide-tele-fancy-scrollbar::-webkit-scrollbar-thumb:horizontal{min-width:50px}.netless-app-slide-content{position:relative;height:100%;overflow:hidden}.netless-app-slide-slide{width:100%;height:100%;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.netless-app-slide-preview-mask{display:none;position:absolute;z-index:10200;top:0;left:0;width:100%;height:100%}.netless-app-slide-preview{display:flex;flex-direction:column;align-items:center;position:absolute;z-index:10300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.netless-app-slide-preview-active .netless-app-slide-preview-mask{display:block}.netless-app-slide-preview-active .netless-app-slide-preview{transform:translate(0)}.netless-app-slide-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.netless-app-slide-preview-page:hover,.netless-app-slide-preview-page.netless-app-slide-preview-page-active{border-color:#444e601a}.netless-app-slide-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-slide-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;color:#5f5f5f;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.netless-app-slide-overlay{display:flex;align-items:center;justify-content:center;position:absolute;z-index:10100;top:0;left:0;width:100%;height:100%;background:rgba(255,0,0,.25);transition:opacity .3s;opacity:0;pointer-events:none}.netless-app-slide-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.netless-app-slide-float-footer{width:100%;min-height:26px;position:absolute;left:0;bottom:0;z-index:2000;background:rgba(249,249,252,.9);transition:opacity .4s}.netless-app-slide-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-slide-footer-btn:hover{background:transparent!important}}.netless-app-slide-footer-btn>svg{width:100%;height:100%}.netless-app-slide-footer-btn>svg:nth-of-type(2){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-slide-footer-btn~.netless-app-slide-footer-btn{margin-left:15px}.netless-app-slide-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-slide-page-number{display:flex;align-items:center;height:26px;margin-left:auto;font-size:13px;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;word-break:keep-all;font-variant-numeric:tabular-nums}.netless-app-slide-page-number-input{border:none;outline:none;width:3em;margin:0;padding:0 .5em 0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;font-family:inherit;border-radius:2px;color:currentColor;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";background:transparent;transition:background .4s;font-variant-numeric:tabular-nums;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-page-number-input:hover,.netless-app-slide-page-number-input:focus,.netless-app-slide-page-number-input:active{user-select:text;background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-slide-readonly .netless-app-slide-footer-btn{cursor:not-allowed}.netless-app-slide-readonly .netless-app-slide-footer-btn:hover{background:transparent}.netless-app-slide-readonly .netless-app-slide-page-number-input{cursor:not-allowed}.netless-app-slide-readonly .netless-app-slide-page-number-input:hover,.netless-app-slide-readonly .netless-app-slide-page-number-input:focus,.netless-app-slide-readonly .netless-app-slide-page-number-input:active{background:transparent;box-shadow:none}.netless-app-slide-readonly .netless-app-slide-page-number-input:disabled{color:inherit}.netless-app-slide-readonly.netless-app-slide-float-footer{display:none}.telebox-color-scheme-dark .netless-app-slide-page-number-input:active,.telebox-color-scheme-dark .netless-app-slide-page-number-input:focus,.telebox-color-scheme-dark .netless-app-slide-page-number-input:hover{color:currentColor;background:#25282e}.telebox-color-scheme-dark .netless-app-slide-footer{border-top:none}.telebox-color-scheme-dark .netless-app-slide-footer-btn:hover{background:#212126}.telebox-color-scheme-dark .netless-app-slide-preview{background:rgba(50,50,50,.9)}.netless-app-slide-preview-wrapper{width:100%;height:100%;overflow:hidden;display:flex;flex-flow:column nowrap}.netless-app-slide-preview-wrapper .netless-app-slide-content{flex:1}.netless-app-slide-preview-wrapper .netless-app-slide-footer{flex-shrink:0}
|
|
520
|
+
`;
|
|
521
|
+
function Ft(e) {
|
|
522
|
+
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
523
|
+
s.setAttribute("class", `${e}-footer-icon-sidebar`), s.setAttribute("viewBox", "0 0 64 64");
|
|
524
|
+
const r = document.createElementNS(t, "path");
|
|
525
|
+
return r.setAttribute("fill", "currentColor"), r.setAttribute(
|
|
526
|
+
"d",
|
|
527
|
+
"M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"
|
|
528
|
+
), s.appendChild(r), s;
|
|
529
|
+
}
|
|
530
|
+
function Dt(e) {
|
|
531
|
+
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
532
|
+
s.setAttribute("class", `${e}-footer-icon-arrow-left`), s.setAttribute("viewBox", "0 0 500 500");
|
|
533
|
+
const r = document.createElementNS(t, "path");
|
|
534
|
+
return r.setAttribute("fill", "currentColor"), r.setAttribute(
|
|
535
|
+
"d",
|
|
536
|
+
"M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"
|
|
537
|
+
), s.appendChild(r), s;
|
|
538
|
+
}
|
|
539
|
+
function Rt(e) {
|
|
540
|
+
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
541
|
+
s.setAttribute("class", `${e}-footer-icon-play`), s.setAttribute("viewBox", "0 0 500 500");
|
|
542
|
+
const r = document.createElementNS(t, "path");
|
|
543
|
+
return r.setAttribute("fill", "currentColor"), r.setAttribute(
|
|
544
|
+
"d",
|
|
545
|
+
"M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"
|
|
546
|
+
), s.appendChild(r), s;
|
|
547
|
+
}
|
|
548
|
+
function Vt(e) {
|
|
549
|
+
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
550
|
+
s.setAttribute("class", `${e}-footer-icon-pause`), s.setAttribute("viewBox", "0 0 500 500");
|
|
551
|
+
const r = document.createElementNS(t, "path");
|
|
552
|
+
return r.setAttribute("fill", "currentColor"), r.setAttribute(
|
|
553
|
+
"d",
|
|
554
|
+
"M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"
|
|
555
|
+
), s.appendChild(r), s;
|
|
556
|
+
}
|
|
557
|
+
function Ut(e) {
|
|
558
|
+
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
559
|
+
s.setAttribute("class", `${e}-footer-icon-arrow-right`), s.setAttribute("viewBox", "0 0 500 500");
|
|
560
|
+
const r = document.createElementNS(t, "path");
|
|
561
|
+
return r.setAttribute("fill", "currentColor"), r.setAttribute(
|
|
562
|
+
"d",
|
|
563
|
+
"M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"
|
|
564
|
+
), s.appendChild(r), s;
|
|
565
|
+
}
|
|
566
|
+
function qt() {
|
|
567
|
+
let e = K;
|
|
568
|
+
const t = (d) => {
|
|
569
|
+
e = d;
|
|
570
|
+
};
|
|
571
|
+
let s = K;
|
|
572
|
+
const r = (d) => {
|
|
573
|
+
s = d;
|
|
574
|
+
};
|
|
575
|
+
let o = K;
|
|
576
|
+
const i = (d) => {
|
|
577
|
+
o = d;
|
|
578
|
+
};
|
|
579
|
+
let a = !1, n = !1, l = 0, p = 0;
|
|
580
|
+
const c = g("div");
|
|
581
|
+
_(c, "footer");
|
|
582
|
+
const h = g("button");
|
|
583
|
+
_(h, "btn-sidebar"), h.classList.add(b("footer-btn")), h.appendChild(Ft(H)), h.onclick = function() {
|
|
584
|
+
a || s();
|
|
585
|
+
}, h.style.display = "none", c.appendChild(h);
|
|
586
|
+
const v = g("div");
|
|
587
|
+
_(v, "page-jumps");
|
|
588
|
+
const E = g("button");
|
|
589
|
+
_(E, "btn-page-back"), E.classList.add(b("footer-btn")), E.appendChild(Dt(H)), E.onclick = function() {
|
|
590
|
+
a || e(l - 1);
|
|
591
|
+
}, v.appendChild(E);
|
|
592
|
+
const m = g("button");
|
|
593
|
+
_(m, "btn-page-play"), m.classList.add(b("footer-btn")), m.appendChild(Rt(H)), m.appendChild(Vt(H));
|
|
594
|
+
let V = 0;
|
|
595
|
+
m.onclick = function() {
|
|
596
|
+
a || (m.classList.add(b("footer-btn-playing")), o(), clearTimeout(V), V = setTimeout(() => {
|
|
597
|
+
m.classList.remove(b("footer-btn-playing"));
|
|
598
|
+
}, 500));
|
|
599
|
+
}, v.appendChild(m);
|
|
600
|
+
const L = g("button");
|
|
601
|
+
_(L, "btn-page-next"), L.classList.add(b("footer-btn")), L.appendChild(Ut(H)), L.onclick = function() {
|
|
602
|
+
a || e(l + 1);
|
|
603
|
+
}, v.appendChild(L);
|
|
604
|
+
const A = g("div");
|
|
605
|
+
_(A, "page-number");
|
|
606
|
+
const S = g("input");
|
|
607
|
+
_(S, "page-number-input"), S.value = String(l + 1), S.onchange = function() {
|
|
608
|
+
a || S.value && e(Number(S.value) - 1);
|
|
609
|
+
};
|
|
610
|
+
const f = g("span");
|
|
611
|
+
_(f, "total-page"), f.textContent = " / ", A.appendChild(S), A.appendChild(f), c.appendChild(v), c.appendChild(A);
|
|
612
|
+
const k = b("readonly");
|
|
613
|
+
function I(d) {
|
|
614
|
+
a !== d && (a = d, c.classList.toggle(k, a), S.disabled = a);
|
|
305
615
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
s && s();
|
|
616
|
+
function z(d) {
|
|
617
|
+
n !== d && (n = d, h.style.display = n ? "" : "none");
|
|
309
618
|
}
|
|
310
|
-
|
|
311
|
-
|
|
619
|
+
function U(d, q = !1) {
|
|
620
|
+
(q || l !== d) && (l = d, S.value = String(l + 1));
|
|
312
621
|
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
do
|
|
316
|
-
t = _t();
|
|
317
|
-
while (this.disposers.has(t));
|
|
318
|
-
return t;
|
|
622
|
+
function W(d) {
|
|
623
|
+
p !== d && (p = d, f.textContent = ` / ${p}`);
|
|
319
624
|
}
|
|
625
|
+
return {
|
|
626
|
+
$footer: c,
|
|
627
|
+
$pageNumberInput: S,
|
|
628
|
+
set_readonly: I,
|
|
629
|
+
set_sidebar: z,
|
|
630
|
+
set_page_index: U,
|
|
631
|
+
set_page_count: W,
|
|
632
|
+
on_new_page_index: t,
|
|
633
|
+
on_toggle_preview: r,
|
|
634
|
+
on_play: i
|
|
635
|
+
};
|
|
320
636
|
}
|
|
321
|
-
|
|
322
|
-
return () => e.forEach(Le);
|
|
323
|
-
}
|
|
324
|
-
const N = typeof window < "u", Ne = N && !("onscroll" in window) || typeof navigator < "u" && /(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent), Oe = N && "IntersectionObserver" in window, De = N && "classList" in document.createElement("p"), Me = N && window.devicePixelRatio > 1, yt = {
|
|
637
|
+
const P = typeof window < "u", Be = P && !("onscroll" in window) || typeof navigator < "u" && /(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent), He = P && "IntersectionObserver" in window, je = P && "classList" in document.createElement("p"), Ge = P && window.devicePixelRatio > 1, Bt = {
|
|
325
638
|
elements_selector: ".lazy",
|
|
326
|
-
container:
|
|
639
|
+
container: Be || P ? document : null,
|
|
327
640
|
threshold: 300,
|
|
328
641
|
thresholds: null,
|
|
329
642
|
data_src: "src",
|
|
@@ -354,7 +667,7 @@ const N = typeof window < "u", Ne = N && !("onscroll" in window) || typeof navig
|
|
|
354
667
|
callback_cancel: null,
|
|
355
668
|
use_native: !1,
|
|
356
669
|
restore_on_error: !1
|
|
357
|
-
},
|
|
670
|
+
}, We = (e) => Object.assign({}, Bt, e), $e = function(e, t) {
|
|
358
671
|
let s;
|
|
359
672
|
const r = "LazyLoad::Initialized", o = new e(t);
|
|
360
673
|
try {
|
|
@@ -363,21 +676,21 @@ const N = typeof window < "u", Ne = N && !("onscroll" in window) || typeof navig
|
|
|
363
676
|
s = document.createEvent("CustomEvent"), s.initCustomEvent(r, !1, !1, { instance: o });
|
|
364
677
|
}
|
|
365
678
|
window.dispatchEvent(s);
|
|
366
|
-
},
|
|
679
|
+
}, Ht = (e, t) => {
|
|
367
680
|
if (!!t)
|
|
368
681
|
if (!t.length)
|
|
369
|
-
|
|
682
|
+
$e(e, t);
|
|
370
683
|
else
|
|
371
684
|
for (let s = 0, r; r = t[s]; s += 1)
|
|
372
|
-
|
|
373
|
-
},
|
|
374
|
-
var r =
|
|
685
|
+
$e(e, r);
|
|
686
|
+
}, $ = "src", ue = "srcset", pe = "sizes", Je = "poster", Y = "llOriginalAttrs", Ze = "data", he = "loading", Ke = "loaded", Qe = "applied", jt = "entered", fe = "error", Xe = "native", Ye = "data-", et = "ll-status", w = (e, t) => e.getAttribute(Ye + t), Gt = (e, t, s) => {
|
|
687
|
+
var r = Ye + t;
|
|
375
688
|
if (s === null) {
|
|
376
689
|
e.removeAttribute(r);
|
|
377
690
|
return;
|
|
378
691
|
}
|
|
379
692
|
e.setAttribute(r, s);
|
|
380
|
-
},
|
|
693
|
+
}, ee = (e) => w(e, et), R = (e, t) => Gt(e, et, t), oe = (e) => R(e, null), ge = (e) => ee(e) === null, Wt = (e) => ee(e) === he, Jt = (e) => ee(e) === fe, be = (e) => ee(e) === Xe, Zt = [he, Ke, Qe, fe], Kt = (e) => Zt.indexOf(ee(e)) >= 0, T = (e, t, s, r) => {
|
|
381
694
|
if (!!e) {
|
|
382
695
|
if (r !== void 0) {
|
|
383
696
|
e(t, s, r);
|
|
@@ -389,541 +702,416 @@ const N = typeof window < "u", Ne = N && !("onscroll" in window) || typeof navig
|
|
|
389
702
|
}
|
|
390
703
|
e(t);
|
|
391
704
|
}
|
|
392
|
-
},
|
|
393
|
-
if (
|
|
705
|
+
}, G = (e, t) => {
|
|
706
|
+
if (je) {
|
|
394
707
|
e.classList.add(t);
|
|
395
708
|
return;
|
|
396
709
|
}
|
|
397
710
|
e.className += (e.className ? " " : "") + t;
|
|
398
|
-
},
|
|
399
|
-
if (
|
|
711
|
+
}, x = (e, t) => {
|
|
712
|
+
if (je) {
|
|
400
713
|
e.classList.remove(t);
|
|
401
714
|
return;
|
|
402
715
|
}
|
|
403
716
|
e.className = e.className.replace(new RegExp("(^|\\s+)" + t + "(\\s+|$)"), " ").replace(/^\s+/, "").replace(/\s+$/, "");
|
|
404
|
-
},
|
|
717
|
+
}, Qt = (e) => {
|
|
405
718
|
e.llTempImage = document.createElement("IMG");
|
|
406
|
-
},
|
|
719
|
+
}, Xt = (e) => {
|
|
407
720
|
delete e.llTempImage;
|
|
408
|
-
},
|
|
721
|
+
}, tt = (e) => e.llTempImage, ne = (e, t) => {
|
|
409
722
|
if (!t)
|
|
410
723
|
return;
|
|
411
724
|
const s = t._observer;
|
|
412
725
|
!s || s.unobserve(e);
|
|
413
|
-
},
|
|
726
|
+
}, Yt = (e) => {
|
|
414
727
|
e.disconnect();
|
|
415
|
-
},
|
|
416
|
-
t.unobserve_entered &&
|
|
417
|
-
},
|
|
728
|
+
}, es = (e, t, s) => {
|
|
729
|
+
t.unobserve_entered && ne(e, s);
|
|
730
|
+
}, ve = (e, t) => {
|
|
418
731
|
!e || (e.loadingCount += t);
|
|
419
|
-
},
|
|
732
|
+
}, ts = (e) => {
|
|
420
733
|
!e || (e.toLoadCount -= 1);
|
|
421
|
-
},
|
|
734
|
+
}, st = (e, t) => {
|
|
422
735
|
!e || (e.toLoadCount = t);
|
|
423
|
-
},
|
|
736
|
+
}, ss = (e) => e.loadingCount > 0, rs = (e) => e.toLoadCount > 0, rt = (e) => {
|
|
424
737
|
let t = [];
|
|
425
738
|
for (let s = 0, r; r = e.children[s]; s += 1)
|
|
426
739
|
r.tagName === "SOURCE" && t.push(r);
|
|
427
740
|
return t;
|
|
428
|
-
},
|
|
741
|
+
}, me = (e, t) => {
|
|
429
742
|
const s = e.parentNode;
|
|
430
743
|
if (!s || s.tagName !== "PICTURE")
|
|
431
744
|
return;
|
|
432
|
-
|
|
433
|
-
},
|
|
434
|
-
|
|
435
|
-
},
|
|
436
|
-
if (
|
|
745
|
+
rt(s).forEach(t);
|
|
746
|
+
}, ot = (e, t) => {
|
|
747
|
+
rt(e).forEach(t);
|
|
748
|
+
}, ae = [$], nt = [$, Je], Q = [$, ue, pe], at = [Ze], ie = (e) => !!e[Y], it = (e) => e[Y], lt = (e) => delete e[Y], j = (e, t) => {
|
|
749
|
+
if (ie(e))
|
|
437
750
|
return;
|
|
438
751
|
const s = {};
|
|
439
752
|
t.forEach((r) => {
|
|
440
753
|
s[r] = e.getAttribute(r);
|
|
441
|
-
}), e[
|
|
442
|
-
},
|
|
443
|
-
|
|
444
|
-
},
|
|
754
|
+
}), e[Y] = s;
|
|
755
|
+
}, os = (e) => {
|
|
756
|
+
ie(e) || (e[Y] = { backgroundImage: e.style.backgroundImage });
|
|
757
|
+
}, ns = (e, t, s) => {
|
|
445
758
|
if (!s) {
|
|
446
759
|
e.removeAttribute(t);
|
|
447
760
|
return;
|
|
448
761
|
}
|
|
449
762
|
e.setAttribute(t, s);
|
|
450
|
-
},
|
|
451
|
-
if (!
|
|
763
|
+
}, D = (e, t) => {
|
|
764
|
+
if (!ie(e))
|
|
452
765
|
return;
|
|
453
|
-
const s =
|
|
766
|
+
const s = it(e);
|
|
454
767
|
t.forEach((r) => {
|
|
455
|
-
|
|
768
|
+
ns(e, r, s[r]);
|
|
456
769
|
});
|
|
457
|
-
},
|
|
458
|
-
if (!
|
|
770
|
+
}, as = (e) => {
|
|
771
|
+
if (!ie(e))
|
|
459
772
|
return;
|
|
460
|
-
const t =
|
|
773
|
+
const t = it(e);
|
|
461
774
|
e.style.backgroundImage = t.backgroundImage;
|
|
462
|
-
},
|
|
463
|
-
|
|
464
|
-
},
|
|
465
|
-
|
|
466
|
-
},
|
|
775
|
+
}, ct = (e, t, s) => {
|
|
776
|
+
G(e, t.class_applied), R(e, Qe), s && (t.unobserve_completed && ne(e, t), T(t.callback_applied, e, s));
|
|
777
|
+
}, dt = (e, t, s) => {
|
|
778
|
+
G(e, t.class_loading), R(e, he), s && (ve(s, 1), T(t.callback_loading, e, s));
|
|
779
|
+
}, M = (e, t, s) => {
|
|
467
780
|
!s || e.setAttribute(t, s);
|
|
468
|
-
},
|
|
469
|
-
|
|
470
|
-
},
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
}),
|
|
474
|
-
},
|
|
475
|
-
|
|
476
|
-
},
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
}),
|
|
480
|
-
},
|
|
481
|
-
|
|
482
|
-
},
|
|
483
|
-
const r =
|
|
484
|
-
!
|
|
485
|
-
},
|
|
486
|
-
const r =
|
|
487
|
-
!
|
|
488
|
-
},
|
|
489
|
-
const r =
|
|
781
|
+
}, Le = (e, t) => {
|
|
782
|
+
M(e, pe, w(e, t.data_sizes)), M(e, ue, w(e, t.data_srcset)), M(e, $, w(e, t.data_src));
|
|
783
|
+
}, is = (e, t) => {
|
|
784
|
+
me(e, (s) => {
|
|
785
|
+
j(s, Q), Le(s, t);
|
|
786
|
+
}), j(e, Q), Le(e, t);
|
|
787
|
+
}, ls = (e, t) => {
|
|
788
|
+
j(e, ae), M(e, $, w(e, t.data_src));
|
|
789
|
+
}, cs = (e, t) => {
|
|
790
|
+
ot(e, (s) => {
|
|
791
|
+
j(s, ae), M(s, $, w(s, t.data_src));
|
|
792
|
+
}), j(e, nt), M(e, Je, w(e, t.data_poster)), M(e, $, w(e, t.data_src)), e.load();
|
|
793
|
+
}, ds = (e, t) => {
|
|
794
|
+
j(e, at), M(e, Ze, w(e, t.data_src));
|
|
795
|
+
}, us = (e, t, s) => {
|
|
796
|
+
const r = w(e, t.data_bg), o = w(e, t.data_bg_hidpi), i = Ge && o ? o : r;
|
|
797
|
+
!i || (e.style.backgroundImage = `url("${i}")`, tt(e).setAttribute($, i), dt(e, t, s));
|
|
798
|
+
}, ps = (e, t, s) => {
|
|
799
|
+
const r = w(e, t.data_bg_multi), o = w(e, t.data_bg_multi_hidpi), i = Ge && o ? o : r;
|
|
800
|
+
!i || (e.style.backgroundImage = i, ct(e, t, s));
|
|
801
|
+
}, hs = (e, t, s) => {
|
|
802
|
+
const r = w(e, t.data_bg_set);
|
|
490
803
|
if (!r)
|
|
491
804
|
return;
|
|
492
805
|
const o = r.split("|");
|
|
493
|
-
let
|
|
494
|
-
e.style.backgroundImage =
|
|
495
|
-
},
|
|
496
|
-
IMG:
|
|
497
|
-
IFRAME:
|
|
498
|
-
VIDEO:
|
|
499
|
-
OBJECT:
|
|
500
|
-
},
|
|
501
|
-
const s =
|
|
806
|
+
let i = o.map((a) => `image-set(${a})`);
|
|
807
|
+
e.style.backgroundImage = i.join(), e.style.backgroundImage === "" && (i = o.map((a) => `-webkit-image-set(${a})`), e.style.backgroundImage = i.join()), ct(e, t, s);
|
|
808
|
+
}, ut = {
|
|
809
|
+
IMG: is,
|
|
810
|
+
IFRAME: ls,
|
|
811
|
+
VIDEO: cs,
|
|
812
|
+
OBJECT: ds
|
|
813
|
+
}, fs = (e, t) => {
|
|
814
|
+
const s = ut[e.tagName];
|
|
502
815
|
!s || s(e, t);
|
|
503
|
-
},
|
|
504
|
-
const r =
|
|
505
|
-
!r || (r(e, t),
|
|
506
|
-
},
|
|
507
|
-
t && !
|
|
508
|
-
},
|
|
816
|
+
}, gs = (e, t, s) => {
|
|
817
|
+
const r = ut[e.tagName];
|
|
818
|
+
!r || (r(e, t), dt(e, t, s));
|
|
819
|
+
}, bs = ["IMG", "IFRAME", "VIDEO", "OBJECT"], vs = (e) => bs.indexOf(e.tagName) > -1, pt = (e, t) => {
|
|
820
|
+
t && !ss(t) && !rs(t) && T(e.callback_finish, t);
|
|
821
|
+
}, Ae = (e, t, s) => {
|
|
509
822
|
e.addEventListener(t, s), e.llEvLisnrs[t] = s;
|
|
510
|
-
},
|
|
823
|
+
}, ms = (e, t, s) => {
|
|
511
824
|
e.removeEventListener(t, s);
|
|
512
|
-
},
|
|
513
|
-
|
|
825
|
+
}, we = (e) => !!e.llEvLisnrs, ws = (e, t, s) => {
|
|
826
|
+
we(e) || (e.llEvLisnrs = {});
|
|
514
827
|
const r = e.tagName === "VIDEO" ? "loadeddata" : "load";
|
|
515
|
-
|
|
516
|
-
},
|
|
517
|
-
if (!
|
|
828
|
+
Ae(e, r, t), Ae(e, "error", s);
|
|
829
|
+
}, de = (e) => {
|
|
830
|
+
if (!we(e))
|
|
518
831
|
return;
|
|
519
832
|
const t = e.llEvLisnrs;
|
|
520
833
|
for (let s in t) {
|
|
521
834
|
const r = t[s];
|
|
522
|
-
|
|
835
|
+
ms(e, s, r);
|
|
523
836
|
}
|
|
524
837
|
delete e.llEvLisnrs;
|
|
525
|
-
},
|
|
526
|
-
|
|
527
|
-
},
|
|
528
|
-
const o =
|
|
529
|
-
|
|
530
|
-
},
|
|
531
|
-
const o =
|
|
532
|
-
|
|
533
|
-
},
|
|
534
|
-
const r =
|
|
535
|
-
if (
|
|
838
|
+
}, ht = (e, t, s) => {
|
|
839
|
+
Xt(e), ve(s, -1), ts(s), x(e, t.class_loading), t.unobserve_completed && ne(e, s);
|
|
840
|
+
}, _s = (e, t, s, r) => {
|
|
841
|
+
const o = be(t);
|
|
842
|
+
ht(t, s, r), G(t, s.class_loaded), R(t, Ke), T(s.callback_loaded, t, r), o || pt(s, r);
|
|
843
|
+
}, ys = (e, t, s, r) => {
|
|
844
|
+
const o = be(t);
|
|
845
|
+
ht(t, s, r), G(t, s.class_error), R(t, fe), T(s.callback_error, t, r), s.restore_on_error && D(t, Q), o || pt(s, r);
|
|
846
|
+
}, _e = (e, t, s) => {
|
|
847
|
+
const r = tt(e) || e;
|
|
848
|
+
if (we(r))
|
|
536
849
|
return;
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
}, (
|
|
540
|
-
|
|
850
|
+
ws(r, (a) => {
|
|
851
|
+
_s(a, e, t, s), de(r);
|
|
852
|
+
}, (a) => {
|
|
853
|
+
ys(a, e, t, s), de(r);
|
|
541
854
|
});
|
|
542
|
-
},
|
|
543
|
-
|
|
544
|
-
},
|
|
545
|
-
|
|
546
|
-
},
|
|
547
|
-
|
|
548
|
-
},
|
|
549
|
-
e.setAttribute("loading", "lazy"),
|
|
550
|
-
},
|
|
551
|
-
e.removeAttribute(
|
|
552
|
-
},
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
}),
|
|
556
|
-
},
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
}),
|
|
560
|
-
},
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
}),
|
|
564
|
-
},
|
|
565
|
-
|
|
566
|
-
},
|
|
567
|
-
|
|
568
|
-
},
|
|
569
|
-
IMG:
|
|
570
|
-
IFRAME:
|
|
571
|
-
VIDEO:
|
|
572
|
-
OBJECT:
|
|
573
|
-
},
|
|
574
|
-
const t =
|
|
855
|
+
}, ks = (e, t, s) => {
|
|
856
|
+
Qt(e), _e(e, t, s), os(e), us(e, t, s), ps(e, t, s), hs(e, t, s);
|
|
857
|
+
}, Ss = (e, t, s) => {
|
|
858
|
+
_e(e, t, s), gs(e, t, s);
|
|
859
|
+
}, ye = (e, t, s) => {
|
|
860
|
+
vs(e) ? Ss(e, t, s) : ks(e, t, s);
|
|
861
|
+
}, xs = (e, t, s) => {
|
|
862
|
+
e.setAttribute("loading", "lazy"), _e(e, t, s), fs(e, t), R(e, Xe);
|
|
863
|
+
}, ze = (e) => {
|
|
864
|
+
e.removeAttribute($), e.removeAttribute(ue), e.removeAttribute(pe);
|
|
865
|
+
}, Es = (e) => {
|
|
866
|
+
me(e, (t) => {
|
|
867
|
+
ze(t);
|
|
868
|
+
}), ze(e);
|
|
869
|
+
}, ft = (e) => {
|
|
870
|
+
me(e, (t) => {
|
|
871
|
+
D(t, Q);
|
|
872
|
+
}), D(e, Q);
|
|
873
|
+
}, Is = (e) => {
|
|
874
|
+
ot(e, (t) => {
|
|
875
|
+
D(t, ae);
|
|
876
|
+
}), D(e, nt), e.load();
|
|
877
|
+
}, Cs = (e) => {
|
|
878
|
+
D(e, ae);
|
|
879
|
+
}, $s = (e) => {
|
|
880
|
+
D(e, at);
|
|
881
|
+
}, Ls = {
|
|
882
|
+
IMG: ft,
|
|
883
|
+
IFRAME: Cs,
|
|
884
|
+
VIDEO: Is,
|
|
885
|
+
OBJECT: $s
|
|
886
|
+
}, As = (e) => {
|
|
887
|
+
const t = Ls[e.tagName];
|
|
575
888
|
if (!t) {
|
|
576
|
-
|
|
889
|
+
as(e);
|
|
577
890
|
return;
|
|
578
891
|
}
|
|
579
892
|
t(e);
|
|
580
|
-
},
|
|
581
|
-
|
|
582
|
-
},
|
|
583
|
-
|
|
584
|
-
},
|
|
585
|
-
!s.cancel_on_exit || !
|
|
586
|
-
},
|
|
587
|
-
const o =
|
|
588
|
-
|
|
589
|
-
},
|
|
590
|
-
|
|
591
|
-
},
|
|
893
|
+
}, zs = (e, t) => {
|
|
894
|
+
ge(e) || be(e) || (x(e, t.class_entered), x(e, t.class_exited), x(e, t.class_applied), x(e, t.class_loading), x(e, t.class_loaded), x(e, t.class_error));
|
|
895
|
+
}, Os = (e, t) => {
|
|
896
|
+
As(e), zs(e, t), oe(e), lt(e);
|
|
897
|
+
}, Ns = (e, t, s, r) => {
|
|
898
|
+
!s.cancel_on_exit || !Wt(e) || e.tagName === "IMG" && (de(e), Es(e), ft(e), x(e, s.class_loading), ve(r, -1), oe(e), T(s.callback_cancel, e, t, r));
|
|
899
|
+
}, Ms = (e, t, s, r) => {
|
|
900
|
+
const o = Kt(e);
|
|
901
|
+
R(e, jt), G(e, s.class_entered), x(e, s.class_exited), es(e, s, r), T(s.callback_enter, e, t, r), !o && ye(e, s, r);
|
|
902
|
+
}, Ps = (e, t, s, r) => {
|
|
903
|
+
ge(e) || (G(e, s.class_exited), Ns(e, t, s, r), T(s.callback_exit, e, t, r));
|
|
904
|
+
}, Ts = ["IMG", "IFRAME", "VIDEO"], gt = (e) => e.use_native && "loading" in HTMLImageElement.prototype, Fs = (e, t, s) => {
|
|
592
905
|
e.forEach((r) => {
|
|
593
|
-
|
|
594
|
-
}),
|
|
595
|
-
},
|
|
906
|
+
Ts.indexOf(r.tagName) !== -1 && xs(r, t, s);
|
|
907
|
+
}), st(s, 0);
|
|
908
|
+
}, Ds = (e) => e.isIntersecting || e.intersectionRatio > 0, Rs = (e) => ({
|
|
596
909
|
root: e.container === document ? null : e.container,
|
|
597
910
|
rootMargin: e.thresholds || e.threshold + "px"
|
|
598
|
-
}),
|
|
599
|
-
e.forEach(
|
|
600
|
-
|
|
911
|
+
}), Vs = (e, t, s) => {
|
|
912
|
+
e.forEach(
|
|
913
|
+
(r) => Ds(r) ? Ms(r.target, r, t, s) : Ps(r.target, r, t, s)
|
|
914
|
+
);
|
|
915
|
+
}, Us = (e, t) => {
|
|
601
916
|
t.forEach((s) => {
|
|
602
917
|
e.observe(s);
|
|
603
918
|
});
|
|
604
|
-
},
|
|
605
|
-
|
|
606
|
-
},
|
|
607
|
-
!
|
|
608
|
-
|
|
609
|
-
},
|
|
610
|
-
},
|
|
611
|
-
|
|
612
|
-
|
|
919
|
+
}, qs = (e, t) => {
|
|
920
|
+
Yt(e), Us(e, t);
|
|
921
|
+
}, Bs = (e, t) => {
|
|
922
|
+
!He || gt(e) || (t._observer = new IntersectionObserver((s) => {
|
|
923
|
+
Vs(s, e, t);
|
|
924
|
+
}, Rs(e)));
|
|
925
|
+
}, bt = (e) => Array.prototype.slice.call(e), re = (e) => e.container.querySelectorAll(e.elements_selector), Hs = (e) => bt(e).filter(ge), js = (e) => Jt(e), Gs = (e) => bt(e).filter(js), Oe = (e, t) => Hs(e || re(t)), Ws = (e, t) => {
|
|
926
|
+
Gs(re(e)).forEach((r) => {
|
|
927
|
+
x(r, e.class_error), oe(r);
|
|
613
928
|
}), t.update();
|
|
614
|
-
},
|
|
615
|
-
!
|
|
616
|
-
|
|
929
|
+
}, Js = (e, t) => {
|
|
930
|
+
!P || (t._onlineHandler = () => {
|
|
931
|
+
Ws(e, t);
|
|
617
932
|
}, window.addEventListener("online", t._onlineHandler));
|
|
618
|
-
},
|
|
619
|
-
!
|
|
620
|
-
},
|
|
621
|
-
const s =
|
|
622
|
-
this._settings = s, this.loadingCount = 0,
|
|
933
|
+
}, Zs = (e) => {
|
|
934
|
+
!P || window.removeEventListener("online", e._onlineHandler);
|
|
935
|
+
}, te = function(e, t) {
|
|
936
|
+
const s = We(e);
|
|
937
|
+
this._settings = s, this.loadingCount = 0, Bs(s, this), Js(s, this), this.update(t);
|
|
623
938
|
};
|
|
624
|
-
|
|
939
|
+
te.prototype = {
|
|
625
940
|
update: function(e) {
|
|
626
|
-
const t = this._settings, s =
|
|
627
|
-
if (
|
|
941
|
+
const t = this._settings, s = Oe(e, t);
|
|
942
|
+
if (st(this, s.length), Be || !He) {
|
|
628
943
|
this.loadAll(s);
|
|
629
944
|
return;
|
|
630
945
|
}
|
|
631
|
-
if (
|
|
632
|
-
|
|
946
|
+
if (gt(t)) {
|
|
947
|
+
Fs(s, t, this);
|
|
633
948
|
return;
|
|
634
949
|
}
|
|
635
|
-
|
|
950
|
+
qs(this._observer, s);
|
|
636
951
|
},
|
|
637
952
|
destroy: function() {
|
|
638
|
-
this._observer && this._observer.disconnect(),
|
|
639
|
-
|
|
953
|
+
this._observer && this._observer.disconnect(), Zs(this), re(this._settings).forEach((e) => {
|
|
954
|
+
lt(e);
|
|
640
955
|
}), delete this._observer, delete this._settings, delete this._onlineHandler, delete this.loadingCount, delete this.toLoadCount;
|
|
641
956
|
},
|
|
642
957
|
loadAll: function(e) {
|
|
643
958
|
const t = this._settings;
|
|
644
|
-
|
|
645
|
-
|
|
959
|
+
Oe(e, t).forEach((r) => {
|
|
960
|
+
ne(r, this), ye(r, t, this);
|
|
646
961
|
});
|
|
647
962
|
},
|
|
648
963
|
restoreAll: function() {
|
|
649
964
|
const e = this._settings;
|
|
650
|
-
|
|
651
|
-
|
|
965
|
+
re(e).forEach((t) => {
|
|
966
|
+
Os(t, e);
|
|
652
967
|
});
|
|
653
968
|
}
|
|
654
969
|
};
|
|
655
|
-
|
|
656
|
-
const s =
|
|
657
|
-
|
|
970
|
+
te.load = (e, t) => {
|
|
971
|
+
const s = We(t);
|
|
972
|
+
ye(e, s);
|
|
658
973
|
};
|
|
659
|
-
|
|
660
|
-
|
|
974
|
+
te.resetStatus = (e) => {
|
|
975
|
+
oe(e);
|
|
661
976
|
};
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
`;
|
|
668
|
-
function $s(e) {
|
|
669
|
-
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
670
|
-
s.setAttribute("class", `${e}-footer-icon-sidebar`), s.setAttribute("viewBox", "0 0 64 64");
|
|
671
|
-
const r = document.createElementNS(t, "path");
|
|
672
|
-
return r.setAttribute("fill", "currentColor"), r.setAttribute("d", "M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"), s.appendChild(r), s;
|
|
673
|
-
}
|
|
674
|
-
function Ls(e) {
|
|
675
|
-
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
676
|
-
s.setAttribute("class", `${e}-footer-icon-arrow-left`), s.setAttribute("viewBox", "0 0 500 500");
|
|
677
|
-
const r = document.createElementNS(t, "path");
|
|
678
|
-
return r.setAttribute("fill", "currentColor"), r.setAttribute("d", "M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"), s.appendChild(r), s;
|
|
679
|
-
}
|
|
680
|
-
function zs(e) {
|
|
681
|
-
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
682
|
-
s.setAttribute("class", `${e}-footer-icon-play`), s.setAttribute("viewBox", "0 0 500 500");
|
|
683
|
-
const r = document.createElementNS(t, "path");
|
|
684
|
-
return r.setAttribute("fill", "currentColor"), r.setAttribute("d", "M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"), s.appendChild(r), s;
|
|
685
|
-
}
|
|
686
|
-
function Ns(e) {
|
|
687
|
-
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
688
|
-
s.setAttribute("class", `${e}-footer-icon-pause`), s.setAttribute("viewBox", "0 0 500 500");
|
|
689
|
-
const r = document.createElementNS(t, "path");
|
|
690
|
-
return r.setAttribute("fill", "currentColor"), r.setAttribute("d", "M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"), s.appendChild(r), s;
|
|
691
|
-
}
|
|
692
|
-
function Os(e) {
|
|
693
|
-
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
694
|
-
s.setAttribute("class", `${e}-footer-icon-arrow-right`), s.setAttribute("viewBox", "0 0 500 500");
|
|
695
|
-
const r = document.createElementNS(t, "path");
|
|
696
|
-
return r.setAttribute("fill", "currentColor"), r.setAttribute("d", "M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"), s.appendChild(r), s;
|
|
697
|
-
}
|
|
698
|
-
function g(e) {
|
|
699
|
-
return document.createElement(e);
|
|
700
|
-
}
|
|
701
|
-
function D(e, t) {
|
|
702
|
-
return e.appendChild(t);
|
|
703
|
-
}
|
|
704
|
-
function f(e) {
|
|
705
|
-
return `${U}-${e}`;
|
|
706
|
-
}
|
|
707
|
-
function v(e, t) {
|
|
708
|
-
e.className = f(t);
|
|
709
|
-
}
|
|
710
|
-
function Ds(e) {
|
|
711
|
-
return e.endsWith("/") ? e.slice(0, -1) : e;
|
|
712
|
-
}
|
|
713
|
-
async function it({ taskId: e, url: t }) {
|
|
714
|
-
const s = lt(e, t), r = `${s}/preview/1.png`, o = `${s}/jsonOutput/slide-1.json`, l = new Promise((a) => {
|
|
715
|
-
const n = new Image();
|
|
716
|
-
n.onload = () => a(n), n.onerror = () => a(null), n.src = r;
|
|
717
|
-
}), i = fetch(o).then((a) => a.json());
|
|
718
|
-
return { preview: await l, slide: await i };
|
|
719
|
-
}
|
|
720
|
-
function lt(e, t) {
|
|
721
|
-
return `${Ds(t || at)}/${e}`;
|
|
722
|
-
}
|
|
723
|
-
function Ms() {
|
|
724
|
-
let e = W;
|
|
725
|
-
const t = (p) => {
|
|
726
|
-
e = p;
|
|
977
|
+
P && Ht(te, window.lazyLoadOptions);
|
|
978
|
+
function Ks() {
|
|
979
|
+
let e = K;
|
|
980
|
+
const t = (f) => {
|
|
981
|
+
e = f;
|
|
727
982
|
};
|
|
728
|
-
let s = !1, r = !1, o = !1,
|
|
729
|
-
const
|
|
730
|
-
|
|
731
|
-
const
|
|
732
|
-
|
|
733
|
-
r ||
|
|
734
|
-
},
|
|
983
|
+
let s = !1, r = !1, o = !1, i = [], a = 0;
|
|
984
|
+
const n = b("readonly"), l = b("preview-active"), p = g("div");
|
|
985
|
+
_(p, "content");
|
|
986
|
+
const c = g("div");
|
|
987
|
+
_(c, "preview-mask"), c.onclick = function(k) {
|
|
988
|
+
r || k.target === c && m(!1);
|
|
989
|
+
}, F(p, c);
|
|
735
990
|
const h = g("div");
|
|
736
|
-
|
|
737
|
-
var
|
|
991
|
+
_(h, "preview"), h.classList.add(b("tele-fancy-scrollbar")), h.onclick = function(k) {
|
|
992
|
+
var z;
|
|
738
993
|
if (r)
|
|
739
994
|
return;
|
|
740
|
-
const
|
|
741
|
-
|
|
742
|
-
},
|
|
743
|
-
const
|
|
995
|
+
const I = (z = k.target.dataset) == null ? void 0 : z.pageIndex;
|
|
996
|
+
I && (k.preventDefault(), k.stopPropagation(), k.stopImmediatePropagation(), e(Number(I)), m(!1));
|
|
997
|
+
}, F(p, h);
|
|
998
|
+
const v = new te({
|
|
744
999
|
container: h,
|
|
745
|
-
elements_selector: `.${
|
|
1000
|
+
elements_selector: `.${b("preview-page>img")}`
|
|
746
1001
|
});
|
|
747
|
-
function
|
|
748
|
-
r !==
|
|
1002
|
+
function E(f) {
|
|
1003
|
+
r !== f && (r = f, p.classList.toggle(n, r));
|
|
749
1004
|
}
|
|
750
|
-
function
|
|
751
|
-
o !==
|
|
1005
|
+
function m(f) {
|
|
1006
|
+
o !== f && (o = f, p.classList.toggle(l, o));
|
|
752
1007
|
}
|
|
753
|
-
function
|
|
754
|
-
if (
|
|
755
|
-
|
|
756
|
-
const
|
|
757
|
-
|
|
758
|
-
const
|
|
759
|
-
|
|
760
|
-
const
|
|
761
|
-
|
|
762
|
-
const
|
|
763
|
-
|
|
764
|
-
}), s ||
|
|
1008
|
+
function V(f) {
|
|
1009
|
+
if (i !== f) {
|
|
1010
|
+
i = f;
|
|
1011
|
+
const k = b("preview-page"), I = b("preview-page-name");
|
|
1012
|
+
i.forEach((z, U) => {
|
|
1013
|
+
const W = String(U), d = g("a");
|
|
1014
|
+
d.className = k + " " + b(`preview-page-${U}`), d.href = "#", d.dataset.pageIndex = W;
|
|
1015
|
+
const q = g("span");
|
|
1016
|
+
q.className = I, q.textContent = String(U + 1), q.dataset.pageIndex = W;
|
|
1017
|
+
const B = g("img");
|
|
1018
|
+
B.width = z.width, B.height = z.height, B.src = z.thumbnail, B.alt = `page-${U}`, B.dataset.pageIndex = W, F(d, B), F(d, q), F(h, d);
|
|
1019
|
+
}), s || v.update();
|
|
765
1020
|
}
|
|
766
1021
|
}
|
|
767
|
-
function
|
|
768
|
-
if (
|
|
769
|
-
|
|
770
|
-
const
|
|
771
|
-
|
|
1022
|
+
function L(f, k = !1) {
|
|
1023
|
+
if (k || a !== f) {
|
|
1024
|
+
a = f;
|
|
1025
|
+
const I = h.querySelector(
|
|
1026
|
+
`.${b(`preview-page-${a}`)}`
|
|
1027
|
+
);
|
|
1028
|
+
I && h.scrollTo({ top: I.offsetTop - 16 });
|
|
772
1029
|
}
|
|
773
1030
|
}
|
|
774
1031
|
function A() {
|
|
775
|
-
s = !0,
|
|
1032
|
+
s = !0, v.destroy();
|
|
776
1033
|
}
|
|
777
|
-
function
|
|
1034
|
+
function S() {
|
|
778
1035
|
return o;
|
|
779
1036
|
}
|
|
780
1037
|
return {
|
|
781
|
-
$content:
|
|
1038
|
+
$content: p,
|
|
782
1039
|
$preview: h,
|
|
783
|
-
set_readonly: x,
|
|
784
|
-
set_active: b,
|
|
785
|
-
get_active: y,
|
|
786
|
-
set_pages: F,
|
|
787
|
-
on_new_page_index: t,
|
|
788
|
-
set_page_index: I,
|
|
789
|
-
destroy: A
|
|
790
|
-
};
|
|
791
|
-
}
|
|
792
|
-
function Ts() {
|
|
793
|
-
let e = W;
|
|
794
|
-
const t = (c) => {
|
|
795
|
-
e = c;
|
|
796
|
-
};
|
|
797
|
-
let s = W;
|
|
798
|
-
const r = (c) => {
|
|
799
|
-
s = c;
|
|
800
|
-
};
|
|
801
|
-
let o = W;
|
|
802
|
-
const l = (c) => {
|
|
803
|
-
o = c;
|
|
804
|
-
};
|
|
805
|
-
let i = !1, a = !1, n = 0, d = 0;
|
|
806
|
-
const u = g("div");
|
|
807
|
-
v(u, "footer");
|
|
808
|
-
const h = g("button");
|
|
809
|
-
v(h, "btn-sidebar"), h.classList.add(f("footer-btn")), h.appendChild($s(U)), h.onclick = function() {
|
|
810
|
-
i || s();
|
|
811
|
-
}, h.style.display = "none", u.appendChild(h);
|
|
812
|
-
const k = g("div");
|
|
813
|
-
v(k, "page-jumps");
|
|
814
|
-
const x = g("button");
|
|
815
|
-
v(x, "btn-page-back"), x.classList.add(f("footer-btn")), x.appendChild(Ls(U)), x.onclick = function() {
|
|
816
|
-
i || e(n - 1);
|
|
817
|
-
}, k.appendChild(x);
|
|
818
|
-
const b = g("button");
|
|
819
|
-
v(b, "btn-page-play"), b.classList.add(f("footer-btn")), b.appendChild(zs(U)), b.appendChild(Ns(U));
|
|
820
|
-
let F = 0;
|
|
821
|
-
b.onclick = function() {
|
|
822
|
-
i || (b.classList.add(f("footer-btn-playing")), o(), clearTimeout(F), F = setTimeout(() => {
|
|
823
|
-
b.classList.remove(f("footer-btn-playing"));
|
|
824
|
-
}, 500));
|
|
825
|
-
}, k.appendChild(b);
|
|
826
|
-
const I = g("button");
|
|
827
|
-
v(I, "btn-page-next"), I.classList.add(f("footer-btn")), I.appendChild(Os(U)), I.onclick = function() {
|
|
828
|
-
i || e(n + 1);
|
|
829
|
-
}, k.appendChild(I);
|
|
830
|
-
const A = g("div");
|
|
831
|
-
v(A, "page-number");
|
|
832
|
-
const y = g("input");
|
|
833
|
-
v(y, "page-number-input"), y.value = String(n + 1), y.onchange = function() {
|
|
834
|
-
i || y.value && e(Number(y.value) - 1);
|
|
835
|
-
};
|
|
836
|
-
const p = g("span");
|
|
837
|
-
v(p, "total-page"), p.textContent = " / ", A.appendChild(y), A.appendChild(p), u.appendChild(k), u.appendChild(A);
|
|
838
|
-
const w = f("readonly");
|
|
839
|
-
function E(c) {
|
|
840
|
-
i !== c && (i = c, u.classList.toggle(w, i), y.disabled = i);
|
|
841
|
-
}
|
|
842
|
-
function $(c) {
|
|
843
|
-
a !== c && (a = c, h.style.display = a ? "" : "none");
|
|
844
|
-
}
|
|
845
|
-
function P(c, R = !1) {
|
|
846
|
-
(R || n !== c) && (n = c, y.value = String(n + 1));
|
|
847
|
-
}
|
|
848
|
-
function j(c) {
|
|
849
|
-
d !== c && (d = c, p.textContent = ` / ${d}`);
|
|
850
|
-
}
|
|
851
|
-
return {
|
|
852
|
-
$footer: u,
|
|
853
|
-
$pageNumberInput: y,
|
|
854
1040
|
set_readonly: E,
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
1041
|
+
set_active: m,
|
|
1042
|
+
get_active: S,
|
|
1043
|
+
set_pages: V,
|
|
858
1044
|
on_new_page_index: t,
|
|
859
|
-
|
|
860
|
-
|
|
1045
|
+
set_page_index: L,
|
|
1046
|
+
destroy: A
|
|
861
1047
|
};
|
|
862
1048
|
}
|
|
863
|
-
|
|
864
|
-
const e = g("div");
|
|
865
|
-
return v(e, "slide"), e;
|
|
866
|
-
}
|
|
867
|
-
function Ps(e) {
|
|
868
|
-
if (typeof document < "u") {
|
|
869
|
-
const t = () => e(document.visibilityState === "visible");
|
|
870
|
-
return document.addEventListener("visibilitychange", t), () => document.removeEventListener("visibilitychange", t);
|
|
871
|
-
}
|
|
872
|
-
return W;
|
|
873
|
-
}
|
|
874
|
-
class B {
|
|
1049
|
+
const ke = class {
|
|
875
1050
|
constructor(t) {
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
this
|
|
879
|
-
|
|
1051
|
+
u(this, "sideEffect", new Me());
|
|
1052
|
+
u(this, "events", new Et());
|
|
1053
|
+
u(this, "$slide", Ee("div", "slide"));
|
|
1054
|
+
u(this, "$overlay", Ee("div", "overlay"));
|
|
1055
|
+
u(this, "sidebar", Ks());
|
|
1056
|
+
u(this, "footer", qt());
|
|
1057
|
+
u(this, "$content");
|
|
1058
|
+
u(this, "$footer");
|
|
1059
|
+
u(this, "slide");
|
|
1060
|
+
u(this, "_readyPromise");
|
|
1061
|
+
u(this, "_infoPromise");
|
|
1062
|
+
u(this, "_ready", !1);
|
|
1063
|
+
u(this, "_slideCount", 0);
|
|
1064
|
+
u(this, "_destroyed", !1);
|
|
1065
|
+
u(this, "_isFrozen", !1);
|
|
1066
|
+
u(this, "_cachedIsFrozen", !1);
|
|
1067
|
+
u(this, "onPlay", () => {
|
|
1068
|
+
this.slide.nextStep();
|
|
880
1069
|
});
|
|
881
|
-
|
|
882
|
-
this._ready &&
|
|
883
|
-
};
|
|
884
|
-
this
|
|
1070
|
+
u(this, "onNewPageIndex", (t) => {
|
|
1071
|
+
this._ready && t >= 0 && t < this._slideCount ? this.slide.renderSlide(t + 1) : this.setPage(this.slide.slideState.currentSlideIndex);
|
|
1072
|
+
});
|
|
1073
|
+
u(this, "onTogglePreview", () => {
|
|
885
1074
|
this.sidebar.set_active(!this.sidebar.get_active());
|
|
886
|
-
})
|
|
887
|
-
|
|
888
|
-
}), this.sideEffect.addDisposer(this.sidebar.destroy), this.sideEffect.addDisposer(() => this.slide.destroy()), this.sideEffect.addDisposer(() => {
|
|
1075
|
+
});
|
|
1076
|
+
this.$content = this.sidebar.$content, this.$footer = this.footer.$footer, F(this.$content, this.$slide), F(this.$content, this.$overlay), this.sidebar.on_new_page_index(this.onNewPageIndex), this.footer.on_new_page_index(this.onNewPageIndex), this.footer.on_toggle_preview(this.onTogglePreview), this.footer.on_play(this.onPlay), this.sideEffect.push(this.sidebar.destroy), this.sideEffect.push(() => this.slide.destroy()), this.sideEffect.push(() => {
|
|
889
1077
|
this.$content.parentElement && this.$content.remove(), this.$footer.parentElement && this.$footer.remove(), this.$slide.parentElement && this.$slide.remove();
|
|
1078
|
+
}), this.sideEffect.push(
|
|
1079
|
+
Pt((n) => {
|
|
1080
|
+
this._destroyed || (n ? this._cachedIsFrozen || this.unfreeze() : (this._cachedIsFrozen = this._isFrozen, this.freeze()));
|
|
1081
|
+
})
|
|
1082
|
+
);
|
|
1083
|
+
const [s, r] = Ce();
|
|
1084
|
+
this._infoPromise = s, ke.fetchSlideInfo(t).then(({ preview: n, slide: l }) => {
|
|
1085
|
+
if (!this._destroyed) {
|
|
1086
|
+
if (this._slideCount = l.slideCount, n) {
|
|
1087
|
+
const { taskId: p, url: c } = t, { slideCount: h } = l, { width: v, height: E } = n, m = qe(p, c), V = Array.from({ length: h }, (L, A) => ({
|
|
1088
|
+
width: v,
|
|
1089
|
+
height: E,
|
|
1090
|
+
thumbnail: `${m}/preview/${A + 1}.png`
|
|
1091
|
+
}));
|
|
1092
|
+
this.sidebar.set_pages(V), this.footer.set_sidebar(!0);
|
|
1093
|
+
}
|
|
1094
|
+
this.footer.set_page_count(l.slideCount), r(l);
|
|
1095
|
+
}
|
|
1096
|
+
}).catch((n) => {
|
|
1097
|
+
console.log("[Slide] fetch slide info error"), console.error(n), this.events.emit("prepareError", n);
|
|
890
1098
|
});
|
|
891
|
-
|
|
892
|
-
this.
|
|
893
|
-
this._destroyed || (a ? o || this.unfreeze() : (o = this._isFrozen, this.freeze()));
|
|
894
|
-
})), this.slide = new ae({
|
|
1099
|
+
const [i, a] = Ce();
|
|
1100
|
+
this._readyPromise = i, this.slide = new ce({
|
|
895
1101
|
anchor: this.$slide,
|
|
896
1102
|
mode: "local",
|
|
897
1103
|
interactive: !0,
|
|
898
1104
|
enableGlobalClick: !0,
|
|
899
1105
|
useLocalCache: !0,
|
|
900
1106
|
...t
|
|
901
|
-
}), this.slide.setResource(t.taskId, t.url ||
|
|
902
|
-
|
|
903
|
-
this._infoPromise = new Promise((a) => {
|
|
904
|
-
l = a;
|
|
905
|
-
}), this.slide.on("slideChange", (a) => {
|
|
906
|
-
this._destroyed || this.setPage(a);
|
|
1107
|
+
}), this.slide.setResource(t.taskId, t.url || Pe), this.slide.on("slideChange", (n) => {
|
|
1108
|
+
this._destroyed || this.setPage(n);
|
|
907
1109
|
}), this.slide.on("renderEnd", () => {
|
|
908
1110
|
this._ready ? this.$overlay.style.opacity = "" : setTimeout(() => {
|
|
909
|
-
this._ready = !0,
|
|
1111
|
+
this._ready = !0, a();
|
|
910
1112
|
}, 1e3);
|
|
911
|
-
}), this.slide.on("renderError", (
|
|
912
|
-
this._destroyed ||
|
|
913
|
-
}), it(t).then(({ preview: a, slide: n }) => {
|
|
914
|
-
if (!this._destroyed) {
|
|
915
|
-
if (this._slideCount = n.slideCount, a) {
|
|
916
|
-
const { taskId: d, url: u } = t, { slideCount: h } = n, { width: k, height: x } = a, b = lt(d, u), F = Array.from({ length: h }, (I, A) => ({
|
|
917
|
-
width: k,
|
|
918
|
-
height: x,
|
|
919
|
-
thumbnail: `${b}/preview/${A + 1}.png`
|
|
920
|
-
}));
|
|
921
|
-
this.sidebar.set_pages(F), this.footer.set_sidebar(!0);
|
|
922
|
-
}
|
|
923
|
-
this.footer.set_page_count(n.slideCount), l(n);
|
|
924
|
-
}
|
|
925
|
-
}).catch((a) => {
|
|
926
|
-
console.log("[Slide] fetch slide info error"), console.error(a);
|
|
1113
|
+
}), this.slide.on("renderError", (n) => {
|
|
1114
|
+
this._destroyed || n.error && (console.error(n.error), this.$overlay.textContent = `Error on slide.index=${n.index}: ${n.error.message}`, this.$overlay.style.opacity = "1", this.events.emit("renderError", n));
|
|
927
1115
|
}), this.ready(() => {
|
|
928
1116
|
this._isFrozen && this.freeze();
|
|
929
1117
|
});
|
|
@@ -944,161 +1132,143 @@ class B {
|
|
|
944
1132
|
this.sidebar.set_page_index(t - 1, !0), this.footer.set_page_index(t - 1, !0);
|
|
945
1133
|
}
|
|
946
1134
|
freeze() {
|
|
947
|
-
this._destroyed || (this._isFrozen = !0, this._ready && this.slide.frozen());
|
|
1135
|
+
this._destroyed || (this._isFrozen = !0, this._ready && (this.slide.frozen(), this.events.emit("freeze")));
|
|
948
1136
|
}
|
|
949
1137
|
unfreeze() {
|
|
950
|
-
this._destroyed || (this._isFrozen = !1, this._ready && this.slide.release());
|
|
1138
|
+
this._destroyed || (this._isFrozen = !1, this._ready && (this.slide.release(), this.events.emit("unfreeze")));
|
|
951
1139
|
}
|
|
1140
|
+
};
|
|
1141
|
+
let O = ke;
|
|
1142
|
+
u(O, "styles", Tt), u(O, "fetchSlideInfo", Mt);
|
|
1143
|
+
function Qs(e) {
|
|
1144
|
+
return e.displayer.logger;
|
|
952
1145
|
}
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
set(t, s) {
|
|
960
|
-
return this._map.set(t, s), this._queue.includes(t) || this._queue.unshift(t), this._refresh(), () => {
|
|
961
|
-
this.delete(t);
|
|
962
|
-
};
|
|
1146
|
+
const C = class {
|
|
1147
|
+
constructor(t) {
|
|
1148
|
+
u(this, "info", (t) => {
|
|
1149
|
+
C.roomLogger && this.context ? C.roomLogger.info(t + ` (${this.context.appId})`) : this.context ? console.debug(t + ` (${this.context.appId})`) : console.debug(t);
|
|
1150
|
+
});
|
|
1151
|
+
this.context = t, t && (C.active.add(t.appId), C.roomLogger = Qs(t));
|
|
963
1152
|
}
|
|
964
|
-
|
|
965
|
-
this.
|
|
1153
|
+
destroy() {
|
|
1154
|
+
this.context && C.active.delete(this.context.appId), C.active.size === 0 && (C.roomLogger = null);
|
|
966
1155
|
}
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
1156
|
+
};
|
|
1157
|
+
let J = C;
|
|
1158
|
+
u(J, "active", /* @__PURE__ */ new Set()), u(J, "roomLogger", null);
|
|
1159
|
+
function Xs({ context: e, storage: t, viewer: s, sideEffect: r, logger: o }) {
|
|
1160
|
+
const i = o.info.bind(o);
|
|
1161
|
+
let a = null;
|
|
1162
|
+
s.prepare(({ width: c, height: h, slideCount: v }) => {
|
|
1163
|
+
e.destroyed || (c && e.box.setStageRatio(h / c), a = e.createWhiteBoardView({ size: v }), a.setBaseRect({ width: c, height: h }), p());
|
|
1164
|
+
});
|
|
1165
|
+
const { slide: n } = s;
|
|
1166
|
+
function l(c = t.state.state) {
|
|
1167
|
+
return JSON.stringify(c);
|
|
970
1168
|
}
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
1169
|
+
function p() {
|
|
1170
|
+
if (t.state.state)
|
|
1171
|
+
i("[Slide] restore " + l()), n.setSlideState(t.state.state);
|
|
1172
|
+
else if (e.isAddApp)
|
|
1173
|
+
i("[Slide] kick start"), n.renderSlide(1);
|
|
1174
|
+
else {
|
|
1175
|
+
i("[Slide] wait for restore");
|
|
1176
|
+
const c = r.add(() => {
|
|
1177
|
+
const v = setInterval(() => {
|
|
1178
|
+
t.state.state || (i("[Slide] timeout"), n.renderSlide(1));
|
|
1179
|
+
}, 15e3);
|
|
1180
|
+
return () => clearInterval(v);
|
|
1181
|
+
}), h = r.push(
|
|
1182
|
+
t.on("stateChanged", () => {
|
|
1183
|
+
t.state.state && (i("[Slide] restore " + l()), n.setSlideState(t.state.state), r.flush(h), r.flush(c));
|
|
1184
|
+
})
|
|
1185
|
+
);
|
|
1186
|
+
}
|
|
976
1187
|
}
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
1188
|
+
n.on("stateChange", () => {
|
|
1189
|
+
e.isWritable && t.setState({ state: n.slideState });
|
|
1190
|
+
}), n.on("syncDispatch", (c) => {
|
|
1191
|
+
e.isWritable && (i("[Slide] dispatch " + l(Ie(c, "uuid"))), e.dispatchMagixEvent("syncDispatch", c));
|
|
1192
|
+
}), r.push(
|
|
1193
|
+
e.addMagixEventListener(
|
|
1194
|
+
"syncDispatch",
|
|
1195
|
+
({ payload: c }) => {
|
|
1196
|
+
i("[Slide] receive " + l(Ie(c, "uuid"))), n.emit("syncReceive", c);
|
|
1197
|
+
},
|
|
1198
|
+
{ fireSelfEventAfterCommit: !0 }
|
|
1199
|
+
)
|
|
1200
|
+
), n.on("slideChange", (c) => {
|
|
1201
|
+
e.isWritable && a && (i("[Slide] page to " + c), a.jumpPage(c - 1));
|
|
1202
|
+
}), s.setReadonly(!e.isWritable), r.push(
|
|
1203
|
+
e.emitter.on("writableChange", (c) => {
|
|
1204
|
+
s.setReadonly(!c);
|
|
1205
|
+
})
|
|
1206
|
+
), r.addEventListener(window, "keydown", (c) => {
|
|
1207
|
+
e.box.focus && ((c.key === "ArrowUp" || c.key === "ArrowLeft") && s.slide.prevStep(), (c.key === "ArrowRight" || c.key === "ArrowDown") && s.slide.nextStep());
|
|
981
1208
|
});
|
|
982
|
-
}
|
|
1209
|
+
}
|
|
1210
|
+
function sr(e) {
|
|
1211
|
+
const { container: t, ...s } = e, r = document.createElement("div");
|
|
1212
|
+
r.className = "netless-app-slide-preview-wrapper";
|
|
1213
|
+
const o = new O(s);
|
|
1214
|
+
return r.appendChild(document.createElement("style")).textContent = O.styles, r.appendChild(o.$content), r.appendChild(o.$footer), t.appendChild(r), o.prepare(() => o.slide.renderSlide(1)), o;
|
|
1215
|
+
}
|
|
1216
|
+
const rr = /* @__PURE__ */ ce.usePlugin.bind(ce), or = "0.3.0-canary.13", nr = {
|
|
983
1217
|
kind: "Slide",
|
|
984
1218
|
setup(e) {
|
|
985
|
-
var
|
|
986
|
-
|
|
1219
|
+
var n, l;
|
|
1220
|
+
console.log("[Slide] setup @ 0.3.0-canary.13 (" + e.appId + ")");
|
|
1221
|
+
const t = new J(e);
|
|
1222
|
+
if (t.info("[Slide] setup @ 0.3.0-canary.13"), !e.attributes.taskId)
|
|
987
1223
|
throw new Error("[Slide] no taskId");
|
|
988
|
-
const
|
|
989
|
-
r.info("[Slide] setup @ 0.3.0-canary.11");
|
|
990
|
-
const o = new ze(), l = new B({
|
|
1224
|
+
const s = e.createStorage("slide", e.attributes), r = e.getAppOptions() || {}, o = r.renderOptions || {}, i = new Me(), a = new O({
|
|
991
1225
|
interactive: !0,
|
|
992
1226
|
mode: "interactive",
|
|
993
|
-
resize: !0,
|
|
994
1227
|
enableGlobalClick: !0,
|
|
995
|
-
timestamp:
|
|
996
|
-
logger:
|
|
1228
|
+
timestamp: Ot(e),
|
|
1229
|
+
logger: r.logger || t,
|
|
997
1230
|
renderOptions: {
|
|
998
|
-
minFPS:
|
|
999
|
-
maxFPS:
|
|
1000
|
-
autoFPS: (
|
|
1001
|
-
autoResolution: (
|
|
1002
|
-
resolution:
|
|
1003
|
-
maxResolutionLevel:
|
|
1004
|
-
transactionBgColor:
|
|
1231
|
+
minFPS: o.minFPS || 25,
|
|
1232
|
+
maxFPS: o.maxFPS || 30,
|
|
1233
|
+
autoFPS: (n = o.autoFPS) != null ? n : !0,
|
|
1234
|
+
autoResolution: (l = o.autoResolution) != null ? l : !0,
|
|
1235
|
+
resolution: o.resolution,
|
|
1236
|
+
maxResolutionLevel: o.maxResolutionLevel,
|
|
1237
|
+
transactionBgColor: o.transactionBgColor || Ue(e.box.$content)
|
|
1005
1238
|
},
|
|
1006
|
-
rtcAudio:
|
|
1007
|
-
useLocalCache:
|
|
1008
|
-
resourceTimeout:
|
|
1009
|
-
loaderDelegate:
|
|
1010
|
-
navigatorDelegate:
|
|
1011
|
-
fixedFrameSize:
|
|
1012
|
-
taskId:
|
|
1013
|
-
url:
|
|
1239
|
+
rtcAudio: r.rtcAudio,
|
|
1240
|
+
useLocalCache: r.useLocalCache,
|
|
1241
|
+
resourceTimeout: r.resourceTimeout,
|
|
1242
|
+
loaderDelegate: r.loaderDelegate,
|
|
1243
|
+
navigatorDelegate: r.navigatorDelegate,
|
|
1244
|
+
fixedFrameSize: r.fixedFrameSize,
|
|
1245
|
+
taskId: s.state.taskId,
|
|
1246
|
+
url: s.state.url
|
|
1014
1247
|
});
|
|
1015
|
-
return
|
|
1016
|
-
|
|
1017
|
-
|
|
1248
|
+
return Object.assign(a, { context: e, logger: t }), i.push(Te.set(e.appId, a)), i.push(a.events.on("freeze", () => t.info("[Slide] freeze"))), i.push(a.events.on("unfreeze", () => t.info("[Slide] unfreeze"))), i.push(
|
|
1249
|
+
a.events.on(
|
|
1250
|
+
"prepareError",
|
|
1251
|
+
(p) => t.info("[Slide] fetch slide info failed: " + p.message)
|
|
1252
|
+
)
|
|
1253
|
+
), i.push(
|
|
1254
|
+
a.events.on(
|
|
1255
|
+
"renderError",
|
|
1256
|
+
({ error: p, index: c }) => t.info(`[Slide] render failed [${c}]: ${p.message}`)
|
|
1257
|
+
)
|
|
1258
|
+
), e.box.mountStyles(O.styles), e.box.mountStage(a.$slide), e.box.mountFooter(a.$footer), e.box.mountContent(a.$content), i.push(() => a.destroy()), Xs({ context: e, storage: s, viewer: a, sideEffect: i, logger: t }), e.emitter.on("destroy", () => {
|
|
1259
|
+
t.info("[Slide] destroy"), t.destroy(), i.flushAll();
|
|
1260
|
+
}), a;
|
|
1018
1261
|
}
|
|
1019
1262
|
};
|
|
1020
|
-
function Ks(e) {
|
|
1021
|
-
const { container: t, ...s } = e, r = document.createElement("div");
|
|
1022
|
-
r.className = "netless-app-slide-preview-wrapper";
|
|
1023
|
-
const o = new B(s);
|
|
1024
|
-
return r.appendChild(document.createElement("style")).textContent = B.styles, r.appendChild(o.$content), r.appendChild(o.$footer), t.appendChild(r), o.prepare(() => o.slide.renderSlide(1)), o;
|
|
1025
|
-
}
|
|
1026
|
-
function Vs(e) {
|
|
1027
|
-
const t = e.room, s = e.displayer;
|
|
1028
|
-
return t ? () => t.calibrationTimestamp : s ? () => s.beginTimestamp + s.progressTime : () => Date.now();
|
|
1029
|
-
}
|
|
1030
|
-
function Us(e, t) {
|
|
1031
|
-
return e.displayer.logger;
|
|
1032
|
-
}
|
|
1033
|
-
function dt(e) {
|
|
1034
|
-
try {
|
|
1035
|
-
let t = window.getComputedStyle(e).backgroundColor;
|
|
1036
|
-
if (t !== "rgba(0, 0, 0, 0)" && t !== "transparent")
|
|
1037
|
-
return t = qs(t), console.log("[Slide] guess bg color:", t), t;
|
|
1038
|
-
if (e.parentElement)
|
|
1039
|
-
return dt(e.parentElement);
|
|
1040
|
-
} catch {
|
|
1041
|
-
}
|
|
1042
|
-
return "#ffffff";
|
|
1043
|
-
}
|
|
1044
|
-
function qs(e) {
|
|
1045
|
-
const t = Ce.exports.get(e);
|
|
1046
|
-
if (t && t.model === "rgb") {
|
|
1047
|
-
const s = t.value, o = (((Math.round(s[0]) & 255) << 16) + ((Math.round(s[1]) & 255) << 8) + (Math.round(s[2]) & 255)).toString(16);
|
|
1048
|
-
return "#" + "000000".substring(o.length) + o;
|
|
1049
|
-
} else
|
|
1050
|
-
return e;
|
|
1051
|
-
}
|
|
1052
|
-
function Bs(e, t) {
|
|
1053
|
-
e.emitter.on("destroy", t);
|
|
1054
|
-
}
|
|
1055
|
-
function Hs({ context: e, viewer: t, sideEffect: s, logger: r }) {
|
|
1056
|
-
const o = r.info.bind(r);
|
|
1057
|
-
let l = null;
|
|
1058
|
-
t.prepare(({ width: n, height: d, slideCount: u }) => {
|
|
1059
|
-
e.destroyed || (n && e.box.setStageRatio(d / n), l = e.createWhiteBoardView({ size: u }), l.setBaseRect({ width: n, height: d }), a());
|
|
1060
|
-
});
|
|
1061
|
-
const { slide: i } = t;
|
|
1062
|
-
function a() {
|
|
1063
|
-
if (e.storage.state.state)
|
|
1064
|
-
o("[Slide] restore", { ...e.storage.state.state }), i.setSlideState(e.storage.state.state);
|
|
1065
|
-
else if (e.isAddApp)
|
|
1066
|
-
o("[Slide] kick start"), i.renderSlide(1);
|
|
1067
|
-
else {
|
|
1068
|
-
o("[Slide] wait for restore");
|
|
1069
|
-
const n = s.add(() => {
|
|
1070
|
-
const u = setInterval(() => {
|
|
1071
|
-
e.storage.state.state || (o("[Slide] timeout"), i.renderSlide(1));
|
|
1072
|
-
}, 15e3);
|
|
1073
|
-
return () => clearInterval(u);
|
|
1074
|
-
}), d = s.addDisposer(e.storage.addStateChangedListener(() => {
|
|
1075
|
-
e.storage.state.state && (o("[Slide] restore", { ...e.storage.state.state }), i.setSlideState(e.storage.state.state), s.flush(d), s.flush(n));
|
|
1076
|
-
}));
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
|
-
i.on("stateChange", () => {
|
|
1080
|
-
e.isWritable && (o("[Slide] save state", { ...i.slideState }), e.storage.setState({ state: i.slideState }));
|
|
1081
|
-
}), i.on("syncDispatch", (n) => {
|
|
1082
|
-
e.isWritable && (o("[Slide] dispatch", { ...n }), e.dispatchMagixEvent("syncDispatch", n));
|
|
1083
|
-
}), s.addDisposer(e.addMagixEventListener("syncDispatch", ({ payload: n }) => {
|
|
1084
|
-
o("[Slide] receive", { ...n }), i.emit("syncReceive", n);
|
|
1085
|
-
}, { fireSelfEventAfterCommit: !0 })), i.on("slideChange", (n) => {
|
|
1086
|
-
e.isWritable && l && (o("[Slide] page to", n), l.jumpPage(n - 1));
|
|
1087
|
-
}), t.setReadonly(!e.isWritable), s.addDisposer(e.emitter.on("writableChange", (n) => {
|
|
1088
|
-
t.setReadonly(!n);
|
|
1089
|
-
})), s.addEventListener(window, "keydown", (n) => {
|
|
1090
|
-
e.box.focus && ((n.key === "ArrowUp" || n.key === "ArrowLeft") && t.slide.prevStep(), (n.key === "ArrowRight" || n.key === "ArrowDown") && t.slide.nextStep());
|
|
1091
|
-
});
|
|
1092
|
-
}
|
|
1093
1263
|
export {
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1264
|
+
Pe as DefaultUrl,
|
|
1265
|
+
lr as Slide,
|
|
1266
|
+
O as SlideViewer,
|
|
1267
|
+
tr as addHooks,
|
|
1268
|
+
nr as default,
|
|
1269
|
+
sr as previewSlide,
|
|
1270
|
+
Te as refrigerator,
|
|
1271
|
+
rr as usePlugin,
|
|
1272
|
+
or as version
|
|
1103
1273
|
};
|
|
1104
1274
|
//# sourceMappingURL=main.mjs.map
|