@netless/app-slide 0.3.0-canary.2 → 0.3.0-canary.21
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/README-zh.md +17 -7
- package/README.md +4 -7
- package/dist/Logger.d.ts +12 -0
- package/dist/Refrigerator.d.ts +3 -1
- package/dist/SlideViewer/footer.d.ts +12 -0
- package/dist/{SlideViewer.d.ts → SlideViewer/index.d.ts} +33 -20
- 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/icons/save.d.ts +1 -0
- package/dist/icons/spinner.d.ts +1 -0
- package/dist/index.d.ts +7 -6
- package/dist/main.js +3 -0
- package/dist/main.js.map +1 -0
- package/dist/main.mjs +1406 -0
- package/dist/main.mjs.map +1 -0
- package/dist/preview.d.ts +5 -0
- package/dist/typings.d.ts +9 -18
- package/dist/utils.d.ts +12 -0
- package/package.json +12 -8
- package/src/Logger.ts +38 -0
- package/src/Refrigerator.ts +11 -1
- package/src/SlideViewer/footer.ts +169 -0
- package/src/SlideViewer/index.ts +329 -0
- package/src/SlideViewer/sidebar.ts +140 -0
- package/src/SlideViewer/typings.ts +21 -0
- package/src/SlideViewer/utils.ts +37 -0
- package/src/connect.ts +152 -0
- package/src/constants.ts +1 -1
- package/src/icons/index.ts +5 -0
- package/src/icons/save.ts +18 -0
- package/src/icons/spinner.ts +37 -0
- package/src/index.ts +64 -192
- package/src/preview.ts +21 -0
- package/src/style.scss +67 -16
- package/src/typings.ts +18 -16
- package/src/utils.ts +90 -0
- package/dist/main.cjs.js +0 -6363
- package/dist/main.cjs.js.map +0 -1
- package/dist/main.es.js +0 -38214
- package/dist/main.es.js.map +0 -1
- package/dist/main.iife.js +0 -6363
- package/dist/main.iife.js.map +0 -1
- package/src/SlideViewer.ts +0 -557
package/dist/main.mjs
ADDED
|
@@ -0,0 +1,1406 @@
|
|
|
1
|
+
var At = Object.defineProperty;
|
|
2
|
+
var It = (e, t, s) => t in e ? At(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
|
+
var d = (e, t, s) => (It(e, typeof t != "symbol" ? t + "" : t, s), s);
|
|
4
|
+
import { Slide as pe } from "@netless/slide";
|
|
5
|
+
import { Slide as Ir } from "@netless/slide";
|
|
6
|
+
var $t = "!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", zt = 87, Lt = 20, $e = [], Nt = () => {
|
|
7
|
+
for (let e = 0; e < Lt; e++)
|
|
8
|
+
$e[e] = $t.charAt(Math.random() * zt);
|
|
9
|
+
return $e.join("");
|
|
10
|
+
};
|
|
11
|
+
function Fe(e) {
|
|
12
|
+
try {
|
|
13
|
+
return e();
|
|
14
|
+
} catch (t) {
|
|
15
|
+
console.error(t);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
var Ve = class {
|
|
19
|
+
constructor() {
|
|
20
|
+
this.push = this.addDisposer, this.disposers = /* @__PURE__ */ new Map();
|
|
21
|
+
}
|
|
22
|
+
addDisposer(e, t = this.genUID()) {
|
|
23
|
+
return this.flush(t), this.disposers.set(
|
|
24
|
+
t,
|
|
25
|
+
Array.isArray(e) ? Mt(e) : e
|
|
26
|
+
), t;
|
|
27
|
+
}
|
|
28
|
+
add(e, t = this.genUID()) {
|
|
29
|
+
const s = e();
|
|
30
|
+
return s ? this.addDisposer(s, t) : t;
|
|
31
|
+
}
|
|
32
|
+
addEventListener(e, t, s, r, n = this.genUID()) {
|
|
33
|
+
return e.addEventListener(t, s, r), this.addDisposer(
|
|
34
|
+
() => e.removeEventListener(t, s, r),
|
|
35
|
+
n
|
|
36
|
+
), n;
|
|
37
|
+
}
|
|
38
|
+
setTimeout(e, t, s = this.genUID()) {
|
|
39
|
+
const r = window.setTimeout(() => {
|
|
40
|
+
this.remove(s), e();
|
|
41
|
+
}, t);
|
|
42
|
+
return this.addDisposer(() => window.clearTimeout(r), s);
|
|
43
|
+
}
|
|
44
|
+
setInterval(e, t, s = this.genUID()) {
|
|
45
|
+
const r = window.setInterval(e, t);
|
|
46
|
+
return this.addDisposer(() => window.clearInterval(r), s);
|
|
47
|
+
}
|
|
48
|
+
remove(e) {
|
|
49
|
+
const t = this.disposers.get(e);
|
|
50
|
+
return this.disposers.delete(e), t;
|
|
51
|
+
}
|
|
52
|
+
flush(e) {
|
|
53
|
+
const t = this.remove(e);
|
|
54
|
+
t && t();
|
|
55
|
+
}
|
|
56
|
+
flushAll() {
|
|
57
|
+
this.disposers.forEach(Fe), this.disposers.clear();
|
|
58
|
+
}
|
|
59
|
+
genUID() {
|
|
60
|
+
let e;
|
|
61
|
+
do
|
|
62
|
+
e = Nt();
|
|
63
|
+
while (this.disposers.has(e));
|
|
64
|
+
return e;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
function Mt(e) {
|
|
68
|
+
return () => e.forEach(Fe);
|
|
69
|
+
}
|
|
70
|
+
const D = "netless-app-slide", Ue = "https://convertcdn.netless.link/dynamicConvert";
|
|
71
|
+
class Tt {
|
|
72
|
+
constructor() {
|
|
73
|
+
d(this, "threshold", 2);
|
|
74
|
+
d(this, "_map", /* @__PURE__ */ new Map());
|
|
75
|
+
d(this, "_box", /* @__PURE__ */ new Map());
|
|
76
|
+
d(this, "_queue", []);
|
|
77
|
+
}
|
|
78
|
+
set(t, s, r) {
|
|
79
|
+
return this._map.set(t, s), this._box.set(t, r), this._queue.includes(t) || this._queue.unshift(t), this._refresh(), () => {
|
|
80
|
+
this.delete(t);
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
delete(t) {
|
|
84
|
+
this._map.delete(t), this._box.delete(t), this._queue = this._queue.filter((s) => s !== t), this._refresh();
|
|
85
|
+
}
|
|
86
|
+
focus(t) {
|
|
87
|
+
const s = this._queue.indexOf(t);
|
|
88
|
+
s >= 0 && this._queue.splice(s, 1), this._queue.unshift(t), this._refresh();
|
|
89
|
+
}
|
|
90
|
+
_refresh() {
|
|
91
|
+
let t;
|
|
92
|
+
this._queue.sort((s, r) => {
|
|
93
|
+
var o, a;
|
|
94
|
+
const n = ((o = this._box.get(s)) == null ? void 0 : o.zIndex) ?? 0, i = ((a = this._box.get(r)) == null ? void 0 : a.zIndex) ?? 0;
|
|
95
|
+
return -(n - i);
|
|
96
|
+
}), this._queue.forEach((s, r) => {
|
|
97
|
+
(t = this._map.get(s)) && (r < this.threshold ? t.unfreeze() : t.freeze());
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
const Be = new Tt(), yr = function(t) {
|
|
102
|
+
t.on("focus", (s) => {
|
|
103
|
+
Be.focus(s.appId);
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
var T = Symbol.for("$ ANY_EVENT $"), be = (e, t) => {
|
|
107
|
+
try {
|
|
108
|
+
return e(t);
|
|
109
|
+
} catch (s) {
|
|
110
|
+
console.error(s);
|
|
111
|
+
}
|
|
112
|
+
}, Ot = () => {
|
|
113
|
+
}, qe = (e, t) => {
|
|
114
|
+
e.a = be(e.c, t) || Ot;
|
|
115
|
+
}, Pt = (e, t) => {
|
|
116
|
+
for (const s of e)
|
|
117
|
+
s.a || (s.b === T || t.count(s.b) > 0 || t.count(T) > 0) && qe(s, t);
|
|
118
|
+
}, He = (e) => {
|
|
119
|
+
e.a && (be(e.a), e.a = null);
|
|
120
|
+
}, ze = (e, t) => {
|
|
121
|
+
for (const s of e)
|
|
122
|
+
s.a && (s.b === T ? t.count() <= 0 : t.count(T) <= 0 && t.count(s.b) <= 0) && He(s);
|
|
123
|
+
}, je = (e) => {
|
|
124
|
+
try {
|
|
125
|
+
e();
|
|
126
|
+
} catch (t) {
|
|
127
|
+
console.error(t);
|
|
128
|
+
}
|
|
129
|
+
}, Rt = (e) => {
|
|
130
|
+
const t = () => {
|
|
131
|
+
e && (je(e), e = null), t.abortable();
|
|
132
|
+
};
|
|
133
|
+
return t.dispose = t, t.abortable = Dt, t;
|
|
134
|
+
};
|
|
135
|
+
function Dt(e) {
|
|
136
|
+
this._o && je(this._o), this._o = e;
|
|
137
|
+
}
|
|
138
|
+
var Ft = class {
|
|
139
|
+
constructor() {
|
|
140
|
+
d(this, "ANY_EVENT", T);
|
|
141
|
+
d(this, "_l", /* @__PURE__ */ new Map());
|
|
142
|
+
d(this, "_r");
|
|
143
|
+
d(this, "_o");
|
|
144
|
+
}
|
|
145
|
+
emit(e, t) {
|
|
146
|
+
const s = this._l.get(e);
|
|
147
|
+
if (s)
|
|
148
|
+
for (const r of s)
|
|
149
|
+
be(r, t);
|
|
150
|
+
e !== T && this.count(T) && this.emit(T, {
|
|
151
|
+
event: e,
|
|
152
|
+
data: t
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
on(e, t) {
|
|
156
|
+
let s = this._l.get(e);
|
|
157
|
+
return s || (s = /* @__PURE__ */ new Set(), this._l.set(e, s)), s.add(t), this._r && s.size === 1 && Pt(
|
|
158
|
+
this._r,
|
|
159
|
+
this
|
|
160
|
+
), () => {
|
|
161
|
+
this.off(e, t);
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
once(e, t) {
|
|
165
|
+
const s = Rt(() => this.off(e, r)), r = (n) => (s(), t(n));
|
|
166
|
+
return (this._o || (this._o = /* @__PURE__ */ new WeakMap())).set(
|
|
167
|
+
t,
|
|
168
|
+
r
|
|
169
|
+
), this.on(e, r), s;
|
|
170
|
+
}
|
|
171
|
+
off(e, t) {
|
|
172
|
+
var r;
|
|
173
|
+
const s = this._l.get(e);
|
|
174
|
+
if (s) {
|
|
175
|
+
let n = s.delete(t);
|
|
176
|
+
const i = (r = this._o) == null ? void 0 : r.get(t);
|
|
177
|
+
return i && (n = s.delete(i) || n), s.size <= 0 && (this._l.delete(e), this._r && ze(this._r, this)), n;
|
|
178
|
+
}
|
|
179
|
+
return !1;
|
|
180
|
+
}
|
|
181
|
+
clear(e) {
|
|
182
|
+
var t;
|
|
183
|
+
e ? (t = this._l.get(e)) == null || t.clear() : this._l.clear(), this._r && ze(this._r, this);
|
|
184
|
+
}
|
|
185
|
+
count(e) {
|
|
186
|
+
var t;
|
|
187
|
+
if (e)
|
|
188
|
+
return ((t = this._l.get(e)) == null ? void 0 : t.size) || 0;
|
|
189
|
+
{
|
|
190
|
+
let s = 0;
|
|
191
|
+
for (const r of this._l.values())
|
|
192
|
+
s += r.size;
|
|
193
|
+
return s;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
remit(e, t) {
|
|
197
|
+
const s = {
|
|
198
|
+
c: t,
|
|
199
|
+
b: e
|
|
200
|
+
};
|
|
201
|
+
return (this._r || (this._r = /* @__PURE__ */ new Set())).add(
|
|
202
|
+
s
|
|
203
|
+
), (this.count(e) > 0 || this.count(T) > 0) && qe(s, this), () => {
|
|
204
|
+
var r;
|
|
205
|
+
(r = this._r) == null || r.delete(s), He(s);
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
dispose() {
|
|
209
|
+
var e;
|
|
210
|
+
this.clear(), (e = this._r) == null || e.clear();
|
|
211
|
+
}
|
|
212
|
+
}, Vt = class extends Ft {
|
|
213
|
+
constructor() {
|
|
214
|
+
super();
|
|
215
|
+
d(this, "emit", super.emit);
|
|
216
|
+
d(this, "remit", super.remit);
|
|
217
|
+
}
|
|
218
|
+
}, he = {}, Ut = {
|
|
219
|
+
get exports() {
|
|
220
|
+
return he;
|
|
221
|
+
},
|
|
222
|
+
set exports(e) {
|
|
223
|
+
he = e;
|
|
224
|
+
}
|
|
225
|
+
}, Bt = {
|
|
226
|
+
aliceblue: [240, 248, 255],
|
|
227
|
+
antiquewhite: [250, 235, 215],
|
|
228
|
+
aqua: [0, 255, 255],
|
|
229
|
+
aquamarine: [127, 255, 212],
|
|
230
|
+
azure: [240, 255, 255],
|
|
231
|
+
beige: [245, 245, 220],
|
|
232
|
+
bisque: [255, 228, 196],
|
|
233
|
+
black: [0, 0, 0],
|
|
234
|
+
blanchedalmond: [255, 235, 205],
|
|
235
|
+
blue: [0, 0, 255],
|
|
236
|
+
blueviolet: [138, 43, 226],
|
|
237
|
+
brown: [165, 42, 42],
|
|
238
|
+
burlywood: [222, 184, 135],
|
|
239
|
+
cadetblue: [95, 158, 160],
|
|
240
|
+
chartreuse: [127, 255, 0],
|
|
241
|
+
chocolate: [210, 105, 30],
|
|
242
|
+
coral: [255, 127, 80],
|
|
243
|
+
cornflowerblue: [100, 149, 237],
|
|
244
|
+
cornsilk: [255, 248, 220],
|
|
245
|
+
crimson: [220, 20, 60],
|
|
246
|
+
cyan: [0, 255, 255],
|
|
247
|
+
darkblue: [0, 0, 139],
|
|
248
|
+
darkcyan: [0, 139, 139],
|
|
249
|
+
darkgoldenrod: [184, 134, 11],
|
|
250
|
+
darkgray: [169, 169, 169],
|
|
251
|
+
darkgreen: [0, 100, 0],
|
|
252
|
+
darkgrey: [169, 169, 169],
|
|
253
|
+
darkkhaki: [189, 183, 107],
|
|
254
|
+
darkmagenta: [139, 0, 139],
|
|
255
|
+
darkolivegreen: [85, 107, 47],
|
|
256
|
+
darkorange: [255, 140, 0],
|
|
257
|
+
darkorchid: [153, 50, 204],
|
|
258
|
+
darkred: [139, 0, 0],
|
|
259
|
+
darksalmon: [233, 150, 122],
|
|
260
|
+
darkseagreen: [143, 188, 143],
|
|
261
|
+
darkslateblue: [72, 61, 139],
|
|
262
|
+
darkslategray: [47, 79, 79],
|
|
263
|
+
darkslategrey: [47, 79, 79],
|
|
264
|
+
darkturquoise: [0, 206, 209],
|
|
265
|
+
darkviolet: [148, 0, 211],
|
|
266
|
+
deeppink: [255, 20, 147],
|
|
267
|
+
deepskyblue: [0, 191, 255],
|
|
268
|
+
dimgray: [105, 105, 105],
|
|
269
|
+
dimgrey: [105, 105, 105],
|
|
270
|
+
dodgerblue: [30, 144, 255],
|
|
271
|
+
firebrick: [178, 34, 34],
|
|
272
|
+
floralwhite: [255, 250, 240],
|
|
273
|
+
forestgreen: [34, 139, 34],
|
|
274
|
+
fuchsia: [255, 0, 255],
|
|
275
|
+
gainsboro: [220, 220, 220],
|
|
276
|
+
ghostwhite: [248, 248, 255],
|
|
277
|
+
gold: [255, 215, 0],
|
|
278
|
+
goldenrod: [218, 165, 32],
|
|
279
|
+
gray: [128, 128, 128],
|
|
280
|
+
green: [0, 128, 0],
|
|
281
|
+
greenyellow: [173, 255, 47],
|
|
282
|
+
grey: [128, 128, 128],
|
|
283
|
+
honeydew: [240, 255, 240],
|
|
284
|
+
hotpink: [255, 105, 180],
|
|
285
|
+
indianred: [205, 92, 92],
|
|
286
|
+
indigo: [75, 0, 130],
|
|
287
|
+
ivory: [255, 255, 240],
|
|
288
|
+
khaki: [240, 230, 140],
|
|
289
|
+
lavender: [230, 230, 250],
|
|
290
|
+
lavenderblush: [255, 240, 245],
|
|
291
|
+
lawngreen: [124, 252, 0],
|
|
292
|
+
lemonchiffon: [255, 250, 205],
|
|
293
|
+
lightblue: [173, 216, 230],
|
|
294
|
+
lightcoral: [240, 128, 128],
|
|
295
|
+
lightcyan: [224, 255, 255],
|
|
296
|
+
lightgoldenrodyellow: [250, 250, 210],
|
|
297
|
+
lightgray: [211, 211, 211],
|
|
298
|
+
lightgreen: [144, 238, 144],
|
|
299
|
+
lightgrey: [211, 211, 211],
|
|
300
|
+
lightpink: [255, 182, 193],
|
|
301
|
+
lightsalmon: [255, 160, 122],
|
|
302
|
+
lightseagreen: [32, 178, 170],
|
|
303
|
+
lightskyblue: [135, 206, 250],
|
|
304
|
+
lightslategray: [119, 136, 153],
|
|
305
|
+
lightslategrey: [119, 136, 153],
|
|
306
|
+
lightsteelblue: [176, 196, 222],
|
|
307
|
+
lightyellow: [255, 255, 224],
|
|
308
|
+
lime: [0, 255, 0],
|
|
309
|
+
limegreen: [50, 205, 50],
|
|
310
|
+
linen: [250, 240, 230],
|
|
311
|
+
magenta: [255, 0, 255],
|
|
312
|
+
maroon: [128, 0, 0],
|
|
313
|
+
mediumaquamarine: [102, 205, 170],
|
|
314
|
+
mediumblue: [0, 0, 205],
|
|
315
|
+
mediumorchid: [186, 85, 211],
|
|
316
|
+
mediumpurple: [147, 112, 219],
|
|
317
|
+
mediumseagreen: [60, 179, 113],
|
|
318
|
+
mediumslateblue: [123, 104, 238],
|
|
319
|
+
mediumspringgreen: [0, 250, 154],
|
|
320
|
+
mediumturquoise: [72, 209, 204],
|
|
321
|
+
mediumvioletred: [199, 21, 133],
|
|
322
|
+
midnightblue: [25, 25, 112],
|
|
323
|
+
mintcream: [245, 255, 250],
|
|
324
|
+
mistyrose: [255, 228, 225],
|
|
325
|
+
moccasin: [255, 228, 181],
|
|
326
|
+
navajowhite: [255, 222, 173],
|
|
327
|
+
navy: [0, 0, 128],
|
|
328
|
+
oldlace: [253, 245, 230],
|
|
329
|
+
olive: [128, 128, 0],
|
|
330
|
+
olivedrab: [107, 142, 35],
|
|
331
|
+
orange: [255, 165, 0],
|
|
332
|
+
orangered: [255, 69, 0],
|
|
333
|
+
orchid: [218, 112, 214],
|
|
334
|
+
palegoldenrod: [238, 232, 170],
|
|
335
|
+
palegreen: [152, 251, 152],
|
|
336
|
+
paleturquoise: [175, 238, 238],
|
|
337
|
+
palevioletred: [219, 112, 147],
|
|
338
|
+
papayawhip: [255, 239, 213],
|
|
339
|
+
peachpuff: [255, 218, 185],
|
|
340
|
+
peru: [205, 133, 63],
|
|
341
|
+
pink: [255, 192, 203],
|
|
342
|
+
plum: [221, 160, 221],
|
|
343
|
+
powderblue: [176, 224, 230],
|
|
344
|
+
purple: [128, 0, 128],
|
|
345
|
+
rebeccapurple: [102, 51, 153],
|
|
346
|
+
red: [255, 0, 0],
|
|
347
|
+
rosybrown: [188, 143, 143],
|
|
348
|
+
royalblue: [65, 105, 225],
|
|
349
|
+
saddlebrown: [139, 69, 19],
|
|
350
|
+
salmon: [250, 128, 114],
|
|
351
|
+
sandybrown: [244, 164, 96],
|
|
352
|
+
seagreen: [46, 139, 87],
|
|
353
|
+
seashell: [255, 245, 238],
|
|
354
|
+
sienna: [160, 82, 45],
|
|
355
|
+
silver: [192, 192, 192],
|
|
356
|
+
skyblue: [135, 206, 235],
|
|
357
|
+
slateblue: [106, 90, 205],
|
|
358
|
+
slategray: [112, 128, 144],
|
|
359
|
+
slategrey: [112, 128, 144],
|
|
360
|
+
snow: [255, 250, 250],
|
|
361
|
+
springgreen: [0, 255, 127],
|
|
362
|
+
steelblue: [70, 130, 180],
|
|
363
|
+
tan: [210, 180, 140],
|
|
364
|
+
teal: [0, 128, 128],
|
|
365
|
+
thistle: [216, 191, 216],
|
|
366
|
+
tomato: [255, 99, 71],
|
|
367
|
+
turquoise: [64, 224, 208],
|
|
368
|
+
violet: [238, 130, 238],
|
|
369
|
+
wheat: [245, 222, 179],
|
|
370
|
+
white: [255, 255, 255],
|
|
371
|
+
whitesmoke: [245, 245, 245],
|
|
372
|
+
yellow: [255, 255, 0],
|
|
373
|
+
yellowgreen: [154, 205, 50]
|
|
374
|
+
}, fe = {}, qt = {
|
|
375
|
+
get exports() {
|
|
376
|
+
return fe;
|
|
377
|
+
},
|
|
378
|
+
set exports(e) {
|
|
379
|
+
fe = e;
|
|
380
|
+
}
|
|
381
|
+
}, Ht = function(t) {
|
|
382
|
+
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");
|
|
383
|
+
}, jt = Ht, Gt = Array.prototype.concat, Wt = Array.prototype.slice, Le = qt.exports = function(t) {
|
|
384
|
+
for (var s = [], r = 0, n = t.length; r < n; r++) {
|
|
385
|
+
var i = t[r];
|
|
386
|
+
jt(i) ? s = Gt.call(s, Wt.call(i)) : s.push(i);
|
|
387
|
+
}
|
|
388
|
+
return s;
|
|
389
|
+
};
|
|
390
|
+
Le.wrap = function(e) {
|
|
391
|
+
return function() {
|
|
392
|
+
return e(Le(arguments));
|
|
393
|
+
};
|
|
394
|
+
};
|
|
395
|
+
var Z = Bt, Q = fe, Ge = Object.hasOwnProperty, We = /* @__PURE__ */ Object.create(null);
|
|
396
|
+
for (var ue in Z)
|
|
397
|
+
Ge.call(Z, ue) && (We[Z[ue]] = ue);
|
|
398
|
+
var C = Ut.exports = {
|
|
399
|
+
to: {},
|
|
400
|
+
get: {}
|
|
401
|
+
};
|
|
402
|
+
C.get = function(e) {
|
|
403
|
+
var t = e.substring(0, 3).toLowerCase(), s, r;
|
|
404
|
+
switch (t) {
|
|
405
|
+
case "hsl":
|
|
406
|
+
s = C.get.hsl(e), r = "hsl";
|
|
407
|
+
break;
|
|
408
|
+
case "hwb":
|
|
409
|
+
s = C.get.hwb(e), r = "hwb";
|
|
410
|
+
break;
|
|
411
|
+
default:
|
|
412
|
+
s = C.get.rgb(e), r = "rgb";
|
|
413
|
+
break;
|
|
414
|
+
}
|
|
415
|
+
return s ? { model: r, value: s } : null;
|
|
416
|
+
};
|
|
417
|
+
C.get.rgb = function(e) {
|
|
418
|
+
if (!e)
|
|
419
|
+
return null;
|
|
420
|
+
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*)?\)$/, n = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/, i = /^(\w+)$/, o = [0, 0, 0, 1], a, l, u;
|
|
421
|
+
if (a = e.match(s)) {
|
|
422
|
+
for (u = a[2], a = a[1], l = 0; l < 3; l++) {
|
|
423
|
+
var b = l * 2;
|
|
424
|
+
o[l] = parseInt(a.slice(b, b + 2), 16);
|
|
425
|
+
}
|
|
426
|
+
u && (o[3] = parseInt(u, 16) / 255);
|
|
427
|
+
} else if (a = e.match(t)) {
|
|
428
|
+
for (a = a[1], u = a[3], l = 0; l < 3; l++)
|
|
429
|
+
o[l] = parseInt(a[l] + a[l], 16);
|
|
430
|
+
u && (o[3] = parseInt(u + u, 16) / 255);
|
|
431
|
+
} else if (a = e.match(r)) {
|
|
432
|
+
for (l = 0; l < 3; l++)
|
|
433
|
+
o[l] = parseInt(a[l + 1], 0);
|
|
434
|
+
a[4] && (a[5] ? o[3] = parseFloat(a[4]) * 0.01 : o[3] = parseFloat(a[4]));
|
|
435
|
+
} else if (a = e.match(n)) {
|
|
436
|
+
for (l = 0; l < 3; l++)
|
|
437
|
+
o[l] = Math.round(parseFloat(a[l + 1]) * 2.55);
|
|
438
|
+
a[4] && (a[5] ? o[3] = parseFloat(a[4]) * 0.01 : o[3] = parseFloat(a[4]));
|
|
439
|
+
} else
|
|
440
|
+
return (a = e.match(i)) ? a[1] === "transparent" ? [0, 0, 0, 0] : Ge.call(Z, a[1]) ? (o = Z[a[1]], o[3] = 1, o) : null : null;
|
|
441
|
+
for (l = 0; l < 3; l++)
|
|
442
|
+
o[l] = V(o[l], 0, 255);
|
|
443
|
+
return o[3] = V(o[3], 0, 1), o;
|
|
444
|
+
};
|
|
445
|
+
C.get.hsl = function(e) {
|
|
446
|
+
if (!e)
|
|
447
|
+
return null;
|
|
448
|
+
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);
|
|
449
|
+
if (s) {
|
|
450
|
+
var r = parseFloat(s[4]), n = (parseFloat(s[1]) % 360 + 360) % 360, i = V(parseFloat(s[2]), 0, 100), o = V(parseFloat(s[3]), 0, 100), a = V(isNaN(r) ? 1 : r, 0, 1);
|
|
451
|
+
return [n, i, o, a];
|
|
452
|
+
}
|
|
453
|
+
return null;
|
|
454
|
+
};
|
|
455
|
+
C.get.hwb = function(e) {
|
|
456
|
+
if (!e)
|
|
457
|
+
return null;
|
|
458
|
+
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);
|
|
459
|
+
if (s) {
|
|
460
|
+
var r = parseFloat(s[4]), n = (parseFloat(s[1]) % 360 + 360) % 360, i = V(parseFloat(s[2]), 0, 100), o = V(parseFloat(s[3]), 0, 100), a = V(isNaN(r) ? 1 : r, 0, 1);
|
|
461
|
+
return [n, i, o, a];
|
|
462
|
+
}
|
|
463
|
+
return null;
|
|
464
|
+
};
|
|
465
|
+
C.to.hex = function() {
|
|
466
|
+
var e = Q(arguments);
|
|
467
|
+
return "#" + oe(e[0]) + oe(e[1]) + oe(e[2]) + (e[3] < 1 ? oe(Math.round(e[3] * 255)) : "");
|
|
468
|
+
};
|
|
469
|
+
C.to.rgb = function() {
|
|
470
|
+
var e = Q(arguments);
|
|
471
|
+
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] + ")";
|
|
472
|
+
};
|
|
473
|
+
C.to.rgb.percent = function() {
|
|
474
|
+
var e = Q(arguments), t = Math.round(e[0] / 255 * 100), s = Math.round(e[1] / 255 * 100), r = Math.round(e[2] / 255 * 100);
|
|
475
|
+
return e.length < 4 || e[3] === 1 ? "rgb(" + t + "%, " + s + "%, " + r + "%)" : "rgba(" + t + "%, " + s + "%, " + r + "%, " + e[3] + ")";
|
|
476
|
+
};
|
|
477
|
+
C.to.hsl = function() {
|
|
478
|
+
var e = Q(arguments);
|
|
479
|
+
return e.length < 4 || e[3] === 1 ? "hsl(" + e[0] + ", " + e[1] + "%, " + e[2] + "%)" : "hsla(" + e[0] + ", " + e[1] + "%, " + e[2] + "%, " + e[3] + ")";
|
|
480
|
+
};
|
|
481
|
+
C.to.hwb = function() {
|
|
482
|
+
var e = Q(arguments), t = "";
|
|
483
|
+
return e.length >= 4 && e[3] !== 1 && (t = ", " + e[3]), "hwb(" + e[0] + ", " + e[1] + "%, " + e[2] + "%" + t + ")";
|
|
484
|
+
};
|
|
485
|
+
C.to.keyword = function(e) {
|
|
486
|
+
return We[e.slice(0, 3)];
|
|
487
|
+
};
|
|
488
|
+
function V(e, t, s) {
|
|
489
|
+
return Math.min(Math.max(t, e), s);
|
|
490
|
+
}
|
|
491
|
+
function oe(e) {
|
|
492
|
+
var t = Math.round(e).toString(16).toUpperCase();
|
|
493
|
+
return t.length < 2 ? "0" + t : t;
|
|
494
|
+
}
|
|
495
|
+
function W() {
|
|
496
|
+
}
|
|
497
|
+
function ne(e) {
|
|
498
|
+
return document.createElement(e);
|
|
499
|
+
}
|
|
500
|
+
function y(e, t) {
|
|
501
|
+
const s = ne(e);
|
|
502
|
+
return Jt(s, t), s;
|
|
503
|
+
}
|
|
504
|
+
function H(e, t) {
|
|
505
|
+
return e.appendChild(t);
|
|
506
|
+
}
|
|
507
|
+
function _(e) {
|
|
508
|
+
return `${D}-${e}`;
|
|
509
|
+
}
|
|
510
|
+
function Jt(e, t) {
|
|
511
|
+
e.className = _(t);
|
|
512
|
+
}
|
|
513
|
+
function Xt(e) {
|
|
514
|
+
return e.endsWith("/") ? e.slice(0, -1) : e;
|
|
515
|
+
}
|
|
516
|
+
function Ne(e, t) {
|
|
517
|
+
if (typeof e == "object" && e !== null)
|
|
518
|
+
return e[t];
|
|
519
|
+
}
|
|
520
|
+
function Me() {
|
|
521
|
+
let e;
|
|
522
|
+
return [new Promise((s) => {
|
|
523
|
+
e = s;
|
|
524
|
+
}), e];
|
|
525
|
+
}
|
|
526
|
+
function Yt(e) {
|
|
527
|
+
const t = e.room, s = e.displayer;
|
|
528
|
+
return t ? () => t.calibrationTimestamp : s ? () => s.beginTimestamp + s.progressTime : () => Date.now();
|
|
529
|
+
}
|
|
530
|
+
function Je(e) {
|
|
531
|
+
try {
|
|
532
|
+
let t = window.getComputedStyle(e).backgroundColor;
|
|
533
|
+
if (t !== "rgba(0, 0, 0, 0)" && t !== "transparent")
|
|
534
|
+
return t = Zt(t), console.log("[Slide] guess bg color:", t), t;
|
|
535
|
+
if (e.parentElement)
|
|
536
|
+
return Je(e.parentElement);
|
|
537
|
+
} catch {
|
|
538
|
+
}
|
|
539
|
+
return "#ffffff";
|
|
540
|
+
}
|
|
541
|
+
function Zt(e) {
|
|
542
|
+
const t = he.get(e);
|
|
543
|
+
if (t && t.model === "rgb") {
|
|
544
|
+
const s = t.value, n = (((Math.round(s[0]) & 255) << 16) + ((Math.round(s[1]) & 255) << 8) + (Math.round(s[2]) & 255)).toString(16);
|
|
545
|
+
return "#" + "000000".substring(n.length) + n;
|
|
546
|
+
} else
|
|
547
|
+
return e;
|
|
548
|
+
}
|
|
549
|
+
function Xe(e, t) {
|
|
550
|
+
return `${Xt(t || Ue)}/${e}`;
|
|
551
|
+
}
|
|
552
|
+
async function Kt({ taskId: e, url: t }) {
|
|
553
|
+
const s = Xe(e, t), r = `${s}/preview/1.png`, n = `${s}/jsonOutput/slide-1.json`, i = new Promise((a) => {
|
|
554
|
+
const l = new Image();
|
|
555
|
+
l.onload = () => a(l), l.onerror = () => a(null), l.src = r;
|
|
556
|
+
}), o = fetch(n).then((a) => a.json());
|
|
557
|
+
return { preview: await i, slide: await o };
|
|
558
|
+
}
|
|
559
|
+
function Qt(e) {
|
|
560
|
+
if (typeof document < "u") {
|
|
561
|
+
const t = () => e(document.visibilityState === "visible");
|
|
562
|
+
return document.addEventListener("visibilitychange", t), () => document.removeEventListener("visibilitychange", t);
|
|
563
|
+
}
|
|
564
|
+
return W;
|
|
565
|
+
}
|
|
566
|
+
const es = `.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%;padding:10px;box-sizing:border-box;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;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,.netless-app-slide-wb-view-hidden{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}
|
|
567
|
+
`;
|
|
568
|
+
function ts(e) {
|
|
569
|
+
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
570
|
+
s.setAttribute("class", `${e}-footer-icon-sidebar`), s.setAttribute("viewBox", "0 0 64 64");
|
|
571
|
+
const r = document.createElementNS(t, "path");
|
|
572
|
+
return r.setAttribute("fill", "currentColor"), r.setAttribute(
|
|
573
|
+
"d",
|
|
574
|
+
"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"
|
|
575
|
+
), s.appendChild(r), s;
|
|
576
|
+
}
|
|
577
|
+
function ss(e) {
|
|
578
|
+
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
579
|
+
s.setAttribute("class", `${e}-footer-icon-arrow-left`), s.setAttribute("viewBox", "0 0 500 500");
|
|
580
|
+
const r = document.createElementNS(t, "path");
|
|
581
|
+
return r.setAttribute("fill", "currentColor"), r.setAttribute(
|
|
582
|
+
"d",
|
|
583
|
+
"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"
|
|
584
|
+
), s.appendChild(r), s;
|
|
585
|
+
}
|
|
586
|
+
function rs(e) {
|
|
587
|
+
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
588
|
+
s.setAttribute("class", `${e}-footer-icon-play`), s.setAttribute("viewBox", "0 0 500 500");
|
|
589
|
+
const r = document.createElementNS(t, "path");
|
|
590
|
+
return r.setAttribute("fill", "currentColor"), r.setAttribute(
|
|
591
|
+
"d",
|
|
592
|
+
"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"
|
|
593
|
+
), s.appendChild(r), s;
|
|
594
|
+
}
|
|
595
|
+
function os(e) {
|
|
596
|
+
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
597
|
+
s.setAttribute("class", `${e}-footer-icon-pause`), s.setAttribute("viewBox", "0 0 500 500");
|
|
598
|
+
const r = document.createElementNS(t, "path");
|
|
599
|
+
return r.setAttribute("fill", "currentColor"), r.setAttribute(
|
|
600
|
+
"d",
|
|
601
|
+
"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"
|
|
602
|
+
), s.appendChild(r), s;
|
|
603
|
+
}
|
|
604
|
+
function ns(e) {
|
|
605
|
+
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
606
|
+
s.setAttribute("class", `${e}-footer-icon-arrow-right`), s.setAttribute("viewBox", "0 0 500 500");
|
|
607
|
+
const r = document.createElementNS(t, "path");
|
|
608
|
+
return r.setAttribute("fill", "currentColor"), r.setAttribute(
|
|
609
|
+
"d",
|
|
610
|
+
"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"
|
|
611
|
+
), s.appendChild(r), s;
|
|
612
|
+
}
|
|
613
|
+
function as(e) {
|
|
614
|
+
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
615
|
+
s.setAttribute("class", `${e}-footer-icon-save`), s.setAttribute("viewBox", "0 0 448 512");
|
|
616
|
+
const r = document.createElementNS(t, "path");
|
|
617
|
+
return r.setAttribute("fill", "currentColor"), r.setAttribute(
|
|
618
|
+
"d",
|
|
619
|
+
"M224 256c-35.2 0-64 28.8-64 64c0 35.2 28.8 64 64 64c35.2 0 64-28.8 64-64C288 284.8 259.2 256 224 256zM433.1 129.1l-83.9-83.9C341.1 37.06 328.8 32 316.1 32H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h320c35.35 0 64-28.65 64-64V163.9C448 151.2 442.9 138.9 433.1 129.1zM128 80h144V160H128V80zM400 416c0 8.836-7.164 16-16 16H64c-8.836 0-16-7.164-16-16V96c0-8.838 7.164-16 16-16h16v104c0 13.25 10.75 24 24 24h192C309.3 208 320 197.3 320 184V83.88l78.25 78.25C399.4 163.2 400 164.8 400 166.3V416z"
|
|
620
|
+
), s.appendChild(r), s;
|
|
621
|
+
}
|
|
622
|
+
function is(e) {
|
|
623
|
+
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
624
|
+
s.setAttribute("class", `${e}-footer-icon-spinner`), s.setAttribute("viewBox", "0 0 512 512");
|
|
625
|
+
const r = document.createElementNS(t, "path");
|
|
626
|
+
r.setAttribute("fill", "currentColor"), r.setAttribute(
|
|
627
|
+
"d",
|
|
628
|
+
"M304 48c0-26.5-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48s48-21.5 48-48zm0 416c0-26.5-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48s48-21.5 48-48zM48 304c26.5 0 48-21.5 48-48s-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48zm464-48c0-26.5-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48s48-21.5 48-48zM142.9 437c18.7-18.7 18.7-49.1 0-67.9s-49.1-18.7-67.9 0s-18.7 49.1 0 67.9s49.1 18.7 67.9 0zm0-294.2c18.7-18.7 18.7-49.1 0-67.9S93.7 56.2 75 75s-18.7 49.1 0 67.9s49.1 18.7 67.9 0zM369.1 437c18.7 18.7 49.1 18.7 67.9 0s18.7-49.1 0-67.9s-49.1-18.7-67.9 0s-18.7 49.1 0 67.9z"
|
|
629
|
+
);
|
|
630
|
+
const n = document.createElementNS(t, "animateTransform");
|
|
631
|
+
n.setAttribute("attributeName", "transform"), n.setAttribute("attributeType", "xml"), n.setAttribute("type", "rotate"), n.setAttribute("from", "0 256 256"), n.setAttribute("to", "360 256 256"), n.setAttribute("begin", "0s"), n.setAttribute("dur", "2s"), n.setAttribute("fill", "freeze"), n.setAttribute("repeatCount", "indefinite"), r.appendChild(n);
|
|
632
|
+
const i = document.createElementNS(t, "text");
|
|
633
|
+
return i.setAttribute("x", "125"), i.setAttribute("y", "345"), i.setAttribute("data-id", "progress"), i.style.fontSize = "246px", i.textContent = "20", s.appendChild(i), s.appendChild(r), s;
|
|
634
|
+
}
|
|
635
|
+
function ls() {
|
|
636
|
+
let e = W;
|
|
637
|
+
const t = (h) => {
|
|
638
|
+
e = h;
|
|
639
|
+
};
|
|
640
|
+
let s = W;
|
|
641
|
+
const r = (h) => {
|
|
642
|
+
s = h;
|
|
643
|
+
};
|
|
644
|
+
let n = W;
|
|
645
|
+
const i = (h) => {
|
|
646
|
+
n = h;
|
|
647
|
+
};
|
|
648
|
+
let o = !1, a = !1, l = 0, u = 0;
|
|
649
|
+
const b = y("div", "footer"), g = y("button", "btn-sidebar");
|
|
650
|
+
g.classList.add(_("footer-btn")), g.appendChild(ts(D)), g.onclick = function() {
|
|
651
|
+
o || s();
|
|
652
|
+
}, g.style.display = "none", b.appendChild(g);
|
|
653
|
+
const m = y("div", "page-jumps"), c = y("button", "btn-page-back");
|
|
654
|
+
c.classList.add(_("footer-btn")), c.appendChild(ss(D)), c.onclick = function() {
|
|
655
|
+
o || e(l - 1);
|
|
656
|
+
}, m.appendChild(c);
|
|
657
|
+
const f = y("button", "btn-page-play");
|
|
658
|
+
f.classList.add(_("footer-btn")), f.appendChild(rs(D)), f.appendChild(os(D));
|
|
659
|
+
let E = 0;
|
|
660
|
+
f.onclick = function() {
|
|
661
|
+
o || (f.classList.add(_("footer-btn-playing")), n(), clearTimeout(E), E = window.setTimeout(() => {
|
|
662
|
+
f.classList.remove(_("footer-btn-playing"));
|
|
663
|
+
}, 500));
|
|
664
|
+
}, m.appendChild(f);
|
|
665
|
+
const z = y("button", "btn-page-next");
|
|
666
|
+
z.classList.add(_("footer-btn")), z.appendChild(ns(D)), z.onclick = function() {
|
|
667
|
+
o || e(l + 1);
|
|
668
|
+
}, m.appendChild(z);
|
|
669
|
+
const A = y("div", "page-number"), v = y("input", "page-number-input");
|
|
670
|
+
v.value = String(l + 1), v.onchange = function() {
|
|
671
|
+
o || v.value && e(Number(v.value) - 1);
|
|
672
|
+
};
|
|
673
|
+
const p = y("span", "total-page");
|
|
674
|
+
p.textContent = " / ", A.appendChild(v), A.appendChild(p), b.appendChild(m), b.appendChild(A);
|
|
675
|
+
const w = _("readonly");
|
|
676
|
+
let k = W;
|
|
677
|
+
const S = (h) => {
|
|
678
|
+
k = h;
|
|
679
|
+
}, I = (h) => {
|
|
680
|
+
if (h < 99) {
|
|
681
|
+
$.style.display = "block", N.style.display = "none";
|
|
682
|
+
const re = $.querySelector("[data-id]");
|
|
683
|
+
re && (re.textContent = h.toString().padStart(2, "0"));
|
|
684
|
+
} else
|
|
685
|
+
$.style.display = "none", N.style.display = "block";
|
|
686
|
+
}, N = as(D), $ = is(D);
|
|
687
|
+
$.style.display = "none";
|
|
688
|
+
const P = y("button", "footer-btn");
|
|
689
|
+
P.appendChild(N), P.onclick = function() {
|
|
690
|
+
k(I);
|
|
691
|
+
}, P.appendChild($);
|
|
692
|
+
function R(h) {
|
|
693
|
+
o !== h && (o = h, b.classList.toggle(w, o), v.disabled = o);
|
|
694
|
+
}
|
|
695
|
+
function xt(h) {
|
|
696
|
+
a !== h && (a = h, g.style.display = a ? "" : "none");
|
|
697
|
+
}
|
|
698
|
+
function Et(h, re = !1) {
|
|
699
|
+
(re || l !== h) && (l = h, v.value = String(l + 1));
|
|
700
|
+
}
|
|
701
|
+
function Ct(h) {
|
|
702
|
+
u !== h && (u = h, p.textContent = ` / ${u}`);
|
|
703
|
+
}
|
|
704
|
+
return {
|
|
705
|
+
$footer: b,
|
|
706
|
+
$pageNumberInput: v,
|
|
707
|
+
set_readonly: R,
|
|
708
|
+
set_sidebar: xt,
|
|
709
|
+
set_page_index: Et,
|
|
710
|
+
set_page_count: Ct,
|
|
711
|
+
on_new_page_index: t,
|
|
712
|
+
on_toggle_preview: r,
|
|
713
|
+
on_play: i,
|
|
714
|
+
on_save_to_pdf: S
|
|
715
|
+
};
|
|
716
|
+
}
|
|
717
|
+
const B = typeof window < "u", Ye = B && !("onscroll" in window) || typeof navigator < "u" && /(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent), Ze = B && "IntersectionObserver" in window, Ke = B && "classList" in document.createElement("p"), Qe = B && window.devicePixelRatio > 1, cs = {
|
|
718
|
+
elements_selector: ".lazy",
|
|
719
|
+
container: Ye || B ? document : null,
|
|
720
|
+
threshold: 300,
|
|
721
|
+
thresholds: null,
|
|
722
|
+
data_src: "src",
|
|
723
|
+
data_srcset: "srcset",
|
|
724
|
+
data_sizes: "sizes",
|
|
725
|
+
data_bg: "bg",
|
|
726
|
+
data_bg_hidpi: "bg-hidpi",
|
|
727
|
+
data_bg_multi: "bg-multi",
|
|
728
|
+
data_bg_multi_hidpi: "bg-multi-hidpi",
|
|
729
|
+
data_bg_set: "bg-set",
|
|
730
|
+
data_poster: "poster",
|
|
731
|
+
class_applied: "applied",
|
|
732
|
+
class_loading: "loading",
|
|
733
|
+
class_loaded: "loaded",
|
|
734
|
+
class_error: "error",
|
|
735
|
+
class_entered: "entered",
|
|
736
|
+
class_exited: "exited",
|
|
737
|
+
unobserve_completed: !0,
|
|
738
|
+
unobserve_entered: !1,
|
|
739
|
+
cancel_on_exit: !0,
|
|
740
|
+
callback_enter: null,
|
|
741
|
+
callback_exit: null,
|
|
742
|
+
callback_applied: null,
|
|
743
|
+
callback_loading: null,
|
|
744
|
+
callback_loaded: null,
|
|
745
|
+
callback_error: null,
|
|
746
|
+
callback_finish: null,
|
|
747
|
+
callback_cancel: null,
|
|
748
|
+
use_native: !1,
|
|
749
|
+
restore_on_error: !1
|
|
750
|
+
}, et = (e) => Object.assign({}, cs, e), Te = function(e, t) {
|
|
751
|
+
let s;
|
|
752
|
+
const r = "LazyLoad::Initialized", n = new e(t);
|
|
753
|
+
try {
|
|
754
|
+
s = new CustomEvent(r, { detail: { instance: n } });
|
|
755
|
+
} catch {
|
|
756
|
+
s = document.createEvent("CustomEvent"), s.initCustomEvent(r, !1, !1, { instance: n });
|
|
757
|
+
}
|
|
758
|
+
window.dispatchEvent(s);
|
|
759
|
+
}, ds = (e, t) => {
|
|
760
|
+
if (t)
|
|
761
|
+
if (!t.length)
|
|
762
|
+
Te(e, t);
|
|
763
|
+
else
|
|
764
|
+
for (let s = 0, r; r = t[s]; s += 1)
|
|
765
|
+
Te(e, r);
|
|
766
|
+
}, O = "src", me = "srcset", ve = "sizes", tt = "poster", ee = "llOriginalAttrs", st = "data", we = "loading", rt = "loaded", ot = "applied", us = "entered", _e = "error", nt = "native", at = "data-", it = "ll-status", x = (e, t) => e.getAttribute(at + t), ps = (e, t, s) => {
|
|
767
|
+
const r = at + t;
|
|
768
|
+
if (s === null) {
|
|
769
|
+
e.removeAttribute(r);
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
e.setAttribute(r, s);
|
|
773
|
+
}, te = (e) => x(e, it), G = (e, t) => ps(e, it, t), ie = (e) => G(e, null), ye = (e) => te(e) === null, hs = (e) => te(e) === we, fs = (e) => te(e) === _e, ke = (e) => te(e) === nt, gs = [we, rt, ot, _e], bs = (e) => gs.indexOf(te(e)) >= 0, q = (e, t, s, r) => {
|
|
774
|
+
if (!(!e || typeof e != "function")) {
|
|
775
|
+
if (r !== void 0) {
|
|
776
|
+
e(t, s, r);
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
779
|
+
if (s !== void 0) {
|
|
780
|
+
e(t, s);
|
|
781
|
+
return;
|
|
782
|
+
}
|
|
783
|
+
e(t);
|
|
784
|
+
}
|
|
785
|
+
}, X = (e, t) => {
|
|
786
|
+
if (Ke) {
|
|
787
|
+
e.classList.add(t);
|
|
788
|
+
return;
|
|
789
|
+
}
|
|
790
|
+
e.className += (e.className ? " " : "") + t;
|
|
791
|
+
}, L = (e, t) => {
|
|
792
|
+
if (Ke) {
|
|
793
|
+
e.classList.remove(t);
|
|
794
|
+
return;
|
|
795
|
+
}
|
|
796
|
+
e.className = e.className.replace(new RegExp("(^|\\s+)" + t + "(\\s+|$)"), " ").replace(/^\s+/, "").replace(/\s+$/, "");
|
|
797
|
+
}, ms = (e) => {
|
|
798
|
+
e.llTempImage = document.createElement("IMG");
|
|
799
|
+
}, vs = (e) => {
|
|
800
|
+
delete e.llTempImage;
|
|
801
|
+
}, lt = (e) => e.llTempImage, le = (e, t) => {
|
|
802
|
+
if (!t)
|
|
803
|
+
return;
|
|
804
|
+
const s = t._observer;
|
|
805
|
+
s && s.unobserve(e);
|
|
806
|
+
}, ws = (e) => {
|
|
807
|
+
e.disconnect();
|
|
808
|
+
}, _s = (e, t, s) => {
|
|
809
|
+
t.unobserve_entered && le(e, s);
|
|
810
|
+
}, Se = (e, t) => {
|
|
811
|
+
e && (e.loadingCount += t);
|
|
812
|
+
}, ys = (e) => {
|
|
813
|
+
e && (e.toLoadCount -= 1);
|
|
814
|
+
}, ct = (e, t) => {
|
|
815
|
+
e && (e.toLoadCount = t);
|
|
816
|
+
}, ks = (e) => e.loadingCount > 0, Ss = (e) => e.toLoadCount > 0, dt = (e) => {
|
|
817
|
+
let t = [];
|
|
818
|
+
for (let s = 0, r; r = e.children[s]; s += 1)
|
|
819
|
+
r.tagName === "SOURCE" && t.push(r);
|
|
820
|
+
return t;
|
|
821
|
+
}, xe = (e, t) => {
|
|
822
|
+
const s = e.parentNode;
|
|
823
|
+
if (!s || s.tagName !== "PICTURE")
|
|
824
|
+
return;
|
|
825
|
+
dt(s).forEach(t);
|
|
826
|
+
}, ut = (e, t) => {
|
|
827
|
+
dt(e).forEach(t);
|
|
828
|
+
}, ce = [O], pt = [O, tt], K = [O, me, ve], ht = [st], de = (e) => !!e[ee], ft = (e) => e[ee], gt = (e) => delete e[ee], J = (e, t) => {
|
|
829
|
+
if (de(e))
|
|
830
|
+
return;
|
|
831
|
+
const s = {};
|
|
832
|
+
t.forEach((r) => {
|
|
833
|
+
s[r] = e.getAttribute(r);
|
|
834
|
+
}), e[ee] = s;
|
|
835
|
+
}, xs = (e) => {
|
|
836
|
+
de(e) || (e[ee] = { backgroundImage: e.style.backgroundImage });
|
|
837
|
+
}, Es = (e, t, s) => {
|
|
838
|
+
if (!s) {
|
|
839
|
+
e.removeAttribute(t);
|
|
840
|
+
return;
|
|
841
|
+
}
|
|
842
|
+
e.setAttribute(t, s);
|
|
843
|
+
}, j = (e, t) => {
|
|
844
|
+
if (!de(e))
|
|
845
|
+
return;
|
|
846
|
+
const s = ft(e);
|
|
847
|
+
t.forEach((r) => {
|
|
848
|
+
Es(e, r, s[r]);
|
|
849
|
+
});
|
|
850
|
+
}, Cs = (e) => {
|
|
851
|
+
if (!de(e))
|
|
852
|
+
return;
|
|
853
|
+
const t = ft(e);
|
|
854
|
+
e.style.backgroundImage = t.backgroundImage;
|
|
855
|
+
}, bt = (e, t, s) => {
|
|
856
|
+
X(e, t.class_applied), G(e, ot), s && (t.unobserve_completed && le(e, t), q(t.callback_applied, e, s));
|
|
857
|
+
}, mt = (e, t, s) => {
|
|
858
|
+
X(e, t.class_loading), G(e, we), s && (Se(s, 1), q(t.callback_loading, e, s));
|
|
859
|
+
}, U = (e, t, s) => {
|
|
860
|
+
s && e.setAttribute(t, s);
|
|
861
|
+
}, Oe = (e, t) => {
|
|
862
|
+
U(e, ve, x(e, t.data_sizes)), U(e, me, x(e, t.data_srcset)), U(e, O, x(e, t.data_src));
|
|
863
|
+
}, As = (e, t) => {
|
|
864
|
+
xe(e, (s) => {
|
|
865
|
+
J(s, K), Oe(s, t);
|
|
866
|
+
}), J(e, K), Oe(e, t);
|
|
867
|
+
}, Is = (e, t) => {
|
|
868
|
+
J(e, ce), U(e, O, x(e, t.data_src));
|
|
869
|
+
}, $s = (e, t) => {
|
|
870
|
+
ut(e, (s) => {
|
|
871
|
+
J(s, ce), U(s, O, x(s, t.data_src));
|
|
872
|
+
}), J(e, pt), U(e, tt, x(e, t.data_poster)), U(e, O, x(e, t.data_src)), e.load();
|
|
873
|
+
}, zs = (e, t) => {
|
|
874
|
+
J(e, ht), U(e, st, x(e, t.data_src));
|
|
875
|
+
}, Ls = (e, t, s) => {
|
|
876
|
+
const r = x(e, t.data_bg), n = x(e, t.data_bg_hidpi), i = Qe && n ? n : r;
|
|
877
|
+
i && (e.style.backgroundImage = `url("${i}")`, lt(e).setAttribute(O, i), mt(e, t, s));
|
|
878
|
+
}, Ns = (e, t, s) => {
|
|
879
|
+
const r = x(e, t.data_bg_multi), n = x(e, t.data_bg_multi_hidpi), i = Qe && n ? n : r;
|
|
880
|
+
i && (e.style.backgroundImage = i, bt(e, t, s));
|
|
881
|
+
}, Ms = (e, t, s) => {
|
|
882
|
+
const r = x(e, t.data_bg_set);
|
|
883
|
+
if (!r)
|
|
884
|
+
return;
|
|
885
|
+
const n = r.split("|");
|
|
886
|
+
let i = n.map((o) => `image-set(${o})`);
|
|
887
|
+
e.style.backgroundImage = i.join(), e.style.backgroundImage === "" && (i = n.map((o) => `-webkit-image-set(${o})`), e.style.backgroundImage = i.join()), bt(e, t, s);
|
|
888
|
+
}, vt = {
|
|
889
|
+
IMG: As,
|
|
890
|
+
IFRAME: Is,
|
|
891
|
+
VIDEO: $s,
|
|
892
|
+
OBJECT: zs
|
|
893
|
+
}, Ts = (e, t) => {
|
|
894
|
+
const s = vt[e.tagName];
|
|
895
|
+
s && s(e, t);
|
|
896
|
+
}, Os = (e, t, s) => {
|
|
897
|
+
const r = vt[e.tagName];
|
|
898
|
+
r && (r(e, t), mt(e, t, s));
|
|
899
|
+
}, Ps = ["IMG", "IFRAME", "VIDEO", "OBJECT"], Rs = (e) => Ps.indexOf(e.tagName) > -1, wt = (e, t) => {
|
|
900
|
+
t && !ks(t) && !Ss(t) && q(e.callback_finish, t);
|
|
901
|
+
}, Pe = (e, t, s) => {
|
|
902
|
+
e.addEventListener(t, s), e.llEvLisnrs[t] = s;
|
|
903
|
+
}, Ds = (e, t, s) => {
|
|
904
|
+
e.removeEventListener(t, s);
|
|
905
|
+
}, Ee = (e) => !!e.llEvLisnrs, Fs = (e, t, s) => {
|
|
906
|
+
Ee(e) || (e.llEvLisnrs = {});
|
|
907
|
+
const r = e.tagName === "VIDEO" ? "loadeddata" : "load";
|
|
908
|
+
Pe(e, r, t), Pe(e, "error", s);
|
|
909
|
+
}, ge = (e) => {
|
|
910
|
+
if (!Ee(e))
|
|
911
|
+
return;
|
|
912
|
+
const t = e.llEvLisnrs;
|
|
913
|
+
for (let s in t) {
|
|
914
|
+
const r = t[s];
|
|
915
|
+
Ds(e, s, r);
|
|
916
|
+
}
|
|
917
|
+
delete e.llEvLisnrs;
|
|
918
|
+
}, _t = (e, t, s) => {
|
|
919
|
+
vs(e), Se(s, -1), ys(s), L(e, t.class_loading), t.unobserve_completed && le(e, s);
|
|
920
|
+
}, Vs = (e, t, s, r) => {
|
|
921
|
+
const n = ke(t);
|
|
922
|
+
_t(t, s, r), X(t, s.class_loaded), G(t, rt), q(s.callback_loaded, t, r), n || wt(s, r);
|
|
923
|
+
}, Us = (e, t, s, r) => {
|
|
924
|
+
const n = ke(t);
|
|
925
|
+
_t(t, s, r), X(t, s.class_error), G(t, _e), q(s.callback_error, t, r), s.restore_on_error && j(t, K), n || wt(s, r);
|
|
926
|
+
}, Ce = (e, t, s) => {
|
|
927
|
+
const r = lt(e) || e;
|
|
928
|
+
if (Ee(r))
|
|
929
|
+
return;
|
|
930
|
+
Fs(r, (o) => {
|
|
931
|
+
Vs(o, e, t, s), ge(r);
|
|
932
|
+
}, (o) => {
|
|
933
|
+
Us(o, e, t, s), ge(r);
|
|
934
|
+
});
|
|
935
|
+
}, Bs = (e, t, s) => {
|
|
936
|
+
ms(e), Ce(e, t, s), xs(e), Ls(e, t, s), Ns(e, t, s), Ms(e, t, s);
|
|
937
|
+
}, qs = (e, t, s) => {
|
|
938
|
+
Ce(e, t, s), Os(e, t, s);
|
|
939
|
+
}, Ae = (e, t, s) => {
|
|
940
|
+
Rs(e) ? qs(e, t, s) : Bs(e, t, s);
|
|
941
|
+
}, Hs = (e, t, s) => {
|
|
942
|
+
e.setAttribute("loading", "lazy"), Ce(e, t, s), Ts(e, t), G(e, nt);
|
|
943
|
+
}, Re = (e) => {
|
|
944
|
+
e.removeAttribute(O), e.removeAttribute(me), e.removeAttribute(ve);
|
|
945
|
+
}, js = (e) => {
|
|
946
|
+
xe(e, (t) => {
|
|
947
|
+
Re(t);
|
|
948
|
+
}), Re(e);
|
|
949
|
+
}, yt = (e) => {
|
|
950
|
+
xe(e, (t) => {
|
|
951
|
+
j(t, K);
|
|
952
|
+
}), j(e, K);
|
|
953
|
+
}, Gs = (e) => {
|
|
954
|
+
ut(e, (t) => {
|
|
955
|
+
j(t, ce);
|
|
956
|
+
}), j(e, pt), e.load();
|
|
957
|
+
}, Ws = (e) => {
|
|
958
|
+
j(e, ce);
|
|
959
|
+
}, Js = (e) => {
|
|
960
|
+
j(e, ht);
|
|
961
|
+
}, Xs = {
|
|
962
|
+
IMG: yt,
|
|
963
|
+
IFRAME: Ws,
|
|
964
|
+
VIDEO: Gs,
|
|
965
|
+
OBJECT: Js
|
|
966
|
+
}, Ys = (e) => {
|
|
967
|
+
const t = Xs[e.tagName];
|
|
968
|
+
if (!t) {
|
|
969
|
+
Cs(e);
|
|
970
|
+
return;
|
|
971
|
+
}
|
|
972
|
+
t(e);
|
|
973
|
+
}, Zs = (e, t) => {
|
|
974
|
+
ye(e) || ke(e) || (L(e, t.class_entered), L(e, t.class_exited), L(e, t.class_applied), L(e, t.class_loading), L(e, t.class_loaded), L(e, t.class_error));
|
|
975
|
+
}, Ks = (e, t) => {
|
|
976
|
+
Ys(e), Zs(e, t), ie(e), gt(e);
|
|
977
|
+
}, Qs = (e, t, s, r) => {
|
|
978
|
+
s.cancel_on_exit && hs(e) && e.tagName === "IMG" && (ge(e), js(e), yt(e), L(e, s.class_loading), Se(r, -1), ie(e), q(s.callback_cancel, e, t, r));
|
|
979
|
+
}, er = (e, t, s, r) => {
|
|
980
|
+
const n = bs(e);
|
|
981
|
+
G(e, us), X(e, s.class_entered), L(e, s.class_exited), _s(e, s, r), q(s.callback_enter, e, t, r), !n && Ae(e, s, r);
|
|
982
|
+
}, tr = (e, t, s, r) => {
|
|
983
|
+
ye(e) || (X(e, s.class_exited), Qs(e, t, s, r), q(s.callback_exit, e, t, r));
|
|
984
|
+
}, sr = ["IMG", "IFRAME", "VIDEO"], kt = (e) => e.use_native && "loading" in HTMLImageElement.prototype, rr = (e, t, s) => {
|
|
985
|
+
e.forEach((r) => {
|
|
986
|
+
sr.indexOf(r.tagName) !== -1 && Hs(r, t, s);
|
|
987
|
+
}), ct(s, 0);
|
|
988
|
+
}, or = (e) => e.isIntersecting || e.intersectionRatio > 0, nr = (e) => ({
|
|
989
|
+
root: e.container === document ? null : e.container,
|
|
990
|
+
rootMargin: e.thresholds || e.threshold + "px"
|
|
991
|
+
}), ar = (e, t, s) => {
|
|
992
|
+
e.forEach(
|
|
993
|
+
(r) => or(r) ? er(r.target, r, t, s) : tr(r.target, r, t, s)
|
|
994
|
+
);
|
|
995
|
+
}, ir = (e, t) => {
|
|
996
|
+
t.forEach((s) => {
|
|
997
|
+
e.observe(s);
|
|
998
|
+
});
|
|
999
|
+
}, lr = (e, t) => {
|
|
1000
|
+
ws(e), ir(e, t);
|
|
1001
|
+
}, cr = (e, t) => {
|
|
1002
|
+
!Ze || kt(e) || (t._observer = new IntersectionObserver((s) => {
|
|
1003
|
+
ar(s, e, t);
|
|
1004
|
+
}, nr(e)));
|
|
1005
|
+
}, St = (e) => Array.prototype.slice.call(e), ae = (e) => e.container.querySelectorAll(e.elements_selector), dr = (e) => St(e).filter(ye), ur = (e) => fs(e), pr = (e) => St(e).filter(ur), De = (e, t) => dr(e || ae(t)), hr = (e, t) => {
|
|
1006
|
+
pr(ae(e)).forEach((r) => {
|
|
1007
|
+
L(r, e.class_error), ie(r);
|
|
1008
|
+
}), t.update();
|
|
1009
|
+
}, fr = (e, t) => {
|
|
1010
|
+
B && (t._onlineHandler = () => {
|
|
1011
|
+
hr(e, t);
|
|
1012
|
+
}, window.addEventListener("online", t._onlineHandler));
|
|
1013
|
+
}, gr = (e) => {
|
|
1014
|
+
B && window.removeEventListener("online", e._onlineHandler);
|
|
1015
|
+
}, se = function(e, t) {
|
|
1016
|
+
const s = et(e);
|
|
1017
|
+
this._settings = s, this.loadingCount = 0, cr(s, this), fr(s, this), this.update(t);
|
|
1018
|
+
};
|
|
1019
|
+
se.prototype = {
|
|
1020
|
+
update: function(e) {
|
|
1021
|
+
const t = this._settings, s = De(e, t);
|
|
1022
|
+
if (ct(this, s.length), Ye || !Ze) {
|
|
1023
|
+
this.loadAll(s);
|
|
1024
|
+
return;
|
|
1025
|
+
}
|
|
1026
|
+
if (kt(t)) {
|
|
1027
|
+
rr(s, t, this);
|
|
1028
|
+
return;
|
|
1029
|
+
}
|
|
1030
|
+
lr(this._observer, s);
|
|
1031
|
+
},
|
|
1032
|
+
destroy: function() {
|
|
1033
|
+
this._observer && this._observer.disconnect(), gr(this), ae(this._settings).forEach((e) => {
|
|
1034
|
+
gt(e);
|
|
1035
|
+
}), delete this._observer, delete this._settings, delete this._onlineHandler, delete this.loadingCount, delete this.toLoadCount;
|
|
1036
|
+
},
|
|
1037
|
+
loadAll: function(e) {
|
|
1038
|
+
const t = this._settings;
|
|
1039
|
+
De(e, t).forEach((r) => {
|
|
1040
|
+
le(r, this), Ae(r, t, this);
|
|
1041
|
+
});
|
|
1042
|
+
},
|
|
1043
|
+
restoreAll: function() {
|
|
1044
|
+
const e = this._settings;
|
|
1045
|
+
ae(e).forEach((t) => {
|
|
1046
|
+
Ks(t, e);
|
|
1047
|
+
});
|
|
1048
|
+
}
|
|
1049
|
+
};
|
|
1050
|
+
se.load = (e, t) => {
|
|
1051
|
+
const s = et(t);
|
|
1052
|
+
Ae(e, s);
|
|
1053
|
+
};
|
|
1054
|
+
se.resetStatus = (e) => {
|
|
1055
|
+
ie(e);
|
|
1056
|
+
};
|
|
1057
|
+
B && ds(se, window.lazyLoadOptions);
|
|
1058
|
+
function br() {
|
|
1059
|
+
let e = W;
|
|
1060
|
+
const t = (p) => {
|
|
1061
|
+
e = p;
|
|
1062
|
+
};
|
|
1063
|
+
let s = !1, r = !1, n = !1, i = [], o = 0;
|
|
1064
|
+
const a = _("readonly"), l = _("preview-active"), u = y("div", "content"), b = y("div", "preview-mask");
|
|
1065
|
+
b.onclick = function(w) {
|
|
1066
|
+
r || w.target === b && f(!1);
|
|
1067
|
+
}, H(u, b);
|
|
1068
|
+
const g = y("div", "preview");
|
|
1069
|
+
g.classList.add(_("tele-fancy-scrollbar")), g.onclick = function(w) {
|
|
1070
|
+
var S;
|
|
1071
|
+
if (r)
|
|
1072
|
+
return;
|
|
1073
|
+
const k = (S = w.target.dataset) == null ? void 0 : S.pageIndex;
|
|
1074
|
+
k && (w.preventDefault(), w.stopPropagation(), w.stopImmediatePropagation(), e(Number(k)), f(!1));
|
|
1075
|
+
}, H(u, g);
|
|
1076
|
+
let m;
|
|
1077
|
+
function c(p) {
|
|
1078
|
+
r !== p && (r = p, u.classList.toggle(a, r));
|
|
1079
|
+
}
|
|
1080
|
+
function f(p) {
|
|
1081
|
+
n !== p && (n = p, u.classList.toggle(l, n), n && !m && (m = new se({
|
|
1082
|
+
container: g,
|
|
1083
|
+
elements_selector: `.${_("preview-page>img")}`
|
|
1084
|
+
})));
|
|
1085
|
+
}
|
|
1086
|
+
function E(p) {
|
|
1087
|
+
if (i !== p) {
|
|
1088
|
+
i = p;
|
|
1089
|
+
const w = _("preview-page"), k = _("preview-page-name");
|
|
1090
|
+
i.forEach((S, I) => {
|
|
1091
|
+
const N = String(I), $ = ne("a");
|
|
1092
|
+
$.className = w + " " + _(`preview-page-${I}`), $.href = "#", $.dataset.pageIndex = N;
|
|
1093
|
+
const P = ne("span");
|
|
1094
|
+
P.className = k, P.textContent = String(I + 1), P.dataset.pageIndex = N;
|
|
1095
|
+
const R = ne("img");
|
|
1096
|
+
R.width = S.width, R.height = S.height, R.alt = `page-${I}`, R.dataset.src = S.thumbnail, R.dataset.pageIndex = N, H($, R), H($, P), H(g, $);
|
|
1097
|
+
}), s || m == null || m.update();
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
function z(p, w = !1) {
|
|
1101
|
+
if (w || o !== p) {
|
|
1102
|
+
o = p;
|
|
1103
|
+
const k = g.querySelector(
|
|
1104
|
+
`.${_(`preview-page-${o}`)}`
|
|
1105
|
+
);
|
|
1106
|
+
k && g.scrollTo({ top: k.offsetTop - 16 });
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
function A() {
|
|
1110
|
+
s = !0, m == null || m.destroy();
|
|
1111
|
+
}
|
|
1112
|
+
function v() {
|
|
1113
|
+
return n;
|
|
1114
|
+
}
|
|
1115
|
+
return {
|
|
1116
|
+
$content: u,
|
|
1117
|
+
$preview: g,
|
|
1118
|
+
set_readonly: c,
|
|
1119
|
+
set_active: f,
|
|
1120
|
+
get_active: v,
|
|
1121
|
+
set_pages: E,
|
|
1122
|
+
on_new_page_index: t,
|
|
1123
|
+
set_page_index: z,
|
|
1124
|
+
destroy: A
|
|
1125
|
+
};
|
|
1126
|
+
}
|
|
1127
|
+
const Ie = class {
|
|
1128
|
+
constructor(t) {
|
|
1129
|
+
d(this, "sideEffect", new Ve());
|
|
1130
|
+
d(this, "events", new Vt());
|
|
1131
|
+
d(this, "$slide", y("div", "slide"));
|
|
1132
|
+
d(this, "$overlay", y("div", "overlay"));
|
|
1133
|
+
d(this, "sidebar", br());
|
|
1134
|
+
d(this, "footer", ls());
|
|
1135
|
+
d(this, "$content");
|
|
1136
|
+
d(this, "$footer");
|
|
1137
|
+
d(this, "slide");
|
|
1138
|
+
d(this, "_slideTitle", "");
|
|
1139
|
+
d(this, "_getWhiteSnapshot", null);
|
|
1140
|
+
d(this, "_readyPromise");
|
|
1141
|
+
d(this, "_infoPromise");
|
|
1142
|
+
d(this, "_ready", !1);
|
|
1143
|
+
d(this, "_slideCount", 0);
|
|
1144
|
+
d(this, "_destroyed", !1);
|
|
1145
|
+
d(this, "_isFrozen", !1);
|
|
1146
|
+
d(this, "_cachedIsFrozen", !1);
|
|
1147
|
+
d(this, "onPlay", () => {
|
|
1148
|
+
this.slide.nextStep();
|
|
1149
|
+
});
|
|
1150
|
+
d(this, "onNewPageIndex", (t) => {
|
|
1151
|
+
this._ready && t >= 0 && t < this._slideCount ? this.slide.renderSlide(t + 1) : this.setPage(this.slide.slideState.currentSlideIndex);
|
|
1152
|
+
});
|
|
1153
|
+
d(this, "onTogglePreview", () => {
|
|
1154
|
+
this.sidebar.set_active(!this.sidebar.get_active());
|
|
1155
|
+
});
|
|
1156
|
+
d(this, "toPdf", async (t) => {
|
|
1157
|
+
const r = document.createElement("canvas"), n = r.getContext("2d"), { slideCount: i, width: o, height: a } = this.slide;
|
|
1158
|
+
let l = Math.floor(o), u = Math.floor(a);
|
|
1159
|
+
l > 1920 && (l = 1920, u = Math.floor(a * l / o)), u > 1920 && (u = 1920, l = Math.floor(o * u / a)), r.width = l, r.height = u;
|
|
1160
|
+
const b = document.createElement("canvas");
|
|
1161
|
+
b.width = o, b.height = a;
|
|
1162
|
+
const g = b.getContext("2d");
|
|
1163
|
+
if (!g || !this._getWhiteSnapshot || !n)
|
|
1164
|
+
return null;
|
|
1165
|
+
const m = l > u ? "l" : "p", { jsPDF: c } = await import("jspdf"), f = new c({
|
|
1166
|
+
format: [l, u],
|
|
1167
|
+
orientation: m,
|
|
1168
|
+
compress: !0
|
|
1169
|
+
});
|
|
1170
|
+
for (let p = 1; p <= i; p++) {
|
|
1171
|
+
const w = await this.slide.snapshotWithTimingEnd(p);
|
|
1172
|
+
if (w) {
|
|
1173
|
+
const S = document.createElement("img");
|
|
1174
|
+
S.src = w, await new Promise((I) => S.onload = I), n.drawImage(S, 0, 0, l, u);
|
|
1175
|
+
}
|
|
1176
|
+
g.clearRect(0, 0, o, a), this._getWhiteSnapshot(p, b, g);
|
|
1177
|
+
try {
|
|
1178
|
+
const S = b.toDataURL("image/png"), I = document.createElement("img");
|
|
1179
|
+
I.src = S, await new Promise((N) => I.onload = N), n.drawImage(I, 0, 0, l, u);
|
|
1180
|
+
} catch {
|
|
1181
|
+
}
|
|
1182
|
+
const k = r.toDataURL("image/jpeg", 0.6);
|
|
1183
|
+
p > 1 && f.addPage(), f.addImage(k, "JPEG", 0, 0, l, u, "", "FAST"), n.clearRect(0, 0, l, u), t(Math.ceil(p / i * 100));
|
|
1184
|
+
}
|
|
1185
|
+
const E = f.output("arraybuffer"), z = new Blob([E]), A = URL.createObjectURL(z), v = document.createElement("a");
|
|
1186
|
+
v.setAttribute("href", A), v.setAttribute("download", `${this._slideTitle || "snapshot"}.pdf`), v.style.display = "none", document.body.appendChild(v), v.click(), document.body.removeChild(v), window.postMessage({ type: "@app-slide/_download_pdf_", buf: E });
|
|
1187
|
+
});
|
|
1188
|
+
this.$content = this.sidebar.$content, this.$footer = this.footer.$footer, H(this.$content, this.$slide), H(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.footer.on_save_to_pdf(this.toPdf), this.sideEffect.push(this.sidebar.destroy), this.sideEffect.push(() => this.slide.destroy()), this.sideEffect.push(() => {
|
|
1189
|
+
this.$content.parentElement && this.$content.remove(), this.$footer.parentElement && this.$footer.remove(), this.$slide.parentElement && this.$slide.remove();
|
|
1190
|
+
}), this.sideEffect.push(
|
|
1191
|
+
Qt((a) => {
|
|
1192
|
+
this._destroyed || (a ? this._cachedIsFrozen || this.unfreeze() : (this._cachedIsFrozen = this._isFrozen, this.freeze()));
|
|
1193
|
+
})
|
|
1194
|
+
);
|
|
1195
|
+
const [s, r] = Me();
|
|
1196
|
+
this._infoPromise = s, Ie.fetchSlideInfo(t).then(({ preview: a, slide: l }) => {
|
|
1197
|
+
if (!this._destroyed) {
|
|
1198
|
+
if (this._slideCount = l.slideCount, a) {
|
|
1199
|
+
const { taskId: u, url: b } = t, { slideCount: g } = l, { width: m, height: c } = a, f = Xe(u, b), E = Array.from({ length: g }, (z, A) => ({
|
|
1200
|
+
width: m,
|
|
1201
|
+
height: c,
|
|
1202
|
+
thumbnail: `${f}/preview/${A + 1}.png`
|
|
1203
|
+
}));
|
|
1204
|
+
this.sidebar.set_pages(E), this.footer.set_sidebar(!0);
|
|
1205
|
+
}
|
|
1206
|
+
this.footer.set_page_count(l.slideCount), r(l);
|
|
1207
|
+
}
|
|
1208
|
+
}).catch((a) => {
|
|
1209
|
+
console.log("[Slide] fetch slide info error"), console.error(a), this.events.emit("prepareError", a);
|
|
1210
|
+
});
|
|
1211
|
+
const [i, o] = Me();
|
|
1212
|
+
this._readyPromise = i, this.slide = new pe({
|
|
1213
|
+
anchor: this.$slide,
|
|
1214
|
+
mode: "local",
|
|
1215
|
+
interactive: !0,
|
|
1216
|
+
enableGlobalClick: !0,
|
|
1217
|
+
useLocalCache: !0,
|
|
1218
|
+
...t
|
|
1219
|
+
}), this.slide.setResource(t.taskId, t.url || Ue), this.slide.on("renderStart", () => {
|
|
1220
|
+
this._destroyed || this.events.emit("renderStart");
|
|
1221
|
+
}), this.slide.on("slideChange", (a) => {
|
|
1222
|
+
this._destroyed || (this.setPage(a), this.$overlay.style.opacity = "", this.events.emit("renderEnd"));
|
|
1223
|
+
}), this.slide.once("renderEnd", () => {
|
|
1224
|
+
this._ready || setTimeout(() => {
|
|
1225
|
+
this._ready = !0, o();
|
|
1226
|
+
}, 1e3);
|
|
1227
|
+
}), this.slide.on("renderError", (a) => {
|
|
1228
|
+
this._destroyed || a.error && (console.error(a.error), this.$overlay.textContent = `Error on slide.index=${a.index}: ${a.error.message}`, this.$overlay.style.opacity = "1", this.events.emit("renderError", a));
|
|
1229
|
+
}), this.ready(() => {
|
|
1230
|
+
this._isFrozen && this.freeze();
|
|
1231
|
+
});
|
|
1232
|
+
}
|
|
1233
|
+
prepare(t) {
|
|
1234
|
+
return this._infoPromise.then(t);
|
|
1235
|
+
}
|
|
1236
|
+
ready(t) {
|
|
1237
|
+
return this._readyPromise.then(t);
|
|
1238
|
+
}
|
|
1239
|
+
destroy() {
|
|
1240
|
+
this._destroyed = !0, this.sideEffect.flushAll();
|
|
1241
|
+
}
|
|
1242
|
+
setReadonly(t) {
|
|
1243
|
+
this.slide.setInteractive(!t), this.sidebar.set_readonly(t), this.footer.set_readonly(t);
|
|
1244
|
+
}
|
|
1245
|
+
setPage(t) {
|
|
1246
|
+
this.sidebar.set_page_index(t - 1, !0), this.footer.set_page_index(t - 1, !0);
|
|
1247
|
+
}
|
|
1248
|
+
freeze() {
|
|
1249
|
+
this._destroyed || (this._isFrozen = !0, this._ready && (this.slide.frozen(), this.events.emit("freeze")));
|
|
1250
|
+
}
|
|
1251
|
+
unfreeze() {
|
|
1252
|
+
this._destroyed || (this._isFrozen = !1, this._ready && (this.slide.release(), this.events.emit("unfreeze")));
|
|
1253
|
+
}
|
|
1254
|
+
};
|
|
1255
|
+
let F = Ie;
|
|
1256
|
+
d(F, "styles", es), d(F, "fetchSlideInfo", Kt);
|
|
1257
|
+
function mr(e) {
|
|
1258
|
+
return e.displayer.logger;
|
|
1259
|
+
}
|
|
1260
|
+
const M = class {
|
|
1261
|
+
constructor(t) {
|
|
1262
|
+
d(this, "info", (t) => {
|
|
1263
|
+
M.roomLogger && this.context ? M.roomLogger.info(t + ` (${this.context.appId})`) : this.context ? console.debug(t + ` (${this.context.appId})`) : console.debug(t);
|
|
1264
|
+
});
|
|
1265
|
+
this.context = t, t && (M.active.add(t.appId), M.roomLogger = mr(t));
|
|
1266
|
+
}
|
|
1267
|
+
destroy() {
|
|
1268
|
+
this.context && M.active.delete(this.context.appId), M.active.size === 0 && (M.roomLogger = null);
|
|
1269
|
+
}
|
|
1270
|
+
};
|
|
1271
|
+
let Y = M;
|
|
1272
|
+
d(Y, "active", /* @__PURE__ */ new Set()), d(Y, "roomLogger", null);
|
|
1273
|
+
function vr({ context: e, storage: t, viewer: s, sideEffect: r, logger: n }) {
|
|
1274
|
+
const i = n.info.bind(n);
|
|
1275
|
+
let o = null;
|
|
1276
|
+
s.prepare(({ width: c, height: f, slideCount: E }) => {
|
|
1277
|
+
e.destroyed || (c && e.box.setStageRatio(f / c), o = e.createWhiteBoardView({ size: E }), o.setBaseRect({ width: c, height: f }), s._slideTitle = e.box.title, s._getWhiteSnapshot = (z, A, v) => {
|
|
1278
|
+
if (!o)
|
|
1279
|
+
return null;
|
|
1280
|
+
const p = o.pageState.pages[z - 1], { width: w, height: k } = o.view.size;
|
|
1281
|
+
A.width = w, A.height = k, o.view.screenshotToCanvas(v, p, w, k, o.view.camera);
|
|
1282
|
+
}, u());
|
|
1283
|
+
});
|
|
1284
|
+
const { slide: a } = s;
|
|
1285
|
+
function l(c = t.state.state) {
|
|
1286
|
+
return JSON.stringify(c);
|
|
1287
|
+
}
|
|
1288
|
+
function u() {
|
|
1289
|
+
if (t.state.state)
|
|
1290
|
+
i("[Slide] restore " + l()), a.setSlideState(t.state.state);
|
|
1291
|
+
else if (e.isAddApp)
|
|
1292
|
+
i("[Slide] kick start"), a.renderSlide(1);
|
|
1293
|
+
else {
|
|
1294
|
+
i("[Slide] wait for restore");
|
|
1295
|
+
const c = r.add(() => {
|
|
1296
|
+
const E = setInterval(() => {
|
|
1297
|
+
t.state.state || (i("[Slide] timeout"), a.renderSlide(1));
|
|
1298
|
+
}, 15e3);
|
|
1299
|
+
return () => clearInterval(E);
|
|
1300
|
+
}), f = r.push(
|
|
1301
|
+
t.on("stateChanged", () => {
|
|
1302
|
+
t.state.state && (i("[Slide] restore " + l()), a.setSlideState(t.state.state), r.flush(f), r.flush(c));
|
|
1303
|
+
})
|
|
1304
|
+
);
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
a.on("stateChange", () => {
|
|
1308
|
+
t.isWritable && t.setState({ state: a.slideState });
|
|
1309
|
+
}), a.on("syncDispatch", (c) => {
|
|
1310
|
+
e.isWritable && (i("[Slide] dispatch " + l(Ne(c, "uuid"))), e.dispatchMagixEvent("syncDispatch", c));
|
|
1311
|
+
}), r.push(
|
|
1312
|
+
e.addMagixEventListener(
|
|
1313
|
+
"syncDispatch",
|
|
1314
|
+
({ payload: c }) => {
|
|
1315
|
+
i("[Slide] receive " + l(Ne(c, "uuid"))), a.emit("syncReceive", c);
|
|
1316
|
+
},
|
|
1317
|
+
{ fireSelfEventAfterCommit: !0 }
|
|
1318
|
+
)
|
|
1319
|
+
), a.on("slideChange", (c) => {
|
|
1320
|
+
e.isWritable && o && (i("[Slide] page to " + c), o.jumpPage(c - 1));
|
|
1321
|
+
});
|
|
1322
|
+
function b() {
|
|
1323
|
+
o && o.view.divElement && o.view.divElement.classList.add(_("wb-view-hidden"));
|
|
1324
|
+
}
|
|
1325
|
+
function g() {
|
|
1326
|
+
o && o.view.divElement && o.view.divElement.classList.remove(_("wb-view-hidden"));
|
|
1327
|
+
}
|
|
1328
|
+
s.setReadonly(!e.isWritable), r.push([
|
|
1329
|
+
e.emitter.on("writableChange", () => s.setReadonly(!e.isWritable)),
|
|
1330
|
+
s.events.on("renderStart", b),
|
|
1331
|
+
s.events.on("renderEnd", g)
|
|
1332
|
+
]);
|
|
1333
|
+
const m = (c) => {
|
|
1334
|
+
if (!c)
|
|
1335
|
+
return !1;
|
|
1336
|
+
const f = c.tagName;
|
|
1337
|
+
return f === "INPUT" || f === "TEXTAREA" || f === "SELECT";
|
|
1338
|
+
};
|
|
1339
|
+
r.addEventListener(window, "keydown", (c) => {
|
|
1340
|
+
!c || c.target.className === "telebox-quarantine-outer" || e.box.focus && !e.box.readonly && !m(c.target) && ((c.key === "ArrowUp" || c.key === "ArrowLeft") && s.slide.prevStep(), (c.key === "ArrowRight" || c.key === "ArrowDown") && s.slide.nextStep());
|
|
1341
|
+
});
|
|
1342
|
+
}
|
|
1343
|
+
function kr(e) {
|
|
1344
|
+
const { container: t, ...s } = e, r = y("div", "preview-wrapper"), n = new F(s);
|
|
1345
|
+
return r.appendChild(document.createElement("style")).textContent = F.styles, r.appendChild(n.$content), r.appendChild(n.$footer), t.appendChild(r), n.prepare(() => n.slide.renderSlide(1)), n;
|
|
1346
|
+
}
|
|
1347
|
+
const Sr = /* @__PURE__ */ pe.usePlugin.bind(pe), xr = "0.3.0-canary.21", Er = {
|
|
1348
|
+
kind: "Slide",
|
|
1349
|
+
config: { enableShadowDOM: !1 },
|
|
1350
|
+
setup(e) {
|
|
1351
|
+
console.log("[Slide] setup @ 0.3.0-canary.21 (" + e.appId + ")");
|
|
1352
|
+
const t = new Y(e);
|
|
1353
|
+
if (t.info("[Slide] setup @ 0.3.0-canary.21"), !e.attributes.taskId)
|
|
1354
|
+
throw new Error("[Slide] no taskId");
|
|
1355
|
+
const s = e.createStorage("slide", e.attributes), r = e.getAppOptions() || {}, n = r.renderOptions || {}, i = new Ve(), o = new F({
|
|
1356
|
+
interactive: !0,
|
|
1357
|
+
mode: "interactive",
|
|
1358
|
+
enableGlobalClick: !0,
|
|
1359
|
+
timestamp: Yt(e),
|
|
1360
|
+
logger: r.logger || t,
|
|
1361
|
+
whiteTracker: e.displayer.tracker,
|
|
1362
|
+
renderOptions: {
|
|
1363
|
+
minFPS: n.minFPS || 25,
|
|
1364
|
+
maxFPS: n.maxFPS || 30,
|
|
1365
|
+
autoFPS: n.autoFPS ?? !0,
|
|
1366
|
+
autoResolution: n.autoResolution ?? !0,
|
|
1367
|
+
resolution: n.resolution,
|
|
1368
|
+
maxResolutionLevel: n.maxResolutionLevel,
|
|
1369
|
+
transactionBgColor: n.transactionBgColor || Je(e.box.$content)
|
|
1370
|
+
},
|
|
1371
|
+
rtcAudio: r.rtcAudio,
|
|
1372
|
+
useLocalCache: r.useLocalCache,
|
|
1373
|
+
resourceTimeout: r.resourceTimeout,
|
|
1374
|
+
loaderDelegate: r.loaderDelegate,
|
|
1375
|
+
navigatorDelegate: r.navigatorDelegate,
|
|
1376
|
+
fixedFrameSize: r.fixedFrameSize,
|
|
1377
|
+
taskId: s.state.taskId,
|
|
1378
|
+
url: s.state.url
|
|
1379
|
+
});
|
|
1380
|
+
return Object.assign(o, { context: e, logger: t }), i.push(Be.set(e.appId, o, e.box)), i.push(o.events.on("freeze", () => t.info("[Slide] freeze"))), i.push(o.events.on("unfreeze", () => t.info("[Slide] unfreeze"))), i.push(
|
|
1381
|
+
o.events.on(
|
|
1382
|
+
"prepareError",
|
|
1383
|
+
(a) => t.info("[Slide] fetch slide info failed: " + a.message)
|
|
1384
|
+
)
|
|
1385
|
+
), i.push(
|
|
1386
|
+
o.events.on(
|
|
1387
|
+
"renderError",
|
|
1388
|
+
({ error: a, index: l }) => t.info(`[Slide] render failed [${l}]: ${a.message}`)
|
|
1389
|
+
)
|
|
1390
|
+
), e.box.mountStyles(F.styles), e.box.mountStage(o.$slide), e.box.mountFooter(o.$footer), e.box.mountContent(o.$content), i.push(() => o.destroy()), vr({ context: e, storage: s, viewer: o, sideEffect: i, logger: t }), e.emitter.on("destroy", () => {
|
|
1391
|
+
t.info("[Slide] destroy"), t.destroy(), i.flushAll();
|
|
1392
|
+
}), o;
|
|
1393
|
+
}
|
|
1394
|
+
};
|
|
1395
|
+
export {
|
|
1396
|
+
Ue as DefaultUrl,
|
|
1397
|
+
Ir as Slide,
|
|
1398
|
+
F as SlideViewer,
|
|
1399
|
+
yr as addHooks,
|
|
1400
|
+
Er as default,
|
|
1401
|
+
kr as previewSlide,
|
|
1402
|
+
Be as refrigerator,
|
|
1403
|
+
Sr as usePlugin,
|
|
1404
|
+
xr as version
|
|
1405
|
+
};
|
|
1406
|
+
//# sourceMappingURL=main.mjs.map
|