@xwadex/fesd 0.0.33 → 0.0.34

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