@netless/app-slide 0.3.0-canary.6 → 0.3.0-canary.9
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/SlideViewer.d.ts +15 -0
- package/dist/index.d.ts +4 -1
- 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 +383 -373
- package/dist/main.mjs.map +1 -1
- package/dist/typings.d.ts +7 -2
- package/package.json +3 -3
- package/src/SlideViewer.ts +33 -12
- package/src/index.ts +22 -8
- package/src/style.scss +16 -0
- package/src/typings.ts +19 -2
package/dist/main.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Slide as
|
|
2
|
-
|
|
1
|
+
import { Slide as ae } from "@netless/slide";
|
|
2
|
+
import { Slide as Ys } from "@netless/slide";
|
|
3
|
+
var Ce = { exports: {} }, ut = {
|
|
3
4
|
aliceblue: [240, 248, 255],
|
|
4
5
|
antiquewhite: [250, 235, 215],
|
|
5
6
|
aqua: [0, 255, 255],
|
|
@@ -148,24 +149,24 @@ var Ie = { exports: {} }, ut = {
|
|
|
148
149
|
whitesmoke: [245, 245, 245],
|
|
149
150
|
yellow: [255, 255, 0],
|
|
150
151
|
yellowgreen: [154, 205, 50]
|
|
151
|
-
},
|
|
152
|
+
}, Ie = { exports: {} }, pt = function(t) {
|
|
152
153
|
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");
|
|
153
|
-
}, ht = pt, gt = Array.prototype.concat, ft = Array.prototype.slice,
|
|
154
|
-
for (var s = [], r = 0,
|
|
154
|
+
}, ht = pt, gt = Array.prototype.concat, ft = Array.prototype.slice, _e = Ie.exports = function(t) {
|
|
155
|
+
for (var s = [], r = 0, n = t.length; r < n; r++) {
|
|
155
156
|
var l = t[r];
|
|
156
157
|
ht(l) ? s = gt.call(s, ft.call(l)) : s.push(l);
|
|
157
158
|
}
|
|
158
159
|
return s;
|
|
159
160
|
};
|
|
160
|
-
|
|
161
|
+
_e.wrap = function(e) {
|
|
161
162
|
return function() {
|
|
162
|
-
return e(
|
|
163
|
+
return e(_e(arguments));
|
|
163
164
|
};
|
|
164
165
|
};
|
|
165
|
-
var
|
|
166
|
-
for (var ne in
|
|
167
|
-
|
|
168
|
-
var _ =
|
|
166
|
+
var G = ut, Z = Ie.exports, $e = Object.hasOwnProperty, Ae = /* @__PURE__ */ Object.create(null);
|
|
167
|
+
for (var ne in G)
|
|
168
|
+
$e.call(G, ne) && (Ae[G[ne]] = ne);
|
|
169
|
+
var _ = Ce.exports = {
|
|
169
170
|
to: {},
|
|
170
171
|
get: {}
|
|
171
172
|
};
|
|
@@ -187,38 +188,38 @@ _.get = function(e) {
|
|
|
187
188
|
_.get.rgb = function(e) {
|
|
188
189
|
if (!e)
|
|
189
190
|
return null;
|
|
190
|
-
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*)?\)$/,
|
|
191
|
-
if (
|
|
192
|
-
for (d =
|
|
193
|
-
var u =
|
|
194
|
-
a
|
|
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*)?\)$/, n = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/, l = /^(\w+)$/, i = [0, 0, 0, 1], o, a, d;
|
|
192
|
+
if (o = e.match(s)) {
|
|
193
|
+
for (d = o[2], o = o[1], a = 0; a < 3; a++) {
|
|
194
|
+
var u = a * 2;
|
|
195
|
+
i[a] = parseInt(o.slice(u, u + 2), 16);
|
|
195
196
|
}
|
|
196
|
-
d && (
|
|
197
|
-
} else if (
|
|
198
|
-
for (
|
|
199
|
-
a
|
|
200
|
-
d && (
|
|
201
|
-
} else if (
|
|
202
|
-
for (
|
|
203
|
-
a
|
|
204
|
-
|
|
205
|
-
} else if (
|
|
206
|
-
for (
|
|
207
|
-
a
|
|
208
|
-
|
|
197
|
+
d && (i[3] = parseInt(d, 16) / 255);
|
|
198
|
+
} else if (o = e.match(t)) {
|
|
199
|
+
for (o = o[1], d = o[3], a = 0; a < 3; a++)
|
|
200
|
+
i[a] = parseInt(o[a] + o[a], 16);
|
|
201
|
+
d && (i[3] = parseInt(d + d, 16) / 255);
|
|
202
|
+
} else if (o = e.match(r)) {
|
|
203
|
+
for (a = 0; a < 3; a++)
|
|
204
|
+
i[a] = parseInt(o[a + 1], 0);
|
|
205
|
+
o[4] && (o[5] ? i[3] = parseFloat(o[4]) * 0.01 : i[3] = parseFloat(o[4]));
|
|
206
|
+
} else if (o = e.match(n)) {
|
|
207
|
+
for (a = 0; a < 3; a++)
|
|
208
|
+
i[a] = Math.round(parseFloat(o[a + 1]) * 2.55);
|
|
209
|
+
o[4] && (o[5] ? i[3] = parseFloat(o[4]) * 0.01 : i[3] = parseFloat(o[4]));
|
|
209
210
|
} else
|
|
210
|
-
return (
|
|
211
|
-
for (
|
|
212
|
-
a
|
|
213
|
-
return
|
|
211
|
+
return (o = e.match(l)) ? o[1] === "transparent" ? [0, 0, 0, 0] : $e.call(G, o[1]) ? (i = G[o[1]], i[3] = 1, i) : null : null;
|
|
212
|
+
for (a = 0; a < 3; a++)
|
|
213
|
+
i[a] = L(i[a], 0, 255);
|
|
214
|
+
return i[3] = L(i[3], 0, 1), i;
|
|
214
215
|
};
|
|
215
216
|
_.get.hsl = function(e) {
|
|
216
217
|
if (!e)
|
|
217
218
|
return null;
|
|
218
219
|
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);
|
|
219
220
|
if (s) {
|
|
220
|
-
var r = parseFloat(s[4]),
|
|
221
|
-
return [
|
|
221
|
+
var r = parseFloat(s[4]), n = (parseFloat(s[1]) % 360 + 360) % 360, l = L(parseFloat(s[2]), 0, 100), i = L(parseFloat(s[3]), 0, 100), o = L(isNaN(r) ? 1 : r, 0, 1);
|
|
222
|
+
return [n, l, i, o];
|
|
222
223
|
}
|
|
223
224
|
return null;
|
|
224
225
|
};
|
|
@@ -227,8 +228,8 @@ _.get.hwb = function(e) {
|
|
|
227
228
|
return null;
|
|
228
229
|
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);
|
|
229
230
|
if (s) {
|
|
230
|
-
var r = parseFloat(s[4]),
|
|
231
|
-
return [
|
|
231
|
+
var r = parseFloat(s[4]), n = (parseFloat(s[1]) % 360 + 360) % 360, l = L(parseFloat(s[2]), 0, 100), i = L(parseFloat(s[3]), 0, 100), o = L(isNaN(r) ? 1 : r, 0, 1);
|
|
232
|
+
return [n, l, i, o];
|
|
232
233
|
}
|
|
233
234
|
return null;
|
|
234
235
|
};
|
|
@@ -253,21 +254,21 @@ _.to.hwb = function() {
|
|
|
253
254
|
return e.length >= 4 && e[3] !== 1 && (t = ", " + e[3]), "hwb(" + e[0] + ", " + e[1] + "%, " + e[2] + "%" + t + ")";
|
|
254
255
|
};
|
|
255
256
|
_.to.keyword = function(e) {
|
|
256
|
-
return
|
|
257
|
+
return Ae[e.slice(0, 3)];
|
|
257
258
|
};
|
|
258
|
-
function
|
|
259
|
+
function L(e, t, s) {
|
|
259
260
|
return Math.min(Math.max(t, e), s);
|
|
260
261
|
}
|
|
261
262
|
function Y(e) {
|
|
262
263
|
var t = Math.round(e).toString(16).toUpperCase();
|
|
263
264
|
return t.length < 2 ? "0" + t : t;
|
|
264
265
|
}
|
|
265
|
-
const
|
|
266
|
-
for (let e = 0; e <
|
|
267
|
-
|
|
268
|
-
return
|
|
266
|
+
const bt = "!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", vt = 87, mt = 20, we = [], _t = () => {
|
|
267
|
+
for (let e = 0; e < mt; e++)
|
|
268
|
+
we[e] = bt.charAt(Math.random() * vt);
|
|
269
|
+
return we.join("");
|
|
269
270
|
};
|
|
270
|
-
function
|
|
271
|
+
function Le(e) {
|
|
271
272
|
try {
|
|
272
273
|
return e();
|
|
273
274
|
} catch (t) {
|
|
@@ -276,27 +277,27 @@ function we(e) {
|
|
|
276
277
|
}
|
|
277
278
|
class ze {
|
|
278
279
|
constructor() {
|
|
279
|
-
this.disposers = /* @__PURE__ */ new Map();
|
|
280
|
+
this.push = this.addDisposer, this.disposers = /* @__PURE__ */ new Map();
|
|
280
281
|
}
|
|
281
282
|
addDisposer(t, s = this.genUID()) {
|
|
282
|
-
return this.flush(s), this.disposers.set(s, Array.isArray(t) ? (
|
|
283
|
+
return this.flush(s), this.disposers.set(s, Array.isArray(t) ? wt(t) : t), s;
|
|
283
284
|
}
|
|
284
285
|
add(t, s = this.genUID()) {
|
|
285
286
|
const r = t();
|
|
286
287
|
return r ? this.addDisposer(r, s) : s;
|
|
287
288
|
}
|
|
288
|
-
addEventListener(t, s, r,
|
|
289
|
-
return t.addEventListener(s, r,
|
|
289
|
+
addEventListener(t, s, r, n, l = this.genUID()) {
|
|
290
|
+
return t.addEventListener(s, r, n), this.addDisposer(() => t.removeEventListener(s, r, n), l), l;
|
|
290
291
|
}
|
|
291
292
|
setTimeout(t, s, r = this.genUID()) {
|
|
292
|
-
const
|
|
293
|
+
const n = window.setTimeout(() => {
|
|
293
294
|
this.remove(r), t();
|
|
294
295
|
}, s);
|
|
295
|
-
return this.addDisposer(() => window.clearTimeout(
|
|
296
|
+
return this.addDisposer(() => window.clearTimeout(n), r);
|
|
296
297
|
}
|
|
297
298
|
setInterval(t, s, r = this.genUID()) {
|
|
298
|
-
const
|
|
299
|
-
return this.addDisposer(() => window.clearInterval(
|
|
299
|
+
const n = window.setInterval(t, s);
|
|
300
|
+
return this.addDisposer(() => window.clearInterval(n), r);
|
|
300
301
|
}
|
|
301
302
|
remove(t) {
|
|
302
303
|
const s = this.disposers.get(t);
|
|
@@ -304,25 +305,23 @@ class ze {
|
|
|
304
305
|
}
|
|
305
306
|
flush(t) {
|
|
306
307
|
const s = this.remove(t);
|
|
307
|
-
|
|
308
|
-
try {
|
|
309
|
-
s();
|
|
310
|
-
} catch (r) {
|
|
311
|
-
console.error(r);
|
|
312
|
-
}
|
|
308
|
+
s && s();
|
|
313
309
|
}
|
|
314
310
|
flushAll() {
|
|
315
|
-
this.disposers.forEach(
|
|
311
|
+
this.disposers.forEach(Le), this.disposers.clear();
|
|
316
312
|
}
|
|
317
313
|
genUID() {
|
|
318
314
|
let t;
|
|
319
315
|
do
|
|
320
|
-
t =
|
|
316
|
+
t = _t();
|
|
321
317
|
while (this.disposers.has(t));
|
|
322
318
|
return t;
|
|
323
319
|
}
|
|
324
320
|
}
|
|
325
|
-
|
|
321
|
+
function wt(e) {
|
|
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 = {
|
|
326
325
|
elements_selector: ".lazy",
|
|
327
326
|
container: Ne || N ? document : null,
|
|
328
327
|
threshold: 300,
|
|
@@ -355,30 +354,30 @@ const N = typeof window < "u", Ne = N && !("onscroll" in window) || typeof navig
|
|
|
355
354
|
callback_cancel: null,
|
|
356
355
|
use_native: !1,
|
|
357
356
|
restore_on_error: !1
|
|
358
|
-
}, Te = (e) => Object.assign({},
|
|
357
|
+
}, Te = (e) => Object.assign({}, yt, e), ye = function(e, t) {
|
|
359
358
|
let s;
|
|
360
|
-
const r = "LazyLoad::Initialized",
|
|
359
|
+
const r = "LazyLoad::Initialized", n = new e(t);
|
|
361
360
|
try {
|
|
362
|
-
s = new CustomEvent(r, { detail: { instance:
|
|
361
|
+
s = new CustomEvent(r, { detail: { instance: n } });
|
|
363
362
|
} catch {
|
|
364
|
-
s = document.createEvent("CustomEvent"), s.initCustomEvent(r, !1, !1, { instance:
|
|
363
|
+
s = document.createEvent("CustomEvent"), s.initCustomEvent(r, !1, !1, { instance: n });
|
|
365
364
|
}
|
|
366
365
|
window.dispatchEvent(s);
|
|
367
|
-
},
|
|
366
|
+
}, kt = (e, t) => {
|
|
368
367
|
if (!!t)
|
|
369
368
|
if (!t.length)
|
|
370
369
|
ye(e, t);
|
|
371
370
|
else
|
|
372
371
|
for (let s = 0, r; r = t[s]; s += 1)
|
|
373
372
|
ye(e, r);
|
|
374
|
-
},
|
|
375
|
-
var r =
|
|
373
|
+
}, C = "src", le = "srcset", ce = "sizes", Fe = "poster", K = "llOriginalAttrs", Pe = "data", de = "loading", Re = "loaded", Ve = "applied", St = "entered", ue = "error", Ue = "native", qe = "data-", Be = "ll-status", m = (e, t) => e.getAttribute(qe + t), xt = (e, t, s) => {
|
|
374
|
+
var r = qe + t;
|
|
376
375
|
if (s === null) {
|
|
377
376
|
e.removeAttribute(r);
|
|
378
377
|
return;
|
|
379
378
|
}
|
|
380
379
|
e.setAttribute(r, s);
|
|
381
|
-
}, Q = (e) =>
|
|
380
|
+
}, Q = (e) => m(e, Be), T = (e, t) => xt(e, Be, t), te = (e) => T(e, null), pe = (e) => Q(e) === null, Et = (e) => Q(e) === de, Ct = (e) => Q(e) === ue, he = (e) => Q(e) === Ue, It = [de, Re, Ve, ue], $t = (e) => It.indexOf(Q(e)) >= 0, O = (e, t, s, r) => {
|
|
382
381
|
if (!!e) {
|
|
383
382
|
if (r !== void 0) {
|
|
384
383
|
e(t, s, r);
|
|
@@ -390,7 +389,7 @@ const N = typeof window < "u", Ne = N && !("onscroll" in window) || typeof navig
|
|
|
390
389
|
}
|
|
391
390
|
e(t);
|
|
392
391
|
}
|
|
393
|
-
},
|
|
392
|
+
}, H = (e, t) => {
|
|
394
393
|
if (De) {
|
|
395
394
|
e.classList.add(t);
|
|
396
395
|
return;
|
|
@@ -402,225 +401,225 @@ const N = typeof window < "u", Ne = N && !("onscroll" in window) || typeof navig
|
|
|
402
401
|
return;
|
|
403
402
|
}
|
|
404
403
|
e.className = e.className.replace(new RegExp("(^|\\s+)" + t + "(\\s+|$)"), " ").replace(/^\s+/, "").replace(/\s+$/, "");
|
|
405
|
-
},
|
|
404
|
+
}, At = (e) => {
|
|
406
405
|
e.llTempImage = document.createElement("IMG");
|
|
407
|
-
},
|
|
406
|
+
}, Lt = (e) => {
|
|
408
407
|
delete e.llTempImage;
|
|
409
408
|
}, He = (e) => e.llTempImage, se = (e, t) => {
|
|
410
409
|
if (!t)
|
|
411
410
|
return;
|
|
412
411
|
const s = t._observer;
|
|
413
412
|
!s || s.unobserve(e);
|
|
414
|
-
},
|
|
413
|
+
}, zt = (e) => {
|
|
415
414
|
e.disconnect();
|
|
416
|
-
},
|
|
415
|
+
}, Nt = (e, t, s) => {
|
|
417
416
|
t.unobserve_entered && se(e, s);
|
|
418
|
-
},
|
|
417
|
+
}, ge = (e, t) => {
|
|
419
418
|
!e || (e.loadingCount += t);
|
|
420
|
-
},
|
|
419
|
+
}, Ot = (e) => {
|
|
421
420
|
!e || (e.toLoadCount -= 1);
|
|
422
421
|
}, je = (e, t) => {
|
|
423
422
|
!e || (e.toLoadCount = t);
|
|
424
|
-
},
|
|
423
|
+
}, Dt = (e) => e.loadingCount > 0, Mt = (e) => e.toLoadCount > 0, Ge = (e) => {
|
|
425
424
|
let t = [];
|
|
426
425
|
for (let s = 0, r; r = e.children[s]; s += 1)
|
|
427
426
|
r.tagName === "SOURCE" && t.push(r);
|
|
428
427
|
return t;
|
|
429
|
-
},
|
|
428
|
+
}, fe = (e, t) => {
|
|
430
429
|
const s = e.parentNode;
|
|
431
430
|
if (!s || s.tagName !== "PICTURE")
|
|
432
431
|
return;
|
|
433
432
|
Ge(s).forEach(t);
|
|
434
433
|
}, We = (e, t) => {
|
|
435
434
|
Ge(e).forEach(t);
|
|
436
|
-
}, re = [
|
|
435
|
+
}, re = [C], Je = [C, Fe], J = [C, le, ce], Ze = [Pe], oe = (e) => !!e[K], Ke = (e) => e[K], Qe = (e) => delete e[K], q = (e, t) => {
|
|
437
436
|
if (oe(e))
|
|
438
437
|
return;
|
|
439
438
|
const s = {};
|
|
440
439
|
t.forEach((r) => {
|
|
441
440
|
s[r] = e.getAttribute(r);
|
|
442
441
|
}), e[K] = s;
|
|
443
|
-
},
|
|
442
|
+
}, Tt = (e) => {
|
|
444
443
|
oe(e) || (e[K] = { backgroundImage: e.style.backgroundImage });
|
|
445
|
-
},
|
|
444
|
+
}, Ft = (e, t, s) => {
|
|
446
445
|
if (!s) {
|
|
447
446
|
e.removeAttribute(t);
|
|
448
447
|
return;
|
|
449
448
|
}
|
|
450
449
|
e.setAttribute(t, s);
|
|
451
|
-
},
|
|
450
|
+
}, M = (e, t) => {
|
|
452
451
|
if (!oe(e))
|
|
453
452
|
return;
|
|
454
453
|
const s = Ke(e);
|
|
455
454
|
t.forEach((r) => {
|
|
456
|
-
|
|
455
|
+
Ft(e, r, s[r]);
|
|
457
456
|
});
|
|
458
|
-
},
|
|
457
|
+
}, Pt = (e) => {
|
|
459
458
|
if (!oe(e))
|
|
460
459
|
return;
|
|
461
460
|
const t = Ke(e);
|
|
462
461
|
e.style.backgroundImage = t.backgroundImage;
|
|
463
462
|
}, Xe = (e, t, s) => {
|
|
464
|
-
|
|
463
|
+
H(e, t.class_applied), T(e, Ve), s && (t.unobserve_completed && se(e, t), O(t.callback_applied, e, s));
|
|
465
464
|
}, Ye = (e, t, s) => {
|
|
466
|
-
|
|
465
|
+
H(e, t.class_loading), T(e, de), s && (ge(s, 1), O(t.callback_loading, e, s));
|
|
467
466
|
}, z = (e, t, s) => {
|
|
468
467
|
!s || e.setAttribute(t, s);
|
|
469
468
|
}, ke = (e, t) => {
|
|
470
|
-
z(e,
|
|
471
|
-
}, Tt = (e, t) => {
|
|
472
|
-
ge(e, (s) => {
|
|
473
|
-
B(s, W), ke(s, t);
|
|
474
|
-
}), B(e, W), ke(e, t);
|
|
475
|
-
}, Ft = (e, t) => {
|
|
476
|
-
B(e, re), z(e, I, v(e, t.data_src));
|
|
477
|
-
}, Pt = (e, t) => {
|
|
478
|
-
We(e, (s) => {
|
|
479
|
-
B(s, re), z(s, I, v(s, t.data_src));
|
|
480
|
-
}), B(e, Je), z(e, Fe, v(e, t.data_poster)), z(e, I, v(e, t.data_src)), e.load();
|
|
469
|
+
z(e, ce, m(e, t.data_sizes)), z(e, le, m(e, t.data_srcset)), z(e, C, m(e, t.data_src));
|
|
481
470
|
}, Rt = (e, t) => {
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
471
|
+
fe(e, (s) => {
|
|
472
|
+
q(s, J), ke(s, t);
|
|
473
|
+
}), q(e, J), ke(e, t);
|
|
474
|
+
}, Vt = (e, t) => {
|
|
475
|
+
q(e, re), z(e, C, m(e, t.data_src));
|
|
476
|
+
}, Ut = (e, t) => {
|
|
477
|
+
We(e, (s) => {
|
|
478
|
+
q(s, re), z(s, C, m(s, t.data_src));
|
|
479
|
+
}), q(e, Je), z(e, Fe, m(e, t.data_poster)), z(e, C, m(e, t.data_src)), e.load();
|
|
480
|
+
}, qt = (e, t) => {
|
|
481
|
+
q(e, Ze), z(e, Pe, m(e, t.data_src));
|
|
489
482
|
}, Bt = (e, t, s) => {
|
|
490
|
-
const r =
|
|
483
|
+
const r = m(e, t.data_bg), n = m(e, t.data_bg_hidpi), l = Me && n ? n : r;
|
|
484
|
+
!l || (e.style.backgroundImage = `url("${l}")`, He(e).setAttribute(C, l), Ye(e, t, s));
|
|
485
|
+
}, Ht = (e, t, s) => {
|
|
486
|
+
const r = m(e, t.data_bg_multi), n = m(e, t.data_bg_multi_hidpi), l = Me && n ? n : r;
|
|
487
|
+
!l || (e.style.backgroundImage = l, Xe(e, t, s));
|
|
488
|
+
}, jt = (e, t, s) => {
|
|
489
|
+
const r = m(e, t.data_bg_set);
|
|
491
490
|
if (!r)
|
|
492
491
|
return;
|
|
493
|
-
const
|
|
494
|
-
let l =
|
|
495
|
-
e.style.backgroundImage = l.join(), e.style.backgroundImage === "" && (l =
|
|
492
|
+
const n = r.split("|");
|
|
493
|
+
let l = n.map((i) => `image-set(${i})`);
|
|
494
|
+
e.style.backgroundImage = l.join(), e.style.backgroundImage === "" && (l = n.map((i) => `-webkit-image-set(${i})`), e.style.backgroundImage = l.join()), Xe(e, t, s);
|
|
496
495
|
}, et = {
|
|
497
|
-
IMG:
|
|
498
|
-
IFRAME:
|
|
499
|
-
VIDEO:
|
|
500
|
-
OBJECT:
|
|
501
|
-
},
|
|
496
|
+
IMG: Rt,
|
|
497
|
+
IFRAME: Vt,
|
|
498
|
+
VIDEO: Ut,
|
|
499
|
+
OBJECT: qt
|
|
500
|
+
}, Gt = (e, t) => {
|
|
502
501
|
const s = et[e.tagName];
|
|
503
502
|
!s || s(e, t);
|
|
504
|
-
},
|
|
503
|
+
}, Wt = (e, t, s) => {
|
|
505
504
|
const r = et[e.tagName];
|
|
506
505
|
!r || (r(e, t), Ye(e, t, s));
|
|
507
|
-
},
|
|
508
|
-
t && !
|
|
506
|
+
}, Jt = ["IMG", "IFRAME", "VIDEO", "OBJECT"], Zt = (e) => Jt.indexOf(e.tagName) > -1, tt = (e, t) => {
|
|
507
|
+
t && !Dt(t) && !Mt(t) && O(e.callback_finish, t);
|
|
509
508
|
}, Se = (e, t, s) => {
|
|
510
509
|
e.addEventListener(t, s), e.llEvLisnrs[t] = s;
|
|
511
|
-
},
|
|
510
|
+
}, Kt = (e, t, s) => {
|
|
512
511
|
e.removeEventListener(t, s);
|
|
513
|
-
},
|
|
514
|
-
|
|
512
|
+
}, be = (e) => !!e.llEvLisnrs, Qt = (e, t, s) => {
|
|
513
|
+
be(e) || (e.llEvLisnrs = {});
|
|
515
514
|
const r = e.tagName === "VIDEO" ? "loadeddata" : "load";
|
|
516
515
|
Se(e, r, t), Se(e, "error", s);
|
|
517
|
-
},
|
|
518
|
-
if (!
|
|
516
|
+
}, ie = (e) => {
|
|
517
|
+
if (!be(e))
|
|
519
518
|
return;
|
|
520
519
|
const t = e.llEvLisnrs;
|
|
521
520
|
for (let s in t) {
|
|
522
521
|
const r = t[s];
|
|
523
|
-
|
|
522
|
+
Kt(e, s, r);
|
|
524
523
|
}
|
|
525
524
|
delete e.llEvLisnrs;
|
|
526
525
|
}, st = (e, t, s) => {
|
|
527
|
-
|
|
528
|
-
},
|
|
529
|
-
const
|
|
530
|
-
st(t, s, r),
|
|
531
|
-
},
|
|
532
|
-
const
|
|
533
|
-
st(t, s, r),
|
|
534
|
-
},
|
|
526
|
+
Lt(e), ge(s, -1), Ot(s), S(e, t.class_loading), t.unobserve_completed && se(e, s);
|
|
527
|
+
}, Xt = (e, t, s, r) => {
|
|
528
|
+
const n = he(t);
|
|
529
|
+
st(t, s, r), H(t, s.class_loaded), T(t, Re), O(s.callback_loaded, t, r), n || tt(s, r);
|
|
530
|
+
}, Yt = (e, t, s, r) => {
|
|
531
|
+
const n = he(t);
|
|
532
|
+
st(t, s, r), H(t, s.class_error), T(t, ue), O(s.callback_error, t, r), s.restore_on_error && M(t, J), n || tt(s, r);
|
|
533
|
+
}, ve = (e, t, s) => {
|
|
535
534
|
const r = He(e) || e;
|
|
536
|
-
if (
|
|
535
|
+
if (be(r))
|
|
537
536
|
return;
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
}, (
|
|
541
|
-
|
|
537
|
+
Qt(r, (i) => {
|
|
538
|
+
Xt(i, e, t, s), ie(r);
|
|
539
|
+
}, (i) => {
|
|
540
|
+
Yt(i, e, t, s), ie(r);
|
|
542
541
|
});
|
|
543
|
-
},
|
|
544
|
-
|
|
545
|
-
},
|
|
546
|
-
|
|
547
|
-
},
|
|
548
|
-
|
|
549
|
-
},
|
|
550
|
-
e.setAttribute("loading", "lazy"),
|
|
542
|
+
}, es = (e, t, s) => {
|
|
543
|
+
At(e), ve(e, t, s), Tt(e), Bt(e, t, s), Ht(e, t, s), jt(e, t, s);
|
|
544
|
+
}, ts = (e, t, s) => {
|
|
545
|
+
ve(e, t, s), Wt(e, t, s);
|
|
546
|
+
}, me = (e, t, s) => {
|
|
547
|
+
Zt(e) ? ts(e, t, s) : es(e, t, s);
|
|
548
|
+
}, ss = (e, t, s) => {
|
|
549
|
+
e.setAttribute("loading", "lazy"), ve(e, t, s), Gt(e, t), T(e, Ue);
|
|
551
550
|
}, xe = (e) => {
|
|
552
|
-
e.removeAttribute(
|
|
553
|
-
},
|
|
554
|
-
|
|
551
|
+
e.removeAttribute(C), e.removeAttribute(le), e.removeAttribute(ce);
|
|
552
|
+
}, rs = (e) => {
|
|
553
|
+
fe(e, (t) => {
|
|
555
554
|
xe(t);
|
|
556
555
|
}), xe(e);
|
|
557
556
|
}, rt = (e) => {
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
}),
|
|
561
|
-
},
|
|
557
|
+
fe(e, (t) => {
|
|
558
|
+
M(t, J);
|
|
559
|
+
}), M(e, J);
|
|
560
|
+
}, os = (e) => {
|
|
562
561
|
We(e, (t) => {
|
|
563
|
-
|
|
564
|
-
}),
|
|
565
|
-
}, ss = (e) => {
|
|
566
|
-
D(e, re);
|
|
567
|
-
}, rs = (e) => {
|
|
568
|
-
D(e, Ze);
|
|
569
|
-
}, os = {
|
|
570
|
-
IMG: rt,
|
|
571
|
-
IFRAME: ss,
|
|
572
|
-
VIDEO: ts,
|
|
573
|
-
OBJECT: rs
|
|
562
|
+
M(t, re);
|
|
563
|
+
}), M(e, Je), e.load();
|
|
574
564
|
}, ns = (e) => {
|
|
575
|
-
|
|
565
|
+
M(e, re);
|
|
566
|
+
}, as = (e) => {
|
|
567
|
+
M(e, Ze);
|
|
568
|
+
}, is = {
|
|
569
|
+
IMG: rt,
|
|
570
|
+
IFRAME: ns,
|
|
571
|
+
VIDEO: os,
|
|
572
|
+
OBJECT: as
|
|
573
|
+
}, ls = (e) => {
|
|
574
|
+
const t = is[e.tagName];
|
|
576
575
|
if (!t) {
|
|
577
|
-
|
|
576
|
+
Pt(e);
|
|
578
577
|
return;
|
|
579
578
|
}
|
|
580
579
|
t(e);
|
|
581
|
-
},
|
|
582
|
-
|
|
583
|
-
},
|
|
584
|
-
|
|
585
|
-
},
|
|
586
|
-
!s.cancel_on_exit || !
|
|
587
|
-
},
|
|
588
|
-
const
|
|
589
|
-
|
|
590
|
-
},
|
|
591
|
-
|
|
592
|
-
},
|
|
580
|
+
}, cs = (e, t) => {
|
|
581
|
+
pe(e) || he(e) || (S(e, t.class_entered), S(e, t.class_exited), S(e, t.class_applied), S(e, t.class_loading), S(e, t.class_loaded), S(e, t.class_error));
|
|
582
|
+
}, ds = (e, t) => {
|
|
583
|
+
ls(e), cs(e, t), te(e), Qe(e);
|
|
584
|
+
}, us = (e, t, s, r) => {
|
|
585
|
+
!s.cancel_on_exit || !Et(e) || e.tagName === "IMG" && (ie(e), rs(e), rt(e), S(e, s.class_loading), ge(r, -1), te(e), O(s.callback_cancel, e, t, r));
|
|
586
|
+
}, ps = (e, t, s, r) => {
|
|
587
|
+
const n = $t(e);
|
|
588
|
+
T(e, St), H(e, s.class_entered), S(e, s.class_exited), Nt(e, s, r), O(s.callback_enter, e, t, r), !n && me(e, s, r);
|
|
589
|
+
}, hs = (e, t, s, r) => {
|
|
590
|
+
pe(e) || (H(e, s.class_exited), us(e, t, s, r), O(s.callback_exit, e, t, r));
|
|
591
|
+
}, gs = ["IMG", "IFRAME", "VIDEO"], ot = (e) => e.use_native && "loading" in HTMLImageElement.prototype, fs = (e, t, s) => {
|
|
593
592
|
e.forEach((r) => {
|
|
594
|
-
|
|
593
|
+
gs.indexOf(r.tagName) !== -1 && ss(r, t, s);
|
|
595
594
|
}), je(s, 0);
|
|
596
|
-
},
|
|
595
|
+
}, bs = (e) => e.isIntersecting || e.intersectionRatio > 0, vs = (e) => ({
|
|
597
596
|
root: e.container === document ? null : e.container,
|
|
598
597
|
rootMargin: e.thresholds || e.threshold + "px"
|
|
599
|
-
}),
|
|
600
|
-
e.forEach((r) =>
|
|
601
|
-
},
|
|
598
|
+
}), ms = (e, t, s) => {
|
|
599
|
+
e.forEach((r) => bs(r) ? ps(r.target, r, t, s) : hs(r.target, r, t, s));
|
|
600
|
+
}, _s = (e, t) => {
|
|
602
601
|
t.forEach((s) => {
|
|
603
602
|
e.observe(s);
|
|
604
603
|
});
|
|
605
|
-
},
|
|
606
|
-
|
|
607
|
-
},
|
|
604
|
+
}, ws = (e, t) => {
|
|
605
|
+
zt(e), _s(e, t);
|
|
606
|
+
}, ys = (e, t) => {
|
|
608
607
|
!Oe || ot(e) || (t._observer = new IntersectionObserver((s) => {
|
|
609
|
-
|
|
610
|
-
},
|
|
611
|
-
}, nt = (e) => Array.prototype.slice.call(e), ee = (e) => e.container.querySelectorAll(e.elements_selector),
|
|
612
|
-
|
|
608
|
+
ms(s, e, t);
|
|
609
|
+
}, vs(e)));
|
|
610
|
+
}, nt = (e) => Array.prototype.slice.call(e), ee = (e) => e.container.querySelectorAll(e.elements_selector), ks = (e) => nt(e).filter(pe), Ss = (e) => Ct(e), xs = (e) => nt(e).filter(Ss), Ee = (e, t) => ks(e || ee(t)), Es = (e, t) => {
|
|
611
|
+
xs(ee(e)).forEach((r) => {
|
|
613
612
|
S(r, e.class_error), te(r);
|
|
614
613
|
}), t.update();
|
|
615
|
-
},
|
|
614
|
+
}, Cs = (e, t) => {
|
|
616
615
|
!N || (t._onlineHandler = () => {
|
|
617
|
-
|
|
616
|
+
Es(e, t);
|
|
618
617
|
}, window.addEventListener("online", t._onlineHandler));
|
|
619
|
-
},
|
|
618
|
+
}, Is = (e) => {
|
|
620
619
|
!N || window.removeEventListener("online", e._onlineHandler);
|
|
621
620
|
}, X = function(e, t) {
|
|
622
621
|
const s = Te(e);
|
|
623
|
-
this._settings = s, this.loadingCount = 0,
|
|
622
|
+
this._settings = s, this.loadingCount = 0, ys(s, this), Cs(s, this), this.update(t);
|
|
624
623
|
};
|
|
625
624
|
X.prototype = {
|
|
626
625
|
update: function(e) {
|
|
@@ -630,67 +629,67 @@ X.prototype = {
|
|
|
630
629
|
return;
|
|
631
630
|
}
|
|
632
631
|
if (ot(t)) {
|
|
633
|
-
|
|
632
|
+
fs(s, t, this);
|
|
634
633
|
return;
|
|
635
634
|
}
|
|
636
|
-
|
|
635
|
+
ws(this._observer, s);
|
|
637
636
|
},
|
|
638
637
|
destroy: function() {
|
|
639
|
-
this._observer && this._observer.disconnect(),
|
|
638
|
+
this._observer && this._observer.disconnect(), Is(this), ee(this._settings).forEach((e) => {
|
|
640
639
|
Qe(e);
|
|
641
640
|
}), delete this._observer, delete this._settings, delete this._onlineHandler, delete this.loadingCount, delete this.toLoadCount;
|
|
642
641
|
},
|
|
643
642
|
loadAll: function(e) {
|
|
644
643
|
const t = this._settings;
|
|
645
644
|
Ee(e, t).forEach((r) => {
|
|
646
|
-
se(r, this),
|
|
645
|
+
se(r, this), me(r, t, this);
|
|
647
646
|
});
|
|
648
647
|
},
|
|
649
648
|
restoreAll: function() {
|
|
650
649
|
const e = this._settings;
|
|
651
650
|
ee(e).forEach((t) => {
|
|
652
|
-
|
|
651
|
+
ds(t, e);
|
|
653
652
|
});
|
|
654
653
|
}
|
|
655
654
|
};
|
|
656
655
|
X.load = (e, t) => {
|
|
657
656
|
const s = Te(t);
|
|
658
|
-
|
|
657
|
+
me(e, s);
|
|
659
658
|
};
|
|
660
659
|
X.resetStatus = (e) => {
|
|
661
660
|
te(e);
|
|
662
661
|
};
|
|
663
|
-
N &&
|
|
664
|
-
const
|
|
665
|
-
function
|
|
662
|
+
N && kt(X, window.lazyLoadOptions);
|
|
663
|
+
const U = "netless-app-slide", at = "https://convertcdn.netless.link/dynamicConvert";
|
|
664
|
+
function W() {
|
|
666
665
|
}
|
|
667
|
-
const
|
|
666
|
+
const $s = `.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)}
|
|
668
667
|
`;
|
|
669
|
-
function
|
|
668
|
+
function As(e) {
|
|
670
669
|
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
671
670
|
s.setAttribute("class", `${e}-footer-icon-sidebar`), s.setAttribute("viewBox", "0 0 64 64");
|
|
672
671
|
const r = document.createElementNS(t, "path");
|
|
673
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;
|
|
674
673
|
}
|
|
675
|
-
function
|
|
674
|
+
function Ls(e) {
|
|
676
675
|
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
677
676
|
s.setAttribute("class", `${e}-footer-icon-arrow-left`), s.setAttribute("viewBox", "0 0 500 500");
|
|
678
677
|
const r = document.createElementNS(t, "path");
|
|
679
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;
|
|
680
679
|
}
|
|
681
|
-
function
|
|
680
|
+
function zs(e) {
|
|
682
681
|
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
683
682
|
s.setAttribute("class", `${e}-footer-icon-play`), s.setAttribute("viewBox", "0 0 500 500");
|
|
684
683
|
const r = document.createElementNS(t, "path");
|
|
685
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;
|
|
686
685
|
}
|
|
687
|
-
function
|
|
686
|
+
function Ns(e) {
|
|
688
687
|
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
689
688
|
s.setAttribute("class", `${e}-footer-icon-pause`), s.setAttribute("viewBox", "0 0 500 500");
|
|
690
689
|
const r = document.createElementNS(t, "path");
|
|
691
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;
|
|
692
691
|
}
|
|
693
|
-
function
|
|
692
|
+
function Os(e) {
|
|
694
693
|
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
695
694
|
s.setAttribute("class", `${e}-footer-icon-arrow-right`), s.setAttribute("viewBox", "0 0 500 500");
|
|
696
695
|
const r = document.createElementNS(t, "path");
|
|
@@ -699,84 +698,84 @@ function $s(e) {
|
|
|
699
698
|
function g(e) {
|
|
700
699
|
return document.createElement(e);
|
|
701
700
|
}
|
|
702
|
-
function
|
|
701
|
+
function D(e, t) {
|
|
703
702
|
return e.appendChild(t);
|
|
704
703
|
}
|
|
705
704
|
function f(e) {
|
|
706
|
-
return `${
|
|
705
|
+
return `${U}-${e}`;
|
|
707
706
|
}
|
|
708
|
-
function
|
|
707
|
+
function v(e, t) {
|
|
709
708
|
e.className = f(t);
|
|
710
709
|
}
|
|
711
|
-
function
|
|
710
|
+
function Ds(e) {
|
|
712
711
|
return e.endsWith("/") ? e.slice(0, -1) : e;
|
|
713
712
|
}
|
|
714
|
-
async function
|
|
715
|
-
const s =
|
|
716
|
-
const
|
|
717
|
-
|
|
718
|
-
}),
|
|
719
|
-
return { preview: await l, slide: await
|
|
713
|
+
async function it({ taskId: e, url: t }) {
|
|
714
|
+
const s = lt(e, t), r = `${s}/preview/1.png`, n = `${s}/jsonOutput/slide-1.json`, l = new Promise((o) => {
|
|
715
|
+
const a = new Image();
|
|
716
|
+
a.onload = () => o(a), a.onerror = () => o(null), a.src = r;
|
|
717
|
+
}), i = fetch(n).then((o) => o.json());
|
|
718
|
+
return { preview: await l, slide: await i };
|
|
720
719
|
}
|
|
721
|
-
function
|
|
722
|
-
return `${
|
|
720
|
+
function lt(e, t) {
|
|
721
|
+
return `${Ds(t || at)}/${e}`;
|
|
723
722
|
}
|
|
724
|
-
function
|
|
725
|
-
let e =
|
|
723
|
+
function Ms() {
|
|
724
|
+
let e = W;
|
|
726
725
|
const t = (p) => {
|
|
727
726
|
e = p;
|
|
728
727
|
};
|
|
729
|
-
let s = !1, r = !1,
|
|
730
|
-
const
|
|
731
|
-
|
|
728
|
+
let s = !1, r = !1, n = !1, l = [], i = 0;
|
|
729
|
+
const o = f("readonly"), a = f("preview-active"), d = g("div");
|
|
730
|
+
v(d, "content");
|
|
732
731
|
const u = g("div");
|
|
733
|
-
|
|
732
|
+
v(u, "preview-mask"), u.onclick = function(w) {
|
|
734
733
|
r || w.target === u && b(!1);
|
|
735
|
-
},
|
|
734
|
+
}, D(d, u);
|
|
736
735
|
const h = g("div");
|
|
737
|
-
|
|
738
|
-
var
|
|
736
|
+
v(h, "preview"), h.classList.add(f("tele-fancy-scrollbar")), h.onclick = function(w) {
|
|
737
|
+
var A;
|
|
739
738
|
if (r)
|
|
740
739
|
return;
|
|
741
|
-
const E = (
|
|
740
|
+
const E = (A = w.target.dataset) == null ? void 0 : A.pageIndex;
|
|
742
741
|
E && (w.preventDefault(), w.stopPropagation(), w.stopImmediatePropagation(), e(Number(E)), b(!1));
|
|
743
|
-
},
|
|
742
|
+
}, D(d, h);
|
|
744
743
|
const k = new X({
|
|
745
744
|
container: h,
|
|
746
745
|
elements_selector: `.${f("preview-page>img")}`
|
|
747
746
|
});
|
|
748
747
|
function x(p) {
|
|
749
|
-
r !== p && (r = p, d.classList.toggle(
|
|
748
|
+
r !== p && (r = p, d.classList.toggle(o, r));
|
|
750
749
|
}
|
|
751
750
|
function b(p) {
|
|
752
|
-
|
|
751
|
+
n !== p && (n = p, d.classList.toggle(a, n));
|
|
753
752
|
}
|
|
754
|
-
function
|
|
753
|
+
function F(p) {
|
|
755
754
|
if (l !== p) {
|
|
756
755
|
l = p;
|
|
757
756
|
const w = f("preview-page"), E = f("preview-page-name");
|
|
758
|
-
l.forEach((
|
|
759
|
-
const
|
|
760
|
-
c.className = w + " " + f(`preview-page-${
|
|
761
|
-
const
|
|
762
|
-
|
|
763
|
-
const
|
|
764
|
-
|
|
757
|
+
l.forEach((A, P) => {
|
|
758
|
+
const j = String(P), c = g("a");
|
|
759
|
+
c.className = w + " " + f(`preview-page-${P}`), c.href = "#", c.dataset.pageIndex = j;
|
|
760
|
+
const R = g("span");
|
|
761
|
+
R.className = E, R.textContent = String(P + 1), R.dataset.pageIndex = j;
|
|
762
|
+
const V = g("img");
|
|
763
|
+
V.width = A.width, V.height = A.height, V.src = A.thumbnail, V.alt = `page-${P}`, V.dataset.pageIndex = j, D(c, V), D(c, R), D(h, c);
|
|
765
764
|
}), s || k.update();
|
|
766
765
|
}
|
|
767
766
|
}
|
|
768
|
-
function
|
|
769
|
-
if (w ||
|
|
770
|
-
|
|
771
|
-
const E = h.querySelector(`.${f(`preview-page-${
|
|
767
|
+
function I(p, w = !1) {
|
|
768
|
+
if (w || i !== p) {
|
|
769
|
+
i = p;
|
|
770
|
+
const E = h.querySelector(`.${f(`preview-page-${i}`)}`);
|
|
772
771
|
E && h.scrollTo({ top: E.offsetTop - 16 });
|
|
773
772
|
}
|
|
774
773
|
}
|
|
775
|
-
function
|
|
774
|
+
function $() {
|
|
776
775
|
s = !0, k.destroy();
|
|
777
776
|
}
|
|
778
777
|
function y() {
|
|
779
|
-
return
|
|
778
|
+
return n;
|
|
780
779
|
}
|
|
781
780
|
return {
|
|
782
781
|
$content: d,
|
|
@@ -784,103 +783,103 @@ function Os() {
|
|
|
784
783
|
set_readonly: x,
|
|
785
784
|
set_active: b,
|
|
786
785
|
get_active: y,
|
|
787
|
-
set_pages:
|
|
786
|
+
set_pages: F,
|
|
788
787
|
on_new_page_index: t,
|
|
789
|
-
set_page_index:
|
|
790
|
-
destroy:
|
|
788
|
+
set_page_index: I,
|
|
789
|
+
destroy: $
|
|
791
790
|
};
|
|
792
791
|
}
|
|
793
|
-
function
|
|
794
|
-
let e =
|
|
792
|
+
function Ts() {
|
|
793
|
+
let e = W;
|
|
795
794
|
const t = (c) => {
|
|
796
795
|
e = c;
|
|
797
796
|
};
|
|
798
|
-
let s =
|
|
797
|
+
let s = W;
|
|
799
798
|
const r = (c) => {
|
|
800
799
|
s = c;
|
|
801
800
|
};
|
|
802
|
-
let
|
|
801
|
+
let n = W;
|
|
803
802
|
const l = (c) => {
|
|
804
|
-
|
|
803
|
+
n = c;
|
|
805
804
|
};
|
|
806
|
-
let
|
|
805
|
+
let i = !1, o = !1, a = 0, d = 0;
|
|
807
806
|
const u = g("div");
|
|
808
|
-
|
|
807
|
+
v(u, "footer");
|
|
809
808
|
const h = g("button");
|
|
810
|
-
|
|
811
|
-
|
|
809
|
+
v(h, "btn-sidebar"), h.classList.add(f("footer-btn")), h.appendChild(As(U)), h.onclick = function() {
|
|
810
|
+
i || s();
|
|
812
811
|
}, h.style.display = "none", u.appendChild(h);
|
|
813
812
|
const k = g("div");
|
|
814
|
-
|
|
813
|
+
v(k, "page-jumps");
|
|
815
814
|
const x = g("button");
|
|
816
|
-
|
|
817
|
-
|
|
815
|
+
v(x, "btn-page-back"), x.classList.add(f("footer-btn")), x.appendChild(Ls(U)), x.onclick = function() {
|
|
816
|
+
i || e(a - 1);
|
|
818
817
|
}, k.appendChild(x);
|
|
819
818
|
const b = g("button");
|
|
820
|
-
|
|
821
|
-
let
|
|
819
|
+
v(b, "btn-page-play"), b.classList.add(f("footer-btn")), b.appendChild(zs(U)), b.appendChild(Ns(U));
|
|
820
|
+
let F = 0;
|
|
822
821
|
b.onclick = function() {
|
|
823
|
-
|
|
822
|
+
i || (b.classList.add(f("footer-btn-playing")), n(), clearTimeout(F), F = setTimeout(() => {
|
|
824
823
|
b.classList.remove(f("footer-btn-playing"));
|
|
825
824
|
}, 500));
|
|
826
825
|
}, k.appendChild(b);
|
|
827
|
-
const
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
}, k.appendChild(
|
|
831
|
-
const
|
|
832
|
-
|
|
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(a + 1);
|
|
829
|
+
}, k.appendChild(I);
|
|
830
|
+
const $ = g("div");
|
|
831
|
+
v($, "page-number");
|
|
833
832
|
const y = g("input");
|
|
834
|
-
|
|
835
|
-
|
|
833
|
+
v(y, "page-number-input"), y.value = String(a + 1), y.onchange = function() {
|
|
834
|
+
i || y.value && e(Number(y.value) - 1);
|
|
836
835
|
};
|
|
837
836
|
const p = g("span");
|
|
838
|
-
|
|
837
|
+
v(p, "total-page"), p.textContent = " / ", $.appendChild(y), $.appendChild(p), u.appendChild(k), u.appendChild($);
|
|
839
838
|
const w = f("readonly");
|
|
840
839
|
function E(c) {
|
|
841
|
-
|
|
840
|
+
i !== c && (i = c, u.classList.toggle(w, i), y.disabled = i);
|
|
842
841
|
}
|
|
843
|
-
function
|
|
844
|
-
|
|
842
|
+
function A(c) {
|
|
843
|
+
o !== c && (o = c, h.style.display = o ? "" : "none");
|
|
845
844
|
}
|
|
846
|
-
function
|
|
847
|
-
(
|
|
845
|
+
function P(c, R = !1) {
|
|
846
|
+
(R || a !== c) && (a = c, y.value = String(a + 1));
|
|
848
847
|
}
|
|
849
|
-
function
|
|
848
|
+
function j(c) {
|
|
850
849
|
d !== c && (d = c, p.textContent = ` / ${d}`);
|
|
851
850
|
}
|
|
852
851
|
return {
|
|
853
852
|
$footer: u,
|
|
854
853
|
$pageNumberInput: y,
|
|
855
854
|
set_readonly: E,
|
|
856
|
-
set_sidebar:
|
|
857
|
-
set_page_index:
|
|
858
|
-
set_page_count:
|
|
855
|
+
set_sidebar: A,
|
|
856
|
+
set_page_index: P,
|
|
857
|
+
set_page_count: j,
|
|
859
858
|
on_new_page_index: t,
|
|
860
859
|
on_toggle_preview: r,
|
|
861
860
|
on_play: l
|
|
862
861
|
};
|
|
863
862
|
}
|
|
864
|
-
function
|
|
863
|
+
function Fs() {
|
|
865
864
|
const e = g("div");
|
|
866
|
-
return
|
|
865
|
+
return v(e, "slide"), e;
|
|
867
866
|
}
|
|
868
|
-
function
|
|
867
|
+
function Ps(e) {
|
|
869
868
|
if (typeof document < "u") {
|
|
870
869
|
const t = () => e(document.visibilityState === "visible");
|
|
871
870
|
return document.addEventListener("visibilitychange", t), () => document.removeEventListener("visibilitychange", t);
|
|
872
871
|
}
|
|
873
|
-
return
|
|
872
|
+
return W;
|
|
874
873
|
}
|
|
875
|
-
class
|
|
874
|
+
class B {
|
|
876
875
|
constructor(t) {
|
|
877
|
-
this.sideEffect = new ze(), this.$slide =
|
|
876
|
+
this.sideEffect = new ze(), this.$slide = Fs(), this.sidebar = Ms(), this.footer = Ts(), this._ready = !1, this._slideCount = 0, this._destroyed = !1, this._isFrozen = !1, this.$content = this.sidebar.$content, this.$footer = this.footer.$footer, D(this.$content, this.$slide), this.$overlay = g("div"), v(this.$overlay, "overlay"), D(this.$content, this.$overlay);
|
|
878
877
|
let s;
|
|
879
|
-
this._readyPromise = new Promise((
|
|
880
|
-
s =
|
|
878
|
+
this._readyPromise = new Promise((o) => {
|
|
879
|
+
s = o;
|
|
881
880
|
});
|
|
882
|
-
const r = (
|
|
883
|
-
this._ready &&
|
|
881
|
+
const r = (o) => {
|
|
882
|
+
this._ready && o >= 0 && o < this._slideCount ? this.slide.renderSlide(o + 1) : this.setPage(this.slide.slideState.currentSlideIndex);
|
|
884
883
|
};
|
|
885
884
|
this.sidebar.on_new_page_index(r), this.footer.on_new_page_index(r), this.footer.on_toggle_preview(() => {
|
|
886
885
|
this.sidebar.set_active(!this.sidebar.get_active());
|
|
@@ -889,40 +888,41 @@ class J {
|
|
|
889
888
|
}), this.sideEffect.addDisposer(this.sidebar.destroy), this.sideEffect.addDisposer(() => this.slide.destroy()), this.sideEffect.addDisposer(() => {
|
|
890
889
|
this.$content.parentElement && this.$content.remove(), this.$footer.parentElement && this.$footer.remove(), this.$slide.parentElement && this.$slide.remove();
|
|
891
890
|
});
|
|
892
|
-
let
|
|
893
|
-
this.sideEffect.addDisposer(
|
|
894
|
-
this._destroyed || (
|
|
895
|
-
})), this.slide = new
|
|
891
|
+
let n = !1;
|
|
892
|
+
this.sideEffect.addDisposer(Ps((o) => {
|
|
893
|
+
this._destroyed || (o ? n || this.unfreeze() : (n = this._isFrozen, this.freeze()));
|
|
894
|
+
})), this.slide = new ae({
|
|
896
895
|
anchor: this.$slide,
|
|
897
|
-
resize: !0,
|
|
898
896
|
mode: "local",
|
|
899
897
|
interactive: !0,
|
|
900
898
|
enableGlobalClick: !0,
|
|
901
899
|
...t
|
|
902
900
|
}), this.slide.setResource(t.taskId, t.url || at);
|
|
903
901
|
let l;
|
|
904
|
-
this._infoPromise = new Promise((
|
|
905
|
-
l =
|
|
906
|
-
}), this.slide.on("slideChange", (
|
|
907
|
-
this._destroyed || this.setPage(
|
|
902
|
+
this._infoPromise = new Promise((o) => {
|
|
903
|
+
l = o;
|
|
904
|
+
}), this.slide.on("slideChange", (o) => {
|
|
905
|
+
this._destroyed || this.setPage(o);
|
|
908
906
|
}), this.slide.on("renderEnd", () => {
|
|
909
|
-
this._ready
|
|
907
|
+
this._ready ? this.$overlay.style.opacity = "" : setTimeout(() => {
|
|
910
908
|
this._ready = !0, s();
|
|
911
909
|
}, 1e3);
|
|
912
|
-
}),
|
|
910
|
+
}), this.slide.on("renderError", ({ error: o, index: a }) => {
|
|
911
|
+
this._destroyed || o && (console.error(o), this.$overlay.textContent = `Error on slide[index=${a}]: ${o.message}`, this.$overlay.style.opacity = "1");
|
|
912
|
+
}), it(t).then(({ preview: o, slide: a }) => {
|
|
913
913
|
if (!this._destroyed) {
|
|
914
|
-
if (this._slideCount =
|
|
915
|
-
const { taskId: d, url: u } = t, { slideCount: h } =
|
|
914
|
+
if (this._slideCount = a.slideCount, o) {
|
|
915
|
+
const { taskId: d, url: u } = t, { slideCount: h } = a, { width: k, height: x } = o, b = lt(d, u), F = Array.from({ length: h }, (I, $) => ({
|
|
916
916
|
width: k,
|
|
917
917
|
height: x,
|
|
918
|
-
thumbnail: `${b}/preview/${
|
|
918
|
+
thumbnail: `${b}/preview/${$ + 1}.png`
|
|
919
919
|
}));
|
|
920
|
-
this.sidebar.set_pages(
|
|
920
|
+
this.sidebar.set_pages(F), this.footer.set_sidebar(!0);
|
|
921
921
|
}
|
|
922
|
-
this.footer.set_page_count(
|
|
922
|
+
this.footer.set_page_count(a.slideCount), l(a);
|
|
923
923
|
}
|
|
924
|
-
}).catch((
|
|
925
|
-
console.log("[Slide] fetch slide info error"), console.error(
|
|
924
|
+
}).catch((o) => {
|
|
925
|
+
console.log("[Slide] fetch slide info error"), console.error(o);
|
|
926
926
|
}), this.ready(() => {
|
|
927
927
|
this._isFrozen && this.freeze();
|
|
928
928
|
});
|
|
@@ -949,8 +949,9 @@ class J {
|
|
|
949
949
|
this._destroyed || (this._isFrozen = !1, this._ready && this.slide.release());
|
|
950
950
|
}
|
|
951
951
|
}
|
|
952
|
-
|
|
953
|
-
|
|
952
|
+
B.styles = $s;
|
|
953
|
+
B.fetchSlideInfo = it;
|
|
954
|
+
class Rs {
|
|
954
955
|
constructor() {
|
|
955
956
|
this.threshold = 2, this._map = /* @__PURE__ */ new Map(), this._queue = [];
|
|
956
957
|
}
|
|
@@ -973,119 +974,128 @@ class Fs {
|
|
|
973
974
|
});
|
|
974
975
|
}
|
|
975
976
|
}
|
|
976
|
-
const
|
|
977
|
+
const ct = new Rs(), Gs = function(t) {
|
|
977
978
|
t.on("focus", (s) => {
|
|
978
|
-
|
|
979
|
+
ct.focus(s.appId);
|
|
979
980
|
});
|
|
980
|
-
},
|
|
981
|
+
}, Ws = /* @__PURE__ */ ae.usePlugin.bind(ae), Js = "0.3.0-canary.9", Zs = {
|
|
981
982
|
kind: "Slide",
|
|
982
983
|
setup(e) {
|
|
983
|
-
var
|
|
984
|
-
if (console.log("[Slide] setup @ 0.3.0-canary.
|
|
984
|
+
var i, o;
|
|
985
|
+
if (console.log("[Slide] setup @ 0.3.0-canary.9"), !e.storage.state.taskId)
|
|
985
986
|
throw new Error("[Slide] no taskId");
|
|
986
|
-
const t = e.getAppOptions() || {}, s =
|
|
987
|
-
|
|
988
|
-
const
|
|
987
|
+
const t = e.getAppOptions() || {}, s = t.renderOptions || {}, r = Us(e, t.debug);
|
|
988
|
+
r.info("[Slide] setup @ 0.3.0-canary.9");
|
|
989
|
+
const n = new ze(), l = new B({
|
|
989
990
|
interactive: !0,
|
|
990
991
|
mode: "interactive",
|
|
991
992
|
resize: !0,
|
|
992
993
|
enableGlobalClick: !0,
|
|
993
|
-
timestamp:
|
|
994
|
-
logger:
|
|
994
|
+
timestamp: Vs(e),
|
|
995
|
+
logger: t.logger || r,
|
|
995
996
|
renderOptions: {
|
|
996
|
-
minFPS:
|
|
997
|
-
maxFPS:
|
|
998
|
-
autoFPS: (
|
|
999
|
-
autoResolution: (
|
|
1000
|
-
resolution:
|
|
1001
|
-
maxResolutionLevel:
|
|
1002
|
-
transactionBgColor:
|
|
997
|
+
minFPS: s.minFPS || 25,
|
|
998
|
+
maxFPS: s.maxFPS || 30,
|
|
999
|
+
autoFPS: (i = s.autoFPS) != null ? i : !0,
|
|
1000
|
+
autoResolution: (o = s.autoResolution) != null ? o : !0,
|
|
1001
|
+
resolution: s.resolution,
|
|
1002
|
+
maxResolutionLevel: s.maxResolutionLevel,
|
|
1003
|
+
transactionBgColor: s.transactionBgColor || dt(e.box.$content)
|
|
1003
1004
|
},
|
|
1005
|
+
rtcAudio: t.rtcAudio,
|
|
1006
|
+
useLocalCache: t.useLocalCache,
|
|
1007
|
+
resourceTimeout: t.resourceTimeout,
|
|
1008
|
+
loaderDelegate: t.loaderDelegate,
|
|
1009
|
+
navigatorDelegate: t.navigatorDelegate,
|
|
1010
|
+
fixedFrameSize: t.fixedFrameSize,
|
|
1004
1011
|
taskId: e.storage.state.taskId,
|
|
1005
1012
|
url: e.storage.state.url
|
|
1006
1013
|
});
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
});
|
|
1014
|
+
return l.context = e, n.addDisposer(ct.set(e.appId, l)), e.box.mountStyles(B.styles), e.box.mountStage(l.$slide), e.box.mountFooter(l.$footer), e.box.mountContent(l.$content), n.addDisposer(() => l.destroy()), Hs({ context: e, viewer: l, sideEffect: n, logger: r }), Bs(e, () => {
|
|
1015
|
+
r.info("[Slide] destroy"), n.flushAll();
|
|
1016
|
+
}), l;
|
|
1010
1017
|
}
|
|
1011
1018
|
};
|
|
1012
|
-
function
|
|
1013
|
-
const { container: t } = e;
|
|
1019
|
+
function Ks(e) {
|
|
1020
|
+
const { container: t, ...s } = e;
|
|
1014
1021
|
t.style.cssText = "display:flex;flex-direction:column";
|
|
1015
|
-
const
|
|
1016
|
-
return t.appendChild(document.createElement("style")).textContent =
|
|
1022
|
+
const r = new B(s);
|
|
1023
|
+
return t.appendChild(document.createElement("style")).textContent = B.styles, t.appendChild(r.$content), t.appendChild(r.$footer), r.prepare(() => r.slide.renderSlide(1)), r;
|
|
1017
1024
|
}
|
|
1018
|
-
function
|
|
1025
|
+
function Vs(e) {
|
|
1019
1026
|
const t = e.room, s = e.displayer;
|
|
1020
1027
|
return t ? () => t.calibrationTimestamp : s ? () => s.beginTimestamp + s.progressTime : () => Date.now();
|
|
1021
1028
|
}
|
|
1022
|
-
function
|
|
1029
|
+
function Us(e, t) {
|
|
1023
1030
|
return e.displayer.logger;
|
|
1024
1031
|
}
|
|
1025
|
-
function
|
|
1032
|
+
function dt(e) {
|
|
1026
1033
|
try {
|
|
1027
1034
|
let t = window.getComputedStyle(e).backgroundColor;
|
|
1028
1035
|
if (t !== "rgba(0, 0, 0, 0)" && t !== "transparent")
|
|
1029
|
-
return t =
|
|
1036
|
+
return t = qs(t), console.log("[Slide] guess bg color:", t), t;
|
|
1030
1037
|
if (e.parentElement)
|
|
1031
|
-
return
|
|
1038
|
+
return dt(e.parentElement);
|
|
1032
1039
|
} catch {
|
|
1033
1040
|
}
|
|
1034
1041
|
return "#ffffff";
|
|
1035
1042
|
}
|
|
1036
|
-
function
|
|
1037
|
-
const t =
|
|
1043
|
+
function qs(e) {
|
|
1044
|
+
const t = Ce.exports.get(e);
|
|
1038
1045
|
if (t && t.model === "rgb") {
|
|
1039
|
-
const s = t.value,
|
|
1040
|
-
return "#" + "000000".substring(
|
|
1046
|
+
const s = t.value, n = (((Math.round(s[0]) & 255) << 16) + ((Math.round(s[1]) & 255) << 8) + (Math.round(s[2]) & 255)).toString(16);
|
|
1047
|
+
return "#" + "000000".substring(n.length) + n;
|
|
1041
1048
|
} else
|
|
1042
1049
|
return e;
|
|
1043
1050
|
}
|
|
1044
|
-
function
|
|
1051
|
+
function Bs(e, t) {
|
|
1045
1052
|
e.emitter.on("destroy", t);
|
|
1046
1053
|
}
|
|
1047
|
-
function
|
|
1048
|
-
const
|
|
1054
|
+
function Hs({ context: e, viewer: t, sideEffect: s, logger: r }) {
|
|
1055
|
+
const n = r.info.bind(r);
|
|
1049
1056
|
let l = null;
|
|
1050
|
-
t.prepare(({ width:
|
|
1051
|
-
e.destroyed || (
|
|
1057
|
+
t.prepare(({ width: a, height: d, slideCount: u }) => {
|
|
1058
|
+
e.destroyed || (a && e.box.setStageRatio(d / a), l = e.createWhiteBoardView({ size: u }), l.setBaseRect({ width: a, height: d }), o());
|
|
1052
1059
|
});
|
|
1053
|
-
const { slide:
|
|
1054
|
-
function
|
|
1060
|
+
const { slide: i } = t;
|
|
1061
|
+
function o() {
|
|
1055
1062
|
if (e.storage.state.state)
|
|
1056
|
-
|
|
1063
|
+
n("[Slide] restore", { ...e.storage.state.state }), i.setSlideState(e.storage.state.state);
|
|
1057
1064
|
else if (e.isAddApp)
|
|
1058
|
-
|
|
1065
|
+
n("[Slide] kick start"), i.renderSlide(1);
|
|
1059
1066
|
else {
|
|
1060
|
-
|
|
1061
|
-
const
|
|
1067
|
+
n("[Slide] wait for restore");
|
|
1068
|
+
const a = s.add(() => {
|
|
1062
1069
|
const u = setInterval(() => {
|
|
1063
|
-
e.storage.state.state || (
|
|
1070
|
+
e.storage.state.state || (n("[Slide] timeout"), i.renderSlide(1));
|
|
1064
1071
|
}, 15e3);
|
|
1065
1072
|
return () => clearInterval(u);
|
|
1066
1073
|
}), d = s.addDisposer(e.storage.addStateChangedListener(() => {
|
|
1067
|
-
e.storage.state.state && (
|
|
1074
|
+
e.storage.state.state && (n("[Slide] restore", { ...e.storage.state.state }), i.setSlideState(e.storage.state.state), s.flush(d), s.flush(a));
|
|
1068
1075
|
}));
|
|
1069
1076
|
}
|
|
1070
1077
|
}
|
|
1071
|
-
|
|
1072
|
-
e.isWritable && (
|
|
1073
|
-
}),
|
|
1074
|
-
e.isWritable && (
|
|
1075
|
-
}), s.addDisposer(e.addMagixEventListener("syncDispatch", ({ payload:
|
|
1076
|
-
|
|
1077
|
-
}, { fireSelfEventAfterCommit: !0 })),
|
|
1078
|
-
e.isWritable && l && (
|
|
1079
|
-
}), t.setReadonly(!e.isWritable), s.addDisposer(e.emitter.on("writableChange", (
|
|
1080
|
-
t.setReadonly(!
|
|
1078
|
+
i.on("stateChange", () => {
|
|
1079
|
+
e.isWritable && (n("[Slide] save state", { ...i.slideState }), e.storage.setState({ state: i.slideState }));
|
|
1080
|
+
}), i.on("syncDispatch", (a) => {
|
|
1081
|
+
e.isWritable && (n("[Slide] dispatch", { ...a }), e.dispatchMagixEvent("syncDispatch", a));
|
|
1082
|
+
}), s.addDisposer(e.addMagixEventListener("syncDispatch", ({ payload: a }) => {
|
|
1083
|
+
n("[Slide] receive", { ...a }), i.emit("syncReceive", a);
|
|
1084
|
+
}, { fireSelfEventAfterCommit: !0 })), i.on("slideChange", (a) => {
|
|
1085
|
+
e.isWritable && l && (n("[Slide] page to", a), l.jumpPage(a - 1));
|
|
1086
|
+
}), t.setReadonly(!e.isWritable), s.addDisposer(e.emitter.on("writableChange", (a) => {
|
|
1087
|
+
t.setReadonly(!a);
|
|
1081
1088
|
}));
|
|
1082
1089
|
}
|
|
1083
1090
|
export {
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1091
|
+
at as DefaultUrl,
|
|
1092
|
+
Ys as Slide,
|
|
1093
|
+
B as SlideViewer,
|
|
1094
|
+
Gs as addHooks,
|
|
1095
|
+
Zs as default,
|
|
1096
|
+
Ks as previewSlide,
|
|
1097
|
+
ct as refrigerator,
|
|
1098
|
+
Ws as usePlugin,
|
|
1099
|
+
Js as version
|
|
1090
1100
|
};
|
|
1091
1101
|
//# sourceMappingURL=main.mjs.map
|