@xwadex/fesd 0.0.72 → 0.0.74
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/fesd-bundle.css +1 -1
- package/dist/image-preview-bundle.js +469 -462
- package/dist/image-preview-bundle.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { OverlayScrollbars as
|
|
1
|
+
import h from "jquery";
|
|
2
|
+
import { OverlayScrollbars as it } from "overlayscrollbars";
|
|
3
3
|
import "./vendor-bundle.js";
|
|
4
4
|
import "validator";
|
|
5
5
|
import "flatpickr";
|
|
6
|
-
import
|
|
7
|
-
import { unlock as Mt, lock as
|
|
8
|
-
const
|
|
6
|
+
import ft from "vanilla-lazyload";
|
|
7
|
+
import { unlock as Mt, lock as Pt } from "tua-body-scroll-lock";
|
|
8
|
+
const U = {
|
|
9
9
|
SETTINGS: {
|
|
10
10
|
videoId: null,
|
|
11
11
|
videoType: null,
|
|
@@ -66,14 +66,14 @@ const J = {
|
|
|
66
66
|
TEMPLATE() {
|
|
67
67
|
return '<div class="player-container"><div class="player-wrapper"></div></div>';
|
|
68
68
|
}
|
|
69
|
-
},
|
|
69
|
+
}, Nt = {
|
|
70
70
|
SETTINGS: {
|
|
71
71
|
success: null,
|
|
72
72
|
text: null,
|
|
73
73
|
className: null,
|
|
74
74
|
duration: 1500
|
|
75
75
|
}
|
|
76
|
-
},
|
|
76
|
+
}, O = {
|
|
77
77
|
SETTINGS: {
|
|
78
78
|
target: null,
|
|
79
79
|
route: null,
|
|
@@ -104,7 +104,7 @@ const J = {
|
|
|
104
104
|
</div>
|
|
105
105
|
`;
|
|
106
106
|
}
|
|
107
|
-
},
|
|
107
|
+
}, $ = {
|
|
108
108
|
SETTINGS: {
|
|
109
109
|
direction: "left",
|
|
110
110
|
// 方向 - top || right || bottom || left
|
|
@@ -123,7 +123,7 @@ const J = {
|
|
|
123
123
|
gap: 30
|
|
124
124
|
// 跑馬燈內容之間的距離 - Number
|
|
125
125
|
}
|
|
126
|
-
},
|
|
126
|
+
}, st = {
|
|
127
127
|
SETTINGS: {
|
|
128
128
|
scrollbar: {
|
|
129
129
|
"scrollbar-track-color": "transparent",
|
|
@@ -151,7 +151,7 @@ const J = {
|
|
|
151
151
|
</div>`;
|
|
152
152
|
return e || r;
|
|
153
153
|
}
|
|
154
|
-
},
|
|
154
|
+
}, jt = {
|
|
155
155
|
SETTINGS: {
|
|
156
156
|
basic_rwd: 900,
|
|
157
157
|
markdownLink: !1,
|
|
@@ -160,7 +160,7 @@ const J = {
|
|
|
160
160
|
navigation: !1,
|
|
161
161
|
scrollStep: !1
|
|
162
162
|
}
|
|
163
|
-
},
|
|
163
|
+
}, vt = {
|
|
164
164
|
SETTINGS: {
|
|
165
165
|
scroller: window,
|
|
166
166
|
class: "aost-show",
|
|
@@ -183,7 +183,7 @@ const J = {
|
|
|
183
183
|
enter: null,
|
|
184
184
|
leave: null
|
|
185
185
|
}
|
|
186
|
-
},
|
|
186
|
+
}, J = {
|
|
187
187
|
SETTINGS: {
|
|
188
188
|
target: null,
|
|
189
189
|
container: null,
|
|
@@ -201,7 +201,7 @@ const J = {
|
|
|
201
201
|
beforeScroll: null,
|
|
202
202
|
afterScroll: null
|
|
203
203
|
}
|
|
204
|
-
},
|
|
204
|
+
}, C = {
|
|
205
205
|
SETTINGS: {
|
|
206
206
|
type: "drag",
|
|
207
207
|
drag: {
|
|
@@ -243,7 +243,7 @@ const J = {
|
|
|
243
243
|
return `<dropdown-el${s.placeholder ? ` d4-placeholder="${s.placeholder}"` : ""}${s.value ? ` d4-value="${s.value}"` : ""}></dropdown-el>`;
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
|
-
},
|
|
246
|
+
}, bt = {
|
|
247
247
|
SETTINGS: {
|
|
248
248
|
// 樣式 normal / process
|
|
249
249
|
type: "normal",
|
|
@@ -263,7 +263,7 @@ const J = {
|
|
|
263
263
|
// 步驟狀態綁定
|
|
264
264
|
stepOutput: ".step-show"
|
|
265
265
|
}
|
|
266
|
-
},
|
|
266
|
+
}, yt = {
|
|
267
267
|
SETTINGS: {
|
|
268
268
|
collapseClass: "collapse",
|
|
269
269
|
block: "[collapse-block]",
|
|
@@ -296,7 +296,7 @@ const J = {
|
|
|
296
296
|
update: null,
|
|
297
297
|
afterUpdate: null
|
|
298
298
|
}
|
|
299
|
-
},
|
|
299
|
+
}, wt = {
|
|
300
300
|
SETTINGS: {
|
|
301
301
|
// 是否要加 hover 效果?
|
|
302
302
|
hover: !0,
|
|
@@ -313,23 +313,23 @@ const J = {
|
|
|
313
313
|
}
|
|
314
314
|
}, Me = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
315
315
|
__proto__: null,
|
|
316
|
-
anchor4:
|
|
317
|
-
aost4:
|
|
318
|
-
article4:
|
|
319
|
-
collapse4:
|
|
320
|
-
dropdown4:
|
|
321
|
-
marquee4:
|
|
322
|
-
modal4:
|
|
323
|
-
multipurpose4:
|
|
324
|
-
ripple4:
|
|
325
|
-
share4:
|
|
326
|
-
tab4:
|
|
327
|
-
video4:
|
|
316
|
+
anchor4: J,
|
|
317
|
+
aost4: vt,
|
|
318
|
+
article4: jt,
|
|
319
|
+
collapse4: yt,
|
|
320
|
+
dropdown4: st,
|
|
321
|
+
marquee4: $,
|
|
322
|
+
modal4: O,
|
|
323
|
+
multipurpose4: C,
|
|
324
|
+
ripple4: wt,
|
|
325
|
+
share4: Nt,
|
|
326
|
+
tab4: bt,
|
|
327
|
+
video4: U
|
|
328
328
|
}, Symbol.toStringTag, { value: "Module" })), E = {
|
|
329
329
|
after: "afterend",
|
|
330
330
|
append: "beforeend",
|
|
331
331
|
prepend: "afterbegin"
|
|
332
|
-
},
|
|
332
|
+
}, Y = (s) => typeof s == "string" && s !== "", K = (s) => s instanceof HTMLElement, F = (s) => s instanceof NodeList, T = (s) => A(s) !== null, P = (s) => typeof s == "function", A = (s) => K(s) ? s : document.querySelector(s), S = (s) => F(s) ? s : document.querySelectorAll(s), zt = () => Math.random().toString(36).substr(2, 9), Gt = (s) => {
|
|
333
333
|
const t = document.createElement("div");
|
|
334
334
|
return t.innerHTML = s, t.childNodes;
|
|
335
335
|
}, Bt = (s) => {
|
|
@@ -341,11 +341,11 @@ const J = {
|
|
|
341
341
|
return JSON.parse(s);
|
|
342
342
|
}, w = (s, t) => {
|
|
343
343
|
console.warn(`[${s} warn]: ${t}`);
|
|
344
|
-
},
|
|
344
|
+
}, at = (s, t) => {
|
|
345
345
|
console.error(`[${s} error]: ${t}`);
|
|
346
|
-
},
|
|
346
|
+
}, M = {
|
|
347
347
|
on(s, t) {
|
|
348
|
-
if (!
|
|
348
|
+
if (!P(t)) return this;
|
|
349
349
|
const { __events__: e } = this;
|
|
350
350
|
return s.split(" ").forEach((i) => {
|
|
351
351
|
e[i] || (e[i] = []), e[i].push(t);
|
|
@@ -360,7 +360,7 @@ const J = {
|
|
|
360
360
|
}), this;
|
|
361
361
|
},
|
|
362
362
|
once(s, t) {
|
|
363
|
-
if (!
|
|
363
|
+
if (!P(t)) return this;
|
|
364
364
|
const e = (...i) => {
|
|
365
365
|
this.off(s, e), t.apply(this, i);
|
|
366
366
|
};
|
|
@@ -369,10 +369,10 @@ const J = {
|
|
|
369
369
|
emit(...s) {
|
|
370
370
|
const { __events__: t } = this, e = s[0], i = s.slice(1, s.length);
|
|
371
371
|
return t[e] ? (t[e].forEach((n) => {
|
|
372
|
-
|
|
372
|
+
P(n) && n.apply(this, i);
|
|
373
373
|
}), this) : this;
|
|
374
374
|
}
|
|
375
|
-
},
|
|
375
|
+
}, Wt = {
|
|
376
376
|
easeInOutCirc(s, t, e, i) {
|
|
377
377
|
return (s /= i / 2) < 1 ? -e / 2 * (Math.sqrt(1 - s * s) - 1) + t : e / 2 * (Math.sqrt(1 - (s -= 2) * s) + 1) + t;
|
|
378
378
|
},
|
|
@@ -382,23 +382,23 @@ const J = {
|
|
|
382
382
|
easeOutQuart(s, t, e, i) {
|
|
383
383
|
return -e * ((s = s / i - 1) * s * s * s - 1) + t;
|
|
384
384
|
}
|
|
385
|
-
},
|
|
386
|
-
const { target: e, container: i, spacer: n, speed: o, gap: a, easing: r, direction: l } = s, c = l === "horizontal", d = c ? "scrollLeft" : "scrollTop", u = c ? "left" : "top",
|
|
387
|
-
let
|
|
385
|
+
}, V = (s, t) => {
|
|
386
|
+
const { target: e, container: i, spacer: n, speed: o, gap: a, easing: r, direction: l } = s, c = l === "horizontal", d = c ? "scrollLeft" : "scrollTop", u = c ? "left" : "top", p = c ? "width" : "height", m = T(i) ? A(i) : document.scrollingElement, g = m[d], y = T(e) ? A(e).getBoundingClientRect()[u] : 0 - g, f = T(n) ? A(n).getBoundingClientRect()[p] : 0, v = y - a - f, N = 15;
|
|
387
|
+
let I = 0;
|
|
388
388
|
if (v === 0) return;
|
|
389
|
-
const
|
|
390
|
-
const
|
|
391
|
-
t && t.emit(
|
|
389
|
+
const b = (L) => {
|
|
390
|
+
const z = A(e);
|
|
391
|
+
t && t.emit(L, z), !t && s.on && P(s.on[L]) && s.on[L](z);
|
|
392
392
|
};
|
|
393
|
-
|
|
394
|
-
const
|
|
395
|
-
|
|
396
|
-
const
|
|
397
|
-
m[d] =
|
|
393
|
+
b("beforeScroll");
|
|
394
|
+
const j = () => {
|
|
395
|
+
I += N;
|
|
396
|
+
const L = Wt[r](I, g, v, o);
|
|
397
|
+
m[d] = L, I < o && requestAnimationFrame(j), I >= o && b("afterScroll");
|
|
398
398
|
};
|
|
399
|
-
requestAnimationFrame(
|
|
399
|
+
requestAnimationFrame(j);
|
|
400
400
|
};
|
|
401
|
-
class
|
|
401
|
+
class Tt {
|
|
402
402
|
constructor(t, e = {}) {
|
|
403
403
|
this.__storage__ = {
|
|
404
404
|
el: t,
|
|
@@ -407,8 +407,8 @@ class wt {
|
|
|
407
407
|
}
|
|
408
408
|
#t() {
|
|
409
409
|
const { el: t, options: e } = this.__storage__;
|
|
410
|
-
if (!
|
|
411
|
-
const { SETTINGS: i, EVENTS: n } =
|
|
410
|
+
if (!Y(t) || !T(t)) return;
|
|
411
|
+
const { SETTINGS: i, EVENTS: n } = J;
|
|
412
412
|
if (this.elements = e.state == "not active" ? S(t + `:not([${this.active}])`) : S(t), this.elements = S(t), this.options = Object.assign({}, i, e), this.__events__ = Object.assign({}, n), this.options.on)
|
|
413
413
|
for (const [o, a] of Object.entries(this.options.on))
|
|
414
414
|
this.__events__[o] = [a];
|
|
@@ -434,7 +434,7 @@ class wt {
|
|
|
434
434
|
this.removeEventListener("click", e), setTimeout(() => {
|
|
435
435
|
this.addEventListener("click", e);
|
|
436
436
|
}, n.speed), setTimeout(() => {
|
|
437
|
-
|
|
437
|
+
V(n, i);
|
|
438
438
|
}, n.delay);
|
|
439
439
|
}
|
|
440
440
|
destroy() {
|
|
@@ -447,24 +447,24 @@ class wt {
|
|
|
447
447
|
return this.destroy().#t(), this.emit("afterUpdate"), this;
|
|
448
448
|
}
|
|
449
449
|
static run(t) {
|
|
450
|
-
const { SETTINGS: e } =
|
|
450
|
+
const { SETTINGS: e } = J, i = Object.assign({}, e, t);
|
|
451
451
|
setTimeout(() => {
|
|
452
|
-
|
|
452
|
+
V(i);
|
|
453
453
|
}, i.delay);
|
|
454
454
|
}
|
|
455
455
|
static url(t) {
|
|
456
|
-
const { SETTINGS: e } =
|
|
456
|
+
const { SETTINGS: e } = J, { hashName: i } = t, n = window.location.search || window.location.hash, { searchParams: o } = new URL(window.location), a = document.querySelector(`[data-anchor-id="${i ? o.get(i) : n.split("?").pop()}"]`);
|
|
457
457
|
if (!a) return;
|
|
458
458
|
const r = Object.assign({}, e, t, { target: a });
|
|
459
459
|
setTimeout(() => {
|
|
460
|
-
|
|
460
|
+
V(r);
|
|
461
461
|
}, r.delay);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
Object.assign(
|
|
465
|
-
const
|
|
464
|
+
Object.assign(Tt.prototype, M);
|
|
465
|
+
const Rt = {
|
|
466
466
|
CG_A: function(s) {
|
|
467
|
-
|
|
467
|
+
h("html,body").delay(100).animate(
|
|
468
468
|
{ opacity: "0" },
|
|
469
469
|
{
|
|
470
470
|
queue: !0,
|
|
@@ -477,7 +477,7 @@ const Wt = {
|
|
|
477
477
|
);
|
|
478
478
|
},
|
|
479
479
|
CG_B: function(s) {
|
|
480
|
-
|
|
480
|
+
h("main").append("<div id='CG_Abg'><div class='CG_Abg1'></div><div class='CG_Abg2'></div></div>"), h("body").delay(1200).animate(
|
|
481
481
|
{ opacity: "0" },
|
|
482
482
|
{
|
|
483
483
|
queue: !0,
|
|
@@ -492,7 +492,7 @@ const Wt = {
|
|
|
492
492
|
);
|
|
493
493
|
},
|
|
494
494
|
CG_C: function(s) {
|
|
495
|
-
|
|
495
|
+
h("main").append("<div id='CG_Bbg'></div>"), h("body").delay(1200).animate(
|
|
496
496
|
{ opacity: "0" },
|
|
497
497
|
{
|
|
498
498
|
queue: !0,
|
|
@@ -507,7 +507,7 @@ const Wt = {
|
|
|
507
507
|
);
|
|
508
508
|
},
|
|
509
509
|
CG_D: function(s) {
|
|
510
|
-
|
|
510
|
+
h("main").append("<div id='CG_Cbg'><div class='CG_Cbg1'></div><div class='CG_Cbg2'></div></div>"), h("body").delay(1200).animate(
|
|
511
511
|
{ opacity: "0" },
|
|
512
512
|
{
|
|
513
513
|
queue: !0,
|
|
@@ -521,11 +521,11 @@ const Wt = {
|
|
|
521
521
|
}
|
|
522
522
|
);
|
|
523
523
|
}
|
|
524
|
-
},
|
|
525
|
-
|
|
526
|
-
},
|
|
524
|
+
}, Xt = (s) => {
|
|
525
|
+
Rt.CG_A(s);
|
|
526
|
+
}, tt = (s, t) => {
|
|
527
527
|
s.preventDefault();
|
|
528
|
-
const e =
|
|
528
|
+
const e = h(s.currentTarget), i = e.attr("target"), n = e.attr("href");
|
|
529
529
|
let o;
|
|
530
530
|
if (t) {
|
|
531
531
|
if (e.is("[data-nolink]")) {
|
|
@@ -546,20 +546,20 @@ const Wt = {
|
|
|
546
546
|
let c = l.split("/");
|
|
547
547
|
c = d(c);
|
|
548
548
|
function d(u) {
|
|
549
|
-
const
|
|
550
|
-
return
|
|
549
|
+
const p = u.pop();
|
|
550
|
+
return p.indexOf("#") > -1 || p.indexOf("html") > 0 ? u.push(p) : (p == "" || u.push(p), u.push("index.html")), u;
|
|
551
551
|
}
|
|
552
|
-
i == "_blank" || s.ctrlKey || s.metaKey ? window.open(o) : l.indexOf("jpg") > -1 || l.indexOf("javascript") > -1 ||
|
|
553
|
-
}, Xt = (s) => {
|
|
554
|
-
const e = p(s.currentTarget).closest("[data-href]");
|
|
555
|
-
e.hasClass("isHover") || e.addClass("isHover");
|
|
552
|
+
i == "_blank" || s.ctrlKey || s.metaKey ? window.open(o) : l.indexOf("jpg") > -1 || l.indexOf("javascript") > -1 || Xt(o);
|
|
556
553
|
}, Ut = (s) => {
|
|
557
|
-
const e =
|
|
554
|
+
const e = h(s.currentTarget).closest("[data-href]");
|
|
555
|
+
e.hasClass("isHover") || e.addClass("isHover");
|
|
556
|
+
}, Yt = (s) => {
|
|
557
|
+
const e = h(s.currentTarget).closest("[data-href]");
|
|
558
558
|
e.hasClass("isHover") && e.removeClass("isHover");
|
|
559
559
|
};
|
|
560
|
-
let
|
|
561
|
-
const
|
|
562
|
-
|
|
560
|
+
let Et = !0;
|
|
561
|
+
const At = () => Et, Pe = (s = !0) => {
|
|
562
|
+
Et = s, h.easing.jswing = h.easing.swing, h.extend(h.easing, {
|
|
563
563
|
def: "easeOutQuad",
|
|
564
564
|
easeOutQuad: function(t, e, i, n, o) {
|
|
565
565
|
return -n * (e /= o) * (e - 2) + i;
|
|
@@ -567,35 +567,35 @@ const Et = () => Tt, Oe = (s = !0) => {
|
|
|
567
567
|
easeInOutCirc: function(t, e, i, n, o) {
|
|
568
568
|
return (e /= o / 2) < 1 ? -n / 2 * (Math.sqrt(1 - e * e) - 1) + i : n / 2 * (Math.sqrt(1 - (e -= 2) * e) + 1) + i;
|
|
569
569
|
}
|
|
570
|
-
}), s ?
|
|
570
|
+
}), s ? h("body").on("click", "a:not(.nocg), .href-link, [data-nolink]", (t) => tt(t, s)) : h("body").on("click", "a:not(.nocg), .click-block, [data-nolink]", (t) => tt(t, s)), h("body").on("mouseenter", "[data-href] a", (t) => Ut(t)), h("body").on("mouseleave", "[data-href] a", (t) => Yt(t));
|
|
571
571
|
};
|
|
572
572
|
window.MODALS || (window.MODALS = {});
|
|
573
|
-
const { MODALS:
|
|
574
|
-
const { TEMPLATE: t } =
|
|
573
|
+
const { MODALS: q } = window, Ft = (s) => {
|
|
574
|
+
const { TEMPLATE: t } = O, { childDom: e } = s, i = document.createElement("div");
|
|
575
575
|
i.innerHTML = t(s.getAttribute("data-modal-template-setting"));
|
|
576
576
|
const n = i.querySelector(".modal-content");
|
|
577
577
|
return [...e].forEach((o) => {
|
|
578
578
|
n.append(o);
|
|
579
579
|
}), i.children[0];
|
|
580
|
-
},
|
|
581
|
-
const t =
|
|
580
|
+
}, Zt = (s) => {
|
|
581
|
+
const t = h(s);
|
|
582
582
|
if (!s) return;
|
|
583
|
-
const e =
|
|
583
|
+
const e = At();
|
|
584
584
|
if (!e) return;
|
|
585
585
|
let i = e ? "a:not(.nocg), .href-link, [data-nolink]" : "a:not(.nocg), .click-block, [data-nolink]";
|
|
586
586
|
const n = t.find(i);
|
|
587
587
|
n.off("click.modalHrefLink"), n.on("click.modalHrefLink", function(o) {
|
|
588
|
-
|
|
588
|
+
tt(o, e);
|
|
589
589
|
});
|
|
590
|
-
},
|
|
591
|
-
const t =
|
|
590
|
+
}, rt = (s) => {
|
|
591
|
+
const t = h(s);
|
|
592
592
|
if (!s) return;
|
|
593
|
-
const e =
|
|
593
|
+
const e = At();
|
|
594
594
|
if (!e) return;
|
|
595
595
|
let i = e ? "a:not(.nocg), .href-link, [data-nolink]" : "a:not(.nocg), .click-block, [data-nolink]";
|
|
596
596
|
t.find(i).off("click.modalHrefLink");
|
|
597
597
|
};
|
|
598
|
-
class
|
|
598
|
+
class St extends HTMLElement {
|
|
599
599
|
constructor() {
|
|
600
600
|
super(), this.initialize = !1;
|
|
601
601
|
}
|
|
@@ -609,17 +609,17 @@ class At extends HTMLElement {
|
|
|
609
609
|
this.initialize || (this.initialize = !0, this.#t());
|
|
610
610
|
}
|
|
611
611
|
#t() {
|
|
612
|
-
const { ATTRS: t } =
|
|
612
|
+
const { ATTRS: t } = O;
|
|
613
613
|
this.__events__ = {}, this.getAttribute(":state") || this.setAttribute(":state", "close");
|
|
614
|
-
const e = this.getAttribute(t.id) ||
|
|
615
|
-
this.getAttribute(t.id) || (w(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)),
|
|
614
|
+
const e = this.getAttribute(t.id) || zt();
|
|
615
|
+
this.getAttribute(t.id) || (w(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), q[e] && w(`the ${t.id} "${e}" is already be used.`), q[e] = this, this.#s();
|
|
616
616
|
}
|
|
617
617
|
#s() {
|
|
618
|
-
this.childDom = this.childNodes, this.template =
|
|
618
|
+
this.childDom = this.childNodes, this.template = Ft(this), this.innerHTML = "", this.append(this.template), this.#e();
|
|
619
619
|
}
|
|
620
620
|
#e() {
|
|
621
621
|
const t = this.querySelector(".modal-scroller");
|
|
622
|
-
this.__scroller__ =
|
|
622
|
+
this.__scroller__ = it(t, {
|
|
623
623
|
overflowBehavior: {
|
|
624
624
|
x: "hidden"
|
|
625
625
|
},
|
|
@@ -627,16 +627,16 @@ class At extends HTMLElement {
|
|
|
627
627
|
}), window.modalScroll = this.__scroller__, this.#i();
|
|
628
628
|
}
|
|
629
629
|
#i() {
|
|
630
|
-
const t = this, { ATTRS: e } =
|
|
630
|
+
const t = this, { ATTRS: e } = O, { close: i, destroy: n } = e;
|
|
631
631
|
t.querySelectorAll(`[${i}]`)?.forEach((o) => {
|
|
632
632
|
o.addEventListener("click", function() {
|
|
633
633
|
const a = this.getAttribute(i);
|
|
634
|
-
(a &&
|
|
634
|
+
(a && q[a] ? q[a] : t).close();
|
|
635
635
|
});
|
|
636
636
|
}), t.querySelectorAll(`[${n}]`)?.forEach((o) => {
|
|
637
637
|
o.addEventListener("click", function() {
|
|
638
638
|
const a = this.getAttribute(n);
|
|
639
|
-
(a &&
|
|
639
|
+
(a && q[a] ? q[a] : t).destroy();
|
|
640
640
|
});
|
|
641
641
|
}), t.querySelector("[stop-propagation]")?.addEventListener("click", function(o) {
|
|
642
642
|
o.stopPropagation();
|
|
@@ -666,37 +666,37 @@ class At extends HTMLElement {
|
|
|
666
666
|
if (t === "destroy") {
|
|
667
667
|
this.classList.remove("show");
|
|
668
668
|
const i = () => {
|
|
669
|
-
const { ATTRS: n } =
|
|
670
|
-
this.style.removeProperty("display"), this.emit("close"), this.remove(), this.emit("destroy"),
|
|
669
|
+
const { ATTRS: n } = O, o = this.getAttribute(n.id);
|
|
670
|
+
this.style.removeProperty("display"), this.emit("close"), this.remove(), this.emit("destroy"), q[o] && delete q[o];
|
|
671
671
|
};
|
|
672
672
|
this.addEventListener("transitionend", i);
|
|
673
673
|
}
|
|
674
674
|
}
|
|
675
675
|
open() {
|
|
676
|
-
return this.setAttribute(":state", "open"),
|
|
676
|
+
return this.setAttribute(":state", "open"), Zt(this), this;
|
|
677
677
|
}
|
|
678
678
|
close() {
|
|
679
|
-
return this.setAttribute(":state", "close"),
|
|
679
|
+
return this.setAttribute(":state", "close"), rt(this), this;
|
|
680
680
|
}
|
|
681
681
|
destroy() {
|
|
682
|
-
return this.setAttribute(":state", "destroy"),
|
|
682
|
+
return this.setAttribute(":state", "destroy"), rt(this), this;
|
|
683
683
|
}
|
|
684
684
|
}
|
|
685
|
-
Object.assign(
|
|
686
|
-
const { MODALS:
|
|
685
|
+
Object.assign(St.prototype, M);
|
|
686
|
+
const { MODALS: nt } = window, Z = {}, Lt = (s, t, ...e) => {
|
|
687
687
|
if (!t) return;
|
|
688
688
|
const i = s[t];
|
|
689
|
-
i &&
|
|
690
|
-
},
|
|
691
|
-
s &&
|
|
692
|
-
},
|
|
693
|
-
const { target: e } = s, i =
|
|
694
|
-
i &&
|
|
695
|
-
},
|
|
696
|
-
const { target: e, action: i, on: n, e: o } = s, a =
|
|
689
|
+
i && P(i) && i.apply(s, e);
|
|
690
|
+
}, _t = (s, ...t) => {
|
|
691
|
+
s && P(s) && s.apply(H, t);
|
|
692
|
+
}, lt = (s, t) => {
|
|
693
|
+
const { target: e } = s, i = nt[e] || A(s.target);
|
|
694
|
+
i && kt(s, t), i || Jt(s, t);
|
|
695
|
+
}, kt = (s, t) => {
|
|
696
|
+
const { target: e, action: i, on: n, e: o } = s, a = nt[e] || A(s.target);
|
|
697
697
|
switch (["open", "close", "destroy"].forEach((l) => {
|
|
698
698
|
a.once(l, () => {
|
|
699
|
-
t && (t.emit(l, a, o),
|
|
699
|
+
t && (t.emit(l, a, o), Lt(t, n[l], a, o)), t || _t(n[l], a);
|
|
700
700
|
});
|
|
701
701
|
}), i) {
|
|
702
702
|
case "open":
|
|
@@ -713,24 +713,24 @@ const { MODALS: st } = window, U = {}, St = (s, t, ...e) => {
|
|
|
713
713
|
l === "close" && a.open(), l === "open" && a.close();
|
|
714
714
|
break;
|
|
715
715
|
}
|
|
716
|
-
},
|
|
716
|
+
}, Jt = async (s, t) => {
|
|
717
717
|
const { target: e, route: i, container: n, on: o, e: a } = s;
|
|
718
718
|
if (!i) return w("modal4", "cannot find target or data-modal-route is not defined");
|
|
719
719
|
const r = (l, ...c) => {
|
|
720
|
-
t && (t.emit(l, ...c),
|
|
720
|
+
t && (t.emit(l, ...c), Lt(t, o[l], ...c)), t || _t(o[l], ...c);
|
|
721
721
|
};
|
|
722
|
-
|
|
723
|
-
const c =
|
|
724
|
-
[...c].forEach((
|
|
725
|
-
d.append(
|
|
722
|
+
Z[e] || (Z[e] = !0, fetch(i).then((l) => (r("success", a), l.text())).then((l) => {
|
|
723
|
+
const c = Gt(l), d = A(n) || A(O.SETTINGS.container);
|
|
724
|
+
[...c].forEach((p) => {
|
|
725
|
+
d.append(p);
|
|
726
726
|
});
|
|
727
|
-
const u =
|
|
728
|
-
r("complete", u),
|
|
727
|
+
const u = nt[e] || A(s.target);
|
|
728
|
+
r("complete", u), kt(s, t), delete Z[e];
|
|
729
729
|
}).catch((l) => {
|
|
730
|
-
r("error", l), delete
|
|
730
|
+
r("error", l), delete Z[e];
|
|
731
731
|
}));
|
|
732
732
|
};
|
|
733
|
-
class
|
|
733
|
+
class H {
|
|
734
734
|
constructor(t, e = {}) {
|
|
735
735
|
this.__storage__ = {
|
|
736
736
|
el: t,
|
|
@@ -739,8 +739,8 @@ class C {
|
|
|
739
739
|
}
|
|
740
740
|
#t() {
|
|
741
741
|
const { el: t, options: e } = this.__storage__;
|
|
742
|
-
if (!
|
|
743
|
-
const { SETTINGS: i, EVENTS: n } =
|
|
742
|
+
if (!Y(t) || !T(t)) return;
|
|
743
|
+
const { SETTINGS: i, EVENTS: n } = O;
|
|
744
744
|
if (this.elements = e.state == "not active" ? S(t + `:not([${this.active}])`) : S(t), this.options = Object.assign({}, i, e), this.__events__ = Object.assign({}, n), this.options.on)
|
|
745
745
|
for (const [o, a] of Object.entries(this.options.on))
|
|
746
746
|
this.__events__[o] = [a];
|
|
@@ -765,7 +765,7 @@ class C {
|
|
|
765
765
|
};
|
|
766
766
|
this.removeEventListener("click", i), setTimeout(() => {
|
|
767
767
|
this.addEventListener("click", i);
|
|
768
|
-
}, 200),
|
|
768
|
+
}, 200), lt(a, n);
|
|
769
769
|
}
|
|
770
770
|
destroy() {
|
|
771
771
|
const { elements: t } = this;
|
|
@@ -778,37 +778,37 @@ class C {
|
|
|
778
778
|
}
|
|
779
779
|
/** static method 'open' */
|
|
780
780
|
static open(t) {
|
|
781
|
-
const { SETTINGS: e } =
|
|
782
|
-
|
|
781
|
+
const { SETTINGS: e } = O, i = Object.assign({}, e, { on: {} }, t);
|
|
782
|
+
lt(i);
|
|
783
783
|
}
|
|
784
784
|
/** static method 'defineMethods' */
|
|
785
785
|
static defineMethods(t) {
|
|
786
|
-
|
|
787
|
-
const e =
|
|
786
|
+
H.prototype.__methods__ || (H.prototype.__methods__ = {});
|
|
787
|
+
const e = H.prototype.__methods__;
|
|
788
788
|
for (const [i, n] of Object.entries(t))
|
|
789
|
-
|
|
790
|
-
Object.assign(
|
|
789
|
+
P(n) && (e[i] = n);
|
|
790
|
+
Object.assign(H.prototype, H.prototype.__methods__);
|
|
791
791
|
}
|
|
792
792
|
}
|
|
793
|
-
Object.assign(
|
|
794
|
-
customElements.define("modern-modal",
|
|
795
|
-
const
|
|
793
|
+
Object.assign(H.prototype, M);
|
|
794
|
+
customElements.define("modern-modal", St);
|
|
795
|
+
const Qt = (s, t) => {
|
|
796
796
|
const e = s === window ? s.innerHeight : s.getBoundingClientRect().height, i = s === window ? 0 : s.getBoundingClientRect().top;
|
|
797
797
|
t.forEach((n) => {
|
|
798
|
-
const { class: o, delay: a, start: r, end: l, repeat: c, instance: d } = n.aost, { top: u, bottom:
|
|
799
|
-
if (u - i <= m &&
|
|
798
|
+
const { class: o, delay: a, start: r, end: l, repeat: c, instance: d } = n.aost, { top: u, bottom: p } = n.getBoundingClientRect(), m = e * (r / 100), g = e * (l / 100);
|
|
799
|
+
if (u - i <= m && p - i >= g && n.offsetParent)
|
|
800
800
|
setTimeout(() => {
|
|
801
801
|
n.classList.add(o);
|
|
802
802
|
}, a);
|
|
803
803
|
else {
|
|
804
|
-
const f = n.classList.contains(o) && c === "down" && u - i >= m || c === "up" &&
|
|
804
|
+
const f = n.classList.contains(o) && c === "down" && u - i >= m || c === "up" && p - i <= g || c === !0;
|
|
805
805
|
setTimeout(() => {
|
|
806
806
|
f && n.classList.remove(o);
|
|
807
807
|
}, a);
|
|
808
808
|
}
|
|
809
809
|
});
|
|
810
|
-
},
|
|
811
|
-
class
|
|
810
|
+
}, Kt = (s, t) => s === "up" || s === "down" ? s : s !== null ? s === "true" ? !0 : s === "false" ? !1 : t.repeat : t.repeat;
|
|
811
|
+
class Dt {
|
|
812
812
|
constructor(t, e = {}) {
|
|
813
813
|
this.__storage__ = {
|
|
814
814
|
el: t,
|
|
@@ -817,8 +817,8 @@ class kt {
|
|
|
817
817
|
}
|
|
818
818
|
#t() {
|
|
819
819
|
const { el: t, options: e } = this.__storage__;
|
|
820
|
-
if (!
|
|
821
|
-
const { SETTINGS: i, EVENTS: n } =
|
|
820
|
+
if (!Y(t) || !T(t)) return;
|
|
821
|
+
const { SETTINGS: i, EVENTS: n } = vt;
|
|
822
822
|
if (this.elements = e.state == "not active" ? S(t + `:not([${this.active}])`) : S(t), this.options = Object.assign({}, i, e), this.__events__ = Object.assign({}, n), this.options.on)
|
|
823
823
|
for (const [o, a] of Object.entries(this.options.on))
|
|
824
824
|
this.__events__[o] = [a];
|
|
@@ -827,9 +827,9 @@ class kt {
|
|
|
827
827
|
#s() {
|
|
828
828
|
const { elements: t, options: e } = this, { scroller: i } = e, n = i === window || !T(i) ? window : A(i);
|
|
829
829
|
this.eventHandler = () => {
|
|
830
|
-
|
|
830
|
+
Qt(n, t);
|
|
831
831
|
}, t.forEach((a) => {
|
|
832
|
-
a.aost = {}, a.aost.class = a.getAttribute("data-aost-class") || e.class, a.aost.delay = parseInt(a.getAttribute("data-aost-delay")) || e.delay, a.aost.start = parseInt(a.getAttribute("data-aost-start")) || e.start, a.aost.end = parseInt(a.getAttribute("data-aost-end")) || e.end, a.aost.repeat =
|
|
832
|
+
a.aost = {}, a.aost.class = a.getAttribute("data-aost-class") || e.class, a.aost.delay = parseInt(a.getAttribute("data-aost-delay")) || e.delay, a.aost.start = parseInt(a.getAttribute("data-aost-start")) || e.start, a.aost.end = parseInt(a.getAttribute("data-aost-end")) || e.end, a.aost.repeat = Kt(a.getAttribute("data-aost-repeat"), e), a.aost.methods = {}, a.aost.methods.destroy = this.destroy, a.aost.methods.update = this.update, a.aost.instance = this, a.setAttribute(this.active, "");
|
|
833
833
|
});
|
|
834
834
|
const { eventHandler: o } = this;
|
|
835
835
|
o(), n.aost = {}, n.aost.eventHandler = o, n.addEventListener("scroll", n.aost.eventHandler, !1);
|
|
@@ -848,16 +848,16 @@ class kt {
|
|
|
848
848
|
this.destroy(t).#t();
|
|
849
849
|
}
|
|
850
850
|
}
|
|
851
|
-
Object.assign(
|
|
852
|
-
const
|
|
853
|
-
const { TEMPLATE: t } =
|
|
851
|
+
Object.assign(Dt.prototype, M);
|
|
852
|
+
const Vt = (s) => {
|
|
853
|
+
const { TEMPLATE: t } = U, { childDom: e } = s, i = document.createElement("div");
|
|
854
854
|
i.innerHTML = t();
|
|
855
855
|
const n = i.querySelector(".player-wrapper");
|
|
856
856
|
return [...e].forEach((o) => {
|
|
857
857
|
n.append(o);
|
|
858
858
|
}), i.children[0];
|
|
859
859
|
};
|
|
860
|
-
class
|
|
860
|
+
class te extends HTMLElement {
|
|
861
861
|
constructor() {
|
|
862
862
|
super(), this.#t();
|
|
863
863
|
}
|
|
@@ -866,16 +866,16 @@ class Vt extends HTMLElement {
|
|
|
866
866
|
w("videoPlayer", "video-render needs a ['video-id'] attribute to creat player.");
|
|
867
867
|
return;
|
|
868
868
|
}
|
|
869
|
-
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"), this.#s();
|
|
869
|
+
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"), this.isShorts = this.hasAttribute("video-is-shorts"), this.#s();
|
|
870
870
|
}
|
|
871
871
|
#s() {
|
|
872
|
-
this.childDom = this.childNodes, this.template =
|
|
872
|
+
this.childDom = this.childNodes, this.template = Vt(this), this.innerHTML = "", this.append(this.template), this.#e();
|
|
873
873
|
}
|
|
874
874
|
#e() {
|
|
875
|
-
const { videoType: t, videoMode: e } = this, { COOKIEDISAGREELAYOUT: i } =
|
|
875
|
+
const { videoType: t, videoMode: e } = this, { COOKIEDISAGREELAYOUT: i } = U;
|
|
876
876
|
let n = "";
|
|
877
877
|
function o(a) {
|
|
878
|
-
|
|
878
|
+
h(a).addClass("cookie-disagree"), h(".cookie-disagree").append(i);
|
|
879
879
|
}
|
|
880
880
|
switch (t) {
|
|
881
881
|
case "youtubeAPI":
|
|
@@ -977,25 +977,25 @@ class Vt extends HTMLElement {
|
|
|
977
977
|
}
|
|
978
978
|
}
|
|
979
979
|
}
|
|
980
|
-
let
|
|
981
|
-
function
|
|
980
|
+
let W = 0;
|
|
981
|
+
function $t(s) {
|
|
982
982
|
const t = [];
|
|
983
983
|
return (s || []).forEach((e) => {
|
|
984
984
|
e instanceof HTMLElement ? t.push(e) : typeof e == "string" && t.push(...document.querySelectorAll(e));
|
|
985
985
|
}), t;
|
|
986
986
|
}
|
|
987
|
-
function $t(s) {
|
|
988
|
-
const t = Dt(s);
|
|
989
|
-
B += 1, B === 1 && document.documentElement.classList.add("scrollLock"), Ot(t);
|
|
990
|
-
}
|
|
991
987
|
function xt(s) {
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
988
|
+
const t = $t(s);
|
|
989
|
+
W += 1, W === 1 && document.documentElement.classList.add("scrollLock"), Pt(t);
|
|
990
|
+
}
|
|
991
|
+
function Ct(s) {
|
|
992
|
+
W = Math.max(0, W - 1);
|
|
993
|
+
const t = $t(s);
|
|
994
|
+
Mt(t), W === 0 && document.documentElement.classList.remove("scrollLock");
|
|
995
995
|
}
|
|
996
|
-
async function
|
|
997
|
-
if (
|
|
998
|
-
|
|
996
|
+
async function Ne(s = 0) {
|
|
997
|
+
if (h(".loading-wrapper").length) return;
|
|
998
|
+
h("body").append(`
|
|
999
999
|
<div class="loading-wrapper">
|
|
1000
1000
|
<div class="icon-box">
|
|
1001
1001
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"><path d="M10 50A40 40 0 0 0 90 50A40 42 0 0 1 10 50" fill="#ffffff" stroke="none">
|
|
@@ -1005,31 +1005,31 @@ async function Pe(s = 0) {
|
|
|
1005
1005
|
</svg>
|
|
1006
1006
|
</div>
|
|
1007
1007
|
</div>
|
|
1008
|
-
`),
|
|
1009
|
-
|
|
1008
|
+
`), h(".loading-wrapper").delay(s).fadeIn(300).promise().done(function() {
|
|
1009
|
+
xt();
|
|
1010
1010
|
});
|
|
1011
1011
|
}
|
|
1012
|
-
function
|
|
1013
|
-
|
|
1014
|
-
|
|
1012
|
+
function je() {
|
|
1013
|
+
h(".loading-wrapper").fadeOut(300).promise().done(function() {
|
|
1014
|
+
h(".loading-wrapper").remove(), Ct();
|
|
1015
1015
|
});
|
|
1016
1016
|
}
|
|
1017
|
-
function
|
|
1018
|
-
new
|
|
1017
|
+
function ze(s, t) {
|
|
1018
|
+
new De(s, t);
|
|
1019
1019
|
}
|
|
1020
|
-
function
|
|
1021
|
-
const s = document.querySelector("[data-aost]") && new
|
|
1022
|
-
} }), i = new
|
|
1020
|
+
function ee() {
|
|
1021
|
+
const s = document.querySelector("[data-aost]") && new Dt("[data-aost]"), t = document.querySelector("[data-anchor-target]") && new Tt("[data-anchor-target]"), e = new ft({ callback_loaded: () => {
|
|
1022
|
+
} }), i = new Te();
|
|
1023
1023
|
s?.update(), e.update(), i.reValidate(), t?.update();
|
|
1024
1024
|
}
|
|
1025
|
-
function
|
|
1025
|
+
function Ge(s, t = () => {
|
|
1026
1026
|
}) {
|
|
1027
|
-
|
|
1027
|
+
h(`[data-tab-content=${s}]`).fadeIn(function() {
|
|
1028
1028
|
typeof t == "function" && t();
|
|
1029
|
-
}).siblings("[data-tab-content]").hide(),
|
|
1029
|
+
}).siblings("[data-tab-content]").hide(), ee();
|
|
1030
1030
|
}
|
|
1031
1031
|
function Be() {
|
|
1032
|
-
|
|
1032
|
+
it(
|
|
1033
1033
|
{
|
|
1034
1034
|
target: document.body,
|
|
1035
1035
|
cancel: {
|
|
@@ -1053,31 +1053,31 @@ function Be() {
|
|
|
1053
1053
|
}
|
|
1054
1054
|
);
|
|
1055
1055
|
}
|
|
1056
|
-
function
|
|
1056
|
+
function We() {
|
|
1057
1057
|
window.onpageshow = function(s) {
|
|
1058
1058
|
s.persisted && window.location.reload();
|
|
1059
1059
|
};
|
|
1060
1060
|
}
|
|
1061
|
-
function
|
|
1061
|
+
function Re() {
|
|
1062
1062
|
const s = navigator.userAgent;
|
|
1063
1063
|
return {
|
|
1064
1064
|
BigSurUP: /Mac OS X 10.15/.test(s) || /Mac OS X 10_15_7/.test(s) || /Mac OS X 10_15_8/.test(s) || /Mac OS X 10_15_9/.test(s) || /Mac OS X 11_/.test(s) || /Mac OS X 12_/.test(s)
|
|
1065
1065
|
};
|
|
1066
1066
|
}
|
|
1067
|
-
function
|
|
1068
|
-
|
|
1069
|
-
|
|
1067
|
+
function Xe(s, t) {
|
|
1068
|
+
h(s).on("click", function() {
|
|
1069
|
+
h(this).toggleClass(t);
|
|
1070
1070
|
});
|
|
1071
1071
|
}
|
|
1072
|
-
function
|
|
1073
|
-
|
|
1074
|
-
|
|
1072
|
+
function Ue(s, t) {
|
|
1073
|
+
h(s).on("click", function() {
|
|
1074
|
+
h(s).not(this).removeClass(t), h(this).addClass(t);
|
|
1075
1075
|
});
|
|
1076
1076
|
}
|
|
1077
|
-
const
|
|
1077
|
+
const Ye = (s) => new Promise((t) => {
|
|
1078
1078
|
let e = setTimeout(() => (clearTimeout(e), t()), s);
|
|
1079
1079
|
});
|
|
1080
|
-
function
|
|
1080
|
+
function ie(s, t = 250) {
|
|
1081
1081
|
let e = null;
|
|
1082
1082
|
return function(...i) {
|
|
1083
1083
|
let n = this;
|
|
@@ -1086,7 +1086,7 @@ function ee(s, t = 250) {
|
|
|
1086
1086
|
}, t);
|
|
1087
1087
|
};
|
|
1088
1088
|
}
|
|
1089
|
-
function
|
|
1089
|
+
function Fe(s, t = 250) {
|
|
1090
1090
|
let e, i;
|
|
1091
1091
|
return function() {
|
|
1092
1092
|
const n = this, o = arguments, a = +/* @__PURE__ */ new Date();
|
|
@@ -1095,44 +1095,44 @@ function Ye(s, t = 250) {
|
|
|
1095
1095
|
}, t)) : (e = a, s.apply(n, o));
|
|
1096
1096
|
};
|
|
1097
1097
|
}
|
|
1098
|
-
function
|
|
1099
|
-
window._g.interval = [],
|
|
1100
|
-
const i = Number(
|
|
1098
|
+
function Ze() {
|
|
1099
|
+
window._g.interval = [], h(".countdown").each((t, e) => {
|
|
1100
|
+
const i = Number(h(e).attr("data-seconds")) + 1;
|
|
1101
1101
|
let n = Math.floor(i / 60) + ":" + i % 60;
|
|
1102
1102
|
window._g.interval[t] = setInterval(function() {
|
|
1103
1103
|
var o = n.split(":"), a = parseInt(o[0], 10), r = parseInt(o[1], 10);
|
|
1104
|
-
--r, a = r < 0 ? --a : a, a = a < 10 ? a = "0" + a : a, a == 0 && r == 0 && clearInterval(window._g.interval[t]), r = r < 0 ? 59 : r, r = r < 10 ? "0" + r : r,
|
|
1104
|
+
--r, a = r < 0 ? --a : a, a = a < 10 ? a = "0" + a : a, a == 0 && r == 0 && clearInterval(window._g.interval[t]), r = r < 0 ? 59 : r, r = r < 10 ? "0" + r : r, h(e).html(a + ":" + r), n = a + ":" + r;
|
|
1105
1105
|
}, 1e3);
|
|
1106
1106
|
});
|
|
1107
1107
|
}
|
|
1108
|
-
function
|
|
1108
|
+
function Je(s = 500) {
|
|
1109
1109
|
return new Promise((t, e) => {
|
|
1110
1110
|
let i = setTimeout(() => {
|
|
1111
1111
|
clearTimeout(i), t();
|
|
1112
1112
|
}, s);
|
|
1113
1113
|
});
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1115
|
+
function Qe() {
|
|
1116
1116
|
const s = function() {
|
|
1117
1117
|
let t = window.innerHeight * 0.01;
|
|
1118
1118
|
document.documentElement.style.setProperty("--vh", t + "px");
|
|
1119
1119
|
};
|
|
1120
|
-
s(), window.addEventListener("resize",
|
|
1120
|
+
s(), window.addEventListener("resize", ie(s));
|
|
1121
1121
|
}
|
|
1122
|
-
function
|
|
1123
|
-
const o = this, r =
|
|
1122
|
+
function Ke(s, t, e, i, n) {
|
|
1123
|
+
const o = this, r = h(s).html().split("<br>");
|
|
1124
1124
|
let l = "", c = 0;
|
|
1125
1125
|
r.forEach((d, u) => {
|
|
1126
1126
|
u !== 0 && (l += "<br>"), d.split("").forEach((m, g) => {
|
|
1127
1127
|
t ? (g === 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"${n || e ? ` style="${n ? `transition: ${o.formatFloat(Math.random(), 2) * n}s;` : ""}${e ? e === "random" ? `transition-delay: ${o.formatFloat(Math.random(), 2)}s;` : `transition-delay: ${e + c * i}s;` : ""}"` : ""}>${m}</span>`, c++), g === d.length - 1 && (l += "</span>")) : m === " " ? l += " " : (l += `<span class="letter"${n || e ? ` style="${n ? `transition: ${o.formatFloat(Math.random(), 2) * n}s;` : ""}${e ? e === "random" ? `transition-delay: ${o.formatFloat(Math.random(), 2)}s;` : `transition-delay: ${e + c * i}s;` : ""}"` : ""}>${m}</span>`, c++);
|
|
1128
1128
|
});
|
|
1129
|
-
}),
|
|
1129
|
+
}), h(s).html(l);
|
|
1130
1130
|
}
|
|
1131
|
-
function
|
|
1131
|
+
function Ve(s, t) {
|
|
1132
1132
|
const e = Math.pow(10, t);
|
|
1133
1133
|
return Math.round(s * e) / e;
|
|
1134
1134
|
}
|
|
1135
|
-
function
|
|
1135
|
+
function ti(s) {
|
|
1136
1136
|
let t = s.activeIndex, e = s.slides.length;
|
|
1137
1137
|
if (s.params.loop)
|
|
1138
1138
|
switch (s.activeIndex) {
|
|
@@ -1147,74 +1147,74 @@ function Ve(s) {
|
|
|
1147
1147
|
}
|
|
1148
1148
|
return t;
|
|
1149
1149
|
}
|
|
1150
|
-
function
|
|
1150
|
+
function ei(s, t) {
|
|
1151
1151
|
const e = s.$el, i = s.params.grid.rows, n = t || s.params.slidesPerView * i;
|
|
1152
|
-
(s.loopedSlides ? s.slides.length - s.loopedSlides * 2 : s.slides.length) <= n ? (e.addClass("swiper-no-swiping"),
|
|
1152
|
+
(s.loopedSlides ? s.slides.length - s.loopedSlides * 2 : s.slides.length) <= n ? (e.addClass("swiper-no-swiping"), h(s.params.navigation.nextEl).hide(), h(s.params.navigation.prevEl).hide(), h(s.params.pagination.el).hide(), s.params.autoplay.enabled = !1, s.autoplay.stop()) : (e.removeClass("swiper-no-swiping"), h(s.params.navigation.nextEl).show(), h(s.params.navigation.prevEl).show(), h(s.params.pagination.el).show(), s.params.autoplay.enabled && s.autoplay.start());
|
|
1153
1153
|
}
|
|
1154
|
-
function
|
|
1154
|
+
function ii(s) {
|
|
1155
1155
|
s.el.querySelectorAll("img.detect-shade").forEach((t) => {
|
|
1156
1156
|
t.addEventListener("load", function() {
|
|
1157
1157
|
detectShade(t);
|
|
1158
1158
|
});
|
|
1159
1159
|
});
|
|
1160
1160
|
}
|
|
1161
|
-
function
|
|
1162
|
-
const t = s.el, e =
|
|
1163
|
-
s.autoplay.stop(),
|
|
1161
|
+
function si(s) {
|
|
1162
|
+
const t = s.el, e = h(t).find(".swiper-slide-active"), i = h(e).find("video").get(0), n = h(t).find(".swiper-slide video");
|
|
1163
|
+
s.autoplay.stop(), h(i).off("ended"), i ? (n.each((o, a) => {
|
|
1164
1164
|
a.currentTime = 0;
|
|
1165
|
-
}),
|
|
1165
|
+
}), h(i).on("ended", function() {
|
|
1166
1166
|
s.slideNext();
|
|
1167
1167
|
}), i.play()) : s.params.autoplay.enabled && s.autoplay.start();
|
|
1168
1168
|
}
|
|
1169
|
-
function
|
|
1170
|
-
|
|
1171
|
-
const e =
|
|
1169
|
+
function ni() {
|
|
1170
|
+
h(".number-grow").each(function(s, t) {
|
|
1171
|
+
const e = h(t), o = e.attr("data-num").replace(/(\d)(?=(?:\d{3})+$)/g, "$1,").split(""), a = () => {
|
|
1172
1172
|
let r = "";
|
|
1173
1173
|
for (var l = 0; l <= 9; l++)
|
|
1174
1174
|
r += String(l) + "<br>";
|
|
1175
1175
|
return r;
|
|
1176
1176
|
};
|
|
1177
|
-
|
|
1177
|
+
h(o).each(function(r, l) {
|
|
1178
1178
|
const c = () => l !== "," ? `<div class="num" data-final-num="${l}"><div><br>${a()}<br>${a()}</div></div>` : `<div class="comma">${l}</div>`;
|
|
1179
1179
|
e.append(c);
|
|
1180
1180
|
});
|
|
1181
1181
|
});
|
|
1182
1182
|
}
|
|
1183
|
-
function
|
|
1184
|
-
|
|
1185
|
-
const e =
|
|
1183
|
+
function oi() {
|
|
1184
|
+
h(".letter-grow").each(function(s, t) {
|
|
1185
|
+
const e = h(t), n = e.attr("data-letter").split(""), o = () => {
|
|
1186
1186
|
let a = "";
|
|
1187
1187
|
for (let r = 65; r <= 90; r++)
|
|
1188
1188
|
a += String.fromCharCode(r) + "<br>";
|
|
1189
1189
|
return a;
|
|
1190
1190
|
};
|
|
1191
|
-
|
|
1191
|
+
h(n).each(function(a, r) {
|
|
1192
1192
|
const l = `<div class="letter" data-final-letter="${r}"><div><br>${o()}<br>${o()}</div></div>`;
|
|
1193
1193
|
e.append(l);
|
|
1194
1194
|
});
|
|
1195
1195
|
});
|
|
1196
1196
|
}
|
|
1197
|
-
function
|
|
1197
|
+
function ai(s) {
|
|
1198
1198
|
const t = getComputedStyle(s).transform;
|
|
1199
1199
|
let e = t.match(/^matrix3d\((.+)\)$/);
|
|
1200
1200
|
return e ? parseFloat(e[1].split(", ")[12]) : (e = t.match(/^matrix\((.+)\)$/), e ? parseFloat(e[1].split(", ")[4]) : 0);
|
|
1201
1201
|
}
|
|
1202
|
-
function
|
|
1202
|
+
function ri(s) {
|
|
1203
1203
|
const t = getComputedStyle(s).transform;
|
|
1204
1204
|
let e = t.match(/^matrix3d\((.+)\)$/);
|
|
1205
1205
|
return e ? parseFloat(e[1].split(", ")[13]) : (e = t.match(/^matrix\((.+)\)$/), e ? parseFloat(e[1].split(", ")[5]) : 0);
|
|
1206
1206
|
}
|
|
1207
|
-
function
|
|
1207
|
+
function li(s) {
|
|
1208
1208
|
const t = document.createElement("div");
|
|
1209
1209
|
return t.innerHTML = s, t.childNodes[0];
|
|
1210
1210
|
}
|
|
1211
|
-
const
|
|
1212
|
-
class
|
|
1211
|
+
const ct = (s) => s.videoId !== "" || typeof s.videoId < "u", se = (s) => s.$selector.getAttribute("video4-active") === "on", B = (s) => `<video-player video-id="${s.videoId}" video-type="${s.videoType}" video-startTime="${s.videoStartTime}" video-autoplay="${s.videoAutoplay}"></video-player>`, dt = (s) => (console.log(s.videoId, "params.videoId"), `<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-permalink="${s.videoId}"></blockquote>`);
|
|
1212
|
+
class R {
|
|
1213
1213
|
static globalOptions = {};
|
|
1214
1214
|
//*-* 給Article4用的 **//
|
|
1215
1215
|
constructor(t, e = {}) {
|
|
1216
|
-
if (!
|
|
1217
|
-
|
|
1216
|
+
if (!Y(t) && !K(t) && !F(t)) {
|
|
1217
|
+
at("video4", `找不到該物件 -> ${t}`);
|
|
1218
1218
|
return;
|
|
1219
1219
|
}
|
|
1220
1220
|
this.__storage__ = {
|
|
@@ -1223,26 +1223,26 @@ class G {
|
|
|
1223
1223
|
}, this.active = "data-video-active", this.#t();
|
|
1224
1224
|
}
|
|
1225
1225
|
#t() {
|
|
1226
|
-
const { el: t, options: e } = this.__storage__, { SETTINGS: i, EVENTS: n, LAYOUT: o } =
|
|
1227
|
-
if (e.isGlobal && (
|
|
1226
|
+
const { el: t, options: e } = this.__storage__, { SETTINGS: i, EVENTS: n, LAYOUT: o } = U;
|
|
1227
|
+
if (e.isGlobal && (R.globalOptions = e), this.elements = e.state == "not active" ? S(t + `:not([${this.active}])`) : S(t), this.options = Object.assign(
|
|
1228
1228
|
{},
|
|
1229
1229
|
{ LAYOUT: o },
|
|
1230
1230
|
// 原始 configs 的 LAYOUT
|
|
1231
1231
|
i,
|
|
1232
1232
|
// 原始 configs 的 SETTINGS
|
|
1233
|
-
|
|
1233
|
+
R.globalOptions,
|
|
1234
1234
|
// 全站 A 設定
|
|
1235
1235
|
e
|
|
1236
1236
|
// 個別傳入的設定 (優先級最高)
|
|
1237
1237
|
), this.__events__ = Object.assign({}, n), this.options.on)
|
|
1238
1238
|
for (const [a, r] of Object.entries(this.options.on))
|
|
1239
1239
|
this.__events__[a] = [r];
|
|
1240
|
-
this.#s();
|
|
1240
|
+
this.options.COOKIEDISAGREELAYOUT !== void 0 && (U.COOKIEDISAGREELAYOUT = this.options.COOKIEDISAGREELAYOUT), this.#s();
|
|
1241
1241
|
}
|
|
1242
1242
|
#s() {
|
|
1243
1243
|
const { elements: t, options: e } = this;
|
|
1244
1244
|
t.forEach((i) => {
|
|
1245
|
-
i.video = {}, i.video.instance = this, i.video.defaultOptions = e, i.video.params = this.#a(i), i.video.methods = {}, i.video.methods.update = this.update, i.setAttribute(this.active, ""),
|
|
1245
|
+
i.video = {}, i.video.instance = this, i.video.defaultOptions = e, i.video.params = this.#a(i), i.video.methods = {}, i.video.methods.update = this.update, i.setAttribute(this.active, ""), ct(i.video.params) && !se(i.video.params) && (i.setAttribute("video4-active", "on"), this.#n(i)), ct(i.video.params) || at("video4", "無法取得影片 ID");
|
|
1246
1246
|
}), this.emit("init");
|
|
1247
1247
|
}
|
|
1248
1248
|
#e(t) {
|
|
@@ -1272,11 +1272,11 @@ class G {
|
|
|
1272
1272
|
#n(t) {
|
|
1273
1273
|
const { LAYOUT: e } = this.options, i = t.video.params, { $selector: n, videoLayoutNo: o, videoId: a, videoType: r, videoMode: l, videoButton: c, videoCover: d, videoHighQualityPic: u } = i;
|
|
1274
1274
|
if (l === "onBox" || l === "inBox") {
|
|
1275
|
-
let
|
|
1275
|
+
let p = null;
|
|
1276
1276
|
if (d === "on") {
|
|
1277
1277
|
t.classList.add("video4-cover"), n.querySelector("img") || (n.insertAdjacentHTML(E.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), w("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
|
|
1278
|
-
const m = n.querySelector("img"), g = m?.getAttribute("src") || m?.getAttribute("data-src"),
|
|
1279
|
-
if (
|
|
1278
|
+
const m = n.querySelector("img"), g = m?.getAttribute("src") || m?.getAttribute("data-src"), y = e[o] ? e[o] : e[0] || "";
|
|
1279
|
+
if (y ? m.insertAdjacentHTML(E.after, y) : w("video4", `找不到對應的 LAYOUT 設定 (No: ${o}),且無預設樣式。`), !g)
|
|
1280
1280
|
this.#i(m, i);
|
|
1281
1281
|
else if (!g && r == "youtube")
|
|
1282
1282
|
u == "on" ? m.setAttribute("src", `https://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`);
|
|
@@ -1297,25 +1297,25 @@ class G {
|
|
|
1297
1297
|
console.log("error");
|
|
1298
1298
|
}) : w("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
|
|
1299
1299
|
}
|
|
1300
|
-
c == "off" ?
|
|
1300
|
+
c == "off" ? p = n : (p = n.querySelector(c) ?? n, n.querySelector(c) || w("video4", `找不到 videoButton 設定的 element -> '${c}' , 點擊物件轉移至 '${this.__storage__.el}'`)), p.video || (p.video = {}, p.video.params = i, p.video.instance = this), p.video.eventHandler = this.#o, p.addEventListener("click", p.video.eventHandler);
|
|
1301
1301
|
} else if (l === "onPage") {
|
|
1302
|
-
let
|
|
1302
|
+
let p = null;
|
|
1303
1303
|
if (d == "on") {
|
|
1304
1304
|
t.classList.add("video4-cover"), n.querySelector("img") || (n.insertAdjacentHTML(E.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), w("video", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構"));
|
|
1305
1305
|
const m = n.querySelector("img");
|
|
1306
1306
|
m.insertAdjacentHTML(E.after, e[o]);
|
|
1307
1307
|
const g = m?.getAttribute("src") || m?.getAttribute("data-src");
|
|
1308
|
-
g ? !g && r == "youtube" ? u == "on" ? m.setAttribute("src", `http://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`) : !g && r == "vimeo" ? m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !g && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((
|
|
1309
|
-
const f =
|
|
1308
|
+
g ? !g && r == "youtube" ? u == "on" ? m.setAttribute("src", `http://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`) : !g && r == "vimeo" ? m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !g && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((y) => y.json()).then((y) => {
|
|
1309
|
+
const f = y.thumbnail_url;
|
|
1310
1310
|
m.setAttribute("src", `${f}`);
|
|
1311
|
-
}).catch(function(
|
|
1311
|
+
}).catch(function(y) {
|
|
1312
1312
|
console.log("error");
|
|
1313
|
-
}) : g || w("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片") : this.#i(m, i), c == "off" ?
|
|
1313
|
+
}) : g || w("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片") : this.#i(m, i), c == "off" ? p = n : (p = n.querySelector(c) ?? n, n.querySelector(c) || w("video4", `找不到 videoButton 設定的 element -> '${c}', 點擊物件轉移至 '${this.__storage__.el}'`));
|
|
1314
1314
|
} else {
|
|
1315
|
-
n.innerHTML =
|
|
1315
|
+
n.innerHTML = B(i);
|
|
1316
1316
|
return;
|
|
1317
1317
|
}
|
|
1318
|
-
|
|
1318
|
+
p.video || (p.video = {}, p.video.params = i), p.video.eventHandler = this.#o, p.addEventListener("click", p.video.eventHandler);
|
|
1319
1319
|
}
|
|
1320
1320
|
}
|
|
1321
1321
|
#o(t) {
|
|
@@ -1328,40 +1328,41 @@ class G {
|
|
|
1328
1328
|
videoTargetRoute: c,
|
|
1329
1329
|
videoType: d,
|
|
1330
1330
|
videoIgHtml: u,
|
|
1331
|
-
videoInboxImg:
|
|
1331
|
+
videoInboxImg: p,
|
|
1332
1332
|
videoButton: m,
|
|
1333
1333
|
videoLayoutNo: g,
|
|
1334
|
-
videoStartTime:
|
|
1335
|
-
|
|
1336
|
-
}
|
|
1334
|
+
videoStartTime: y,
|
|
1335
|
+
videoIsShorts: f
|
|
1336
|
+
} = e.params, v = new ft({ callback_loaded: (I) => {
|
|
1337
|
+
} }), N = new URLSearchParams({
|
|
1337
1338
|
video_mode: o,
|
|
1338
1339
|
video_type: d,
|
|
1339
1340
|
video_id: l
|
|
1340
1341
|
});
|
|
1341
1342
|
if (o == "onBox" || o == "inBox") {
|
|
1342
|
-
const
|
|
1343
|
+
const I = {
|
|
1343
1344
|
target: a,
|
|
1344
|
-
route: c + `?${
|
|
1345
|
+
route: c + `?${N.toString()}`,
|
|
1345
1346
|
on: {
|
|
1346
|
-
complete(
|
|
1347
|
-
o == "onBox" && (d == "instagram" ? (
|
|
1347
|
+
complete(b) {
|
|
1348
|
+
o == "onBox" && (d == "instagram" ? (b.setAttribute("video-typeStyle", `${d}`), window.instgrm?.Embeds ? (b.querySelector(".modal-content").insertAdjacentHTML("beforeend", dt(e.params)), window.instgrm.Embeds.process()) : console.log("window.instgrm is undefined")) : d == "youtube" && f ? (b.querySelector(".modal-content").insertAdjacentHTML("beforeend", B(e.params)), b.setAttribute("video-typeStyle", "youtube-shorts")) : (b.querySelector(".modal-content").insertAdjacentHTML("beforeend", B(e.params)), b.setAttribute("video-typeStyle", `${d}`))), o == "inBox" && (d == "youtube" && f ? b.setAttribute("video-typeStyle", "youtube-shorts") : b.setAttribute("video-typeStyle", `${d}`), d == "instagram" && (window.instgrm?.Embeds ? (b.querySelector(".modal-content").insertAdjacentHTML("beforeend", dt(e.params)), window.instgrm.Embeds.process()) : console.log("window.instgrm is undefined")));
|
|
1348
1349
|
},
|
|
1349
|
-
open(
|
|
1350
|
-
const
|
|
1351
|
-
if (
|
|
1352
|
-
const
|
|
1353
|
-
new ResizeObserver((
|
|
1354
|
-
|
|
1355
|
-
}).observe(
|
|
1350
|
+
open(b) {
|
|
1351
|
+
const j = b.querySelectorAll("[data-overlayscrollbars-viewport]");
|
|
1352
|
+
if (v.update(), xt([...j]), d == "instagram") {
|
|
1353
|
+
const L = document.querySelector("[video-template] .modal-content");
|
|
1354
|
+
new ResizeObserver((G) => {
|
|
1355
|
+
G[0].contentRect.height > 50 && L.classList.add("active");
|
|
1356
|
+
}).observe(L);
|
|
1356
1357
|
}
|
|
1357
1358
|
if (o == "inBox")
|
|
1358
1359
|
if (d == "instagram")
|
|
1359
|
-
|
|
1360
|
+
h(".video-content").remove();
|
|
1360
1361
|
else {
|
|
1361
|
-
let
|
|
1362
|
-
const
|
|
1363
|
-
i.#e(e.params).then((
|
|
1364
|
-
|
|
1362
|
+
let L;
|
|
1363
|
+
const z = b.querySelector(".video-content");
|
|
1364
|
+
i.#e(e.params).then((G) => {
|
|
1365
|
+
L = `
|
|
1365
1366
|
<div
|
|
1366
1367
|
class="photo-box"
|
|
1367
1368
|
video-target
|
|
@@ -1370,46 +1371,48 @@ class G {
|
|
|
1370
1371
|
video-id="${l}"
|
|
1371
1372
|
video-button="${m}"
|
|
1372
1373
|
video-layout-no="${g}"
|
|
1373
|
-
video-starttime="${
|
|
1374
|
+
video-starttime="${y}"
|
|
1374
1375
|
>
|
|
1375
1376
|
<picture>
|
|
1376
1377
|
<source
|
|
1377
|
-
srcset="${
|
|
1378
|
+
srcset="${G || ""}"
|
|
1378
1379
|
type="image/webp"
|
|
1379
1380
|
/>
|
|
1380
1381
|
<source
|
|
1381
|
-
srcset="${
|
|
1382
|
+
srcset="${G || ""}"
|
|
1382
1383
|
type="image/jpeg"
|
|
1383
1384
|
/>
|
|
1384
|
-
<img src="${
|
|
1385
|
+
<img src="${G || ""}" alt="" />
|
|
1385
1386
|
</picture>
|
|
1386
|
-
</div>`,
|
|
1387
|
-
const
|
|
1388
|
-
|
|
1387
|
+
</div>`, z.insertAdjacentHTML(E.prepend, L);
|
|
1388
|
+
const ot = b.querySelectorAll("[video-target]");
|
|
1389
|
+
ot.length > 0 && new R(ot, {
|
|
1389
1390
|
LAYOUT: e.params.LAYOUT,
|
|
1390
|
-
videoLayoutNo: e.params.videoLayoutNo
|
|
1391
|
+
videoLayoutNo: e.params.videoLayoutNo,
|
|
1392
|
+
// 0612
|
|
1393
|
+
videoIsShorts: e.params.videoIsShorts
|
|
1391
1394
|
});
|
|
1392
1395
|
});
|
|
1393
1396
|
}
|
|
1394
1397
|
i?.emit("openModal");
|
|
1395
1398
|
},
|
|
1396
|
-
close(
|
|
1397
|
-
const
|
|
1398
|
-
|
|
1399
|
+
close(b) {
|
|
1400
|
+
const j = b.querySelectorAll("[data-overlayscrollbars-viewport]");
|
|
1401
|
+
Ct([...j]), i?.emit("closeModal");
|
|
1399
1402
|
},
|
|
1400
|
-
destroy(
|
|
1403
|
+
destroy(b) {
|
|
1401
1404
|
}
|
|
1402
1405
|
}
|
|
1403
1406
|
};
|
|
1404
|
-
|
|
1407
|
+
H.open(I);
|
|
1405
1408
|
} else if (o == "onPage")
|
|
1406
1409
|
if (e.params.videoAutoplay = "on", r == "off") {
|
|
1407
1410
|
if (n.querySelector("video-player"))
|
|
1408
1411
|
return;
|
|
1409
|
-
n.innerHTML =
|
|
1412
|
+
n.innerHTML = B(e.params);
|
|
1410
1413
|
return;
|
|
1411
1414
|
} else {
|
|
1412
|
-
(n.querySelector(r) ?? n).insertAdjacentHTML("beforeend",
|
|
1415
|
+
(n.querySelector(r) ?? n).insertAdjacentHTML("beforeend", B(e.params));
|
|
1413
1416
|
return;
|
|
1414
1417
|
}
|
|
1415
1418
|
}
|
|
@@ -1431,16 +1434,20 @@ class G {
|
|
|
1431
1434
|
videoHighQualityPic: t.getAttribute("video-highquality") || e.videoHighQuality,
|
|
1432
1435
|
videoIgHtml: t.getAttribute("video-ig") || e.videoIgHtml,
|
|
1433
1436
|
videoInboxImg: t.getAttribute("video-inbox-img") || e.videoInboxImgHtml,
|
|
1434
|
-
LAYOUT: e.LAYOUT || []
|
|
1437
|
+
LAYOUT: e.LAYOUT || [],
|
|
1438
|
+
// 0612 測試用
|
|
1439
|
+
videoIsShorts: t.classList.contains("isShorts") || e.videoIsShorts === !0
|
|
1440
|
+
// 0612 抓後端判斷
|
|
1441
|
+
// videoIsShorts: el.classList.contains('isShorts'),
|
|
1435
1442
|
};
|
|
1436
1443
|
}
|
|
1437
1444
|
update() {
|
|
1438
1445
|
this.#t();
|
|
1439
1446
|
}
|
|
1440
1447
|
}
|
|
1441
|
-
Object.assign(
|
|
1442
|
-
customElements.define("video-player",
|
|
1443
|
-
const
|
|
1448
|
+
Object.assign(R.prototype, M);
|
|
1449
|
+
customElements.define("video-player", te);
|
|
1450
|
+
const ne = {
|
|
1444
1451
|
"zh-tw": {
|
|
1445
1452
|
臺北市: [
|
|
1446
1453
|
["中正區", "100"],
|
|
@@ -2270,9 +2277,9 @@ const se = {
|
|
|
2270
2277
|
]
|
|
2271
2278
|
}
|
|
2272
2279
|
};
|
|
2273
|
-
let
|
|
2274
|
-
const
|
|
2275
|
-
const { TEMPLATE: t } =
|
|
2280
|
+
let X;
|
|
2281
|
+
const oe = (s) => {
|
|
2282
|
+
const { TEMPLATE: t } = st, { childDom: e } = s.s, i = document.createElement("div"), n = s.classList.contains("filter"), o = s.getAttribute("filter-placeholder"), a = s.getAttribute("d4-icon"), r = s.getAttribute("custom-template");
|
|
2276
2283
|
i.innerHTML = t(
|
|
2277
2284
|
n,
|
|
2278
2285
|
o,
|
|
@@ -2285,13 +2292,13 @@ const ne = (s) => {
|
|
|
2285
2292
|
(!u.hasAttribute("data-option") || u.getAttribute("data-option").trim() === "") && u.setAttribute("data-option", u.textContent.trim());
|
|
2286
2293
|
}) : (!c.hasAttribute("data-option") || c.getAttribute("data-option").trim() === "") && c.setAttribute("data-option", c.textContent.trim())), l.append(c);
|
|
2287
2294
|
}), i.children[0];
|
|
2288
|
-
},
|
|
2295
|
+
}, ae = (s) => {
|
|
2289
2296
|
const t = s.getAttribute("control-elements")?.split(",");
|
|
2290
2297
|
t && t.forEach((e) => {
|
|
2291
2298
|
const i = document.querySelector(e);
|
|
2292
|
-
i || w("dropdown", `Can't not find control element(${e})`), i && i.classList.contains("disabled") && (i.classList.remove("disabled"), i.tagName === "DROPDOWN-EL" && i.s.activeLi &&
|
|
2299
|
+
i || w("dropdown", `Can't not find control element(${e})`), i && i.classList.contains("disabled") && (i.classList.remove("disabled"), i.tagName === "DROPDOWN-EL" && i.s.activeLi && x(i, [...i.s.allLi].indexOf(i.s.activeLi)));
|
|
2293
2300
|
});
|
|
2294
|
-
},
|
|
2301
|
+
}, x = (s, t) => {
|
|
2295
2302
|
const e = s.getAttribute("d4-placeholder"), i = s.s.dropdownEl.querySelectorAll(".dropdown-list li");
|
|
2296
2303
|
if (t < 0 || t.length === 0) {
|
|
2297
2304
|
switch (i.forEach((n) => {
|
|
@@ -2343,35 +2350,35 @@ const ne = (s) => {
|
|
|
2343
2350
|
break;
|
|
2344
2351
|
}
|
|
2345
2352
|
}
|
|
2346
|
-
},
|
|
2353
|
+
}, re = (s) => {
|
|
2347
2354
|
const t = s.s.cityLang;
|
|
2348
|
-
|
|
2355
|
+
h("#newCityData").length > 0 ? h("#newCityData").val() !== "" && (X = JSON.parse(h("#newCityData").val())[0], console.log([0])) : X = ne, s.classList.contains("city") && (s.s.dropdownEl.querySelector(".dropdown-list").innerHTML = "", Object.keys(X[t]).forEach((e) => {
|
|
2349
2356
|
const i = document.createElement("li");
|
|
2350
2357
|
i.textContent = e, i.setAttribute("data-option", e), s.s.dropdownEl.querySelector(".dropdown-list").append(i);
|
|
2351
2358
|
}), s.s.allLi = s.s.dropdownEl.querySelectorAll(".dropdown-list li"));
|
|
2352
|
-
},
|
|
2359
|
+
}, le = (s, t) => {
|
|
2353
2360
|
const e = s.s.cityLang;
|
|
2354
|
-
|
|
2361
|
+
X[e][t].forEach((i, n) => {
|
|
2355
2362
|
const o = document.createElement("li");
|
|
2356
2363
|
o.textContent = i[0], o.setAttribute("data-option", i[0]), s.s.dropdownEl.querySelector(".dropdown-list").append(o);
|
|
2357
2364
|
});
|
|
2358
|
-
},
|
|
2365
|
+
}, et = () => {
|
|
2359
2366
|
S('dropdown-el[d4-status="open"]').forEach((t) => {
|
|
2360
2367
|
t.close();
|
|
2361
2368
|
});
|
|
2362
|
-
},
|
|
2363
|
-
const { SETTINGS: s } =
|
|
2369
|
+
}, ce = () => {
|
|
2370
|
+
const { SETTINGS: s } = st;
|
|
2364
2371
|
((e, i) => {
|
|
2365
2372
|
Object.keys(i).forEach((n) => {
|
|
2366
2373
|
e.style.setProperty(`--${n}`, i[n]);
|
|
2367
2374
|
});
|
|
2368
2375
|
})(document.documentElement, s.scrollbar);
|
|
2369
2376
|
};
|
|
2370
|
-
|
|
2377
|
+
ce();
|
|
2371
2378
|
document.addEventListener("click", function(s) {
|
|
2372
|
-
s.target.closest("dropdown-el") || s.target.closest("[data-d4-portal]") ||
|
|
2379
|
+
s.target.closest("dropdown-el") || s.target.closest("[data-d4-portal]") || et();
|
|
2373
2380
|
}, !0);
|
|
2374
|
-
class
|
|
2381
|
+
class Ht extends HTMLElement {
|
|
2375
2382
|
constructor() {
|
|
2376
2383
|
super(), this.initialize = !1;
|
|
2377
2384
|
}
|
|
@@ -2391,7 +2398,7 @@ class Ct extends HTMLElement {
|
|
|
2391
2398
|
switch (n.hasAttribute("multiple") ? "multiple" : "single") {
|
|
2392
2399
|
case "single":
|
|
2393
2400
|
const a = n.s.dropdownEl.querySelector(`.dropdown-list li[data-option="${i}"]`);
|
|
2394
|
-
T(a) ?
|
|
2401
|
+
T(a) ? x(n, [...n.s.allLi].indexOf(a)) : x(n, -1);
|
|
2395
2402
|
break;
|
|
2396
2403
|
case "multiple":
|
|
2397
2404
|
const r = [];
|
|
@@ -2400,16 +2407,16 @@ class Ct extends HTMLElement {
|
|
|
2400
2407
|
T(d) && (d.classList.add("active"), r.push(d));
|
|
2401
2408
|
});
|
|
2402
2409
|
const l = r.map((c) => [...n.s.allLi].indexOf(c));
|
|
2403
|
-
|
|
2410
|
+
x(n, l);
|
|
2404
2411
|
break;
|
|
2405
2412
|
}
|
|
2406
2413
|
else
|
|
2407
|
-
|
|
2414
|
+
x(n, -1);
|
|
2408
2415
|
n.emit("change");
|
|
2409
2416
|
break;
|
|
2410
2417
|
case "d4-placeholder":
|
|
2411
2418
|
if (e === null) return;
|
|
2412
|
-
e !== i && n.s.value.index < 0 &&
|
|
2419
|
+
e !== i && n.s.value.index < 0 && x(n, n.s.value.index);
|
|
2413
2420
|
break;
|
|
2414
2421
|
}
|
|
2415
2422
|
}
|
|
@@ -2424,7 +2431,7 @@ class Ct extends HTMLElement {
|
|
|
2424
2431
|
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), this.#s();
|
|
2425
2432
|
}
|
|
2426
2433
|
#s() {
|
|
2427
|
-
this.s.childDom = this.childNodes, this.s.template =
|
|
2434
|
+
this.s.childDom = this.childNodes, this.s.template = oe(this), this.innerHTML = "", this.append(this.s.template), this.s.dropdownEl = this.querySelector(".dropdown"), this.getAttribute("d4-portal") === "true" && (this.s.dropdownEl.setAttribute("data-d4-portal", ""), document.body.appendChild(this.s.dropdownEl)), this.#i();
|
|
2428
2435
|
}
|
|
2429
2436
|
// -** 獨立 dropdown 出 body 更新
|
|
2430
2437
|
#e() {
|
|
@@ -2435,7 +2442,7 @@ class Ct extends HTMLElement {
|
|
|
2435
2442
|
}
|
|
2436
2443
|
#i() {
|
|
2437
2444
|
const t = this;
|
|
2438
|
-
t.s.allLi = t.s.dropdownEl.querySelectorAll(".dropdown-list li"), t.s.selectDisplayEl = t.querySelector(".select-display"), t.s.selectType = t.hasAttribute("multiple") ? "multiple" : "single", t.s.cityLang = t.hasAttribute("city-lang") ? t.getAttribute("city-lang") : "zh-tw",
|
|
2445
|
+
t.s.allLi = t.s.dropdownEl.querySelectorAll(".dropdown-list li"), t.s.selectDisplayEl = t.querySelector(".select-display"), t.s.selectType = t.hasAttribute("multiple") ? "multiple" : "single", t.s.cityLang = t.hasAttribute("city-lang") ? t.getAttribute("city-lang") : "zh-tw", re(t), t.s.subDropdownTotalH = 0;
|
|
2439
2446
|
const e = t.getAttribute("d4-value");
|
|
2440
2447
|
switch (t.s.selectType) {
|
|
2441
2448
|
case "single":
|
|
@@ -2444,7 +2451,7 @@ class Ct extends HTMLElement {
|
|
|
2444
2451
|
const o = document.querySelector(`dropdown-el[dist-select="${t.id}"]`), a = o ? o.getAttribute("d4-value") !== "" : !1;
|
|
2445
2452
|
if (o && a) {
|
|
2446
2453
|
const r = o.getAttribute("d4-value");
|
|
2447
|
-
if (
|
|
2454
|
+
if (le(t, r), t.s.allLi = t.s.dropdownEl.querySelectorAll(".dropdown-list li"), t.classList.remove("disabled"), t.getAttribute("d4-value") !== "") {
|
|
2448
2455
|
const l = e.split(",")[1];
|
|
2449
2456
|
i = t.s.dropdownEl.querySelector(`.dropdown-list li[data-option="${l}"]`), t.setAttribute("d4-value", l);
|
|
2450
2457
|
}
|
|
@@ -2477,7 +2484,7 @@ class Ct extends HTMLElement {
|
|
|
2477
2484
|
};
|
|
2478
2485
|
break;
|
|
2479
2486
|
}
|
|
2480
|
-
|
|
2487
|
+
x(t, t.s.value.index), t.#n(), t.classList.add("d4-initialize");
|
|
2481
2488
|
}
|
|
2482
2489
|
#n() {
|
|
2483
2490
|
const t = this;
|
|
@@ -2525,7 +2532,7 @@ class Ct extends HTMLElement {
|
|
|
2525
2532
|
t.s.dropdownEl.addEventListener("transitionend", e);
|
|
2526
2533
|
}, t.__events__.bindScrollbar = (e = this) => {
|
|
2527
2534
|
const i = e.s.dropdownEl.querySelector(".dropdown-scroller");
|
|
2528
|
-
e.__scroller__ =
|
|
2535
|
+
e.__scroller__ = it(i, {
|
|
2529
2536
|
overflowBehavior: {
|
|
2530
2537
|
x: "hidden"
|
|
2531
2538
|
}
|
|
@@ -2538,32 +2545,32 @@ class Ct extends HTMLElement {
|
|
|
2538
2545
|
const c = this, d = [...e.s.allLi].indexOf(c), u = parseInt(e.getAttribute("d4-default-height"));
|
|
2539
2546
|
if (c.classList.contains("has-sublayer")) {
|
|
2540
2547
|
l.stopPropagation();
|
|
2541
|
-
const
|
|
2542
|
-
|
|
2543
|
-
const
|
|
2548
|
+
const p = c.querySelector(".sub-dropdown"), m = p.querySelector(".sub-dropdown-list"), g = parseInt(getComputedStyle(m).marginTop) + parseInt(getComputedStyle(m).marginBottom);
|
|
2549
|
+
p.style.cssText = `--height: ${m.offsetHeight + g}px`;
|
|
2550
|
+
const y = parseInt(p.style.cssText.replace("--height:", "").trim()), f = parseInt(getComputedStyle(o).maxHeight), v = () => {
|
|
2544
2551
|
i = u + e.s.subDropdownTotalH, n = i > f ? f : i, e.getAttribute("d4-portal") == "true" ? e.s.dropdownEl.style.setProperty("--maxHeight", `${n}px`) : e.style.cssText = `--maxHeight: ${n}px;`, e.s.dropdownEl.style.height = `${n}px`;
|
|
2545
2552
|
};
|
|
2546
|
-
c.classList.contains("open") ? (c.classList.remove("open"), e.s.subDropdownTotalH -=
|
|
2547
|
-
const
|
|
2548
|
-
e.__scroller__.update(!0),
|
|
2553
|
+
c.classList.contains("open") ? (c.classList.remove("open"), e.s.subDropdownTotalH -= y, v()) : (c.classList.add("open"), e.s.subDropdownTotalH += y, v());
|
|
2554
|
+
const N = () => {
|
|
2555
|
+
e.__scroller__.update(!0), p.removeEventListener("transitionend", N);
|
|
2549
2556
|
};
|
|
2550
|
-
|
|
2557
|
+
p.addEventListener("transitionend", N);
|
|
2551
2558
|
} else
|
|
2552
|
-
switch (
|
|
2559
|
+
switch (ae(e), e.s.selectType) {
|
|
2553
2560
|
// 單選
|
|
2554
2561
|
case "single":
|
|
2555
2562
|
if (e.setAttribute("d4-value", c.getAttribute("data-option")), a) {
|
|
2556
|
-
const
|
|
2557
|
-
g && (g.s.dropdownEl.querySelector(".dropdown-list").textContent = "",
|
|
2563
|
+
const p = e.s.cityLang, m = r.textContent.trim(), g = document.getElementById(e.getAttribute("dist-select"));
|
|
2564
|
+
g && (g.s.dropdownEl.querySelector(".dropdown-list").textContent = "", x(g, -1), X[p][m].forEach((y, f) => {
|
|
2558
2565
|
const v = document.createElement("li");
|
|
2559
|
-
v.textContent =
|
|
2566
|
+
v.textContent = y[0], v.setAttribute("data-option", y[0]), e.getAttribute("d4-portal") == "true" ? g.s.dropdownEl.querySelector(".dropdown-list").append(v) : g.querySelector(".dropdown-list").append(v);
|
|
2560
2567
|
}), e.__events__.selectOption(g));
|
|
2561
2568
|
}
|
|
2562
2569
|
(e.getAttribute("d4-portal") == "true" || c.parentNode.closest("li")?.classList.contains("has-sublayer")) && (l.stopPropagation(), e.close());
|
|
2563
2570
|
break;
|
|
2564
2571
|
// 複選
|
|
2565
2572
|
case "multiple":
|
|
2566
|
-
l.stopPropagation(), c.classList.toggle("active"),
|
|
2573
|
+
l.stopPropagation(), c.classList.toggle("active"), x(e, d);
|
|
2567
2574
|
break;
|
|
2568
2575
|
}
|
|
2569
2576
|
});
|
|
@@ -2598,7 +2605,7 @@ class Ct extends HTMLElement {
|
|
|
2598
2605
|
open() {
|
|
2599
2606
|
const t = this;
|
|
2600
2607
|
let e;
|
|
2601
|
-
t.getAttribute("d4-portal") == "true" ? (
|
|
2608
|
+
t.getAttribute("d4-portal") == "true" ? (et(), t.s.dropdownEl.parentNode !== document.body && document.body.appendChild(t.s.dropdownEl), t.__scroller__ || t.__events__.bindScrollbar(), this.#e(), t.s.dropdownEl.offsetHeight, e = t.s.dropdownEl.querySelector(".dropdown-scroller").clientHeight) : e = t.querySelector(".dropdown-scroller").clientHeight;
|
|
2602
2609
|
const i = t.classList.contains("filter"), n = () => {
|
|
2603
2610
|
if (t.getAttribute("d4-portal") == "true") {
|
|
2604
2611
|
if (i)
|
|
@@ -2617,7 +2624,7 @@ class Ct extends HTMLElement {
|
|
|
2617
2624
|
const l = i ? t.getAttribute("d4-portal") == "true" ? t.s.dropdownEl.querySelector(".filter-bar") : t.querySelector(".filter-bar") : null, c = l ? l.clientHeight : 0, d = n() + t.s.subDropdownTotalH;
|
|
2618
2625
|
return d > a + c ? a + c : d;
|
|
2619
2626
|
};
|
|
2620
|
-
return t.getAttribute("d4-portal") !== "true" &&
|
|
2627
|
+
return t.getAttribute("d4-portal") !== "true" && et(), t.setAttribute("d4-status", "open"), t.setAttribute("d4-default-height", n()), t.getAttribute("d4-portal") == "true" ? (t.s.dropdownEl.style.setProperty("--maxHeight", `${r()}px`), t.s.dropdownEl.style.zIndex = "9999", this.#e(), t.s.dropdownEl.offsetHeight, t.s.dropdownEl.style.height = `${r()}px`, t.__events__._scrollUpdate = () => {
|
|
2621
2628
|
const l = t.getBoundingClientRect();
|
|
2622
2629
|
l.bottom < 0 || l.top > window.innerHeight ? t.close() : t.#e();
|
|
2623
2630
|
}, window.addEventListener("scroll", t.__events__._scrollUpdate, { passive: !0, capture: !0 }), window.addEventListener("resize", t.__events__._scrollUpdate, { passive: !0 })) : (t.style.cssText = `--maxHeight: ${r()}px;`, t.s.dropdownEl.style.cssText = `
|
|
@@ -2642,9 +2649,9 @@ class Ct extends HTMLElement {
|
|
|
2642
2649
|
this.__events__.selectOption();
|
|
2643
2650
|
}
|
|
2644
2651
|
}
|
|
2645
|
-
Object.assign(
|
|
2646
|
-
customElements.define("dropdown-el",
|
|
2647
|
-
function
|
|
2652
|
+
Object.assign(Ht.prototype, M);
|
|
2653
|
+
customElements.define("dropdown-el", Ht);
|
|
2654
|
+
function Q(s) {
|
|
2648
2655
|
const t = {};
|
|
2649
2656
|
return [...s.attributes].forEach((e) => {
|
|
2650
2657
|
if (e.name.includes("duration-")) {
|
|
@@ -2653,10 +2660,10 @@ function Z(s) {
|
|
|
2653
2660
|
}
|
|
2654
2661
|
}), Object.keys(t).length === 0 ? null : t;
|
|
2655
2662
|
}
|
|
2656
|
-
function
|
|
2657
|
-
if (
|
|
2663
|
+
function ut(s) {
|
|
2664
|
+
if (Q(s)) {
|
|
2658
2665
|
let t;
|
|
2659
|
-
const e = Object.keys(
|
|
2666
|
+
const e = Object.keys(Q(s)).map((i) => ({
|
|
2660
2667
|
value: i,
|
|
2661
2668
|
point: i
|
|
2662
2669
|
}));
|
|
@@ -2665,11 +2672,11 @@ function dt(s) {
|
|
|
2665
2672
|
const { point: n, value: o } = e[i];
|
|
2666
2673
|
window.matchMedia(`(max-width: ${o}px)`).matches && (t = n);
|
|
2667
2674
|
}
|
|
2668
|
-
return t ? Number(
|
|
2675
|
+
return t ? Number(Q(s)[t]) : s.s.options.duration;
|
|
2669
2676
|
} else
|
|
2670
2677
|
return s.s.options.duration;
|
|
2671
2678
|
}
|
|
2672
|
-
function
|
|
2679
|
+
function de(s) {
|
|
2673
2680
|
const { behavior: t, continual: e, gap: i } = s.s.options, n = s.childNodes, o = document.createElement("div"), a = document.createElement("div");
|
|
2674
2681
|
o.className = "animate-container", a.className = "animate-item", [...n].forEach((l) => {
|
|
2675
2682
|
a.append(l);
|
|
@@ -2680,7 +2687,7 @@ function ce(s) {
|
|
|
2680
2687
|
}
|
|
2681
2688
|
s.s.animation = null, s.s.animateEl = a, s.textContent = "", o.append(a), s.append(o), a.clientWidth * 2 + i >= s.clientWidth ? t === "normal" && e && o.append(r()) : s.s.options.continual = !1;
|
|
2682
2689
|
}
|
|
2683
|
-
function
|
|
2690
|
+
function D(s) {
|
|
2684
2691
|
const { behavior: t, direction: e, continual: i } = s.s.options;
|
|
2685
2692
|
let n = {};
|
|
2686
2693
|
switch (t) {
|
|
@@ -2737,13 +2744,13 @@ function k(s) {
|
|
|
2737
2744
|
}
|
|
2738
2745
|
return n;
|
|
2739
2746
|
}
|
|
2740
|
-
function
|
|
2747
|
+
function ue(s) {
|
|
2741
2748
|
let t;
|
|
2742
2749
|
return function(e) {
|
|
2743
2750
|
t && clearTimeout(t), t = setTimeout(s, 200, e);
|
|
2744
2751
|
};
|
|
2745
2752
|
}
|
|
2746
|
-
class
|
|
2753
|
+
class he extends HTMLElement {
|
|
2747
2754
|
constructor() {
|
|
2748
2755
|
super(), this.initialize = !1;
|
|
2749
2756
|
}
|
|
@@ -2757,22 +2764,22 @@ class ue extends HTMLElement {
|
|
|
2757
2764
|
}
|
|
2758
2765
|
#t() {
|
|
2759
2766
|
const t = {
|
|
2760
|
-
direction: this.getAttribute("direction") ||
|
|
2767
|
+
direction: this.getAttribute("direction") || $.SETTINGS.direction,
|
|
2761
2768
|
// up / down / left / right
|
|
2762
|
-
behavior: this.getAttribute("behavior") ||
|
|
2769
|
+
behavior: this.getAttribute("behavior") || $.SETTINGS.behavior,
|
|
2763
2770
|
// normal / alternate / endStop
|
|
2764
|
-
duration: Number(this.getAttribute("duration")) ||
|
|
2771
|
+
duration: Number(this.getAttribute("duration")) || $.SETTINGS.duration,
|
|
2765
2772
|
// ms
|
|
2766
|
-
durationBreakpoints:
|
|
2767
|
-
autoplay: this.getAttribute("autoplay") ||
|
|
2773
|
+
durationBreakpoints: Q(this) || $.SETTINGS.durationBreakpoints,
|
|
2774
|
+
autoplay: this.getAttribute("autoplay") || $.SETTINGS.autoplay,
|
|
2768
2775
|
// normal / alternate / endStop
|
|
2769
|
-
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" :
|
|
2776
|
+
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : $.SETTINGS.pauseOnMouseenter,
|
|
2770
2777
|
// true / false
|
|
2771
|
-
continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" :
|
|
2778
|
+
continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" : $.SETTINGS.continual,
|
|
2772
2779
|
// true / false
|
|
2773
|
-
gap: Number(this.getAttribute("gap")) ||
|
|
2780
|
+
gap: Number(this.getAttribute("gap")) || $.SETTINGS.gap
|
|
2774
2781
|
};
|
|
2775
|
-
this.s = {}, this.s.options = t, this.s.nowDuration =
|
|
2782
|
+
this.s = {}, this.s.options = t, this.s.nowDuration = ut(this), de(this), this.#s();
|
|
2776
2783
|
}
|
|
2777
2784
|
#s() {
|
|
2778
2785
|
const { direction: t, continual: e, gap: i } = this.s.options;
|
|
@@ -2794,17 +2801,17 @@ class ue extends HTMLElement {
|
|
|
2794
2801
|
function c() {
|
|
2795
2802
|
switch (i) {
|
|
2796
2803
|
case "normal":
|
|
2797
|
-
t.s.animateEl.style.transform = `${
|
|
2804
|
+
t.s.animateEl.style.transform = `${D(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(D(t).animate1, {
|
|
2798
2805
|
duration: t.s.nowDuration,
|
|
2799
2806
|
iterations: 1 / 0
|
|
2800
|
-
}), r && (t.s.cloneAnimateEl.style.transform = `${
|
|
2807
|
+
}), r && (t.s.cloneAnimateEl.style.transform = `${D(t).animate2[0].transform}`, t.s.cloneAnimation = t.s.cloneAnimateEl.animate(D(t).animate2, {
|
|
2801
2808
|
duration: t.s.nowDuration,
|
|
2802
2809
|
delay: -t.s.nowDuration / 2,
|
|
2803
2810
|
iterations: 1 / 0
|
|
2804
2811
|
}));
|
|
2805
2812
|
break;
|
|
2806
2813
|
case "alternate":
|
|
2807
|
-
let
|
|
2814
|
+
let p = function() {
|
|
2808
2815
|
let m = [];
|
|
2809
2816
|
switch (e) {
|
|
2810
2817
|
case "top":
|
|
@@ -2822,11 +2829,11 @@ class ue extends HTMLElement {
|
|
|
2822
2829
|
}
|
|
2823
2830
|
return m;
|
|
2824
2831
|
}, d, u;
|
|
2825
|
-
(t.clientHeight > t.s.animateEl.scrollHeight || e === "left" || e === "right") && (t.s.animateEl.style.transform = `${
|
|
2832
|
+
(t.clientHeight > t.s.animateEl.scrollHeight || e === "left" || e === "right") && (t.s.animateEl.style.transform = `${p()[0].transform}`, t.s.animateEl.animate(p(), {
|
|
2826
2833
|
duration: u,
|
|
2827
2834
|
fill: "forwards"
|
|
2828
2835
|
}).finished.then(() => {
|
|
2829
|
-
t.s.animation = t.s.animateEl.animate(
|
|
2836
|
+
t.s.animation = t.s.animateEl.animate(D(t).animate1, {
|
|
2830
2837
|
duration: t.s.nowDuration,
|
|
2831
2838
|
iterations: 1 / 0
|
|
2832
2839
|
});
|
|
@@ -2835,7 +2842,7 @@ class ue extends HTMLElement {
|
|
|
2835
2842
|
});
|
|
2836
2843
|
break;
|
|
2837
2844
|
case "endStop":
|
|
2838
|
-
t.s.animateEl.style.transform = `${
|
|
2845
|
+
t.s.animateEl.style.transform = `${D(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(D(t).animate1, {
|
|
2839
2846
|
duration: t.s.nowDuration,
|
|
2840
2847
|
fill: "forwards"
|
|
2841
2848
|
});
|
|
@@ -2858,16 +2865,16 @@ class ue extends HTMLElement {
|
|
|
2858
2865
|
const t = this;
|
|
2859
2866
|
function e() {
|
|
2860
2867
|
const i = t.s.animation.startTime, n = t.s.cloneAnimation ? t.s.cloneAnimation.startTime : null;
|
|
2861
|
-
t.s.nowDuration =
|
|
2868
|
+
t.s.nowDuration = ut(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(D(t).animate1, {
|
|
2862
2869
|
duration: t.s.nowDuration,
|
|
2863
2870
|
iterations: 1 / 0
|
|
2864
|
-
}), t.s.animation.startTime = i, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(
|
|
2871
|
+
}), t.s.animation.startTime = i, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(D(t).animate2, {
|
|
2865
2872
|
duration: t.s.nowDuration,
|
|
2866
2873
|
delay: -t.s.nowDuration / 2,
|
|
2867
2874
|
iterations: 1 / 0
|
|
2868
2875
|
}), t.s.cloneAnimation.startTime = n);
|
|
2869
2876
|
}
|
|
2870
|
-
window.addEventListener("resize",
|
|
2877
|
+
window.addEventListener("resize", ue(e));
|
|
2871
2878
|
}
|
|
2872
2879
|
play() {
|
|
2873
2880
|
this.s.animation.play(), this.s.animateEl.classList.add("start"), this.s.options.continual && (this.s.cloneAnimation.play(), this.s.cloneAnimateEl.classList.add("start"));
|
|
@@ -2876,22 +2883,22 @@ class ue extends HTMLElement {
|
|
|
2876
2883
|
this.s.animation.pause(), this.s.options.continual && this.s.cloneAnimation.pause();
|
|
2877
2884
|
}
|
|
2878
2885
|
}
|
|
2879
|
-
customElements.define("marquee-el",
|
|
2880
|
-
const
|
|
2886
|
+
customElements.define("marquee-el", he);
|
|
2887
|
+
const ht = function(s, t) {
|
|
2881
2888
|
let e;
|
|
2882
2889
|
return function(i) {
|
|
2883
2890
|
e && clearTimeout(e), e = setTimeout(s, 200, i);
|
|
2884
2891
|
};
|
|
2885
|
-
},
|
|
2886
|
-
if (
|
|
2892
|
+
}, _ = (s, t) => {
|
|
2893
|
+
if (F(s)) {
|
|
2887
2894
|
s.forEach((e) => {
|
|
2888
2895
|
e.classList.add(t);
|
|
2889
2896
|
});
|
|
2890
2897
|
return;
|
|
2891
2898
|
}
|
|
2892
2899
|
s.classList.add(t);
|
|
2893
|
-
},
|
|
2894
|
-
if (
|
|
2900
|
+
}, k = (s, t) => {
|
|
2901
|
+
if (F(s)) {
|
|
2895
2902
|
s.forEach((e) => {
|
|
2896
2903
|
e.classList.remove(t);
|
|
2897
2904
|
});
|
|
@@ -2994,7 +3001,7 @@ class pt {
|
|
|
2994
3001
|
// 卷軸位置判斷
|
|
2995
3002
|
#i() {
|
|
2996
3003
|
const { $container: t, $wrapper: e } = this, i = e.scrollWidth - e.clientWidth, n = Math.round(e.scrollLeft);
|
|
2997
|
-
i <= 0 || (
|
|
3004
|
+
i <= 0 || (_(t, "scrollable"), n == 0 ? (_(e, "start"), k(e, "end")) : n + 1 >= i ? (k(e, "start"), _(e, "end")) : (_(e, "center"), k(e, "start"), k(e, "end")));
|
|
2998
3005
|
}
|
|
2999
3006
|
// 隱藏按鈕判斷
|
|
3000
3007
|
#n() {
|
|
@@ -3002,22 +3009,22 @@ class pt {
|
|
|
3002
3009
|
if (!e) return;
|
|
3003
3010
|
const n = t.scrollWidth - t.clientWidth, o = t.scrollLeft;
|
|
3004
3011
|
if (n <= 0) {
|
|
3005
|
-
|
|
3012
|
+
_(e, "hide"), k(e, "active"), _(i, "noScrollable");
|
|
3006
3013
|
return;
|
|
3007
3014
|
}
|
|
3008
|
-
n > 0 && (
|
|
3015
|
+
n > 0 && (_(e, "active"), k(i, "noScrollable")), o == 0 ? e.forEach((a) => {
|
|
3009
3016
|
if (a.classList.contains("next")) {
|
|
3010
|
-
|
|
3017
|
+
k(a, "hide");
|
|
3011
3018
|
return;
|
|
3012
3019
|
}
|
|
3013
|
-
|
|
3020
|
+
_(a, "hide");
|
|
3014
3021
|
}) : o + 1 >= n ? e.forEach((a) => {
|
|
3015
3022
|
if (a.classList.contains("next")) {
|
|
3016
|
-
|
|
3023
|
+
_(a, "hide");
|
|
3017
3024
|
return;
|
|
3018
3025
|
}
|
|
3019
|
-
|
|
3020
|
-
}) :
|
|
3026
|
+
k(a, "hide");
|
|
3027
|
+
}) : k(e, "hide");
|
|
3021
3028
|
}
|
|
3022
3029
|
// 選項事件綁定
|
|
3023
3030
|
#o() {
|
|
@@ -3046,7 +3053,7 @@ class pe {
|
|
|
3046
3053
|
// 隱藏按鈕判斷
|
|
3047
3054
|
#s() {
|
|
3048
3055
|
const t = this.$element.querySelector(".drag-container"), e = t.querySelector(".wrapper");
|
|
3049
|
-
return e.scrollWidth - e.clientWidth > 0 ? (t.insertAdjacentHTML(E.append, '<div class="open-collapse"></div>'), this.$button = t.querySelector(".open-collapse"),
|
|
3056
|
+
return e.scrollWidth - e.clientWidth > 0 ? (t.insertAdjacentHTML(E.append, '<div class="open-collapse"></div>'), this.$button = t.querySelector(".open-collapse"), k(this.$element, "noScrollable"), !0) : (_(this.$element, "noScrollable"), !1);
|
|
3050
3057
|
}
|
|
3051
3058
|
// 展開箭頭事件綁定
|
|
3052
3059
|
#e() {
|
|
@@ -3071,11 +3078,11 @@ class pe {
|
|
|
3071
3078
|
});
|
|
3072
3079
|
}
|
|
3073
3080
|
}
|
|
3074
|
-
const
|
|
3081
|
+
const me = (s) => {
|
|
3075
3082
|
const { type: t, option: e, originalDomString: i } = s.s, n = document.createElement("div");
|
|
3076
|
-
return t == "drag" && (n.innerHTML =
|
|
3083
|
+
return t == "drag" && (n.innerHTML = C.TEMPLATE[t]().trim(), n.querySelector(".drag-container .wrapper").insertAdjacentHTML(E.append, i)), t == "collapse" && (n.innerHTML = C.TEMPLATE[t](e?.collapse).trim(), n.querySelector(".drag-container .wrapper").insertAdjacentHTML(E.append, i), n.querySelector(".collapse-container .wrapper").insertAdjacentHTML(E.append, i)), t == "dropdown" && (n.innerHTML = C.TEMPLATE[t](e?.dropdown).trim(), n.querySelector("dropdown-el").insertAdjacentHTML(E.append, i)), n.children;
|
|
3077
3084
|
};
|
|
3078
|
-
class
|
|
3085
|
+
class ge extends HTMLElement {
|
|
3079
3086
|
constructor() {
|
|
3080
3087
|
super(), this.initialize = !1, this.__events__ = {}, this.s = {}, this.s.originalDomString = this.innerHTML.trim().replace(/\n/g, ""), this.previousWidth = window.innerWidth;
|
|
3081
3088
|
}
|
|
@@ -3102,7 +3109,7 @@ class me extends HTMLElement {
|
|
|
3102
3109
|
}
|
|
3103
3110
|
#t() {
|
|
3104
3111
|
let t = {};
|
|
3105
|
-
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ??
|
|
3112
|
+
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ?? C.SETTINGS.type, this.hasAttribute("m4-option") && (t = this.getAttribute("m4-option") ? JSON.parse(this.getAttribute("m4-option")) : {}, this.removeAttribute("m4-option"));
|
|
3106
3113
|
const e = (i) => {
|
|
3107
3114
|
if (i.type === "resize") {
|
|
3108
3115
|
if (window.innerWidth === this.previousWidth) return;
|
|
@@ -3110,7 +3117,7 @@ class me extends HTMLElement {
|
|
|
3110
3117
|
}
|
|
3111
3118
|
this.update();
|
|
3112
3119
|
};
|
|
3113
|
-
window.removeEventListener("resize",
|
|
3120
|
+
window.removeEventListener("resize", ht(e)), window.addEventListener("resize", ht(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, C.SETTINGS.drag, t?.drag), this.s.option.collapse = Object.assign({}, C.SETTINGS.collapse, t?.collapse), this.s.option.dropdown = Object.assign({}, C.SETTINGS.dropdown, t?.dropdown), this.s.option.breakpoint = Object.assign({}, C.SETTINGS.breakpoint, t?.breakpoint), this.#s();
|
|
3114
3121
|
}
|
|
3115
3122
|
#s() {
|
|
3116
3123
|
this.classList.add("m4-init"), this.#e();
|
|
@@ -3151,7 +3158,7 @@ class me extends HTMLElement {
|
|
|
3151
3158
|
// check type
|
|
3152
3159
|
#a() {
|
|
3153
3160
|
const { type: t } = this.s;
|
|
3154
|
-
switch (this.#o(), this.innerHTML = "", [...
|
|
3161
|
+
switch (this.#o(), this.innerHTML = "", [...me(this)].forEach((e) => {
|
|
3155
3162
|
this.append(e);
|
|
3156
3163
|
}), this.#i(), t) {
|
|
3157
3164
|
case "drag":
|
|
@@ -3166,8 +3173,8 @@ class me extends HTMLElement {
|
|
|
3166
3173
|
}
|
|
3167
3174
|
}
|
|
3168
3175
|
}
|
|
3169
|
-
customElements.define("multipurpose-nav",
|
|
3170
|
-
class
|
|
3176
|
+
customElements.define("multipurpose-nav", ge);
|
|
3177
|
+
class It extends HTMLElement {
|
|
3171
3178
|
// 定義組件的初始狀態
|
|
3172
3179
|
constructor(t, e) {
|
|
3173
3180
|
super();
|
|
@@ -3183,7 +3190,7 @@ class Ht extends HTMLElement {
|
|
|
3183
3190
|
this.classList.contains("t4-initialize") || this.#t();
|
|
3184
3191
|
}
|
|
3185
3192
|
#t() {
|
|
3186
|
-
const t = this.getAttribute("t4-name"), { SETTINGS: e } =
|
|
3193
|
+
const t = this.getAttribute("t4-name"), { SETTINGS: e } = bt;
|
|
3187
3194
|
document.querySelectorAll(`tab-el[t4-name=${t}]`).length > 1 && console.warn(t, "名字有重複喔!!!"), this.t = {
|
|
3188
3195
|
tabs: [],
|
|
3189
3196
|
name: t,
|
|
@@ -3274,14 +3281,14 @@ class Ht extends HTMLElement {
|
|
|
3274
3281
|
});
|
|
3275
3282
|
}
|
|
3276
3283
|
// prev 按鈕狀態
|
|
3277
|
-
#
|
|
3284
|
+
#h(t) {
|
|
3278
3285
|
const e = document.querySelectorAll(`[t4-role="prev"][t4-control="${this.t.name}"]`), i = this.t.tabPanels.length === 1, n = t === 0;
|
|
3279
3286
|
e.forEach((o) => {
|
|
3280
3287
|
i || n ? o.setAttribute("disabled", "") : o.removeAttribute("disabled");
|
|
3281
3288
|
});
|
|
3282
3289
|
}
|
|
3283
3290
|
// 頁籤狀態
|
|
3284
|
-
#
|
|
3291
|
+
#p(t, e) {
|
|
3285
3292
|
this.t.tabGroup === "true" ? this.t.tabs.forEach((i, n) => {
|
|
3286
3293
|
n == t ? i.setAttribute("aria-selected", !0) : i.setAttribute("aria-selected", !1);
|
|
3287
3294
|
}) : this.t.tabs.forEach((i, n) => {
|
|
@@ -3292,16 +3299,16 @@ class Ht extends HTMLElement {
|
|
|
3292
3299
|
#r(t, e, i) {
|
|
3293
3300
|
switch (t) {
|
|
3294
3301
|
case "step":
|
|
3295
|
-
|
|
3302
|
+
K(this.t.step) && this.#d(e);
|
|
3296
3303
|
break;
|
|
3297
3304
|
case "eventAnchor":
|
|
3298
3305
|
this.t.anchor && this.#l();
|
|
3299
3306
|
break;
|
|
3300
3307
|
case "tabState":
|
|
3301
|
-
this.t.type == "normal" && this.#
|
|
3308
|
+
this.t.type == "normal" && this.#p(e, i);
|
|
3302
3309
|
break;
|
|
3303
3310
|
case "btnState":
|
|
3304
|
-
this.#u(e), this.#
|
|
3311
|
+
this.#u(e), this.#h(e);
|
|
3305
3312
|
break;
|
|
3306
3313
|
case "tabUrl":
|
|
3307
3314
|
this.t.recordUrl === "true" && this.#a(e);
|
|
@@ -3365,7 +3372,7 @@ class Ht extends HTMLElement {
|
|
|
3365
3372
|
const t = this;
|
|
3366
3373
|
window.addEventListener(
|
|
3367
3374
|
"resize",
|
|
3368
|
-
|
|
3375
|
+
fe(() => {
|
|
3369
3376
|
t.update();
|
|
3370
3377
|
}, 1e3)
|
|
3371
3378
|
);
|
|
@@ -3402,7 +3409,7 @@ class Ht extends HTMLElement {
|
|
|
3402
3409
|
this.t.tabs = this.#e(), qt(), console.log("tab update!!!!");
|
|
3403
3410
|
}
|
|
3404
3411
|
}
|
|
3405
|
-
function
|
|
3412
|
+
function fe(s, t = 1e3) {
|
|
3406
3413
|
let e;
|
|
3407
3414
|
return function(i) {
|
|
3408
3415
|
e && clearTimeout(e), e = setTimeout(s, t, i);
|
|
@@ -3439,24 +3446,24 @@ function qt() {
|
|
|
3439
3446
|
});
|
|
3440
3447
|
}
|
|
3441
3448
|
qt();
|
|
3442
|
-
Object.assign(
|
|
3443
|
-
customElements.define("tab-el",
|
|
3444
|
-
const
|
|
3449
|
+
Object.assign(It.prototype, M);
|
|
3450
|
+
customElements.define("tab-el", It);
|
|
3451
|
+
const mt = (s) => {
|
|
3445
3452
|
const { defaultOptions: t } = s.collapse, { collapseClass: e, target: i, transition: n } = t, o = s.querySelector(i);
|
|
3446
3453
|
s.classList.add(e), o.style.height = 0, o.style["transition-property"] = n.property, o.style["transition-duration"] = n.duration, o.style["transition-timing-function"] = n.function, o.style["transition-delay"] = n.delay, o.style.overflow = "hidden";
|
|
3447
|
-
},
|
|
3454
|
+
}, ve = (s) => {
|
|
3448
3455
|
const { defaultOptions: t } = s.collapse, { collapseClass: e, target: i, transition: n } = t, o = s.querySelector(i), a = o.children[0].offsetHeight;
|
|
3449
3456
|
s.collapse.height = a, s.classList.remove(e), o.style.display = "block", o.style.height = `${a}px`, o.style["transition-property"] = n.property, o.style["transition-duration"] = n.duration, o.style["transition-timing-function"] = n.function, o.style["transition-delay"] = n.delay, o.style.overflow = "hidden";
|
|
3450
3457
|
};
|
|
3451
|
-
class
|
|
3458
|
+
class be {
|
|
3452
3459
|
constructor(t, e = {}) {
|
|
3453
|
-
!
|
|
3460
|
+
!Y(t) && !K(t) && !F(t) && !T(t) || (this.__storage__ = {
|
|
3454
3461
|
el: t,
|
|
3455
3462
|
options: e
|
|
3456
3463
|
}, this.active = "data-collapse-active", this.#t());
|
|
3457
3464
|
}
|
|
3458
3465
|
#t() {
|
|
3459
|
-
const { el: t, options: e } = this.__storage__, { SETTINGS: i, EVENTS: n } =
|
|
3466
|
+
const { el: t, options: e } = this.__storage__, { SETTINGS: i, EVENTS: n } = yt;
|
|
3460
3467
|
if (this.elements = e.state == "not active" ? S(t + `:not([${this.active}])`) : S(t), this.options = Object.assign({}, i, e), this.__events__ = Object.assign({}, n), this.options.on)
|
|
3461
3468
|
for (const [o, a] of Object.entries(this.options.on))
|
|
3462
3469
|
this.__events__[o] = [a];
|
|
@@ -3471,8 +3478,8 @@ class ve {
|
|
|
3471
3478
|
#e(t) {
|
|
3472
3479
|
const { options: e } = this, { collapseClass: i, block: n, target: o, defaultOpen: a, targetStopPropagation: r, defaultActiveMark: l } = e, c = t, d = c.querySelector(o);
|
|
3473
3480
|
if (c.collapse.height = d.children[0].offsetHeight, a ? (d.style.height = `${d.children[0].offsetHeight}px`, c.classList.remove(i)) : !c.classList.contains(l) && !c.hasAttribute(l) ? (c.classList.add(i), d.style.height = "0px", d.style.overflow = "hidden") : (d.style.height = `${d.children[0].offsetHeight}px`, c.classList.remove(i)), c.removeEventListener("click", this.#i), c.addEventListener("click", this.#i), r) {
|
|
3474
|
-
const u = (
|
|
3475
|
-
|
|
3481
|
+
const u = (p) => {
|
|
3482
|
+
p.stopPropagation();
|
|
3476
3483
|
};
|
|
3477
3484
|
d.removeEventListener("click", u), d.addEventListener("click", u);
|
|
3478
3485
|
}
|
|
@@ -3480,28 +3487,28 @@ class ve {
|
|
|
3480
3487
|
#i() {
|
|
3481
3488
|
const { instance: t, defaultOptions: e } = this.collapse, { collapseClass: i, block: n, target: o, single: a } = e, r = this;
|
|
3482
3489
|
r.classList.contains(i) ? (a && r.parentNode.querySelectorAll(`.${r.classList[0]}`).forEach((l) => {
|
|
3483
|
-
|
|
3484
|
-
}),
|
|
3490
|
+
mt(l);
|
|
3491
|
+
}), ve(r)) : mt(r), t.emit("afterCollapse");
|
|
3485
3492
|
}
|
|
3486
3493
|
update() {
|
|
3487
3494
|
this.#t();
|
|
3488
3495
|
}
|
|
3489
3496
|
}
|
|
3490
|
-
Object.assign(
|
|
3491
|
-
function
|
|
3497
|
+
Object.assign(be.prototype, M);
|
|
3498
|
+
function ye(s, t) {
|
|
3492
3499
|
const e = t, { color: i, opacity: n, duration: o } = t.s.options;
|
|
3493
3500
|
let a = document.createElement("span"), r = s.clientX - e.getBoundingClientRect().left, l = s.clientY - e.getBoundingClientRect().top;
|
|
3494
3501
|
a.style.cssText = `background: ${i};left: ${r}px;top: ${l}px;opacity: ${n};animation-duration: ${o}ms`, a.classList.add("circle"), e.appendChild(a), setTimeout(function() {
|
|
3495
3502
|
a.remove();
|
|
3496
3503
|
}, `${o}`);
|
|
3497
3504
|
}
|
|
3498
|
-
function
|
|
3505
|
+
function Ot() {
|
|
3499
3506
|
document.querySelectorAll("ripple-btn").forEach((s) => {
|
|
3500
3507
|
s.querySelector(".hover-ball"), s.style.setProperty("--r", ""), s.classList.remove("entered");
|
|
3501
3508
|
});
|
|
3502
3509
|
}
|
|
3503
|
-
document.addEventListener("click",
|
|
3504
|
-
class
|
|
3510
|
+
document.addEventListener("click", Ot);
|
|
3511
|
+
class we extends HTMLElement {
|
|
3505
3512
|
constructor() {
|
|
3506
3513
|
super(), this.initialize = !1;
|
|
3507
3514
|
}
|
|
@@ -3510,7 +3517,7 @@ class ye extends HTMLElement {
|
|
|
3510
3517
|
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, this.#t());
|
|
3511
3518
|
}
|
|
3512
3519
|
#t() {
|
|
3513
|
-
const { SETTINGS: t } =
|
|
3520
|
+
const { SETTINGS: t } = wt;
|
|
3514
3521
|
this.s = {};
|
|
3515
3522
|
function e(n) {
|
|
3516
3523
|
let o = !!n;
|
|
@@ -3536,11 +3543,11 @@ class ye extends HTMLElement {
|
|
|
3536
3543
|
#i() {
|
|
3537
3544
|
const t = this.querySelector("i.hover-ball"), e = this;
|
|
3538
3545
|
e.addEventListener("click", function(o) {
|
|
3539
|
-
e.s.options.click &&
|
|
3546
|
+
e.s.options.click && ye(o, e);
|
|
3540
3547
|
});
|
|
3541
3548
|
let i = "ontouchstart" in document.documentElement ? "touchstart" : "mouseenter", n = "ontouchend" in document.documentElement ? "touchend" : "mouseleave";
|
|
3542
3549
|
e.addEventListener(i, function(o) {
|
|
3543
|
-
if (i === "touchstart" &&
|
|
3550
|
+
if (i === "touchstart" && Ot(), e.s.options.hover) {
|
|
3544
3551
|
const a = Math.round(i === "mouseenter" ? o.clientX - e.getBoundingClientRect().left : o.changedTouches[0].clientX - e.getBoundingClientRect().x), r = Math.round(i === "mouseenter" ? o.clientY - e.getBoundingClientRect().top : o.changedTouches[0].clientY - e.getBoundingClientRect().y), { offsetWidth: l, offsetHeight: c } = e, d = Math.max(l, c);
|
|
3545
3552
|
t.style.width = d * 2 + "px", t.style.height = d * 2 + "px", t.style.left = a + "px", t.style.top = r + "px", e.classList.add("entered");
|
|
3546
3553
|
}
|
|
@@ -3555,8 +3562,8 @@ class ye extends HTMLElement {
|
|
|
3555
3562
|
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), this.#t();
|
|
3556
3563
|
}
|
|
3557
3564
|
}
|
|
3558
|
-
customElements.define("ripple-btn",
|
|
3559
|
-
class
|
|
3565
|
+
customElements.define("ripple-btn", we);
|
|
3566
|
+
class Te {
|
|
3560
3567
|
constructor() {
|
|
3561
3568
|
this.init();
|
|
3562
3569
|
}
|
|
@@ -3608,12 +3615,12 @@ class we {
|
|
|
3608
3615
|
this.init();
|
|
3609
3616
|
}
|
|
3610
3617
|
}
|
|
3611
|
-
function
|
|
3618
|
+
function gt(s, t) {
|
|
3612
3619
|
return s ? function(e, i) {
|
|
3613
3620
|
Function(s)(e, i);
|
|
3614
3621
|
} : t;
|
|
3615
3622
|
}
|
|
3616
|
-
function
|
|
3623
|
+
function Ee(s, t, e, i) {
|
|
3617
3624
|
const n = t.params, o = s.closest("[data-upload-item]").querySelector("[data-preview]");
|
|
3618
3625
|
o.querySelector("img") && o.querySelector("img").remove(), o.appendChild(i.imgElement);
|
|
3619
3626
|
const a = s.dataset.group, r = document.querySelector(t.el).dataset.index;
|
|
@@ -3636,7 +3643,7 @@ function Te(s, t, e, i) {
|
|
|
3636
3643
|
info: i
|
|
3637
3644
|
}, n.on.changeAfter && typeof n.on.changeAfter == "function" && n.on.changeAfter(s, i);
|
|
3638
3645
|
}
|
|
3639
|
-
function
|
|
3646
|
+
function Ae(s, t, e, i) {
|
|
3640
3647
|
const n = document.createElement("canvas"), o = n.getContext("2d"), a = t.width, l = t.height / a * 100, c = i / e * 100;
|
|
3641
3648
|
let d = 0, u = 0;
|
|
3642
3649
|
switch (n.width = e, n.height = i, s.previewSize) {
|
|
@@ -3647,17 +3654,17 @@ function Ee(s, t, e, i) {
|
|
|
3647
3654
|
l < c ? (d = i / l * 100, u = n.height) : l > c ? (d = n.width, u = e * l / 100) : l === c && (d = n.width, u = n.height);
|
|
3648
3655
|
break;
|
|
3649
3656
|
}
|
|
3650
|
-
const
|
|
3651
|
-
return o.drawImage(t,
|
|
3657
|
+
const p = (n.width - d) * 0.5, m = (n.height - u) * 0.5;
|
|
3658
|
+
return o.drawImage(t, p, m, d, u), n;
|
|
3652
3659
|
}
|
|
3653
|
-
function
|
|
3660
|
+
function Se(s, t) {
|
|
3654
3661
|
return new Promise((e, i) => {
|
|
3655
3662
|
if (t) {
|
|
3656
3663
|
const n = new Image();
|
|
3657
3664
|
n.src = t, n.classList.add(s.previewSize), n.onload = () => {
|
|
3658
3665
|
let o = {
|
|
3659
3666
|
imgElement: n,
|
|
3660
|
-
originalCanvas:
|
|
3667
|
+
originalCanvas: Ae(s, n, n.width, n.height),
|
|
3661
3668
|
info: {
|
|
3662
3669
|
originalWidth: n.width,
|
|
3663
3670
|
originalHeight: n.height,
|
|
@@ -3670,30 +3677,30 @@ function Ae(s, t) {
|
|
|
3670
3677
|
e();
|
|
3671
3678
|
});
|
|
3672
3679
|
}
|
|
3673
|
-
function
|
|
3680
|
+
function Le(s, t) {
|
|
3674
3681
|
const e = Math.pow(10, t);
|
|
3675
3682
|
return Math.round(s * e) / e;
|
|
3676
3683
|
}
|
|
3677
|
-
function
|
|
3684
|
+
function _e(s, t) {
|
|
3678
3685
|
let e = s.size / 1024 / 1024;
|
|
3679
|
-
return `${
|
|
3686
|
+
return `${Le(e, 2)}` <= t;
|
|
3680
3687
|
}
|
|
3681
|
-
function
|
|
3688
|
+
function ke(s, t, e) {
|
|
3682
3689
|
if (s.target.files.length <= 0) return;
|
|
3683
3690
|
const i = s.target.files[0], n = t.closest("[data-upload-item]");
|
|
3684
3691
|
let o = new FileReader();
|
|
3685
3692
|
o.onload = (a) => {
|
|
3686
3693
|
const r = i.type.split("/")[0] === "image" ? a.target.result : null;
|
|
3687
|
-
if (e.params.sizeLimit && !
|
|
3694
|
+
if (e.params.sizeLimit && !_e(i, e.params.sizeLimit)) {
|
|
3688
3695
|
t.value = "", n.classList.add("over-limit"), e.params.on.overLimit && typeof e.params.on.overLimit == "function" && e.params.on.overLimit(t, e.params.sizeLimit);
|
|
3689
3696
|
return;
|
|
3690
3697
|
} else
|
|
3691
|
-
n.classList.remove("over-limit"), n.classList.add("uploaded"),
|
|
3692
|
-
|
|
3698
|
+
n.classList.remove("over-limit"), n.classList.add("uploaded"), Se(e.params, r).then((l) => {
|
|
3699
|
+
Ee(t, e, i, l);
|
|
3693
3700
|
});
|
|
3694
3701
|
}, o.readAsDataURL(i);
|
|
3695
3702
|
}
|
|
3696
|
-
class
|
|
3703
|
+
class De {
|
|
3697
3704
|
constructor(t, e) {
|
|
3698
3705
|
const i = this;
|
|
3699
3706
|
i.el = t, i.params = {
|
|
@@ -3721,70 +3728,70 @@ class ke {
|
|
|
3721
3728
|
previewSize: i.dataset.previewSize || t.params.previewSize,
|
|
3722
3729
|
compress: i.dataset.compress || t.params.compress,
|
|
3723
3730
|
on: {
|
|
3724
|
-
changeAfter:
|
|
3725
|
-
overLimit:
|
|
3731
|
+
changeAfter: gt(i.dataset.changeAfter, t.params.on.changeAfter),
|
|
3732
|
+
overLimit: gt(i.dataset.overLimit, t.params.on.overLimit)
|
|
3726
3733
|
}
|
|
3727
3734
|
};
|
|
3728
3735
|
t.params = o, typeof uploadImage[`${o.group}`] > "u" && (uploadImage[`${o.group}`] = []), i.dataset.group || (i.dataset.group = o.group), i.dataset.index = document.querySelectorAll(`[data-group="${o.group}"]`).length - 1, i.addEventListener("change", function(a) {
|
|
3729
|
-
|
|
3736
|
+
ke(a, i, t);
|
|
3730
3737
|
});
|
|
3731
3738
|
}));
|
|
3732
3739
|
}
|
|
3733
3740
|
}
|
|
3734
3741
|
export {
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3742
|
+
Ke as $,
|
|
3743
|
+
Tt as A,
|
|
3744
|
+
li as B,
|
|
3745
|
+
be as C,
|
|
3746
|
+
Ht as D,
|
|
3747
|
+
ze as E,
|
|
3741
3748
|
E as F,
|
|
3742
3749
|
T as G,
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3750
|
+
F as H,
|
|
3751
|
+
De as I,
|
|
3752
|
+
Y as J,
|
|
3753
|
+
si as K,
|
|
3754
|
+
oi as L,
|
|
3755
|
+
he as M,
|
|
3756
|
+
je as N,
|
|
3757
|
+
Ne as O,
|
|
3758
|
+
ni as P,
|
|
3759
|
+
xt as Q,
|
|
3760
|
+
we as R,
|
|
3761
|
+
Ct as S,
|
|
3762
|
+
It as T,
|
|
3763
|
+
Nt as U,
|
|
3764
|
+
Ye as V,
|
|
3765
|
+
ii as W,
|
|
3766
|
+
Ge as X,
|
|
3767
|
+
Fe as Y,
|
|
3768
|
+
R as Z,
|
|
3769
|
+
U as _,
|
|
3770
|
+
Dt as a,
|
|
3771
|
+
Te as b,
|
|
3772
|
+
H as c,
|
|
3773
|
+
ge as d,
|
|
3774
|
+
ee as e,
|
|
3775
|
+
We as f,
|
|
3776
|
+
jt as g,
|
|
3770
3777
|
Be as h,
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3778
|
+
Pe as i,
|
|
3779
|
+
tt as j,
|
|
3780
|
+
Ue as k,
|
|
3781
|
+
Xe as l,
|
|
3775
3782
|
Me as m,
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
+
Ze as n,
|
|
3784
|
+
zt as o,
|
|
3785
|
+
ie as p,
|
|
3786
|
+
Je as q,
|
|
3787
|
+
Re as r,
|
|
3788
|
+
Qe as s,
|
|
3789
|
+
Ve as t,
|
|
3783
3790
|
S as u,
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3791
|
+
At as v,
|
|
3792
|
+
ti as w,
|
|
3793
|
+
ei as x,
|
|
3794
|
+
ai as y,
|
|
3795
|
+
ri as z
|
|
3789
3796
|
};
|
|
3790
3797
|
//# sourceMappingURL=image-preview-bundle.js.map
|