@xwadex/fesd 0.0.14-re.80 → 0.0.14-re.82
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 +611 -579
- package/dist/image-preview-bundle.js.map +1 -1
- package/package.json +1 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
var
|
1
|
+
var fs = (n, i, t) => {
|
2
2
|
if (!i.has(n))
|
3
3
|
throw TypeError("Cannot " + t);
|
4
4
|
};
|
@@ -7,14 +7,14 @@ var p = (n, i, t) => {
|
|
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
|
12
|
-
import
|
10
|
+
var d = (n, i, t) => (fs(n, i, "access private method"), t);
|
11
|
+
import { OverlayScrollbars as Me } from "overlayscrollbars";
|
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,25 +364,25 @@ 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", h = c ? "left" : "top", m = c ? "width" : "height",
|
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", h = c ? "left" : "top", m = c ? "width" : "height", g = w(e) ? A(e) : document.scrollingElement, v = g[u], b = w(t) ? A(t).getBoundingClientRect()[h] : 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
|
-
|
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
387
|
p(this, J);
|
384
388
|
p(this, pt);
|
@@ -386,7 +390,7 @@ class Je {
|
|
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,8 +459,8 @@ const { MODALS: M } = window, Ts = (n) => {
|
|
455
459
|
s.append(o);
|
456
460
|
}), e.children[0];
|
457
461
|
};
|
458
|
-
var gt,
|
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
466
|
p(this, gt);
|
@@ -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, gt,
|
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
|
-
gt = new WeakSet(),
|
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
|
-
}, ft = new WeakSet(),
|
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
|
+
}), 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 @@ gt = 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 @@ gt = 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,26 +586,26 @@ 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 h =
|
598
|
-
r("complete", h),
|
601
|
+
const h = Ie[t] || A(n.target);
|
602
|
+
r("complete", h), 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
610
|
p(this, Z);
|
607
611
|
p(this, wt);
|
@@ -609,7 +613,7 @@ const N = class N {
|
|
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: h, bottom: m } = s.getBoundingClientRect(),
|
674
|
-
if (h - e <=
|
677
|
+
const { class: o, delay: a, start: r, end: l, repeat: c, instance: u } = s.aost, { top: h, bottom: m } = s.getBoundingClientRect(), g = t * (r / 100), v = t * (l / 100);
|
678
|
+
if (h - 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" && h - 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
693
|
p(this, Q);
|
690
694
|
p(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
|
-
p(this, Lt);
|
746
749
|
p(this, At);
|
750
|
+
p(this, Lt);
|
747
751
|
p(this, St);
|
748
752
|
// youtube iframe
|
749
753
|
p(this, Dt);
|
750
754
|
// vimeo iframe
|
751
755
|
p(this, _t);
|
752
756
|
// youku iframe
|
753
|
-
p(this,
|
757
|
+
p(this, kt);
|
754
758
|
p(this, $t);
|
755
|
-
|
759
|
+
// 2025.02.11 新增 ig
|
760
|
+
p(this, xt);
|
761
|
+
// 2025.02.11 新增 tiktok
|
762
|
+
p(this, Ct);
|
763
|
+
d(this, At, pi).call(this);
|
756
764
|
}
|
757
765
|
play() {
|
758
766
|
const { videoType: t } = this;
|
@@ -789,68 +797,80 @@ 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/" allowtransparency="true" allowfullscreen="true" frameborder="0" height="100%" data-instgrm-payload-id="instagram-media-payload-0" scrolling="no"></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
|
-
}),
|
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
|
-
}),
|
868
|
+
}), f("html").removeClass("scrollLock"), bs(i);
|
849
869
|
}
|
850
|
-
async function
|
851
|
-
if (
|
870
|
+
async function fn(n = 0) {
|
871
|
+
if (f(".loading-wrapper").length)
|
852
872
|
return;
|
853
|
-
|
873
|
+
f("body").append(`
|
854
874
|
<div class="loading-wrapper">
|
855
875
|
<div class="icon-box">
|
856
876
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"><path d="M10 50A40 40 0 0 0 90 50A40 42 0 0 1 10 50" fill="#ffffff" stroke="none">
|
@@ -860,31 +880,31 @@ async function hn(n = 0) {
|
|
860
880
|
</svg>
|
861
881
|
</div>
|
862
882
|
</div>
|
863
|
-
`),
|
864
|
-
|
883
|
+
`), f(".loading-wrapper").delay(n).fadeIn(300).promise().done(function() {
|
884
|
+
Ei();
|
865
885
|
});
|
866
886
|
}
|
867
|
-
function
|
868
|
-
|
869
|
-
|
887
|
+
function vn() {
|
888
|
+
f(".loading-wrapper").fadeOut(300).promise().done(function() {
|
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 fn() {
|
|
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
|
923
|
-
|
924
|
-
|
942
|
+
function An(n, i) {
|
943
|
+
f(n).on("click", function() {
|
944
|
+
f(this).toggleClass(i);
|
925
945
|
});
|
926
946
|
}
|
927
|
-
function
|
928
|
-
|
929
|
-
|
947
|
+
function Ln(n, i) {
|
948
|
+
f(n).on("click", function() {
|
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,44 +967,44 @@ function Tn(n, i = 250) {
|
|
947
967
|
}, i)) : (t = a, n.apply(s, o));
|
948
968
|
};
|
949
969
|
}
|
950
|
-
function
|
951
|
-
window._g.interval = [],
|
952
|
-
const e = Number(
|
970
|
+
function Dn() {
|
971
|
+
window._g.interval = [], f(".countdown").each((i, t) => {
|
972
|
+
const e = Number(f(t).attr("data-seconds")) + 1;
|
953
973
|
let s = Math.floor(e / 60) + ":" + e % 60;
|
954
974
|
window._g.interval[i] = setInterval(function() {
|
955
975
|
var o = s.split(":"), a = parseInt(o[0], 10), r = parseInt(o[1], 10);
|
956
|
-
--r, a = r < 0 ? --a : a, a = a < 10 ? a = "0" + a : a, a == 0 && r == 0 && clearInterval(window._g.interval[i]), r = r < 0 ? 59 : r, r = r < 10 ? "0" + r : r,
|
976
|
+
--r, a = r < 0 ? --a : a, a = a < 10 ? a = "0" + a : a, a == 0 && r == 0 && clearInterval(window._g.interval[i]), r = r < 0 ? 59 : r, r = r < 10 ? "0" + r : r, f(t).html(a + ":" + r), s = a + ":" + r;
|
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
|
975
|
-
const o = this, r =
|
994
|
+
function $n(n, i, t, e, s) {
|
995
|
+
const o = this, r = f(n).html().split("<br>");
|
976
996
|
let l = "", c = 0;
|
977
997
|
r.forEach((u, h) => {
|
978
|
-
h !== 0 && (l += "<br>"), u.split("").forEach((
|
979
|
-
i ? (v === 0 && (l += '<span class="letter-wrap" style="display: inline-block">'),
|
998
|
+
h !== 0 && (l += "<br>"), u.split("").forEach((g, v) => {
|
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,153 +1019,163 @@ 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
|
-
(n.loopedSlides ? n.slides.length - n.loopedSlides * 2 : n.slides.length) <= s ? (t.addClass("swiper-no-swiping"),
|
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
|
1014
|
-
const i = n.el, t =
|
1015
|
-
n.autoplay.stop(),
|
1033
|
+
function qn(n) {
|
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");
|
1035
|
+
n.autoplay.stop(), f(e).off("ended"), e ? (s.each((o, a) => {
|
1016
1036
|
a.currentTime = 0;
|
1017
|
-
}),
|
1037
|
+
}), f(e).on("ended", function() {
|
1018
1038
|
n.slideNext();
|
1019
1039
|
}), e.play()) : n.params.autoplay.enabled && n.autoplay.start();
|
1020
1040
|
}
|
1021
|
-
function
|
1022
|
-
|
1023
|
-
const t =
|
1041
|
+
function In() {
|
1042
|
+
f(".number-grow").each(function(n, i) {
|
1043
|
+
const t = f(i), o = t.attr("data-num").replace(/(\d)(?=(?:\d{3})+$)/g, "$1,").split(""), a = () => {
|
1024
1044
|
let r = "";
|
1025
1045
|
for (var l = 0; l <= 9; l++)
|
1026
1046
|
r += String(l) + "<br>";
|
1027
1047
|
return r;
|
1028
1048
|
};
|
1029
|
-
|
1049
|
+
f(o).each(function(r, l) {
|
1030
1050
|
const c = () => l !== "," ? `<div class="num" data-final-num="${l}"><div><br>${a()}<br>${a()}</div></div>` : `<div class="comma">${l}</div>`;
|
1031
1051
|
t.append(c);
|
1032
1052
|
});
|
1033
1053
|
});
|
1034
1054
|
}
|
1035
|
-
function
|
1036
|
-
|
1037
|
-
const t =
|
1055
|
+
function On() {
|
1056
|
+
f(".letter-grow").each(function(n, i) {
|
1057
|
+
const t = f(i), s = t.attr("data-letter").split(""), o = () => {
|
1038
1058
|
let a = "";
|
1039
1059
|
for (let r = 65; r <= 90; r++)
|
1040
1060
|
a += String.fromCharCode(r) + "<br>";
|
1041
1061
|
return a;
|
1042
1062
|
};
|
1043
|
-
|
1063
|
+
f(s).each(function(a, r) {
|
1044
1064
|
const l = `<div class="letter" data-final-letter="${r}"><div><br>${o()}<br>${o()}</div></div>`;
|
1045
1065
|
t.append(l);
|
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
1087
|
p(this, V);
|
1068
|
-
p(this, kt);
|
1069
|
-
p(this, Ct);
|
1070
|
-
p(this, K);
|
1071
1088
|
p(this, Ht);
|
1072
|
-
|
1073
|
-
|
1089
|
+
p(this, Mt);
|
1090
|
+
p(this, K);
|
1091
|
+
p(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: h } = 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" ? h ? 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" ? h ? 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 } = t.params, c = new Fe({ callback_loaded: (u) => {
|
1124
1154
|
} });
|
1125
1155
|
if (o == "onBox") {
|
1126
|
-
const
|
1156
|
+
const u = {
|
1127
1157
|
target: a,
|
1128
1158
|
route: r,
|
1129
1159
|
on: {
|
1130
|
-
complete(
|
1131
|
-
|
1160
|
+
complete(h) {
|
1161
|
+
h.querySelector(".modal-content").insertAdjacentHTML("beforeend", Te(t.params)), h.querySelector(".modal-content").setAttribute("video-typeStyle", `${l}`);
|
1132
1162
|
},
|
1133
|
-
open(
|
1134
|
-
const
|
1135
|
-
|
1163
|
+
open(h) {
|
1164
|
+
const m = h.querySelectorAll("[data-overlayscrollbars-viewport]");
|
1165
|
+
c.update(), Ei([...m]);
|
1136
1166
|
},
|
1137
|
-
close(
|
1138
|
-
const
|
1139
|
-
|
1167
|
+
close(h) {
|
1168
|
+
const m = h.querySelectorAll("[data-overlayscrollbars-viewport]");
|
1169
|
+
Ai([...m]);
|
1140
1170
|
},
|
1141
|
-
destroy(
|
1171
|
+
destroy(h) {
|
1142
1172
|
}
|
1143
1173
|
}
|
1144
1174
|
};
|
1145
|
-
U.open(
|
1175
|
+
U.open(u);
|
1146
1176
|
} else
|
1147
|
-
o == "onPage" && (t.params.videoAutoplay = "on", s.innerHTML =
|
1148
|
-
},
|
1177
|
+
o == "onPage" && (t.params.videoAutoplay = "on", s.innerHTML = Te(t.params));
|
1178
|
+
}, qt = new WeakSet(), Di = function(i) {
|
1149
1179
|
const { SETTINGS: t } = Y;
|
1150
1180
|
return {
|
1151
1181
|
$selector: i,
|
@@ -1157,12 +1187,14 @@ V = new WeakSet(), Le = function() {
|
|
1157
1187
|
videoCover: i.getAttribute("video-cover") || t.videoCover,
|
1158
1188
|
videoLayoutNo: i.getAttribute("video-layout-no") || t.videoLayoutNo,
|
1159
1189
|
videoTarget: i.getAttribute("video-target") || t.videoTarget,
|
1160
|
-
videoTargetRoute: i.getAttribute("video-target-route") || t.videoTargetRoute
|
1190
|
+
videoTargetRoute: i.getAttribute("video-target-route") || t.videoTargetRoute,
|
1191
|
+
videoStartTime: i.getAttribute("video-starttime") || t.videoStartTime,
|
1192
|
+
videoHighQualityPic: i.getAttribute("video-highquality") || t.videoHighQuality
|
1161
1193
|
};
|
1162
1194
|
};
|
1163
|
-
Object.assign(
|
1164
|
-
customElements.define("video-player",
|
1165
|
-
const
|
1195
|
+
Object.assign(qs.prototype, O);
|
1196
|
+
customElements.define("video-player", xs);
|
1197
|
+
const Oe = {
|
1166
1198
|
"zh-tw": {
|
1167
1199
|
臺北市: [
|
1168
1200
|
["中正區", "100"],
|
@@ -1991,8 +2023,8 @@ const qe = {
|
|
1991
2023
|
["Dongyin Township", "212"]
|
1992
2024
|
]
|
1993
2025
|
}
|
1994
|
-
},
|
1995
|
-
const { TEMPLATE: i } =
|
2026
|
+
}, Is = (n) => {
|
2027
|
+
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
2028
|
e.innerHTML = i(
|
1997
2029
|
s,
|
1998
2030
|
o,
|
@@ -2005,14 +2037,14 @@ const qe = {
|
|
2005
2037
|
(!h.hasAttribute("data-option") || h.getAttribute("data-option").trim() === "") && h.setAttribute("data-option", h.textContent.trim());
|
2006
2038
|
}) : (!c.hasAttribute("data-option") || c.getAttribute("data-option").trim() === "") && c.setAttribute("data-option", c.textContent.trim())), l.append(c);
|
2007
2039
|
}), e.children[0];
|
2008
|
-
},
|
2040
|
+
}, Os = (n) => {
|
2009
2041
|
var t;
|
2010
2042
|
const i = (t = n.getAttribute("control-elements")) == null ? void 0 : t.split(",");
|
2011
2043
|
i && i.forEach((e) => {
|
2012
2044
|
const s = document.querySelector(e);
|
2013
|
-
s ||
|
2045
|
+
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
2046
|
});
|
2015
|
-
},
|
2047
|
+
}, x = (n, i) => {
|
2016
2048
|
const t = n.getAttribute("d4-placeholder"), e = n.querySelectorAll(".dropdown-list li");
|
2017
2049
|
if (i < 0 || i.length === 0) {
|
2018
2050
|
switch (e.forEach((s) => {
|
@@ -2053,7 +2085,7 @@ const qe = {
|
|
2053
2085
|
const o = n.querySelectorAll(".dropdown-list li.active");
|
2054
2086
|
o.length <= 0 ? n.s.selectDisplayEl.textContent = t.trim() : (n.s.selectDisplayEl.textContent = "", o.forEach((r) => {
|
2055
2087
|
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(
|
2088
|
+
n.s.selectDisplayEl.insertAdjacentHTML(E.append, u);
|
2057
2089
|
})), n.s.activeLi = o, n.s.value = [...o].map((r) => ({
|
2058
2090
|
index: [...e].indexOf(r),
|
2059
2091
|
id: r.getAttribute("data-option"),
|
@@ -2064,42 +2096,42 @@ const qe = {
|
|
2064
2096
|
break;
|
2065
2097
|
}
|
2066
2098
|
}
|
2067
|
-
},
|
2099
|
+
}, Ps = (n) => {
|
2068
2100
|
const i = n.s.cityLang;
|
2069
|
-
n.classList.contains("city") && (n.s.dropdownEl.querySelector(".dropdown-list").innerHTML = "", Object.keys(
|
2101
|
+
n.classList.contains("city") && (n.s.dropdownEl.querySelector(".dropdown-list").innerHTML = "", Object.keys(Oe[i]).forEach((t) => {
|
2070
2102
|
const e = document.createElement("li");
|
2071
2103
|
e.textContent = t, e.setAttribute("data-option", t), n.s.dropdownEl.querySelector(".dropdown-list").append(e);
|
2072
2104
|
}), n.s.allLi = n.querySelectorAll(".dropdown-list li"));
|
2073
|
-
},
|
2105
|
+
}, Ns = (n, i) => {
|
2074
2106
|
const t = n.s.cityLang;
|
2075
|
-
|
2107
|
+
Oe[t][i].forEach((e, s) => {
|
2076
2108
|
const o = document.createElement("li");
|
2077
2109
|
o.textContent = e[0], o.setAttribute("data-option", e[0]), n.querySelector(".dropdown-list").append(o);
|
2078
2110
|
});
|
2079
|
-
},
|
2080
|
-
|
2111
|
+
}, _i = () => {
|
2112
|
+
L('dropdown-el[d4-status="open"]').forEach((i) => {
|
2081
2113
|
i.close();
|
2082
2114
|
});
|
2083
|
-
},
|
2084
|
-
const { SETTINGS: n } =
|
2115
|
+
}, js = () => {
|
2116
|
+
const { SETTINGS: n } = qe;
|
2085
2117
|
((t, e) => {
|
2086
2118
|
Object.keys(e).forEach((s) => {
|
2087
2119
|
t.style.setProperty(`--${s}`, e[s]);
|
2088
2120
|
});
|
2089
2121
|
})(document.documentElement, n.scrollbar);
|
2090
2122
|
};
|
2091
|
-
|
2123
|
+
js();
|
2092
2124
|
document.addEventListener("click", function() {
|
2093
|
-
|
2125
|
+
_i();
|
2094
2126
|
});
|
2095
|
-
var
|
2096
|
-
class
|
2127
|
+
var It, $i, Ot, xi, Pt, Ci, Nt, Hi;
|
2128
|
+
class ki extends HTMLElement {
|
2097
2129
|
constructor() {
|
2098
2130
|
super();
|
2099
|
-
p(this, Mt);
|
2100
|
-
p(this, qt);
|
2101
2131
|
p(this, It);
|
2102
2132
|
p(this, Ot);
|
2133
|
+
p(this, Pt);
|
2134
|
+
p(this, Nt);
|
2103
2135
|
this.initialize = !1;
|
2104
2136
|
}
|
2105
2137
|
static get observedAttributes() {
|
@@ -2120,36 +2152,36 @@ class Ai extends HTMLElement {
|
|
2120
2152
|
switch (o.hasAttribute("multiple") ? "multiple" : "single") {
|
2121
2153
|
case "single":
|
2122
2154
|
const r = o.querySelector(`.dropdown-list li[data-option="${s}"]`);
|
2123
|
-
|
2155
|
+
w(r) ? x(o, [...o.s.allLi].indexOf(r)) : x(o, -1);
|
2124
2156
|
break;
|
2125
2157
|
case "multiple":
|
2126
2158
|
const l = [];
|
2127
2159
|
o.querySelector(".dropdown-list li").classList.remove("active"), s.split(",").forEach((u) => {
|
2128
2160
|
const h = o.querySelector(`.dropdown-list li[data-option="${u}"]`);
|
2129
|
-
|
2161
|
+
w(h) && (h.classList.add("active"), l.push(h));
|
2130
2162
|
});
|
2131
2163
|
const c = l.map((u) => [...o.s.allLi].indexOf(u));
|
2132
|
-
|
2164
|
+
x(o, c);
|
2133
2165
|
break;
|
2134
2166
|
}
|
2135
2167
|
else
|
2136
|
-
|
2168
|
+
x(o, -1);
|
2137
2169
|
o.emit("change");
|
2138
2170
|
break;
|
2139
2171
|
case "d4-placeholder":
|
2140
2172
|
if (e === null)
|
2141
2173
|
return;
|
2142
|
-
e !== s && o.s.value.index < 0 &&
|
2174
|
+
e !== s && o.s.value.index < 0 && x(o, o.s.value.index);
|
2143
2175
|
break;
|
2144
2176
|
}
|
2145
2177
|
}
|
2146
2178
|
connectedCallback() {
|
2147
2179
|
const t = this;
|
2148
|
-
t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this,
|
2180
|
+
t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this, It, $i).call(this));
|
2149
2181
|
}
|
2150
2182
|
open() {
|
2151
2183
|
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
|
2184
|
+
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
2185
|
height: ${o()}px;
|
2154
2186
|
z-index: 2;
|
2155
2187
|
`, this;
|
@@ -2171,14 +2203,14 @@ class Ai extends HTMLElement {
|
|
2171
2203
|
this.__events__.selectOption();
|
2172
2204
|
}
|
2173
2205
|
}
|
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
|
-
},
|
2206
|
+
It = new WeakSet(), $i = function() {
|
2207
|
+
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);
|
2208
|
+
}, Ot = new WeakSet(), xi = function() {
|
2209
|
+
this.s.childDom = this.childNodes, this.s.template = Is(this), this.innerHTML = "", this.append(this.s.template), d(this, Pt, Ci).call(this);
|
2210
|
+
}, Pt = new WeakSet(), Ci = function() {
|
2179
2211
|
var s;
|
2180
2212
|
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",
|
2213
|
+
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
2214
|
const e = t.getAttribute("d4-value");
|
2183
2215
|
switch (t.s.selectType) {
|
2184
2216
|
case "single":
|
@@ -2187,14 +2219,14 @@ Mt = new WeakSet(), Si = function() {
|
|
2187
2219
|
const r = document.querySelector(`dropdown-el[dist-select="${t.id}"]`), l = r ? r.getAttribute("d4-value") !== "" : !1;
|
2188
2220
|
if (r && l) {
|
2189
2221
|
const c = r.getAttribute("d4-value");
|
2190
|
-
if (
|
2222
|
+
if (Ns(t, c), t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.classList.remove("disabled"), t.getAttribute("d4-value") !== "") {
|
2191
2223
|
const u = e.split(",")[1];
|
2192
2224
|
o = t.querySelector(`.dropdown-list li[data-option="${u}"]`), t.setAttribute("d4-value", u);
|
2193
2225
|
}
|
2194
2226
|
}
|
2195
2227
|
} else
|
2196
2228
|
o = t.querySelector(`.dropdown-list li[data-option="${e}"]`);
|
2197
|
-
|
2229
|
+
w(o) ? (o.classList.add("active"), t.s.activeLi = o, t.s.value = {
|
2198
2230
|
index: [...t.s.allLi].indexOf(o),
|
2199
2231
|
id: e,
|
2200
2232
|
el: o
|
@@ -2208,7 +2240,7 @@ Mt = new WeakSet(), Si = function() {
|
|
2208
2240
|
const a = [];
|
2209
2241
|
e.split(",").forEach((r) => {
|
2210
2242
|
const l = t.querySelector(`.dropdown-list li[data-option="${r}"]`);
|
2211
|
-
|
2243
|
+
w(l) && a.push(l);
|
2212
2244
|
}), a.length > 0 ? t.s.value = {
|
2213
2245
|
index: a.map((r) => [...t.s.allLi].indexOf(r)),
|
2214
2246
|
id: a.map((r) => r.getAttribute("data-option")),
|
@@ -2220,8 +2252,8 @@ Mt = new WeakSet(), Si = function() {
|
|
2220
2252
|
};
|
2221
2253
|
break;
|
2222
2254
|
}
|
2223
|
-
|
2224
|
-
},
|
2255
|
+
x(t, t.s.value.index), d(s = t, Nt, Hi).call(s), t.classList.add("d4-initialize");
|
2256
|
+
}, Nt = new WeakSet(), Hi = function() {
|
2225
2257
|
const t = this;
|
2226
2258
|
t.__events__.dropdownToggle = () => {
|
2227
2259
|
t.addEventListener("click", function(e) {
|
@@ -2243,7 +2275,7 @@ Mt = new WeakSet(), Si = function() {
|
|
2243
2275
|
const r = t.querySelector(".dropdown-scroller"), l = () => {
|
2244
2276
|
if (t.__scroller__) {
|
2245
2277
|
const { viewport: c } = t.__scroller__.elements();
|
2246
|
-
if (
|
2278
|
+
if (w(t.s.activeLi)) {
|
2247
2279
|
const u = t.s.activeLi.clientHeight / 2, h = t.s.activeLi.offsetTop, m = h - r.clientHeight / 2 + u > 0 ? h - r.clientHeight / 2 + u : 0;
|
2248
2280
|
c.scrollTo({
|
2249
2281
|
top: m,
|
@@ -2267,7 +2299,7 @@ Mt = new WeakSet(), Si = function() {
|
|
2267
2299
|
t.s.dropdownEl.addEventListener("transitionend", e);
|
2268
2300
|
}, t.__events__.bindScrollbar = (e = this) => {
|
2269
2301
|
const s = e.querySelector(".dropdown-scroller");
|
2270
|
-
e.__scroller__ =
|
2302
|
+
e.__scroller__ = Me(s, {
|
2271
2303
|
overflowBehavior: {
|
2272
2304
|
x: "hidden"
|
2273
2305
|
}
|
@@ -2277,34 +2309,34 @@ Mt = new WeakSet(), Si = function() {
|
|
2277
2309
|
const a = e.querySelector(".dropdown-scroller"), r = e.classList.contains("city");
|
2278
2310
|
e.s.allLi = e.querySelectorAll(".dropdown-list li"), e.s.allLi.forEach((l) => {
|
2279
2311
|
l.addEventListener("click", function(c) {
|
2280
|
-
var
|
2312
|
+
var g;
|
2281
2313
|
const u = this, h = [...e.s.allLi].indexOf(u), m = parseInt(e.getAttribute("d4-default-height"));
|
2282
2314
|
if (u.classList.contains("has-sublayer")) {
|
2283
2315
|
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),
|
2316
|
+
const v = u.querySelector(".sub-dropdown"), b = v.querySelector(".sub-dropdown-list"), y = parseInt(getComputedStyle(b).marginTop) + parseInt(getComputedStyle(b).marginBottom);
|
2317
|
+
v.style.cssText = `--height: ${b.offsetHeight + y}px`;
|
2318
|
+
const H = parseInt(v.style.cssText.replace("--height:", "").trim()), G = parseInt(getComputedStyle(a).maxHeight), S = () => {
|
2287
2319
|
s = m + e.s.subDropdownTotalH, o = s > G ? G : s, e.style.cssText = `--maxHeight: ${o}px;`, e.s.dropdownEl.style.height = `${o}px`;
|
2288
2320
|
};
|
2289
|
-
u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -= H,
|
2321
|
+
u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -= H, S()) : (u.classList.add("open"), e.s.subDropdownTotalH += H, S());
|
2290
2322
|
const X = () => {
|
2291
2323
|
e.__scroller__.update(!0), v.removeEventListener("transitionend", X);
|
2292
2324
|
};
|
2293
2325
|
v.addEventListener("transitionend", X);
|
2294
2326
|
} else
|
2295
|
-
switch (
|
2327
|
+
switch (Os(e), e.s.selectType) {
|
2296
2328
|
case "single":
|
2297
2329
|
if (e.setAttribute("d4-value", u.getAttribute("data-option")), r) {
|
2298
|
-
const v = e.s.cityLang,
|
2299
|
-
|
2300
|
-
const
|
2301
|
-
|
2302
|
-
}), e.__events__.selectOption(
|
2330
|
+
const v = e.s.cityLang, b = l.textContent.trim(), y = document.getElementById(e.getAttribute("dist-select"));
|
2331
|
+
y && (y.querySelector(".dropdown-list").textContent = "", x(y, -1), Oe[v][b].forEach((H, G) => {
|
2332
|
+
const S = document.createElement("li");
|
2333
|
+
S.textContent = H[0], S.setAttribute("data-option", H[0]), y.querySelector(".dropdown-list").append(S);
|
2334
|
+
}), e.__events__.selectOption(y));
|
2303
2335
|
}
|
2304
|
-
(
|
2336
|
+
(g = u.parentNode.closest("li")) != null && g.classList.contains("has-sublayer") && (c.stopPropagation(), e.close());
|
2305
2337
|
break;
|
2306
2338
|
case "multiple":
|
2307
|
-
c.stopPropagation(), u.classList.toggle("active"),
|
2339
|
+
c.stopPropagation(), u.classList.toggle("active"), x(e, h);
|
2308
2340
|
break;
|
2309
2341
|
}
|
2310
2342
|
});
|
@@ -2337,8 +2369,8 @@ Mt = new WeakSet(), Si = function() {
|
|
2337
2369
|
});
|
2338
2370
|
}, t.__events__.dropdownToggle(), t.__events__.bindScrollbar(), t.__events__.selectOption(), t.__events__.filterHandler(), t.__events__.removeTag(), t.__events__.transitionend();
|
2339
2371
|
};
|
2340
|
-
Object.assign(
|
2341
|
-
customElements.define("dropdown-el",
|
2372
|
+
Object.assign(ki.prototype, O);
|
2373
|
+
customElements.define("dropdown-el", ki);
|
2342
2374
|
function ct(n) {
|
2343
2375
|
const i = {};
|
2344
2376
|
return [...n.attributes].forEach((t) => {
|
@@ -2348,7 +2380,7 @@ function ct(n) {
|
|
2348
2380
|
}
|
2349
2381
|
}), Object.keys(i).length === 0 ? null : i;
|
2350
2382
|
}
|
2351
|
-
function
|
2383
|
+
function Be(n) {
|
2352
2384
|
if (ct(n)) {
|
2353
2385
|
let i;
|
2354
2386
|
const t = Object.keys(ct(n)).map((e) => ({
|
@@ -2364,7 +2396,7 @@ function ze(n) {
|
|
2364
2396
|
} else
|
2365
2397
|
return n.s.options.duration;
|
2366
2398
|
}
|
2367
|
-
function
|
2399
|
+
function zs(n) {
|
2368
2400
|
const { behavior: i, continual: t, gap: e } = n.s.options, s = n.childNodes, o = document.createElement("div"), a = document.createElement("div");
|
2369
2401
|
o.className = "animate-container", a.className = "animate-item", [...s].forEach((l) => {
|
2370
2402
|
a.append(l);
|
@@ -2375,7 +2407,7 @@ function Os(n) {
|
|
2375
2407
|
}
|
2376
2408
|
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
2409
|
}
|
2378
|
-
function
|
2410
|
+
function _(n) {
|
2379
2411
|
const { behavior: i, direction: t, continual: e } = n.s.options;
|
2380
2412
|
let s = {};
|
2381
2413
|
switch (i) {
|
@@ -2431,20 +2463,20 @@ function D(n) {
|
|
2431
2463
|
}
|
2432
2464
|
return s;
|
2433
2465
|
}
|
2434
|
-
function
|
2466
|
+
function Ws(n) {
|
2435
2467
|
let i;
|
2436
2468
|
return function(t) {
|
2437
2469
|
i && clearTimeout(i), i = setTimeout(n, 200, t);
|
2438
2470
|
};
|
2439
2471
|
}
|
2440
|
-
var
|
2441
|
-
class
|
2472
|
+
var jt, Mi, zt, qi, Wt, Ii, Bt, Oi;
|
2473
|
+
class Bs extends HTMLElement {
|
2442
2474
|
constructor() {
|
2443
2475
|
super();
|
2444
|
-
p(this, Nt);
|
2445
|
-
p(this, Pt);
|
2446
2476
|
p(this, jt);
|
2447
2477
|
p(this, zt);
|
2478
|
+
p(this, Wt);
|
2479
|
+
p(this, Bt);
|
2448
2480
|
this.initialize = !1;
|
2449
2481
|
}
|
2450
2482
|
static get observedAttributes() {
|
@@ -2453,7 +2485,7 @@ class Ps extends HTMLElement {
|
|
2453
2485
|
attributeChangedCallback(t, e, s) {
|
2454
2486
|
}
|
2455
2487
|
connectedCallback() {
|
2456
|
-
this.initialize || (this.initialize = !0, d(this,
|
2488
|
+
this.initialize || (this.initialize = !0, d(this, jt, Mi).call(this));
|
2457
2489
|
}
|
2458
2490
|
play() {
|
2459
2491
|
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 +2494,25 @@ class Ps extends HTMLElement {
|
|
2462
2494
|
this.s.animation.pause(), this.s.options.continual && this.s.cloneAnimation.pause();
|
2463
2495
|
}
|
2464
2496
|
}
|
2465
|
-
|
2497
|
+
jt = new WeakSet(), Mi = function() {
|
2466
2498
|
const t = {
|
2467
|
-
direction: this.getAttribute("direction") ||
|
2499
|
+
direction: this.getAttribute("direction") || $.SETTINGS.direction,
|
2468
2500
|
// up / down / left / right
|
2469
|
-
behavior: this.getAttribute("behavior") ||
|
2501
|
+
behavior: this.getAttribute("behavior") || $.SETTINGS.behavior,
|
2470
2502
|
// normal / alternate / endStop
|
2471
|
-
duration: Number(this.getAttribute("duration")) ||
|
2503
|
+
duration: Number(this.getAttribute("duration")) || $.SETTINGS.duration,
|
2472
2504
|
// ms
|
2473
|
-
durationBreakpoints: ct(this) ||
|
2474
|
-
autoplay: this.getAttribute("autoplay") ||
|
2505
|
+
durationBreakpoints: ct(this) || $.SETTINGS.durationBreakpoints,
|
2506
|
+
autoplay: this.getAttribute("autoplay") || $.SETTINGS.autoplay,
|
2475
2507
|
// normal / alternate / endStop
|
2476
|
-
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" :
|
2508
|
+
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : $.SETTINGS.pauseOnMouseenter,
|
2477
2509
|
// true / false
|
2478
|
-
continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" :
|
2510
|
+
continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" : $.SETTINGS.continual,
|
2479
2511
|
// true / false
|
2480
|
-
gap: Number(this.getAttribute("gap")) ||
|
2512
|
+
gap: Number(this.getAttribute("gap")) || $.SETTINGS.gap
|
2481
2513
|
};
|
2482
|
-
this.s = {}, this.s.options = t, this.s.nowDuration =
|
2483
|
-
},
|
2514
|
+
this.s = {}, this.s.options = t, this.s.nowDuration = Be(this), zs(this), d(this, zt, qi).call(this);
|
2515
|
+
}, zt = new WeakSet(), qi = function() {
|
2484
2516
|
const { direction: t, continual: e, gap: s } = this.s.options;
|
2485
2517
|
switch (t) {
|
2486
2518
|
case "left":
|
@@ -2492,24 +2524,24 @@ Nt = new WeakSet(), $i = function() {
|
|
2492
2524
|
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
2525
|
break;
|
2494
2526
|
}
|
2495
|
-
d(this,
|
2496
|
-
},
|
2527
|
+
d(this, Wt, Ii).call(this), d(this, Bt, Oi).call(this), e && this.classList.add("continual"), this.classList.add("m4-initialize");
|
2528
|
+
}, Wt = new WeakSet(), Ii = function() {
|
2497
2529
|
const t = this, { direction: e, behavior: s, duration: o, autoplay: a, pauseOnMouseenter: r, continual: l } = t.s.options;
|
2498
2530
|
let c;
|
2499
2531
|
function u() {
|
2500
2532
|
switch (s) {
|
2501
2533
|
case "normal":
|
2502
|
-
t.s.animateEl.style.transform = `${
|
2534
|
+
t.s.animateEl.style.transform = `${_(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(_(t).animate1, {
|
2503
2535
|
duration: t.s.nowDuration,
|
2504
2536
|
iterations: 1 / 0
|
2505
|
-
}), l && (t.s.cloneAnimateEl.style.transform = `${
|
2537
|
+
}), l && (t.s.cloneAnimateEl.style.transform = `${_(t).animate2[0].transform}`, t.s.cloneAnimation = t.s.cloneAnimateEl.animate(_(t).animate2, {
|
2506
2538
|
duration: t.s.nowDuration,
|
2507
2539
|
delay: -t.s.nowDuration / 2,
|
2508
2540
|
iterations: 1 / 0
|
2509
2541
|
}));
|
2510
2542
|
break;
|
2511
2543
|
case "alternate":
|
2512
|
-
let
|
2544
|
+
let g = function() {
|
2513
2545
|
let v = [];
|
2514
2546
|
switch (e) {
|
2515
2547
|
case "top":
|
@@ -2527,11 +2559,11 @@ Nt = new WeakSet(), $i = function() {
|
|
2527
2559
|
}
|
2528
2560
|
return v;
|
2529
2561
|
}, h, m;
|
2530
|
-
(t.clientHeight > t.s.animateEl.scrollHeight || e === "left" || e === "right") && (t.s.animateEl.style.transform = `${
|
2562
|
+
(t.clientHeight > t.s.animateEl.scrollHeight || e === "left" || e === "right") && (t.s.animateEl.style.transform = `${g()[0].transform}`, t.s.animateEl.animate(g(), {
|
2531
2563
|
duration: m,
|
2532
2564
|
fill: "forwards"
|
2533
2565
|
}).finished.then(() => {
|
2534
|
-
t.s.animation = t.s.animateEl.animate(
|
2566
|
+
t.s.animation = t.s.animateEl.animate(_(t).animate1, {
|
2535
2567
|
duration: t.s.nowDuration,
|
2536
2568
|
iterations: 1 / 0
|
2537
2569
|
});
|
@@ -2540,7 +2572,7 @@ Nt = new WeakSet(), $i = function() {
|
|
2540
2572
|
});
|
2541
2573
|
break;
|
2542
2574
|
case "endStop":
|
2543
|
-
t.s.animateEl.style.transform = `${
|
2575
|
+
t.s.animateEl.style.transform = `${_(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(_(t).animate1, {
|
2544
2576
|
duration: t.s.nowDuration,
|
2545
2577
|
fill: "forwards"
|
2546
2578
|
});
|
@@ -2558,28 +2590,28 @@ Nt = new WeakSet(), $i = function() {
|
|
2558
2590
|
}), t.addEventListener("mouseleave", function() {
|
2559
2591
|
t.s.animation && r && t.s.animation.playState === "paused" && t.play();
|
2560
2592
|
});
|
2561
|
-
},
|
2593
|
+
}, Bt = new WeakSet(), Oi = function() {
|
2562
2594
|
const t = this;
|
2563
2595
|
function e() {
|
2564
2596
|
const s = t.s.animation.startTime, o = t.s.cloneAnimation ? t.s.cloneAnimation.startTime : null;
|
2565
|
-
t.s.nowDuration =
|
2597
|
+
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
2598
|
duration: t.s.nowDuration,
|
2567
2599
|
iterations: 1 / 0
|
2568
|
-
}), t.s.animation.startTime = s, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(
|
2600
|
+
}), t.s.animation.startTime = s, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(_(t).animate2, {
|
2569
2601
|
duration: t.s.nowDuration,
|
2570
2602
|
delay: -t.s.nowDuration / 2,
|
2571
2603
|
iterations: 1 / 0
|
2572
2604
|
}), t.s.cloneAnimation.startTime = o);
|
2573
2605
|
}
|
2574
|
-
window.addEventListener("resize",
|
2606
|
+
window.addEventListener("resize", Ws(e));
|
2575
2607
|
};
|
2576
|
-
customElements.define("marquee-el",
|
2608
|
+
customElements.define("marquee-el", Bs);
|
2577
2609
|
const ht = function(n, i) {
|
2578
2610
|
let t;
|
2579
2611
|
return function(e) {
|
2580
2612
|
t && clearTimeout(t), t = setTimeout(n, 200, e);
|
2581
2613
|
};
|
2582
|
-
},
|
2614
|
+
}, k = (n, i) => {
|
2583
2615
|
if (rt(n)) {
|
2584
2616
|
n.forEach((t) => {
|
2585
2617
|
t.classList.add(i);
|
@@ -2587,7 +2619,7 @@ const ht = function(n, i) {
|
|
2587
2619
|
return;
|
2588
2620
|
}
|
2589
2621
|
n.classList.add(i);
|
2590
|
-
},
|
2622
|
+
}, D = (n, i) => {
|
2591
2623
|
if (rt(n)) {
|
2592
2624
|
n.forEach((t) => {
|
2593
2625
|
t.classList.remove(i);
|
@@ -2596,26 +2628,26 @@ const ht = function(n, i) {
|
|
2596
2628
|
}
|
2597
2629
|
n.classList.remove(i);
|
2598
2630
|
};
|
2599
|
-
var
|
2600
|
-
class
|
2631
|
+
var Gt, Pi, Xt, Ni, Rt, ji, tt, _e, W, dt, Ft, zi;
|
2632
|
+
class Ge {
|
2601
2633
|
constructor(i) {
|
2602
2634
|
// 初始化
|
2603
|
-
p(this,
|
2635
|
+
p(this, Gt);
|
2604
2636
|
// 左右箭頭事件綁定
|
2605
|
-
p(this,
|
2637
|
+
p(this, Xt);
|
2606
2638
|
// 左右拖拉事件綁定
|
2607
|
-
p(this,
|
2639
|
+
p(this, Rt);
|
2608
2640
|
// 卷軸位置判斷
|
2609
2641
|
p(this, tt);
|
2610
2642
|
// 隱藏按鈕判斷
|
2611
2643
|
p(this, W);
|
2612
2644
|
// 選項事件綁定
|
2613
|
-
p(this,
|
2614
|
-
this.$element = i, this.option = i.s.option.drag, d(this,
|
2645
|
+
p(this, Ft);
|
2646
|
+
this.$element = i, this.option = i.s.option.drag, d(this, Gt, Pi).call(this);
|
2615
2647
|
}
|
2616
2648
|
// 更新 active 位置
|
2617
2649
|
update(i) {
|
2618
|
-
const t =
|
2650
|
+
const t = this.$element.querySelector(".wrapper"), e = t == null ? void 0 : t.querySelector(".active");
|
2619
2651
|
if (e) {
|
2620
2652
|
const s = e.offsetLeft + e.getBoundingClientRect().width / 2 - t.getBoundingClientRect().width / 2;
|
2621
2653
|
t.scrollTo({
|
@@ -2625,7 +2657,7 @@ class We {
|
|
2625
2657
|
}
|
2626
2658
|
}
|
2627
2659
|
}
|
2628
|
-
|
2660
|
+
Gt = new WeakSet(), Pi = function() {
|
2629
2661
|
var e, s, o, a, r, l;
|
2630
2662
|
const i = this;
|
2631
2663
|
if (!i.$element)
|
@@ -2633,10 +2665,10 @@ Wt = new WeakSet(), Mi = function() {
|
|
2633
2665
|
i.$container = i.$element.querySelector(".drag-container"), i.$wrapper = i.$container.querySelector(".wrapper");
|
2634
2666
|
const t = () => {
|
2635
2667
|
var c, u;
|
2636
|
-
d(c = i, tt,
|
2668
|
+
d(c = i, tt, _e).call(c), d(u = i, W, dt).call(u);
|
2637
2669
|
};
|
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
|
-
|
2670
|
+
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(
|
2671
|
+
E.prepend,
|
2640
2672
|
`<div class="navigation">
|
2641
2673
|
<div class="button prev">
|
2642
2674
|
<div></div>
|
@@ -2645,8 +2677,8 @@ Wt = new WeakSet(), Mi = function() {
|
|
2645
2677
|
<div></div>
|
2646
2678
|
</div>
|
2647
2679
|
</div>`
|
2648
|
-
), i.$button = (s = i.$container) == null ? void 0 : s.querySelectorAll(".button"), d(o = i,
|
2649
|
-
},
|
2680
|
+
), 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();
|
2681
|
+
}, Xt = new WeakSet(), Ni = function() {
|
2650
2682
|
const i = this, { $wrapper: t, $button: e } = i, s = function() {
|
2651
2683
|
const o = this.classList.contains("next"), a = parseInt(t.getBoundingClientRect().width * 0.7);
|
2652
2684
|
t.scrollTo({
|
@@ -2660,7 +2692,7 @@ Wt = new WeakSet(), Mi = function() {
|
|
2660
2692
|
e.forEach((o) => {
|
2661
2693
|
o.removeEventListener("click", s), o.addEventListener("click", s);
|
2662
2694
|
});
|
2663
|
-
},
|
2695
|
+
}, Rt = new WeakSet(), ji = function() {
|
2664
2696
|
const { $wrapper: i } = this;
|
2665
2697
|
let t = !1, e = !1, s = 0, o = 0;
|
2666
2698
|
const a = function(h) {
|
@@ -2678,9 +2710,9 @@ Wt = new WeakSet(), Mi = function() {
|
|
2678
2710
|
const c = function(h) {
|
2679
2711
|
if (h.preventDefault(), e = !0, !t)
|
2680
2712
|
return;
|
2681
|
-
const
|
2713
|
+
const g = h.pageX - i.offsetLeft - s;
|
2682
2714
|
i.scrollTo({
|
2683
|
-
left: o -
|
2715
|
+
left: o - g
|
2684
2716
|
});
|
2685
2717
|
};
|
2686
2718
|
i.removeEventListener("mousemove", c), i.addEventListener("mousemove", c);
|
@@ -2690,32 +2722,32 @@ Wt = new WeakSet(), Mi = function() {
|
|
2690
2722
|
i.querySelectorAll("a").forEach((h) => {
|
2691
2723
|
h.removeEventListener("click", u), h.addEventListener("click", u);
|
2692
2724
|
});
|
2693
|
-
}, tt = new WeakSet(),
|
2725
|
+
}, tt = new WeakSet(), _e = function() {
|
2694
2726
|
const { $container: i, $wrapper: t } = this, e = t.scrollWidth - t.clientWidth, s = t.scrollLeft;
|
2695
|
-
e <= 0 || (
|
2727
|
+
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
2728
|
}, W = new WeakSet(), dt = function() {
|
2697
2729
|
const { $wrapper: i, $button: t, $element: e } = this;
|
2698
2730
|
if (!t)
|
2699
2731
|
return;
|
2700
2732
|
const s = i.scrollWidth - i.clientWidth, o = i.scrollLeft;
|
2701
|
-
if (
|
2702
|
-
|
2733
|
+
if (s <= 0) {
|
2734
|
+
k(t, "hide"), D(t, "active"), k(e, "noScrollable");
|
2703
2735
|
return;
|
2704
2736
|
}
|
2705
|
-
s > 0 && (
|
2737
|
+
s > 0 && (k(t, "active"), D(e, "noScrollable")), o == 0 ? t.forEach((a) => {
|
2706
2738
|
if (a.classList.contains("next")) {
|
2707
|
-
|
2739
|
+
D(a, "hide");
|
2708
2740
|
return;
|
2709
2741
|
}
|
2710
|
-
|
2742
|
+
k(a, "hide");
|
2711
2743
|
}) : o >= s ? t.forEach((a) => {
|
2712
2744
|
if (a.classList.contains("next")) {
|
2713
|
-
|
2745
|
+
k(a, "hide");
|
2714
2746
|
return;
|
2715
2747
|
}
|
2716
|
-
|
2717
|
-
}) :
|
2718
|
-
},
|
2748
|
+
D(a, "hide");
|
2749
|
+
}) : D(t, "hide");
|
2750
|
+
}, Ft = new WeakSet(), zi = function() {
|
2719
2751
|
const { $element: i } = this, t = (s) => {
|
2720
2752
|
if (this.option.selected) {
|
2721
2753
|
const o = s.getAttribute("data-option").trim();
|
@@ -2729,31 +2761,31 @@ Wt = new WeakSet(), Mi = function() {
|
|
2729
2761
|
s.removeEventListener("click", e), s.addEventListener("click", e);
|
2730
2762
|
});
|
2731
2763
|
};
|
2732
|
-
var
|
2733
|
-
class
|
2764
|
+
var Yt, Wi, Ut, Bi, Jt, Gi, Zt, Xi;
|
2765
|
+
class Gs {
|
2734
2766
|
constructor(i) {
|
2735
2767
|
// 初始化
|
2736
|
-
p(this,
|
2768
|
+
p(this, Yt);
|
2737
2769
|
// 隱藏按鈕判斷
|
2738
|
-
p(this,
|
2770
|
+
p(this, Ut);
|
2739
2771
|
// 展開箭頭事件綁定
|
2740
|
-
p(this,
|
2772
|
+
p(this, Jt);
|
2741
2773
|
// 選項事件綁定
|
2742
|
-
p(this,
|
2743
|
-
this.$element = i, this.option = i.s.option.collapse, d(this,
|
2774
|
+
p(this, Zt);
|
2775
|
+
this.$element = i, this.option = i.s.option.collapse, d(this, Yt, Wi).call(this);
|
2744
2776
|
}
|
2745
2777
|
}
|
2746
|
-
|
2747
|
-
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this,
|
2748
|
-
},
|
2778
|
+
Yt = new WeakSet(), Wi = function() {
|
2779
|
+
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));
|
2780
|
+
}, Ut = new WeakSet(), Bi = function() {
|
2749
2781
|
const i = this.$element.querySelector(".drag-container"), t = i.querySelector(".wrapper");
|
2750
|
-
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(
|
2751
|
-
},
|
2782
|
+
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(E.append, '<div class="open-collapse"></div>'), this.$button = i.querySelector(".open-collapse"), !0) : !1;
|
2783
|
+
}, Jt = new WeakSet(), Gi = function() {
|
2752
2784
|
const { $element: i, $button: t } = this, e = function() {
|
2753
2785
|
i.classList.contains("expand") ? i.classList.remove("expand") : i.classList.add("expand");
|
2754
2786
|
};
|
2755
2787
|
t.removeEventListener("click", e), t.addEventListener("click", e);
|
2756
|
-
},
|
2788
|
+
}, Zt = new WeakSet(), Xi = function() {
|
2757
2789
|
const { $element: i } = this, t = (s, o) => {
|
2758
2790
|
if (i != null && i.classList.contains("expand") ? i == null || i.classList.remove("expand") : i == null || i.classList.add("expand"), this.option.selected) {
|
2759
2791
|
const a = s.getAttribute("data-option").trim();
|
@@ -2767,16 +2799,16 @@ Rt = new WeakSet(), Ni = function() {
|
|
2767
2799
|
s.removeEventListener("click", e), s.addEventListener("click", e);
|
2768
2800
|
});
|
2769
2801
|
};
|
2770
|
-
const
|
2802
|
+
const Xs = (n) => {
|
2771
2803
|
const { type: i, option: t, originalDomString: e } = n.s, s = document.createElement("div");
|
2772
|
-
return i == "drag" && (s.innerHTML =
|
2804
|
+
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
2805
|
};
|
2774
|
-
var
|
2775
|
-
class
|
2806
|
+
var Qt, Ri, Vt, Fi, et, ke, B, ut;
|
2807
|
+
class Rs extends HTMLElement {
|
2776
2808
|
constructor() {
|
2777
2809
|
super();
|
2778
|
-
p(this,
|
2779
|
-
p(this,
|
2810
|
+
p(this, Qt);
|
2811
|
+
p(this, Vt);
|
2780
2812
|
// 斷點設定
|
2781
2813
|
p(this, et);
|
2782
2814
|
// check type
|
@@ -2809,15 +2841,15 @@ class Ws extends HTMLElement {
|
|
2809
2841
|
}
|
2810
2842
|
}
|
2811
2843
|
connectedCallback() {
|
2812
|
-
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this,
|
2844
|
+
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this, Qt, Ri).call(this));
|
2813
2845
|
}
|
2814
2846
|
update() {
|
2815
|
-
d(this, et,
|
2847
|
+
d(this, et, ke).call(this);
|
2816
2848
|
}
|
2817
2849
|
}
|
2818
|
-
|
2850
|
+
Qt = new WeakSet(), Ri = function() {
|
2819
2851
|
let t = {};
|
2820
|
-
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ??
|
2852
|
+
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
2853
|
const e = (s) => {
|
2822
2854
|
if (s.type === "resize") {
|
2823
2855
|
if (window.innerWidth === this.previousWidth)
|
@@ -2826,10 +2858,10 @@ Jt = new WeakSet(), Wi = function() {
|
|
2826
2858
|
}
|
2827
2859
|
this.update();
|
2828
2860
|
};
|
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(),
|
2861
|
+
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);
|
2862
|
+
}, Vt = new WeakSet(), Fi = function() {
|
2863
|
+
this.classList.add("m4-init"), d(this, et, ke).call(this);
|
2864
|
+
}, et = new WeakSet(), ke = function() {
|
2833
2865
|
const t = Object.keys(this.s.option.breakpoint);
|
2834
2866
|
if (!t.length) {
|
2835
2867
|
d(this, B, ut).call(this);
|
@@ -2842,72 +2874,72 @@ Jt = new WeakSet(), Wi = function() {
|
|
2842
2874
|
}, B = new WeakSet(), ut = function() {
|
2843
2875
|
var o;
|
2844
2876
|
const { type: t } = this.s;
|
2845
|
-
this.innerHTML = "", [...
|
2877
|
+
this.innerHTML = "", [...Xs(this)].forEach((a) => {
|
2846
2878
|
this.append(a);
|
2847
2879
|
});
|
2848
2880
|
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
2881
|
switch (e == null || e.classList.add("active"), s == null || s.classList.add("active"), t) {
|
2850
2882
|
case "drag":
|
2851
2883
|
setTimeout(() => {
|
2852
|
-
this.constructor.drag = new
|
2884
|
+
this.constructor.drag = new Ge(this);
|
2853
2885
|
}, 10);
|
2854
2886
|
break;
|
2855
2887
|
case "collapse":
|
2856
2888
|
setTimeout(() => {
|
2857
|
-
this.constructor.drag = new
|
2889
|
+
this.constructor.drag = new Ge(this), this.constructor.collapse = new Gs(this);
|
2858
2890
|
}, 10);
|
2859
2891
|
break;
|
2860
2892
|
}
|
2861
2893
|
(o = this.constructor.drag) == null || o.update(this);
|
2862
2894
|
};
|
2863
|
-
customElements.define("multipurpose-nav",
|
2864
|
-
var
|
2865
|
-
class
|
2895
|
+
customElements.define("multipurpose-nav", Rs);
|
2896
|
+
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;
|
2897
|
+
class Yi extends HTMLElement {
|
2866
2898
|
// 定義組件的初始狀態
|
2867
2899
|
constructor(t, e) {
|
2868
2900
|
super();
|
2869
|
-
p(this,
|
2870
|
-
p(this,
|
2901
|
+
p(this, Kt);
|
2902
|
+
p(this, te);
|
2871
2903
|
// 第一關 判斷數量以及id設定
|
2872
2904
|
p(this, it);
|
2873
2905
|
// 第二關 id命名提醒
|
2874
|
-
p(this,
|
2875
|
-
p(this, Kt);
|
2876
|
-
p(this, te);
|
2906
|
+
p(this, N);
|
2877
2907
|
p(this, ee);
|
2908
|
+
p(this, ie);
|
2909
|
+
p(this, se);
|
2878
2910
|
// 執行函式
|
2879
2911
|
// 移動至指定位置
|
2880
|
-
p(this,
|
2912
|
+
p(this, ne);
|
2881
2913
|
// 移動
|
2882
|
-
p(this,
|
2914
|
+
p(this, oe);
|
2883
2915
|
// 步驟狀態
|
2884
|
-
p(this,
|
2916
|
+
p(this, ae);
|
2885
2917
|
// next 按鈕狀態
|
2886
|
-
p(this,
|
2918
|
+
p(this, re);
|
2887
2919
|
// prev 按鈕狀態
|
2888
|
-
p(this,
|
2920
|
+
p(this, le);
|
2889
2921
|
// 頁籤狀態
|
2890
|
-
p(this,
|
2922
|
+
p(this, ce);
|
2891
2923
|
// 第三關各種元件判斷 及 執行
|
2892
2924
|
p(this, q);
|
2893
2925
|
// 消失動畫
|
2894
|
-
p(this,
|
2926
|
+
p(this, de);
|
2895
2927
|
// 出現動畫
|
2896
|
-
p(this,
|
2928
|
+
p(this, ue);
|
2897
2929
|
// 狀態
|
2898
|
-
p(this,
|
2930
|
+
p(this, he);
|
2899
2931
|
// resize
|
2900
|
-
p(this,
|
2932
|
+
p(this, pe);
|
2901
2933
|
}
|
2902
2934
|
// 當組件的屬性被更改時會被呼叫
|
2903
2935
|
static get observedAttributes() {
|
2904
2936
|
return ["t4-active"];
|
2905
2937
|
}
|
2906
2938
|
attributeChangedCallback(t, e, s) {
|
2907
|
-
t === "t4-active" && e !== s && d(this,
|
2939
|
+
t === "t4-active" && e !== s && d(this, he, rs).call(this, s);
|
2908
2940
|
}
|
2909
2941
|
connectedCallback() {
|
2910
|
-
this.classList.contains("t4-initialize") || d(this,
|
2942
|
+
this.classList.contains("t4-initialize") || d(this, Kt, Ui).call(this);
|
2911
2943
|
}
|
2912
2944
|
// ------------- 我是分隔線呦 -------------
|
2913
2945
|
// 頁籤切換
|
@@ -2921,28 +2953,28 @@ class Gi extends HTMLElement {
|
|
2921
2953
|
setActiveTab(t) {
|
2922
2954
|
const { t: e } = this, s = t === "" ? e.tabPanels[0].getAttribute("t4-id") : t;
|
2923
2955
|
e.activeTab = s, this.setAttribute("t4-active", s);
|
2924
|
-
const o = d(this,
|
2956
|
+
const o = d(this, N, F).call(this, s);
|
2925
2957
|
e.tabPanels.forEach((a, r) => {
|
2926
|
-
r === o ? d(this,
|
2958
|
+
r === o ? d(this, ue, as).call(this, r) : d(this, de, os).call(this, r);
|
2927
2959
|
});
|
2928
2960
|
}
|
2929
2961
|
// 外部呼叫方法 $0.goNext()
|
2930
2962
|
goNext() {
|
2931
|
-
const t = d(this,
|
2963
|
+
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
2964
|
this.setActiveTab(s);
|
2933
2965
|
}
|
2934
2966
|
// 外部呼叫方法 $0.goPrev()
|
2935
2967
|
goPrev() {
|
2936
|
-
const t = d(this,
|
2968
|
+
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
2969
|
this.setActiveTab(s);
|
2938
2970
|
}
|
2939
2971
|
// 外部呼叫方法 $0.update()
|
2940
2972
|
update() {
|
2941
|
-
this.t.tabs = d(this, it,
|
2973
|
+
this.t.tabs = d(this, it, $e).call(this), cs(), console.log("tab update!!!!");
|
2942
2974
|
}
|
2943
2975
|
}
|
2944
|
-
|
2945
|
-
const t = this.getAttribute("t4-name"), { SETTINGS: e } =
|
2976
|
+
Kt = new WeakSet(), Ui = function() {
|
2977
|
+
const t = this.getAttribute("t4-name"), { SETTINGS: e } = Ue;
|
2946
2978
|
document.querySelectorAll(`tab-el[t4-name=${t}]`).length > 1 && console.warn(t, "名字有重複喔!!!"), this.t = {
|
2947
2979
|
tabs: [],
|
2948
2980
|
name: t,
|
@@ -2961,36 +2993,36 @@ Qt = new WeakSet(), Xi = function() {
|
|
2961
2993
|
delay: this.getAttribute("t4-delay") || e.transition.delay
|
2962
2994
|
},
|
2963
2995
|
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,
|
2996
|
+
}, 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);
|
2997
|
+
}, te = new WeakSet(), Ji = function() {
|
2998
|
+
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this, ee, Zi).call(this), this.t.recordUrl) {
|
2967
2999
|
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
3000
|
e && s.length === 1 ? this.t.activeTab = e : console.warn(`沒有${e}這頁喔!!`);
|
2969
3001
|
}
|
2970
|
-
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this,
|
2971
|
-
}, it = new WeakSet(),
|
3002
|
+
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this, pe, ls).call(this);
|
3003
|
+
}, it = new WeakSet(), $e = function() {
|
2972
3004
|
const { t } = this, e = Array.from(document.querySelectorAll(`[t4-control="${t.name}"][t4-role="tab"]`));
|
2973
3005
|
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
3006
|
s.getAttribute("t4-id") || console.warn(s, "請幫我設定id!!");
|
2975
3007
|
}), e;
|
2976
|
-
},
|
3008
|
+
}, N = new WeakSet(), F = function(t) {
|
2977
3009
|
const { t: e } = this, s = e.tabPanels.filter((a) => a.getAttribute("t4-id") === t);
|
2978
3010
|
s.length > 1 && console.warn("有兩個相同id設定", s);
|
2979
3011
|
const o = s[0];
|
2980
3012
|
return o ? e.tabPanels.indexOf(o) : (console.warn(`找不到t4-id為${t}的頁籤`), 0);
|
2981
|
-
},
|
3013
|
+
}, ee = new WeakSet(), Zi = function() {
|
2982
3014
|
const t = document.createElement("div");
|
2983
3015
|
t.classList.add("swiper-container");
|
2984
3016
|
const e = document.createElement("div");
|
2985
3017
|
e.classList.add("swiper-wrapper"), this.t.tabPanels.forEach((s) => {
|
2986
3018
|
e.appendChild(s.cloneNode(!0));
|
2987
|
-
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this,
|
2988
|
-
},
|
3019
|
+
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this, ie, Qi).call(this);
|
3020
|
+
}, ie = new WeakSet(), Qi = function() {
|
2989
3021
|
const t = this.querySelector(".swiper-container"), e = this.querySelector(".swiper-wrapper"), s = this.t.tabPanels;
|
2990
3022
|
t.style.overflow = "hidden", e.style.display = "flex";
|
2991
3023
|
const o = s.length * 100 + "%";
|
2992
3024
|
e.style.width = o;
|
2993
|
-
},
|
3025
|
+
}, se = new WeakSet(), Vi = function(t) {
|
2994
3026
|
const { t: e } = this;
|
2995
3027
|
if (e.recordUrl === "true") {
|
2996
3028
|
const s = new URLSearchParams(document.location.search);
|
@@ -2998,28 +3030,28 @@ Qt = new WeakSet(), Xi = function() {
|
|
2998
3030
|
const o = `${window.location.pathname}?${s.toString()}`;
|
2999
3031
|
history.replaceState({ t4Id: t }, "", o);
|
3000
3032
|
}
|
3001
|
-
},
|
3033
|
+
}, ne = new WeakSet(), Ki = function() {
|
3002
3034
|
const t = parseInt(this.t.gap, 10), e = window.pageYOffset, o = this.getBoundingClientRect().top + e - t;
|
3003
|
-
d(this,
|
3004
|
-
},
|
3035
|
+
d(this, oe, ts).call(this, o);
|
3036
|
+
}, oe = new WeakSet(), ts = function(t) {
|
3005
3037
|
window.scrollTo({
|
3006
3038
|
top: t,
|
3007
3039
|
behavior: "smooth"
|
3008
3040
|
});
|
3009
|
-
},
|
3041
|
+
}, ae = new WeakSet(), es = function(t) {
|
3010
3042
|
let e = parseInt(t, 10) + 1;
|
3011
3043
|
this.t.step.textContent = `${e}`, this.t.step.setAttribute("now-page", e);
|
3012
|
-
},
|
3044
|
+
}, re = new WeakSet(), is = function(t) {
|
3013
3045
|
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
3046
|
e.forEach((a) => {
|
3015
3047
|
s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
|
3016
3048
|
});
|
3017
|
-
},
|
3049
|
+
}, le = new WeakSet(), ss = function(t) {
|
3018
3050
|
const e = document.querySelectorAll(`[t4-role="prev"][t4-control="${this.t.name}"]`), s = this.t.tabPanels.length === 1, o = t === 0;
|
3019
3051
|
e.forEach((a) => {
|
3020
3052
|
s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
|
3021
3053
|
});
|
3022
|
-
},
|
3054
|
+
}, ce = new WeakSet(), ns = function(t, e) {
|
3023
3055
|
this.t.tabGroup === "true" ? this.t.tabs.forEach((s, o) => {
|
3024
3056
|
o == t ? s.setAttribute("aria-selected", !0) : s.setAttribute("aria-selected", !1);
|
3025
3057
|
}) : this.t.tabs.forEach((s, o) => {
|
@@ -3028,25 +3060,25 @@ Qt = new WeakSet(), Xi = function() {
|
|
3028
3060
|
}, q = new WeakSet(), z = function(t, e, s) {
|
3029
3061
|
switch (t) {
|
3030
3062
|
case "step":
|
3031
|
-
|
3063
|
+
ye(this.t.step) && d(this, ae, es).call(this, e);
|
3032
3064
|
break;
|
3033
3065
|
case "eventAnchor":
|
3034
|
-
this.t.anchor && d(this,
|
3066
|
+
this.t.anchor && d(this, ne, Ki).call(this);
|
3035
3067
|
break;
|
3036
3068
|
case "tabState":
|
3037
|
-
this.t.type == "normal" && d(this,
|
3069
|
+
this.t.type == "normal" && d(this, ce, ns).call(this, e, s);
|
3038
3070
|
break;
|
3039
3071
|
case "btnState":
|
3040
|
-
d(this,
|
3072
|
+
d(this, re, is).call(this, e), d(this, le, ss).call(this, e);
|
3041
3073
|
break;
|
3042
3074
|
case "tabUrl":
|
3043
|
-
this.t.recordUrl === "true" && d(this,
|
3075
|
+
this.t.recordUrl === "true" && d(this, se, Vi).call(this, e);
|
3044
3076
|
break;
|
3045
3077
|
default:
|
3046
3078
|
console.warn("請增加判斷,謝謝");
|
3047
3079
|
break;
|
3048
3080
|
}
|
3049
|
-
},
|
3081
|
+
}, de = new WeakSet(), os = function(t) {
|
3050
3082
|
const { t: e } = this;
|
3051
3083
|
this.t.transition;
|
3052
3084
|
const s = e.tabPanels[t];
|
@@ -3063,7 +3095,7 @@ Qt = new WeakSet(), Xi = function() {
|
|
3063
3095
|
s.style.display = "none";
|
3064
3096
|
break;
|
3065
3097
|
}
|
3066
|
-
},
|
3098
|
+
}, ue = new WeakSet(), as = function(t) {
|
3067
3099
|
const { duration: e, timing: s, delay: o } = this.t.transition, a = this.t.tabPanels[t];
|
3068
3100
|
let r;
|
3069
3101
|
switch (a.classList.remove("hide"), a.style.transition = `opacity ${e}ms ${s} ${o}ms`, a.style.display = "block", this.t.display) {
|
@@ -3088,25 +3120,25 @@ Qt = new WeakSet(), Xi = function() {
|
|
3088
3120
|
console.warn(this.t.display, "沒有這個效果請自己想辦法!!!!");
|
3089
3121
|
break;
|
3090
3122
|
}
|
3091
|
-
},
|
3092
|
-
const e = d(this,
|
3123
|
+
}, he = new WeakSet(), rs = function(t) {
|
3124
|
+
const e = d(this, N, F).call(this, t);
|
3093
3125
|
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
|
-
},
|
3126
|
+
}, pe = new WeakSet(), ls = function() {
|
3095
3127
|
const t = this;
|
3096
3128
|
window.addEventListener(
|
3097
3129
|
"resize",
|
3098
|
-
|
3130
|
+
Fs(() => {
|
3099
3131
|
t.update();
|
3100
3132
|
}, 1e3)
|
3101
3133
|
);
|
3102
3134
|
};
|
3103
|
-
function
|
3135
|
+
function Fs(n, i = 1e3) {
|
3104
3136
|
let t;
|
3105
3137
|
return function(e) {
|
3106
3138
|
t && clearTimeout(t), t = setTimeout(n, i, e);
|
3107
3139
|
};
|
3108
3140
|
}
|
3109
|
-
function
|
3141
|
+
function cs() {
|
3110
3142
|
const n = document.querySelectorAll("[t4-control]");
|
3111
3143
|
document.addEventListener("click", function(i) {
|
3112
3144
|
let t = !1;
|
@@ -3136,24 +3168,24 @@ function os() {
|
|
3136
3168
|
}
|
3137
3169
|
});
|
3138
3170
|
}
|
3139
|
-
|
3140
|
-
Object.assign(
|
3141
|
-
customElements.define("tab-el",
|
3142
|
-
const
|
3171
|
+
cs();
|
3172
|
+
Object.assign(Yi.prototype, O);
|
3173
|
+
customElements.define("tab-el", Yi);
|
3174
|
+
const Xe = (n) => {
|
3143
3175
|
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e);
|
3144
3176
|
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
|
-
},
|
3177
|
+
}, Ys = (n) => {
|
3146
3178
|
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e), a = o.children[0].offsetHeight;
|
3147
3179
|
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
3180
|
};
|
3149
|
-
var st, xe,
|
3150
|
-
class
|
3181
|
+
var st, xe, me, ds, ge, us, nt, Ce;
|
3182
|
+
class Us {
|
3151
3183
|
constructor(i, t = {}) {
|
3152
3184
|
p(this, st);
|
3153
|
-
p(this,
|
3154
|
-
p(this,
|
3185
|
+
p(this, me);
|
3186
|
+
p(this, ge);
|
3155
3187
|
p(this, nt);
|
3156
|
-
!at(i) && !
|
3188
|
+
!at(i) && !ye(i) && !rt(i) && !w(i) || (this.__storage__ = {
|
3157
3189
|
el: i,
|
3158
3190
|
options: t
|
3159
3191
|
}, this.active = "data-collapse-active", d(this, st, xe).call(this));
|
@@ -3163,64 +3195,64 @@ class Xs {
|
|
3163
3195
|
}
|
3164
3196
|
}
|
3165
3197
|
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" ?
|
3198
|
+
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } = Je;
|
3199
|
+
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
3200
|
for (const [o, a] of Object.entries(this.options.on))
|
3169
3201
|
this.__events__[o] = [a];
|
3170
|
-
d(this,
|
3171
|
-
},
|
3202
|
+
d(this, me, ds).call(this);
|
3203
|
+
}, me = new WeakSet(), ds = function() {
|
3172
3204
|
const { elements: i, options: t } = this;
|
3173
3205
|
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,
|
3206
|
+
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
3207
|
}), this.emit("init");
|
3176
|
-
},
|
3208
|
+
}, ge = new WeakSet(), us = function(i) {
|
3177
3209
|
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,
|
3210
|
+
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) {
|
3179
3211
|
const h = (m) => {
|
3180
3212
|
m.stopPropagation();
|
3181
3213
|
};
|
3182
3214
|
u.removeEventListener("click", h), u.addEventListener("click", h);
|
3183
3215
|
}
|
3184
|
-
}, nt = new WeakSet(),
|
3216
|
+
}, nt = new WeakSet(), Ce = function() {
|
3185
3217
|
const { instance: i, defaultOptions: t } = this.collapse, { collapseClass: e, block: s, target: o, single: a } = t, r = this;
|
3186
3218
|
r.classList.contains(e) ? (a && r.parentNode.querySelectorAll(`.${r.classList[0]}`).forEach((l) => {
|
3187
|
-
|
3188
|
-
}),
|
3219
|
+
Xe(l);
|
3220
|
+
}), Ys(r)) : Xe(r), i.emit("afterCollapse");
|
3189
3221
|
};
|
3190
|
-
Object.assign(
|
3191
|
-
function
|
3222
|
+
Object.assign(Us.prototype, O);
|
3223
|
+
function Js(n, i) {
|
3192
3224
|
const t = i, { color: e, opacity: s, duration: o } = i.s.options;
|
3193
3225
|
let a = document.createElement("span"), r = n.clientX - t.getBoundingClientRect().left, l = n.clientY - t.getBoundingClientRect().top;
|
3194
3226
|
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
3227
|
a.remove();
|
3196
3228
|
}, `${o}`);
|
3197
3229
|
}
|
3198
|
-
function
|
3230
|
+
function hs() {
|
3199
3231
|
document.querySelectorAll("ripple-btn").forEach((n) => {
|
3200
3232
|
n.querySelector(".hover-ball"), n.style.setProperty("--r", ""), n.classList.remove("entered");
|
3201
3233
|
});
|
3202
3234
|
}
|
3203
|
-
document.addEventListener("click",
|
3204
|
-
var ot,
|
3205
|
-
class
|
3235
|
+
document.addEventListener("click", hs);
|
3236
|
+
var ot, He, fe, ps, ve, ms, be, gs;
|
3237
|
+
class Zs extends HTMLElement {
|
3206
3238
|
constructor() {
|
3207
3239
|
super();
|
3208
3240
|
p(this, ot);
|
3209
|
-
p(this, me);
|
3210
|
-
p(this, ge);
|
3211
3241
|
p(this, fe);
|
3242
|
+
p(this, ve);
|
3243
|
+
p(this, be);
|
3212
3244
|
this.initialize = !1;
|
3213
3245
|
}
|
3214
3246
|
connectedCallback() {
|
3215
3247
|
const t = this;
|
3216
|
-
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this, ot,
|
3248
|
+
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this, ot, He).call(this));
|
3217
3249
|
}
|
3218
3250
|
update() {
|
3219
|
-
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this, ot,
|
3251
|
+
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this, ot, He).call(this);
|
3220
3252
|
}
|
3221
3253
|
}
|
3222
|
-
ot = new WeakSet(),
|
3223
|
-
const { SETTINGS: t } =
|
3254
|
+
ot = new WeakSet(), He = function() {
|
3255
|
+
const { SETTINGS: t } = Ze;
|
3224
3256
|
this.s = {};
|
3225
3257
|
function e(o) {
|
3226
3258
|
let a = !!o;
|
@@ -3234,20 +3266,20 @@ ot = new WeakSet(), ke = function() {
|
|
3234
3266
|
hover: this.getAttribute("r4-hover") ? e(this.getAttribute("r4-hover")) : t.hover,
|
3235
3267
|
click: this.getAttribute("r4-hover-click") ? e(this.getAttribute("r4-hover-click")) : t.click
|
3236
3268
|
};
|
3237
|
-
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this,
|
3238
|
-
},
|
3239
|
-
d(this,
|
3240
|
-
},
|
3269
|
+
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this, fe, ps).call(this);
|
3270
|
+
}, fe = new WeakSet(), ps = function() {
|
3271
|
+
d(this, ve, ms).call(this), d(this, be, gs).call(this), this.classList.add("r4-initialize");
|
3272
|
+
}, ve = new WeakSet(), ms = function() {
|
3241
3273
|
const t = this, e = document.createElement("i");
|
3242
3274
|
e.classList.add("hover-ball"), e.style.transitionDuration = `${t.s.options.speed}ms`, t.appendChild(e);
|
3243
|
-
},
|
3275
|
+
}, be = new WeakSet(), gs = function() {
|
3244
3276
|
const t = this.querySelector("i.hover-ball"), e = this;
|
3245
3277
|
e.addEventListener("click", function(a) {
|
3246
|
-
a.stopPropagation(), e.s.options.click &&
|
3278
|
+
a.stopPropagation(), e.s.options.click && Js(a, e);
|
3247
3279
|
});
|
3248
3280
|
let s = "ontouchstart" in document.documentElement ? "touchstart" : "mouseenter", o = "ontouchend" in document.documentElement ? "touchend" : "mouseleave";
|
3249
3281
|
e.addEventListener(s, function(a) {
|
3250
|
-
if (s === "touchstart" &&
|
3282
|
+
if (s === "touchstart" && hs(), e.s.options.hover) {
|
3251
3283
|
const r = Math.round(s === "mouseenter" ? a.clientX - e.getBoundingClientRect().left : a.changedTouches[0].clientX - e.getBoundingClientRect().x), l = Math.round(s === "mouseenter" ? a.clientY - e.getBoundingClientRect().top : a.changedTouches[0].clientY - e.getBoundingClientRect().y), { offsetWidth: c, offsetHeight: u } = e, h = Math.ceil(Math.sqrt(c ** 2 + u ** 2) * 2);
|
3252
3284
|
e.style.setProperty("--r", h), t.style.left = r + "px", t.style.top = l + "px", e.classList.add("entered");
|
3253
3285
|
}
|
@@ -3258,8 +3290,8 @@ ot = new WeakSet(), ke = function() {
|
|
3258
3290
|
}
|
3259
3291
|
});
|
3260
3292
|
};
|
3261
|
-
customElements.define("ripple-btn",
|
3262
|
-
class
|
3293
|
+
customElements.define("ripple-btn", Zs);
|
3294
|
+
class Qs {
|
3263
3295
|
constructor() {
|
3264
3296
|
this.init();
|
3265
3297
|
}
|
@@ -3311,12 +3343,12 @@ class Ys {
|
|
3311
3343
|
this.init();
|
3312
3344
|
}
|
3313
3345
|
}
|
3314
|
-
function
|
3346
|
+
function Re(n, i) {
|
3315
3347
|
return n ? function(t, e) {
|
3316
3348
|
Function(n)(t, e);
|
3317
3349
|
} : i;
|
3318
3350
|
}
|
3319
|
-
function
|
3351
|
+
function Vs(n, i, t, e) {
|
3320
3352
|
const s = i.params, o = n.closest("[data-upload-item]").querySelector("[data-preview]");
|
3321
3353
|
o.querySelector("img") && o.querySelector("img").remove(), o.appendChild(e.imgElement);
|
3322
3354
|
const a = n.dataset.group, r = document.querySelector(i.el).dataset.index;
|
@@ -3339,7 +3371,7 @@ function Us(n, i, t, e) {
|
|
3339
3371
|
info: e
|
3340
3372
|
}, s.on.changeAfter && typeof s.on.changeAfter == "function" && s.on.changeAfter(n, e);
|
3341
3373
|
}
|
3342
|
-
function
|
3374
|
+
function Ks(n, i, t, e) {
|
3343
3375
|
const s = document.createElement("canvas"), o = s.getContext("2d"), a = i.width, l = i.height / a * 100, c = e / t * 100;
|
3344
3376
|
let u = 0, h = 0;
|
3345
3377
|
switch (s.width = t, s.height = e, n.previewSize) {
|
@@ -3350,17 +3382,17 @@ function Js(n, i, t, e) {
|
|
3350
3382
|
l < c ? (u = e / l * 100, h = s.height) : l > c ? (u = s.width, h = t * l / 100) : l === c && (u = s.width, h = s.height);
|
3351
3383
|
break;
|
3352
3384
|
}
|
3353
|
-
const m = (s.width - u) * 0.5,
|
3354
|
-
return o.drawImage(i, m,
|
3385
|
+
const m = (s.width - u) * 0.5, g = (s.height - h) * 0.5;
|
3386
|
+
return o.drawImage(i, m, g, u, h), s;
|
3355
3387
|
}
|
3356
|
-
function
|
3388
|
+
function tn(n, i) {
|
3357
3389
|
return new Promise((t, e) => {
|
3358
3390
|
if (i) {
|
3359
3391
|
const s = new Image();
|
3360
3392
|
s.src = i, s.classList.add(n.previewSize), s.onload = () => {
|
3361
3393
|
let o = {
|
3362
3394
|
imgElement: s,
|
3363
|
-
originalCanvas:
|
3395
|
+
originalCanvas: Ks(n, s, s.width, s.height),
|
3364
3396
|
info: {
|
3365
3397
|
originalWidth: s.width,
|
3366
3398
|
originalHeight: s.height,
|
@@ -3373,31 +3405,31 @@ function Zs(n, i) {
|
|
3373
3405
|
t();
|
3374
3406
|
});
|
3375
3407
|
}
|
3376
|
-
function
|
3408
|
+
function en(n, i) {
|
3377
3409
|
const t = Math.pow(10, i);
|
3378
3410
|
return Math.round(n * t) / t;
|
3379
3411
|
}
|
3380
|
-
function
|
3412
|
+
function sn(n, i) {
|
3381
3413
|
let t = n.size / 1024 / 1024;
|
3382
|
-
return `${
|
3414
|
+
return `${en(t, 2)}` <= i;
|
3383
3415
|
}
|
3384
|
-
function
|
3416
|
+
function nn(n, i, t) {
|
3385
3417
|
if (n.target.files.length <= 0)
|
3386
3418
|
return;
|
3387
3419
|
const e = n.target.files[0], s = i.closest("[data-upload-item]");
|
3388
3420
|
let o = new FileReader();
|
3389
3421
|
o.onload = (a) => {
|
3390
3422
|
const r = e.type.split("/")[0] === "image" ? a.target.result : null;
|
3391
|
-
if (t.params.sizeLimit && !
|
3423
|
+
if (t.params.sizeLimit && !sn(e, t.params.sizeLimit)) {
|
3392
3424
|
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
3425
|
return;
|
3394
3426
|
} else
|
3395
|
-
s.classList.remove("over-limit"), s.classList.add("uploaded"),
|
3396
|
-
|
3427
|
+
s.classList.remove("over-limit"), s.classList.add("uploaded"), tn(t.params, r).then((l) => {
|
3428
|
+
Vs(i, t, e, l);
|
3397
3429
|
});
|
3398
3430
|
}, o.readAsDataURL(e);
|
3399
3431
|
}
|
3400
|
-
class
|
3432
|
+
class on {
|
3401
3433
|
constructor(i, t) {
|
3402
3434
|
const e = this;
|
3403
3435
|
e.el = i, e.params = {
|
@@ -3425,67 +3457,67 @@ class tn {
|
|
3425
3457
|
previewSize: e.dataset.previewSize || i.params.previewSize,
|
3426
3458
|
compress: e.dataset.compress || i.params.compress,
|
3427
3459
|
on: {
|
3428
|
-
changeAfter:
|
3429
|
-
overLimit:
|
3460
|
+
changeAfter: Re(e.dataset.changeAfter, i.params.on.changeAfter),
|
3461
|
+
overLimit: Re(e.dataset.overLimit, i.params.on.overLimit)
|
3430
3462
|
}
|
3431
3463
|
};
|
3432
3464
|
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
|
-
|
3465
|
+
nn(a, e, i);
|
3434
3466
|
});
|
3435
3467
|
}));
|
3436
3468
|
}
|
3437
3469
|
}
|
3438
3470
|
export {
|
3439
|
-
|
3440
|
-
|
3441
|
-
|
3442
|
-
|
3443
|
-
|
3444
|
-
|
3445
|
-
|
3446
|
-
|
3447
|
-
|
3448
|
-
|
3449
|
-
|
3450
|
-
|
3471
|
+
Qe as A,
|
3472
|
+
Tn as B,
|
3473
|
+
Us as C,
|
3474
|
+
ki as D,
|
3475
|
+
En as E,
|
3476
|
+
An as F,
|
3477
|
+
Ln as G,
|
3478
|
+
Sn as H,
|
3479
|
+
Qs as I,
|
3480
|
+
Dn as J,
|
3481
|
+
_n as K,
|
3482
|
+
kn as L,
|
3451
3483
|
U as M,
|
3452
|
-
|
3453
|
-
|
3454
|
-
|
3455
|
-
|
3456
|
-
|
3457
|
-
|
3458
|
-
|
3459
|
-
|
3460
|
-
|
3461
|
-
|
3462
|
-
|
3463
|
-
|
3464
|
-
|
3484
|
+
$n as N,
|
3485
|
+
xn as O,
|
3486
|
+
Cn as P,
|
3487
|
+
Hn as Q,
|
3488
|
+
Zs as R,
|
3489
|
+
Mn as S,
|
3490
|
+
Yi as T,
|
3491
|
+
qn as U,
|
3492
|
+
In as V,
|
3493
|
+
On as W,
|
3494
|
+
Pn as X,
|
3495
|
+
Nn as Y,
|
3496
|
+
w as a,
|
3465
3497
|
rt as b,
|
3466
|
-
|
3467
|
-
|
3498
|
+
Ts as c,
|
3499
|
+
ws as d,
|
3468
3500
|
Y as e,
|
3469
|
-
|
3470
|
-
|
3471
|
-
|
3501
|
+
E as f,
|
3502
|
+
L as g,
|
3503
|
+
mn as h,
|
3472
3504
|
at as i,
|
3473
|
-
|
3474
|
-
|
3475
|
-
|
3476
|
-
|
3477
|
-
|
3478
|
-
|
3479
|
-
|
3480
|
-
|
3481
|
-
|
3482
|
-
|
3483
|
-
|
3484
|
-
|
3485
|
-
|
3486
|
-
|
3487
|
-
|
3488
|
-
|
3489
|
-
|
3505
|
+
ui as j,
|
3506
|
+
Bs as k,
|
3507
|
+
Rs as l,
|
3508
|
+
on as m,
|
3509
|
+
Hs as n,
|
3510
|
+
jn as o,
|
3511
|
+
gn as p,
|
3512
|
+
Ei as q,
|
3513
|
+
Ai as r,
|
3514
|
+
ys as s,
|
3515
|
+
fn as t,
|
3516
|
+
vn as u,
|
3517
|
+
qs as v,
|
3518
|
+
bn as w,
|
3519
|
+
Cs as x,
|
3520
|
+
yn as y,
|
3521
|
+
wn as z
|
3490
3522
|
};
|
3491
3523
|
//# sourceMappingURL=image-preview-bundle.js.map
|