@xwadex/fesd 0.0.61 → 0.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/image-preview-bundle.js +279 -270
- package/dist/image-preview-bundle.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var Ke = (n, i, t) => (
|
|
1
|
+
var Is = Object.defineProperty;
|
|
2
|
+
var qs = (n, i, t) => i in n ? Is(n, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[i] = t;
|
|
3
|
+
var Ke = (n, i, t) => (qs(n, typeof i != "symbol" ? i + "" : i, t), t), Ms = (n, i, t) => {
|
|
4
4
|
if (!i.has(n))
|
|
5
5
|
throw TypeError("Cannot " + t);
|
|
6
6
|
};
|
|
7
|
-
var
|
|
7
|
+
var p = (n, i, t) => {
|
|
8
8
|
if (i.has(n))
|
|
9
9
|
throw TypeError("Cannot add the same private member more than once");
|
|
10
10
|
i instanceof WeakSet ? i.add(n) : i.set(n, t);
|
|
11
11
|
};
|
|
12
|
-
var d = (n, i, t) => (
|
|
12
|
+
var d = (n, i, t) => (Ms(n, i, "access private method"), t);
|
|
13
13
|
import f from "jquery";
|
|
14
14
|
import { OverlayScrollbars as Fe } from "overlayscrollbars";
|
|
15
15
|
import "./vendor-bundle.js";
|
|
@@ -116,7 +116,7 @@ const xe = {
|
|
|
116
116
|
</div>
|
|
117
117
|
`;
|
|
118
118
|
}
|
|
119
|
-
},
|
|
119
|
+
}, I = {
|
|
120
120
|
SETTINGS: {
|
|
121
121
|
direction: "left",
|
|
122
122
|
// 方向 - top || right || bottom || left
|
|
@@ -213,7 +213,7 @@ const xe = {
|
|
|
213
213
|
beforeScroll: null,
|
|
214
214
|
afterScroll: null
|
|
215
215
|
}
|
|
216
|
-
},
|
|
216
|
+
}, M = {
|
|
217
217
|
SETTINGS: {
|
|
218
218
|
type: "drag",
|
|
219
219
|
drag: {
|
|
@@ -308,7 +308,7 @@ const xe = {
|
|
|
308
308
|
update: null,
|
|
309
309
|
afterUpdate: null
|
|
310
310
|
}
|
|
311
|
-
},
|
|
311
|
+
}, pi = {
|
|
312
312
|
SETTINGS: {
|
|
313
313
|
// 是否要加 hover 效果?
|
|
314
314
|
hover: !0,
|
|
@@ -323,21 +323,21 @@ const xe = {
|
|
|
323
323
|
// hover 毫秒 ?
|
|
324
324
|
speed: 600
|
|
325
325
|
}
|
|
326
|
-
},
|
|
326
|
+
}, In = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
327
327
|
__proto__: null,
|
|
328
328
|
anchor4: bt,
|
|
329
329
|
aost4: ci,
|
|
330
330
|
article4: js,
|
|
331
331
|
collapse4: ui,
|
|
332
332
|
dropdown4: Je,
|
|
333
|
-
marquee4:
|
|
333
|
+
marquee4: I,
|
|
334
334
|
modal4: j,
|
|
335
|
-
multipurpose4:
|
|
336
|
-
ripple4:
|
|
335
|
+
multipurpose4: M,
|
|
336
|
+
ripple4: pi,
|
|
337
337
|
share4: Ns,
|
|
338
338
|
tab4: di,
|
|
339
339
|
video4: xe
|
|
340
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
340
|
+
}, Symbol.toStringTag, { value: "Module" })), S = {
|
|
341
341
|
before: "beforebegin",
|
|
342
342
|
after: "afterend",
|
|
343
343
|
append: "beforeend",
|
|
@@ -398,28 +398,28 @@ const xe = {
|
|
|
398
398
|
return -t * ((n = n / e - 1) * n * n * n - 1) + i;
|
|
399
399
|
}
|
|
400
400
|
}, Ce = (n, i) => {
|
|
401
|
-
const { target: t, container: e, spacer: s, speed: o, gap: a, easing: r, direction: l } = n, c = l === "horizontal", u = c ? "scrollLeft" : "scrollTop",
|
|
401
|
+
const { target: t, container: e, spacer: s, speed: o, gap: a, easing: r, direction: l } = n, c = l === "horizontal", u = c ? "scrollLeft" : "scrollTop", h = c ? "left" : "top", g = c ? "width" : "height", m = A(e) ? _(e) : document.scrollingElement, v = m[u], w = A(t) ? _(t).getBoundingClientRect()[h] : 0 - v, b = A(s) ? _(s).getBoundingClientRect()[g] : 0, T = w - a - b, C = 15;
|
|
402
402
|
let y = 0;
|
|
403
403
|
if (T === 0)
|
|
404
404
|
return;
|
|
405
|
-
const
|
|
405
|
+
const L = (k) => {
|
|
406
406
|
const F = _(t);
|
|
407
407
|
i && i.emit(k, F), !i && n.on && G(n.on[k]) && n.on[k](F);
|
|
408
408
|
};
|
|
409
|
-
|
|
409
|
+
L("beforeScroll");
|
|
410
410
|
const O = () => {
|
|
411
411
|
y += C;
|
|
412
412
|
const k = Gs[r](y, v, T, o);
|
|
413
|
-
m[u] = k, y < o && requestAnimationFrame(O), y >= o &&
|
|
413
|
+
m[u] = k, y < o && requestAnimationFrame(O), y >= o && L("afterScroll");
|
|
414
414
|
};
|
|
415
415
|
requestAnimationFrame(O);
|
|
416
416
|
};
|
|
417
417
|
var tt, He, Et, mi, At, gi;
|
|
418
|
-
class
|
|
418
|
+
class hi {
|
|
419
419
|
constructor(i, t = {}) {
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
420
|
+
p(this, tt);
|
|
421
|
+
p(this, Et);
|
|
422
|
+
p(this, At);
|
|
423
423
|
this.__storage__ = {
|
|
424
424
|
el: i,
|
|
425
425
|
options: t
|
|
@@ -482,7 +482,7 @@ tt = new WeakSet(), He = function() {
|
|
|
482
482
|
Ce(s, e);
|
|
483
483
|
}, s.delay);
|
|
484
484
|
};
|
|
485
|
-
Object.assign(
|
|
485
|
+
Object.assign(hi.prototype, z);
|
|
486
486
|
window.MODALS || (window.MODALS = {});
|
|
487
487
|
const { MODALS: P } = window, Rs = (n) => {
|
|
488
488
|
const { TEMPLATE: i } = j, { childDom: t } = n, e = document.createElement("div");
|
|
@@ -492,15 +492,15 @@ const { MODALS: P } = window, Rs = (n) => {
|
|
|
492
492
|
s.append(o);
|
|
493
493
|
}), e.children[0];
|
|
494
494
|
};
|
|
495
|
-
var
|
|
495
|
+
var St, vi, Lt, bi, _t, yi, Dt, wi, kt, Ti;
|
|
496
496
|
class fi extends HTMLElement {
|
|
497
497
|
constructor() {
|
|
498
498
|
super();
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
499
|
+
p(this, St);
|
|
500
|
+
p(this, Lt);
|
|
501
|
+
p(this, _t);
|
|
502
|
+
p(this, Dt);
|
|
503
|
+
p(this, kt);
|
|
504
504
|
this.initialize = !1;
|
|
505
505
|
}
|
|
506
506
|
static get observedAttributes() {
|
|
@@ -514,7 +514,7 @@ class fi extends HTMLElement {
|
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
516
|
connectedCallback() {
|
|
517
|
-
this.initialize || (this.initialize = !0, d(this,
|
|
517
|
+
this.initialize || (this.initialize = !0, d(this, St, vi).call(this));
|
|
518
518
|
}
|
|
519
519
|
open() {
|
|
520
520
|
return this.setAttribute(":state", "open"), this;
|
|
@@ -526,12 +526,12 @@ class fi extends HTMLElement {
|
|
|
526
526
|
return this.setAttribute(":state", "destroy"), this;
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
|
-
|
|
529
|
+
St = new WeakSet(), vi = function() {
|
|
530
530
|
const { ATTRS: t } = j;
|
|
531
531
|
this.__events__ = {}, this.getAttribute(":state") || this.setAttribute(":state", "close");
|
|
532
532
|
const e = this.getAttribute(t.id) || zs();
|
|
533
|
-
this.getAttribute(t.id) || (E(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), P[e] && E(`the ${t.id} "${e}" is already be used.`), P[e] = this, d(this,
|
|
534
|
-
},
|
|
533
|
+
this.getAttribute(t.id) || (E(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), P[e] && E(`the ${t.id} "${e}" is already be used.`), P[e] = this, d(this, Lt, bi).call(this);
|
|
534
|
+
}, Lt = new WeakSet(), bi = function() {
|
|
535
535
|
this.childDom = this.childNodes, this.template = Rs(this), this.innerHTML = "", this.append(this.template), d(this, _t, yi).call(this);
|
|
536
536
|
}, _t = new WeakSet(), yi = function() {
|
|
537
537
|
const t = this.querySelector(".modal-scroller");
|
|
@@ -598,8 +598,8 @@ const { MODALS: Ze } = window, ft = {}, Ei = (n, i, ...t) => {
|
|
|
598
598
|
n && G(n) && n.apply(V, i);
|
|
599
599
|
}, ti = (n, i) => {
|
|
600
600
|
const { target: t } = n, e = Ze[t] || _(n.target);
|
|
601
|
-
e &&
|
|
602
|
-
},
|
|
601
|
+
e && Si(n, i), e || Xs(n, i);
|
|
602
|
+
}, Si = (n, i) => {
|
|
603
603
|
const { target: t, action: e, on: s, e: o } = n, a = Ze[t] || _(n.target);
|
|
604
604
|
switch (["open", "close", "destroy"].forEach((l) => {
|
|
605
605
|
a.once(l, () => {
|
|
@@ -632,22 +632,22 @@ const { MODALS: Ze } = window, ft = {}, Ei = (n, i, ...t) => {
|
|
|
632
632
|
[...c].forEach((g) => {
|
|
633
633
|
u.append(g);
|
|
634
634
|
});
|
|
635
|
-
const
|
|
636
|
-
r("complete",
|
|
635
|
+
const h = Ze[t] || _(n.target);
|
|
636
|
+
r("complete", h), Si(n, i), delete ft[t];
|
|
637
637
|
}).catch((l) => {
|
|
638
638
|
r("error", l), delete ft[t];
|
|
639
639
|
}));
|
|
640
640
|
};
|
|
641
|
-
var et,
|
|
641
|
+
var et, Ie, xt, Li, $t, _i;
|
|
642
642
|
const B = class B {
|
|
643
643
|
constructor(i, t = {}) {
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
644
|
+
p(this, et);
|
|
645
|
+
p(this, xt);
|
|
646
|
+
p(this, $t);
|
|
647
647
|
this.__storage__ = {
|
|
648
648
|
el: i,
|
|
649
649
|
options: t
|
|
650
|
-
}, this.active = "data-modal-active", d(this, et,
|
|
650
|
+
}, this.active = "data-modal-active", d(this, et, Ie).call(this);
|
|
651
651
|
}
|
|
652
652
|
destroy() {
|
|
653
653
|
const { elements: i } = this;
|
|
@@ -657,7 +657,7 @@ const B = class B {
|
|
|
657
657
|
}
|
|
658
658
|
update() {
|
|
659
659
|
var i;
|
|
660
|
-
return d(i = this.destroy(), et,
|
|
660
|
+
return d(i = this.destroy(), et, Ie).call(i), this.emit("update"), this;
|
|
661
661
|
}
|
|
662
662
|
/** static method 'open' */
|
|
663
663
|
static open(i) {
|
|
@@ -673,7 +673,7 @@ const B = class B {
|
|
|
673
673
|
Object.assign(B.prototype, B.prototype.__methods__);
|
|
674
674
|
}
|
|
675
675
|
};
|
|
676
|
-
et = new WeakSet(),
|
|
676
|
+
et = new WeakSet(), Ie = function() {
|
|
677
677
|
const { el: i, options: t } = this.__storage__;
|
|
678
678
|
if (!mt(i) || !A(i))
|
|
679
679
|
return;
|
|
@@ -681,8 +681,8 @@ et = new WeakSet(), Me = function() {
|
|
|
681
681
|
if (this.elements = t.state == "not active" ? D(i + `:not([${this.active}])`) : D(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
682
682
|
for (const [o, a] of Object.entries(this.options.on))
|
|
683
683
|
this.__events__[o] = [a];
|
|
684
|
-
d(this, xt,
|
|
685
|
-
}, xt = new WeakSet(),
|
|
684
|
+
d(this, xt, Li).call(this);
|
|
685
|
+
}, xt = new WeakSet(), Li = function() {
|
|
686
686
|
const { elements: i, options: t } = this;
|
|
687
687
|
i.forEach((e) => {
|
|
688
688
|
e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this, $t, _i), e.modal.defaultOptions = t, e.modal.methods = {}, e.modal.methods.destroy = this.destroy, e.modal.methods.update = this.update, e.addEventListener("click", e.modal.eventHandler), e.setAttribute(this.active, "");
|
|
@@ -708,28 +708,28 @@ customElements.define("modern-modal", fi);
|
|
|
708
708
|
const Us = (n, i) => {
|
|
709
709
|
const t = n === window ? n.innerHeight : n.getBoundingClientRect().height, e = n === window ? 0 : n.getBoundingClientRect().top;
|
|
710
710
|
i.forEach((s) => {
|
|
711
|
-
const { class: o, delay: a, start: r, end: l, repeat: c, instance: u } = s.aost, { top:
|
|
712
|
-
if (
|
|
711
|
+
const { class: o, delay: a, start: r, end: l, repeat: c, instance: u } = s.aost, { top: h, bottom: g } = s.getBoundingClientRect(), m = t * (r / 100), v = t * (l / 100);
|
|
712
|
+
if (h - e <= m && g - e >= v && s.offsetParent)
|
|
713
713
|
setTimeout(() => {
|
|
714
714
|
s.classList.add(o);
|
|
715
715
|
}, a);
|
|
716
716
|
else {
|
|
717
|
-
const b = s.classList.contains(o) && c === "down" &&
|
|
717
|
+
const b = s.classList.contains(o) && c === "down" && h - e >= m || c === "up" && g - e <= v || c === !0;
|
|
718
718
|
setTimeout(() => {
|
|
719
719
|
b && s.classList.remove(o);
|
|
720
720
|
}, a);
|
|
721
721
|
}
|
|
722
722
|
});
|
|
723
723
|
}, Ys = (n, i) => n === "up" || n === "down" ? n : n !== null ? n === "true" ? !0 : n === "false" ? !1 : i.repeat : i.repeat;
|
|
724
|
-
var it,
|
|
724
|
+
var it, qe, Ct, ki;
|
|
725
725
|
class Di {
|
|
726
726
|
constructor(i, t = {}) {
|
|
727
|
-
|
|
728
|
-
|
|
727
|
+
p(this, it);
|
|
728
|
+
p(this, Ct);
|
|
729
729
|
this.__storage__ = {
|
|
730
730
|
el: i,
|
|
731
731
|
options: t
|
|
732
|
-
}, this.active = "data-aost-active", d(this, it,
|
|
732
|
+
}, this.active = "data-aost-active", d(this, it, qe).call(this);
|
|
733
733
|
}
|
|
734
734
|
destroy(i) {
|
|
735
735
|
const { elements: t, options: e } = this;
|
|
@@ -745,10 +745,10 @@ class Di {
|
|
|
745
745
|
}
|
|
746
746
|
update(i) {
|
|
747
747
|
var t;
|
|
748
|
-
d(t = this.destroy(i), it,
|
|
748
|
+
d(t = this.destroy(i), it, qe).call(t);
|
|
749
749
|
}
|
|
750
750
|
}
|
|
751
|
-
it = new WeakSet(),
|
|
751
|
+
it = new WeakSet(), qe = function() {
|
|
752
752
|
const { el: i, options: t } = this.__storage__;
|
|
753
753
|
if (!mt(i) || !A(i))
|
|
754
754
|
return;
|
|
@@ -776,26 +776,26 @@ const Fs = (n) => {
|
|
|
776
776
|
s.append(o);
|
|
777
777
|
}), e.children[0];
|
|
778
778
|
};
|
|
779
|
-
var Ht, xi,
|
|
779
|
+
var Ht, xi, It, $i, qt, Ci, Mt, Hi, Ot, Ii, Pt, qi, Nt, Mi, jt, Oi, zt, Pi, Bt, Ni;
|
|
780
780
|
class Js extends HTMLElement {
|
|
781
781
|
constructor() {
|
|
782
782
|
super();
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
783
|
+
p(this, Ht);
|
|
784
|
+
p(this, It);
|
|
785
|
+
p(this, qt);
|
|
786
786
|
// youtube iframe
|
|
787
|
-
|
|
787
|
+
p(this, Mt);
|
|
788
788
|
// vimeo iframe
|
|
789
|
-
|
|
789
|
+
p(this, Ot);
|
|
790
790
|
// youku iframe
|
|
791
|
-
|
|
792
|
-
|
|
791
|
+
p(this, Pt);
|
|
792
|
+
p(this, Nt);
|
|
793
793
|
// 2025.02.11 新增 ig
|
|
794
|
-
|
|
794
|
+
p(this, jt);
|
|
795
795
|
// 2025.02.11 新增 tiktok
|
|
796
|
-
|
|
796
|
+
p(this, zt);
|
|
797
797
|
// 2026.01.15 新增 video
|
|
798
|
-
|
|
798
|
+
p(this, Bt);
|
|
799
799
|
d(this, Ht, xi).call(this);
|
|
800
800
|
}
|
|
801
801
|
play() {
|
|
@@ -838,10 +838,10 @@ Ht = new WeakSet(), xi = function() {
|
|
|
838
838
|
E("videoPlayer", "video-render needs a ['video-id'] attribute to creat player.");
|
|
839
839
|
return;
|
|
840
840
|
}
|
|
841
|
-
this.videoId = this.getAttribute("video-id"), this.videoType = this.getAttribute("video-type"), this.videoMode = this.getAttribute("video-mode"), this.autoplay = this.getAttribute("video-autoplay"), this.startTime = this.getAttribute("video-starttime"), this.videoInboxImg = this.getAttribute("video-inbox-img"), d(this,
|
|
842
|
-
},
|
|
843
|
-
this.childDom = this.childNodes, this.template = Fs(this), this.innerHTML = "", this.append(this.template), d(this,
|
|
844
|
-
},
|
|
841
|
+
this.videoId = this.getAttribute("video-id"), this.videoType = this.getAttribute("video-type"), this.videoMode = this.getAttribute("video-mode"), this.autoplay = this.getAttribute("video-autoplay"), this.startTime = this.getAttribute("video-starttime"), this.videoInboxImg = this.getAttribute("video-inbox-img"), d(this, It, $i).call(this);
|
|
842
|
+
}, It = new WeakSet(), $i = function() {
|
|
843
|
+
this.childDom = this.childNodes, this.template = Fs(this), this.innerHTML = "", this.append(this.template), d(this, qt, Ci).call(this);
|
|
844
|
+
}, qt = new WeakSet(), Ci = function() {
|
|
845
845
|
const { videoType: t, videoMode: e } = this, { COOKIEDISAGREELAYOUT: s } = xe;
|
|
846
846
|
let o = "";
|
|
847
847
|
function a(r) {
|
|
@@ -851,18 +851,18 @@ Ht = new WeakSet(), xi = function() {
|
|
|
851
851
|
case "youtubeAPI":
|
|
852
852
|
break;
|
|
853
853
|
case "youtube":
|
|
854
|
-
document.body.wd_youtube == !1 ? a("video-player") : o = d(this,
|
|
854
|
+
document.body.wd_youtube == !1 ? a("video-player") : o = d(this, Mt, Hi).call(this);
|
|
855
855
|
break;
|
|
856
856
|
case "youkuAPI":
|
|
857
857
|
break;
|
|
858
858
|
case "youku":
|
|
859
|
-
document.body.wd_youku == !1 ? a("video-player") : o = d(this, Pt,
|
|
859
|
+
document.body.wd_youku == !1 ? a("video-player") : o = d(this, Pt, qi).call(this);
|
|
860
860
|
break;
|
|
861
861
|
case "vimeo":
|
|
862
|
-
document.body.wd_vimeo == !1 ? a("video-player") : o = d(this, Ot,
|
|
862
|
+
document.body.wd_vimeo == !1 ? a("video-player") : o = d(this, Ot, Ii).call(this);
|
|
863
863
|
break;
|
|
864
864
|
case "bilibili":
|
|
865
|
-
document.body.wd_bilibili == !1 ? a("video-player") : o = d(this, Nt,
|
|
865
|
+
document.body.wd_bilibili == !1 ? a("video-player") : o = d(this, Nt, Mi).call(this);
|
|
866
866
|
break;
|
|
867
867
|
case "instagram":
|
|
868
868
|
document.body.wd_instagram == !1 ? a(".instagram-media") : o = d(this, jt, Oi).call(this);
|
|
@@ -876,17 +876,17 @@ Ht = new WeakSet(), xi = function() {
|
|
|
876
876
|
o = d(this, Bt, Ni).call(this);
|
|
877
877
|
break;
|
|
878
878
|
}
|
|
879
|
-
this.querySelector(".player-wrapper").insertAdjacentHTML(
|
|
880
|
-
},
|
|
879
|
+
this.querySelector(".player-wrapper").insertAdjacentHTML(S.prepend, o);
|
|
880
|
+
}, Mt = new WeakSet(), Hi = function() {
|
|
881
881
|
const { videoId: t, autoplay: e, startTime: s } = this;
|
|
882
882
|
return `<iframe src="https://www.youtube.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}&start=${s}&mute=1&loop=1&enablejsapi=1" frameborder="0" allowfullscreen="0" volumn="0" allow="${e === "on" ? "autoplay;" : ""} encrypted-media; gyroscope; picture-in-picture;"></iframe>`;
|
|
883
|
-
}, Ot = new WeakSet(),
|
|
883
|
+
}, Ot = new WeakSet(), Ii = function() {
|
|
884
884
|
const { videoId: t, autoplay: e, hash: s } = this;
|
|
885
885
|
return `<iframe src="https://player.vimeo.com/video/${t}?h=${s}&${e === "on" ? "autoplay=1" : ""}&loop=1&color=ffffff&title=0&byline=0&portrait=0" frameborder="0" allow="${e === "on" ? "autoplay;" : ""} fullscreen; picture-in-picture" allowfullscreen></iframe><script src="https://player.vimeo.com/api/player.js"><\/script>`;
|
|
886
|
-
}, Pt = new WeakSet(),
|
|
886
|
+
}, Pt = new WeakSet(), qi = function() {
|
|
887
887
|
const { videoId: t, autoplay: e } = this;
|
|
888
888
|
return `<iframe src="https://player.youku.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}" frameborder=0 "allowfullscreen"></iframe>`;
|
|
889
|
-
}, Nt = new WeakSet(),
|
|
889
|
+
}, Nt = new WeakSet(), Mi = function() {
|
|
890
890
|
const { videoId: t, autoplay: e } = this;
|
|
891
891
|
return `<iframe src="//player.bilibili.com/player.html?bvid=${t}&page=1&as_wide=1&high_quality=1&danmaku=0" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>`;
|
|
892
892
|
}, jt = new WeakSet(), Oi = function() {
|
|
@@ -908,15 +908,14 @@ function ji(n) {
|
|
|
908
908
|
}
|
|
909
909
|
function zi(n) {
|
|
910
910
|
const i = ji(n);
|
|
911
|
-
Q += 1, Q === 1 &&
|
|
911
|
+
Q += 1, Q === 1 && document.documentElement.classList.add("scrollLock"), Os(i);
|
|
912
912
|
}
|
|
913
913
|
function Bi(n) {
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
}
|
|
914
|
+
Q = Math.max(0, Q - 1);
|
|
915
|
+
const i = ji(n);
|
|
916
|
+
Ps(i), Q === 0 && document.documentElement.classList.remove("scrollLock");
|
|
918
917
|
}
|
|
919
|
-
async function
|
|
918
|
+
async function qn(n = 0) {
|
|
920
919
|
if (f(".loading-wrapper").length)
|
|
921
920
|
return;
|
|
922
921
|
f("body").append(`
|
|
@@ -933,16 +932,16 @@ async function In(n = 0) {
|
|
|
933
932
|
zi();
|
|
934
933
|
});
|
|
935
934
|
}
|
|
936
|
-
function
|
|
935
|
+
function Mn() {
|
|
937
936
|
f(".loading-wrapper").fadeOut(300).promise().done(function() {
|
|
938
937
|
f(".loading-wrapper").remove(), Bi();
|
|
939
938
|
});
|
|
940
939
|
}
|
|
941
940
|
function On(n, i) {
|
|
942
|
-
new
|
|
941
|
+
new Sn(n, i);
|
|
943
942
|
}
|
|
944
943
|
function Zs() {
|
|
945
|
-
const n = document.querySelector("[data-aost]") && new Di("[data-aost]"), i = document.querySelector("[data-anchor-target]") && new
|
|
944
|
+
const n = document.querySelector("[data-aost]") && new Di("[data-aost]"), i = document.querySelector("[data-anchor-target]") && new hi("[data-anchor-target]"), t = new li({ callback_loaded: () => {
|
|
946
945
|
} }), e = new vn();
|
|
947
946
|
n == null || n.update(), t.update(), e.reValidate(), i == null || i.update();
|
|
948
947
|
}
|
|
@@ -1046,8 +1045,8 @@ function Yn() {
|
|
|
1046
1045
|
function Fn(n, i, t, e, s) {
|
|
1047
1046
|
const o = this, r = f(n).html().split("<br>");
|
|
1048
1047
|
let l = "", c = 0;
|
|
1049
|
-
r.forEach((u,
|
|
1050
|
-
|
|
1048
|
+
r.forEach((u, h) => {
|
|
1049
|
+
h !== 0 && (l += "<br>"), u.split("").forEach((m, v) => {
|
|
1051
1050
|
i ? (v === 0 && (l += '<span class="letter-wrap" style="display: inline-block">'), m === " " ? l += '</span> <span class="letter-wrap" style="display: inline-block">' : (l += `<span class="letter"${s || t ? ` style="${s ? `transition: ${o.formatFloat(Math.random(), 2) * s}s;` : ""}${t ? t === "random" ? `transition-delay: ${o.formatFloat(Math.random(), 2)}s;` : `transition-delay: ${t + c * e}s;` : ""}"` : ""}>${m}</span>`, c++), v === u.length - 1 && (l += "</span>")) : m === " " ? l += " " : (l += `<span class="letter"${s || t ? ` style="${s ? `transition: ${o.formatFloat(Math.random(), 2) * s}s;` : ""}${t ? t === "random" ? `transition-delay: ${o.formatFloat(Math.random(), 2)}s;` : `transition-delay: ${t + c * e}s;` : ""}"` : ""}>${m}</span>`, c++);
|
|
1052
1051
|
});
|
|
1053
1052
|
}), f(n).html(l);
|
|
@@ -1137,13 +1136,13 @@ var st, Oe, Wt, Wi, nt, Pe, ot, Ne, Gt, Gi, at, je, Rt, Ri;
|
|
|
1137
1136
|
const X = class X {
|
|
1138
1137
|
//*-* 給Article4用的 **//
|
|
1139
1138
|
constructor(i, t = {}) {
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1139
|
+
p(this, st);
|
|
1140
|
+
p(this, Wt);
|
|
1141
|
+
p(this, nt);
|
|
1142
|
+
p(this, ot);
|
|
1143
|
+
p(this, Gt);
|
|
1144
|
+
p(this, at);
|
|
1145
|
+
p(this, Rt);
|
|
1147
1146
|
if (!mt(i) && !$e(i) && !gt(i)) {
|
|
1148
1147
|
Ve("video4", `找不到該物件 -> ${i}`);
|
|
1149
1148
|
return;
|
|
@@ -1201,16 +1200,16 @@ st = new WeakSet(), Oe = function() {
|
|
|
1201
1200
|
});
|
|
1202
1201
|
}
|
|
1203
1202
|
}, Gt = new WeakSet(), Gi = function(i) {
|
|
1204
|
-
const { LAYOUT: t } = this.options, e = i.video.params, { $selector: s, videoLayoutNo: o, videoId: a, videoType: r, videoMode: l, videoButton: c, videoCover: u, videoHighQualityPic:
|
|
1203
|
+
const { LAYOUT: t } = this.options, e = i.video.params, { $selector: s, videoLayoutNo: o, videoId: a, videoType: r, videoMode: l, videoButton: c, videoCover: u, videoHighQualityPic: h } = e;
|
|
1205
1204
|
if (l === "onBox" || l === "inBox") {
|
|
1206
1205
|
let g = null;
|
|
1207
1206
|
if (u === "on") {
|
|
1208
|
-
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(
|
|
1207
|
+
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(S.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), E("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
|
|
1209
1208
|
const m = s.querySelector("img"), v = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src")), w = t[o] ? t[o] : t[0] || "";
|
|
1210
|
-
if (w ? m.insertAdjacentHTML(
|
|
1209
|
+
if (w ? m.insertAdjacentHTML(S.after, w) : E("video4", `找不到對應的 LAYOUT 設定 (No: ${o}),且無預設樣式。`), !v)
|
|
1211
1210
|
d(this, ot, Ne).call(this, m, e);
|
|
1212
1211
|
else if (!v && r == "youtube")
|
|
1213
|
-
|
|
1212
|
+
h == "on" ? m.setAttribute("src", `https://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`);
|
|
1214
1213
|
else if (!v && r == "vimeo")
|
|
1215
1214
|
m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`);
|
|
1216
1215
|
else if (!v && r === "video") {
|
|
@@ -1233,11 +1232,11 @@ st = new WeakSet(), Oe = function() {
|
|
|
1233
1232
|
} else if (l === "onPage") {
|
|
1234
1233
|
let g = null;
|
|
1235
1234
|
if (u == "on") {
|
|
1236
|
-
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(
|
|
1235
|
+
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(S.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), E("video", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構"));
|
|
1237
1236
|
const m = s.querySelector("img");
|
|
1238
|
-
m.insertAdjacentHTML(
|
|
1237
|
+
m.insertAdjacentHTML(S.after, t[o]);
|
|
1239
1238
|
const v = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src"));
|
|
1240
|
-
v ? !v && r == "youtube" ?
|
|
1239
|
+
v ? !v && r == "youtube" ? h == "on" ? m.setAttribute("src", `http://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`) : !v && r == "vimeo" ? m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !v && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((w) => w.json()).then((w) => {
|
|
1241
1240
|
const b = w.thumbnail_url;
|
|
1242
1241
|
m.setAttribute("src", `${b}`);
|
|
1243
1242
|
}).catch(function(w) {
|
|
@@ -1258,7 +1257,7 @@ st = new WeakSet(), Oe = function() {
|
|
|
1258
1257
|
videoId: l,
|
|
1259
1258
|
videoTargetRoute: c,
|
|
1260
1259
|
videoType: u,
|
|
1261
|
-
videoIgHtml:
|
|
1260
|
+
videoIgHtml: h,
|
|
1262
1261
|
videoInboxImg: g,
|
|
1263
1262
|
videoButton: m,
|
|
1264
1263
|
videoLayoutNo: v,
|
|
@@ -1275,13 +1274,13 @@ st = new WeakSet(), Oe = function() {
|
|
|
1275
1274
|
route: c + `?${T.toString()}`,
|
|
1276
1275
|
on: {
|
|
1277
1276
|
complete(y) {
|
|
1278
|
-
var
|
|
1279
|
-
o == "onBox" && (u == "instagram" ? (y.setAttribute("video-typeStyle", `${u}`), (
|
|
1277
|
+
var L, O;
|
|
1278
|
+
o == "onBox" && (u == "instagram" ? (y.setAttribute("video-typeStyle", `${u}`), (L = window.instgrm) != null && L.Embeds ? (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", ii(t.params)), window.instgrm.Embeds.process()) : console.log("window.instgrm is undefined")) : (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", vt(t.params)), y.setAttribute("video-typeStyle", `${u}`))), o == "inBox" && (y.setAttribute("video-typeStyle", `${u}`), u == "instagram" && ((O = window.instgrm) != null && O.Embeds ? (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", ii(t.params)), window.instgrm.Embeds.process()) : console.log("window.instgrm is undefined")));
|
|
1280
1279
|
},
|
|
1281
1280
|
open(y) {
|
|
1282
1281
|
var O;
|
|
1283
|
-
const
|
|
1284
|
-
if (b.update(), zi([...
|
|
1282
|
+
const L = y.querySelectorAll("[data-overlayscrollbars-viewport]");
|
|
1283
|
+
if (b.update(), zi([...L]), u == "instagram") {
|
|
1285
1284
|
const k = document.querySelector("[video-template] .modal-content");
|
|
1286
1285
|
new ResizeObserver((J) => {
|
|
1287
1286
|
J[0].contentRect.height > 50 && k.classList.add("active");
|
|
@@ -1316,7 +1315,7 @@ st = new WeakSet(), Oe = function() {
|
|
|
1316
1315
|
/>
|
|
1317
1316
|
<img src="${J || ""}" alt="" />
|
|
1318
1317
|
</picture>
|
|
1319
|
-
</div>`, F.insertAdjacentHTML(
|
|
1318
|
+
</div>`, F.insertAdjacentHTML(S.prepend, k);
|
|
1320
1319
|
const Qe = y.querySelectorAll("[video-target]");
|
|
1321
1320
|
Qe.length > 0 && new X(Qe, {
|
|
1322
1321
|
LAYOUT: t.params.LAYOUT,
|
|
@@ -1327,8 +1326,8 @@ st = new WeakSet(), Oe = function() {
|
|
|
1327
1326
|
e == null || e.emit("openModal");
|
|
1328
1327
|
},
|
|
1329
1328
|
close(y) {
|
|
1330
|
-
const
|
|
1331
|
-
Bi([...
|
|
1329
|
+
const L = y.querySelectorAll("[data-overlayscrollbars-viewport]");
|
|
1330
|
+
Bi([...L]), e == null || e.emit("closeModal");
|
|
1332
1331
|
},
|
|
1333
1332
|
destroy(y) {
|
|
1334
1333
|
}
|
|
@@ -1366,8 +1365,8 @@ st = new WeakSet(), Oe = function() {
|
|
|
1366
1365
|
LAYOUT: t.LAYOUT || []
|
|
1367
1366
|
};
|
|
1368
1367
|
}, Ke(X, "globalOptions", {});
|
|
1369
|
-
let
|
|
1370
|
-
Object.assign(
|
|
1368
|
+
let Me = X;
|
|
1369
|
+
Object.assign(Me.prototype, z);
|
|
1371
1370
|
customElements.define("video-player", Js);
|
|
1372
1371
|
const Vs = {
|
|
1373
1372
|
"zh-tw": {
|
|
@@ -2210,8 +2209,8 @@ const tn = (n) => {
|
|
|
2210
2209
|
);
|
|
2211
2210
|
const l = e.querySelector(".dropdown-list");
|
|
2212
2211
|
return [...t].forEach((c) => {
|
|
2213
|
-
c.tagName === "LI" && (c.classList.contains("has-sublayer") ? [...c.querySelectorAll("li")].forEach((
|
|
2214
|
-
(!
|
|
2212
|
+
c.tagName === "LI" && (c.classList.contains("has-sublayer") ? [...c.querySelectorAll("li")].forEach((h) => {
|
|
2213
|
+
(!h.hasAttribute("data-option") || h.getAttribute("data-option").trim() === "") && h.setAttribute("data-option", h.textContent.trim());
|
|
2215
2214
|
}) : (!c.hasAttribute("data-option") || c.getAttribute("data-option").trim() === "") && c.setAttribute("data-option", c.textContent.trim())), l.append(c);
|
|
2216
2215
|
}), e.children[0];
|
|
2217
2216
|
}, en = (n) => {
|
|
@@ -2219,9 +2218,9 @@ const tn = (n) => {
|
|
|
2219
2218
|
const i = (t = n.getAttribute("control-elements")) == null ? void 0 : t.split(",");
|
|
2220
2219
|
i && i.forEach((e) => {
|
|
2221
2220
|
const s = document.querySelector(e);
|
|
2222
|
-
s || E("dropdown", `Can't not find control element(${e})`), s && s.classList.contains("disabled") && (s.classList.remove("disabled"), s.tagName === "DROPDOWN-EL" && s.s.activeLi &&
|
|
2221
|
+
s || E("dropdown", `Can't not find control element(${e})`), s && s.classList.contains("disabled") && (s.classList.remove("disabled"), s.tagName === "DROPDOWN-EL" && s.s.activeLi && q(s, [...s.s.allLi].indexOf(s.s.activeLi)));
|
|
2223
2222
|
});
|
|
2224
|
-
},
|
|
2223
|
+
}, q = (n, i) => {
|
|
2225
2224
|
const t = n.getAttribute("d4-placeholder"), e = n.s.dropdownEl.querySelectorAll(".dropdown-list li");
|
|
2226
2225
|
if (i < 0 || i.length === 0) {
|
|
2227
2226
|
switch (e.forEach((s) => {
|
|
@@ -2262,7 +2261,7 @@ const tn = (n) => {
|
|
|
2262
2261
|
const o = n.s.dropdownEl.querySelectorAll(".dropdown-list li.active");
|
|
2263
2262
|
o.length <= 0 ? n.s.selectDisplayEl.textContent = t.trim() : (n.s.selectDisplayEl.textContent = "", o.forEach((r) => {
|
|
2264
2263
|
const l = r.getAttribute("data-option"), c = r.textContent.trim(), u = `<div class="option-btn" data-option="${l}"><div class="text">${c}</div><div class="remove-icon"></div></div>`;
|
|
2265
|
-
n.s.selectDisplayEl.insertAdjacentHTML(
|
|
2264
|
+
n.s.selectDisplayEl.insertAdjacentHTML(S.append, u);
|
|
2266
2265
|
})), n.s.activeLi = o, n.s.value = [...o].map((r) => ({
|
|
2267
2266
|
index: [...e].indexOf(r),
|
|
2268
2267
|
id: r.getAttribute("data-option"),
|
|
@@ -2305,12 +2304,12 @@ var Xt, Ui, Ut, Yi, rt, Be, Yt, Fi, Ft, Ji;
|
|
|
2305
2304
|
class Xi extends HTMLElement {
|
|
2306
2305
|
constructor() {
|
|
2307
2306
|
super();
|
|
2308
|
-
|
|
2309
|
-
|
|
2307
|
+
p(this, Xt);
|
|
2308
|
+
p(this, Ut);
|
|
2310
2309
|
// -** 獨立 dropdown 出 body 更新
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2310
|
+
p(this, rt);
|
|
2311
|
+
p(this, Yt);
|
|
2312
|
+
p(this, Ft);
|
|
2314
2313
|
this.initialize = !1;
|
|
2315
2314
|
}
|
|
2316
2315
|
static get observedAttributes() {
|
|
@@ -2331,26 +2330,26 @@ class Xi extends HTMLElement {
|
|
|
2331
2330
|
switch (o.hasAttribute("multiple") ? "multiple" : "single") {
|
|
2332
2331
|
case "single":
|
|
2333
2332
|
const r = o.s.dropdownEl.querySelector(`.dropdown-list li[data-option="${s}"]`);
|
|
2334
|
-
A(r) ?
|
|
2333
|
+
A(r) ? q(o, [...o.s.allLi].indexOf(r)) : q(o, -1);
|
|
2335
2334
|
break;
|
|
2336
2335
|
case "multiple":
|
|
2337
2336
|
const l = [];
|
|
2338
2337
|
o.s.dropdownEl.querySelector(".dropdown-list li").classList.remove("active"), s.split(",").forEach((u) => {
|
|
2339
|
-
const
|
|
2340
|
-
A(
|
|
2338
|
+
const h = o.s.dropdownEl.querySelector(`.dropdown-list li[data-option="${u}"]`);
|
|
2339
|
+
A(h) && (h.classList.add("active"), l.push(h));
|
|
2341
2340
|
});
|
|
2342
2341
|
const c = l.map((u) => [...o.s.allLi].indexOf(u));
|
|
2343
|
-
|
|
2342
|
+
q(o, c);
|
|
2344
2343
|
break;
|
|
2345
2344
|
}
|
|
2346
2345
|
else
|
|
2347
|
-
|
|
2346
|
+
q(o, -1);
|
|
2348
2347
|
o.emit("change");
|
|
2349
2348
|
break;
|
|
2350
2349
|
case "d4-placeholder":
|
|
2351
2350
|
if (e === null)
|
|
2352
2351
|
return;
|
|
2353
|
-
e !== s && o.s.value.index < 0 &&
|
|
2352
|
+
e !== s && o.s.value.index < 0 && q(o, o.s.value.index);
|
|
2354
2353
|
break;
|
|
2355
2354
|
}
|
|
2356
2355
|
}
|
|
@@ -2373,12 +2372,22 @@ class Xi extends HTMLElement {
|
|
|
2373
2372
|
return t.querySelector(".dropdown-scroller .filter-bar") ? e : t.querySelector(".filter-bar").clientHeight + e;
|
|
2374
2373
|
return e;
|
|
2375
2374
|
};
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2375
|
+
t.s.subDropdownTotalH = 0;
|
|
2376
|
+
const a = t.getAttribute("d4-portal") == "true" ? t.s.dropdownEl.querySelector(".dropdown-scroller") : t.querySelector(".dropdown-scroller"), r = parseInt(getComputedStyle(a).maxHeight);
|
|
2377
|
+
t.s.dropdownEl.querySelectorAll('.has-sublayer[data-open="true"]').forEach((c) => {
|
|
2378
|
+
const u = c.querySelector(".sub-dropdown"), h = u.querySelector(".sub-dropdown-list"), g = parseInt(getComputedStyle(h).marginTop) + parseInt(getComputedStyle(h).marginBottom);
|
|
2379
|
+
u.style.cssText = `--height: ${h.offsetHeight + g}px`, t.s.subDropdownTotalH += parseInt(u.style.cssText.replace("--height:", "").trim()), c.classList.add("open");
|
|
2380
|
+
});
|
|
2381
|
+
const l = () => {
|
|
2382
|
+
const c = o() + t.s.subDropdownTotalH;
|
|
2383
|
+
return c > r ? r : c;
|
|
2384
|
+
};
|
|
2385
|
+
return t.getAttribute("d4-portal") !== "true" && ze(), t.setAttribute("d4-status", "open"), t.setAttribute("d4-default-height", o()), t.getAttribute("d4-portal") == "true" ? (t.s.dropdownEl.style.setProperty("--maxHeight", `${l()}px`), t.s.dropdownEl.style.zIndex = "9999", d(this, rt, Be).call(this), t.s.dropdownEl.offsetHeight, t.s.dropdownEl.style.height = `${l()}px`, t.__events__._scrollUpdate = () => {
|
|
2386
|
+
var u;
|
|
2387
|
+
const c = t.getBoundingClientRect();
|
|
2388
|
+
c.bottom < 0 || c.top > window.innerHeight ? t.close() : d(u = t, rt, Be).call(u);
|
|
2389
|
+
}, window.addEventListener("scroll", t.__events__._scrollUpdate, { passive: !0, capture: !0 }), window.addEventListener("resize", t.__events__._scrollUpdate, { passive: !0 })) : (t.style.cssText = `--maxHeight: ${l()}px;`, t.s.dropdownEl.style.cssText = `
|
|
2390
|
+
height: ${l()}px;
|
|
2382
2391
|
z-index: 2;
|
|
2383
2392
|
`), this;
|
|
2384
2393
|
}
|
|
@@ -2453,7 +2462,7 @@ Xt = new WeakSet(), Ui = function() {
|
|
|
2453
2462
|
};
|
|
2454
2463
|
break;
|
|
2455
2464
|
}
|
|
2456
|
-
|
|
2465
|
+
q(t, t.s.value.index), d(s = t, Ft, Ji).call(s), t.classList.add("d4-initialize");
|
|
2457
2466
|
}, Ft = new WeakSet(), Ji = function() {
|
|
2458
2467
|
const t = this;
|
|
2459
2468
|
t.__events__.dropdownToggle = () => {
|
|
@@ -2477,7 +2486,7 @@ Xt = new WeakSet(), Ui = function() {
|
|
|
2477
2486
|
if (t.__scroller__) {
|
|
2478
2487
|
const { viewport: c } = t.__scroller__.elements();
|
|
2479
2488
|
if (A(t.s.activeLi)) {
|
|
2480
|
-
const u = t.s.activeLi.clientHeight / 2,
|
|
2489
|
+
const u = t.s.activeLi.clientHeight / 2, h = t.s.activeLi.offsetTop, g = h - r.clientHeight / 2 + u > 0 ? h - r.clientHeight / 2 + u : 0;
|
|
2481
2490
|
c.scrollTo({
|
|
2482
2491
|
top: g,
|
|
2483
2492
|
behavior: "smooth"
|
|
@@ -2489,7 +2498,7 @@ Xt = new WeakSet(), Ui = function() {
|
|
|
2489
2498
|
});
|
|
2490
2499
|
}
|
|
2491
2500
|
};
|
|
2492
|
-
a && (t.s.dropdownEl.querySelector(".filter-bar input").disabled = !1, t.s.dropdownEl.querySelector(".filter-bar input").focus()), t.s.selectType === "single" && l();
|
|
2501
|
+
t.s.subDropdownTotalH > 0 && t.__scroller__ && t.__scroller__.update(!0), a && (t.s.dropdownEl.querySelector(".filter-bar input").disabled = !1, t.s.dropdownEl.querySelector(".filter-bar input").focus()), t.s.selectType === "single" && l();
|
|
2493
2502
|
break;
|
|
2494
2503
|
case "close":
|
|
2495
2504
|
t.getAttribute("d4-portal") == "true" ? (t.__scroller__ && t.__scroller__.update(!0), t.s.dropdownEl.style.height = "", t.s.dropdownEl.style.zIndex = "", a && (t.s.dropdownEl.querySelector(".filter-bar input").disabled = !0), t.s.dropdownEl.parentNode === document.body && document.body.removeChild(t.s.dropdownEl)) : (t.__scroller__.update(!0), t.s.dropdownEl.removeAttribute("style"), a && (t.querySelector(".filter-bar input").disabled = !0));
|
|
@@ -2511,7 +2520,7 @@ Xt = new WeakSet(), Ui = function() {
|
|
|
2511
2520
|
e.s.allLi = e.s.dropdownEl.querySelectorAll(".dropdown-list li"), e.s.allLi.forEach((l) => {
|
|
2512
2521
|
l.addEventListener("click", function(c) {
|
|
2513
2522
|
var m;
|
|
2514
|
-
const u = this,
|
|
2523
|
+
const u = this, h = [...e.s.allLi].indexOf(u), g = parseInt(e.getAttribute("d4-default-height"));
|
|
2515
2524
|
if (u.classList.contains("has-sublayer")) {
|
|
2516
2525
|
c.stopPropagation();
|
|
2517
2526
|
const v = u.querySelector(".sub-dropdown"), w = v.querySelector(".sub-dropdown-list"), b = parseInt(getComputedStyle(w).marginTop) + parseInt(getComputedStyle(w).marginBottom);
|
|
@@ -2520,16 +2529,16 @@ Xt = new WeakSet(), Ui = function() {
|
|
|
2520
2529
|
s = g + e.s.subDropdownTotalH, o = s > C ? C : s, e.getAttribute("d4-portal") == "true" ? e.s.dropdownEl.style.setProperty("--maxHeight", `${o}px`) : e.style.cssText = `--maxHeight: ${o}px;`, e.s.dropdownEl.style.height = `${o}px`;
|
|
2521
2530
|
};
|
|
2522
2531
|
u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -= T, y()) : (u.classList.add("open"), e.s.subDropdownTotalH += T, y());
|
|
2523
|
-
const
|
|
2524
|
-
e.__scroller__.update(!0), v.removeEventListener("transitionend",
|
|
2532
|
+
const L = () => {
|
|
2533
|
+
e.__scroller__.update(!0), v.removeEventListener("transitionend", L);
|
|
2525
2534
|
};
|
|
2526
|
-
v.addEventListener("transitionend",
|
|
2535
|
+
v.addEventListener("transitionend", L);
|
|
2527
2536
|
} else
|
|
2528
2537
|
switch (en(e), e.s.selectType) {
|
|
2529
2538
|
case "single":
|
|
2530
2539
|
if (e.setAttribute("d4-value", u.getAttribute("data-option")), r) {
|
|
2531
2540
|
const v = e.s.cityLang, w = l.textContent.trim(), b = document.getElementById(e.getAttribute("dist-select"));
|
|
2532
|
-
b && (b.s.dropdownEl.querySelector(".dropdown-list").textContent = "",
|
|
2541
|
+
b && (b.s.dropdownEl.querySelector(".dropdown-list").textContent = "", q(b, -1), K[v][w].forEach((T, C) => {
|
|
2533
2542
|
const y = document.createElement("li");
|
|
2534
2543
|
y.textContent = T[0], y.setAttribute("data-option", T[0]), e.getAttribute("d4-portal") == "true" ? b.s.dropdownEl.querySelector(".dropdown-list").append(y) : b.querySelector(".dropdown-list").append(y);
|
|
2535
2544
|
}), e.__events__.selectOption(b));
|
|
@@ -2537,7 +2546,7 @@ Xt = new WeakSet(), Ui = function() {
|
|
|
2537
2546
|
(e.getAttribute("d4-portal") == "true" || (m = u.parentNode.closest("li")) != null && m.classList.contains("has-sublayer")) && (c.stopPropagation(), e.close());
|
|
2538
2547
|
break;
|
|
2539
2548
|
case "multiple":
|
|
2540
|
-
c.stopPropagation(), u.classList.toggle("active"),
|
|
2549
|
+
c.stopPropagation(), u.classList.toggle("active"), q(e, h);
|
|
2541
2550
|
break;
|
|
2542
2551
|
}
|
|
2543
2552
|
});
|
|
@@ -2674,10 +2683,10 @@ var Jt, Zi, Zt, Qi, Qt, Ki, Kt, Vi;
|
|
|
2674
2683
|
class ln extends HTMLElement {
|
|
2675
2684
|
constructor() {
|
|
2676
2685
|
super();
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2686
|
+
p(this, Jt);
|
|
2687
|
+
p(this, Zt);
|
|
2688
|
+
p(this, Qt);
|
|
2689
|
+
p(this, Kt);
|
|
2681
2690
|
this.initialize = !1;
|
|
2682
2691
|
}
|
|
2683
2692
|
static get observedAttributes() {
|
|
@@ -2697,20 +2706,20 @@ class ln extends HTMLElement {
|
|
|
2697
2706
|
}
|
|
2698
2707
|
Jt = new WeakSet(), Zi = function() {
|
|
2699
2708
|
const t = {
|
|
2700
|
-
direction: this.getAttribute("direction") ||
|
|
2709
|
+
direction: this.getAttribute("direction") || I.SETTINGS.direction,
|
|
2701
2710
|
// up / down / left / right
|
|
2702
|
-
behavior: this.getAttribute("behavior") ||
|
|
2711
|
+
behavior: this.getAttribute("behavior") || I.SETTINGS.behavior,
|
|
2703
2712
|
// normal / alternate / endStop
|
|
2704
|
-
duration: Number(this.getAttribute("duration")) ||
|
|
2713
|
+
duration: Number(this.getAttribute("duration")) || I.SETTINGS.duration,
|
|
2705
2714
|
// ms
|
|
2706
|
-
durationBreakpoints: yt(this) ||
|
|
2707
|
-
autoplay: this.getAttribute("autoplay") ||
|
|
2715
|
+
durationBreakpoints: yt(this) || I.SETTINGS.durationBreakpoints,
|
|
2716
|
+
autoplay: this.getAttribute("autoplay") || I.SETTINGS.autoplay,
|
|
2708
2717
|
// normal / alternate / endStop
|
|
2709
|
-
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" :
|
|
2718
|
+
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : I.SETTINGS.pauseOnMouseenter,
|
|
2710
2719
|
// true / false
|
|
2711
|
-
continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" :
|
|
2720
|
+
continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" : I.SETTINGS.continual,
|
|
2712
2721
|
// true / false
|
|
2713
|
-
gap: Number(this.getAttribute("gap")) ||
|
|
2722
|
+
gap: Number(this.getAttribute("gap")) || I.SETTINGS.gap
|
|
2714
2723
|
};
|
|
2715
2724
|
this.s = {}, this.s.options = t, this.s.nowDuration = si(this), an(this), d(this, Zt, Qi).call(this);
|
|
2716
2725
|
}, Zt = new WeakSet(), Qi = function() {
|
|
@@ -2746,20 +2755,20 @@ Jt = new WeakSet(), Zi = function() {
|
|
|
2746
2755
|
let v = [];
|
|
2747
2756
|
switch (e) {
|
|
2748
2757
|
case "top":
|
|
2749
|
-
|
|
2758
|
+
h = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), g = parseInt(t.s.nowDuration / (h * 2)) * t.s.animateEl.scrollHeight, v = [{ transform: `translate3d(0,${t.clientHeight}px,0)` }, { transform: `translate3d(0,calc(${t.clientHeight}px - 100%),0)` }];
|
|
2750
2759
|
break;
|
|
2751
2760
|
case "right":
|
|
2752
|
-
|
|
2761
|
+
h = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), g = parseInt(t.s.nowDuration / (h * 2)) * t.s.animateEl.scrollWidth, v = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(0,0,0)" }];
|
|
2753
2762
|
break;
|
|
2754
2763
|
case "bottom":
|
|
2755
|
-
|
|
2764
|
+
h = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), g = parseInt(o / (h * 2)) * t.s.animateEl.scrollHeight, v = [{ transform: "translate3d(0,-100%,0)" }, { transform: "translate3d(0,0,0)" }];
|
|
2756
2765
|
break;
|
|
2757
2766
|
case "left":
|
|
2758
|
-
|
|
2767
|
+
h = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), g = parseInt(o / (h * 2)) * t.s.animateEl.scrollWidth, v = [{ transform: `translate3d(${t.clientWidth}px,0,0)` }, { transform: `translate3d(calc(-100% + ${t.clientWidth}px),0,0)` }];
|
|
2759
2768
|
break;
|
|
2760
2769
|
}
|
|
2761
2770
|
return v;
|
|
2762
|
-
},
|
|
2771
|
+
}, h, g;
|
|
2763
2772
|
(t.clientHeight > t.s.animateEl.scrollHeight || e === "left" || e === "right") && (t.s.animateEl.style.transform = `${m()[0].transform}`, t.s.animateEl.animate(m(), {
|
|
2764
2773
|
duration: g,
|
|
2765
2774
|
fill: "forwards"
|
|
@@ -2833,17 +2842,17 @@ var Vt, ts, te, es, ee, is, lt, We, U, wt, ie, ss;
|
|
|
2833
2842
|
class oi {
|
|
2834
2843
|
constructor(i) {
|
|
2835
2844
|
// 初始化
|
|
2836
|
-
|
|
2845
|
+
p(this, Vt);
|
|
2837
2846
|
// 左右箭頭事件綁定
|
|
2838
|
-
|
|
2847
|
+
p(this, te);
|
|
2839
2848
|
// 左右拖拉事件綁定
|
|
2840
|
-
|
|
2849
|
+
p(this, ee);
|
|
2841
2850
|
// 卷軸位置判斷
|
|
2842
|
-
|
|
2851
|
+
p(this, lt);
|
|
2843
2852
|
// 隱藏按鈕判斷
|
|
2844
|
-
|
|
2853
|
+
p(this, U);
|
|
2845
2854
|
// 選項事件綁定
|
|
2846
|
-
|
|
2855
|
+
p(this, ie);
|
|
2847
2856
|
this.$element = i, this.option = i.s.option.drag, this._didInitialScroll = !1, d(this, Vt, ts).call(this);
|
|
2848
2857
|
}
|
|
2849
2858
|
// 更新 active 位置
|
|
@@ -2878,7 +2887,7 @@ Vt = new WeakSet(), ts = function() {
|
|
|
2878
2887
|
}), t = !0);
|
|
2879
2888
|
};
|
|
2880
2889
|
i.$wrapper.removeEventListener("scroll", e), i.$wrapper.addEventListener("scroll", e), window.removeEventListener("resize", e), window.addEventListener("resize", e), (i.option.draggable || i.$element.s.type == "collapse") && d(s = i, ee, is).call(s), i.option.navigation && i.$element.s.type !== "collapse" && (i.$container.insertAdjacentHTML(
|
|
2881
|
-
|
|
2890
|
+
S.prepend,
|
|
2882
2891
|
`<div class="navigation">
|
|
2883
2892
|
<div class="button prev">
|
|
2884
2893
|
<div></div>
|
|
@@ -2907,32 +2916,32 @@ Vt = new WeakSet(), ts = function() {
|
|
|
2907
2916
|
}, ee = new WeakSet(), is = function() {
|
|
2908
2917
|
const { $wrapper: i } = this;
|
|
2909
2918
|
let t = !1, e = !1, s = 0, o = 0;
|
|
2910
|
-
const a = function(
|
|
2911
|
-
|
|
2919
|
+
const a = function(h) {
|
|
2920
|
+
h.preventDefault(), e = !1, t = !0, s = h.pageX - i.offsetLeft, o = i.scrollLeft;
|
|
2912
2921
|
};
|
|
2913
2922
|
i.removeEventListener("mousedown", a), i.addEventListener("mousedown", a);
|
|
2914
2923
|
const r = function() {
|
|
2915
2924
|
e = !1, t = !1;
|
|
2916
2925
|
};
|
|
2917
2926
|
i.removeEventListener("mouseleave", r), i.addEventListener("mouseleave", r);
|
|
2918
|
-
const l = function(
|
|
2919
|
-
|
|
2927
|
+
const l = function(h) {
|
|
2928
|
+
h.preventDefault(), t = !1;
|
|
2920
2929
|
};
|
|
2921
2930
|
i.removeEventListener("mouseup", l), i.addEventListener("mouseup", l);
|
|
2922
|
-
const c = function(
|
|
2923
|
-
if (
|
|
2931
|
+
const c = function(h) {
|
|
2932
|
+
if (h.preventDefault(), e = !0, !t)
|
|
2924
2933
|
return;
|
|
2925
|
-
const m =
|
|
2934
|
+
const m = h.pageX - i.offsetLeft - s;
|
|
2926
2935
|
i.scrollTo({
|
|
2927
2936
|
left: o - m
|
|
2928
2937
|
});
|
|
2929
2938
|
};
|
|
2930
2939
|
i.removeEventListener("mousemove", c), i.addEventListener("mousemove", c);
|
|
2931
|
-
const u = function(
|
|
2932
|
-
e && (
|
|
2940
|
+
const u = function(h) {
|
|
2941
|
+
e && (h.preventDefault(), h.stopPropagation());
|
|
2933
2942
|
};
|
|
2934
|
-
i.querySelectorAll("a").forEach((
|
|
2935
|
-
|
|
2943
|
+
i.querySelectorAll("a").forEach((h) => {
|
|
2944
|
+
h.removeEventListener("click", u), h.addEventListener("click", u);
|
|
2936
2945
|
});
|
|
2937
2946
|
}, lt = new WeakSet(), We = function() {
|
|
2938
2947
|
const { $container: i, $wrapper: t } = this, e = t.scrollWidth - t.clientWidth, s = Math.round(t.scrollLeft);
|
|
@@ -2977,13 +2986,13 @@ var se, ns, ne, os, oe, as, ae, rs;
|
|
|
2977
2986
|
class cn {
|
|
2978
2987
|
constructor(i) {
|
|
2979
2988
|
// 初始化
|
|
2980
|
-
|
|
2989
|
+
p(this, se);
|
|
2981
2990
|
// 隱藏按鈕判斷
|
|
2982
|
-
|
|
2991
|
+
p(this, ne);
|
|
2983
2992
|
// 展開箭頭事件綁定
|
|
2984
|
-
|
|
2993
|
+
p(this, oe);
|
|
2985
2994
|
// 選項事件綁定
|
|
2986
|
-
|
|
2995
|
+
p(this, ae);
|
|
2987
2996
|
this.$element = i, this.option = i.s.option.collapse, d(this, se, ns).call(this);
|
|
2988
2997
|
}
|
|
2989
2998
|
}
|
|
@@ -2991,7 +3000,7 @@ se = new WeakSet(), ns = function() {
|
|
|
2991
3000
|
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this, ne, os).call(this) && d(this, oe, as).call(this), d(this, ae, rs).call(this));
|
|
2992
3001
|
}, ne = new WeakSet(), os = function() {
|
|
2993
3002
|
const i = this.$element.querySelector(".drag-container"), t = i.querySelector(".wrapper");
|
|
2994
|
-
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(
|
|
3003
|
+
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(S.append, '<div class="open-collapse"></div>'), this.$button = i.querySelector(".open-collapse"), $(this.$element, "noScrollable"), !0) : (x(this.$element, "noScrollable"), !1);
|
|
2995
3004
|
}, oe = new WeakSet(), as = function() {
|
|
2996
3005
|
const { $element: i, $button: t } = this, e = function() {
|
|
2997
3006
|
i.classList.contains("expand") ? i.classList.remove("expand") : i.classList.add("expand");
|
|
@@ -3013,18 +3022,18 @@ se = new WeakSet(), ns = function() {
|
|
|
3013
3022
|
};
|
|
3014
3023
|
const dn = (n) => {
|
|
3015
3024
|
const { type: i, option: t, originalDomString: e } = n.s, s = document.createElement("div");
|
|
3016
|
-
return i == "drag" && (s.innerHTML =
|
|
3025
|
+
return i == "drag" && (s.innerHTML = M.TEMPLATE[i]().trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(S.append, e)), i == "collapse" && (s.innerHTML = M.TEMPLATE[i](t == null ? void 0 : t.collapse).trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(S.append, e), s.querySelector(".collapse-container .wrapper").insertAdjacentHTML(S.append, e)), i == "dropdown" && (s.innerHTML = M.TEMPLATE[i](t == null ? void 0 : t.dropdown).trim(), s.querySelector("dropdown-el").insertAdjacentHTML(S.append, e)), s.children;
|
|
3017
3026
|
};
|
|
3018
3027
|
var re, ls, le, cs, ct, Ge, Y, Tt;
|
|
3019
3028
|
class un extends HTMLElement {
|
|
3020
3029
|
constructor() {
|
|
3021
3030
|
super();
|
|
3022
|
-
|
|
3023
|
-
|
|
3031
|
+
p(this, re);
|
|
3032
|
+
p(this, le);
|
|
3024
3033
|
// 斷點設定
|
|
3025
|
-
|
|
3034
|
+
p(this, ct);
|
|
3026
3035
|
// check type
|
|
3027
|
-
|
|
3036
|
+
p(this, Y);
|
|
3028
3037
|
this.initialize = !1, this.__events__ = {}, this.s = {}, this.s.originalDomString = this.innerHTML.trim().replace(/\n/g, ""), this.previousWidth = window.innerWidth;
|
|
3029
3038
|
}
|
|
3030
3039
|
static get observedAttributes() {
|
|
@@ -3061,7 +3070,7 @@ class un extends HTMLElement {
|
|
|
3061
3070
|
}
|
|
3062
3071
|
re = new WeakSet(), ls = function() {
|
|
3063
3072
|
let t = {};
|
|
3064
|
-
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ??
|
|
3073
|
+
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ?? M.SETTINGS.type, this.hasAttribute("m4-option") && (t = this.getAttribute("m4-option") ? JSON.parse(this.getAttribute("m4-option")) : {}, this.removeAttribute("m4-option"));
|
|
3065
3074
|
const e = (s) => {
|
|
3066
3075
|
if (s.type === "resize") {
|
|
3067
3076
|
if (window.innerWidth === this.previousWidth)
|
|
@@ -3070,7 +3079,7 @@ re = new WeakSet(), ls = function() {
|
|
|
3070
3079
|
}
|
|
3071
3080
|
this.update();
|
|
3072
3081
|
};
|
|
3073
|
-
window.removeEventListener("resize", ni(e)), window.addEventListener("resize", ni(e)), this.s.option = {}, this.s.option.drag = Object.assign({},
|
|
3082
|
+
window.removeEventListener("resize", ni(e)), window.addEventListener("resize", ni(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, M.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, M.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, M.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, M.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint), d(this, le, cs).call(this);
|
|
3074
3083
|
}, le = new WeakSet(), cs = function() {
|
|
3075
3084
|
this.classList.add("m4-init"), d(this, ct, Ge).call(this);
|
|
3076
3085
|
}, ct = new WeakSet(), Ge = function() {
|
|
@@ -3101,50 +3110,50 @@ re = new WeakSet(), ls = function() {
|
|
|
3101
3110
|
(o = this.drag) == null || o.update();
|
|
3102
3111
|
};
|
|
3103
3112
|
customElements.define("multipurpose-nav", un);
|
|
3104
|
-
var ce, us, de,
|
|
3113
|
+
var ce, us, de, ps, dt, Re, W, Z, ue, hs, pe, ms, he, gs, me, fs, ge, vs, fe, bs, ve, ys, be, ws, ye, Ts, N, R, we, Es, Te, As, Ee, Ss, Ae, Ls;
|
|
3105
3114
|
class ds extends HTMLElement {
|
|
3106
3115
|
// 定義組件的初始狀態
|
|
3107
3116
|
constructor(t, e) {
|
|
3108
3117
|
super();
|
|
3109
|
-
|
|
3110
|
-
|
|
3118
|
+
p(this, ce);
|
|
3119
|
+
p(this, de);
|
|
3111
3120
|
// 第一關 判斷數量以及id設定
|
|
3112
|
-
|
|
3121
|
+
p(this, dt);
|
|
3113
3122
|
// 第二關 id命名提醒
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3123
|
+
p(this, W);
|
|
3124
|
+
p(this, ue);
|
|
3125
|
+
p(this, pe);
|
|
3126
|
+
p(this, he);
|
|
3118
3127
|
// 執行函式
|
|
3119
3128
|
// 移動至指定位置
|
|
3120
|
-
|
|
3129
|
+
p(this, me);
|
|
3121
3130
|
// 移動
|
|
3122
|
-
|
|
3131
|
+
p(this, ge);
|
|
3123
3132
|
// 步驟狀態
|
|
3124
|
-
|
|
3133
|
+
p(this, fe);
|
|
3125
3134
|
// next 按鈕狀態
|
|
3126
|
-
|
|
3135
|
+
p(this, ve);
|
|
3127
3136
|
// prev 按鈕狀態
|
|
3128
|
-
|
|
3137
|
+
p(this, be);
|
|
3129
3138
|
// 頁籤狀態
|
|
3130
|
-
|
|
3139
|
+
p(this, ye);
|
|
3131
3140
|
// 第三關各種元件判斷 及 執行
|
|
3132
|
-
|
|
3141
|
+
p(this, N);
|
|
3133
3142
|
// 消失動畫
|
|
3134
|
-
|
|
3143
|
+
p(this, we);
|
|
3135
3144
|
// 出現動畫
|
|
3136
|
-
|
|
3145
|
+
p(this, Te);
|
|
3137
3146
|
// 狀態
|
|
3138
|
-
|
|
3147
|
+
p(this, Ee);
|
|
3139
3148
|
// resize
|
|
3140
|
-
|
|
3149
|
+
p(this, Ae);
|
|
3141
3150
|
}
|
|
3142
3151
|
// 當組件的屬性被更改時會被呼叫
|
|
3143
3152
|
static get observedAttributes() {
|
|
3144
3153
|
return ["t4-active"];
|
|
3145
3154
|
}
|
|
3146
3155
|
attributeChangedCallback(t, e, s) {
|
|
3147
|
-
t === "t4-active" && e !== s && d(this, Ee,
|
|
3156
|
+
t === "t4-active" && e !== s && d(this, Ee, Ss).call(this, s);
|
|
3148
3157
|
}
|
|
3149
3158
|
connectedCallback() {
|
|
3150
3159
|
this.classList.contains("t4-initialize") || d(this, ce, us).call(this);
|
|
@@ -3201,13 +3210,13 @@ ce = new WeakSet(), us = function() {
|
|
|
3201
3210
|
delay: this.getAttribute("t4-delay") || e.transition.delay
|
|
3202
3211
|
},
|
|
3203
3212
|
tabGroup: this.getAttribute("t4-group") || e.tabGroup
|
|
3204
|
-
}, this.__events__ = {}, this.t.tabs = d(this, dt, Re).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this, de,
|
|
3205
|
-
}, de = new WeakSet(),
|
|
3206
|
-
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this, ue,
|
|
3213
|
+
}, this.__events__ = {}, this.t.tabs = d(this, dt, Re).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this, de, ps).call(this);
|
|
3214
|
+
}, de = new WeakSet(), ps = function() {
|
|
3215
|
+
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this, ue, hs).call(this), this.t.recordUrl) {
|
|
3207
3216
|
const e = new URLSearchParams(document.location.search).get(this.t.name), s = document.querySelectorAll(`[t4-name="${this.t.name}"] .tab-panel[t4-id="${e}"]`);
|
|
3208
3217
|
e && s.length === 1 ? this.t.activeTab = e : console.warn(`沒有${e}這頁喔!!`);
|
|
3209
3218
|
}
|
|
3210
|
-
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this, Ae,
|
|
3219
|
+
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this, Ae, Ls).call(this);
|
|
3211
3220
|
}, dt = new WeakSet(), Re = function() {
|
|
3212
3221
|
const { t } = this, e = Array.from(document.querySelectorAll(`[t4-control="${t.name}"][t4-role="tab"]`));
|
|
3213
3222
|
return t.type === "normal" && t.tabGroup === "true" && t.tabPanels.length !== e.length && console.warn("按鈕與內容數量不同喔", t.tabPanels.length, e.length), t.tabGroup === "true" ? t.tabPanels.forEach((s, o) => s.setAttribute("t4-id", o)) : t.tabPanels.forEach((s) => {
|
|
@@ -3218,19 +3227,19 @@ ce = new WeakSet(), us = function() {
|
|
|
3218
3227
|
s.length > 1 && console.warn("有兩個相同id設定", s);
|
|
3219
3228
|
const o = s[0];
|
|
3220
3229
|
return o ? e.tabPanels.indexOf(o) : (console.warn(`找不到t4-id為${t}的頁籤`), 0);
|
|
3221
|
-
}, ue = new WeakSet(),
|
|
3230
|
+
}, ue = new WeakSet(), hs = function() {
|
|
3222
3231
|
const t = document.createElement("div");
|
|
3223
3232
|
t.classList.add("swiper-container");
|
|
3224
3233
|
const e = document.createElement("div");
|
|
3225
3234
|
e.classList.add("swiper-wrapper"), this.t.tabPanels.forEach((s) => {
|
|
3226
3235
|
e.appendChild(s.cloneNode(!0));
|
|
3227
|
-
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this,
|
|
3228
|
-
},
|
|
3236
|
+
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this, pe, ms).call(this);
|
|
3237
|
+
}, pe = new WeakSet(), ms = function() {
|
|
3229
3238
|
const t = this.querySelector(".swiper-container"), e = this.querySelector(".swiper-wrapper"), s = this.t.tabPanels;
|
|
3230
3239
|
t.style.overflow = "hidden", e.style.display = "flex";
|
|
3231
3240
|
const o = s.length * 100 + "%";
|
|
3232
3241
|
e.style.width = o;
|
|
3233
|
-
},
|
|
3242
|
+
}, he = new WeakSet(), gs = function(t) {
|
|
3234
3243
|
const { t: e } = this;
|
|
3235
3244
|
if (e.recordUrl === "true") {
|
|
3236
3245
|
const s = new URLSearchParams(document.location.search);
|
|
@@ -3280,7 +3289,7 @@ ce = new WeakSet(), us = function() {
|
|
|
3280
3289
|
d(this, ve, ys).call(this, e), d(this, be, ws).call(this, e);
|
|
3281
3290
|
break;
|
|
3282
3291
|
case "tabUrl":
|
|
3283
|
-
this.t.recordUrl === "true" && d(this,
|
|
3292
|
+
this.t.recordUrl === "true" && d(this, he, gs).call(this, e);
|
|
3284
3293
|
break;
|
|
3285
3294
|
default:
|
|
3286
3295
|
console.warn("請增加判斷,謝謝");
|
|
@@ -3321,26 +3330,26 @@ ce = new WeakSet(), us = function() {
|
|
|
3321
3330
|
break;
|
|
3322
3331
|
case "swiper":
|
|
3323
3332
|
a.style.opacity = "1";
|
|
3324
|
-
const c = this.querySelector(".swiper-wrapper"), u = this.t.tabPanels[0].offsetWidth,
|
|
3325
|
-
c.style.transition = `transform ${e}ms ${s} ${o}ms`, c.style.transform = `translateX(${
|
|
3333
|
+
const c = this.querySelector(".swiper-wrapper"), u = this.t.tabPanels[0].offsetWidth, h = -t * u;
|
|
3334
|
+
c.style.transition = `transform ${e}ms ${s} ${o}ms`, c.style.transform = `translateX(${h}px)`;
|
|
3326
3335
|
break;
|
|
3327
3336
|
default:
|
|
3328
3337
|
console.warn(this.t.display, "沒有這個效果請自己想辦法!!!!");
|
|
3329
3338
|
break;
|
|
3330
3339
|
}
|
|
3331
|
-
}, Ee = new WeakSet(),
|
|
3340
|
+
}, Ee = new WeakSet(), Ss = function(t) {
|
|
3332
3341
|
const e = d(this, W, Z).call(this, t);
|
|
3333
3342
|
d(this, N, R).call(this, "step", e), d(this, N, R).call(this, "btnState", e), d(this, N, R).call(this, "tabState", e, t), d(this, N, R).call(this, "tabUrl", t), this.emit("change");
|
|
3334
|
-
}, Ae = new WeakSet(),
|
|
3343
|
+
}, Ae = new WeakSet(), Ls = function() {
|
|
3335
3344
|
const t = this;
|
|
3336
3345
|
window.addEventListener(
|
|
3337
3346
|
"resize",
|
|
3338
|
-
|
|
3347
|
+
pn(() => {
|
|
3339
3348
|
t.update();
|
|
3340
3349
|
}, 1e3)
|
|
3341
3350
|
);
|
|
3342
3351
|
};
|
|
3343
|
-
function
|
|
3352
|
+
function pn(n, i = 1e3) {
|
|
3344
3353
|
let t;
|
|
3345
3354
|
return function(e) {
|
|
3346
3355
|
t && clearTimeout(t), t = setTimeout(n, i, e);
|
|
@@ -3382,17 +3391,17 @@ customElements.define("tab-el", ds);
|
|
|
3382
3391
|
const ai = (n) => {
|
|
3383
3392
|
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e);
|
|
3384
3393
|
n.classList.add(t), o.style.height = 0, o.style["transition-property"] = s.property, o.style["transition-duration"] = s.duration, o.style["transition-timing-function"] = s.function, o.style["transition-delay"] = s.delay, o.style.overflow = "hidden";
|
|
3385
|
-
},
|
|
3394
|
+
}, hn = (n) => {
|
|
3386
3395
|
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e), a = o.children[0].offsetHeight;
|
|
3387
3396
|
n.collapse.height = a, n.classList.remove(t), o.style.display = "block", o.style.height = `${a}px`, o.style["transition-property"] = s.property, o.style["transition-duration"] = s.duration, o.style["transition-timing-function"] = s.function, o.style["transition-delay"] = s.delay, o.style.overflow = "hidden";
|
|
3388
3397
|
};
|
|
3389
|
-
var ut, Xe,
|
|
3398
|
+
var ut, Xe, Se, Ds, Le, ks, pt, Ue;
|
|
3390
3399
|
class mn {
|
|
3391
3400
|
constructor(i, t = {}) {
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3401
|
+
p(this, ut);
|
|
3402
|
+
p(this, Se);
|
|
3403
|
+
p(this, Le);
|
|
3404
|
+
p(this, pt);
|
|
3396
3405
|
!mt(i) && !$e(i) && !gt(i) && !A(i) || (this.__storage__ = {
|
|
3397
3406
|
el: i,
|
|
3398
3407
|
options: t
|
|
@@ -3407,25 +3416,25 @@ ut = new WeakSet(), Xe = function() {
|
|
|
3407
3416
|
if (this.elements = t.state == "not active" ? D(i + `:not([${this.active}])`) : D(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
3408
3417
|
for (const [o, a] of Object.entries(this.options.on))
|
|
3409
3418
|
this.__events__[o] = [a];
|
|
3410
|
-
d(this,
|
|
3411
|
-
},
|
|
3419
|
+
d(this, Se, Ds).call(this);
|
|
3420
|
+
}, Se = new WeakSet(), Ds = function() {
|
|
3412
3421
|
const { elements: i, options: t } = this;
|
|
3413
3422
|
i.forEach((e) => {
|
|
3414
|
-
e.collapse = {}, e.collapse.instance = this, e.collapse.defaultOptions = t, e.collapse.methods = {}, e.collapse.methods.update = this.update, e.setAttribute(this.active, ""), d(this,
|
|
3423
|
+
e.collapse = {}, e.collapse.instance = this, e.collapse.defaultOptions = t, e.collapse.methods = {}, e.collapse.methods.update = this.update, e.setAttribute(this.active, ""), d(this, Le, ks).call(this, e);
|
|
3415
3424
|
}), this.emit("init");
|
|
3416
|
-
},
|
|
3425
|
+
}, Le = new WeakSet(), ks = function(i) {
|
|
3417
3426
|
const { options: t } = this, { collapseClass: e, block: s, target: o, defaultOpen: a, targetStopPropagation: r, defaultActiveMark: l } = t, c = i, u = c.querySelector(o);
|
|
3418
|
-
if (c.collapse.height = u.children[0].offsetHeight, a ? (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)) : !c.classList.contains(l) && !c.hasAttribute(l) ? (c.classList.add(e), u.style.height = "0px", u.style.overflow = "hidden") : (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)), c.removeEventListener("click", d(this,
|
|
3419
|
-
const
|
|
3427
|
+
if (c.collapse.height = u.children[0].offsetHeight, a ? (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)) : !c.classList.contains(l) && !c.hasAttribute(l) ? (c.classList.add(e), u.style.height = "0px", u.style.overflow = "hidden") : (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)), c.removeEventListener("click", d(this, pt, Ue)), c.addEventListener("click", d(this, pt, Ue)), r) {
|
|
3428
|
+
const h = (g) => {
|
|
3420
3429
|
g.stopPropagation();
|
|
3421
3430
|
};
|
|
3422
|
-
u.removeEventListener("click",
|
|
3431
|
+
u.removeEventListener("click", h), u.addEventListener("click", h);
|
|
3423
3432
|
}
|
|
3424
|
-
},
|
|
3433
|
+
}, pt = new WeakSet(), Ue = function() {
|
|
3425
3434
|
const { instance: i, defaultOptions: t } = this.collapse, { collapseClass: e, block: s, target: o, single: a } = t, r = this;
|
|
3426
3435
|
r.classList.contains(e) ? (a && r.parentNode.querySelectorAll(`.${r.classList[0]}`).forEach((l) => {
|
|
3427
3436
|
ai(l);
|
|
3428
|
-
}),
|
|
3437
|
+
}), hn(r)) : ai(r), i.emit("afterCollapse");
|
|
3429
3438
|
};
|
|
3430
3439
|
Object.assign(mn.prototype, z);
|
|
3431
3440
|
function gn(n, i) {
|
|
@@ -3441,26 +3450,26 @@ function xs() {
|
|
|
3441
3450
|
});
|
|
3442
3451
|
}
|
|
3443
3452
|
document.addEventListener("click", xs);
|
|
3444
|
-
var
|
|
3453
|
+
var ht, Ye, _e, $s, De, Cs, ke, Hs;
|
|
3445
3454
|
class fn extends HTMLElement {
|
|
3446
3455
|
constructor() {
|
|
3447
3456
|
super();
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3457
|
+
p(this, ht);
|
|
3458
|
+
p(this, _e);
|
|
3459
|
+
p(this, De);
|
|
3460
|
+
p(this, ke);
|
|
3452
3461
|
this.initialize = !1;
|
|
3453
3462
|
}
|
|
3454
3463
|
connectedCallback() {
|
|
3455
3464
|
const t = this;
|
|
3456
|
-
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this,
|
|
3465
|
+
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this, ht, Ye).call(this));
|
|
3457
3466
|
}
|
|
3458
3467
|
update() {
|
|
3459
|
-
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this,
|
|
3468
|
+
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this, ht, Ye).call(this);
|
|
3460
3469
|
}
|
|
3461
3470
|
}
|
|
3462
|
-
|
|
3463
|
-
const { SETTINGS: t } =
|
|
3471
|
+
ht = new WeakSet(), Ye = function() {
|
|
3472
|
+
const { SETTINGS: t } = pi;
|
|
3464
3473
|
this.s = {};
|
|
3465
3474
|
function e(o) {
|
|
3466
3475
|
let a = !!o;
|
|
@@ -3488,8 +3497,8 @@ pt = new WeakSet(), Ye = function() {
|
|
|
3488
3497
|
let s = "ontouchstart" in document.documentElement ? "touchstart" : "mouseenter", o = "ontouchend" in document.documentElement ? "touchend" : "mouseleave";
|
|
3489
3498
|
e.addEventListener(s, function(a) {
|
|
3490
3499
|
if (s === "touchstart" && xs(), e.s.options.hover) {
|
|
3491
|
-
const r = Math.round(s === "mouseenter" ? a.clientX - e.getBoundingClientRect().left : a.changedTouches[0].clientX - e.getBoundingClientRect().x), l = Math.round(s === "mouseenter" ? a.clientY - e.getBoundingClientRect().top : a.changedTouches[0].clientY - e.getBoundingClientRect().y), { offsetWidth: c, offsetHeight: u } = e,
|
|
3492
|
-
t.style.width =
|
|
3500
|
+
const r = Math.round(s === "mouseenter" ? a.clientX - e.getBoundingClientRect().left : a.changedTouches[0].clientX - e.getBoundingClientRect().x), l = Math.round(s === "mouseenter" ? a.clientY - e.getBoundingClientRect().top : a.changedTouches[0].clientY - e.getBoundingClientRect().y), { offsetWidth: c, offsetHeight: u } = e, h = Math.max(c, u);
|
|
3501
|
+
t.style.width = h * 2 + "px", t.style.height = h * 2 + "px", t.style.left = r + "px", t.style.top = l + "px", e.classList.add("entered");
|
|
3493
3502
|
}
|
|
3494
3503
|
}), e.addEventListener(o, function(a) {
|
|
3495
3504
|
if (o !== "touchend" && e.s.options.hover) {
|
|
@@ -3505,13 +3514,13 @@ class vn {
|
|
|
3505
3514
|
}
|
|
3506
3515
|
init() {
|
|
3507
3516
|
const i = document.querySelectorAll("*:not([video-id]) > img"), t = (o, a) => {
|
|
3508
|
-
const r = document.createElement("div"), l = document.createElement("span"), c = document.createElement("span"), u = Math.sqrt(o ** 2 + a ** 2),
|
|
3517
|
+
const r = document.createElement("div"), l = document.createElement("span"), c = document.createElement("span"), u = Math.sqrt(o ** 2 + a ** 2), h = Math.asin(a / u) * 180 / Math.PI;
|
|
3509
3518
|
return r.className = "no-image", l.className = "slash1", l.style.cssText = `
|
|
3510
3519
|
width: ${u}px;
|
|
3511
|
-
transform: rotate(${
|
|
3520
|
+
transform: rotate(${h}deg);
|
|
3512
3521
|
`, c.className = "slash2", c.style.cssText = `
|
|
3513
3522
|
width: ${u}px;
|
|
3514
|
-
transform: rotate(${-
|
|
3523
|
+
transform: rotate(${-h}deg);
|
|
3515
3524
|
`, r.appendChild(l), r.appendChild(c), r;
|
|
3516
3525
|
}, e = document.querySelectorAll(".error-image");
|
|
3517
3526
|
for (let o = 0; o < e.length; o++)
|
|
@@ -3564,9 +3573,9 @@ function bn(n, i, t, e) {
|
|
|
3564
3573
|
const l = t.name.substring(t.name.lastIndexOf(".")).replace("."), c = t.name.replace(`.${l}`, "");
|
|
3565
3574
|
e.originalCanvas.toBlob(
|
|
3566
3575
|
function(u) {
|
|
3567
|
-
const
|
|
3576
|
+
const h = new File([u], `${c}`, { type: t.type });
|
|
3568
3577
|
uploadImage[`${a}`][r] = {
|
|
3569
|
-
file:
|
|
3578
|
+
file: h,
|
|
3570
3579
|
info: e
|
|
3571
3580
|
}, s.on.changeAfter && typeof s.on.changeAfter == "function" && s.on.changeAfter(n, e);
|
|
3572
3581
|
},
|
|
@@ -3581,17 +3590,17 @@ function bn(n, i, t, e) {
|
|
|
3581
3590
|
}
|
|
3582
3591
|
function yn(n, i, t, e) {
|
|
3583
3592
|
const s = document.createElement("canvas"), o = s.getContext("2d"), a = i.width, l = i.height / a * 100, c = e / t * 100;
|
|
3584
|
-
let u = 0,
|
|
3593
|
+
let u = 0, h = 0;
|
|
3585
3594
|
switch (s.width = t, s.height = e, n.previewSize) {
|
|
3586
3595
|
case "contain":
|
|
3587
|
-
l < c ? (u = s.width,
|
|
3596
|
+
l < c ? (u = s.width, h = t * l / 100) : l > c ? (u = e / l * 100, h = s.height) : (u = s.width, h = s.height);
|
|
3588
3597
|
break;
|
|
3589
3598
|
case "cover":
|
|
3590
|
-
l < c ? (u = e / l * 100,
|
|
3599
|
+
l < c ? (u = e / l * 100, h = s.height) : l > c ? (u = s.width, h = t * l / 100) : l === c && (u = s.width, h = s.height);
|
|
3591
3600
|
break;
|
|
3592
3601
|
}
|
|
3593
|
-
const g = (s.width - u) * 0.5, m = (s.height -
|
|
3594
|
-
return o.drawImage(i, g, m, u,
|
|
3602
|
+
const g = (s.width - u) * 0.5, m = (s.height - h) * 0.5;
|
|
3603
|
+
return o.drawImage(i, g, m, u, h), s;
|
|
3595
3604
|
}
|
|
3596
3605
|
function wn(n, i) {
|
|
3597
3606
|
return new Promise((t, e) => {
|
|
@@ -3637,7 +3646,7 @@ function An(n, i, t) {
|
|
|
3637
3646
|
});
|
|
3638
3647
|
}, o.readAsDataURL(e);
|
|
3639
3648
|
}
|
|
3640
|
-
class
|
|
3649
|
+
class Sn {
|
|
3641
3650
|
constructor(i, t) {
|
|
3642
3651
|
const e = this;
|
|
3643
3652
|
e.el = i, e.params = {
|
|
@@ -3676,7 +3685,7 @@ class Ln {
|
|
|
3676
3685
|
}
|
|
3677
3686
|
}
|
|
3678
3687
|
export {
|
|
3679
|
-
|
|
3688
|
+
hi as A,
|
|
3680
3689
|
zn as B,
|
|
3681
3690
|
mn as C,
|
|
3682
3691
|
Xi as D,
|
|
@@ -3706,23 +3715,23 @@ export {
|
|
|
3706
3715
|
zs as c,
|
|
3707
3716
|
js as d,
|
|
3708
3717
|
xe as e,
|
|
3709
|
-
|
|
3718
|
+
S as f,
|
|
3710
3719
|
D as g,
|
|
3711
|
-
|
|
3720
|
+
In as h,
|
|
3712
3721
|
mt as i,
|
|
3713
3722
|
Di as j,
|
|
3714
3723
|
ln as k,
|
|
3715
3724
|
un as l,
|
|
3716
|
-
|
|
3725
|
+
Sn as m,
|
|
3717
3726
|
Qs as n,
|
|
3718
3727
|
no as o,
|
|
3719
3728
|
zi as p,
|
|
3720
3729
|
Bi as q,
|
|
3721
|
-
|
|
3730
|
+
qn as r,
|
|
3722
3731
|
Ns as s,
|
|
3723
|
-
|
|
3732
|
+
Mn as t,
|
|
3724
3733
|
On as u,
|
|
3725
|
-
|
|
3734
|
+
Me as v,
|
|
3726
3735
|
Zs as w,
|
|
3727
3736
|
Pn as x,
|
|
3728
3737
|
Nn as y,
|