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