@flyfish-group/file-viewer3 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/components/ImageViewer.js +795 -743
- package/dist/components/MarkdownViewer.js +990 -1099
- package/dist/components/PdfView.js +20049 -19079
- package/dist/components/PptxRender.js +7101 -6518
- package/dist/components/XlsxTable.js +48841 -64918
- package/dist/components/_commonjsHelpers.js +15 -21
- package/dist/components/docx-preview.js +5622 -0
- package/dist/components/index.js +819 -702
- package/dist/components/utils.d.ts +3 -0
- package/dist/components/worker-ref.js +8 -8
- package/dist/index.umd.js +193 -382
- package/dist/main.d.ts +0 -0
- package/dist/package/components/FileViewer/FileViewer.vue.d.ts +18 -0
- package/dist/package/vendors/image/ImageViewer.vue.d.ts +15 -0
- package/dist/package/vendors/md/MarkdownViewer.vue.d.ts +15 -0
- package/dist/package/vendors/pdf/PdfView.vue.d.ts +15 -0
- package/dist/package/vendors/pptx/PptxRender.vue.d.ts +87 -0
- package/dist/{src/package → package}/vendors/pptx/index.d.ts +1 -1
- package/dist/{src/package → package}/vendors/renders.d.ts +1 -1
- package/dist/package/vendors/text/CodeViewer.vue.d.ts +15 -0
- package/dist/package/vendors/xlsx/XlsxTable.vue.d.ts +17 -0
- package/dist/package/vendors/xlsx/worker/xls/sheet.worker.d.ts +1 -0
- package/dist/package/vendors/xlsx/worker/xlsx/xlsx.worker.d.ts +2 -0
- package/dist/style.css +23 -23
- package/dist/worker/pdf.worker.js +37 -45
- package/dist/worker/pptx.worker.js +7 -7
- package/dist/worker/sheet.worker.js +24 -24
- package/dist/worker/xlsx.worker.js +43 -46
- package/package.json +21 -20
- package/dist/components/docx-preview.min.js +0 -5287
- package/dist/src/package/components/FileViewer/FileViewer.vue.d.ts +0 -25
- package/dist/src/package/vendors/image/ImageViewer.vue.d.ts +0 -13
- package/dist/src/package/vendors/md/MarkdownViewer.vue.d.ts +0 -13
- package/dist/src/package/vendors/pdf/PdfView.vue.d.ts +0 -13
- package/dist/src/package/vendors/pptx/PptxRender.vue.d.ts +0 -81
- package/dist/src/package/vendors/text/CodeViewer.vue.d.ts +0 -13
- package/dist/src/package/vendors/xlsx/XlsxTable.vue.d.ts +0 -21
- /package/dist/{src/package → package}/common/type.d.ts +0 -0
- /package/dist/{src/package → package}/common/util.d.ts +0 -0
- /package/dist/{src/package → package}/common/worker-ref.d.ts +0 -0
- /package/dist/{src/package → package}/components/FileViewer/index.d.ts +0 -0
- /package/dist/{src/package → package}/components/FileViewer/util.d.ts +0 -0
- /package/dist/{src/package → package}/index.d.ts +0 -0
- /package/dist/{src/package → package}/use/index.d.ts +0 -0
- /package/dist/{src/package → package}/use/worker.d.ts +0 -0
- /package/dist/{src/package → package}/vendors/docx/index.d.ts +0 -0
- /package/dist/{src/package → package}/vendors/image/index.d.ts +0 -0
- /package/dist/{src/package → package}/vendors/md/index.d.ts +0 -0
- /package/dist/{src/package → package}/vendors/mp4/index.d.ts +0 -0
- /package/dist/{src/package → package}/vendors/pdf/index.d.ts +0 -0
- /package/dist/{src/package → package}/vendors/pdf/worker/index.d.ts +0 -0
- /package/dist/{src/package → package}/vendors/pptx/options.d.ts +0 -0
- /package/dist/{src/package → package}/vendors/pptx/support/chart.d.ts +0 -0
- /package/dist/{src/package → package}/vendors/pptx/worker/index.d.ts +0 -0
- /package/dist/{src/package → package}/vendors/text/index.d.ts +0 -0
- /package/dist/{src/package → package}/vendors/xlsx/index.d.ts +0 -0
- /package/dist/{src/package → package}/vendors/xlsx/render.d.ts +0 -0
- /package/dist/{src/package → package}/vendors/xlsx/util.d.ts +0 -0
- /package/dist/{src/package → package}/vendors/xlsx/worker/index.d.ts +0 -0
- /package/dist/{src/package → package}/vendors/xlsx/worker/xls/SheetJsModel.d.ts +0 -0
- /package/dist/{src/package → package}/vendors/xlsx/worker/xls/index.d.ts +0 -0
- /package/dist/{src/package → package}/vendors/xlsx/worker/xlsx/ExcelJsModel.d.ts +0 -0
- /package/dist/{src/package → package}/vendors/xlsx/worker/xlsx/color.d.ts +0 -0
- /package/dist/{src/package → package}/vendors/xlsx/worker/xlsx/context.d.ts +0 -0
- /package/dist/{src/package → package}/vendors/xlsx/worker/xlsx/index.d.ts +0 -0
- /package/dist/{src/package → package}/vendors/xlsx/worker/xlsx/util.d.ts +0 -0
|
@@ -1,82 +1,83 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { _ as
|
|
1
|
+
import { defineComponent as Se, ref as qe, watch as Tt, nextTick as Ot, onMounted as Ue, onUnmounted as Be, openBlock as ft, createElementBlock as At, renderSlot as Ze, computed as $e, createBlock as Ke, unref as Ge, withCtx as Qe, Fragment as Je, renderList as ti } from "vue";
|
|
2
|
+
import { _ as ei } from "./index.js";
|
|
3
3
|
/*!
|
|
4
|
-
* Viewer.js v1.11.
|
|
4
|
+
* Viewer.js v1.11.6
|
|
5
5
|
* https://fengyuanchen.github.io/viewerjs
|
|
6
6
|
*
|
|
7
7
|
* Copyright 2015-present Chen Fengyuan
|
|
8
8
|
* Released under the MIT license
|
|
9
9
|
*
|
|
10
|
-
* Date: 2023-
|
|
10
|
+
* Date: 2023-09-17T03:16:38.052Z
|
|
11
11
|
*/
|
|
12
|
-
function
|
|
12
|
+
function Yt(e, t) {
|
|
13
13
|
var i = Object.keys(e);
|
|
14
14
|
if (Object.getOwnPropertySymbols) {
|
|
15
|
-
var
|
|
16
|
-
t && (
|
|
17
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
18
|
-
})), i.push.apply(i,
|
|
15
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
16
|
+
t && (n = n.filter(function(r) {
|
|
17
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
18
|
+
})), i.push.apply(i, n);
|
|
19
19
|
}
|
|
20
20
|
return i;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function kt(e) {
|
|
23
23
|
for (var t = 1; t < arguments.length; t++) {
|
|
24
24
|
var i = arguments[t] != null ? arguments[t] : {};
|
|
25
|
-
t % 2 ?
|
|
26
|
-
|
|
27
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i)) :
|
|
28
|
-
Object.defineProperty(e,
|
|
25
|
+
t % 2 ? Yt(Object(i), !0).forEach(function(n) {
|
|
26
|
+
ri(e, n, i[n]);
|
|
27
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i)) : Yt(Object(i)).forEach(function(n) {
|
|
28
|
+
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(i, n));
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
return e;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
|
|
33
|
+
function Dt(e) {
|
|
34
|
+
"@babel/helpers - typeof";
|
|
35
|
+
return Dt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
35
36
|
return typeof t;
|
|
36
37
|
} : function(t) {
|
|
37
38
|
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
38
|
-
},
|
|
39
|
+
}, Dt(e);
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
+
function ii(e, t) {
|
|
41
42
|
if (!(e instanceof t))
|
|
42
43
|
throw new TypeError("Cannot call a class as a function");
|
|
43
44
|
}
|
|
44
|
-
function
|
|
45
|
+
function Wt(e, t) {
|
|
45
46
|
for (var i = 0; i < t.length; i++) {
|
|
46
|
-
var
|
|
47
|
-
|
|
47
|
+
var n = t[i];
|
|
48
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, xe(n.key), n);
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
-
return t &&
|
|
51
|
+
function ni(e, t, i) {
|
|
52
|
+
return t && Wt(e.prototype, t), i && Wt(e, i), Object.defineProperty(e, "prototype", {
|
|
52
53
|
writable: !1
|
|
53
54
|
}), e;
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
-
return t =
|
|
56
|
+
function ri(e, t, i) {
|
|
57
|
+
return t = xe(t), t in e ? Object.defineProperty(e, t, {
|
|
57
58
|
value: i,
|
|
58
59
|
enumerable: !0,
|
|
59
60
|
configurable: !0,
|
|
60
61
|
writable: !0
|
|
61
62
|
}) : e[t] = i, e;
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
+
function ai(e, t) {
|
|
64
65
|
if (typeof e != "object" || e === null)
|
|
65
66
|
return e;
|
|
66
67
|
var i = e[Symbol.toPrimitive];
|
|
67
68
|
if (i !== void 0) {
|
|
68
|
-
var
|
|
69
|
-
if (typeof
|
|
70
|
-
return
|
|
69
|
+
var n = i.call(e, t || "default");
|
|
70
|
+
if (typeof n != "object")
|
|
71
|
+
return n;
|
|
71
72
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
72
73
|
}
|
|
73
74
|
return (t === "string" ? String : Number)(e);
|
|
74
75
|
}
|
|
75
|
-
function
|
|
76
|
-
var t =
|
|
76
|
+
function xe(e) {
|
|
77
|
+
var t = ai(e, "string");
|
|
77
78
|
return typeof t == "symbol" ? t : String(t);
|
|
78
79
|
}
|
|
79
|
-
var
|
|
80
|
+
var Xt = {
|
|
80
81
|
/**
|
|
81
82
|
* Enable a modal backdrop, specify `static` for a backdrop
|
|
82
83
|
* which doesn't close the modal on click.
|
|
@@ -281,28 +282,28 @@ var Ft = {
|
|
|
281
282
|
zoomed: null,
|
|
282
283
|
play: null,
|
|
283
284
|
stop: null
|
|
284
|
-
},
|
|
285
|
-
function
|
|
285
|
+
}, oi = '<div class="viewer-container" tabindex="-1" touch-action="none"><div class="viewer-canvas"></div><div class="viewer-footer"><div class="viewer-title"></div><div class="viewer-toolbar"></div><div class="viewer-navbar"><ul class="viewer-list" role="navigation"></ul></div></div><div class="viewer-tooltip" role="alert" aria-hidden="true"></div><div class="viewer-button" data-viewer-action="mix" role="button"></div><div class="viewer-player"></div></div>', yt = typeof window != "undefined" && typeof window.document != "undefined", P = yt ? window : {}, K = yt && P.document.documentElement ? "ontouchstart" in P.document.documentElement : !1, jt = yt ? "PointerEvent" in P : !1, v = "viewer", dt = "move", _e = "switch", it = "zoom", lt = "".concat(v, "-active"), si = "".concat(v, "-close"), vt = "".concat(v, "-fade"), It = "".concat(v, "-fixed"), li = "".concat(v, "-fullscreen"), Ht = "".concat(v, "-fullscreen-exit"), W = "".concat(v, "-hide"), ui = "".concat(v, "-hide-md-down"), ci = "".concat(v, "-hide-sm-down"), hi = "".concat(v, "-hide-xs-down"), k = "".concat(v, "-in"), nt = "".concat(v, "-invisible"), G = "".concat(v, "-loading"), fi = "".concat(v, "-move"), qt = "".concat(v, "-open"), q = "".concat(v, "-show"), x = "".concat(v, "-transition"), Q = "click", Nt = "dblclick", Ut = "dragstart", Bt = "focusin", Zt = "keydown", j = "load", X = "error", di = K ? "touchend touchcancel" : "mouseup", vi = K ? "touchmove" : "mousemove", mi = K ? "touchstart" : "mousedown", $t = jt ? "pointerdown" : mi, Kt = jt ? "pointermove" : vi, Gt = jt ? "pointerup pointercancel" : di, Qt = "resize", z = "transitionend", Jt = "wheel", te = "ready", ee = "show", ie = "shown", ne = "hide", re = "hidden", ae = "view", at = "viewed", oe = "move", se = "moved", le = "rotate", ue = "rotated", ce = "scale", he = "scaled", fe = "zoom", de = "zoomed", ve = "play", me = "stop", gt = "".concat(v, "Action"), zt = /\s\s*/, ut = ["zoom-in", "zoom-out", "one-to-one", "reset", "prev", "play", "next", "rotate-left", "rotate-right", "flip-horizontal", "flip-vertical"];
|
|
286
|
+
function ot(e) {
|
|
286
287
|
return typeof e == "string";
|
|
287
288
|
}
|
|
288
|
-
var
|
|
289
|
-
function
|
|
290
|
-
return typeof e == "number" && !
|
|
289
|
+
var gi = Number.isNaN || P.isNaN;
|
|
290
|
+
function O(e) {
|
|
291
|
+
return typeof e == "number" && !gi(e);
|
|
291
292
|
}
|
|
292
|
-
function
|
|
293
|
-
return typeof e
|
|
293
|
+
function B(e) {
|
|
294
|
+
return typeof e == "undefined";
|
|
294
295
|
}
|
|
295
|
-
function
|
|
296
|
-
return
|
|
296
|
+
function J(e) {
|
|
297
|
+
return Dt(e) === "object" && e !== null;
|
|
297
298
|
}
|
|
298
|
-
var
|
|
299
|
-
function
|
|
300
|
-
if (!
|
|
299
|
+
var pi = Object.prototype.hasOwnProperty;
|
|
300
|
+
function Z(e) {
|
|
301
|
+
if (!J(e))
|
|
301
302
|
return !1;
|
|
302
303
|
try {
|
|
303
304
|
var t = e.constructor, i = t.prototype;
|
|
304
|
-
return t && i &&
|
|
305
|
-
} catch {
|
|
305
|
+
return t && i && pi.call(i, "isPrototypeOf");
|
|
306
|
+
} catch (n) {
|
|
306
307
|
return !1;
|
|
307
308
|
}
|
|
308
309
|
}
|
|
@@ -311,42 +312,42 @@ function p(e) {
|
|
|
311
312
|
}
|
|
312
313
|
function y(e, t) {
|
|
313
314
|
if (e && p(t))
|
|
314
|
-
if (Array.isArray(e) ||
|
|
315
|
-
var i = e.length,
|
|
316
|
-
for (
|
|
315
|
+
if (Array.isArray(e) || O(e.length)) {
|
|
316
|
+
var i = e.length, n;
|
|
317
|
+
for (n = 0; n < i && t.call(e, e[n], n, e) !== !1; n += 1)
|
|
317
318
|
;
|
|
318
319
|
} else
|
|
319
|
-
|
|
320
|
-
t.call(e, e[
|
|
320
|
+
J(e) && Object.keys(e).forEach(function(r) {
|
|
321
|
+
t.call(e, e[r], r, e);
|
|
321
322
|
});
|
|
322
323
|
return e;
|
|
323
324
|
}
|
|
324
325
|
var C = Object.assign || function(t) {
|
|
325
|
-
for (var i = arguments.length,
|
|
326
|
-
r
|
|
327
|
-
return
|
|
328
|
-
|
|
329
|
-
t[
|
|
326
|
+
for (var i = arguments.length, n = new Array(i > 1 ? i - 1 : 0), r = 1; r < i; r++)
|
|
327
|
+
n[r - 1] = arguments[r];
|
|
328
|
+
return J(t) && n.length > 0 && n.forEach(function(a) {
|
|
329
|
+
J(a) && Object.keys(a).forEach(function(o) {
|
|
330
|
+
t[o] = a[o];
|
|
330
331
|
});
|
|
331
332
|
}), t;
|
|
332
|
-
},
|
|
333
|
-
function
|
|
333
|
+
}, bi = /^(?:width|height|left|top|marginLeft|marginTop)$/;
|
|
334
|
+
function L(e, t) {
|
|
334
335
|
var i = e.style;
|
|
335
|
-
y(t, function(
|
|
336
|
-
|
|
336
|
+
y(t, function(n, r) {
|
|
337
|
+
bi.test(r) && O(n) && (n += "px"), i[r] = n;
|
|
337
338
|
});
|
|
338
339
|
}
|
|
339
|
-
function
|
|
340
|
-
return
|
|
340
|
+
function yi(e) {
|
|
341
|
+
return ot(e) ? e.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">") : e;
|
|
341
342
|
}
|
|
342
|
-
function
|
|
343
|
+
function U(e, t) {
|
|
343
344
|
return !e || !t ? !1 : e.classList ? e.classList.contains(t) : e.className.indexOf(t) > -1;
|
|
344
345
|
}
|
|
345
346
|
function f(e, t) {
|
|
346
347
|
if (!(!e || !t)) {
|
|
347
|
-
if (
|
|
348
|
-
y(e, function(
|
|
349
|
-
f(
|
|
348
|
+
if (O(e.length)) {
|
|
349
|
+
y(e, function(n) {
|
|
350
|
+
f(n, t);
|
|
350
351
|
});
|
|
351
352
|
return;
|
|
352
353
|
}
|
|
@@ -358,11 +359,11 @@ function f(e, t) {
|
|
|
358
359
|
i ? i.indexOf(t) < 0 && (e.className = "".concat(i, " ").concat(t)) : e.className = t;
|
|
359
360
|
}
|
|
360
361
|
}
|
|
361
|
-
function
|
|
362
|
+
function g(e, t) {
|
|
362
363
|
if (!(!e || !t)) {
|
|
363
|
-
if (
|
|
364
|
+
if (O(e.length)) {
|
|
364
365
|
y(e, function(i) {
|
|
365
|
-
|
|
366
|
+
g(i, t);
|
|
366
367
|
});
|
|
367
368
|
return;
|
|
368
369
|
}
|
|
@@ -375,30 +376,30 @@ function m(e, t) {
|
|
|
375
376
|
}
|
|
376
377
|
function st(e, t, i) {
|
|
377
378
|
if (t) {
|
|
378
|
-
if (
|
|
379
|
-
y(e, function(
|
|
380
|
-
st(
|
|
379
|
+
if (O(e.length)) {
|
|
380
|
+
y(e, function(n) {
|
|
381
|
+
st(n, t, i);
|
|
381
382
|
});
|
|
382
383
|
return;
|
|
383
384
|
}
|
|
384
|
-
i ? f(e, t) :
|
|
385
|
+
i ? f(e, t) : g(e, t);
|
|
385
386
|
}
|
|
386
387
|
}
|
|
387
|
-
var
|
|
388
|
-
function
|
|
389
|
-
return e.replace(
|
|
388
|
+
var wi = /([a-z\d])([A-Z])/g;
|
|
389
|
+
function Lt(e) {
|
|
390
|
+
return e.replace(wi, "$1-$2").toLowerCase();
|
|
390
391
|
}
|
|
391
|
-
function
|
|
392
|
-
return
|
|
392
|
+
function $(e, t) {
|
|
393
|
+
return J(e[t]) ? e[t] : e.dataset ? e.dataset[t] : e.getAttribute("data-".concat(Lt(t)));
|
|
393
394
|
}
|
|
394
|
-
function
|
|
395
|
-
|
|
395
|
+
function Ct(e, t, i) {
|
|
396
|
+
J(i) ? e[t] = i : e.dataset ? e.dataset[t] = i : e.setAttribute("data-".concat(Lt(t)), i);
|
|
396
397
|
}
|
|
397
|
-
var
|
|
398
|
+
var Ae = function() {
|
|
398
399
|
var e = !1;
|
|
399
|
-
if (
|
|
400
|
+
if (yt) {
|
|
400
401
|
var t = !1, i = function() {
|
|
401
|
-
},
|
|
402
|
+
}, n = Object.defineProperty({}, "once", {
|
|
402
403
|
get: function() {
|
|
403
404
|
return e = !0, t;
|
|
404
405
|
},
|
|
@@ -411,121 +412,121 @@ var Oe = function() {
|
|
|
411
412
|
t = a;
|
|
412
413
|
}
|
|
413
414
|
});
|
|
414
|
-
|
|
415
|
+
P.addEventListener("test", i, n), P.removeEventListener("test", i, n);
|
|
415
416
|
}
|
|
416
417
|
return e;
|
|
417
418
|
}();
|
|
418
419
|
function b(e, t, i) {
|
|
419
|
-
var
|
|
420
|
-
t.trim().split(
|
|
421
|
-
if (!
|
|
422
|
-
var
|
|
423
|
-
|
|
420
|
+
var n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, r = i;
|
|
421
|
+
t.trim().split(zt).forEach(function(a) {
|
|
422
|
+
if (!Ae) {
|
|
423
|
+
var o = e.listeners;
|
|
424
|
+
o && o[a] && o[a][i] && (r = o[a][i], delete o[a][i], Object.keys(o[a]).length === 0 && delete o[a], Object.keys(o).length === 0 && delete e.listeners);
|
|
424
425
|
}
|
|
425
|
-
e.removeEventListener(a,
|
|
426
|
+
e.removeEventListener(a, r, n);
|
|
426
427
|
});
|
|
427
428
|
}
|
|
428
429
|
function d(e, t, i) {
|
|
429
|
-
var
|
|
430
|
-
t.trim().split(
|
|
431
|
-
if (
|
|
432
|
-
var
|
|
433
|
-
|
|
434
|
-
delete
|
|
435
|
-
for (var
|
|
436
|
-
u[
|
|
430
|
+
var n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, r = i;
|
|
431
|
+
t.trim().split(zt).forEach(function(a) {
|
|
432
|
+
if (n.once && !Ae) {
|
|
433
|
+
var o = e.listeners, s = o === void 0 ? {} : o;
|
|
434
|
+
r = function() {
|
|
435
|
+
delete s[a][i], e.removeEventListener(a, r, n);
|
|
436
|
+
for (var l = arguments.length, u = new Array(l), h = 0; h < l; h++)
|
|
437
|
+
u[h] = arguments[h];
|
|
437
438
|
i.apply(e, u);
|
|
438
|
-
},
|
|
439
|
+
}, s[a] || (s[a] = {}), s[a][i] && e.removeEventListener(a, s[a][i], n), s[a][i] = r, e.listeners = s;
|
|
439
440
|
}
|
|
440
|
-
e.addEventListener(a,
|
|
441
|
+
e.addEventListener(a, r, n);
|
|
441
442
|
});
|
|
442
443
|
}
|
|
443
|
-
function A(e, t, i,
|
|
444
|
-
var
|
|
445
|
-
return p(Event) && p(CustomEvent) ?
|
|
444
|
+
function A(e, t, i, n) {
|
|
445
|
+
var r;
|
|
446
|
+
return p(Event) && p(CustomEvent) ? r = new CustomEvent(t, kt({
|
|
446
447
|
bubbles: !0,
|
|
447
448
|
cancelable: !0,
|
|
448
449
|
detail: i
|
|
449
|
-
},
|
|
450
|
+
}, n)) : (r = document.createEvent("CustomEvent"), r.initCustomEvent(t, !0, !0, i)), e.dispatchEvent(r);
|
|
450
451
|
}
|
|
451
|
-
function
|
|
452
|
+
function Ei(e) {
|
|
452
453
|
var t = e.getBoundingClientRect();
|
|
453
454
|
return {
|
|
454
455
|
left: t.left + (window.pageXOffset - document.documentElement.clientLeft),
|
|
455
456
|
top: t.top + (window.pageYOffset - document.documentElement.clientTop)
|
|
456
457
|
};
|
|
457
458
|
}
|
|
458
|
-
function
|
|
459
|
-
var t = e.rotate, i = e.scaleX,
|
|
460
|
-
|
|
461
|
-
var
|
|
459
|
+
function mt(e) {
|
|
460
|
+
var t = e.rotate, i = e.scaleX, n = e.scaleY, r = e.translateX, a = e.translateY, o = [];
|
|
461
|
+
O(r) && r !== 0 && o.push("translateX(".concat(r, "px)")), O(a) && a !== 0 && o.push("translateY(".concat(a, "px)")), O(t) && t !== 0 && o.push("rotate(".concat(t, "deg)")), O(i) && i !== 1 && o.push("scaleX(".concat(i, ")")), O(n) && n !== 1 && o.push("scaleY(".concat(n, ")"));
|
|
462
|
+
var s = o.length ? o.join(" ") : "none";
|
|
462
463
|
return {
|
|
463
|
-
WebkitTransform:
|
|
464
|
-
msTransform:
|
|
465
|
-
transform:
|
|
464
|
+
WebkitTransform: s,
|
|
465
|
+
msTransform: s,
|
|
466
|
+
transform: s
|
|
466
467
|
};
|
|
467
468
|
}
|
|
468
|
-
function
|
|
469
|
-
return
|
|
470
|
-
}
|
|
471
|
-
var
|
|
472
|
-
function
|
|
473
|
-
var
|
|
474
|
-
if (e.naturalWidth && !
|
|
475
|
-
return i(e.naturalWidth, e.naturalHeight),
|
|
476
|
-
var
|
|
477
|
-
return
|
|
478
|
-
i(
|
|
469
|
+
function Ti(e) {
|
|
470
|
+
return ot(e) ? decodeURIComponent(e.replace(/^.*\//, "").replace(/[?&#].*$/, "")) : "";
|
|
471
|
+
}
|
|
472
|
+
var St = P.navigator && /Version\/\d+(\.\d+)+?\s+Safari/i.test(P.navigator.userAgent);
|
|
473
|
+
function De(e, t, i) {
|
|
474
|
+
var n = document.createElement("img");
|
|
475
|
+
if (e.naturalWidth && !St)
|
|
476
|
+
return i(e.naturalWidth, e.naturalHeight), n;
|
|
477
|
+
var r = document.body || document.documentElement;
|
|
478
|
+
return n.onload = function() {
|
|
479
|
+
i(n.width, n.height), St || r.removeChild(n);
|
|
479
480
|
}, y(t.inheritedAttributes, function(a) {
|
|
480
|
-
var
|
|
481
|
-
|
|
482
|
-
}),
|
|
481
|
+
var o = e.getAttribute(a);
|
|
482
|
+
o !== null && n.setAttribute(a, o);
|
|
483
|
+
}), n.src = e.src, St || (n.style.cssText = "left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;", r.appendChild(n)), n;
|
|
483
484
|
}
|
|
484
|
-
function
|
|
485
|
+
function ct(e) {
|
|
485
486
|
switch (e) {
|
|
486
487
|
case 2:
|
|
487
|
-
return
|
|
488
|
+
return hi;
|
|
488
489
|
case 3:
|
|
489
|
-
return
|
|
490
|
+
return ci;
|
|
490
491
|
case 4:
|
|
491
|
-
return
|
|
492
|
+
return ui;
|
|
492
493
|
default:
|
|
493
494
|
return "";
|
|
494
495
|
}
|
|
495
496
|
}
|
|
496
|
-
function
|
|
497
|
-
var t =
|
|
498
|
-
return y(e, function(
|
|
499
|
-
delete t[
|
|
500
|
-
var
|
|
501
|
-
i.push(
|
|
497
|
+
function Oi(e) {
|
|
498
|
+
var t = kt({}, e), i = [];
|
|
499
|
+
return y(e, function(n, r) {
|
|
500
|
+
delete t[r], y(t, function(a) {
|
|
501
|
+
var o = Math.abs(n.startX - a.startX), s = Math.abs(n.startY - a.startY), c = Math.abs(n.endX - a.endX), l = Math.abs(n.endY - a.endY), u = Math.sqrt(o * o + s * s), h = Math.sqrt(c * c + l * l), m = (h - u) / u;
|
|
502
|
+
i.push(m);
|
|
502
503
|
});
|
|
503
|
-
}), i.sort(function(
|
|
504
|
-
return Math.abs(
|
|
504
|
+
}), i.sort(function(n, r) {
|
|
505
|
+
return Math.abs(n) < Math.abs(r);
|
|
505
506
|
}), i[0];
|
|
506
507
|
}
|
|
507
508
|
function ht(e, t) {
|
|
508
|
-
var i = e.pageX,
|
|
509
|
+
var i = e.pageX, n = e.pageY, r = {
|
|
509
510
|
endX: i,
|
|
510
|
-
endY:
|
|
511
|
+
endY: n
|
|
511
512
|
};
|
|
512
|
-
return t ?
|
|
513
|
+
return t ? r : kt({
|
|
513
514
|
timeStamp: Date.now(),
|
|
514
515
|
startX: i,
|
|
515
|
-
startY:
|
|
516
|
-
},
|
|
517
|
-
}
|
|
518
|
-
function
|
|
519
|
-
var t = 0, i = 0,
|
|
520
|
-
return y(e, function(
|
|
521
|
-
var a =
|
|
522
|
-
t += a, i +=
|
|
523
|
-
}), t /=
|
|
516
|
+
startY: n
|
|
517
|
+
}, r);
|
|
518
|
+
}
|
|
519
|
+
function Si(e) {
|
|
520
|
+
var t = 0, i = 0, n = 0;
|
|
521
|
+
return y(e, function(r) {
|
|
522
|
+
var a = r.startX, o = r.startY;
|
|
523
|
+
t += a, i += o, n += 1;
|
|
524
|
+
}), t /= n, i /= n, {
|
|
524
525
|
pageX: t,
|
|
525
526
|
pageY: i
|
|
526
527
|
};
|
|
527
528
|
}
|
|
528
|
-
var
|
|
529
|
+
var xi = {
|
|
529
530
|
render: function() {
|
|
530
531
|
this.initContainer(), this.initViewer(), this.initList(), this.renderViewer();
|
|
531
532
|
},
|
|
@@ -540,39 +541,39 @@ var bi = {
|
|
|
540
541
|
};
|
|
541
542
|
},
|
|
542
543
|
initViewer: function() {
|
|
543
|
-
var t = this.options, i = this.parent,
|
|
544
|
-
t.inline && (
|
|
544
|
+
var t = this.options, i = this.parent, n;
|
|
545
|
+
t.inline && (n = {
|
|
545
546
|
width: Math.max(i.offsetWidth, t.minWidth),
|
|
546
547
|
height: Math.max(i.offsetHeight, t.minHeight)
|
|
547
|
-
}, this.parentData =
|
|
548
|
+
}, this.parentData = n), (this.fulled || !n) && (n = this.containerData), this.viewerData = C({}, n);
|
|
548
549
|
},
|
|
549
550
|
renderViewer: function() {
|
|
550
|
-
this.options.inline && !this.fulled &&
|
|
551
|
+
this.options.inline && !this.fulled && L(this.viewer, this.viewerData);
|
|
551
552
|
},
|
|
552
553
|
initList: function() {
|
|
553
|
-
var t = this, i = this.element,
|
|
554
|
-
|
|
555
|
-
var
|
|
556
|
-
if (
|
|
557
|
-
var
|
|
558
|
-
y(
|
|
559
|
-
var S =
|
|
560
|
-
S !== null &&
|
|
561
|
-
}),
|
|
554
|
+
var t = this, i = this.element, n = this.options, r = this.list, a = [];
|
|
555
|
+
r.innerHTML = "", y(this.images, function(o, s) {
|
|
556
|
+
var c = o.src, l = o.alt || Ti(c), u = t.getImageURL(o);
|
|
557
|
+
if (c || u) {
|
|
558
|
+
var h = document.createElement("li"), m = document.createElement("img");
|
|
559
|
+
y(n.inheritedAttributes, function(_) {
|
|
560
|
+
var S = o.getAttribute(_);
|
|
561
|
+
S !== null && m.setAttribute(_, S);
|
|
562
|
+
}), n.navbar && (m.src = c || u), m.alt = l, m.setAttribute("data-original-url", u || c), h.setAttribute("data-index", s), h.setAttribute("data-viewer-action", "view"), h.setAttribute("role", "button"), n.keyboard && h.setAttribute("tabindex", 0), h.appendChild(m), r.appendChild(h), a.push(h);
|
|
562
563
|
}
|
|
563
|
-
}), this.items = a, y(a, function(
|
|
564
|
-
var
|
|
565
|
-
|
|
566
|
-
b(
|
|
564
|
+
}), this.items = a, y(a, function(o) {
|
|
565
|
+
var s = o.firstElementChild, c, l;
|
|
566
|
+
Ct(s, "filled", !0), n.loading && f(o, G), d(s, j, c = function(h) {
|
|
567
|
+
b(s, X, l), n.loading && g(o, G), t.loadImage(h);
|
|
567
568
|
}, {
|
|
568
569
|
once: !0
|
|
569
|
-
}), d(
|
|
570
|
-
b(
|
|
570
|
+
}), d(s, X, l = function() {
|
|
571
|
+
b(s, j, c), n.loading && g(o, G);
|
|
571
572
|
}, {
|
|
572
573
|
once: !0
|
|
573
574
|
});
|
|
574
|
-
}),
|
|
575
|
-
f(
|
|
575
|
+
}), n.transition && d(i, at, function() {
|
|
576
|
+
f(r, x);
|
|
576
577
|
}, {
|
|
577
578
|
once: !0
|
|
578
579
|
});
|
|
@@ -580,93 +581,91 @@ var bi = {
|
|
|
580
581
|
renderList: function() {
|
|
581
582
|
var t = this.index, i = this.items[t];
|
|
582
583
|
if (i) {
|
|
583
|
-
var
|
|
584
|
-
|
|
585
|
-
width:
|
|
586
|
-
},
|
|
587
|
-
translateX: (this.viewerData.width - a) / 2 -
|
|
584
|
+
var n = i.nextElementSibling, r = parseInt(window.getComputedStyle(n || i).marginLeft, 10), a = i.offsetWidth, o = a + r;
|
|
585
|
+
L(this.list, C({
|
|
586
|
+
width: o * this.length - r
|
|
587
|
+
}, mt({
|
|
588
|
+
translateX: (this.viewerData.width - a) / 2 - o * t
|
|
588
589
|
})));
|
|
589
590
|
}
|
|
590
591
|
},
|
|
591
592
|
resetList: function() {
|
|
592
593
|
var t = this.list;
|
|
593
|
-
t.innerHTML = "",
|
|
594
|
+
t.innerHTML = "", g(t, x), L(t, mt({
|
|
594
595
|
translateX: 0
|
|
595
596
|
}));
|
|
596
597
|
},
|
|
597
598
|
initImage: function(t) {
|
|
598
|
-
var i = this,
|
|
599
|
+
var i = this, n = this.options, r = this.image, a = this.viewerData, o = this.footer.offsetHeight, s = a.width, c = Math.max(a.height - o, o), l = this.imageData || {}, u;
|
|
599
600
|
this.imageInitializing = {
|
|
600
601
|
abort: function() {
|
|
601
602
|
u.onload = null;
|
|
602
603
|
}
|
|
603
|
-
}, u =
|
|
604
|
-
var
|
|
605
|
-
i.imageInitializing = !1,
|
|
606
|
-
var
|
|
607
|
-
left:
|
|
604
|
+
}, u = De(r, n, function(h, m) {
|
|
605
|
+
var _ = h / m, S = Math.max(0, Math.min(1, n.initialCoverage)), T = s, D = c;
|
|
606
|
+
i.imageInitializing = !1, c * _ > s ? D = s / _ : T = c * _, S = O(S) ? S : 0.9, T = Math.min(T * S, h), D = Math.min(D * S, m);
|
|
607
|
+
var I = (s - T) / 2, N = (c - D) / 2, E = {
|
|
608
|
+
left: I,
|
|
608
609
|
top: N,
|
|
609
|
-
x:
|
|
610
|
+
x: I,
|
|
610
611
|
y: N,
|
|
611
|
-
width:
|
|
612
|
-
height:
|
|
612
|
+
width: T,
|
|
613
|
+
height: D,
|
|
613
614
|
oldRatio: 1,
|
|
614
|
-
ratio:
|
|
615
|
-
aspectRatio:
|
|
616
|
-
naturalWidth:
|
|
617
|
-
naturalHeight:
|
|
618
|
-
}, R = C({},
|
|
619
|
-
|
|
615
|
+
ratio: T / h,
|
|
616
|
+
aspectRatio: _,
|
|
617
|
+
naturalWidth: h,
|
|
618
|
+
naturalHeight: m
|
|
619
|
+
}, R = C({}, E);
|
|
620
|
+
n.rotatable && (E.rotate = l.rotate || 0, R.rotate = 0), n.scalable && (E.scaleX = l.scaleX || 1, E.scaleY = l.scaleY || 1, R.scaleX = 1, R.scaleY = 1), i.imageData = E, i.initialImageData = R, t && t();
|
|
620
621
|
});
|
|
621
622
|
},
|
|
622
623
|
renderImage: function(t) {
|
|
623
|
-
var i = this,
|
|
624
|
-
if (
|
|
625
|
-
width:
|
|
626
|
-
height:
|
|
624
|
+
var i = this, n = this.image, r = this.imageData;
|
|
625
|
+
if (L(n, C({
|
|
626
|
+
width: r.width,
|
|
627
|
+
height: r.height,
|
|
627
628
|
// XXX: Not to use translateX/Y to avoid image shaking when zooming
|
|
628
|
-
marginLeft:
|
|
629
|
-
marginTop:
|
|
630
|
-
},
|
|
631
|
-
if ((this.viewing || this.moving || this.rotating || this.scaling || this.zooming) && this.options.transition &&
|
|
629
|
+
marginLeft: r.x,
|
|
630
|
+
marginTop: r.y
|
|
631
|
+
}, mt(r))), t)
|
|
632
|
+
if ((this.viewing || this.moving || this.rotating || this.scaling || this.zooming) && this.options.transition && U(n, x)) {
|
|
632
633
|
var a = function() {
|
|
633
634
|
i.imageRendering = !1, t();
|
|
634
635
|
};
|
|
635
636
|
this.imageRendering = {
|
|
636
637
|
abort: function() {
|
|
637
|
-
b(
|
|
638
|
+
b(n, z, a);
|
|
638
639
|
}
|
|
639
|
-
}, d(
|
|
640
|
+
}, d(n, z, a, {
|
|
640
641
|
once: !0
|
|
641
642
|
});
|
|
642
643
|
} else
|
|
643
644
|
t();
|
|
644
645
|
},
|
|
645
646
|
resetImage: function() {
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
this.viewing && this.viewing.abort(), t.parentNode.removeChild(t), this.image = null;
|
|
649
|
-
}
|
|
647
|
+
var t = this.image;
|
|
648
|
+
t && (this.viewing && this.viewing.abort(), t.parentNode.removeChild(t), this.image = null, this.title.innerHTML = "");
|
|
650
649
|
}
|
|
651
|
-
},
|
|
650
|
+
}, _i = {
|
|
652
651
|
bind: function() {
|
|
653
|
-
var t = this.options, i = this.viewer,
|
|
654
|
-
d(i,
|
|
652
|
+
var t = this.options, i = this.viewer, n = this.canvas, r = this.element.ownerDocument;
|
|
653
|
+
d(i, Q, this.onClick = this.click.bind(this)), d(i, Ut, this.onDragStart = this.dragstart.bind(this)), d(n, $t, this.onPointerDown = this.pointerdown.bind(this)), d(r, Kt, this.onPointerMove = this.pointermove.bind(this)), d(r, Gt, this.onPointerUp = this.pointerup.bind(this)), d(r, Zt, this.onKeyDown = this.keydown.bind(this)), d(window, Qt, this.onResize = this.resize.bind(this)), t.zoomable && t.zoomOnWheel && d(i, Jt, this.onWheel = this.wheel.bind(this), {
|
|
655
654
|
passive: !1,
|
|
656
655
|
capture: !0
|
|
657
|
-
}), t.toggleOnDblclick && d(
|
|
656
|
+
}), t.toggleOnDblclick && d(n, Nt, this.onDblclick = this.dblclick.bind(this));
|
|
658
657
|
},
|
|
659
658
|
unbind: function() {
|
|
660
|
-
var t = this.options, i = this.viewer,
|
|
661
|
-
b(i,
|
|
659
|
+
var t = this.options, i = this.viewer, n = this.canvas, r = this.element.ownerDocument;
|
|
660
|
+
b(i, Q, this.onClick), b(i, Ut, this.onDragStart), b(n, $t, this.onPointerDown), b(r, Kt, this.onPointerMove), b(r, Gt, this.onPointerUp), b(r, Zt, this.onKeyDown), b(window, Qt, this.onResize), t.zoomable && t.zoomOnWheel && b(i, Jt, this.onWheel, {
|
|
662
661
|
passive: !1,
|
|
663
662
|
capture: !0
|
|
664
|
-
}), t.toggleOnDblclick && b(
|
|
663
|
+
}), t.toggleOnDblclick && b(n, Nt, this.onDblclick);
|
|
665
664
|
}
|
|
666
|
-
},
|
|
665
|
+
}, Ai = {
|
|
667
666
|
click: function(t) {
|
|
668
|
-
var i = this.options,
|
|
669
|
-
switch (!a &&
|
|
667
|
+
var i = this.options, n = this.imageData, r = t.target, a = $(r, gt);
|
|
668
|
+
switch (!a && r.localName === "img" && r.parentElement.localName === "li" && (r = r.parentElement, a = $(r, gt)), K && t.isTrusted && r === this.canvas && clearTimeout(this.clickCanvasTimeout), a) {
|
|
670
669
|
case "mix":
|
|
671
670
|
this.played ? this.stop() : i.inline ? this.fulled ? this.exit() : this.full() : this.hide();
|
|
672
671
|
break;
|
|
@@ -674,7 +673,7 @@ var bi = {
|
|
|
674
673
|
this.pointerMoved || this.hide();
|
|
675
674
|
break;
|
|
676
675
|
case "view":
|
|
677
|
-
this.view(
|
|
676
|
+
this.view($(r, "index"));
|
|
678
677
|
break;
|
|
679
678
|
case "zoom-in":
|
|
680
679
|
this.zoom(0.1, !0);
|
|
@@ -704,30 +703,30 @@ var bi = {
|
|
|
704
703
|
this.rotate(90);
|
|
705
704
|
break;
|
|
706
705
|
case "flip-horizontal":
|
|
707
|
-
this.scaleX(-
|
|
706
|
+
this.scaleX(-n.scaleX || -1);
|
|
708
707
|
break;
|
|
709
708
|
case "flip-vertical":
|
|
710
|
-
this.scaleY(-
|
|
709
|
+
this.scaleY(-n.scaleY || -1);
|
|
711
710
|
break;
|
|
712
711
|
default:
|
|
713
712
|
this.played && this.stop();
|
|
714
713
|
}
|
|
715
714
|
},
|
|
716
715
|
dblclick: function(t) {
|
|
717
|
-
t.preventDefault(), this.viewed && t.target === this.image && (
|
|
716
|
+
t.preventDefault(), this.viewed && t.target === this.image && (K && t.isTrusted && clearTimeout(this.doubleClickImageTimeout), this.toggle(t.isTrusted ? t : t.detail && t.detail.originalEvent));
|
|
718
717
|
},
|
|
719
718
|
load: function() {
|
|
720
719
|
var t = this;
|
|
721
720
|
this.timeout && (clearTimeout(this.timeout), this.timeout = !1);
|
|
722
|
-
var i = this.element,
|
|
723
|
-
|
|
724
|
-
st(
|
|
725
|
-
t.viewed = !0, t.viewing = !1, p(
|
|
721
|
+
var i = this.element, n = this.options, r = this.image, a = this.index, o = this.viewerData;
|
|
722
|
+
g(r, nt), n.loading && g(this.canvas, G), r.style.cssText = "height:0;" + "margin-left:".concat(o.width / 2, "px;") + "margin-top:".concat(o.height / 2, "px;") + "max-width:none!important;position:relative;width:0;", this.initImage(function() {
|
|
723
|
+
st(r, fi, n.movable), st(r, x, n.transition), t.renderImage(function() {
|
|
724
|
+
t.viewed = !0, t.viewing = !1, p(n.viewed) && d(i, at, n.viewed, {
|
|
726
725
|
once: !0
|
|
727
|
-
}), A(i,
|
|
726
|
+
}), A(i, at, {
|
|
728
727
|
originalImage: t.images[a],
|
|
729
728
|
index: a,
|
|
730
|
-
image:
|
|
729
|
+
image: r
|
|
731
730
|
}, {
|
|
732
731
|
cancelable: !1
|
|
733
732
|
});
|
|
@@ -735,29 +734,29 @@ var bi = {
|
|
|
735
734
|
});
|
|
736
735
|
},
|
|
737
736
|
loadImage: function(t) {
|
|
738
|
-
var i = t.target,
|
|
739
|
-
|
|
740
|
-
var
|
|
741
|
-
a *
|
|
737
|
+
var i = t.target, n = i.parentNode, r = n.offsetWidth || 30, a = n.offsetHeight || 50, o = !!$(i, "filled");
|
|
738
|
+
De(i, this.options, function(s, c) {
|
|
739
|
+
var l = s / c, u = r, h = a;
|
|
740
|
+
a * l > r ? o ? u = a * l : h = r / l : o ? h = r / l : u = a * l, L(i, C({
|
|
742
741
|
width: u,
|
|
743
|
-
height:
|
|
744
|
-
},
|
|
745
|
-
translateX: (
|
|
746
|
-
translateY: (a -
|
|
742
|
+
height: h
|
|
743
|
+
}, mt({
|
|
744
|
+
translateX: (r - u) / 2,
|
|
745
|
+
translateY: (a - h) / 2
|
|
747
746
|
})));
|
|
748
747
|
});
|
|
749
748
|
},
|
|
750
749
|
keydown: function(t) {
|
|
751
750
|
var i = this.options;
|
|
752
751
|
if (i.keyboard) {
|
|
753
|
-
var
|
|
754
|
-
switch (
|
|
752
|
+
var n = t.keyCode || t.which || t.charCode;
|
|
753
|
+
switch (n) {
|
|
755
754
|
case 13:
|
|
756
755
|
this.viewer.contains(t.target) && this.click(t);
|
|
757
756
|
break;
|
|
758
757
|
}
|
|
759
758
|
if (this.fulled)
|
|
760
|
-
switch (
|
|
759
|
+
switch (n) {
|
|
761
760
|
case 27:
|
|
762
761
|
this.played ? this.stop() : i.inline ? this.fulled && this.exit() : this.hide();
|
|
763
762
|
break;
|
|
@@ -787,34 +786,34 @@ var bi = {
|
|
|
787
786
|
t.target.localName === "img" && t.preventDefault();
|
|
788
787
|
},
|
|
789
788
|
pointerdown: function(t) {
|
|
790
|
-
var i = this.options,
|
|
789
|
+
var i = this.options, n = this.pointers, r = t.buttons, a = t.button;
|
|
791
790
|
if (this.pointerMoved = !1, !(!this.viewed || this.showing || this.viewing || this.hiding || (t.type === "mousedown" || t.type === "pointerdown" && t.pointerType === "mouse") && // No primary button (Usually the left button)
|
|
792
|
-
(
|
|
793
|
-
t.preventDefault(), t.changedTouches ? y(t.changedTouches, function(
|
|
794
|
-
|
|
795
|
-
}) :
|
|
796
|
-
var
|
|
797
|
-
i.zoomOnTouch && i.zoomable && Object.keys(
|
|
791
|
+
(O(r) && r !== 1 || O(a) && a !== 0 || t.ctrlKey))) {
|
|
792
|
+
t.preventDefault(), t.changedTouches ? y(t.changedTouches, function(s) {
|
|
793
|
+
n[s.identifier] = ht(s);
|
|
794
|
+
}) : n[t.pointerId || 0] = ht(t);
|
|
795
|
+
var o = i.movable ? dt : !1;
|
|
796
|
+
i.zoomOnTouch && i.zoomable && Object.keys(n).length > 1 ? o = it : i.slideOnTouch && (t.pointerType === "touch" || t.type === "touchstart") && this.isSwitchable() && (o = _e), i.transition && (o === dt || o === it) && g(this.image, x), this.action = o;
|
|
798
797
|
}
|
|
799
798
|
},
|
|
800
799
|
pointermove: function(t) {
|
|
801
|
-
var i = this.pointers,
|
|
802
|
-
!this.viewed || !
|
|
803
|
-
C(i[
|
|
800
|
+
var i = this.pointers, n = this.action;
|
|
801
|
+
!this.viewed || !n || (t.preventDefault(), t.changedTouches ? y(t.changedTouches, function(r) {
|
|
802
|
+
C(i[r.identifier] || {}, ht(r, !0));
|
|
804
803
|
}) : C(i[t.pointerId || 0] || {}, ht(t, !0)), this.change(t));
|
|
805
804
|
},
|
|
806
805
|
pointerup: function(t) {
|
|
807
|
-
var i = this,
|
|
808
|
-
t.changedTouches ? y(t.changedTouches, function(
|
|
809
|
-
|
|
810
|
-
}) : (
|
|
811
|
-
A(i.image,
|
|
806
|
+
var i = this, n = this.options, r = this.action, a = this.pointers, o;
|
|
807
|
+
t.changedTouches ? y(t.changedTouches, function(s) {
|
|
808
|
+
o = a[s.identifier], delete a[s.identifier];
|
|
809
|
+
}) : (o = a[t.pointerId || 0], delete a[t.pointerId || 0]), r && (t.preventDefault(), n.transition && (r === dt || r === it) && f(this.image, x), this.action = !1, K && r !== it && o && Date.now() - o.timeStamp < 500 && (clearTimeout(this.clickCanvasTimeout), clearTimeout(this.doubleClickImageTimeout), n.toggleOnDblclick && this.viewed && t.target === this.image ? this.imageClicked ? (this.imageClicked = !1, this.doubleClickImageTimeout = setTimeout(function() {
|
|
810
|
+
A(i.image, Nt, {
|
|
812
811
|
originalEvent: t
|
|
813
812
|
});
|
|
814
813
|
}, 50)) : (this.imageClicked = !0, this.doubleClickImageTimeout = setTimeout(function() {
|
|
815
814
|
i.imageClicked = !1;
|
|
816
|
-
}, 500)) : (this.imageClicked = !1,
|
|
817
|
-
A(i.canvas,
|
|
815
|
+
}, 500)) : (this.imageClicked = !1, n.backdrop && n.backdrop !== "static" && t.target === this.canvas && (this.clickCanvasTimeout = setTimeout(function() {
|
|
816
|
+
A(i.canvas, Q, {
|
|
818
817
|
originalEvent: t
|
|
819
818
|
});
|
|
820
819
|
}, 50)))));
|
|
@@ -829,9 +828,9 @@ var bi = {
|
|
|
829
828
|
return;
|
|
830
829
|
}
|
|
831
830
|
y(this.player.getElementsByTagName("img"), function(i) {
|
|
832
|
-
d(i,
|
|
831
|
+
d(i, j, t.loadImage.bind(t), {
|
|
833
832
|
once: !0
|
|
834
|
-
}), A(i,
|
|
833
|
+
}), A(i, j);
|
|
835
834
|
});
|
|
836
835
|
}
|
|
837
836
|
},
|
|
@@ -841,38 +840,38 @@ var bi = {
|
|
|
841
840
|
this.wheeling = !0, setTimeout(function() {
|
|
842
841
|
i.wheeling = !1;
|
|
843
842
|
}, 50);
|
|
844
|
-
var
|
|
845
|
-
t.deltaY ?
|
|
843
|
+
var n = Number(this.options.zoomRatio) || 0.1, r = 1;
|
|
844
|
+
t.deltaY ? r = t.deltaY > 0 ? 1 : -1 : t.wheelDelta ? r = -t.wheelDelta / 120 : t.detail && (r = t.detail > 0 ? 1 : -1), this.zoom(-r * n, !0, null, t);
|
|
846
845
|
}
|
|
847
846
|
}
|
|
848
|
-
},
|
|
847
|
+
}, Di = {
|
|
849
848
|
/** Show the viewer (only available in modal mode)
|
|
850
849
|
* @param {boolean} [immediate=false] - Indicates if show the viewer immediately or not.
|
|
851
850
|
* @returns {Viewer} this
|
|
852
851
|
*/
|
|
853
852
|
show: function() {
|
|
854
|
-
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, i = this.element,
|
|
855
|
-
if (
|
|
853
|
+
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, i = this.element, n = this.options;
|
|
854
|
+
if (n.inline || this.showing || this.isShown || this.showing)
|
|
856
855
|
return this;
|
|
857
856
|
if (!this.ready)
|
|
858
857
|
return this.build(), this.ready && this.show(t), this;
|
|
859
|
-
if (p(
|
|
858
|
+
if (p(n.show) && d(i, ee, n.show, {
|
|
860
859
|
once: !0
|
|
861
|
-
}), A(i,
|
|
860
|
+
}), A(i, ee) === !1 || !this.ready)
|
|
862
861
|
return this;
|
|
863
862
|
this.hiding && this.transitioning.abort(), this.showing = !0, this.open();
|
|
864
|
-
var
|
|
865
|
-
if (
|
|
863
|
+
var r = this.viewer;
|
|
864
|
+
if (g(r, W), r.setAttribute("role", "dialog"), r.setAttribute("aria-labelledby", this.title.id), r.setAttribute("aria-modal", !0), r.removeAttribute("aria-hidden"), n.transition && !t) {
|
|
866
865
|
var a = this.shown.bind(this);
|
|
867
866
|
this.transitioning = {
|
|
868
867
|
abort: function() {
|
|
869
|
-
b(
|
|
868
|
+
b(r, z, a), g(r, k);
|
|
870
869
|
}
|
|
871
|
-
}, f(
|
|
870
|
+
}, f(r, x), r.initialOffsetWidth = r.offsetWidth, d(r, z, a, {
|
|
872
871
|
once: !0
|
|
873
|
-
}), f(
|
|
872
|
+
}), f(r, k);
|
|
874
873
|
} else
|
|
875
|
-
f(
|
|
874
|
+
f(r, k), this.shown();
|
|
876
875
|
return this;
|
|
877
876
|
},
|
|
878
877
|
/**
|
|
@@ -881,32 +880,32 @@ var bi = {
|
|
|
881
880
|
* @returns {Viewer} this
|
|
882
881
|
*/
|
|
883
882
|
hide: function() {
|
|
884
|
-
var t = this, i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1,
|
|
885
|
-
if (
|
|
883
|
+
var t = this, i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, n = this.element, r = this.options;
|
|
884
|
+
if (r.inline || this.hiding || !(this.isShown || this.showing))
|
|
886
885
|
return this;
|
|
887
|
-
if (p(
|
|
886
|
+
if (p(r.hide) && d(n, ne, r.hide, {
|
|
888
887
|
once: !0
|
|
889
|
-
}), A(
|
|
888
|
+
}), A(n, ne) === !1)
|
|
890
889
|
return this;
|
|
891
890
|
this.showing && this.transitioning.abort(), this.hiding = !0, this.played ? this.stop() : this.viewing && this.viewing.abort();
|
|
892
|
-
var a = this.viewer,
|
|
893
|
-
|
|
891
|
+
var a = this.viewer, o = this.image, s = function() {
|
|
892
|
+
g(a, k), t.hidden();
|
|
894
893
|
};
|
|
895
|
-
if (
|
|
896
|
-
var
|
|
897
|
-
|
|
898
|
-
},
|
|
899
|
-
|
|
894
|
+
if (r.transition && !i) {
|
|
895
|
+
var c = function u(h) {
|
|
896
|
+
h && h.target === a && (b(a, z, u), t.hidden());
|
|
897
|
+
}, l = function() {
|
|
898
|
+
U(a, x) ? (d(a, z, c), g(a, k)) : s();
|
|
900
899
|
};
|
|
901
900
|
this.transitioning = {
|
|
902
901
|
abort: function() {
|
|
903
|
-
t.viewed &&
|
|
902
|
+
t.viewed && U(o, x) ? b(o, z, l) : U(a, x) && b(a, z, c);
|
|
904
903
|
}
|
|
905
|
-
}, this.viewed &&
|
|
904
|
+
}, this.viewed && U(o, x) ? (d(o, z, l, {
|
|
906
905
|
once: !0
|
|
907
|
-
}), this.zoomTo(0, !1, null, null, !0)) :
|
|
906
|
+
}), this.zoomTo(0, !1, null, null, !0)) : l();
|
|
908
907
|
} else
|
|
909
|
-
|
|
908
|
+
s();
|
|
910
909
|
return this;
|
|
911
910
|
},
|
|
912
911
|
/**
|
|
@@ -921,40 +920,40 @@ var bi = {
|
|
|
921
920
|
if (!this.isShown)
|
|
922
921
|
return this.index = i, this.show();
|
|
923
922
|
this.viewing && this.viewing.abort();
|
|
924
|
-
var
|
|
925
|
-
if (y(
|
|
926
|
-
var
|
|
927
|
-
|
|
928
|
-
}),
|
|
923
|
+
var n = this.element, r = this.options, a = this.title, o = this.canvas, s = this.items[i], c = s.querySelector("img"), l = $(c, "originalUrl"), u = c.getAttribute("alt"), h = document.createElement("img");
|
|
924
|
+
if (y(r.inheritedAttributes, function(D) {
|
|
925
|
+
var I = c.getAttribute(D);
|
|
926
|
+
I !== null && h.setAttribute(D, I);
|
|
927
|
+
}), h.src = l, h.alt = u, p(r.view) && d(n, ae, r.view, {
|
|
929
928
|
once: !0
|
|
930
|
-
}), A(
|
|
929
|
+
}), A(n, ae, {
|
|
931
930
|
originalImage: this.images[i],
|
|
932
931
|
index: i,
|
|
933
|
-
image:
|
|
932
|
+
image: h
|
|
934
933
|
}) === !1 || !this.isShown || this.hiding || this.played)
|
|
935
934
|
return this;
|
|
936
|
-
var
|
|
937
|
-
|
|
938
|
-
var
|
|
939
|
-
var
|
|
940
|
-
a.innerHTML =
|
|
941
|
-
}, S,
|
|
942
|
-
return d(
|
|
935
|
+
var m = this.items[this.index];
|
|
936
|
+
m && (g(m, lt), m.removeAttribute("aria-selected")), f(s, lt), s.setAttribute("aria-selected", !0), r.focus && s.focus(), this.image = h, this.viewed = !1, this.index = i, this.imageData = {}, f(h, nt), r.loading && f(o, G), o.innerHTML = "", o.appendChild(h), this.renderList(), a.innerHTML = "";
|
|
937
|
+
var _ = function() {
|
|
938
|
+
var I = t.imageData, N = Array.isArray(r.title) ? r.title[1] : r.title;
|
|
939
|
+
a.innerHTML = yi(p(N) ? N.call(t, h, I) : "".concat(u, " (").concat(I.naturalWidth, " × ").concat(I.naturalHeight, ")"));
|
|
940
|
+
}, S, T;
|
|
941
|
+
return d(n, at, _, {
|
|
943
942
|
once: !0
|
|
944
943
|
}), this.viewing = {
|
|
945
944
|
abort: function() {
|
|
946
|
-
b(
|
|
945
|
+
b(n, at, _), h.complete ? t.imageRendering ? t.imageRendering.abort() : t.imageInitializing && t.imageInitializing.abort() : (h.src = "", b(h, j, S), t.timeout && clearTimeout(t.timeout));
|
|
947
946
|
}
|
|
948
|
-
},
|
|
949
|
-
b(
|
|
947
|
+
}, h.complete ? this.load() : (d(h, j, S = function() {
|
|
948
|
+
b(h, X, T), t.load();
|
|
950
949
|
}, {
|
|
951
950
|
once: !0
|
|
952
|
-
}), d(
|
|
953
|
-
b(
|
|
951
|
+
}), d(h, X, T = function() {
|
|
952
|
+
b(h, j, S), t.timeout && (clearTimeout(t.timeout), t.timeout = !1), g(h, nt), r.loading && g(t.canvas, G);
|
|
954
953
|
}, {
|
|
955
954
|
once: !0
|
|
956
955
|
}), this.timeout && clearTimeout(this.timeout), this.timeout = setTimeout(function() {
|
|
957
|
-
|
|
956
|
+
g(h, nt), t.timeout = !1;
|
|
958
957
|
}, 1e3)), this;
|
|
959
958
|
},
|
|
960
959
|
/**
|
|
@@ -974,8 +973,8 @@ var bi = {
|
|
|
974
973
|
* @returns {Viewer} this
|
|
975
974
|
*/
|
|
976
975
|
next: function() {
|
|
977
|
-
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, i = this.length - 1,
|
|
978
|
-
return
|
|
976
|
+
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, i = this.length - 1, n = this.index + 1;
|
|
977
|
+
return n > i && (n = t ? 0 : i), this.view(n), this;
|
|
979
978
|
},
|
|
980
979
|
/**
|
|
981
980
|
* Move the image with relative offsets.
|
|
@@ -984,8 +983,8 @@ var bi = {
|
|
|
984
983
|
* @returns {Viewer} this
|
|
985
984
|
*/
|
|
986
985
|
move: function(t) {
|
|
987
|
-
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : t,
|
|
988
|
-
return this.moveTo(
|
|
986
|
+
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : t, n = this.imageData;
|
|
987
|
+
return this.moveTo(B(t) ? t : n.x + Number(t), B(i) ? i : n.y + Number(i)), this;
|
|
989
988
|
},
|
|
990
989
|
/**
|
|
991
990
|
* Move the image to an absolute point.
|
|
@@ -995,29 +994,29 @@ var bi = {
|
|
|
995
994
|
* @returns {Viewer} this
|
|
996
995
|
*/
|
|
997
996
|
moveTo: function(t) {
|
|
998
|
-
var i = this,
|
|
999
|
-
if (t = Number(t),
|
|
1000
|
-
var
|
|
1001
|
-
if (
|
|
1002
|
-
if (p(
|
|
997
|
+
var i = this, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : t, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null, a = this.element, o = this.options, s = this.imageData;
|
|
998
|
+
if (t = Number(t), n = Number(n), this.viewed && !this.played && o.movable) {
|
|
999
|
+
var c = s.x, l = s.y, u = !1;
|
|
1000
|
+
if (O(t) ? u = !0 : t = c, O(n) ? u = !0 : n = l, u) {
|
|
1001
|
+
if (p(o.move) && d(a, oe, o.move, {
|
|
1003
1002
|
once: !0
|
|
1004
|
-
}), A(a,
|
|
1003
|
+
}), A(a, oe, {
|
|
1005
1004
|
x: t,
|
|
1006
|
-
y:
|
|
1007
|
-
oldX:
|
|
1008
|
-
oldY:
|
|
1009
|
-
originalEvent:
|
|
1005
|
+
y: n,
|
|
1006
|
+
oldX: c,
|
|
1007
|
+
oldY: l,
|
|
1008
|
+
originalEvent: r
|
|
1010
1009
|
}) === !1)
|
|
1011
1010
|
return this;
|
|
1012
|
-
|
|
1013
|
-
i.moving = !1, p(
|
|
1011
|
+
s.x = t, s.y = n, s.left = t, s.top = n, this.moving = !0, this.renderImage(function() {
|
|
1012
|
+
i.moving = !1, p(o.moved) && d(a, se, o.moved, {
|
|
1014
1013
|
once: !0
|
|
1015
|
-
}), A(a,
|
|
1014
|
+
}), A(a, se, {
|
|
1016
1015
|
x: t,
|
|
1017
|
-
y:
|
|
1018
|
-
oldX:
|
|
1019
|
-
oldY:
|
|
1020
|
-
originalEvent:
|
|
1016
|
+
y: n,
|
|
1017
|
+
oldX: c,
|
|
1018
|
+
oldY: l,
|
|
1019
|
+
originalEvent: r
|
|
1021
1020
|
}, {
|
|
1022
1021
|
cancelable: !1
|
|
1023
1022
|
});
|
|
@@ -1040,22 +1039,22 @@ var bi = {
|
|
|
1040
1039
|
* @returns {Viewer} this
|
|
1041
1040
|
*/
|
|
1042
1041
|
rotateTo: function(t) {
|
|
1043
|
-
var i = this,
|
|
1044
|
-
if (t = Number(t),
|
|
1045
|
-
var
|
|
1046
|
-
if (p(
|
|
1042
|
+
var i = this, n = this.element, r = this.options, a = this.imageData;
|
|
1043
|
+
if (t = Number(t), O(t) && this.viewed && !this.played && r.rotatable) {
|
|
1044
|
+
var o = a.rotate;
|
|
1045
|
+
if (p(r.rotate) && d(n, le, r.rotate, {
|
|
1047
1046
|
once: !0
|
|
1048
|
-
}), A(
|
|
1047
|
+
}), A(n, le, {
|
|
1049
1048
|
degree: t,
|
|
1050
|
-
oldDegree:
|
|
1049
|
+
oldDegree: o
|
|
1051
1050
|
}) === !1)
|
|
1052
1051
|
return this;
|
|
1053
1052
|
a.rotate = t, this.rotating = !0, this.renderImage(function() {
|
|
1054
|
-
i.rotating = !1, p(
|
|
1053
|
+
i.rotating = !1, p(r.rotated) && d(n, ue, r.rotated, {
|
|
1055
1054
|
once: !0
|
|
1056
|
-
}), A(
|
|
1055
|
+
}), A(n, ue, {
|
|
1057
1056
|
degree: t,
|
|
1058
|
-
oldDegree:
|
|
1057
|
+
oldDegree: o
|
|
1059
1058
|
}, {
|
|
1060
1059
|
cancelable: !1
|
|
1061
1060
|
});
|
|
@@ -1086,27 +1085,27 @@ var bi = {
|
|
|
1086
1085
|
* @returns {Viewer} this
|
|
1087
1086
|
*/
|
|
1088
1087
|
scale: function(t) {
|
|
1089
|
-
var i = this,
|
|
1090
|
-
if (t = Number(t),
|
|
1091
|
-
var
|
|
1092
|
-
if (
|
|
1093
|
-
if (p(a.scale) && d(
|
|
1088
|
+
var i = this, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : t, r = this.element, a = this.options, o = this.imageData;
|
|
1089
|
+
if (t = Number(t), n = Number(n), this.viewed && !this.played && a.scalable) {
|
|
1090
|
+
var s = o.scaleX, c = o.scaleY, l = !1;
|
|
1091
|
+
if (O(t) ? l = !0 : t = s, O(n) ? l = !0 : n = c, l) {
|
|
1092
|
+
if (p(a.scale) && d(r, ce, a.scale, {
|
|
1094
1093
|
once: !0
|
|
1095
|
-
}), A(
|
|
1094
|
+
}), A(r, ce, {
|
|
1096
1095
|
scaleX: t,
|
|
1097
|
-
scaleY:
|
|
1098
|
-
oldScaleX:
|
|
1099
|
-
oldScaleY:
|
|
1096
|
+
scaleY: n,
|
|
1097
|
+
oldScaleX: s,
|
|
1098
|
+
oldScaleY: c
|
|
1100
1099
|
}) === !1)
|
|
1101
1100
|
return this;
|
|
1102
|
-
|
|
1103
|
-
i.scaling = !1, p(a.scaled) && d(
|
|
1101
|
+
o.scaleX = t, o.scaleY = n, this.scaling = !0, this.renderImage(function() {
|
|
1102
|
+
i.scaling = !1, p(a.scaled) && d(r, he, a.scaled, {
|
|
1104
1103
|
once: !0
|
|
1105
|
-
}), A(
|
|
1104
|
+
}), A(r, he, {
|
|
1106
1105
|
scaleX: t,
|
|
1107
|
-
scaleY:
|
|
1108
|
-
oldScaleX:
|
|
1109
|
-
oldScaleY:
|
|
1106
|
+
scaleY: n,
|
|
1107
|
+
oldScaleX: s,
|
|
1108
|
+
oldScaleY: c
|
|
1110
1109
|
}, {
|
|
1111
1110
|
cancelable: !1
|
|
1112
1111
|
});
|
|
@@ -1124,8 +1123,8 @@ var bi = {
|
|
|
1124
1123
|
* @returns {Viewer} this
|
|
1125
1124
|
*/
|
|
1126
1125
|
zoom: function(t) {
|
|
1127
|
-
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1,
|
|
1128
|
-
return t = Number(t), t < 0 ? t = 1 / (1 - t) : t = 1 + t, this.zoomTo(a.width * t / a.naturalWidth, i,
|
|
1126
|
+
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null, r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null, a = this.imageData;
|
|
1127
|
+
return t = Number(t), t < 0 ? t = 1 / (1 - t) : t = 1 + t, this.zoomTo(a.width * t / a.naturalWidth, i, n, r), this;
|
|
1129
1128
|
},
|
|
1130
1129
|
/**
|
|
1131
1130
|
* Zoom the image to an absolute ratio.
|
|
@@ -1137,16 +1136,16 @@ var bi = {
|
|
|
1137
1136
|
* @returns {Viewer} this
|
|
1138
1137
|
*/
|
|
1139
1138
|
zoomTo: function(t) {
|
|
1140
|
-
var i = this,
|
|
1141
|
-
if (t = Math.max(0, t),
|
|
1142
|
-
if (!
|
|
1143
|
-
var
|
|
1144
|
-
t = Math.min(Math.max(t,
|
|
1139
|
+
var i = this, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null, a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null, o = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !1, s = this.element, c = this.options, l = this.pointers, u = this.imageData, h = u.x, m = u.y, _ = u.width, S = u.height, T = u.naturalWidth, D = u.naturalHeight;
|
|
1140
|
+
if (t = Math.max(0, t), O(t) && this.viewed && !this.played && (o || c.zoomable)) {
|
|
1141
|
+
if (!o) {
|
|
1142
|
+
var I = Math.max(0.01, c.minZoomRatio), N = Math.min(100, c.maxZoomRatio);
|
|
1143
|
+
t = Math.min(Math.max(t, I), N);
|
|
1145
1144
|
}
|
|
1146
1145
|
if (a)
|
|
1147
1146
|
switch (a.type) {
|
|
1148
1147
|
case "wheel":
|
|
1149
|
-
|
|
1148
|
+
c.zoomRatio >= 0.055 && t > 0.95 && t < 1.05 && (t = 1);
|
|
1150
1149
|
break;
|
|
1151
1150
|
case "pointermove":
|
|
1152
1151
|
case "touchmove":
|
|
@@ -1154,34 +1153,34 @@ var bi = {
|
|
|
1154
1153
|
t > 0.99 && t < 1.01 && (t = 1);
|
|
1155
1154
|
break;
|
|
1156
1155
|
}
|
|
1157
|
-
var
|
|
1158
|
-
if (p(
|
|
1156
|
+
var E = T * t, R = D * t, M = E - _, V = R - S, Y = u.ratio;
|
|
1157
|
+
if (p(c.zoom) && d(s, fe, c.zoom, {
|
|
1159
1158
|
once: !0
|
|
1160
|
-
}), A(
|
|
1159
|
+
}), A(s, fe, {
|
|
1161
1160
|
ratio: t,
|
|
1162
|
-
oldRatio:
|
|
1161
|
+
oldRatio: Y,
|
|
1163
1162
|
originalEvent: a
|
|
1164
1163
|
}) === !1)
|
|
1165
1164
|
return this;
|
|
1166
1165
|
if (this.zooming = !0, a) {
|
|
1167
|
-
var tt =
|
|
1166
|
+
var tt = Ei(this.viewer), H = l && Object.keys(l).length > 0 ? Si(l) : {
|
|
1168
1167
|
pageX: a.pageX,
|
|
1169
1168
|
pageY: a.pageY
|
|
1170
1169
|
};
|
|
1171
|
-
u.x -=
|
|
1170
|
+
u.x -= M * ((H.pageX - tt.left - h) / _), u.y -= V * ((H.pageY - tt.top - m) / S);
|
|
1172
1171
|
} else
|
|
1173
|
-
|
|
1174
|
-
u.left = u.x, u.top = u.y, u.width =
|
|
1175
|
-
i.zooming = !1, p(
|
|
1172
|
+
Z(r) && O(r.x) && O(r.y) ? (u.x -= M * ((r.x - h) / _), u.y -= V * ((r.y - m) / S)) : (u.x -= M / 2, u.y -= V / 2);
|
|
1173
|
+
u.left = u.x, u.top = u.y, u.width = E, u.height = R, u.oldRatio = Y, u.ratio = t, this.renderImage(function() {
|
|
1174
|
+
i.zooming = !1, p(c.zoomed) && d(s, de, c.zoomed, {
|
|
1176
1175
|
once: !0
|
|
1177
|
-
}), A(
|
|
1176
|
+
}), A(s, de, {
|
|
1178
1177
|
ratio: t,
|
|
1179
|
-
oldRatio:
|
|
1178
|
+
oldRatio: Y,
|
|
1180
1179
|
originalEvent: a
|
|
1181
1180
|
}, {
|
|
1182
1181
|
cancelable: !1
|
|
1183
1182
|
});
|
|
1184
|
-
}),
|
|
1183
|
+
}), n && this.tooltip();
|
|
1185
1184
|
}
|
|
1186
1185
|
return this;
|
|
1187
1186
|
},
|
|
@@ -1194,27 +1193,27 @@ var bi = {
|
|
|
1194
1193
|
var t = this, i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
|
|
1195
1194
|
if (!this.isShown || this.played)
|
|
1196
1195
|
return this;
|
|
1197
|
-
var
|
|
1198
|
-
if (p(
|
|
1196
|
+
var n = this.element, r = this.options;
|
|
1197
|
+
if (p(r.play) && d(n, ve, r.play, {
|
|
1199
1198
|
once: !0
|
|
1200
|
-
}), A(
|
|
1199
|
+
}), A(n, ve) === !1)
|
|
1201
1200
|
return this;
|
|
1202
|
-
var a = this.player,
|
|
1203
|
-
if (this.played = !0, this.onLoadWhenPlay =
|
|
1204
|
-
var S =
|
|
1205
|
-
|
|
1201
|
+
var a = this.player, o = this.loadImage.bind(this), s = [], c = 0, l = 0;
|
|
1202
|
+
if (this.played = !0, this.onLoadWhenPlay = o, i && this.requestFullscreen(i), f(a, q), y(this.items, function(m, _) {
|
|
1203
|
+
var S = m.querySelector("img"), T = document.createElement("img");
|
|
1204
|
+
T.src = $(S, "originalUrl"), T.alt = S.getAttribute("alt"), T.referrerPolicy = S.referrerPolicy, c += 1, f(T, vt), st(T, x, r.transition), U(m, lt) && (f(T, k), l = _), s.push(T), d(T, j, o, {
|
|
1206
1205
|
once: !0
|
|
1207
|
-
}), a.appendChild(
|
|
1208
|
-
}),
|
|
1209
|
-
var u = function
|
|
1210
|
-
clearTimeout(t.playing.timeout),
|
|
1211
|
-
},
|
|
1212
|
-
clearTimeout(t.playing.timeout),
|
|
1206
|
+
}), a.appendChild(T);
|
|
1207
|
+
}), O(r.interval) && r.interval > 0) {
|
|
1208
|
+
var u = function m() {
|
|
1209
|
+
clearTimeout(t.playing.timeout), g(s[l], k), l -= 1, l = l >= 0 ? l : c - 1, f(s[l], k), t.playing.timeout = setTimeout(m, r.interval);
|
|
1210
|
+
}, h = function m() {
|
|
1211
|
+
clearTimeout(t.playing.timeout), g(s[l], k), l += 1, l = l < c ? l : 0, f(s[l], k), t.playing.timeout = setTimeout(m, r.interval);
|
|
1213
1212
|
};
|
|
1214
|
-
|
|
1213
|
+
c > 1 && (this.playing = {
|
|
1215
1214
|
prev: u,
|
|
1216
|
-
next:
|
|
1217
|
-
timeout: setTimeout(
|
|
1215
|
+
next: h,
|
|
1216
|
+
timeout: setTimeout(h, r.interval)
|
|
1218
1217
|
});
|
|
1219
1218
|
}
|
|
1220
1219
|
return this;
|
|
@@ -1224,51 +1223,51 @@ var bi = {
|
|
|
1224
1223
|
var t = this;
|
|
1225
1224
|
if (!this.played)
|
|
1226
1225
|
return this;
|
|
1227
|
-
var i = this.element,
|
|
1228
|
-
if (p(
|
|
1226
|
+
var i = this.element, n = this.options;
|
|
1227
|
+
if (p(n.stop) && d(i, me, n.stop, {
|
|
1229
1228
|
once: !0
|
|
1230
|
-
}), A(i,
|
|
1229
|
+
}), A(i, me) === !1)
|
|
1231
1230
|
return this;
|
|
1232
|
-
var
|
|
1233
|
-
return clearTimeout(this.playing.timeout), this.playing = !1, this.played = !1, y(
|
|
1234
|
-
b(a,
|
|
1235
|
-
}),
|
|
1231
|
+
var r = this.player;
|
|
1232
|
+
return clearTimeout(this.playing.timeout), this.playing = !1, this.played = !1, y(r.getElementsByTagName("img"), function(a) {
|
|
1233
|
+
b(a, j, t.onLoadWhenPlay);
|
|
1234
|
+
}), g(r, q), r.innerHTML = "", this.exitFullscreen(), this;
|
|
1236
1235
|
},
|
|
1237
1236
|
// Enter modal mode (only available in inline mode)
|
|
1238
1237
|
full: function() {
|
|
1239
|
-
var t = this, i = this.options,
|
|
1240
|
-
return !this.isShown || this.played || this.fulled || !i.inline ? this : (this.fulled = !0, this.open(), f(this.button,
|
|
1238
|
+
var t = this, i = this.options, n = this.viewer, r = this.image, a = this.list;
|
|
1239
|
+
return !this.isShown || this.played || this.fulled || !i.inline ? this : (this.fulled = !0, this.open(), f(this.button, Ht), i.transition && (g(a, x), this.viewed && g(r, x)), f(n, It), n.setAttribute("role", "dialog"), n.setAttribute("aria-labelledby", this.title.id), n.setAttribute("aria-modal", !0), n.removeAttribute("style"), L(n, {
|
|
1241
1240
|
zIndex: i.zIndex
|
|
1242
1241
|
}), i.focus && this.enforceFocus(), this.initContainer(), this.viewerData = C({}, this.containerData), this.renderList(), this.viewed && this.initImage(function() {
|
|
1243
1242
|
t.renderImage(function() {
|
|
1244
1243
|
i.transition && setTimeout(function() {
|
|
1245
|
-
f(
|
|
1244
|
+
f(r, x), f(a, x);
|
|
1246
1245
|
}, 0);
|
|
1247
1246
|
});
|
|
1248
1247
|
}), this);
|
|
1249
1248
|
},
|
|
1250
1249
|
// Exit modal mode (only available in inline mode)
|
|
1251
1250
|
exit: function() {
|
|
1252
|
-
var t = this, i = this.options,
|
|
1253
|
-
return !this.isShown || this.played || !this.fulled || !i.inline ? this : (this.fulled = !1, this.close(),
|
|
1251
|
+
var t = this, i = this.options, n = this.viewer, r = this.image, a = this.list;
|
|
1252
|
+
return !this.isShown || this.played || !this.fulled || !i.inline ? this : (this.fulled = !1, this.close(), g(this.button, Ht), i.transition && (g(a, x), this.viewed && g(r, x)), i.focus && this.clearEnforceFocus(), n.removeAttribute("role"), n.removeAttribute("aria-labelledby"), n.removeAttribute("aria-modal"), g(n, It), L(n, {
|
|
1254
1253
|
zIndex: i.zIndexInline
|
|
1255
1254
|
}), this.viewerData = C({}, this.parentData), this.renderViewer(), this.renderList(), this.viewed && this.initImage(function() {
|
|
1256
1255
|
t.renderImage(function() {
|
|
1257
1256
|
i.transition && setTimeout(function() {
|
|
1258
|
-
f(
|
|
1257
|
+
f(r, x), f(a, x);
|
|
1259
1258
|
}, 0);
|
|
1260
1259
|
});
|
|
1261
1260
|
}), this);
|
|
1262
1261
|
},
|
|
1263
1262
|
// Show the current ratio of the image with percentage
|
|
1264
1263
|
tooltip: function() {
|
|
1265
|
-
var t = this, i = this.options,
|
|
1266
|
-
return !this.viewed || this.played || !i.tooltip ? this : (
|
|
1267
|
-
i.transition ? (d(
|
|
1268
|
-
|
|
1264
|
+
var t = this, i = this.options, n = this.tooltipBox, r = this.imageData;
|
|
1265
|
+
return !this.viewed || this.played || !i.tooltip ? this : (n.textContent = "".concat(Math.round(r.ratio * 100), "%"), this.tooltipping ? clearTimeout(this.tooltipping) : i.transition ? (this.fading && A(n, z), f(n, q), f(n, vt), f(n, x), n.removeAttribute("aria-hidden"), n.initialOffsetWidth = n.offsetWidth, f(n, k)) : (f(n, q), n.removeAttribute("aria-hidden")), this.tooltipping = setTimeout(function() {
|
|
1266
|
+
i.transition ? (d(n, z, function() {
|
|
1267
|
+
g(n, q), g(n, vt), g(n, x), n.setAttribute("aria-hidden", !0), t.fading = !1;
|
|
1269
1268
|
}, {
|
|
1270
1269
|
once: !0
|
|
1271
|
-
}),
|
|
1270
|
+
}), g(n, k), t.fading = !0) : (g(n, q), n.setAttribute("aria-hidden", !0)), t.tooltipping = !1;
|
|
1272
1271
|
}, 1e3), this);
|
|
1273
1272
|
},
|
|
1274
1273
|
/**
|
|
@@ -1286,30 +1285,30 @@ var bi = {
|
|
|
1286
1285
|
},
|
|
1287
1286
|
// Update viewer when images changed
|
|
1288
1287
|
update: function() {
|
|
1289
|
-
var t = this, i = this.element,
|
|
1290
|
-
if (
|
|
1288
|
+
var t = this, i = this.element, n = this.options, r = this.isImg;
|
|
1289
|
+
if (r && !i.parentNode)
|
|
1291
1290
|
return this.destroy();
|
|
1292
1291
|
var a = [];
|
|
1293
|
-
if (y(
|
|
1294
|
-
p(
|
|
1292
|
+
if (y(r ? [i] : i.querySelectorAll("img"), function(l) {
|
|
1293
|
+
p(n.filter) ? n.filter.call(t, l) && a.push(l) : t.getImageURL(l) && a.push(l);
|
|
1295
1294
|
}), !a.length)
|
|
1296
1295
|
return this;
|
|
1297
1296
|
if (this.images = a, this.length = a.length, this.ready) {
|
|
1298
|
-
var
|
|
1299
|
-
if (y(this.items, function(
|
|
1300
|
-
var
|
|
1301
|
-
|
|
1302
|
-
}),
|
|
1297
|
+
var o = [];
|
|
1298
|
+
if (y(this.items, function(l, u) {
|
|
1299
|
+
var h = l.querySelector("img"), m = a[u];
|
|
1300
|
+
m && h ? (m.src !== h.src || m.alt !== h.alt) && o.push(u) : o.push(u);
|
|
1301
|
+
}), L(this.list, {
|
|
1303
1302
|
width: "auto"
|
|
1304
1303
|
}), this.initList(), this.isShown)
|
|
1305
1304
|
if (this.length) {
|
|
1306
1305
|
if (this.viewed) {
|
|
1307
|
-
var
|
|
1308
|
-
if (
|
|
1309
|
-
this.viewed = !1, this.view(Math.max(Math.min(this.index -
|
|
1306
|
+
var s = o.indexOf(this.index);
|
|
1307
|
+
if (s >= 0)
|
|
1308
|
+
this.viewed = !1, this.view(Math.max(Math.min(this.index - s, this.length - 1), 0));
|
|
1310
1309
|
else {
|
|
1311
|
-
var
|
|
1312
|
-
f(
|
|
1310
|
+
var c = this.items[this.index];
|
|
1311
|
+
f(c, lt), c.setAttribute("aria-selected", !0);
|
|
1313
1312
|
}
|
|
1314
1313
|
}
|
|
1315
1314
|
} else
|
|
@@ -1321,57 +1320,57 @@ var bi = {
|
|
|
1321
1320
|
// Destroy the viewer
|
|
1322
1321
|
destroy: function() {
|
|
1323
1322
|
var t = this.element, i = this.options;
|
|
1324
|
-
return t[v] ? (this.destroyed = !0, this.ready ? (this.played && this.stop(), i.inline ? (this.fulled && this.exit(), this.unbind()) : this.isShown ? (this.viewing && (this.imageRendering ? this.imageRendering.abort() : this.imageInitializing && this.imageInitializing.abort()), this.hiding && this.transitioning.abort(), this.hidden()) : this.showing && (this.transitioning.abort(), this.hidden()), this.ready = !1, this.viewer.parentNode.removeChild(this.viewer)) : i.inline && (this.delaying ? this.delaying.abort() : this.initializing && this.initializing.abort()), i.inline || b(t,
|
|
1323
|
+
return t[v] ? (this.destroyed = !0, this.ready ? (this.played && this.stop(), i.inline ? (this.fulled && this.exit(), this.unbind()) : this.isShown ? (this.viewing && (this.imageRendering ? this.imageRendering.abort() : this.imageInitializing && this.imageInitializing.abort()), this.hiding && this.transitioning.abort(), this.hidden()) : this.showing && (this.transitioning.abort(), this.hidden()), this.ready = !1, this.viewer.parentNode.removeChild(this.viewer)) : i.inline && (this.delaying ? this.delaying.abort() : this.initializing && this.initializing.abort()), i.inline || b(t, Q, this.onStart), t[v] = void 0, this) : this;
|
|
1325
1324
|
}
|
|
1326
|
-
},
|
|
1325
|
+
}, Ii = {
|
|
1327
1326
|
getImageURL: function(t) {
|
|
1328
1327
|
var i = this.options.url;
|
|
1329
|
-
return
|
|
1328
|
+
return ot(i) ? i = t.getAttribute(i) : p(i) ? i = i.call(this, t) : i = "", i;
|
|
1330
1329
|
},
|
|
1331
1330
|
enforceFocus: function() {
|
|
1332
1331
|
var t = this;
|
|
1333
|
-
this.clearEnforceFocus(), d(document,
|
|
1334
|
-
var
|
|
1335
|
-
if (!(
|
|
1336
|
-
for (;
|
|
1337
|
-
if (
|
|
1332
|
+
this.clearEnforceFocus(), d(document, Bt, this.onFocusin = function(i) {
|
|
1333
|
+
var n = t.viewer, r = i.target;
|
|
1334
|
+
if (!(r === document || r === n || n.contains(r))) {
|
|
1335
|
+
for (; r; ) {
|
|
1336
|
+
if (r.getAttribute("tabindex") !== null || r.getAttribute("aria-modal") === "true")
|
|
1338
1337
|
return;
|
|
1339
|
-
|
|
1338
|
+
r = r.parentElement;
|
|
1340
1339
|
}
|
|
1341
|
-
|
|
1340
|
+
n.focus();
|
|
1342
1341
|
}
|
|
1343
1342
|
});
|
|
1344
1343
|
},
|
|
1345
1344
|
clearEnforceFocus: function() {
|
|
1346
|
-
this.onFocusin && (b(document,
|
|
1345
|
+
this.onFocusin && (b(document, Bt, this.onFocusin), this.onFocusin = null);
|
|
1347
1346
|
},
|
|
1348
1347
|
open: function() {
|
|
1349
1348
|
var t = this.body;
|
|
1350
|
-
f(t,
|
|
1349
|
+
f(t, qt), this.scrollbarWidth > 0 && (t.style.paddingRight = "".concat(this.scrollbarWidth + (parseFloat(this.initialBodyComputedPaddingRight) || 0), "px"));
|
|
1351
1350
|
},
|
|
1352
1351
|
close: function() {
|
|
1353
1352
|
var t = this.body;
|
|
1354
|
-
|
|
1353
|
+
g(t, qt), this.scrollbarWidth > 0 && (t.style.paddingRight = this.initialBodyPaddingRight);
|
|
1355
1354
|
},
|
|
1356
1355
|
shown: function() {
|
|
1357
|
-
var t = this.element, i = this.options,
|
|
1358
|
-
this.fulled = !0, this.isShown = !0, this.render(), this.bind(), this.showing = !1, i.focus && (
|
|
1356
|
+
var t = this.element, i = this.options, n = this.viewer;
|
|
1357
|
+
this.fulled = !0, this.isShown = !0, this.render(), this.bind(), this.showing = !1, i.focus && (n.focus(), this.enforceFocus()), p(i.shown) && d(t, ie, i.shown, {
|
|
1359
1358
|
once: !0
|
|
1360
|
-
}), A(t,
|
|
1359
|
+
}), A(t, ie) !== !1 && this.ready && this.isShown && !this.hiding && this.view(this.index);
|
|
1361
1360
|
},
|
|
1362
1361
|
hidden: function() {
|
|
1363
|
-
var t = this.element, i = this.options,
|
|
1364
|
-
i.fucus && this.clearEnforceFocus(), this.
|
|
1362
|
+
var t = this.element, i = this.options, n = this.viewer;
|
|
1363
|
+
i.fucus && this.clearEnforceFocus(), this.close(), this.unbind(), f(n, W), n.removeAttribute("role"), n.removeAttribute("aria-labelledby"), n.removeAttribute("aria-modal"), n.setAttribute("aria-hidden", !0), this.resetList(), this.resetImage(), this.fulled = !1, this.viewed = !1, this.isShown = !1, this.hiding = !1, this.destroyed || (p(i.hidden) && d(t, re, i.hidden, {
|
|
1365
1364
|
once: !0
|
|
1366
|
-
}), A(t,
|
|
1365
|
+
}), A(t, re, null, {
|
|
1367
1366
|
cancelable: !1
|
|
1368
1367
|
}));
|
|
1369
1368
|
},
|
|
1370
1369
|
requestFullscreen: function(t) {
|
|
1371
1370
|
var i = this.element.ownerDocument;
|
|
1372
1371
|
if (this.fulled && !(i.fullscreenElement || i.webkitFullscreenElement || i.mozFullScreenElement || i.msFullscreenElement)) {
|
|
1373
|
-
var
|
|
1374
|
-
|
|
1372
|
+
var n = i.documentElement;
|
|
1373
|
+
n.requestFullscreen ? Z(t) ? n.requestFullscreen(t) : n.requestFullscreen() : n.webkitRequestFullscreen ? n.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : n.mozRequestFullScreen ? n.mozRequestFullScreen() : n.msRequestFullscreen && n.msRequestFullscreen();
|
|
1375
1374
|
}
|
|
1376
1375
|
},
|
|
1377
1376
|
exitFullscreen: function() {
|
|
@@ -1379,25 +1378,25 @@ var bi = {
|
|
|
1379
1378
|
this.fulled && (t.fullscreenElement || t.webkitFullscreenElement || t.mozFullScreenElement || t.msFullscreenElement) && (t.exitFullscreen ? t.exitFullscreen() : t.webkitExitFullscreen ? t.webkitExitFullscreen() : t.mozCancelFullScreen ? t.mozCancelFullScreen() : t.msExitFullscreen && t.msExitFullscreen());
|
|
1380
1379
|
},
|
|
1381
1380
|
change: function(t) {
|
|
1382
|
-
var i = this.options,
|
|
1383
|
-
if (
|
|
1384
|
-
var a =
|
|
1381
|
+
var i = this.options, n = this.pointers, r = n[Object.keys(n)[0]];
|
|
1382
|
+
if (r) {
|
|
1383
|
+
var a = r.endX - r.startX, o = r.endY - r.startY;
|
|
1385
1384
|
switch (this.action) {
|
|
1386
1385
|
case dt:
|
|
1387
|
-
(a !== 0 ||
|
|
1386
|
+
(a !== 0 || o !== 0) && (this.pointerMoved = !0, this.move(a, o, t));
|
|
1388
1387
|
break;
|
|
1389
1388
|
case it:
|
|
1390
|
-
this.zoom(
|
|
1389
|
+
this.zoom(Oi(n), !1, null, t);
|
|
1391
1390
|
break;
|
|
1392
|
-
case
|
|
1391
|
+
case _e: {
|
|
1393
1392
|
this.action = "switched";
|
|
1394
|
-
var
|
|
1395
|
-
|
|
1393
|
+
var s = Math.abs(a);
|
|
1394
|
+
s > 1 && s > Math.abs(o) && (this.pointers = {}, a > 1 ? this.prev(i.loop) : a < -1 && this.next(i.loop));
|
|
1396
1395
|
break;
|
|
1397
1396
|
}
|
|
1398
1397
|
}
|
|
1399
|
-
y(
|
|
1400
|
-
|
|
1398
|
+
y(n, function(c) {
|
|
1399
|
+
c.startX = c.endX, c.startY = c.endY;
|
|
1401
1400
|
});
|
|
1402
1401
|
}
|
|
1403
1402
|
},
|
|
@@ -1405,29 +1404,29 @@ var bi = {
|
|
|
1405
1404
|
var t = this.imageData, i = this.viewerData;
|
|
1406
1405
|
return this.length > 1 && t.x >= 0 && t.y >= 0 && t.width <= i.width && t.height <= i.height;
|
|
1407
1406
|
}
|
|
1408
|
-
},
|
|
1407
|
+
}, Ni = P.Viewer, Ci = function(e) {
|
|
1409
1408
|
return function() {
|
|
1410
1409
|
return e += 1, e;
|
|
1411
1410
|
};
|
|
1412
|
-
}(-1),
|
|
1411
|
+
}(-1), Ie = /* @__PURE__ */ function() {
|
|
1413
1412
|
function e(t) {
|
|
1414
1413
|
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1415
|
-
if (
|
|
1414
|
+
if (ii(this, e), !t || t.nodeType !== 1)
|
|
1416
1415
|
throw new Error("The first argument is required and must be an element.");
|
|
1417
|
-
this.element = t, this.options = C({},
|
|
1416
|
+
this.element = t, this.options = C({}, Xt, Z(i) && i), this.action = !1, this.fading = !1, this.fulled = !1, this.hiding = !1, this.imageClicked = !1, this.imageData = {}, this.index = this.options.initialViewIndex, this.isImg = !1, this.isShown = !1, this.length = 0, this.moving = !1, this.played = !1, this.playing = !1, this.pointers = {}, this.ready = !1, this.rotating = !1, this.scaling = !1, this.showing = !1, this.timeout = !1, this.tooltipping = !1, this.viewed = !1, this.viewing = !1, this.wheeling = !1, this.zooming = !1, this.pointerMoved = !1, this.id = Ci(), this.init();
|
|
1418
1417
|
}
|
|
1419
|
-
return
|
|
1418
|
+
return ni(e, [{
|
|
1420
1419
|
key: "init",
|
|
1421
1420
|
value: function() {
|
|
1422
|
-
var i = this,
|
|
1423
|
-
if (!
|
|
1424
|
-
|
|
1425
|
-
var a =
|
|
1426
|
-
if (y(a ? [
|
|
1427
|
-
p(
|
|
1428
|
-
}), this.isImg = a, this.length =
|
|
1429
|
-
var
|
|
1430
|
-
if (
|
|
1421
|
+
var i = this, n = this.element, r = this.options;
|
|
1422
|
+
if (!n[v]) {
|
|
1423
|
+
n[v] = this, r.focus && !r.keyboard && (r.focus = !1);
|
|
1424
|
+
var a = n.localName === "img", o = [];
|
|
1425
|
+
if (y(a ? [n] : n.querySelectorAll("img"), function(l) {
|
|
1426
|
+
p(r.filter) ? r.filter.call(i, l) && o.push(l) : i.getImageURL(l) && o.push(l);
|
|
1427
|
+
}), this.isImg = a, this.length = o.length, this.images = o, this.initBody(), B(document.createElement(v).style.transition) && (r.transition = !1), r.inline) {
|
|
1428
|
+
var s = 0, c = function() {
|
|
1429
|
+
if (s += 1, s === i.length) {
|
|
1431
1430
|
var u;
|
|
1432
1431
|
i.initializing = !1, i.delaying = {
|
|
1433
1432
|
abort: function() {
|
|
@@ -1440,30 +1439,30 @@ var bi = {
|
|
|
1440
1439
|
};
|
|
1441
1440
|
this.initializing = {
|
|
1442
1441
|
abort: function() {
|
|
1443
|
-
y(
|
|
1444
|
-
u.complete || (b(u,
|
|
1442
|
+
y(o, function(u) {
|
|
1443
|
+
u.complete || (b(u, j, c), b(u, X, c));
|
|
1445
1444
|
});
|
|
1446
1445
|
}
|
|
1447
|
-
}, y(
|
|
1448
|
-
if (
|
|
1449
|
-
|
|
1446
|
+
}, y(o, function(l) {
|
|
1447
|
+
if (l.complete)
|
|
1448
|
+
c();
|
|
1450
1449
|
else {
|
|
1451
|
-
var u,
|
|
1452
|
-
d(
|
|
1453
|
-
b(
|
|
1450
|
+
var u, h;
|
|
1451
|
+
d(l, j, u = function() {
|
|
1452
|
+
b(l, X, h), c();
|
|
1454
1453
|
}, {
|
|
1455
1454
|
once: !0
|
|
1456
|
-
}), d(
|
|
1457
|
-
b(
|
|
1455
|
+
}), d(l, X, h = function() {
|
|
1456
|
+
b(l, j, u), c();
|
|
1458
1457
|
}, {
|
|
1459
1458
|
once: !0
|
|
1460
1459
|
});
|
|
1461
1460
|
}
|
|
1462
1461
|
});
|
|
1463
1462
|
} else
|
|
1464
|
-
d(
|
|
1465
|
-
var u =
|
|
1466
|
-
u.localName === "img" && (!p(
|
|
1463
|
+
d(n, Q, this.onStart = function(l) {
|
|
1464
|
+
var u = l.target;
|
|
1465
|
+
u.localName === "img" && (!p(r.filter) || r.filter.call(i, u)) && i.view(i.images.indexOf(u));
|
|
1467
1466
|
});
|
|
1468
1467
|
}
|
|
1469
1468
|
}
|
|
@@ -1471,48 +1470,48 @@ var bi = {
|
|
|
1471
1470
|
key: "build",
|
|
1472
1471
|
value: function() {
|
|
1473
1472
|
if (!this.ready) {
|
|
1474
|
-
var i = this.element,
|
|
1475
|
-
a.innerHTML =
|
|
1476
|
-
var
|
|
1477
|
-
if (this.parent =
|
|
1478
|
-
f(
|
|
1479
|
-
}),
|
|
1480
|
-
var
|
|
1481
|
-
|
|
1482
|
-
var
|
|
1483
|
-
if (!(!
|
|
1484
|
-
var tt =
|
|
1485
|
-
|
|
1473
|
+
var i = this.element, n = this.options, r = i.parentNode, a = document.createElement("div");
|
|
1474
|
+
a.innerHTML = oi;
|
|
1475
|
+
var o = a.querySelector(".".concat(v, "-container")), s = o.querySelector(".".concat(v, "-title")), c = o.querySelector(".".concat(v, "-toolbar")), l = o.querySelector(".".concat(v, "-navbar")), u = o.querySelector(".".concat(v, "-button")), h = o.querySelector(".".concat(v, "-canvas"));
|
|
1476
|
+
if (this.parent = r, this.viewer = o, this.title = s, this.toolbar = c, this.navbar = l, this.button = u, this.canvas = h, this.footer = o.querySelector(".".concat(v, "-footer")), this.tooltipBox = o.querySelector(".".concat(v, "-tooltip")), this.player = o.querySelector(".".concat(v, "-player")), this.list = o.querySelector(".".concat(v, "-list")), o.id = "".concat(v).concat(this.id), s.id = "".concat(v, "Title").concat(this.id), f(s, n.title ? ct(Array.isArray(n.title) ? n.title[0] : n.title) : W), f(l, n.navbar ? ct(n.navbar) : W), st(u, W, !n.button), n.keyboard && u.setAttribute("tabindex", 0), n.backdrop && (f(o, "".concat(v, "-backdrop")), !n.inline && n.backdrop !== "static" && Ct(h, gt, "hide")), ot(n.className) && n.className && n.className.split(zt).forEach(function(E) {
|
|
1477
|
+
f(o, E);
|
|
1478
|
+
}), n.toolbar) {
|
|
1479
|
+
var m = document.createElement("ul"), _ = Z(n.toolbar), S = ut.slice(0, 3), T = ut.slice(7, 9), D = ut.slice(9);
|
|
1480
|
+
_ || f(c, ct(n.toolbar)), y(_ ? n.toolbar : ut, function(E, R) {
|
|
1481
|
+
var M = _ && Z(E), V = _ ? Lt(R) : E, Y = M && !B(E.show) ? E.show : E;
|
|
1482
|
+
if (!(!Y || !n.zoomable && S.indexOf(V) !== -1 || !n.rotatable && T.indexOf(V) !== -1 || !n.scalable && D.indexOf(V) !== -1)) {
|
|
1483
|
+
var tt = M && !B(E.size) ? E.size : E, H = M && !B(E.click) ? E.click : E, F = document.createElement("li");
|
|
1484
|
+
n.keyboard && F.setAttribute("tabindex", 0), F.setAttribute("role", "button"), f(F, "".concat(v, "-").concat(V)), p(H) || Ct(F, gt, V), O(Y) && f(F, ct(Y)), ["small", "large"].indexOf(tt) !== -1 ? f(F, "".concat(v, "-").concat(tt)) : V === "play" && f(F, "".concat(v, "-large")), p(H) && d(F, Q, H), m.appendChild(F);
|
|
1486
1485
|
}
|
|
1487
|
-
}),
|
|
1486
|
+
}), c.appendChild(m);
|
|
1488
1487
|
} else
|
|
1489
|
-
f(
|
|
1490
|
-
if (!
|
|
1491
|
-
var
|
|
1492
|
-
f(
|
|
1493
|
-
|
|
1488
|
+
f(c, W);
|
|
1489
|
+
if (!n.rotatable) {
|
|
1490
|
+
var I = c.querySelectorAll('li[class*="rotate"]');
|
|
1491
|
+
f(I, nt), y(I, function(E) {
|
|
1492
|
+
c.appendChild(E);
|
|
1494
1493
|
});
|
|
1495
1494
|
}
|
|
1496
|
-
if (
|
|
1497
|
-
f(u,
|
|
1498
|
-
zIndex:
|
|
1499
|
-
}), window.getComputedStyle(
|
|
1495
|
+
if (n.inline)
|
|
1496
|
+
f(u, li), L(o, {
|
|
1497
|
+
zIndex: n.zIndexInline
|
|
1498
|
+
}), window.getComputedStyle(r).position === "static" && L(r, {
|
|
1500
1499
|
position: "relative"
|
|
1501
|
-
}),
|
|
1500
|
+
}), r.insertBefore(o, i.nextSibling);
|
|
1502
1501
|
else {
|
|
1503
|
-
f(u,
|
|
1504
|
-
zIndex:
|
|
1502
|
+
f(u, si), f(o, It), f(o, vt), f(o, W), L(o, {
|
|
1503
|
+
zIndex: n.zIndex
|
|
1505
1504
|
});
|
|
1506
|
-
var N =
|
|
1507
|
-
|
|
1505
|
+
var N = n.container;
|
|
1506
|
+
ot(N) && (N = i.ownerDocument.querySelector(N)), N || (N = this.body), N.appendChild(o);
|
|
1508
1507
|
}
|
|
1509
|
-
if (
|
|
1508
|
+
if (n.inline && (this.render(), this.bind(), this.isShown = !0), this.ready = !0, p(n.ready) && d(i, te, n.ready, {
|
|
1510
1509
|
once: !0
|
|
1511
|
-
}), A(i,
|
|
1510
|
+
}), A(i, te) === !1) {
|
|
1512
1511
|
this.ready = !1;
|
|
1513
1512
|
return;
|
|
1514
1513
|
}
|
|
1515
|
-
this.ready &&
|
|
1514
|
+
this.ready && n.inline && this.view(this.index);
|
|
1516
1515
|
}
|
|
1517
1516
|
}
|
|
1518
1517
|
/**
|
|
@@ -1522,7 +1521,7 @@ var bi = {
|
|
|
1522
1521
|
}], [{
|
|
1523
1522
|
key: "noConflict",
|
|
1524
1523
|
value: function() {
|
|
1525
|
-
return window.Viewer =
|
|
1524
|
+
return window.Viewer = Ni, e;
|
|
1526
1525
|
}
|
|
1527
1526
|
/**
|
|
1528
1527
|
* Change the default options.
|
|
@@ -1531,287 +1530,323 @@ var bi = {
|
|
|
1531
1530
|
}, {
|
|
1532
1531
|
key: "setDefaults",
|
|
1533
1532
|
value: function(i) {
|
|
1534
|
-
C(
|
|
1533
|
+
C(Xt, Z(i) && i);
|
|
1535
1534
|
}
|
|
1536
1535
|
}]), e;
|
|
1537
1536
|
}();
|
|
1538
|
-
C(
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
*/
|
|
1548
|
-
var ct = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
1549
|
-
function Oi(e) {
|
|
1550
|
-
return e;
|
|
1551
|
-
}
|
|
1552
|
-
var xe = Oi;
|
|
1553
|
-
function Ii(e, t, i) {
|
|
1554
|
-
switch (i.length) {
|
|
1555
|
-
case 0:
|
|
1556
|
-
return e.call(t);
|
|
1557
|
-
case 1:
|
|
1558
|
-
return e.call(t, i[0]);
|
|
1559
|
-
case 2:
|
|
1560
|
-
return e.call(t, i[0], i[1]);
|
|
1561
|
-
case 3:
|
|
1562
|
-
return e.call(t, i[0], i[1], i[2]);
|
|
1563
|
-
}
|
|
1564
|
-
return e.apply(t, i);
|
|
1565
|
-
}
|
|
1566
|
-
var Ai = Ii, xi = Ai, de = Math.max;
|
|
1567
|
-
function Di(e, t, i) {
|
|
1568
|
-
return t = de(t === void 0 ? e.length - 1 : t, 0), function() {
|
|
1569
|
-
for (var r = arguments, n = -1, a = de(r.length - t, 0), s = Array(a); ++n < a; )
|
|
1570
|
-
s[n] = r[t + n];
|
|
1571
|
-
n = -1;
|
|
1572
|
-
for (var l = Array(t + 1); ++n < t; )
|
|
1573
|
-
l[n] = r[n];
|
|
1574
|
-
return l[t] = i(s), xi(e, this, l);
|
|
1575
|
-
};
|
|
1576
|
-
}
|
|
1577
|
-
var Ni = Di;
|
|
1578
|
-
function Ci(e) {
|
|
1579
|
-
return function() {
|
|
1580
|
-
return e;
|
|
1581
|
-
};
|
|
1582
|
-
}
|
|
1583
|
-
var Li = Ci, $i = typeof ct == "object" && ct && ct.Object === Object && ct, De = $i, ki = De, zi = typeof self == "object" && self && self.Object === Object && self, Pi = ki || zi || Function("return this")(), zt = Pi, Ri = zt, ji = Ri.Symbol, Ne = ji, ve = Ne, Ce = Object.prototype, Vi = Ce.hasOwnProperty, Fi = Ce.toString, et = ve ? ve.toStringTag : void 0;
|
|
1584
|
-
function Mi(e) {
|
|
1537
|
+
C(Ie.prototype, xi, _i, Ai, Di, Ii);
|
|
1538
|
+
var ki = typeof global == "object" && global && global.Object === Object && global;
|
|
1539
|
+
const Ne = ki;
|
|
1540
|
+
var ji = typeof self == "object" && self && self.Object === Object && self, zi = Ne || ji || Function("return this")();
|
|
1541
|
+
const Vt = zi;
|
|
1542
|
+
var Li = Vt.Symbol;
|
|
1543
|
+
const pt = Li;
|
|
1544
|
+
var Ce = Object.prototype, Vi = Ce.hasOwnProperty, Ri = Ce.toString, et = pt ? pt.toStringTag : void 0;
|
|
1545
|
+
function Fi(e) {
|
|
1585
1546
|
var t = Vi.call(e, et), i = e[et];
|
|
1586
1547
|
try {
|
|
1587
1548
|
e[et] = void 0;
|
|
1588
|
-
var
|
|
1589
|
-
} catch {
|
|
1549
|
+
var n = !0;
|
|
1550
|
+
} catch (a) {
|
|
1590
1551
|
}
|
|
1591
|
-
var
|
|
1592
|
-
return
|
|
1552
|
+
var r = Ri.call(e);
|
|
1553
|
+
return n && (t ? e[et] = i : delete e[et]), r;
|
|
1593
1554
|
}
|
|
1594
|
-
var
|
|
1595
|
-
function
|
|
1596
|
-
return
|
|
1555
|
+
var Pi = Object.prototype, Mi = Pi.toString;
|
|
1556
|
+
function Yi(e) {
|
|
1557
|
+
return Mi.call(e);
|
|
1597
1558
|
}
|
|
1598
|
-
var
|
|
1599
|
-
function
|
|
1600
|
-
return e == null ? e === void 0 ?
|
|
1559
|
+
var Wi = "[object Null]", Xi = "[object Undefined]", ge = pt ? pt.toStringTag : void 0;
|
|
1560
|
+
function Rt(e) {
|
|
1561
|
+
return e == null ? e === void 0 ? Xi : Wi : ge && ge in Object(e) ? Fi(e) : Yi(e);
|
|
1601
1562
|
}
|
|
1602
|
-
|
|
1603
|
-
|
|
1563
|
+
function Ft(e) {
|
|
1564
|
+
return e != null && typeof e == "object";
|
|
1565
|
+
}
|
|
1566
|
+
var Hi = Array.isArray;
|
|
1567
|
+
const qi = Hi;
|
|
1568
|
+
function wt(e) {
|
|
1604
1569
|
var t = typeof e;
|
|
1605
1570
|
return e != null && (t == "object" || t == "function");
|
|
1606
1571
|
}
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1572
|
+
function ke(e) {
|
|
1573
|
+
return e;
|
|
1574
|
+
}
|
|
1575
|
+
var Ui = "[object AsyncFunction]", Bi = "[object Function]", Zi = "[object GeneratorFunction]", $i = "[object Proxy]";
|
|
1576
|
+
function je(e) {
|
|
1577
|
+
if (!wt(e))
|
|
1610
1578
|
return !1;
|
|
1611
|
-
var t =
|
|
1612
|
-
return t ==
|
|
1579
|
+
var t = Rt(e);
|
|
1580
|
+
return t == Bi || t == Zi || t == Ui || t == $i;
|
|
1613
1581
|
}
|
|
1614
|
-
var
|
|
1615
|
-
|
|
1582
|
+
var Ki = Vt["__core-js_shared__"];
|
|
1583
|
+
const xt = Ki;
|
|
1584
|
+
var pe = function() {
|
|
1585
|
+
var e = /[^.]+$/.exec(xt && xt.keys && xt.keys.IE_PROTO || "");
|
|
1616
1586
|
return e ? "Symbol(src)_1." + e : "";
|
|
1617
1587
|
}();
|
|
1618
|
-
function
|
|
1588
|
+
function Gi(e) {
|
|
1619
1589
|
return !!pe && pe in e;
|
|
1620
1590
|
}
|
|
1621
|
-
var
|
|
1622
|
-
function
|
|
1591
|
+
var Qi = Function.prototype, Ji = Qi.toString;
|
|
1592
|
+
function tn(e) {
|
|
1623
1593
|
if (e != null) {
|
|
1624
1594
|
try {
|
|
1625
|
-
return
|
|
1626
|
-
} catch {
|
|
1595
|
+
return Ji.call(e);
|
|
1596
|
+
} catch (t) {
|
|
1627
1597
|
}
|
|
1628
1598
|
try {
|
|
1629
1599
|
return e + "";
|
|
1630
|
-
} catch {
|
|
1600
|
+
} catch (t) {
|
|
1631
1601
|
}
|
|
1632
1602
|
}
|
|
1633
1603
|
return "";
|
|
1634
1604
|
}
|
|
1635
|
-
var
|
|
1636
|
-
function
|
|
1637
|
-
|
|
1605
|
+
var en = /[\\^$.*+?()[\]{}|]/g, nn = /^\[object .+?Constructor\]$/, rn = Function.prototype, an = Object.prototype, on = rn.toString, sn = an.hasOwnProperty, ln = RegExp(
|
|
1606
|
+
"^" + on.call(sn).replace(en, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
1607
|
+
);
|
|
1608
|
+
function un(e) {
|
|
1609
|
+
if (!wt(e) || Gi(e))
|
|
1638
1610
|
return !1;
|
|
1639
|
-
var t =
|
|
1640
|
-
return t.test(
|
|
1611
|
+
var t = je(e) ? ln : nn;
|
|
1612
|
+
return t.test(tn(e));
|
|
1641
1613
|
}
|
|
1642
|
-
|
|
1643
|
-
function xr(e, t) {
|
|
1614
|
+
function cn(e, t) {
|
|
1644
1615
|
return e == null ? void 0 : e[t];
|
|
1645
1616
|
}
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
return Nr(i) ? i : void 0;
|
|
1617
|
+
function hn(e, t) {
|
|
1618
|
+
var i = cn(e, t);
|
|
1619
|
+
return un(i) ? i : void 0;
|
|
1650
1620
|
}
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1621
|
+
function fn(e, t, i) {
|
|
1622
|
+
switch (i.length) {
|
|
1623
|
+
case 0:
|
|
1624
|
+
return e.call(t);
|
|
1625
|
+
case 1:
|
|
1626
|
+
return e.call(t, i[0]);
|
|
1627
|
+
case 2:
|
|
1628
|
+
return e.call(t, i[0], i[1]);
|
|
1629
|
+
case 3:
|
|
1630
|
+
return e.call(t, i[0], i[1], i[2]);
|
|
1656
1631
|
}
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
value: Rr(t),
|
|
1662
|
-
writable: !0
|
|
1663
|
-
});
|
|
1664
|
-
} : jr, Fr = Vr, Mr = 800, Yr = 16, Wr = Date.now;
|
|
1665
|
-
function Xr(e) {
|
|
1632
|
+
return e.apply(t, i);
|
|
1633
|
+
}
|
|
1634
|
+
var dn = 800, vn = 16, mn = Date.now;
|
|
1635
|
+
function gn(e) {
|
|
1666
1636
|
var t = 0, i = 0;
|
|
1667
1637
|
return function() {
|
|
1668
|
-
var
|
|
1669
|
-
if (i =
|
|
1670
|
-
if (++t >=
|
|
1638
|
+
var n = mn(), r = vn - (n - i);
|
|
1639
|
+
if (i = n, r > 0) {
|
|
1640
|
+
if (++t >= dn)
|
|
1671
1641
|
return arguments[0];
|
|
1672
1642
|
} else
|
|
1673
1643
|
t = 0;
|
|
1674
1644
|
return e.apply(void 0, arguments);
|
|
1675
1645
|
};
|
|
1676
1646
|
}
|
|
1677
|
-
|
|
1678
|
-
function
|
|
1679
|
-
|
|
1647
|
+
function pn(e) {
|
|
1648
|
+
return function() {
|
|
1649
|
+
return e;
|
|
1650
|
+
};
|
|
1651
|
+
}
|
|
1652
|
+
var bn = function() {
|
|
1653
|
+
try {
|
|
1654
|
+
var e = hn(Object, "defineProperty");
|
|
1655
|
+
return e({}, "", {}), e;
|
|
1656
|
+
} catch (t) {
|
|
1657
|
+
}
|
|
1658
|
+
}();
|
|
1659
|
+
const bt = bn;
|
|
1660
|
+
var yn = bt ? function(e, t) {
|
|
1661
|
+
return bt(e, "toString", {
|
|
1662
|
+
configurable: !0,
|
|
1663
|
+
enumerable: !1,
|
|
1664
|
+
value: pn(t),
|
|
1665
|
+
writable: !0
|
|
1666
|
+
});
|
|
1667
|
+
} : ke;
|
|
1668
|
+
const wn = yn;
|
|
1669
|
+
var En = gn(wn);
|
|
1670
|
+
const Tn = En;
|
|
1671
|
+
var On = 9007199254740991, Sn = /^(?:0|[1-9]\d*)$/;
|
|
1672
|
+
function ze(e, t) {
|
|
1673
|
+
var i = typeof e;
|
|
1674
|
+
return t = t == null ? On : t, !!t && (i == "number" || i != "symbol" && Sn.test(e)) && e > -1 && e % 1 == 0 && e < t;
|
|
1675
|
+
}
|
|
1676
|
+
function Le(e, t, i) {
|
|
1677
|
+
t == "__proto__" && bt ? bt(e, t, {
|
|
1678
|
+
configurable: !0,
|
|
1679
|
+
enumerable: !0,
|
|
1680
|
+
value: i,
|
|
1681
|
+
writable: !0
|
|
1682
|
+
}) : e[t] = i;
|
|
1680
1683
|
}
|
|
1681
|
-
|
|
1682
|
-
function en(e, t) {
|
|
1684
|
+
function Pt(e, t) {
|
|
1683
1685
|
return e === t || e !== e && t !== t;
|
|
1684
1686
|
}
|
|
1685
|
-
var
|
|
1686
|
-
function
|
|
1687
|
-
|
|
1687
|
+
var xn = Object.prototype, _n = xn.hasOwnProperty;
|
|
1688
|
+
function Ve(e, t, i) {
|
|
1689
|
+
var n = e[t];
|
|
1690
|
+
(!(_n.call(e, t) && Pt(n, i)) || i === void 0 && !(t in e)) && Le(e, t, i);
|
|
1691
|
+
}
|
|
1692
|
+
function An(e, t, i, n) {
|
|
1693
|
+
var r = !i;
|
|
1694
|
+
i || (i = {});
|
|
1695
|
+
for (var a = -1, o = t.length; ++a < o; ) {
|
|
1696
|
+
var s = t[a], c = n ? n(i[s], e[s], s, i, e) : void 0;
|
|
1697
|
+
c === void 0 && (c = e[s]), r ? Le(i, s, c) : Ve(i, s, c);
|
|
1698
|
+
}
|
|
1699
|
+
return i;
|
|
1688
1700
|
}
|
|
1689
|
-
var
|
|
1690
|
-
function
|
|
1691
|
-
return
|
|
1701
|
+
var be = Math.max;
|
|
1702
|
+
function Dn(e, t, i) {
|
|
1703
|
+
return t = be(t === void 0 ? e.length - 1 : t, 0), function() {
|
|
1704
|
+
for (var n = arguments, r = -1, a = be(n.length - t, 0), o = Array(a); ++r < a; )
|
|
1705
|
+
o[r] = n[t + r];
|
|
1706
|
+
r = -1;
|
|
1707
|
+
for (var s = Array(t + 1); ++r < t; )
|
|
1708
|
+
s[r] = n[r];
|
|
1709
|
+
return s[t] = i(o), fn(e, this, s);
|
|
1710
|
+
};
|
|
1692
1711
|
}
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1712
|
+
function Re(e, t) {
|
|
1713
|
+
return Tn(Dn(e, t, ke), e + "");
|
|
1714
|
+
}
|
|
1715
|
+
var In = 9007199254740991;
|
|
1716
|
+
function Fe(e) {
|
|
1717
|
+
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= In;
|
|
1697
1718
|
}
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1719
|
+
function Et(e) {
|
|
1720
|
+
return e != null && Fe(e.length) && !je(e);
|
|
1721
|
+
}
|
|
1722
|
+
function Pe(e, t, i) {
|
|
1723
|
+
if (!wt(i))
|
|
1701
1724
|
return !1;
|
|
1702
|
-
var
|
|
1703
|
-
return (
|
|
1725
|
+
var n = typeof t;
|
|
1726
|
+
return (n == "number" ? Et(i) && ze(t, i.length) : n == "string" && t in i) ? Pt(i[t], e) : !1;
|
|
1727
|
+
}
|
|
1728
|
+
function Nn(e) {
|
|
1729
|
+
return Re(function(t, i) {
|
|
1730
|
+
var n = -1, r = i.length, a = r > 1 ? i[r - 1] : void 0, o = r > 2 ? i[2] : void 0;
|
|
1731
|
+
for (a = e.length > 3 && typeof a == "function" ? (r--, a) : void 0, o && Pe(i[0], i[1], o) && (a = r < 3 ? void 0 : a, r = 1), t = Object(t); ++n < r; ) {
|
|
1732
|
+
var s = i[n];
|
|
1733
|
+
s && e(t, s, n, a);
|
|
1734
|
+
}
|
|
1735
|
+
return t;
|
|
1736
|
+
});
|
|
1704
1737
|
}
|
|
1705
|
-
var
|
|
1706
|
-
function
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
return r;
|
|
1738
|
+
var Cn = Object.prototype;
|
|
1739
|
+
function Mt(e) {
|
|
1740
|
+
var t = e && e.constructor, i = typeof t == "function" && t.prototype || Cn;
|
|
1741
|
+
return e === i;
|
|
1710
1742
|
}
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1743
|
+
function kn(e, t) {
|
|
1744
|
+
for (var i = -1, n = Array(e); ++i < e; )
|
|
1745
|
+
n[i] = t(i);
|
|
1746
|
+
return n;
|
|
1714
1747
|
}
|
|
1715
|
-
var
|
|
1716
|
-
function
|
|
1717
|
-
return
|
|
1748
|
+
var jn = "[object Arguments]";
|
|
1749
|
+
function ye(e) {
|
|
1750
|
+
return Ft(e) && Rt(e) == jn;
|
|
1718
1751
|
}
|
|
1719
|
-
var
|
|
1752
|
+
var Me = Object.prototype, zn = Me.hasOwnProperty, Ln = Me.propertyIsEnumerable, Vn = ye(function() {
|
|
1720
1753
|
return arguments;
|
|
1721
1754
|
}()) ? ye : function(e) {
|
|
1722
|
-
return
|
|
1723
|
-
}
|
|
1724
|
-
|
|
1755
|
+
return Ft(e) && zn.call(e, "callee") && !Ln.call(e, "callee");
|
|
1756
|
+
};
|
|
1757
|
+
const Rn = Vn;
|
|
1758
|
+
function Fn() {
|
|
1725
1759
|
return !1;
|
|
1726
1760
|
}
|
|
1727
|
-
var
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
function
|
|
1736
|
-
return Pn(e) && zn(e.length) && !!w[kn(e)];
|
|
1737
|
-
}
|
|
1738
|
-
var la = oa;
|
|
1739
|
-
function ua(e) {
|
|
1761
|
+
var Ye = typeof exports == "object" && exports && !exports.nodeType && exports, we = Ye && typeof module == "object" && module && !module.nodeType && module, Pn = we && we.exports === Ye, Ee = Pn ? Vt.Buffer : void 0, Mn = Ee ? Ee.isBuffer : void 0, Yn = Mn || Fn;
|
|
1762
|
+
const Wn = Yn;
|
|
1763
|
+
var Xn = "[object Arguments]", Hn = "[object Array]", qn = "[object Boolean]", Un = "[object Date]", Bn = "[object Error]", Zn = "[object Function]", $n = "[object Map]", Kn = "[object Number]", Gn = "[object Object]", Qn = "[object RegExp]", Jn = "[object Set]", tr = "[object String]", er = "[object WeakMap]", ir = "[object ArrayBuffer]", nr = "[object DataView]", rr = "[object Float32Array]", ar = "[object Float64Array]", or = "[object Int8Array]", sr = "[object Int16Array]", lr = "[object Int32Array]", ur = "[object Uint8Array]", cr = "[object Uint8ClampedArray]", hr = "[object Uint16Array]", fr = "[object Uint32Array]", w = {};
|
|
1764
|
+
w[rr] = w[ar] = w[or] = w[sr] = w[lr] = w[ur] = w[cr] = w[hr] = w[fr] = !0;
|
|
1765
|
+
w[Xn] = w[Hn] = w[ir] = w[qn] = w[nr] = w[Un] = w[Bn] = w[Zn] = w[$n] = w[Kn] = w[Gn] = w[Qn] = w[Jn] = w[tr] = w[er] = !1;
|
|
1766
|
+
function dr(e) {
|
|
1767
|
+
return Ft(e) && Fe(e.length) && !!w[Rt(e)];
|
|
1768
|
+
}
|
|
1769
|
+
function vr(e) {
|
|
1740
1770
|
return function(t) {
|
|
1741
1771
|
return e(t);
|
|
1742
1772
|
};
|
|
1743
1773
|
}
|
|
1744
|
-
var
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1774
|
+
var We = typeof exports == "object" && exports && !exports.nodeType && exports, rt = We && typeof module == "object" && module && !module.nodeType && module, mr = rt && rt.exports === We, _t = mr && Ne.process, gr = function() {
|
|
1775
|
+
try {
|
|
1776
|
+
var e = rt && rt.require && rt.require("util").types;
|
|
1777
|
+
return e || _t && _t.binding && _t.binding("util");
|
|
1778
|
+
} catch (t) {
|
|
1779
|
+
}
|
|
1780
|
+
}();
|
|
1781
|
+
const Te = gr;
|
|
1782
|
+
var Oe = Te && Te.isTypedArray, pr = Oe ? vr(Oe) : dr;
|
|
1783
|
+
const br = pr;
|
|
1784
|
+
var yr = Object.prototype, wr = yr.hasOwnProperty;
|
|
1785
|
+
function Xe(e, t) {
|
|
1786
|
+
var i = qi(e), n = !i && Rn(e), r = !i && !n && Wn(e), a = !i && !n && !r && br(e), o = i || n || r || a, s = o ? kn(e.length, String) : [], c = s.length;
|
|
1787
|
+
for (var l in e)
|
|
1788
|
+
(t || wr.call(e, l)) && !(o && (l == "length" || r && (l == "offset" || l == "parent") || a && (l == "buffer" || l == "byteLength" || l == "byteOffset") || ze(l, c))) && s.push(l);
|
|
1789
|
+
return s;
|
|
1790
|
+
}
|
|
1791
|
+
function Er(e, t) {
|
|
1792
|
+
return function(i) {
|
|
1793
|
+
return e(t(i));
|
|
1794
|
+
};
|
|
1795
|
+
}
|
|
1796
|
+
var Tr = Er(Object.keys, Object);
|
|
1797
|
+
const Or = Tr;
|
|
1798
|
+
var Sr = Object.prototype, xr = Sr.hasOwnProperty;
|
|
1799
|
+
function _r(e) {
|
|
1800
|
+
if (!Mt(e))
|
|
1801
|
+
return Or(e);
|
|
1802
|
+
var t = [];
|
|
1803
|
+
for (var i in Object(e))
|
|
1804
|
+
xr.call(e, i) && i != "constructor" && t.push(i);
|
|
1805
|
+
return t;
|
|
1806
|
+
}
|
|
1807
|
+
function Ar(e) {
|
|
1808
|
+
return Et(e) ? Xe(e) : _r(e);
|
|
1766
1809
|
}
|
|
1767
|
-
var
|
|
1768
|
-
function
|
|
1810
|
+
var Dr = Object.prototype, Ir = Dr.hasOwnProperty;
|
|
1811
|
+
Nn(function(e, t) {
|
|
1812
|
+
if (Mt(t) || Et(t)) {
|
|
1813
|
+
An(t, Ar(t), e);
|
|
1814
|
+
return;
|
|
1815
|
+
}
|
|
1816
|
+
for (var i in t)
|
|
1817
|
+
Ir.call(t, i) && Ve(e, i, t[i]);
|
|
1818
|
+
});
|
|
1819
|
+
function Nr(e) {
|
|
1769
1820
|
var t = [];
|
|
1770
1821
|
if (e != null)
|
|
1771
1822
|
for (var i in Object(e))
|
|
1772
1823
|
t.push(i);
|
|
1773
1824
|
return t;
|
|
1774
1825
|
}
|
|
1775
|
-
var
|
|
1776
|
-
function
|
|
1777
|
-
if (!
|
|
1778
|
-
return
|
|
1779
|
-
var t =
|
|
1780
|
-
for (var
|
|
1781
|
-
|
|
1826
|
+
var Cr = Object.prototype, kr = Cr.hasOwnProperty;
|
|
1827
|
+
function jr(e) {
|
|
1828
|
+
if (!wt(e))
|
|
1829
|
+
return Nr(e);
|
|
1830
|
+
var t = Mt(e), i = [];
|
|
1831
|
+
for (var n in e)
|
|
1832
|
+
n == "constructor" && (t || !kr.call(e, n)) || i.push(n);
|
|
1782
1833
|
return i;
|
|
1783
1834
|
}
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
return Va(e) ? Ra(e, !0) : ja(e);
|
|
1835
|
+
function zr(e) {
|
|
1836
|
+
return Et(e) ? Xe(e, !0) : jr(e);
|
|
1787
1837
|
}
|
|
1788
|
-
var
|
|
1789
|
-
|
|
1838
|
+
var He = Object.prototype, Lr = He.hasOwnProperty;
|
|
1839
|
+
Re(function(e, t) {
|
|
1790
1840
|
e = Object(e);
|
|
1791
|
-
var i = -1,
|
|
1792
|
-
for (
|
|
1793
|
-
for (var a = t[i],
|
|
1794
|
-
var
|
|
1795
|
-
(u === void 0 ||
|
|
1841
|
+
var i = -1, n = t.length, r = n > 2 ? t[2] : void 0;
|
|
1842
|
+
for (r && Pe(t[0], t[1], r) && (n = 1); ++i < n; )
|
|
1843
|
+
for (var a = t[i], o = zr(a), s = -1, c = o.length; ++s < c; ) {
|
|
1844
|
+
var l = o[s], u = e[l];
|
|
1845
|
+
(u === void 0 || Pt(u, He[l]) && !Lr.call(e, l)) && (e[l] = a[l]);
|
|
1796
1846
|
}
|
|
1797
1847
|
return e;
|
|
1798
1848
|
});
|
|
1799
|
-
const
|
|
1800
|
-
Ba();
|
|
1801
|
-
function Ba() {
|
|
1802
|
-
return Ua && "IntersectionObserver" in window && "IntersectionObserverEntry" in window && "intersectionRatio" in window.IntersectionObserverEntry.prototype ? ("isIntersecting" in window.IntersectionObserverEntry.prototype || Object.defineProperty(window.IntersectionObserverEntry.prototype, "isIntersecting", {
|
|
1803
|
-
get() {
|
|
1804
|
-
return this.intersectionRatio > 0;
|
|
1805
|
-
}
|
|
1806
|
-
}), !0) : !1;
|
|
1807
|
-
}
|
|
1808
|
-
var Ka = (e, t) => {
|
|
1809
|
-
const i = e.__vccOpts || e;
|
|
1810
|
-
for (const [r, n] of t)
|
|
1811
|
-
i[r] = n;
|
|
1812
|
-
return i;
|
|
1813
|
-
};
|
|
1814
|
-
const Ga = Ee({
|
|
1849
|
+
const Vr = Se({
|
|
1815
1850
|
name: "Viewer",
|
|
1816
1851
|
props: {
|
|
1817
1852
|
images: {
|
|
@@ -1834,65 +1869,82 @@ const Ga = Ee({
|
|
|
1834
1869
|
emits: ["inited"],
|
|
1835
1870
|
setup(e, { emit: t }) {
|
|
1836
1871
|
let i;
|
|
1837
|
-
const
|
|
1838
|
-
function
|
|
1839
|
-
i = new
|
|
1872
|
+
const n = qe();
|
|
1873
|
+
function r() {
|
|
1874
|
+
i = new Ie(n.value, e.options), t("inited", i);
|
|
1840
1875
|
}
|
|
1841
1876
|
function a() {
|
|
1842
1877
|
i && i.destroy();
|
|
1843
1878
|
}
|
|
1844
|
-
function
|
|
1845
|
-
a(),
|
|
1879
|
+
function o() {
|
|
1880
|
+
a(), r();
|
|
1846
1881
|
}
|
|
1847
|
-
function
|
|
1848
|
-
i ? (i.update(), t("inited", i)) :
|
|
1882
|
+
function s() {
|
|
1883
|
+
i ? (i.update(), t("inited", i)) : r();
|
|
1849
1884
|
}
|
|
1850
|
-
function
|
|
1851
|
-
e.rebuild ?
|
|
1885
|
+
function c() {
|
|
1886
|
+
e.rebuild ? o() : s();
|
|
1852
1887
|
}
|
|
1853
|
-
const
|
|
1854
|
-
return
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1888
|
+
const l = { deep: !0 };
|
|
1889
|
+
return Tt(() => e.images, () => {
|
|
1890
|
+
Ot(() => {
|
|
1891
|
+
c();
|
|
1892
|
+
});
|
|
1893
|
+
}, l), Tt(() => e.trigger, () => {
|
|
1894
|
+
Ot(() => {
|
|
1895
|
+
c();
|
|
1896
|
+
});
|
|
1897
|
+
}, l), Tt(() => e.options, () => {
|
|
1898
|
+
Ot(() => {
|
|
1899
|
+
o();
|
|
1900
|
+
});
|
|
1901
|
+
}, l), Ue(() => r()), Be(() => a()), {
|
|
1902
|
+
root: n,
|
|
1903
|
+
createViewer: r,
|
|
1904
|
+
rebuildViewer: o,
|
|
1905
|
+
updateViewer: s,
|
|
1859
1906
|
destroyViewer: a
|
|
1860
1907
|
};
|
|
1861
1908
|
}
|
|
1862
|
-
}),
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1909
|
+
}), Rr = (e, t) => {
|
|
1910
|
+
const i = e.__vccOpts || e;
|
|
1911
|
+
for (const [n, r] of t)
|
|
1912
|
+
i[n] = r;
|
|
1913
|
+
return i;
|
|
1914
|
+
}, Fr = { ref: "root" };
|
|
1915
|
+
function Pr(e, t, i, n, r, a) {
|
|
1916
|
+
return ft(), At("div", Fr, [
|
|
1917
|
+
Ze(e.$slots, "default", {
|
|
1866
1918
|
images: e.images,
|
|
1867
1919
|
options: e.options
|
|
1868
1920
|
})
|
|
1869
1921
|
], 512);
|
|
1870
1922
|
}
|
|
1871
|
-
|
|
1872
|
-
const
|
|
1923
|
+
const Mr = /* @__PURE__ */ Rr(Vr, [["render", Pr]]);
|
|
1924
|
+
const Yr = ["src"], Wr = /* @__PURE__ */ Se({
|
|
1873
1925
|
__name: "ImageViewer",
|
|
1874
1926
|
props: {
|
|
1875
|
-
image:
|
|
1927
|
+
image: {}
|
|
1876
1928
|
},
|
|
1877
1929
|
setup(e) {
|
|
1878
|
-
const t = e, i =
|
|
1879
|
-
return (
|
|
1880
|
-
images:
|
|
1930
|
+
const t = e, i = $e(() => t.image ? [{ src: t.image, index: 0 }] : []);
|
|
1931
|
+
return (n, r) => (ft(), Ke(Ge(Mr), {
|
|
1932
|
+
images: i.value,
|
|
1881
1933
|
style: { height: "100%" }
|
|
1882
1934
|
}, {
|
|
1883
|
-
default:
|
|
1884
|
-
(ft(!0),
|
|
1935
|
+
default: Qe(() => [
|
|
1936
|
+
(ft(!0), At(Je, null, ti(i.value, (a) => (ft(), At("img", {
|
|
1885
1937
|
alt: "图片",
|
|
1886
1938
|
src: a.src,
|
|
1887
1939
|
key: a.index,
|
|
1888
1940
|
class: "image"
|
|
1889
|
-
}, null, 8,
|
|
1941
|
+
}, null, 8, Yr))), 128))
|
|
1890
1942
|
]),
|
|
1891
1943
|
_: 1
|
|
1892
1944
|
}, 8, ["images"]));
|
|
1893
1945
|
}
|
|
1894
1946
|
});
|
|
1895
|
-
const
|
|
1947
|
+
const qr = /* @__PURE__ */ ei(Wr, [["__scopeId", "data-v-b0f61c51"]]);
|
|
1896
1948
|
export {
|
|
1897
|
-
|
|
1949
|
+
qr as default
|
|
1898
1950
|
};
|