@xwadex/fesd 0.0.14-re.81 → 0.0.14-re.83
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 +656 -619
- package/dist/image-preview-bundle.js.map +1 -1
- package/package.json +1 -1
@@ -1,20 +1,20 @@
|
|
1
|
-
var
|
1
|
+
var fs = (n, i, t) => {
|
2
2
|
if (!i.has(n))
|
3
3
|
throw TypeError("Cannot " + t);
|
4
4
|
};
|
5
|
-
var
|
5
|
+
var h = (n, i, t) => {
|
6
6
|
if (i.has(n))
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
8
8
|
i instanceof WeakSet ? i.add(n) : i.set(n, t);
|
9
9
|
};
|
10
|
-
var d = (n, i, t) => (
|
11
|
-
import { OverlayScrollbars as
|
10
|
+
var d = (n, i, t) => (fs(n, i, "access private method"), t);
|
11
|
+
import { OverlayScrollbars as Me } from "overlayscrollbars";
|
12
12
|
import f from "jquery";
|
13
13
|
import "./vendor-bundle.js";
|
14
14
|
import "validator";
|
15
15
|
import "flatpickr";
|
16
|
-
import
|
17
|
-
import { lock as
|
16
|
+
import Fe from "vanilla-lazyload";
|
17
|
+
import { lock as vs, unlock as bs } from "tua-body-scroll-lock";
|
18
18
|
const Y = {
|
19
19
|
SETTINGS: {
|
20
20
|
videoId: null,
|
@@ -26,13 +26,17 @@ const Y = {
|
|
26
26
|
videoLayoutNo: 0,
|
27
27
|
videoTarget: "video-template",
|
28
28
|
videoTargetRoute: "https://cdn.wdd.idv.tw/fesd/video4_lightbox.html",
|
29
|
-
videoVimeoHash: null
|
29
|
+
videoVimeoHash: null,
|
30
|
+
videoHighQuality: !1,
|
31
|
+
videoStartTime: 0
|
30
32
|
},
|
31
33
|
ATTRS: {
|
32
34
|
id: "video-id",
|
33
35
|
type: "video-type",
|
34
36
|
autoplay: "video-autoplay",
|
35
|
-
hash: "vimeo-hash"
|
37
|
+
hash: "vimeo-hash",
|
38
|
+
start: "video-starttime",
|
39
|
+
highquality: "video-highquality"
|
36
40
|
},
|
37
41
|
EVENTS: {
|
38
42
|
init: null,
|
@@ -46,7 +50,7 @@ const Y = {
|
|
46
50
|
TEMPLATE() {
|
47
51
|
return '<div class="player-container"><div class="player-wrapper"></div></div>';
|
48
52
|
}
|
49
|
-
},
|
53
|
+
}, ys = {
|
50
54
|
SETTINGS: {
|
51
55
|
success: null,
|
52
56
|
text: null,
|
@@ -84,7 +88,7 @@ const Y = {
|
|
84
88
|
</div>
|
85
89
|
`;
|
86
90
|
}
|
87
|
-
},
|
91
|
+
}, $ = {
|
88
92
|
SETTINGS: {
|
89
93
|
direction: "left",
|
90
94
|
// 方向 - top || right || bottom || left
|
@@ -103,7 +107,7 @@ const Y = {
|
|
103
107
|
gap: 30
|
104
108
|
// 跑馬燈內容之間的距離 - Number
|
105
109
|
}
|
106
|
-
},
|
110
|
+
}, qe = {
|
107
111
|
SETTINGS: {
|
108
112
|
scrollbar: {
|
109
113
|
"scrollbar-track-color": "transparent",
|
@@ -131,11 +135,11 @@ const Y = {
|
|
131
135
|
</div>`;
|
132
136
|
return t || r;
|
133
137
|
}
|
134
|
-
},
|
138
|
+
}, ws = {
|
135
139
|
SETTINGS: {
|
136
140
|
basic_rwd: 900
|
137
141
|
}
|
138
|
-
},
|
142
|
+
}, Ye = {
|
139
143
|
SETTINGS: {
|
140
144
|
scroller: window,
|
141
145
|
class: "aost-show",
|
@@ -176,7 +180,7 @@ const Y = {
|
|
176
180
|
beforeScroll: null,
|
177
181
|
afterScroll: null
|
178
182
|
}
|
179
|
-
},
|
183
|
+
}, C = {
|
180
184
|
SETTINGS: {
|
181
185
|
type: "drag",
|
182
186
|
drag: {
|
@@ -218,7 +222,7 @@ const Y = {
|
|
218
222
|
return `<dropdown-el${n.placeholder ? ` d4-placeholder="${n.placeholder}"` : ""}${n.value ? ` d4-value="${n.value}"` : ""}></dropdown-el>`;
|
219
223
|
}
|
220
224
|
}
|
221
|
-
},
|
225
|
+
}, Ue = {
|
222
226
|
SETTINGS: {
|
223
227
|
// 樣式 normal / process
|
224
228
|
type: "normal",
|
@@ -238,7 +242,7 @@ const Y = {
|
|
238
242
|
// 步驟狀態綁定
|
239
243
|
stepOutput: ".step-show"
|
240
244
|
}
|
241
|
-
},
|
245
|
+
}, Je = {
|
242
246
|
SETTINGS: {
|
243
247
|
collapseClass: "collapse",
|
244
248
|
block: "[collapse-block]",
|
@@ -271,7 +275,7 @@ const Y = {
|
|
271
275
|
update: null,
|
272
276
|
afterUpdate: null
|
273
277
|
}
|
274
|
-
},
|
278
|
+
}, Ze = {
|
275
279
|
SETTINGS: {
|
276
280
|
// 是否要加 hover 效果?
|
277
281
|
hover: !0,
|
@@ -286,38 +290,38 @@ const Y = {
|
|
286
290
|
// hover 毫秒 ?
|
287
291
|
speed: 600
|
288
292
|
}
|
289
|
-
},
|
293
|
+
}, mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
290
294
|
__proto__: null,
|
291
295
|
anchor4: lt,
|
292
|
-
aost4:
|
293
|
-
article4:
|
294
|
-
collapse4:
|
295
|
-
dropdown4:
|
296
|
-
marquee4:
|
296
|
+
aost4: Ye,
|
297
|
+
article4: ws,
|
298
|
+
collapse4: Je,
|
299
|
+
dropdown4: qe,
|
300
|
+
marquee4: $,
|
297
301
|
modal4: I,
|
298
|
-
multipurpose4:
|
299
|
-
ripple4:
|
300
|
-
share4:
|
301
|
-
tab4:
|
302
|
+
multipurpose4: C,
|
303
|
+
ripple4: Ze,
|
304
|
+
share4: ys,
|
305
|
+
tab4: Ue,
|
302
306
|
video4: Y
|
303
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
307
|
+
}, Symbol.toStringTag, { value: "Module" })), E = {
|
304
308
|
before: "beforebegin",
|
305
309
|
after: "afterend",
|
306
310
|
append: "beforeend",
|
307
311
|
prepend: "afterbegin"
|
308
|
-
}, at = (n) => typeof n == "string" && n !== "",
|
312
|
+
}, at = (n) => typeof n == "string" && n !== "", ye = (n) => n instanceof HTMLElement, rt = (n) => n instanceof NodeList, w = (n) => A(n) !== null, j = (n) => typeof n == "function", A = (n) => ye(n) ? n : document.querySelector(n), L = (n) => rt(n) ? n : document.querySelectorAll(n), Ts = () => Math.random().toString(36).substr(2, 9), Es = (n) => {
|
309
313
|
const i = document.createElement("div");
|
310
314
|
return i.innerHTML = n, i.childNodes;
|
311
|
-
},
|
315
|
+
}, As = (n) => {
|
312
316
|
try {
|
313
317
|
JSON.parse(n);
|
314
318
|
} catch {
|
315
319
|
return n;
|
316
320
|
}
|
317
321
|
return JSON.parse(n);
|
318
|
-
},
|
322
|
+
}, T = (n, i) => {
|
319
323
|
console.warn(`[${n} warn]: ${i}`);
|
320
|
-
},
|
324
|
+
}, je = (n, i) => {
|
321
325
|
console.error(`[${n} error]: ${i}`);
|
322
326
|
}, O = {
|
323
327
|
on(n, i) {
|
@@ -350,7 +354,7 @@ const Y = {
|
|
350
354
|
j(s) && s.apply(this, e);
|
351
355
|
}), this) : this;
|
352
356
|
}
|
353
|
-
},
|
357
|
+
}, Ls = {
|
354
358
|
easeInOutCirc(n, i, t, e) {
|
355
359
|
return (n /= e / 2) < 1 ? -t / 2 * (Math.sqrt(1 - n * n) - 1) + i : t / 2 * (Math.sqrt(1 - (n -= 2) * n) + 1) + i;
|
356
360
|
},
|
@@ -360,33 +364,33 @@ const Y = {
|
|
360
364
|
easeOutQuart(n, i, t, e) {
|
361
365
|
return -t * ((n = n / e - 1) * n * n * n - 1) + i;
|
362
366
|
}
|
363
|
-
},
|
364
|
-
const { target: t, container: e, spacer: s, speed: o, gap: a, easing: r, direction: l } = n, c = l === "horizontal", u = c ? "scrollLeft" : "scrollTop",
|
365
|
-
let
|
367
|
+
}, we = (n, i) => {
|
368
|
+
const { target: t, container: e, spacer: s, speed: o, gap: a, easing: r, direction: l } = n, c = l === "horizontal", u = c ? "scrollLeft" : "scrollTop", p = c ? "left" : "top", m = c ? "width" : "height", g = w(e) ? A(e) : document.scrollingElement, v = g[u], b = w(t) ? A(t).getBoundingClientRect()[p] : 0 - v, y = w(s) ? A(s).getBoundingClientRect()[m] : 0, H = b - a - y, G = 15;
|
369
|
+
let S = 0;
|
366
370
|
if (H === 0)
|
367
371
|
return;
|
368
372
|
const X = (R) => {
|
369
|
-
const
|
370
|
-
i && i.emit(R,
|
373
|
+
const Ne = A(t);
|
374
|
+
i && i.emit(R, Ne), !i && n.on && j(n.on[R]) && n.on[R](Ne);
|
371
375
|
};
|
372
376
|
X("beforeScroll");
|
373
|
-
const
|
374
|
-
|
375
|
-
const R =
|
376
|
-
g[u] = R,
|
377
|
+
const Pe = () => {
|
378
|
+
S += G;
|
379
|
+
const R = Ls[r](S, v, H, o);
|
380
|
+
g[u] = R, S < o && requestAnimationFrame(Pe), S >= o && X("afterScroll");
|
377
381
|
};
|
378
|
-
requestAnimationFrame(
|
382
|
+
requestAnimationFrame(Pe);
|
379
383
|
};
|
380
|
-
var J,
|
381
|
-
class
|
384
|
+
var J, Ee, pt, Ve, mt, Ke;
|
385
|
+
class Qe {
|
382
386
|
constructor(i, t = {}) {
|
383
|
-
|
384
|
-
|
385
|
-
|
387
|
+
h(this, J);
|
388
|
+
h(this, pt);
|
389
|
+
h(this, mt);
|
386
390
|
this.__storage__ = {
|
387
391
|
el: i,
|
388
392
|
options: t
|
389
|
-
}, this.active = "data-anchor-active", d(this, J,
|
393
|
+
}, this.active = "data-anchor-active", d(this, J, Ee).call(this);
|
390
394
|
}
|
391
395
|
destroy() {
|
392
396
|
const { elements: i } = this;
|
@@ -396,12 +400,12 @@ class Je {
|
|
396
400
|
}
|
397
401
|
update() {
|
398
402
|
var i;
|
399
|
-
return d(i = this.destroy(), J,
|
403
|
+
return d(i = this.destroy(), J, Ee).call(i), this.emit("afterUpdate"), this;
|
400
404
|
}
|
401
405
|
static run(i) {
|
402
406
|
const { SETTINGS: t } = lt, e = Object.assign({}, t, i);
|
403
407
|
setTimeout(() => {
|
404
|
-
|
408
|
+
we(e);
|
405
409
|
}, e.delay);
|
406
410
|
}
|
407
411
|
static url(i) {
|
@@ -410,25 +414,25 @@ class Je {
|
|
410
414
|
return;
|
411
415
|
const r = Object.assign({}, t, i, { target: a });
|
412
416
|
setTimeout(() => {
|
413
|
-
|
417
|
+
we(r);
|
414
418
|
}, r.delay);
|
415
419
|
}
|
416
420
|
}
|
417
|
-
J = new WeakSet(),
|
421
|
+
J = new WeakSet(), Ee = function() {
|
418
422
|
const { el: i, options: t } = this.__storage__;
|
419
|
-
if (!at(i) || !
|
423
|
+
if (!at(i) || !w(i))
|
420
424
|
return;
|
421
425
|
const { SETTINGS: e, EVENTS: s } = lt;
|
422
|
-
if (this.elements = t.state == "not active" ?
|
426
|
+
if (this.elements = t.state == "not active" ? L(i + `:not([${this.active}])`) : L(i), this.elements = L(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
423
427
|
for (const [o, a] of Object.entries(this.options.on))
|
424
428
|
this.__events__[o] = [a];
|
425
|
-
d(this, pt,
|
426
|
-
}, pt = new WeakSet(),
|
429
|
+
d(this, pt, Ve).call(this);
|
430
|
+
}, pt = new WeakSet(), Ve = function() {
|
427
431
|
const { elements: i, options: t } = this;
|
428
432
|
i.forEach((e) => {
|
429
|
-
e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this, mt,
|
433
|
+
e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this, mt, Ke), e.anchor.defaultOptions = t, e.anchor.methods = {}, e.anchor.methods.destroy = this.destroy, e.anchor.methods.update = this.update, e.addEventListener("click", e.anchor.eventHandler), e.setAttribute(this.active, "");
|
430
434
|
}), this.emit("afterInit");
|
431
|
-
}, mt = new WeakSet(),
|
435
|
+
}, mt = new WeakSet(), Ke = function() {
|
432
436
|
const { defaultOptions: i, eventHandler: t, instance: e } = this.anchor, s = {
|
433
437
|
target: this.getAttribute("data-anchor-target") || i.target,
|
434
438
|
container: this.getAttribute("data-anchor-container") || i.container,
|
@@ -442,12 +446,12 @@ J = new WeakSet(), we = function() {
|
|
442
446
|
this.removeEventListener("click", t), setTimeout(() => {
|
443
447
|
this.addEventListener("click", t);
|
444
448
|
}, s.speed), setTimeout(() => {
|
445
|
-
|
449
|
+
we(s, e);
|
446
450
|
}, s.delay);
|
447
451
|
};
|
448
|
-
Object.assign(
|
452
|
+
Object.assign(Qe.prototype, O);
|
449
453
|
window.MODALS || (window.MODALS = {});
|
450
|
-
const { MODALS: M } = window,
|
454
|
+
const { MODALS: M } = window, Ss = (n) => {
|
451
455
|
const { TEMPLATE: i } = I, { childDom: t } = n, e = document.createElement("div");
|
452
456
|
e.innerHTML = i(n.getAttribute("data-modal-template-setting"));
|
453
457
|
const s = e.querySelector(".modal-content");
|
@@ -455,15 +459,15 @@ const { MODALS: M } = window, Ts = (n) => {
|
|
455
459
|
s.append(o);
|
456
460
|
}), e.children[0];
|
457
461
|
};
|
458
|
-
var
|
459
|
-
class
|
462
|
+
var gt, ei, ft, ii, vt, si, bt, ni, yt, oi;
|
463
|
+
class ti extends HTMLElement {
|
460
464
|
constructor() {
|
461
465
|
super();
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
466
|
+
h(this, gt);
|
467
|
+
h(this, ft);
|
468
|
+
h(this, vt);
|
469
|
+
h(this, bt);
|
470
|
+
h(this, yt);
|
467
471
|
this.initialize = !1;
|
468
472
|
}
|
469
473
|
static get observedAttributes() {
|
@@ -472,12 +476,12 @@ class Ve extends HTMLElement {
|
|
472
476
|
attributeChangedCallback(t, e, s) {
|
473
477
|
switch (t) {
|
474
478
|
case ":state":
|
475
|
-
d(this, yt,
|
479
|
+
d(this, yt, oi).call(this, s);
|
476
480
|
break;
|
477
481
|
}
|
478
482
|
}
|
479
483
|
connectedCallback() {
|
480
|
-
this.initialize || (this.initialize = !0, d(this,
|
484
|
+
this.initialize || (this.initialize = !0, d(this, gt, ei).call(this));
|
481
485
|
}
|
482
486
|
open() {
|
483
487
|
return this.setAttribute(":state", "open"), this;
|
@@ -489,21 +493,21 @@ class Ve extends HTMLElement {
|
|
489
493
|
return this.setAttribute(":state", "destroy"), this;
|
490
494
|
}
|
491
495
|
}
|
492
|
-
|
496
|
+
gt = new WeakSet(), ei = function() {
|
493
497
|
const { ATTRS: t } = I;
|
494
498
|
this.__events__ = {}, this.getAttribute(":state") || this.setAttribute(":state", "close");
|
495
|
-
const e = this.getAttribute(t.id) ||
|
496
|
-
this.getAttribute(t.id) || (
|
497
|
-
},
|
498
|
-
this.childDom = this.childNodes, this.template =
|
499
|
-
}, vt = new WeakSet(),
|
499
|
+
const e = this.getAttribute(t.id) || Ts();
|
500
|
+
this.getAttribute(t.id) || (T(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), M[e] && T(`the ${t.id} "${e}" is already be used.`), M[e] = this, d(this, ft, ii).call(this);
|
501
|
+
}, ft = new WeakSet(), ii = function() {
|
502
|
+
this.childDom = this.childNodes, this.template = Ss(this), this.innerHTML = "", this.append(this.template), d(this, vt, si).call(this);
|
503
|
+
}, vt = new WeakSet(), si = function() {
|
500
504
|
const t = this.querySelector(".modal-scroller");
|
501
|
-
this.__scroller__ =
|
505
|
+
this.__scroller__ = Me(t, {
|
502
506
|
overflowBehavior: {
|
503
507
|
x: "hidden"
|
504
508
|
}
|
505
|
-
}), d(this, bt,
|
506
|
-
}, bt = new WeakSet(),
|
509
|
+
}), window.modalScroll = this.__scroller__, d(this, bt, ni).call(this);
|
510
|
+
}, bt = new WeakSet(), ni = function() {
|
507
511
|
var a, r, l;
|
508
512
|
const t = this, { ATTRS: e } = I, { close: s, destroy: o } = e;
|
509
513
|
(a = t.querySelectorAll(`[${s}]`)) == null || a.forEach((c) => {
|
@@ -519,7 +523,7 @@ ft = new WeakSet(), Ke = function() {
|
|
519
523
|
}), (l = t.querySelector("[stop-propagation]")) == null || l.addEventListener("click", function(c) {
|
520
524
|
c.stopPropagation();
|
521
525
|
});
|
522
|
-
}, yt = new WeakSet(),
|
526
|
+
}, yt = new WeakSet(), oi = function(t) {
|
523
527
|
const { __scroller__: e } = this;
|
524
528
|
if (t === "open") {
|
525
529
|
if (this.style.display = "block", e) {
|
@@ -550,22 +554,22 @@ ft = new WeakSet(), Ke = function() {
|
|
550
554
|
this.addEventListener("transitionend", s);
|
551
555
|
}
|
552
556
|
};
|
553
|
-
Object.assign(
|
554
|
-
const { MODALS:
|
557
|
+
Object.assign(ti.prototype, O);
|
558
|
+
const { MODALS: Ie } = window, ai = (n, i, ...t) => {
|
555
559
|
if (!i)
|
556
560
|
return;
|
557
561
|
const e = n[i];
|
558
562
|
e && j(e) && e.apply(n, t);
|
559
|
-
},
|
563
|
+
}, ri = (n, ...i) => {
|
560
564
|
n && j(n) && n.apply(U, i);
|
561
|
-
},
|
562
|
-
const { target: t } = n, e =
|
563
|
-
e &&
|
564
|
-
},
|
565
|
-
const { target: t, action: e, on: s, e: o } = n, a =
|
565
|
+
}, ze = (n, i) => {
|
566
|
+
const { target: t } = n, e = Ie[t] || A(n.target);
|
567
|
+
e && li(n, i), e || Ds(n, i);
|
568
|
+
}, li = (n, i) => {
|
569
|
+
const { target: t, action: e, on: s, e: o } = n, a = Ie[t] || A(n.target);
|
566
570
|
switch (["open", "close", "destroy"].forEach((l) => {
|
567
571
|
a.once(l, () => {
|
568
|
-
i && (i.emit(l, a, o),
|
572
|
+
i && (i.emit(l, a, o), ai(i, s[l], a, o)), i || ri(s[l], a);
|
569
573
|
});
|
570
574
|
}), e) {
|
571
575
|
case "open":
|
@@ -582,34 +586,34 @@ const { MODALS: Me } = window, ni = (n, i, ...t) => {
|
|
582
586
|
l === "close" && a.open(), l === "open" && a.close();
|
583
587
|
break;
|
584
588
|
}
|
585
|
-
},
|
589
|
+
}, Ds = async (n, i) => {
|
586
590
|
const { target: t, route: e, container: s, on: o, e: a } = n;
|
587
591
|
if (!e)
|
588
|
-
return
|
592
|
+
return T("modal4", "cannot find target or data-modal-route is not defined");
|
589
593
|
const r = (l, ...c) => {
|
590
|
-
i && (i.emit(l, ...c),
|
594
|
+
i && (i.emit(l, ...c), ai(i, o[l], ...c)), i || ri(o[l], ...c);
|
591
595
|
};
|
592
596
|
fetch(e).then((l) => (r("success", a), l.text())).then((l) => {
|
593
|
-
const c =
|
597
|
+
const c = Es(l), u = A(s) || A(I.SETTINGS.container);
|
594
598
|
[...c].forEach((m) => {
|
595
599
|
u.append(m);
|
596
600
|
});
|
597
|
-
const
|
598
|
-
r("complete",
|
601
|
+
const p = Ie[t] || A(n.target);
|
602
|
+
r("complete", p), li(n, i);
|
599
603
|
}).catch((l) => {
|
600
604
|
r("error", l);
|
601
605
|
});
|
602
606
|
};
|
603
|
-
var Z,
|
604
|
-
const
|
607
|
+
var Z, Ae, wt, ci, Tt, di;
|
608
|
+
const P = class P {
|
605
609
|
constructor(i, t = {}) {
|
606
|
-
|
607
|
-
|
608
|
-
|
610
|
+
h(this, Z);
|
611
|
+
h(this, wt);
|
612
|
+
h(this, Tt);
|
609
613
|
this.__storage__ = {
|
610
614
|
el: i,
|
611
615
|
options: t
|
612
|
-
}, this.active = "data-modal-active", d(this, Z,
|
616
|
+
}, this.active = "data-modal-active", d(this, Z, Ae).call(this);
|
613
617
|
}
|
614
618
|
destroy() {
|
615
619
|
const { elements: i } = this;
|
@@ -619,39 +623,39 @@ const N = class N {
|
|
619
623
|
}
|
620
624
|
update() {
|
621
625
|
var i;
|
622
|
-
return d(i = this.destroy(), Z,
|
626
|
+
return d(i = this.destroy(), Z, Ae).call(i), this.emit("update"), this;
|
623
627
|
}
|
624
628
|
/** static method 'open' */
|
625
629
|
static open(i) {
|
626
630
|
const { SETTINGS: t } = I, e = Object.assign({}, t, { on: {} }, i);
|
627
|
-
|
631
|
+
ze(e);
|
628
632
|
}
|
629
633
|
/** static method 'defineMethods' */
|
630
634
|
static defineMethods(i) {
|
631
|
-
|
632
|
-
const t =
|
635
|
+
P.prototype.__methods__ || (P.prototype.__methods__ = {});
|
636
|
+
const t = P.prototype.__methods__;
|
633
637
|
for (const [e, s] of Object.entries(i))
|
634
638
|
j(s) && (t[e] = s);
|
635
|
-
Object.assign(
|
639
|
+
Object.assign(P.prototype, P.prototype.__methods__);
|
636
640
|
}
|
637
641
|
};
|
638
|
-
Z = new WeakSet(),
|
642
|
+
Z = new WeakSet(), Ae = function() {
|
639
643
|
const { el: i, options: t } = this.__storage__;
|
640
|
-
if (!at(i) || !
|
644
|
+
if (!at(i) || !w(i))
|
641
645
|
return;
|
642
646
|
const { SETTINGS: e, EVENTS: s } = I;
|
643
|
-
if (this.elements = t.state == "not active" ?
|
647
|
+
if (this.elements = t.state == "not active" ? L(i + `:not([${this.active}])`) : L(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
644
648
|
for (const [o, a] of Object.entries(this.options.on))
|
645
649
|
this.__events__[o] = [a];
|
646
|
-
d(this, wt,
|
647
|
-
}, wt = new WeakSet(),
|
650
|
+
d(this, wt, ci).call(this);
|
651
|
+
}, wt = new WeakSet(), ci = function() {
|
648
652
|
const { elements: i, options: t } = this;
|
649
653
|
i.forEach((e) => {
|
650
|
-
e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this, Tt,
|
654
|
+
e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this, Tt, di), e.modal.defaultOptions = t, e.modal.methods = {}, e.modal.methods.destroy = this.destroy, e.modal.methods.update = this.update, e.addEventListener("click", e.modal.eventHandler), e.setAttribute(this.active, "");
|
651
655
|
}), this.emit("init");
|
652
|
-
}, Tt = new WeakSet(),
|
653
|
-
const { defaultOptions: t, eventHandler: e, instance: s } = this.modal, o =
|
654
|
-
o && typeof o != "object" &&
|
656
|
+
}, Tt = new WeakSet(), di = function(i) {
|
657
|
+
const { defaultOptions: t, eventHandler: e, instance: s } = this.modal, o = As(this.getAttribute("data-modal-on"));
|
658
|
+
o && typeof o != "object" && T("modal4", "data-modal-on must be a json string.");
|
655
659
|
const a = {
|
656
660
|
target: this.getAttribute("data-modal-target") || t.target,
|
657
661
|
action: this.getAttribute("data-modal-action") || t.action,
|
@@ -662,42 +666,42 @@ Z = new WeakSet(), Te = function() {
|
|
662
666
|
};
|
663
667
|
this.removeEventListener("click", e), setTimeout(() => {
|
664
668
|
this.addEventListener("click", e);
|
665
|
-
}, 200),
|
669
|
+
}, 200), ze(a, s);
|
666
670
|
};
|
667
|
-
let U =
|
671
|
+
let U = P;
|
668
672
|
Object.assign(U.prototype, O);
|
669
|
-
customElements.define("modern-modal",
|
670
|
-
const
|
673
|
+
customElements.define("modern-modal", ti);
|
674
|
+
const _s = (n, i) => {
|
671
675
|
const t = n === window ? n.innerHeight : n.getBoundingClientRect().height, e = n === window ? 0 : n.getBoundingClientRect().top;
|
672
676
|
i.forEach((s) => {
|
673
|
-
const { class: o, delay: a, start: r, end: l, repeat: c, instance: u } = s.aost, { top:
|
674
|
-
if (
|
677
|
+
const { class: o, delay: a, start: r, end: l, repeat: c, instance: u } = s.aost, { top: p, bottom: m } = s.getBoundingClientRect(), g = t * (r / 100), v = t * (l / 100);
|
678
|
+
if (p - e <= g && m - e >= v && s.offsetParent)
|
675
679
|
setTimeout(() => {
|
676
680
|
s.classList.add(o);
|
677
681
|
}, a);
|
678
682
|
else {
|
679
|
-
const
|
683
|
+
const y = s.classList.contains(o) && c === "down" && p - e >= g || c === "up" && m - e <= v || c === !0;
|
680
684
|
setTimeout(() => {
|
681
|
-
|
685
|
+
y && s.classList.remove(o);
|
682
686
|
}, a);
|
683
687
|
}
|
684
688
|
});
|
685
|
-
},
|
686
|
-
var Q,
|
687
|
-
class
|
689
|
+
}, ks = (n, i) => n === "up" || n === "down" ? n : n !== null ? n === "true" ? !0 : n === "false" ? !1 : i.repeat : i.repeat;
|
690
|
+
var Q, Le, Et, hi;
|
691
|
+
class ui {
|
688
692
|
constructor(i, t = {}) {
|
689
|
-
|
690
|
-
|
693
|
+
h(this, Q);
|
694
|
+
h(this, Et);
|
691
695
|
this.__storage__ = {
|
692
696
|
el: i,
|
693
697
|
options: t
|
694
|
-
}, this.active = "data-aost-active", d(this, Q,
|
698
|
+
}, this.active = "data-aost-active", d(this, Q, Le).call(this);
|
695
699
|
}
|
696
700
|
destroy(i) {
|
697
701
|
const { elements: t, options: e } = this;
|
698
702
|
if (!t)
|
699
703
|
return this;
|
700
|
-
const { scroller: s } = e, o = s === window || !
|
704
|
+
const { scroller: s } = e, o = s === window || !w(s) ? window : A(s);
|
701
705
|
return o.aost && (o.removeEventListener("scroll", o.aost.eventHandler), delete o.aost), t.forEach((a) => {
|
702
706
|
if (!a.aost)
|
703
707
|
return;
|
@@ -707,30 +711,30 @@ class ci {
|
|
707
711
|
}
|
708
712
|
update(i) {
|
709
713
|
var t;
|
710
|
-
d(t = this.destroy(i), Q,
|
714
|
+
d(t = this.destroy(i), Q, Le).call(t);
|
711
715
|
}
|
712
716
|
}
|
713
|
-
Q = new WeakSet(),
|
717
|
+
Q = new WeakSet(), Le = function() {
|
714
718
|
const { el: i, options: t } = this.__storage__;
|
715
|
-
if (!at(i) || !
|
719
|
+
if (!at(i) || !w(i))
|
716
720
|
return;
|
717
|
-
const { SETTINGS: e, EVENTS: s } =
|
718
|
-
if (this.elements = t.state == "not active" ?
|
721
|
+
const { SETTINGS: e, EVENTS: s } = Ye;
|
722
|
+
if (this.elements = t.state == "not active" ? L(i + `:not([${this.active}])`) : L(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
719
723
|
for (const [o, a] of Object.entries(this.options.on))
|
720
724
|
this.__events__[o] = [a];
|
721
|
-
d(this, Et,
|
722
|
-
}, Et = new WeakSet(),
|
723
|
-
const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !
|
725
|
+
d(this, Et, hi).call(this);
|
726
|
+
}, Et = new WeakSet(), hi = function() {
|
727
|
+
const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !w(e) ? window : A(e);
|
724
728
|
this.eventHandler = () => {
|
725
|
-
|
729
|
+
_s(s, i);
|
726
730
|
}, i.forEach((a) => {
|
727
|
-
a.aost = {}, a.aost.class = a.getAttribute("data-aost-class") || t.class, a.aost.delay = parseInt(a.getAttribute("data-aost-delay")) || t.delay, a.aost.start = parseInt(a.getAttribute("data-aost-start")) || t.start, a.aost.end = parseInt(a.getAttribute("data-aost-end")) || t.end, a.aost.repeat =
|
731
|
+
a.aost = {}, a.aost.class = a.getAttribute("data-aost-class") || t.class, a.aost.delay = parseInt(a.getAttribute("data-aost-delay")) || t.delay, a.aost.start = parseInt(a.getAttribute("data-aost-start")) || t.start, a.aost.end = parseInt(a.getAttribute("data-aost-end")) || t.end, a.aost.repeat = ks(a.getAttribute("data-aost-repeat"), t), a.aost.methods = {}, a.aost.methods.destroy = this.destroy, a.aost.methods.update = this.update, a.aost.instance = this, a.setAttribute(this.active, "");
|
728
732
|
});
|
729
733
|
const { eventHandler: o } = this;
|
730
734
|
o(), s.aost = {}, s.aost.eventHandler = o, s.addEventListener("scroll", s.aost.eventHandler, !1);
|
731
735
|
};
|
732
|
-
Object.assign(
|
733
|
-
const
|
736
|
+
Object.assign(ui.prototype, O);
|
737
|
+
const $s = (n) => {
|
734
738
|
const { TEMPLATE: i } = Y, { childDom: t } = n, e = document.createElement("div");
|
735
739
|
e.innerHTML = i();
|
736
740
|
const s = e.querySelector(".player-wrapper");
|
@@ -738,21 +742,25 @@ const Ss = (n) => {
|
|
738
742
|
s.append(o);
|
739
743
|
}), e.children[0];
|
740
744
|
};
|
741
|
-
var
|
742
|
-
class
|
745
|
+
var At, pi, Lt, mi, St, gi, Dt, fi, _t, vi, kt, bi, $t, yi, xt, wi, Ct, Ti;
|
746
|
+
class xs extends HTMLElement {
|
743
747
|
constructor() {
|
744
748
|
super();
|
745
|
-
|
746
|
-
|
747
|
-
|
749
|
+
h(this, At);
|
750
|
+
h(this, Lt);
|
751
|
+
h(this, St);
|
748
752
|
// youtube iframe
|
749
|
-
|
753
|
+
h(this, Dt);
|
750
754
|
// vimeo iframe
|
751
|
-
|
755
|
+
h(this, _t);
|
752
756
|
// youku iframe
|
753
|
-
|
754
|
-
|
755
|
-
|
757
|
+
h(this, kt);
|
758
|
+
h(this, $t);
|
759
|
+
// 2025.02.11 新增 ig
|
760
|
+
h(this, xt);
|
761
|
+
// 2025.02.11 新增 tiktok
|
762
|
+
h(this, Ct);
|
763
|
+
d(this, At, pi).call(this);
|
756
764
|
}
|
757
765
|
play() {
|
758
766
|
const { videoType: t } = this;
|
@@ -789,65 +797,77 @@ class Ds extends HTMLElement {
|
|
789
797
|
}
|
790
798
|
}
|
791
799
|
}
|
792
|
-
|
800
|
+
At = new WeakSet(), pi = function() {
|
793
801
|
if (!this.getAttribute("video-id")) {
|
794
|
-
|
802
|
+
T("videoPlayer", "video-render needs a ['video-id'] attribute to creat player.");
|
795
803
|
return;
|
796
804
|
}
|
797
|
-
this.videoId = this.getAttribute("video-id"), this.videoType = this.getAttribute("video-type"), this.autoplay = this.getAttribute("video-autoplay"), d(this,
|
798
|
-
},
|
799
|
-
this.childDom = this.childNodes, this.template =
|
800
|
-
}, St = new WeakSet(),
|
805
|
+
this.videoId = this.getAttribute("video-id"), this.videoType = this.getAttribute("video-type"), this.autoplay = this.getAttribute("video-autoplay"), this.startTime = this.getAttribute("video-starttime"), d(this, Lt, mi).call(this);
|
806
|
+
}, Lt = new WeakSet(), mi = function() {
|
807
|
+
this.childDom = this.childNodes, this.template = $s(this), this.innerHTML = "", this.append(this.template), d(this, St, gi).call(this);
|
808
|
+
}, St = new WeakSet(), gi = function() {
|
801
809
|
const { videoType: t } = this;
|
802
810
|
let e = "";
|
803
811
|
switch (t) {
|
804
812
|
case "youtubeAPI":
|
805
813
|
break;
|
806
814
|
case "youtube":
|
807
|
-
e = d(this, Dt,
|
815
|
+
e = d(this, Dt, fi).call(this);
|
808
816
|
break;
|
809
817
|
case "youkuAPI":
|
810
818
|
break;
|
811
819
|
case "youku":
|
812
|
-
e = d(this,
|
820
|
+
e = d(this, kt, bi).call(this);
|
813
821
|
break;
|
814
822
|
case "vimeo":
|
815
|
-
e = d(this, _t,
|
823
|
+
e = d(this, _t, vi).call(this);
|
816
824
|
break;
|
817
825
|
case "bilibili":
|
818
|
-
e = d(this, $t,
|
826
|
+
e = d(this, $t, yi).call(this);
|
827
|
+
break;
|
828
|
+
case "instagram":
|
829
|
+
e = d(this, xt, wi).call(this);
|
830
|
+
break;
|
831
|
+
case "tiktok":
|
832
|
+
e = d(this, Ct, Ti).call(this);
|
819
833
|
break;
|
820
834
|
}
|
821
|
-
this.querySelector(".player-wrapper").insertAdjacentHTML(
|
822
|
-
}, Dt = new WeakSet(),
|
823
|
-
const { videoId: t, autoplay: e } = this;
|
824
|
-
return `<iframe src="https://www.youtube.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}&mute=1&loop=1&enablejsapi=1" frameborder="0" allowfullscreen="0" volumn="0" allow="${e === "on" ? "autoplay;" : ""} encrypted-media; gyroscope; picture-in-picture;"></iframe>`;
|
825
|
-
}, _t = new WeakSet(),
|
835
|
+
this.querySelector(".player-wrapper").insertAdjacentHTML(E.prepend, e);
|
836
|
+
}, Dt = new WeakSet(), fi = function() {
|
837
|
+
const { videoId: t, autoplay: e, startTime: s } = this;
|
838
|
+
return `<iframe src="https://www.youtube.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}&start=${s}&mute=1&loop=1&enablejsapi=1" frameborder="0" allowfullscreen="0" volumn="0" allow="${e === "on" ? "autoplay;" : ""} encrypted-media; gyroscope; picture-in-picture;"></iframe>`;
|
839
|
+
}, _t = new WeakSet(), vi = function() {
|
826
840
|
const { videoId: t, autoplay: e, hash: s } = this;
|
827
841
|
return `<iframe src="https://player.vimeo.com/video/${t}?h=${s}&${e === "on" ? "autoplay=1" : ""}&loop=1&color=ffffff&title=0&byline=0&portrait=0" frameborder="0" allow="${e === "on" ? "autoplay;" : ""} fullscreen; picture-in-picture" allowfullscreen></iframe><script src="https://player.vimeo.com/api/player.js"><\/script>`;
|
828
|
-
},
|
842
|
+
}, kt = new WeakSet(), bi = function() {
|
829
843
|
const { videoId: t, autoplay: e } = this;
|
830
844
|
return `<iframe src="https://player.youku.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}" frameborder=0 "allowfullscreen"></iframe>`;
|
831
|
-
}, $t = new WeakSet(),
|
845
|
+
}, $t = new WeakSet(), yi = function() {
|
832
846
|
const { videoId: t, autoplay: e } = this;
|
833
847
|
return `<iframe src="//player.bilibili.com/player.html?bvid=${t}&page=1&as_wide=1&high_quality=1&danmaku=0" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>`;
|
848
|
+
}, xt = new WeakSet(), wi = function() {
|
849
|
+
const { videoId: t, autoplay: e } = this;
|
850
|
+
return `<iframe class="instagram-media instagram-media-rendered" id="instagram-embed-0" src="https://www.instagram.com/p/${t}/embed/" width="num-w" height=" num-h" scrolling="auto" frameborder="0" data-instgrm-payload-id="instagram-media-payload-0"></iframe>`;
|
851
|
+
}, Ct = new WeakSet(), Ti = function() {
|
852
|
+
const { videoId: t, autoplay: e } = this;
|
853
|
+
return `<iframe name="__tt_embed__v79271677875424740" sandbox="allow-popups allow-popups-to-escape-sandbox allow-scripts allow-top-navigation allow-same-origin" src="https://www.tiktok.com/player/v1/${t}?&${e === "on" ? "autoplay=1" : ""}"></iframe>`;
|
834
854
|
};
|
835
|
-
const
|
855
|
+
const gn = (n) => new Promise((i) => {
|
836
856
|
let t = setTimeout(() => (clearTimeout(t), i()), n);
|
837
857
|
});
|
838
|
-
function
|
858
|
+
function Ei(n) {
|
839
859
|
const i = [];
|
840
860
|
n && n.forEach((t) => {
|
841
861
|
t instanceof HTMLElement ? i.push(t) : typeof t == "string" && i.push(...document.querySelectorAll(`${t}`));
|
842
|
-
}), f("html").addClass("scrollLock"),
|
862
|
+
}), f("html").addClass("scrollLock"), vs(i);
|
843
863
|
}
|
844
|
-
function
|
864
|
+
function Ai(n) {
|
845
865
|
const i = [];
|
846
866
|
n && n.forEach((t) => {
|
847
867
|
t instanceof HTMLElement ? i.push(t) : typeof t == "string" && i.push(...document.querySelectorAll(`${t}`));
|
848
|
-
}), f("html").removeClass("scrollLock"),
|
868
|
+
}), f("html").removeClass("scrollLock"), bs(i);
|
849
869
|
}
|
850
|
-
async function
|
870
|
+
async function fn(n = 0) {
|
851
871
|
if (f(".loading-wrapper").length)
|
852
872
|
return;
|
853
873
|
f("body").append(`
|
@@ -861,30 +881,30 @@ async function hn(n = 0) {
|
|
861
881
|
</div>
|
862
882
|
</div>
|
863
883
|
`), f(".loading-wrapper").delay(n).fadeIn(300).promise().done(function() {
|
864
|
-
|
884
|
+
Ei();
|
865
885
|
});
|
866
886
|
}
|
867
|
-
function
|
887
|
+
function vn() {
|
868
888
|
f(".loading-wrapper").fadeOut(300).promise().done(function() {
|
869
|
-
f(".loading-wrapper").remove(),
|
889
|
+
f(".loading-wrapper").remove(), Ai();
|
870
890
|
});
|
871
891
|
}
|
872
|
-
function
|
873
|
-
new
|
892
|
+
function bn(n, i) {
|
893
|
+
new on(n, i);
|
874
894
|
}
|
875
|
-
function
|
876
|
-
const n = new
|
877
|
-
} }), t = new
|
895
|
+
function Cs() {
|
896
|
+
const n = new ui("[data-aost]"), i = new Fe({ callback_loaded: (s) => {
|
897
|
+
} }), t = new Qs(), e = new Qe("[data-anchor-target]");
|
878
898
|
n.update(), i.update(), t.reValidate(), e.update();
|
879
899
|
}
|
880
|
-
function
|
900
|
+
function yn(n, i = () => {
|
881
901
|
}) {
|
882
902
|
f(`[data-tab-content=${n}]`).fadeIn(function() {
|
883
903
|
typeof i == "function" && i();
|
884
|
-
}).siblings("[data-tab-content]").hide(),
|
904
|
+
}).siblings("[data-tab-content]").hide(), Cs();
|
885
905
|
}
|
886
|
-
function
|
887
|
-
|
906
|
+
function wn() {
|
907
|
+
Me(
|
888
908
|
{
|
889
909
|
target: document.body,
|
890
910
|
cancel: {
|
@@ -908,28 +928,28 @@ function gn() {
|
|
908
928
|
}
|
909
929
|
);
|
910
930
|
}
|
911
|
-
function
|
931
|
+
function Tn() {
|
912
932
|
window.onpageshow = function(n) {
|
913
933
|
n.persisted && window.location.reload();
|
914
934
|
};
|
915
935
|
}
|
916
|
-
function
|
936
|
+
function En() {
|
917
937
|
const n = navigator.userAgent;
|
918
938
|
return {
|
919
939
|
BigSurUP: /Mac OS X 10.15/.test(n) || /Mac OS X 10_15_7/.test(n) || /Mac OS X 10_15_8/.test(n) || /Mac OS X 10_15_9/.test(n) || /Mac OS X 11_/.test(n) || /Mac OS X 12_/.test(n)
|
920
940
|
};
|
921
941
|
}
|
922
|
-
function
|
942
|
+
function An(n, i) {
|
923
943
|
f(n).on("click", function() {
|
924
944
|
f(this).toggleClass(i);
|
925
945
|
});
|
926
946
|
}
|
927
|
-
function
|
947
|
+
function Ln(n, i) {
|
928
948
|
f(n).on("click", function() {
|
929
949
|
f(n).not(this).removeClass(i), f(this).addClass(i);
|
930
950
|
});
|
931
951
|
}
|
932
|
-
function
|
952
|
+
function Hs(n, i = 250) {
|
933
953
|
let t = null;
|
934
954
|
return function(...e) {
|
935
955
|
let s = this;
|
@@ -938,7 +958,7 @@ function xs(n, i = 250) {
|
|
938
958
|
}, i);
|
939
959
|
};
|
940
960
|
}
|
941
|
-
function
|
961
|
+
function Sn(n, i = 250) {
|
942
962
|
let t, e;
|
943
963
|
return function() {
|
944
964
|
const s = this, o = arguments, a = +/* @__PURE__ */ new Date();
|
@@ -947,7 +967,7 @@ function Tn(n, i = 250) {
|
|
947
967
|
}, i)) : (t = a, n.apply(s, o));
|
948
968
|
};
|
949
969
|
}
|
950
|
-
function
|
970
|
+
function Dn() {
|
951
971
|
window._g.interval = [], f(".countdown").each((i, t) => {
|
952
972
|
const e = Number(f(t).attr("data-seconds")) + 1;
|
953
973
|
let s = Math.floor(e / 60) + ":" + e % 60;
|
@@ -957,34 +977,34 @@ function En() {
|
|
957
977
|
}, 1e3);
|
958
978
|
});
|
959
979
|
}
|
960
|
-
function
|
980
|
+
function _n(n = 500) {
|
961
981
|
return new Promise((i, t) => {
|
962
982
|
let e = setTimeout(() => {
|
963
983
|
clearTimeout(e), i();
|
964
984
|
}, n);
|
965
985
|
});
|
966
986
|
}
|
967
|
-
function
|
987
|
+
function kn() {
|
968
988
|
const n = function() {
|
969
989
|
let i = window.innerHeight * 0.01;
|
970
990
|
document.documentElement.style.setProperty("--vh", i + "px");
|
971
991
|
};
|
972
|
-
n(), window.addEventListener("resize",
|
992
|
+
n(), window.addEventListener("resize", Hs(n));
|
973
993
|
}
|
974
|
-
function
|
994
|
+
function $n(n, i, t, e, s) {
|
975
995
|
const o = this, r = f(n).html().split("<br>");
|
976
996
|
let l = "", c = 0;
|
977
|
-
r.forEach((u,
|
978
|
-
|
997
|
+
r.forEach((u, p) => {
|
998
|
+
p !== 0 && (l += "<br>"), u.split("").forEach((g, v) => {
|
979
999
|
i ? (v === 0 && (l += '<span class="letter-wrap" style="display: inline-block">'), g === " " ? l += '</span> <span class="letter-wrap" style="display: inline-block">' : (l += `<span class="letter"${s || t ? ` style="${s ? `transition: ${o.formatFloat(Math.random(), 2) * s}s;` : ""}${t ? t === "random" ? `transition-delay: ${o.formatFloat(Math.random(), 2)}s;` : `transition-delay: ${t + c * e}s;` : ""}"` : ""}>${g}</span>`, c++), v === u.length - 1 && (l += "</span>")) : g === " " ? l += " " : (l += `<span class="letter"${s || t ? ` style="${s ? `transition: ${o.formatFloat(Math.random(), 2) * s}s;` : ""}${t ? t === "random" ? `transition-delay: ${o.formatFloat(Math.random(), 2)}s;` : `transition-delay: ${t + c * e}s;` : ""}"` : ""}>${g}</span>`, c++);
|
980
1000
|
});
|
981
1001
|
}), f(n).html(l);
|
982
1002
|
}
|
983
|
-
function
|
1003
|
+
function xn(n, i) {
|
984
1004
|
const t = Math.pow(10, i);
|
985
1005
|
return Math.round(n * t) / t;
|
986
1006
|
}
|
987
|
-
function
|
1007
|
+
function Cn(n) {
|
988
1008
|
let i = n.activeIndex, t = n.slides.length;
|
989
1009
|
if (n.params.loop)
|
990
1010
|
switch (n.activeIndex) {
|
@@ -999,18 +1019,18 @@ function _n(n) {
|
|
999
1019
|
}
|
1000
1020
|
return i;
|
1001
1021
|
}
|
1002
|
-
function
|
1022
|
+
function Hn(n, i) {
|
1003
1023
|
const t = n.$el, e = n.params.grid.rows, s = i || n.params.slidesPerView * e;
|
1004
1024
|
(n.loopedSlides ? n.slides.length - n.loopedSlides * 2 : n.slides.length) <= s ? (t.addClass("swiper-no-swiping"), f(n.params.navigation.nextEl).hide(), f(n.params.navigation.prevEl).hide(), f(n.params.pagination.el).hide(), n.params.autoplay.enabled = !1, n.autoplay.stop()) : (t.removeClass("swiper-no-swiping"), f(n.params.navigation.nextEl).show(), f(n.params.navigation.prevEl).show(), f(n.params.pagination.el).show(), n.params.autoplay.enabled && n.autoplay.start());
|
1005
1025
|
}
|
1006
|
-
function
|
1026
|
+
function Mn(n) {
|
1007
1027
|
n.el.querySelectorAll("img.detect-shade").forEach((i) => {
|
1008
1028
|
i.addEventListener("load", function() {
|
1009
1029
|
detectShade(i);
|
1010
1030
|
});
|
1011
1031
|
});
|
1012
1032
|
}
|
1013
|
-
function
|
1033
|
+
function qn(n) {
|
1014
1034
|
const i = n.el, t = f(i).find(".swiper-slide-active"), e = f(t).find("video").get(0), s = f(i).find(".swiper-slide video");
|
1015
1035
|
n.autoplay.stop(), f(e).off("ended"), e ? (s.each((o, a) => {
|
1016
1036
|
a.currentTime = 0;
|
@@ -1018,7 +1038,7 @@ function kn(n) {
|
|
1018
1038
|
n.slideNext();
|
1019
1039
|
}), e.play()) : n.params.autoplay.enabled && n.autoplay.start();
|
1020
1040
|
}
|
1021
|
-
function
|
1041
|
+
function In() {
|
1022
1042
|
f(".number-grow").each(function(n, i) {
|
1023
1043
|
const t = f(i), o = t.attr("data-num").replace(/(\d)(?=(?:\d{3})+$)/g, "$1,").split(""), a = () => {
|
1024
1044
|
let r = "";
|
@@ -1032,7 +1052,7 @@ function Cn() {
|
|
1032
1052
|
});
|
1033
1053
|
});
|
1034
1054
|
}
|
1035
|
-
function
|
1055
|
+
function On() {
|
1036
1056
|
f(".letter-grow").each(function(n, i) {
|
1037
1057
|
const t = f(i), s = t.attr("data-letter").split(""), o = () => {
|
1038
1058
|
let a = "";
|
@@ -1046,106 +1066,120 @@ function Hn() {
|
|
1046
1066
|
});
|
1047
1067
|
});
|
1048
1068
|
}
|
1049
|
-
function
|
1069
|
+
function Pn(n) {
|
1050
1070
|
const i = getComputedStyle(n).transform;
|
1051
1071
|
let t = i.match(/^matrix3d\((.+)\)$/);
|
1052
1072
|
return t ? parseFloat(t[1].split(", ")[12]) : (t = i.match(/^matrix\((.+)\)$/), t ? parseFloat(t[1].split(", ")[4]) : 0);
|
1053
1073
|
}
|
1054
|
-
function
|
1074
|
+
function Nn(n) {
|
1055
1075
|
const i = getComputedStyle(n).transform;
|
1056
1076
|
let t = i.match(/^matrix3d\((.+)\)$/);
|
1057
1077
|
return t ? parseFloat(t[1].split(", ")[13]) : (t = i.match(/^matrix\((.+)\)$/), t ? parseFloat(t[1].split(", ")[5]) : 0);
|
1058
1078
|
}
|
1059
|
-
function
|
1079
|
+
function jn(n) {
|
1060
1080
|
const i = document.createElement("div");
|
1061
1081
|
return i.innerHTML = n, i.childNodes[0];
|
1062
1082
|
}
|
1063
|
-
const
|
1064
|
-
var V,
|
1065
|
-
class
|
1083
|
+
const We = (n) => n.videoId !== "" || typeof n.videoId < "u", Ms = (n) => n.$selector.getAttribute("video4-active") === "on", Te = (n) => `<video-player video-id="${n.videoId}" video-type="${n.videoType}" video-startTime="${n.videoStartTime}" video-autoplay="${n.videoAutoplay}"></video-player>`;
|
1084
|
+
var V, Se, Ht, Li, Mt, Si, K, De, qt, Di;
|
1085
|
+
class qs {
|
1066
1086
|
constructor(i, t = {}) {
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
if (!at(i) && !
|
1073
|
-
|
1087
|
+
h(this, V);
|
1088
|
+
h(this, Ht);
|
1089
|
+
h(this, Mt);
|
1090
|
+
h(this, K);
|
1091
|
+
h(this, qt);
|
1092
|
+
if (!at(i) && !ye(i) && !rt(i)) {
|
1093
|
+
je("video4", `找不到該物件 -> ${i}`);
|
1074
1094
|
return;
|
1075
1095
|
}
|
1076
1096
|
this.__storage__ = {
|
1077
1097
|
el: i,
|
1078
1098
|
options: t
|
1079
|
-
}, this.active = "data-video-active", d(this, V,
|
1099
|
+
}, this.active = "data-video-active", d(this, V, Se).call(this);
|
1080
1100
|
}
|
1081
1101
|
update() {
|
1082
|
-
d(this, V,
|
1102
|
+
d(this, V, Se).call(this);
|
1083
1103
|
}
|
1084
1104
|
}
|
1085
|
-
V = new WeakSet(),
|
1105
|
+
V = new WeakSet(), Se = function() {
|
1086
1106
|
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } = Y;
|
1087
|
-
if (this.elements = t.state == "not active" ?
|
1107
|
+
if (this.elements = t.state == "not active" ? L(i + `:not([${this.active}])`) : L(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
1088
1108
|
for (const [o, a] of Object.entries(this.options.on))
|
1089
1109
|
this.__events__[o] = [a];
|
1090
|
-
d(this,
|
1091
|
-
},
|
1110
|
+
d(this, Ht, Li).call(this);
|
1111
|
+
}, Ht = new WeakSet(), Li = function() {
|
1092
1112
|
const { elements: i, options: t } = this;
|
1093
1113
|
i.forEach((e) => {
|
1094
|
-
e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this,
|
1114
|
+
e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this, qt, Di).call(this, e), e.video.methods = {}, e.video.methods.update = this.update, e.setAttribute(this.active, ""), We(e.video.params) && !Ms(e.video.params) && (e.setAttribute("video4-active", "on"), d(this, Mt, Si).call(this, e)), We(e.video.params) || je("video4", "無法取得影片 ID");
|
1095
1115
|
}), this.emit("init");
|
1096
|
-
},
|
1097
|
-
const { LAYOUT: t } = Y, e = i.video.params, { $selector: s, videoLayoutNo: o, videoId: a, videoType: r, videoMode: l, videoButton: c, videoCover: u } = e;
|
1116
|
+
}, Mt = new WeakSet(), Si = function(i) {
|
1117
|
+
const { LAYOUT: t } = Y, e = i.video.params, { $selector: s, videoLayoutNo: o, videoId: a, videoType: r, videoMode: l, videoButton: c, videoCover: u, videoHighQualityPic: p } = e;
|
1098
1118
|
if (l === "onBox") {
|
1099
|
-
let
|
1119
|
+
let m = null;
|
1100
1120
|
if (u === "on") {
|
1101
|
-
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(
|
1102
|
-
const
|
1103
|
-
|
1104
|
-
const
|
1105
|
-
!
|
1121
|
+
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(E.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), T("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
|
1122
|
+
const g = s.querySelector("img");
|
1123
|
+
g.insertAdjacentHTML(E.after, t[o]);
|
1124
|
+
const v = (g == null ? void 0 : g.getAttribute("src")) || (g == null ? void 0 : g.getAttribute("data-src"));
|
1125
|
+
!v && r == "youtube" ? p ? g.setAttribute("src", `http://img.youtube.com/vi/${a}/maxresdefault.jpg `) : g.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`) : !v && r == "vimeo" ? g.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !v && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((b) => b.json()).then((b) => {
|
1126
|
+
const y = b.thumbnail_url;
|
1127
|
+
g.setAttribute("src", `${y}`);
|
1128
|
+
}).catch(function(b) {
|
1129
|
+
console.log("error");
|
1130
|
+
}) : T("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
|
1106
1131
|
}
|
1107
|
-
c == "off" ?
|
1132
|
+
c == "off" ? m = s : (m = s.querySelector(c) ?? s, s.querySelector(c) || T("video4", `找不到 videoButton 設定的 element -> '${c}' , 點擊物件轉移至 '${this.__storage__.el}'`)), m.video || (m.video = {}, m.video.params = e), m.video.eventHandler = d(this, K, De), m.addEventListener("click", m.video.eventHandler);
|
1108
1133
|
} else if (l === "onPage") {
|
1109
|
-
let
|
1134
|
+
let m = null;
|
1110
1135
|
if (u == "on") {
|
1111
|
-
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(
|
1112
|
-
const
|
1113
|
-
|
1114
|
-
const
|
1115
|
-
!
|
1136
|
+
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(E.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), T("video", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構"));
|
1137
|
+
const g = s.querySelector("img");
|
1138
|
+
g.insertAdjacentHTML(E.after, t[o]);
|
1139
|
+
const v = (g == null ? void 0 : g.getAttribute("src")) || (g == null ? void 0 : g.getAttribute("data-src"));
|
1140
|
+
!v && r == "youtube" ? p ? g.setAttribute("src", `http://img.youtube.com/vi/${a}/maxresdefault.jpg `) : g.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`) : !v && r == "vimeo" ? g.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !v && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((b) => b.json()).then((b) => {
|
1141
|
+
const y = b.thumbnail_url;
|
1142
|
+
g.setAttribute("src", `${y}`);
|
1143
|
+
}).catch(function(b) {
|
1144
|
+
console.log("error");
|
1145
|
+
}) : v || T("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片"), c == "off" ? m = s : (m = s.querySelector(c) ?? s, s.querySelector(c) || T("video4", `找不到 videoButton 設定的 element -> '${c}', 點擊物件轉移至 '${this.__storage__.el}'`));
|
1116
1146
|
} else {
|
1117
|
-
s.innerHTML =
|
1147
|
+
s.innerHTML = Te(e);
|
1118
1148
|
return;
|
1119
1149
|
}
|
1120
|
-
|
1150
|
+
m.video || (m.video = {}, m.video.params = e), m.video.eventHandler = d(this, K, De), m.addEventListener("click", m.video.eventHandler);
|
1121
1151
|
}
|
1122
|
-
}, K = new WeakSet(),
|
1123
|
-
const { video: t, emit: e } = this, { $selector: s, videoMode: o, videoTarget: a, videoTargetRoute: r } = t.params,
|
1152
|
+
}, K = new WeakSet(), De = function(i) {
|
1153
|
+
const { video: t, emit: e } = this, { $selector: s, videoMode: o, videoTarget: a, videoTargetRoute: r, videoType: l, videoIgHtml: c } = t.params, u = new Fe({ callback_loaded: (p) => {
|
1124
1154
|
} });
|
1125
1155
|
if (o == "onBox") {
|
1126
|
-
const
|
1156
|
+
const p = {
|
1127
1157
|
target: a,
|
1128
1158
|
route: r,
|
1129
1159
|
on: {
|
1130
|
-
complete(
|
1131
|
-
|
1160
|
+
complete(m) {
|
1161
|
+
if (l == "instagram") {
|
1162
|
+
const g = (v) => `${c}`;
|
1163
|
+
m.querySelector(".modal-content").insertAdjacentHTML("beforeend", g(t.params)), m.querySelector(".modal-content").setAttribute("video-typeStyle", `${l}`), window.instgrm && window.instgrm.Embeds.process();
|
1164
|
+
} else
|
1165
|
+
m.querySelector(".modal-content").insertAdjacentHTML("beforeend", Te(t.params)), m.querySelector(".modal-content").setAttribute("video-typeStyle", `${l}`);
|
1132
1166
|
},
|
1133
|
-
open(
|
1134
|
-
const
|
1135
|
-
|
1167
|
+
open(m) {
|
1168
|
+
const g = m.querySelectorAll("[data-overlayscrollbars-viewport]");
|
1169
|
+
u.update(), window.modalScroll.update(), Ei([...g]);
|
1136
1170
|
},
|
1137
|
-
close(
|
1138
|
-
const
|
1139
|
-
|
1171
|
+
close(m) {
|
1172
|
+
const g = m.querySelectorAll("[data-overlayscrollbars-viewport]");
|
1173
|
+
Ai([...g]);
|
1140
1174
|
},
|
1141
|
-
destroy(
|
1175
|
+
destroy(m) {
|
1142
1176
|
}
|
1143
1177
|
}
|
1144
1178
|
};
|
1145
|
-
U.open(
|
1179
|
+
U.open(p);
|
1146
1180
|
} else
|
1147
|
-
o == "onPage" && (t.params.videoAutoplay = "on", s.innerHTML =
|
1148
|
-
},
|
1181
|
+
o == "onPage" && (t.params.videoAutoplay = "on", s.innerHTML = Te(t.params));
|
1182
|
+
}, qt = new WeakSet(), Di = function(i) {
|
1149
1183
|
const { SETTINGS: t } = Y;
|
1150
1184
|
return {
|
1151
1185
|
$selector: i,
|
@@ -1157,12 +1191,15 @@ V = new WeakSet(), Le = function() {
|
|
1157
1191
|
videoCover: i.getAttribute("video-cover") || t.videoCover,
|
1158
1192
|
videoLayoutNo: i.getAttribute("video-layout-no") || t.videoLayoutNo,
|
1159
1193
|
videoTarget: i.getAttribute("video-target") || t.videoTarget,
|
1160
|
-
videoTargetRoute: i.getAttribute("video-target-route") || t.videoTargetRoute
|
1194
|
+
videoTargetRoute: i.getAttribute("video-target-route") || t.videoTargetRoute,
|
1195
|
+
videoStartTime: i.getAttribute("video-starttime") || t.videoStartTime,
|
1196
|
+
videoHighQualityPic: i.getAttribute("video-highquality") || t.videoHighQuality,
|
1197
|
+
videoIgHtml: i.getAttribute("video-ig") || t.videoIgHtml
|
1161
1198
|
};
|
1162
1199
|
};
|
1163
|
-
Object.assign(
|
1164
|
-
customElements.define("video-player",
|
1165
|
-
const
|
1200
|
+
Object.assign(qs.prototype, O);
|
1201
|
+
customElements.define("video-player", xs);
|
1202
|
+
const Oe = {
|
1166
1203
|
"zh-tw": {
|
1167
1204
|
臺北市: [
|
1168
1205
|
["中正區", "100"],
|
@@ -1991,8 +2028,8 @@ const qe = {
|
|
1991
2028
|
["Dongyin Township", "212"]
|
1992
2029
|
]
|
1993
2030
|
}
|
1994
|
-
},
|
1995
|
-
const { TEMPLATE: i } =
|
2031
|
+
}, Is = (n) => {
|
2032
|
+
const { TEMPLATE: i } = qe, { childDom: t } = n.s, e = document.createElement("div"), s = n.classList.contains("filter"), o = n.getAttribute("filter-placeholder"), a = n.getAttribute("d4-icon"), r = n.getAttribute("custom-template");
|
1996
2033
|
e.innerHTML = i(
|
1997
2034
|
s,
|
1998
2035
|
o,
|
@@ -2001,18 +2038,18 @@ const qe = {
|
|
2001
2038
|
);
|
2002
2039
|
const l = e.querySelector(".dropdown-list");
|
2003
2040
|
return [...t].forEach((c) => {
|
2004
|
-
c.tagName === "LI" && (c.classList.contains("has-sublayer") ? [...c.querySelectorAll("li")].forEach((
|
2005
|
-
(!
|
2041
|
+
c.tagName === "LI" && (c.classList.contains("has-sublayer") ? [...c.querySelectorAll("li")].forEach((p) => {
|
2042
|
+
(!p.hasAttribute("data-option") || p.getAttribute("data-option").trim() === "") && p.setAttribute("data-option", p.textContent.trim());
|
2006
2043
|
}) : (!c.hasAttribute("data-option") || c.getAttribute("data-option").trim() === "") && c.setAttribute("data-option", c.textContent.trim())), l.append(c);
|
2007
2044
|
}), e.children[0];
|
2008
|
-
},
|
2045
|
+
}, Os = (n) => {
|
2009
2046
|
var t;
|
2010
2047
|
const i = (t = n.getAttribute("control-elements")) == null ? void 0 : t.split(",");
|
2011
2048
|
i && i.forEach((e) => {
|
2012
2049
|
const s = document.querySelector(e);
|
2013
|
-
s ||
|
2050
|
+
s || T("dropdown", `Can't not find control element(${e})`), s && s.classList.contains("disabled") && (s.classList.remove("disabled"), s.tagName === "DROPDOWN-EL" && s.s.activeLi && x(s, [...s.s.allLi].indexOf(s.s.activeLi)));
|
2014
2051
|
});
|
2015
|
-
},
|
2052
|
+
}, x = (n, i) => {
|
2016
2053
|
const t = n.getAttribute("d4-placeholder"), e = n.querySelectorAll(".dropdown-list li");
|
2017
2054
|
if (i < 0 || i.length === 0) {
|
2018
2055
|
switch (e.forEach((s) => {
|
@@ -2053,7 +2090,7 @@ const qe = {
|
|
2053
2090
|
const o = n.querySelectorAll(".dropdown-list li.active");
|
2054
2091
|
o.length <= 0 ? n.s.selectDisplayEl.textContent = t.trim() : (n.s.selectDisplayEl.textContent = "", o.forEach((r) => {
|
2055
2092
|
const l = r.getAttribute("data-option"), c = r.textContent.trim(), u = `<div class="option-btn" data-option="${l}"><div class="text">${c}</div><div class="remove-icon"></div></div>`;
|
2056
|
-
n.s.selectDisplayEl.insertAdjacentHTML(
|
2093
|
+
n.s.selectDisplayEl.insertAdjacentHTML(E.append, u);
|
2057
2094
|
})), n.s.activeLi = o, n.s.value = [...o].map((r) => ({
|
2058
2095
|
index: [...e].indexOf(r),
|
2059
2096
|
id: r.getAttribute("data-option"),
|
@@ -2064,42 +2101,42 @@ const qe = {
|
|
2064
2101
|
break;
|
2065
2102
|
}
|
2066
2103
|
}
|
2067
|
-
},
|
2104
|
+
}, Ps = (n) => {
|
2068
2105
|
const i = n.s.cityLang;
|
2069
|
-
n.classList.contains("city") && (n.s.dropdownEl.querySelector(".dropdown-list").innerHTML = "", Object.keys(
|
2106
|
+
n.classList.contains("city") && (n.s.dropdownEl.querySelector(".dropdown-list").innerHTML = "", Object.keys(Oe[i]).forEach((t) => {
|
2070
2107
|
const e = document.createElement("li");
|
2071
2108
|
e.textContent = t, e.setAttribute("data-option", t), n.s.dropdownEl.querySelector(".dropdown-list").append(e);
|
2072
2109
|
}), n.s.allLi = n.querySelectorAll(".dropdown-list li"));
|
2073
|
-
},
|
2110
|
+
}, Ns = (n, i) => {
|
2074
2111
|
const t = n.s.cityLang;
|
2075
|
-
|
2112
|
+
Oe[t][i].forEach((e, s) => {
|
2076
2113
|
const o = document.createElement("li");
|
2077
2114
|
o.textContent = e[0], o.setAttribute("data-option", e[0]), n.querySelector(".dropdown-list").append(o);
|
2078
2115
|
});
|
2079
|
-
},
|
2080
|
-
|
2116
|
+
}, _i = () => {
|
2117
|
+
L('dropdown-el[d4-status="open"]').forEach((i) => {
|
2081
2118
|
i.close();
|
2082
2119
|
});
|
2083
|
-
},
|
2084
|
-
const { SETTINGS: n } =
|
2120
|
+
}, js = () => {
|
2121
|
+
const { SETTINGS: n } = qe;
|
2085
2122
|
((t, e) => {
|
2086
2123
|
Object.keys(e).forEach((s) => {
|
2087
2124
|
t.style.setProperty(`--${s}`, e[s]);
|
2088
2125
|
});
|
2089
2126
|
})(document.documentElement, n.scrollbar);
|
2090
2127
|
};
|
2091
|
-
|
2128
|
+
js();
|
2092
2129
|
document.addEventListener("click", function() {
|
2093
|
-
|
2130
|
+
_i();
|
2094
2131
|
});
|
2095
|
-
var
|
2096
|
-
class
|
2132
|
+
var It, $i, Ot, xi, Pt, Ci, Nt, Hi;
|
2133
|
+
class ki extends HTMLElement {
|
2097
2134
|
constructor() {
|
2098
2135
|
super();
|
2099
|
-
|
2100
|
-
|
2101
|
-
|
2102
|
-
|
2136
|
+
h(this, It);
|
2137
|
+
h(this, Ot);
|
2138
|
+
h(this, Pt);
|
2139
|
+
h(this, Nt);
|
2103
2140
|
this.initialize = !1;
|
2104
2141
|
}
|
2105
2142
|
static get observedAttributes() {
|
@@ -2120,36 +2157,36 @@ class Ai extends HTMLElement {
|
|
2120
2157
|
switch (o.hasAttribute("multiple") ? "multiple" : "single") {
|
2121
2158
|
case "single":
|
2122
2159
|
const r = o.querySelector(`.dropdown-list li[data-option="${s}"]`);
|
2123
|
-
|
2160
|
+
w(r) ? x(o, [...o.s.allLi].indexOf(r)) : x(o, -1);
|
2124
2161
|
break;
|
2125
2162
|
case "multiple":
|
2126
2163
|
const l = [];
|
2127
2164
|
o.querySelector(".dropdown-list li").classList.remove("active"), s.split(",").forEach((u) => {
|
2128
|
-
const
|
2129
|
-
|
2165
|
+
const p = o.querySelector(`.dropdown-list li[data-option="${u}"]`);
|
2166
|
+
w(p) && (p.classList.add("active"), l.push(p));
|
2130
2167
|
});
|
2131
2168
|
const c = l.map((u) => [...o.s.allLi].indexOf(u));
|
2132
|
-
|
2169
|
+
x(o, c);
|
2133
2170
|
break;
|
2134
2171
|
}
|
2135
2172
|
else
|
2136
|
-
|
2173
|
+
x(o, -1);
|
2137
2174
|
o.emit("change");
|
2138
2175
|
break;
|
2139
2176
|
case "d4-placeholder":
|
2140
2177
|
if (e === null)
|
2141
2178
|
return;
|
2142
|
-
e !== s && o.s.value.index < 0 &&
|
2179
|
+
e !== s && o.s.value.index < 0 && x(o, o.s.value.index);
|
2143
2180
|
break;
|
2144
2181
|
}
|
2145
2182
|
}
|
2146
2183
|
connectedCallback() {
|
2147
2184
|
const t = this;
|
2148
|
-
t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this,
|
2185
|
+
t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this, It, $i).call(this));
|
2149
2186
|
}
|
2150
2187
|
open() {
|
2151
2188
|
const t = this, e = t.querySelector(".dropdown-scroller").clientHeight, s = t.classList.contains("filter"), o = () => s ? t.querySelector(".dropdown-scroller .filter-bar") ? e : t.querySelector(".filter-bar").clientHeight + e : e;
|
2152
|
-
return
|
2189
|
+
return _i(), t.setAttribute("d4-status", "open"), t.setAttribute("d4-default-height", o()), t.style.cssText = `--maxHeight: ${o()}px;`, t.s.dropdownEl.style.cssText = `
|
2153
2190
|
height: ${o()}px;
|
2154
2191
|
z-index: 2;
|
2155
2192
|
`, this;
|
@@ -2171,14 +2208,14 @@ class Ai extends HTMLElement {
|
|
2171
2208
|
this.__events__.selectOption();
|
2172
2209
|
}
|
2173
2210
|
}
|
2174
|
-
|
2175
|
-
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this,
|
2176
|
-
},
|
2177
|
-
this.s.childDom = this.childNodes, this.s.template =
|
2178
|
-
},
|
2211
|
+
It = new WeakSet(), $i = function() {
|
2212
|
+
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this, Ot, xi).call(this);
|
2213
|
+
}, Ot = new WeakSet(), xi = function() {
|
2214
|
+
this.s.childDom = this.childNodes, this.s.template = Is(this), this.innerHTML = "", this.append(this.s.template), d(this, Pt, Ci).call(this);
|
2215
|
+
}, Pt = new WeakSet(), Ci = function() {
|
2179
2216
|
var s;
|
2180
2217
|
const t = this;
|
2181
|
-
t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.s.selectDisplayEl = t.querySelector(".select-display"), t.s.dropdownEl = t.querySelector(".dropdown"), t.s.selectType = t.hasAttribute("multiple") ? "multiple" : "single", t.s.cityLang = t.hasAttribute("city-lang") ? t.getAttribute("city-lang") : "zh-tw",
|
2218
|
+
t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.s.selectDisplayEl = t.querySelector(".select-display"), t.s.dropdownEl = t.querySelector(".dropdown"), t.s.selectType = t.hasAttribute("multiple") ? "multiple" : "single", t.s.cityLang = t.hasAttribute("city-lang") ? t.getAttribute("city-lang") : "zh-tw", Ps(t), t.s.subDropdownTotalH = 0;
|
2182
2219
|
const e = t.getAttribute("d4-value");
|
2183
2220
|
switch (t.s.selectType) {
|
2184
2221
|
case "single":
|
@@ -2187,14 +2224,14 @@ Mt = new WeakSet(), Si = function() {
|
|
2187
2224
|
const r = document.querySelector(`dropdown-el[dist-select="${t.id}"]`), l = r ? r.getAttribute("d4-value") !== "" : !1;
|
2188
2225
|
if (r && l) {
|
2189
2226
|
const c = r.getAttribute("d4-value");
|
2190
|
-
if (
|
2227
|
+
if (Ns(t, c), t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.classList.remove("disabled"), t.getAttribute("d4-value") !== "") {
|
2191
2228
|
const u = e.split(",")[1];
|
2192
2229
|
o = t.querySelector(`.dropdown-list li[data-option="${u}"]`), t.setAttribute("d4-value", u);
|
2193
2230
|
}
|
2194
2231
|
}
|
2195
2232
|
} else
|
2196
2233
|
o = t.querySelector(`.dropdown-list li[data-option="${e}"]`);
|
2197
|
-
|
2234
|
+
w(o) ? (o.classList.add("active"), t.s.activeLi = o, t.s.value = {
|
2198
2235
|
index: [...t.s.allLi].indexOf(o),
|
2199
2236
|
id: e,
|
2200
2237
|
el: o
|
@@ -2208,7 +2245,7 @@ Mt = new WeakSet(), Si = function() {
|
|
2208
2245
|
const a = [];
|
2209
2246
|
e.split(",").forEach((r) => {
|
2210
2247
|
const l = t.querySelector(`.dropdown-list li[data-option="${r}"]`);
|
2211
|
-
|
2248
|
+
w(l) && a.push(l);
|
2212
2249
|
}), a.length > 0 ? t.s.value = {
|
2213
2250
|
index: a.map((r) => [...t.s.allLi].indexOf(r)),
|
2214
2251
|
id: a.map((r) => r.getAttribute("data-option")),
|
@@ -2220,8 +2257,8 @@ Mt = new WeakSet(), Si = function() {
|
|
2220
2257
|
};
|
2221
2258
|
break;
|
2222
2259
|
}
|
2223
|
-
|
2224
|
-
},
|
2260
|
+
x(t, t.s.value.index), d(s = t, Nt, Hi).call(s), t.classList.add("d4-initialize");
|
2261
|
+
}, Nt = new WeakSet(), Hi = function() {
|
2225
2262
|
const t = this;
|
2226
2263
|
t.__events__.dropdownToggle = () => {
|
2227
2264
|
t.addEventListener("click", function(e) {
|
@@ -2243,8 +2280,8 @@ Mt = new WeakSet(), Si = function() {
|
|
2243
2280
|
const r = t.querySelector(".dropdown-scroller"), l = () => {
|
2244
2281
|
if (t.__scroller__) {
|
2245
2282
|
const { viewport: c } = t.__scroller__.elements();
|
2246
|
-
if (
|
2247
|
-
const u = t.s.activeLi.clientHeight / 2,
|
2283
|
+
if (w(t.s.activeLi)) {
|
2284
|
+
const u = t.s.activeLi.clientHeight / 2, p = t.s.activeLi.offsetTop, m = p - r.clientHeight / 2 + u > 0 ? p - r.clientHeight / 2 + u : 0;
|
2248
2285
|
c.scrollTo({
|
2249
2286
|
top: m,
|
2250
2287
|
behavior: "smooth"
|
@@ -2267,7 +2304,7 @@ Mt = new WeakSet(), Si = function() {
|
|
2267
2304
|
t.s.dropdownEl.addEventListener("transitionend", e);
|
2268
2305
|
}, t.__events__.bindScrollbar = (e = this) => {
|
2269
2306
|
const s = e.querySelector(".dropdown-scroller");
|
2270
|
-
e.__scroller__ =
|
2307
|
+
e.__scroller__ = Me(s, {
|
2271
2308
|
overflowBehavior: {
|
2272
2309
|
x: "hidden"
|
2273
2310
|
}
|
@@ -2278,33 +2315,33 @@ Mt = new WeakSet(), Si = function() {
|
|
2278
2315
|
e.s.allLi = e.querySelectorAll(".dropdown-list li"), e.s.allLi.forEach((l) => {
|
2279
2316
|
l.addEventListener("click", function(c) {
|
2280
2317
|
var g;
|
2281
|
-
const u = this,
|
2318
|
+
const u = this, p = [...e.s.allLi].indexOf(u), m = parseInt(e.getAttribute("d4-default-height"));
|
2282
2319
|
if (u.classList.contains("has-sublayer")) {
|
2283
2320
|
c.stopPropagation();
|
2284
|
-
const v = u.querySelector(".sub-dropdown"),
|
2285
|
-
v.style.cssText = `--height: ${
|
2286
|
-
const H = parseInt(v.style.cssText.replace("--height:", "").trim()), G = parseInt(getComputedStyle(a).maxHeight),
|
2321
|
+
const v = u.querySelector(".sub-dropdown"), b = v.querySelector(".sub-dropdown-list"), y = parseInt(getComputedStyle(b).marginTop) + parseInt(getComputedStyle(b).marginBottom);
|
2322
|
+
v.style.cssText = `--height: ${b.offsetHeight + y}px`;
|
2323
|
+
const H = parseInt(v.style.cssText.replace("--height:", "").trim()), G = parseInt(getComputedStyle(a).maxHeight), S = () => {
|
2287
2324
|
s = m + e.s.subDropdownTotalH, o = s > G ? G : s, e.style.cssText = `--maxHeight: ${o}px;`, e.s.dropdownEl.style.height = `${o}px`;
|
2288
2325
|
};
|
2289
|
-
u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -= H,
|
2326
|
+
u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -= H, S()) : (u.classList.add("open"), e.s.subDropdownTotalH += H, S());
|
2290
2327
|
const X = () => {
|
2291
2328
|
e.__scroller__.update(!0), v.removeEventListener("transitionend", X);
|
2292
2329
|
};
|
2293
2330
|
v.addEventListener("transitionend", X);
|
2294
2331
|
} else
|
2295
|
-
switch (
|
2332
|
+
switch (Os(e), e.s.selectType) {
|
2296
2333
|
case "single":
|
2297
2334
|
if (e.setAttribute("d4-value", u.getAttribute("data-option")), r) {
|
2298
|
-
const v = e.s.cityLang,
|
2299
|
-
|
2300
|
-
const
|
2301
|
-
|
2302
|
-
}), e.__events__.selectOption(
|
2335
|
+
const v = e.s.cityLang, b = l.textContent.trim(), y = document.getElementById(e.getAttribute("dist-select"));
|
2336
|
+
y && (y.querySelector(".dropdown-list").textContent = "", x(y, -1), Oe[v][b].forEach((H, G) => {
|
2337
|
+
const S = document.createElement("li");
|
2338
|
+
S.textContent = H[0], S.setAttribute("data-option", H[0]), y.querySelector(".dropdown-list").append(S);
|
2339
|
+
}), e.__events__.selectOption(y));
|
2303
2340
|
}
|
2304
2341
|
(g = u.parentNode.closest("li")) != null && g.classList.contains("has-sublayer") && (c.stopPropagation(), e.close());
|
2305
2342
|
break;
|
2306
2343
|
case "multiple":
|
2307
|
-
c.stopPropagation(), u.classList.toggle("active"),
|
2344
|
+
c.stopPropagation(), u.classList.toggle("active"), x(e, p);
|
2308
2345
|
break;
|
2309
2346
|
}
|
2310
2347
|
});
|
@@ -2337,8 +2374,8 @@ Mt = new WeakSet(), Si = function() {
|
|
2337
2374
|
});
|
2338
2375
|
}, t.__events__.dropdownToggle(), t.__events__.bindScrollbar(), t.__events__.selectOption(), t.__events__.filterHandler(), t.__events__.removeTag(), t.__events__.transitionend();
|
2339
2376
|
};
|
2340
|
-
Object.assign(
|
2341
|
-
customElements.define("dropdown-el",
|
2377
|
+
Object.assign(ki.prototype, O);
|
2378
|
+
customElements.define("dropdown-el", ki);
|
2342
2379
|
function ct(n) {
|
2343
2380
|
const i = {};
|
2344
2381
|
return [...n.attributes].forEach((t) => {
|
@@ -2348,7 +2385,7 @@ function ct(n) {
|
|
2348
2385
|
}
|
2349
2386
|
}), Object.keys(i).length === 0 ? null : i;
|
2350
2387
|
}
|
2351
|
-
function
|
2388
|
+
function Be(n) {
|
2352
2389
|
if (ct(n)) {
|
2353
2390
|
let i;
|
2354
2391
|
const t = Object.keys(ct(n)).map((e) => ({
|
@@ -2364,7 +2401,7 @@ function ze(n) {
|
|
2364
2401
|
} else
|
2365
2402
|
return n.s.options.duration;
|
2366
2403
|
}
|
2367
|
-
function
|
2404
|
+
function zs(n) {
|
2368
2405
|
const { behavior: i, continual: t, gap: e } = n.s.options, s = n.childNodes, o = document.createElement("div"), a = document.createElement("div");
|
2369
2406
|
o.className = "animate-container", a.className = "animate-item", [...s].forEach((l) => {
|
2370
2407
|
a.append(l);
|
@@ -2375,7 +2412,7 @@ function Os(n) {
|
|
2375
2412
|
}
|
2376
2413
|
n.s.animation = null, n.s.animateEl = a, n.textContent = "", o.append(a), n.append(o), a.clientWidth * 2 + e >= n.clientWidth ? i === "normal" && t && o.append(r()) : n.s.options.continual = !1;
|
2377
2414
|
}
|
2378
|
-
function
|
2415
|
+
function _(n) {
|
2379
2416
|
const { behavior: i, direction: t, continual: e } = n.s.options;
|
2380
2417
|
let s = {};
|
2381
2418
|
switch (i) {
|
@@ -2431,20 +2468,20 @@ function D(n) {
|
|
2431
2468
|
}
|
2432
2469
|
return s;
|
2433
2470
|
}
|
2434
|
-
function
|
2471
|
+
function Ws(n) {
|
2435
2472
|
let i;
|
2436
2473
|
return function(t) {
|
2437
2474
|
i && clearTimeout(i), i = setTimeout(n, 200, t);
|
2438
2475
|
};
|
2439
2476
|
}
|
2440
|
-
var
|
2441
|
-
class
|
2477
|
+
var jt, Mi, zt, qi, Wt, Ii, Bt, Oi;
|
2478
|
+
class Bs extends HTMLElement {
|
2442
2479
|
constructor() {
|
2443
2480
|
super();
|
2444
|
-
|
2445
|
-
|
2446
|
-
|
2447
|
-
|
2481
|
+
h(this, jt);
|
2482
|
+
h(this, zt);
|
2483
|
+
h(this, Wt);
|
2484
|
+
h(this, Bt);
|
2448
2485
|
this.initialize = !1;
|
2449
2486
|
}
|
2450
2487
|
static get observedAttributes() {
|
@@ -2453,7 +2490,7 @@ class Ps extends HTMLElement {
|
|
2453
2490
|
attributeChangedCallback(t, e, s) {
|
2454
2491
|
}
|
2455
2492
|
connectedCallback() {
|
2456
|
-
this.initialize || (this.initialize = !0, d(this,
|
2493
|
+
this.initialize || (this.initialize = !0, d(this, jt, Mi).call(this));
|
2457
2494
|
}
|
2458
2495
|
play() {
|
2459
2496
|
this.s.animation.play(), this.s.animateEl.classList.add("start"), this.s.options.continual && (this.s.cloneAnimation.play(), this.s.cloneAnimateEl.classList.add("start"));
|
@@ -2462,25 +2499,25 @@ class Ps extends HTMLElement {
|
|
2462
2499
|
this.s.animation.pause(), this.s.options.continual && this.s.cloneAnimation.pause();
|
2463
2500
|
}
|
2464
2501
|
}
|
2465
|
-
|
2502
|
+
jt = new WeakSet(), Mi = function() {
|
2466
2503
|
const t = {
|
2467
|
-
direction: this.getAttribute("direction") ||
|
2504
|
+
direction: this.getAttribute("direction") || $.SETTINGS.direction,
|
2468
2505
|
// up / down / left / right
|
2469
|
-
behavior: this.getAttribute("behavior") ||
|
2506
|
+
behavior: this.getAttribute("behavior") || $.SETTINGS.behavior,
|
2470
2507
|
// normal / alternate / endStop
|
2471
|
-
duration: Number(this.getAttribute("duration")) ||
|
2508
|
+
duration: Number(this.getAttribute("duration")) || $.SETTINGS.duration,
|
2472
2509
|
// ms
|
2473
|
-
durationBreakpoints: ct(this) ||
|
2474
|
-
autoplay: this.getAttribute("autoplay") ||
|
2510
|
+
durationBreakpoints: ct(this) || $.SETTINGS.durationBreakpoints,
|
2511
|
+
autoplay: this.getAttribute("autoplay") || $.SETTINGS.autoplay,
|
2475
2512
|
// normal / alternate / endStop
|
2476
|
-
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" :
|
2513
|
+
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : $.SETTINGS.pauseOnMouseenter,
|
2477
2514
|
// true / false
|
2478
|
-
continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" :
|
2515
|
+
continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" : $.SETTINGS.continual,
|
2479
2516
|
// true / false
|
2480
|
-
gap: Number(this.getAttribute("gap")) ||
|
2517
|
+
gap: Number(this.getAttribute("gap")) || $.SETTINGS.gap
|
2481
2518
|
};
|
2482
|
-
this.s = {}, this.s.options = t, this.s.nowDuration =
|
2483
|
-
},
|
2519
|
+
this.s = {}, this.s.options = t, this.s.nowDuration = Be(this), zs(this), d(this, zt, qi).call(this);
|
2520
|
+
}, zt = new WeakSet(), qi = function() {
|
2484
2521
|
const { direction: t, continual: e, gap: s } = this.s.options;
|
2485
2522
|
switch (t) {
|
2486
2523
|
case "left":
|
@@ -2492,17 +2529,17 @@ Nt = new WeakSet(), $i = function() {
|
|
2492
2529
|
e ? this.style.cssText = `height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${s}px;` : this.style.cssText = `min-height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${s}px;`;
|
2493
2530
|
break;
|
2494
2531
|
}
|
2495
|
-
d(this,
|
2496
|
-
},
|
2532
|
+
d(this, Wt, Ii).call(this), d(this, Bt, Oi).call(this), e && this.classList.add("continual"), this.classList.add("m4-initialize");
|
2533
|
+
}, Wt = new WeakSet(), Ii = function() {
|
2497
2534
|
const t = this, { direction: e, behavior: s, duration: o, autoplay: a, pauseOnMouseenter: r, continual: l } = t.s.options;
|
2498
2535
|
let c;
|
2499
2536
|
function u() {
|
2500
2537
|
switch (s) {
|
2501
2538
|
case "normal":
|
2502
|
-
t.s.animateEl.style.transform = `${
|
2539
|
+
t.s.animateEl.style.transform = `${_(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(_(t).animate1, {
|
2503
2540
|
duration: t.s.nowDuration,
|
2504
2541
|
iterations: 1 / 0
|
2505
|
-
}), l && (t.s.cloneAnimateEl.style.transform = `${
|
2542
|
+
}), l && (t.s.cloneAnimateEl.style.transform = `${_(t).animate2[0].transform}`, t.s.cloneAnimation = t.s.cloneAnimateEl.animate(_(t).animate2, {
|
2506
2543
|
duration: t.s.nowDuration,
|
2507
2544
|
delay: -t.s.nowDuration / 2,
|
2508
2545
|
iterations: 1 / 0
|
@@ -2513,25 +2550,25 @@ Nt = new WeakSet(), $i = function() {
|
|
2513
2550
|
let v = [];
|
2514
2551
|
switch (e) {
|
2515
2552
|
case "top":
|
2516
|
-
|
2553
|
+
p = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), m = parseInt(t.s.nowDuration / (p * 2)) * t.s.animateEl.scrollHeight, v = [{ transform: `translate3d(0,${t.clientHeight}px,0)` }, { transform: `translate3d(0,calc(${t.clientHeight}px - 100%),0)` }];
|
2517
2554
|
break;
|
2518
2555
|
case "right":
|
2519
|
-
|
2556
|
+
p = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), m = parseInt(t.s.nowDuration / (p * 2)) * t.s.animateEl.scrollWidth, v = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(0,0,0)" }];
|
2520
2557
|
break;
|
2521
2558
|
case "bottom":
|
2522
|
-
|
2559
|
+
p = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), m = parseInt(o / (p * 2)) * t.s.animateEl.scrollHeight, v = [{ transform: "translate3d(0,-100%,0)" }, { transform: "translate3d(0,0,0)" }];
|
2523
2560
|
break;
|
2524
2561
|
case "left":
|
2525
|
-
|
2562
|
+
p = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), m = parseInt(o / (p * 2)) * t.s.animateEl.scrollWidth, v = [{ transform: `translate3d(${t.clientWidth}px,0,0)` }, { transform: `translate3d(calc(-100% + ${t.clientWidth}px),0,0)` }];
|
2526
2563
|
break;
|
2527
2564
|
}
|
2528
2565
|
return v;
|
2529
|
-
},
|
2566
|
+
}, p, m;
|
2530
2567
|
(t.clientHeight > t.s.animateEl.scrollHeight || e === "left" || e === "right") && (t.s.animateEl.style.transform = `${g()[0].transform}`, t.s.animateEl.animate(g(), {
|
2531
2568
|
duration: m,
|
2532
2569
|
fill: "forwards"
|
2533
2570
|
}).finished.then(() => {
|
2534
|
-
t.s.animation = t.s.animateEl.animate(
|
2571
|
+
t.s.animation = t.s.animateEl.animate(_(t).animate1, {
|
2535
2572
|
duration: t.s.nowDuration,
|
2536
2573
|
iterations: 1 / 0
|
2537
2574
|
});
|
@@ -2540,7 +2577,7 @@ Nt = new WeakSet(), $i = function() {
|
|
2540
2577
|
});
|
2541
2578
|
break;
|
2542
2579
|
case "endStop":
|
2543
|
-
t.s.animateEl.style.transform = `${
|
2580
|
+
t.s.animateEl.style.transform = `${_(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(_(t).animate1, {
|
2544
2581
|
duration: t.s.nowDuration,
|
2545
2582
|
fill: "forwards"
|
2546
2583
|
});
|
@@ -2558,28 +2595,28 @@ Nt = new WeakSet(), $i = function() {
|
|
2558
2595
|
}), t.addEventListener("mouseleave", function() {
|
2559
2596
|
t.s.animation && r && t.s.animation.playState === "paused" && t.play();
|
2560
2597
|
});
|
2561
|
-
},
|
2598
|
+
}, Bt = new WeakSet(), Oi = function() {
|
2562
2599
|
const t = this;
|
2563
2600
|
function e() {
|
2564
2601
|
const s = t.s.animation.startTime, o = t.s.cloneAnimation ? t.s.cloneAnimation.startTime : null;
|
2565
|
-
t.s.nowDuration =
|
2602
|
+
t.s.nowDuration = Be(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(_(t).animate1, {
|
2566
2603
|
duration: t.s.nowDuration,
|
2567
2604
|
iterations: 1 / 0
|
2568
|
-
}), t.s.animation.startTime = s, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(
|
2605
|
+
}), t.s.animation.startTime = s, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(_(t).animate2, {
|
2569
2606
|
duration: t.s.nowDuration,
|
2570
2607
|
delay: -t.s.nowDuration / 2,
|
2571
2608
|
iterations: 1 / 0
|
2572
2609
|
}), t.s.cloneAnimation.startTime = o);
|
2573
2610
|
}
|
2574
|
-
window.addEventListener("resize",
|
2611
|
+
window.addEventListener("resize", Ws(e));
|
2575
2612
|
};
|
2576
|
-
customElements.define("marquee-el",
|
2613
|
+
customElements.define("marquee-el", Bs);
|
2577
2614
|
const ht = function(n, i) {
|
2578
2615
|
let t;
|
2579
2616
|
return function(e) {
|
2580
2617
|
t && clearTimeout(t), t = setTimeout(n, 200, e);
|
2581
2618
|
};
|
2582
|
-
},
|
2619
|
+
}, k = (n, i) => {
|
2583
2620
|
if (rt(n)) {
|
2584
2621
|
n.forEach((t) => {
|
2585
2622
|
t.classList.add(i);
|
@@ -2587,7 +2624,7 @@ const ht = function(n, i) {
|
|
2587
2624
|
return;
|
2588
2625
|
}
|
2589
2626
|
n.classList.add(i);
|
2590
|
-
},
|
2627
|
+
}, D = (n, i) => {
|
2591
2628
|
if (rt(n)) {
|
2592
2629
|
n.forEach((t) => {
|
2593
2630
|
t.classList.remove(i);
|
@@ -2596,22 +2633,22 @@ const ht = function(n, i) {
|
|
2596
2633
|
}
|
2597
2634
|
n.classList.remove(i);
|
2598
2635
|
};
|
2599
|
-
var
|
2600
|
-
class
|
2636
|
+
var Gt, Pi, Xt, Ni, Rt, ji, tt, _e, W, dt, Ft, zi;
|
2637
|
+
class Ge {
|
2601
2638
|
constructor(i) {
|
2602
2639
|
// 初始化
|
2603
|
-
|
2640
|
+
h(this, Gt);
|
2604
2641
|
// 左右箭頭事件綁定
|
2605
|
-
|
2642
|
+
h(this, Xt);
|
2606
2643
|
// 左右拖拉事件綁定
|
2607
|
-
|
2644
|
+
h(this, Rt);
|
2608
2645
|
// 卷軸位置判斷
|
2609
|
-
|
2646
|
+
h(this, tt);
|
2610
2647
|
// 隱藏按鈕判斷
|
2611
|
-
|
2648
|
+
h(this, W);
|
2612
2649
|
// 選項事件綁定
|
2613
|
-
|
2614
|
-
this.$element = i, this.option = i.s.option.drag, d(this,
|
2650
|
+
h(this, Ft);
|
2651
|
+
this.$element = i, this.option = i.s.option.drag, d(this, Gt, Pi).call(this);
|
2615
2652
|
}
|
2616
2653
|
// 更新 active 位置
|
2617
2654
|
update(i) {
|
@@ -2625,7 +2662,7 @@ class We {
|
|
2625
2662
|
}
|
2626
2663
|
}
|
2627
2664
|
}
|
2628
|
-
|
2665
|
+
Gt = new WeakSet(), Pi = function() {
|
2629
2666
|
var e, s, o, a, r, l;
|
2630
2667
|
const i = this;
|
2631
2668
|
if (!i.$element)
|
@@ -2633,10 +2670,10 @@ Wt = new WeakSet(), Mi = function() {
|
|
2633
2670
|
i.$container = i.$element.querySelector(".drag-container"), i.$wrapper = i.$container.querySelector(".wrapper");
|
2634
2671
|
const t = () => {
|
2635
2672
|
var c, u;
|
2636
|
-
d(c = i, tt,
|
2673
|
+
d(c = i, tt, _e).call(c), d(u = i, W, dt).call(u);
|
2637
2674
|
};
|
2638
|
-
i.$wrapper.removeEventListener("scroll", t), i.$wrapper.addEventListener("scroll", t), window.removeEventListener("resize", ht(t)), window.addEventListener("resize", ht(t)), (i.option.draggable || i.$element.s.type == "collapse") && d(e = i,
|
2639
|
-
|
2675
|
+
i.$wrapper.removeEventListener("scroll", t), i.$wrapper.addEventListener("scroll", t), window.removeEventListener("resize", ht(t)), window.addEventListener("resize", ht(t)), (i.option.draggable || i.$element.s.type == "collapse") && d(e = i, Rt, ji).call(e), i.option.navigation && i.$element.s.type !== "collapse" && (i.$container.insertAdjacentHTML(
|
2676
|
+
E.prepend,
|
2640
2677
|
`<div class="navigation">
|
2641
2678
|
<div class="button prev">
|
2642
2679
|
<div></div>
|
@@ -2645,8 +2682,8 @@ Wt = new WeakSet(), Mi = function() {
|
|
2645
2682
|
<div></div>
|
2646
2683
|
</div>
|
2647
2684
|
</div>`
|
2648
|
-
), i.$button = (s = i.$container) == null ? void 0 : s.querySelectorAll(".button"), d(o = i,
|
2649
|
-
},
|
2685
|
+
), i.$button = (s = i.$container) == null ? void 0 : s.querySelectorAll(".button"), d(o = i, Xt, Ni).call(o)), d(a = i, tt, _e).call(a), d(r = i, W, dt).call(r), d(l = i, Ft, zi).call(l), i.update();
|
2686
|
+
}, Xt = new WeakSet(), Ni = function() {
|
2650
2687
|
const i = this, { $wrapper: t, $button: e } = i, s = function() {
|
2651
2688
|
const o = this.classList.contains("next"), a = parseInt(t.getBoundingClientRect().width * 0.7);
|
2652
2689
|
t.scrollTo({
|
@@ -2660,62 +2697,62 @@ Wt = new WeakSet(), Mi = function() {
|
|
2660
2697
|
e.forEach((o) => {
|
2661
2698
|
o.removeEventListener("click", s), o.addEventListener("click", s);
|
2662
2699
|
});
|
2663
|
-
},
|
2700
|
+
}, Rt = new WeakSet(), ji = function() {
|
2664
2701
|
const { $wrapper: i } = this;
|
2665
2702
|
let t = !1, e = !1, s = 0, o = 0;
|
2666
|
-
const a = function(
|
2667
|
-
|
2703
|
+
const a = function(p) {
|
2704
|
+
p.preventDefault(), e = !1, t = !0, s = p.pageX - i.offsetLeft, o = i.scrollLeft;
|
2668
2705
|
};
|
2669
2706
|
i.removeEventListener("mousedown", a), i.addEventListener("mousedown", a);
|
2670
2707
|
const r = function() {
|
2671
2708
|
e = !1, t = !1;
|
2672
2709
|
};
|
2673
2710
|
i.removeEventListener("mouseleave", r), i.addEventListener("mouseleave", r);
|
2674
|
-
const l = function(
|
2675
|
-
|
2711
|
+
const l = function(p) {
|
2712
|
+
p.preventDefault(), t = !1;
|
2676
2713
|
};
|
2677
2714
|
i.removeEventListener("mouseup", l), i.addEventListener("mouseup", l);
|
2678
|
-
const c = function(
|
2679
|
-
if (
|
2715
|
+
const c = function(p) {
|
2716
|
+
if (p.preventDefault(), e = !0, !t)
|
2680
2717
|
return;
|
2681
|
-
const g =
|
2718
|
+
const g = p.pageX - i.offsetLeft - s;
|
2682
2719
|
i.scrollTo({
|
2683
2720
|
left: o - g
|
2684
2721
|
});
|
2685
2722
|
};
|
2686
2723
|
i.removeEventListener("mousemove", c), i.addEventListener("mousemove", c);
|
2687
|
-
const u = function(
|
2688
|
-
e && (
|
2724
|
+
const u = function(p) {
|
2725
|
+
e && (p.preventDefault(), p.stopPropagation());
|
2689
2726
|
};
|
2690
|
-
i.querySelectorAll("a").forEach((
|
2691
|
-
|
2727
|
+
i.querySelectorAll("a").forEach((p) => {
|
2728
|
+
p.removeEventListener("click", u), p.addEventListener("click", u);
|
2692
2729
|
});
|
2693
|
-
}, tt = new WeakSet(),
|
2730
|
+
}, tt = new WeakSet(), _e = function() {
|
2694
2731
|
const { $container: i, $wrapper: t } = this, e = t.scrollWidth - t.clientWidth, s = t.scrollLeft;
|
2695
|
-
e <= 0 || (
|
2732
|
+
e <= 0 || (k(i, "scrollable"), s == 0 ? (D(i, "scrollable"), k(t, "start"), D(t, "end")) : s >= e ? (D(i, "scrollable"), D(t, "start"), k(t, "end")) : (k(t, "center"), D(t, "start"), D(t, "end")));
|
2696
2733
|
}, W = new WeakSet(), dt = function() {
|
2697
2734
|
const { $wrapper: i, $button: t, $element: e } = this;
|
2698
2735
|
if (!t)
|
2699
2736
|
return;
|
2700
2737
|
const s = i.scrollWidth - i.clientWidth, o = i.scrollLeft;
|
2701
2738
|
if (s <= 0) {
|
2702
|
-
|
2739
|
+
k(t, "hide"), D(t, "active"), k(e, "noScrollable");
|
2703
2740
|
return;
|
2704
2741
|
}
|
2705
|
-
s > 0 && (
|
2742
|
+
s > 0 && (k(t, "active"), D(e, "noScrollable")), o == 0 ? t.forEach((a) => {
|
2706
2743
|
if (a.classList.contains("next")) {
|
2707
|
-
|
2744
|
+
D(a, "hide");
|
2708
2745
|
return;
|
2709
2746
|
}
|
2710
|
-
|
2747
|
+
k(a, "hide");
|
2711
2748
|
}) : o >= s ? t.forEach((a) => {
|
2712
2749
|
if (a.classList.contains("next")) {
|
2713
|
-
|
2750
|
+
k(a, "hide");
|
2714
2751
|
return;
|
2715
2752
|
}
|
2716
|
-
|
2717
|
-
}) :
|
2718
|
-
},
|
2753
|
+
D(a, "hide");
|
2754
|
+
}) : D(t, "hide");
|
2755
|
+
}, Ft = new WeakSet(), zi = function() {
|
2719
2756
|
const { $element: i } = this, t = (s) => {
|
2720
2757
|
if (this.option.selected) {
|
2721
2758
|
const o = s.getAttribute("data-option").trim();
|
@@ -2729,31 +2766,31 @@ Wt = new WeakSet(), Mi = function() {
|
|
2729
2766
|
s.removeEventListener("click", e), s.addEventListener("click", e);
|
2730
2767
|
});
|
2731
2768
|
};
|
2732
|
-
var
|
2733
|
-
class
|
2769
|
+
var Yt, Wi, Ut, Bi, Jt, Gi, Zt, Xi;
|
2770
|
+
class Gs {
|
2734
2771
|
constructor(i) {
|
2735
2772
|
// 初始化
|
2736
|
-
|
2773
|
+
h(this, Yt);
|
2737
2774
|
// 隱藏按鈕判斷
|
2738
|
-
|
2775
|
+
h(this, Ut);
|
2739
2776
|
// 展開箭頭事件綁定
|
2740
|
-
|
2777
|
+
h(this, Jt);
|
2741
2778
|
// 選項事件綁定
|
2742
|
-
|
2743
|
-
this.$element = i, this.option = i.s.option.collapse, d(this,
|
2779
|
+
h(this, Zt);
|
2780
|
+
this.$element = i, this.option = i.s.option.collapse, d(this, Yt, Wi).call(this);
|
2744
2781
|
}
|
2745
2782
|
}
|
2746
|
-
|
2747
|
-
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this,
|
2748
|
-
},
|
2783
|
+
Yt = new WeakSet(), Wi = function() {
|
2784
|
+
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this, Ut, Bi).call(this) && d(this, Jt, Gi).call(this), d(this, Zt, Xi).call(this));
|
2785
|
+
}, Ut = new WeakSet(), Bi = function() {
|
2749
2786
|
const i = this.$element.querySelector(".drag-container"), t = i.querySelector(".wrapper");
|
2750
|
-
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(
|
2751
|
-
},
|
2787
|
+
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(E.append, '<div class="open-collapse"></div>'), this.$button = i.querySelector(".open-collapse"), !0) : !1;
|
2788
|
+
}, Jt = new WeakSet(), Gi = function() {
|
2752
2789
|
const { $element: i, $button: t } = this, e = function() {
|
2753
2790
|
i.classList.contains("expand") ? i.classList.remove("expand") : i.classList.add("expand");
|
2754
2791
|
};
|
2755
2792
|
t.removeEventListener("click", e), t.addEventListener("click", e);
|
2756
|
-
},
|
2793
|
+
}, Zt = new WeakSet(), Xi = function() {
|
2757
2794
|
const { $element: i } = this, t = (s, o) => {
|
2758
2795
|
if (i != null && i.classList.contains("expand") ? i == null || i.classList.remove("expand") : i == null || i.classList.add("expand"), this.option.selected) {
|
2759
2796
|
const a = s.getAttribute("data-option").trim();
|
@@ -2767,20 +2804,20 @@ Rt = new WeakSet(), Ni = function() {
|
|
2767
2804
|
s.removeEventListener("click", e), s.addEventListener("click", e);
|
2768
2805
|
});
|
2769
2806
|
};
|
2770
|
-
const
|
2807
|
+
const Xs = (n) => {
|
2771
2808
|
const { type: i, option: t, originalDomString: e } = n.s, s = document.createElement("div");
|
2772
|
-
return i == "drag" && (s.innerHTML =
|
2809
|
+
return i == "drag" && (s.innerHTML = C.TEMPLATE[i]().trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(E.append, e)), i == "collapse" && (s.innerHTML = C.TEMPLATE[i](t == null ? void 0 : t.collapse).trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(E.append, e), s.querySelector(".collapse-container .wrapper").insertAdjacentHTML(E.append, e)), i == "dropdown" && (s.innerHTML = C.TEMPLATE[i](t == null ? void 0 : t.dropdown).trim(), s.querySelector("dropdown-el").insertAdjacentHTML(E.append, e)), s.children;
|
2773
2810
|
};
|
2774
|
-
var
|
2775
|
-
class
|
2811
|
+
var Qt, Ri, Vt, Fi, et, ke, B, ut;
|
2812
|
+
class Rs extends HTMLElement {
|
2776
2813
|
constructor() {
|
2777
2814
|
super();
|
2778
|
-
|
2779
|
-
|
2815
|
+
h(this, Qt);
|
2816
|
+
h(this, Vt);
|
2780
2817
|
// 斷點設定
|
2781
|
-
|
2818
|
+
h(this, et);
|
2782
2819
|
// check type
|
2783
|
-
|
2820
|
+
h(this, B);
|
2784
2821
|
this.initialize = !1, this.__events__ = {}, this.s = {}, this.s.originalDomString = this.innerHTML.trim().replace(/\n/g, ""), this.previousWidth = window.innerWidth;
|
2785
2822
|
}
|
2786
2823
|
static get observedAttributes() {
|
@@ -2809,15 +2846,15 @@ class Ws extends HTMLElement {
|
|
2809
2846
|
}
|
2810
2847
|
}
|
2811
2848
|
connectedCallback() {
|
2812
|
-
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this,
|
2849
|
+
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this, Qt, Ri).call(this));
|
2813
2850
|
}
|
2814
2851
|
update() {
|
2815
|
-
d(this, et,
|
2852
|
+
d(this, et, ke).call(this);
|
2816
2853
|
}
|
2817
2854
|
}
|
2818
|
-
|
2855
|
+
Qt = new WeakSet(), Ri = function() {
|
2819
2856
|
let t = {};
|
2820
|
-
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ??
|
2857
|
+
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"));
|
2821
2858
|
const e = (s) => {
|
2822
2859
|
if (s.type === "resize") {
|
2823
2860
|
if (window.innerWidth === this.previousWidth)
|
@@ -2826,10 +2863,10 @@ Jt = new WeakSet(), Wi = function() {
|
|
2826
2863
|
}
|
2827
2864
|
this.update();
|
2828
2865
|
};
|
2829
|
-
window.removeEventListener("resize", ht(e)), window.addEventListener("resize", ht(e)), this.s.option = {}, this.s.option.drag = Object.assign({},
|
2830
|
-
},
|
2831
|
-
this.classList.add("m4-init"), d(this, et,
|
2832
|
-
}, et = new WeakSet(),
|
2866
|
+
window.removeEventListener("resize", ht(e)), window.addEventListener("resize", ht(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, C.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, C.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, C.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, C.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint), d(this, Vt, Fi).call(this);
|
2867
|
+
}, Vt = new WeakSet(), Fi = function() {
|
2868
|
+
this.classList.add("m4-init"), d(this, et, ke).call(this);
|
2869
|
+
}, et = new WeakSet(), ke = function() {
|
2833
2870
|
const t = Object.keys(this.s.option.breakpoint);
|
2834
2871
|
if (!t.length) {
|
2835
2872
|
d(this, B, ut).call(this);
|
@@ -2842,72 +2879,72 @@ Jt = new WeakSet(), Wi = function() {
|
|
2842
2879
|
}, B = new WeakSet(), ut = function() {
|
2843
2880
|
var o;
|
2844
2881
|
const { type: t } = this.s;
|
2845
|
-
this.innerHTML = "", [...
|
2882
|
+
this.innerHTML = "", [...Xs(this)].forEach((a) => {
|
2846
2883
|
this.append(a);
|
2847
2884
|
});
|
2848
2885
|
const e = this.querySelector(`.drag-container .item[data-option="${this.getAttribute("m4-status")}"]`), s = this.querySelector(`.collapse-container .item[data-option="${this.getAttribute("m4-status")}"]`);
|
2849
2886
|
switch (e == null || e.classList.add("active"), s == null || s.classList.add("active"), t) {
|
2850
2887
|
case "drag":
|
2851
2888
|
setTimeout(() => {
|
2852
|
-
this.constructor.drag = new
|
2889
|
+
this.constructor.drag = new Ge(this);
|
2853
2890
|
}, 10);
|
2854
2891
|
break;
|
2855
2892
|
case "collapse":
|
2856
2893
|
setTimeout(() => {
|
2857
|
-
this.constructor.drag = new
|
2894
|
+
this.constructor.drag = new Ge(this), this.constructor.collapse = new Gs(this);
|
2858
2895
|
}, 10);
|
2859
2896
|
break;
|
2860
2897
|
}
|
2861
2898
|
(o = this.constructor.drag) == null || o.update(this);
|
2862
2899
|
};
|
2863
|
-
customElements.define("multipurpose-nav",
|
2864
|
-
var
|
2865
|
-
class
|
2900
|
+
customElements.define("multipurpose-nav", Rs);
|
2901
|
+
var Kt, Ui, te, Ji, it, $e, N, F, ee, Zi, ie, Qi, se, Vi, ne, Ki, oe, ts, ae, es, re, is, le, ss, ce, ns, q, z, de, os, ue, as, he, rs, pe, ls;
|
2902
|
+
class Yi extends HTMLElement {
|
2866
2903
|
// 定義組件的初始狀態
|
2867
2904
|
constructor(t, e) {
|
2868
2905
|
super();
|
2869
|
-
|
2870
|
-
|
2906
|
+
h(this, Kt);
|
2907
|
+
h(this, te);
|
2871
2908
|
// 第一關 判斷數量以及id設定
|
2872
|
-
|
2909
|
+
h(this, it);
|
2873
2910
|
// 第二關 id命名提醒
|
2874
|
-
|
2875
|
-
|
2876
|
-
|
2877
|
-
|
2911
|
+
h(this, N);
|
2912
|
+
h(this, ee);
|
2913
|
+
h(this, ie);
|
2914
|
+
h(this, se);
|
2878
2915
|
// 執行函式
|
2879
2916
|
// 移動至指定位置
|
2880
|
-
|
2917
|
+
h(this, ne);
|
2881
2918
|
// 移動
|
2882
|
-
|
2919
|
+
h(this, oe);
|
2883
2920
|
// 步驟狀態
|
2884
|
-
|
2921
|
+
h(this, ae);
|
2885
2922
|
// next 按鈕狀態
|
2886
|
-
|
2923
|
+
h(this, re);
|
2887
2924
|
// prev 按鈕狀態
|
2888
|
-
|
2925
|
+
h(this, le);
|
2889
2926
|
// 頁籤狀態
|
2890
|
-
|
2927
|
+
h(this, ce);
|
2891
2928
|
// 第三關各種元件判斷 及 執行
|
2892
|
-
|
2929
|
+
h(this, q);
|
2893
2930
|
// 消失動畫
|
2894
|
-
|
2931
|
+
h(this, de);
|
2895
2932
|
// 出現動畫
|
2896
|
-
|
2933
|
+
h(this, ue);
|
2897
2934
|
// 狀態
|
2898
|
-
|
2935
|
+
h(this, he);
|
2899
2936
|
// resize
|
2900
|
-
|
2937
|
+
h(this, pe);
|
2901
2938
|
}
|
2902
2939
|
// 當組件的屬性被更改時會被呼叫
|
2903
2940
|
static get observedAttributes() {
|
2904
2941
|
return ["t4-active"];
|
2905
2942
|
}
|
2906
2943
|
attributeChangedCallback(t, e, s) {
|
2907
|
-
t === "t4-active" && e !== s && d(this,
|
2944
|
+
t === "t4-active" && e !== s && d(this, he, rs).call(this, s);
|
2908
2945
|
}
|
2909
2946
|
connectedCallback() {
|
2910
|
-
this.classList.contains("t4-initialize") || d(this,
|
2947
|
+
this.classList.contains("t4-initialize") || d(this, Kt, Ui).call(this);
|
2911
2948
|
}
|
2912
2949
|
// ------------- 我是分隔線呦 -------------
|
2913
2950
|
// 頁籤切換
|
@@ -2921,28 +2958,28 @@ class Gi extends HTMLElement {
|
|
2921
2958
|
setActiveTab(t) {
|
2922
2959
|
const { t: e } = this, s = t === "" ? e.tabPanels[0].getAttribute("t4-id") : t;
|
2923
2960
|
e.activeTab = s, this.setAttribute("t4-active", s);
|
2924
|
-
const o = d(this,
|
2961
|
+
const o = d(this, N, F).call(this, s);
|
2925
2962
|
e.tabPanels.forEach((a, r) => {
|
2926
|
-
r === o ? d(this,
|
2963
|
+
r === o ? d(this, ue, as).call(this, r) : d(this, de, os).call(this, r);
|
2927
2964
|
});
|
2928
2965
|
}
|
2929
2966
|
// 外部呼叫方法 $0.goNext()
|
2930
2967
|
goNext() {
|
2931
|
-
const t = d(this,
|
2968
|
+
const t = d(this, N, F).call(this, this.t.activeTab), e = Math.min(this.t.tabPanels.length - 1, t + 1), s = this.t.tabPanels[e].getAttribute("t4-id");
|
2932
2969
|
this.setActiveTab(s);
|
2933
2970
|
}
|
2934
2971
|
// 外部呼叫方法 $0.goPrev()
|
2935
2972
|
goPrev() {
|
2936
|
-
const t = d(this,
|
2973
|
+
const t = d(this, N, F).call(this, this.t.activeTab), e = Math.max(0, t - 1), s = this.t.tabPanels[e].getAttribute("t4-id");
|
2937
2974
|
this.setActiveTab(s);
|
2938
2975
|
}
|
2939
2976
|
// 外部呼叫方法 $0.update()
|
2940
2977
|
update() {
|
2941
|
-
this.t.tabs = d(this, it,
|
2978
|
+
this.t.tabs = d(this, it, $e).call(this), cs(), console.log("tab update!!!!");
|
2942
2979
|
}
|
2943
2980
|
}
|
2944
|
-
|
2945
|
-
const t = this.getAttribute("t4-name"), { SETTINGS: e } =
|
2981
|
+
Kt = new WeakSet(), Ui = function() {
|
2982
|
+
const t = this.getAttribute("t4-name"), { SETTINGS: e } = Ue;
|
2946
2983
|
document.querySelectorAll(`tab-el[t4-name=${t}]`).length > 1 && console.warn(t, "名字有重複喔!!!"), this.t = {
|
2947
2984
|
tabs: [],
|
2948
2985
|
name: t,
|
@@ -2961,36 +2998,36 @@ Qt = new WeakSet(), Xi = function() {
|
|
2961
2998
|
delay: this.getAttribute("t4-delay") || e.transition.delay
|
2962
2999
|
},
|
2963
3000
|
tabGroup: this.getAttribute("t4-group") || e.tabGroup
|
2964
|
-
}, this.__events__ = {}, this.t.tabs = d(this, it,
|
2965
|
-
},
|
2966
|
-
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this,
|
3001
|
+
}, this.__events__ = {}, this.t.tabs = d(this, it, $e).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this, te, Ji).call(this);
|
3002
|
+
}, te = new WeakSet(), Ji = function() {
|
3003
|
+
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this, ee, Zi).call(this), this.t.recordUrl) {
|
2967
3004
|
const e = new URLSearchParams(document.location.search).get(this.t.name), s = document.querySelectorAll(`[t4-name="${this.t.name}"] .tab-panel[t4-id="${e}"]`);
|
2968
3005
|
e && s.length === 1 ? this.t.activeTab = e : console.warn(`沒有${e}這頁喔!!`);
|
2969
3006
|
}
|
2970
|
-
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this,
|
2971
|
-
}, it = new WeakSet(),
|
3007
|
+
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this, pe, ls).call(this);
|
3008
|
+
}, it = new WeakSet(), $e = function() {
|
2972
3009
|
const { t } = this, e = Array.from(document.querySelectorAll(`[t4-control="${t.name}"][t4-role="tab"]`));
|
2973
3010
|
return t.type === "normal" && t.tabGroup === "true" && t.tabPanels.length !== e.length && console.warn("按鈕與內容數量不同喔", t.tabPanels.length, e.length), t.tabGroup === "true" ? t.tabPanels.forEach((s, o) => s.setAttribute("t4-id", o)) : t.tabPanels.forEach((s) => {
|
2974
3011
|
s.getAttribute("t4-id") || console.warn(s, "請幫我設定id!!");
|
2975
3012
|
}), e;
|
2976
|
-
},
|
3013
|
+
}, N = new WeakSet(), F = function(t) {
|
2977
3014
|
const { t: e } = this, s = e.tabPanels.filter((a) => a.getAttribute("t4-id") === t);
|
2978
3015
|
s.length > 1 && console.warn("有兩個相同id設定", s);
|
2979
3016
|
const o = s[0];
|
2980
3017
|
return o ? e.tabPanels.indexOf(o) : (console.warn(`找不到t4-id為${t}的頁籤`), 0);
|
2981
|
-
},
|
3018
|
+
}, ee = new WeakSet(), Zi = function() {
|
2982
3019
|
const t = document.createElement("div");
|
2983
3020
|
t.classList.add("swiper-container");
|
2984
3021
|
const e = document.createElement("div");
|
2985
3022
|
e.classList.add("swiper-wrapper"), this.t.tabPanels.forEach((s) => {
|
2986
3023
|
e.appendChild(s.cloneNode(!0));
|
2987
|
-
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this,
|
2988
|
-
},
|
3024
|
+
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this, ie, Qi).call(this);
|
3025
|
+
}, ie = new WeakSet(), Qi = function() {
|
2989
3026
|
const t = this.querySelector(".swiper-container"), e = this.querySelector(".swiper-wrapper"), s = this.t.tabPanels;
|
2990
3027
|
t.style.overflow = "hidden", e.style.display = "flex";
|
2991
3028
|
const o = s.length * 100 + "%";
|
2992
3029
|
e.style.width = o;
|
2993
|
-
},
|
3030
|
+
}, se = new WeakSet(), Vi = function(t) {
|
2994
3031
|
const { t: e } = this;
|
2995
3032
|
if (e.recordUrl === "true") {
|
2996
3033
|
const s = new URLSearchParams(document.location.search);
|
@@ -2998,28 +3035,28 @@ Qt = new WeakSet(), Xi = function() {
|
|
2998
3035
|
const o = `${window.location.pathname}?${s.toString()}`;
|
2999
3036
|
history.replaceState({ t4Id: t }, "", o);
|
3000
3037
|
}
|
3001
|
-
},
|
3038
|
+
}, ne = new WeakSet(), Ki = function() {
|
3002
3039
|
const t = parseInt(this.t.gap, 10), e = window.pageYOffset, o = this.getBoundingClientRect().top + e - t;
|
3003
|
-
d(this,
|
3004
|
-
},
|
3040
|
+
d(this, oe, ts).call(this, o);
|
3041
|
+
}, oe = new WeakSet(), ts = function(t) {
|
3005
3042
|
window.scrollTo({
|
3006
3043
|
top: t,
|
3007
3044
|
behavior: "smooth"
|
3008
3045
|
});
|
3009
|
-
},
|
3046
|
+
}, ae = new WeakSet(), es = function(t) {
|
3010
3047
|
let e = parseInt(t, 10) + 1;
|
3011
3048
|
this.t.step.textContent = `${e}`, this.t.step.setAttribute("now-page", e);
|
3012
|
-
},
|
3049
|
+
}, re = new WeakSet(), is = function(t) {
|
3013
3050
|
const e = document.querySelectorAll(`[t4-role="next"][t4-control="${this.t.name}"]`), s = this.t.tabPanels.length === 1, o = t === this.t.tabPanels.length - 1;
|
3014
3051
|
e.forEach((a) => {
|
3015
3052
|
s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
|
3016
3053
|
});
|
3017
|
-
},
|
3054
|
+
}, le = new WeakSet(), ss = function(t) {
|
3018
3055
|
const e = document.querySelectorAll(`[t4-role="prev"][t4-control="${this.t.name}"]`), s = this.t.tabPanels.length === 1, o = t === 0;
|
3019
3056
|
e.forEach((a) => {
|
3020
3057
|
s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
|
3021
3058
|
});
|
3022
|
-
},
|
3059
|
+
}, ce = new WeakSet(), ns = function(t, e) {
|
3023
3060
|
this.t.tabGroup === "true" ? this.t.tabs.forEach((s, o) => {
|
3024
3061
|
o == t ? s.setAttribute("aria-selected", !0) : s.setAttribute("aria-selected", !1);
|
3025
3062
|
}) : this.t.tabs.forEach((s, o) => {
|
@@ -3028,29 +3065,29 @@ Qt = new WeakSet(), Xi = function() {
|
|
3028
3065
|
}, q = new WeakSet(), z = function(t, e, s) {
|
3029
3066
|
switch (t) {
|
3030
3067
|
case "step":
|
3031
|
-
|
3068
|
+
ye(this.t.step) && d(this, ae, es).call(this, e);
|
3032
3069
|
break;
|
3033
3070
|
case "eventAnchor":
|
3034
|
-
this.t.anchor && d(this,
|
3071
|
+
this.t.anchor && d(this, ne, Ki).call(this);
|
3035
3072
|
break;
|
3036
3073
|
case "tabState":
|
3037
|
-
this.t.type == "normal" && d(this,
|
3074
|
+
this.t.type == "normal" && d(this, ce, ns).call(this, e, s);
|
3038
3075
|
break;
|
3039
3076
|
case "btnState":
|
3040
|
-
d(this,
|
3077
|
+
d(this, re, is).call(this, e), d(this, le, ss).call(this, e);
|
3041
3078
|
break;
|
3042
3079
|
case "tabUrl":
|
3043
|
-
this.t.recordUrl === "true" && d(this,
|
3080
|
+
this.t.recordUrl === "true" && d(this, se, Vi).call(this, e);
|
3044
3081
|
break;
|
3045
3082
|
default:
|
3046
3083
|
console.warn("請增加判斷,謝謝");
|
3047
3084
|
break;
|
3048
3085
|
}
|
3049
|
-
},
|
3086
|
+
}, de = new WeakSet(), os = function(t) {
|
3050
3087
|
const { t: e } = this;
|
3051
3088
|
this.t.transition;
|
3052
3089
|
const s = e.tabPanels[t];
|
3053
|
-
switch (s.classList.add("hide"), e.display) {
|
3090
|
+
switch (s.classList.remove("show"), s.classList.add("hide"), e.display) {
|
3054
3091
|
case "fade":
|
3055
3092
|
s.style.cssText = "display: none; opacity: 0;";
|
3056
3093
|
break;
|
@@ -3063,10 +3100,10 @@ Qt = new WeakSet(), Xi = function() {
|
|
3063
3100
|
s.style.display = "none";
|
3064
3101
|
break;
|
3065
3102
|
}
|
3066
|
-
},
|
3103
|
+
}, ue = new WeakSet(), as = function(t) {
|
3067
3104
|
const { duration: e, timing: s, delay: o } = this.t.transition, a = this.t.tabPanels[t];
|
3068
3105
|
let r;
|
3069
|
-
switch (a.classList.remove("hide"), a.style.transition = `opacity ${e}ms ${s} ${o}ms`, a.style.display = "block", this.t.display) {
|
3106
|
+
switch (a.classList.add("show"), a.classList.remove("hide"), a.style.transition = `opacity ${e}ms ${s} ${o}ms`, a.style.display = "block", this.t.display) {
|
3070
3107
|
case "fade":
|
3071
3108
|
a.style.opacity = "0", r = setTimeout(() => {
|
3072
3109
|
clearTimeout(r), a.style.opacity = "1";
|
@@ -3081,32 +3118,32 @@ Qt = new WeakSet(), Xi = function() {
|
|
3081
3118
|
break;
|
3082
3119
|
case "swiper":
|
3083
3120
|
a.style.opacity = "1";
|
3084
|
-
const c = this.querySelector(".swiper-wrapper"), u = this.t.tabPanels[0].offsetWidth,
|
3085
|
-
c.style.transition = `transform ${e}ms ${s} ${o}ms`, c.style.transform = `translateX(${
|
3121
|
+
const c = this.querySelector(".swiper-wrapper"), u = this.t.tabPanels[0].offsetWidth, p = -t * u;
|
3122
|
+
c.style.transition = `transform ${e}ms ${s} ${o}ms`, c.style.transform = `translateX(${p}px)`;
|
3086
3123
|
break;
|
3087
3124
|
default:
|
3088
3125
|
console.warn(this.t.display, "沒有這個效果請自己想辦法!!!!");
|
3089
3126
|
break;
|
3090
3127
|
}
|
3091
|
-
},
|
3092
|
-
const e = d(this,
|
3128
|
+
}, he = new WeakSet(), rs = function(t) {
|
3129
|
+
const e = d(this, N, F).call(this, t);
|
3093
3130
|
d(this, q, z).call(this, "step", e), d(this, q, z).call(this, "btnState", e), d(this, q, z).call(this, "tabState", e, t), d(this, q, z).call(this, "tabUrl", t), this.emit("change");
|
3094
|
-
},
|
3131
|
+
}, pe = new WeakSet(), ls = function() {
|
3095
3132
|
const t = this;
|
3096
3133
|
window.addEventListener(
|
3097
3134
|
"resize",
|
3098
|
-
|
3135
|
+
Fs(() => {
|
3099
3136
|
t.update();
|
3100
3137
|
}, 1e3)
|
3101
3138
|
);
|
3102
3139
|
};
|
3103
|
-
function
|
3140
|
+
function Fs(n, i = 1e3) {
|
3104
3141
|
let t;
|
3105
3142
|
return function(e) {
|
3106
3143
|
t && clearTimeout(t), t = setTimeout(n, i, e);
|
3107
3144
|
};
|
3108
3145
|
}
|
3109
|
-
function
|
3146
|
+
function cs() {
|
3110
3147
|
const n = document.querySelectorAll("[t4-control]");
|
3111
3148
|
document.addEventListener("click", function(i) {
|
3112
3149
|
let t = !1;
|
@@ -3136,24 +3173,24 @@ function os() {
|
|
3136
3173
|
}
|
3137
3174
|
});
|
3138
3175
|
}
|
3139
|
-
|
3140
|
-
Object.assign(
|
3141
|
-
customElements.define("tab-el",
|
3142
|
-
const
|
3176
|
+
cs();
|
3177
|
+
Object.assign(Yi.prototype, O);
|
3178
|
+
customElements.define("tab-el", Yi);
|
3179
|
+
const Xe = (n) => {
|
3143
3180
|
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e);
|
3144
3181
|
n.classList.add(t), o.style.height = 0, o.style["transition-property"] = s.property, o.style["transition-duration"] = s.duration, o.style["transition-timing-function"] = s.function, o.style["transition-delay"] = s.delay, o.style.overflow = "hidden";
|
3145
|
-
},
|
3182
|
+
}, Ys = (n) => {
|
3146
3183
|
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e), a = o.children[0].offsetHeight;
|
3147
3184
|
n.collapse.height = a, n.classList.remove(t), o.style.display = "block", o.style.height = `${a}px`, o.style["transition-property"] = s.property, o.style["transition-duration"] = s.duration, o.style["transition-timing-function"] = s.function, o.style["transition-delay"] = s.delay, o.style.overflow = "hidden";
|
3148
3185
|
};
|
3149
|
-
var st, xe,
|
3150
|
-
class
|
3186
|
+
var st, xe, me, ds, ge, us, nt, Ce;
|
3187
|
+
class Us {
|
3151
3188
|
constructor(i, t = {}) {
|
3152
|
-
|
3153
|
-
|
3154
|
-
|
3155
|
-
|
3156
|
-
!at(i) && !
|
3189
|
+
h(this, st);
|
3190
|
+
h(this, me);
|
3191
|
+
h(this, ge);
|
3192
|
+
h(this, nt);
|
3193
|
+
!at(i) && !ye(i) && !rt(i) && !w(i) || (this.__storage__ = {
|
3157
3194
|
el: i,
|
3158
3195
|
options: t
|
3159
3196
|
}, this.active = "data-collapse-active", d(this, st, xe).call(this));
|
@@ -3163,64 +3200,64 @@ class Xs {
|
|
3163
3200
|
}
|
3164
3201
|
}
|
3165
3202
|
st = new WeakSet(), xe = function() {
|
3166
|
-
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } =
|
3167
|
-
if (this.elements = t.state == "not active" ?
|
3203
|
+
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } = Je;
|
3204
|
+
if (this.elements = t.state == "not active" ? L(i + `:not([${this.active}])`) : L(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
3168
3205
|
for (const [o, a] of Object.entries(this.options.on))
|
3169
3206
|
this.__events__[o] = [a];
|
3170
|
-
d(this,
|
3171
|
-
},
|
3207
|
+
d(this, me, ds).call(this);
|
3208
|
+
}, me = new WeakSet(), ds = function() {
|
3172
3209
|
const { elements: i, options: t } = this;
|
3173
3210
|
i.forEach((e) => {
|
3174
|
-
e.collapse = {}, e.collapse.instance = this, e.collapse.defaultOptions = t, e.collapse.methods = {}, e.collapse.methods.update = this.update, e.setAttribute(this.active, ""), d(this,
|
3211
|
+
e.collapse = {}, e.collapse.instance = this, e.collapse.defaultOptions = t, e.collapse.methods = {}, e.collapse.methods.update = this.update, e.setAttribute(this.active, ""), d(this, ge, us).call(this, e);
|
3175
3212
|
}), this.emit("init");
|
3176
|
-
},
|
3213
|
+
}, ge = new WeakSet(), us = function(i) {
|
3177
3214
|
const { options: t } = this, { collapseClass: e, block: s, target: o, defaultOpen: a, targetStopPropagation: r, defaultActiveMark: l } = t, c = i, u = c.querySelector(o);
|
3178
|
-
if (c.collapse.height = u.children[0].offsetHeight, a ? (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)) : !c.classList.contains(l) && !c.hasAttribute(l) ? (c.classList.add(e), u.style.height = "0px", u.style.overflow = "hidden") : (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)), c.removeEventListener("click", d(this, nt,
|
3179
|
-
const
|
3215
|
+
if (c.collapse.height = u.children[0].offsetHeight, a ? (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)) : !c.classList.contains(l) && !c.hasAttribute(l) ? (c.classList.add(e), u.style.height = "0px", u.style.overflow = "hidden") : (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)), c.removeEventListener("click", d(this, nt, Ce)), c.addEventListener("click", d(this, nt, Ce)), r) {
|
3216
|
+
const p = (m) => {
|
3180
3217
|
m.stopPropagation();
|
3181
3218
|
};
|
3182
|
-
u.removeEventListener("click",
|
3219
|
+
u.removeEventListener("click", p), u.addEventListener("click", p);
|
3183
3220
|
}
|
3184
|
-
}, nt = new WeakSet(),
|
3221
|
+
}, nt = new WeakSet(), Ce = function() {
|
3185
3222
|
const { instance: i, defaultOptions: t } = this.collapse, { collapseClass: e, block: s, target: o, single: a } = t, r = this;
|
3186
3223
|
r.classList.contains(e) ? (a && r.parentNode.querySelectorAll(`.${r.classList[0]}`).forEach((l) => {
|
3187
|
-
|
3188
|
-
}),
|
3224
|
+
Xe(l);
|
3225
|
+
}), Ys(r)) : Xe(r), i.emit("afterCollapse");
|
3189
3226
|
};
|
3190
|
-
Object.assign(
|
3191
|
-
function
|
3227
|
+
Object.assign(Us.prototype, O);
|
3228
|
+
function Js(n, i) {
|
3192
3229
|
const t = i, { color: e, opacity: s, duration: o } = i.s.options;
|
3193
3230
|
let a = document.createElement("span"), r = n.clientX - t.getBoundingClientRect().left, l = n.clientY - t.getBoundingClientRect().top;
|
3194
3231
|
a.style.cssText = `background: ${e};left: ${r}px;top: ${l}px;opacity: ${s};animation-duration: ${o}ms`, a.classList.add("circle"), t.appendChild(a), setTimeout(function() {
|
3195
3232
|
a.remove();
|
3196
3233
|
}, `${o}`);
|
3197
3234
|
}
|
3198
|
-
function
|
3235
|
+
function hs() {
|
3199
3236
|
document.querySelectorAll("ripple-btn").forEach((n) => {
|
3200
3237
|
n.querySelector(".hover-ball"), n.style.setProperty("--r", ""), n.classList.remove("entered");
|
3201
3238
|
});
|
3202
3239
|
}
|
3203
|
-
document.addEventListener("click",
|
3204
|
-
var ot,
|
3205
|
-
class
|
3240
|
+
document.addEventListener("click", hs);
|
3241
|
+
var ot, He, fe, ps, ve, ms, be, gs;
|
3242
|
+
class Zs extends HTMLElement {
|
3206
3243
|
constructor() {
|
3207
3244
|
super();
|
3208
|
-
|
3209
|
-
|
3210
|
-
|
3211
|
-
|
3245
|
+
h(this, ot);
|
3246
|
+
h(this, fe);
|
3247
|
+
h(this, ve);
|
3248
|
+
h(this, be);
|
3212
3249
|
this.initialize = !1;
|
3213
3250
|
}
|
3214
3251
|
connectedCallback() {
|
3215
3252
|
const t = this;
|
3216
|
-
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this, ot,
|
3253
|
+
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this, ot, He).call(this));
|
3217
3254
|
}
|
3218
3255
|
update() {
|
3219
|
-
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this, ot,
|
3256
|
+
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this, ot, He).call(this);
|
3220
3257
|
}
|
3221
3258
|
}
|
3222
|
-
ot = new WeakSet(),
|
3223
|
-
const { SETTINGS: t } =
|
3259
|
+
ot = new WeakSet(), He = function() {
|
3260
|
+
const { SETTINGS: t } = Ze;
|
3224
3261
|
this.s = {};
|
3225
3262
|
function e(o) {
|
3226
3263
|
let a = !!o;
|
@@ -3234,22 +3271,22 @@ ot = new WeakSet(), ke = function() {
|
|
3234
3271
|
hover: this.getAttribute("r4-hover") ? e(this.getAttribute("r4-hover")) : t.hover,
|
3235
3272
|
click: this.getAttribute("r4-hover-click") ? e(this.getAttribute("r4-hover-click")) : t.click
|
3236
3273
|
};
|
3237
|
-
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this,
|
3238
|
-
},
|
3239
|
-
d(this,
|
3240
|
-
},
|
3274
|
+
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this, fe, ps).call(this);
|
3275
|
+
}, fe = new WeakSet(), ps = function() {
|
3276
|
+
d(this, ve, ms).call(this), d(this, be, gs).call(this), this.classList.add("r4-initialize");
|
3277
|
+
}, ve = new WeakSet(), ms = function() {
|
3241
3278
|
const t = this, e = document.createElement("i");
|
3242
3279
|
e.classList.add("hover-ball"), e.style.transitionDuration = `${t.s.options.speed}ms`, t.appendChild(e);
|
3243
|
-
},
|
3280
|
+
}, be = new WeakSet(), gs = function() {
|
3244
3281
|
const t = this.querySelector("i.hover-ball"), e = this;
|
3245
3282
|
e.addEventListener("click", function(a) {
|
3246
|
-
a.stopPropagation(), e.s.options.click &&
|
3283
|
+
a.stopPropagation(), e.s.options.click && Js(a, e);
|
3247
3284
|
});
|
3248
3285
|
let s = "ontouchstart" in document.documentElement ? "touchstart" : "mouseenter", o = "ontouchend" in document.documentElement ? "touchend" : "mouseleave";
|
3249
3286
|
e.addEventListener(s, function(a) {
|
3250
|
-
if (s === "touchstart" &&
|
3251
|
-
const r = Math.round(s === "mouseenter" ? a.clientX - e.getBoundingClientRect().left : a.changedTouches[0].clientX - e.getBoundingClientRect().x), l = Math.round(s === "mouseenter" ? a.clientY - e.getBoundingClientRect().top : a.changedTouches[0].clientY - e.getBoundingClientRect().y), { offsetWidth: c, offsetHeight: u } = e,
|
3252
|
-
e.style.setProperty("--r",
|
3287
|
+
if (s === "touchstart" && hs(), e.s.options.hover) {
|
3288
|
+
const r = Math.round(s === "mouseenter" ? a.clientX - e.getBoundingClientRect().left : a.changedTouches[0].clientX - e.getBoundingClientRect().x), l = Math.round(s === "mouseenter" ? a.clientY - e.getBoundingClientRect().top : a.changedTouches[0].clientY - e.getBoundingClientRect().y), { offsetWidth: c, offsetHeight: u } = e, p = Math.ceil(Math.sqrt(c ** 2 + u ** 2) * 2);
|
3289
|
+
e.style.setProperty("--r", p), t.style.left = r + "px", t.style.top = l + "px", e.classList.add("entered");
|
3253
3290
|
}
|
3254
3291
|
}), e.addEventListener(o, function(a) {
|
3255
3292
|
if (o !== "touchend" && e.s.options.hover) {
|
@@ -3258,20 +3295,20 @@ ot = new WeakSet(), ke = function() {
|
|
3258
3295
|
}
|
3259
3296
|
});
|
3260
3297
|
};
|
3261
|
-
customElements.define("ripple-btn",
|
3262
|
-
class
|
3298
|
+
customElements.define("ripple-btn", Zs);
|
3299
|
+
class Qs {
|
3263
3300
|
constructor() {
|
3264
3301
|
this.init();
|
3265
3302
|
}
|
3266
3303
|
init() {
|
3267
3304
|
const i = document.querySelectorAll("*:not([video-id]) > img"), t = (o, a) => {
|
3268
|
-
const r = document.createElement("div"), l = document.createElement("span"), c = document.createElement("span"), u = Math.sqrt(o ** 2 + a ** 2),
|
3305
|
+
const r = document.createElement("div"), l = document.createElement("span"), c = document.createElement("span"), u = Math.sqrt(o ** 2 + a ** 2), p = Math.asin(a / u) * 180 / Math.PI;
|
3269
3306
|
return r.className = "no-image", l.className = "slash1", l.style.cssText = `
|
3270
3307
|
width: ${u}px;
|
3271
|
-
transform: rotate(${
|
3308
|
+
transform: rotate(${p}deg);
|
3272
3309
|
`, c.className = "slash2", c.style.cssText = `
|
3273
3310
|
width: ${u}px;
|
3274
|
-
transform: rotate(${-
|
3311
|
+
transform: rotate(${-p}deg);
|
3275
3312
|
`, r.appendChild(l), r.appendChild(c), r;
|
3276
3313
|
}, e = document.querySelectorAll(".error-image");
|
3277
3314
|
for (let o = 0; o < e.length; o++)
|
@@ -3311,12 +3348,12 @@ class Ys {
|
|
3311
3348
|
this.init();
|
3312
3349
|
}
|
3313
3350
|
}
|
3314
|
-
function
|
3351
|
+
function Re(n, i) {
|
3315
3352
|
return n ? function(t, e) {
|
3316
3353
|
Function(n)(t, e);
|
3317
3354
|
} : i;
|
3318
3355
|
}
|
3319
|
-
function
|
3356
|
+
function Vs(n, i, t, e) {
|
3320
3357
|
const s = i.params, o = n.closest("[data-upload-item]").querySelector("[data-preview]");
|
3321
3358
|
o.querySelector("img") && o.querySelector("img").remove(), o.appendChild(e.imgElement);
|
3322
3359
|
const a = n.dataset.group, r = document.querySelector(i.el).dataset.index;
|
@@ -3324,9 +3361,9 @@ function Us(n, i, t, e) {
|
|
3324
3361
|
const l = t.name.substring(t.name.lastIndexOf(".")).replace("."), c = t.name.replace(`.${l}`, "");
|
3325
3362
|
e.originalCanvas.toBlob(
|
3326
3363
|
function(u) {
|
3327
|
-
const
|
3364
|
+
const p = new File([u], `${c}`, { type: t.type });
|
3328
3365
|
uploadImage[`${a}`][r] = {
|
3329
|
-
file:
|
3366
|
+
file: p,
|
3330
3367
|
info: e
|
3331
3368
|
}, s.on.changeAfter && typeof s.on.changeAfter == "function" && s.on.changeAfter(n, e);
|
3332
3369
|
},
|
@@ -3339,28 +3376,28 @@ function Us(n, i, t, e) {
|
|
3339
3376
|
info: e
|
3340
3377
|
}, s.on.changeAfter && typeof s.on.changeAfter == "function" && s.on.changeAfter(n, e);
|
3341
3378
|
}
|
3342
|
-
function
|
3379
|
+
function Ks(n, i, t, e) {
|
3343
3380
|
const s = document.createElement("canvas"), o = s.getContext("2d"), a = i.width, l = i.height / a * 100, c = e / t * 100;
|
3344
|
-
let u = 0,
|
3381
|
+
let u = 0, p = 0;
|
3345
3382
|
switch (s.width = t, s.height = e, n.previewSize) {
|
3346
3383
|
case "contain":
|
3347
|
-
l < c ? (u = s.width,
|
3384
|
+
l < c ? (u = s.width, p = t * l / 100) : l > c ? (u = e / l * 100, p = s.height) : (u = s.width, p = s.height);
|
3348
3385
|
break;
|
3349
3386
|
case "cover":
|
3350
|
-
l < c ? (u = e / l * 100,
|
3387
|
+
l < c ? (u = e / l * 100, p = s.height) : l > c ? (u = s.width, p = t * l / 100) : l === c && (u = s.width, p = s.height);
|
3351
3388
|
break;
|
3352
3389
|
}
|
3353
|
-
const m = (s.width - u) * 0.5, g = (s.height -
|
3354
|
-
return o.drawImage(i, m, g, u,
|
3390
|
+
const m = (s.width - u) * 0.5, g = (s.height - p) * 0.5;
|
3391
|
+
return o.drawImage(i, m, g, u, p), s;
|
3355
3392
|
}
|
3356
|
-
function
|
3393
|
+
function tn(n, i) {
|
3357
3394
|
return new Promise((t, e) => {
|
3358
3395
|
if (i) {
|
3359
3396
|
const s = new Image();
|
3360
3397
|
s.src = i, s.classList.add(n.previewSize), s.onload = () => {
|
3361
3398
|
let o = {
|
3362
3399
|
imgElement: s,
|
3363
|
-
originalCanvas:
|
3400
|
+
originalCanvas: Ks(n, s, s.width, s.height),
|
3364
3401
|
info: {
|
3365
3402
|
originalWidth: s.width,
|
3366
3403
|
originalHeight: s.height,
|
@@ -3373,31 +3410,31 @@ function Zs(n, i) {
|
|
3373
3410
|
t();
|
3374
3411
|
});
|
3375
3412
|
}
|
3376
|
-
function
|
3413
|
+
function en(n, i) {
|
3377
3414
|
const t = Math.pow(10, i);
|
3378
3415
|
return Math.round(n * t) / t;
|
3379
3416
|
}
|
3380
|
-
function
|
3417
|
+
function sn(n, i) {
|
3381
3418
|
let t = n.size / 1024 / 1024;
|
3382
|
-
return `${
|
3419
|
+
return `${en(t, 2)}` <= i;
|
3383
3420
|
}
|
3384
|
-
function
|
3421
|
+
function nn(n, i, t) {
|
3385
3422
|
if (n.target.files.length <= 0)
|
3386
3423
|
return;
|
3387
3424
|
const e = n.target.files[0], s = i.closest("[data-upload-item]");
|
3388
3425
|
let o = new FileReader();
|
3389
3426
|
o.onload = (a) => {
|
3390
3427
|
const r = e.type.split("/")[0] === "image" ? a.target.result : null;
|
3391
|
-
if (t.params.sizeLimit && !
|
3428
|
+
if (t.params.sizeLimit && !sn(e, t.params.sizeLimit)) {
|
3392
3429
|
i.value = "", s.classList.add("over-limit"), t.params.on.overLimit && typeof t.params.on.overLimit == "function" && t.params.on.overLimit(i, t.params.sizeLimit);
|
3393
3430
|
return;
|
3394
3431
|
} else
|
3395
|
-
s.classList.remove("over-limit"), s.classList.add("uploaded"),
|
3396
|
-
|
3432
|
+
s.classList.remove("over-limit"), s.classList.add("uploaded"), tn(t.params, r).then((l) => {
|
3433
|
+
Vs(i, t, e, l);
|
3397
3434
|
});
|
3398
3435
|
}, o.readAsDataURL(e);
|
3399
3436
|
}
|
3400
|
-
class
|
3437
|
+
class on {
|
3401
3438
|
constructor(i, t) {
|
3402
3439
|
const e = this;
|
3403
3440
|
e.el = i, e.params = {
|
@@ -3425,67 +3462,67 @@ class tn {
|
|
3425
3462
|
previewSize: e.dataset.previewSize || i.params.previewSize,
|
3426
3463
|
compress: e.dataset.compress || i.params.compress,
|
3427
3464
|
on: {
|
3428
|
-
changeAfter:
|
3429
|
-
overLimit:
|
3465
|
+
changeAfter: Re(e.dataset.changeAfter, i.params.on.changeAfter),
|
3466
|
+
overLimit: Re(e.dataset.overLimit, i.params.on.overLimit)
|
3430
3467
|
}
|
3431
3468
|
};
|
3432
3469
|
i.params = o, typeof uploadImage[`${o.group}`] > "u" && (uploadImage[`${o.group}`] = []), e.dataset.group || (e.dataset.group = o.group), e.dataset.index = document.querySelectorAll(`[data-group="${o.group}"]`).length - 1, e.addEventListener("change", function(a) {
|
3433
|
-
|
3470
|
+
nn(a, e, i);
|
3434
3471
|
});
|
3435
3472
|
}));
|
3436
3473
|
}
|
3437
3474
|
}
|
3438
3475
|
export {
|
3439
|
-
|
3440
|
-
|
3441
|
-
|
3442
|
-
|
3443
|
-
|
3444
|
-
|
3445
|
-
|
3446
|
-
|
3447
|
-
|
3448
|
-
|
3449
|
-
|
3450
|
-
|
3476
|
+
Qe as A,
|
3477
|
+
Tn as B,
|
3478
|
+
Us as C,
|
3479
|
+
ki as D,
|
3480
|
+
En as E,
|
3481
|
+
An as F,
|
3482
|
+
Ln as G,
|
3483
|
+
Sn as H,
|
3484
|
+
Qs as I,
|
3485
|
+
Dn as J,
|
3486
|
+
_n as K,
|
3487
|
+
kn as L,
|
3451
3488
|
U as M,
|
3452
|
-
|
3453
|
-
|
3454
|
-
|
3455
|
-
|
3456
|
-
|
3457
|
-
|
3458
|
-
|
3459
|
-
|
3460
|
-
|
3461
|
-
|
3462
|
-
|
3463
|
-
|
3464
|
-
|
3489
|
+
$n as N,
|
3490
|
+
xn as O,
|
3491
|
+
Cn as P,
|
3492
|
+
Hn as Q,
|
3493
|
+
Zs as R,
|
3494
|
+
Mn as S,
|
3495
|
+
Yi as T,
|
3496
|
+
qn as U,
|
3497
|
+
In as V,
|
3498
|
+
On as W,
|
3499
|
+
Pn as X,
|
3500
|
+
Nn as Y,
|
3501
|
+
w as a,
|
3465
3502
|
rt as b,
|
3466
|
-
|
3467
|
-
|
3503
|
+
Ts as c,
|
3504
|
+
ws as d,
|
3468
3505
|
Y as e,
|
3469
|
-
|
3470
|
-
|
3471
|
-
|
3506
|
+
E as f,
|
3507
|
+
L as g,
|
3508
|
+
mn as h,
|
3472
3509
|
at as i,
|
3473
|
-
|
3474
|
-
|
3475
|
-
|
3476
|
-
|
3477
|
-
|
3478
|
-
|
3479
|
-
|
3480
|
-
|
3481
|
-
|
3482
|
-
|
3483
|
-
|
3484
|
-
|
3485
|
-
|
3486
|
-
|
3487
|
-
|
3488
|
-
|
3489
|
-
|
3510
|
+
ui as j,
|
3511
|
+
Bs as k,
|
3512
|
+
Rs as l,
|
3513
|
+
on as m,
|
3514
|
+
Hs as n,
|
3515
|
+
jn as o,
|
3516
|
+
gn as p,
|
3517
|
+
Ei as q,
|
3518
|
+
Ai as r,
|
3519
|
+
ys as s,
|
3520
|
+
fn as t,
|
3521
|
+
vn as u,
|
3522
|
+
qs as v,
|
3523
|
+
bn as w,
|
3524
|
+
Cs as x,
|
3525
|
+
yn as y,
|
3526
|
+
wn as z
|
3490
3527
|
};
|
3491
3528
|
//# sourceMappingURL=image-preview-bundle.js.map
|