@xwadex/fesd 0.0.47 → 0.0.48

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,5 +1,5 @@
1
- var Ls = Object.defineProperty;
2
- var Ss = (n, i, t) => i in n ? Ls(n, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[i] = t;
1
+ var As = Object.defineProperty;
2
+ var Ss = (n, i, t) => i in n ? As(n, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[i] = t;
3
3
  var Re = (n, i, t) => (Ss(n, typeof i != "symbol" ? i + "" : i, t), t), Ds = (n, i, t) => {
4
4
  if (!i.has(n))
5
5
  throw TypeError("Cannot " + t);
@@ -195,7 +195,7 @@ const je = {
195
195
  beforeScroll: null,
196
196
  afterScroll: null
197
197
  }
198
- }, I = {
198
+ }, q = {
199
199
  SETTINGS: {
200
200
  type: "drag",
201
201
  drag: {
@@ -305,7 +305,7 @@ const je = {
305
305
  // hover 毫秒 ?
306
306
  speed: 600
307
307
  }
308
- }, Ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
308
+ }, An = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
309
309
  __proto__: null,
310
310
  anchor4: pt,
311
311
  aost4: ti,
@@ -314,17 +314,17 @@ const je = {
314
314
  dropdown4: ze,
315
315
  marquee4: M,
316
316
  modal4: P,
317
- multipurpose4: I,
317
+ multipurpose4: q,
318
318
  ripple4: si,
319
319
  share4: xs,
320
320
  tab4: ei,
321
321
  video4: je
322
- }, Symbol.toStringTag, { value: "Module" })), L = {
322
+ }, Symbol.toStringTag, { value: "Module" })), S = {
323
323
  before: "beforebegin",
324
324
  after: "afterend",
325
325
  append: "beforeend",
326
326
  prepend: "afterbegin"
327
- }, ct = (n) => typeof n == "string" && n !== "", Le = (n) => n instanceof HTMLElement, dt = (n) => n instanceof NodeList, T = (n) => $(n) !== null, G = (n) => typeof n == "function", $ = (n) => Le(n) ? n : document.querySelector(n), x = (n) => dt(n) ? n : document.querySelectorAll(n), Cs = () => Math.random().toString(36).substr(2, 9), Hs = (n) => {
327
+ }, ct = (n) => typeof n == "string" && n !== "", Ae = (n) => n instanceof HTMLElement, dt = (n) => n instanceof NodeList, E = (n) => $(n) !== null, G = (n) => typeof n == "function", $ = (n) => Ae(n) ? n : document.querySelector(n), x = (n) => dt(n) ? n : document.querySelectorAll(n), Cs = () => Math.random().toString(36).substr(2, 9), Hs = (n) => {
328
328
  const i = document.createElement("div");
329
329
  return i.innerHTML = n, i.childNodes;
330
330
  }, Ms = (n) => {
@@ -369,7 +369,7 @@ const je = {
369
369
  G(s) && s.apply(this, e);
370
370
  }), this) : this;
371
371
  }
372
- }, qs = {
372
+ }, Is = {
373
373
  easeInOutCirc(n, i, t, e) {
374
374
  return (n /= e / 2) < 1 ? -t / 2 * (Math.sqrt(1 - n * n) - 1) + i : t / 2 * (Math.sqrt(1 - (n -= 2) * n) + 1) + i;
375
375
  },
@@ -380,19 +380,19 @@ const je = {
380
380
  return -t * ((n = n / e - 1) * n * n * n - 1) + i;
381
381
  }
382
382
  }, Se = (n, i) => {
383
- 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 = T(e) ? $(e) : document.scrollingElement, v = m[u], w = T(t) ? $(t).getBoundingClientRect()[p] : 0 - v, y = T(s) ? $(s).getBoundingClientRect()[g] : 0, S = w - a - y, C = 15;
384
- let b = 0;
385
- if (S === 0)
383
+ 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 = E(e) ? $(e) : document.scrollingElement, v = m[u], w = E(t) ? $(t).getBoundingClientRect()[p] : 0 - v, b = E(s) ? $(s).getBoundingClientRect()[g] : 0, T = w - a - b, C = 15;
384
+ let y = 0;
385
+ if (T === 0)
386
386
  return;
387
- const D = (E) => {
387
+ const D = (L) => {
388
388
  const z = $(t);
389
- i && i.emit(E, z), !i && n.on && G(n.on[E]) && n.on[E](z);
389
+ i && i.emit(L, z), !i && n.on && G(n.on[L]) && n.on[L](z);
390
390
  };
391
391
  D("beforeScroll");
392
392
  const U = () => {
393
- b += C;
394
- const E = qs[r](b, v, S, o);
395
- m[u] = E, b < o && requestAnimationFrame(U), b >= o && D("afterScroll");
393
+ y += C;
394
+ const L = Is[r](y, v, T, o);
395
+ m[u] = L, y < o && requestAnimationFrame(U), y >= o && D("afterScroll");
396
396
  };
397
397
  requestAnimationFrame(U);
398
398
  };
@@ -435,7 +435,7 @@ class ni {
435
435
  }
436
436
  V = new WeakSet(), De = function() {
437
437
  const { el: i, options: t } = this.__storage__;
438
- if (!ct(i) || !T(i))
438
+ if (!ct(i) || !E(i))
439
439
  return;
440
440
  const { SETTINGS: e, EVENTS: s } = pt;
441
441
  if (this.elements = t.state == "not active" ? x(i + `:not([${this.active}])`) : x(i), this.elements = x(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
@@ -466,7 +466,7 @@ V = new WeakSet(), De = function() {
466
466
  };
467
467
  Object.assign(ni.prototype, j);
468
468
  window.MODALS || (window.MODALS = {});
469
- const { MODALS: O } = window, Is = (n) => {
469
+ const { MODALS: O } = window, qs = (n) => {
470
470
  const { TEMPLATE: i } = P, { childDom: t } = n, e = document.createElement("div");
471
471
  e.innerHTML = i(n.getAttribute("data-modal-template-setting"));
472
472
  const s = e.querySelector(".modal-content");
@@ -474,7 +474,7 @@ const { MODALS: O } = window, Is = (n) => {
474
474
  s.append(o);
475
475
  }), e.children[0];
476
476
  };
477
- var yt, li, wt, ci, Tt, di, Et, ui, At, hi;
477
+ var yt, li, wt, ci, Tt, di, Et, ui, Lt, hi;
478
478
  class ri extends HTMLElement {
479
479
  constructor() {
480
480
  super();
@@ -482,7 +482,7 @@ class ri extends HTMLElement {
482
482
  h(this, wt);
483
483
  h(this, Tt);
484
484
  h(this, Et);
485
- h(this, At);
485
+ h(this, Lt);
486
486
  this.initialize = !1;
487
487
  }
488
488
  static get observedAttributes() {
@@ -491,7 +491,7 @@ class ri extends HTMLElement {
491
491
  attributeChangedCallback(t, e, s) {
492
492
  switch (t) {
493
493
  case ":state":
494
- d(this, At, hi).call(this, s);
494
+ d(this, Lt, hi).call(this, s);
495
495
  break;
496
496
  }
497
497
  }
@@ -514,7 +514,7 @@ yt = new WeakSet(), li = function() {
514
514
  const e = this.getAttribute(t.id) || Cs();
515
515
  this.getAttribute(t.id) || (A(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), O[e] && A(`the ${t.id} "${e}" is already be used.`), O[e] = this, d(this, wt, ci).call(this);
516
516
  }, wt = new WeakSet(), ci = function() {
517
- this.childDom = this.childNodes, this.template = Is(this), this.innerHTML = "", this.append(this.template), d(this, Tt, di).call(this);
517
+ this.childDom = this.childNodes, this.template = qs(this), this.innerHTML = "", this.append(this.template), d(this, Tt, di).call(this);
518
518
  }, Tt = new WeakSet(), di = function() {
519
519
  const t = this.querySelector(".modal-scroller");
520
520
  this.__scroller__ = Pe(t, {
@@ -539,7 +539,7 @@ yt = new WeakSet(), li = function() {
539
539
  }), (l = t.querySelector("[stop-propagation]")) == null || l.addEventListener("click", function(c) {
540
540
  c.stopPropagation();
541
541
  });
542
- }, At = new WeakSet(), hi = function(t) {
542
+ }, Lt = new WeakSet(), hi = function(t) {
543
543
  const { __scroller__: e } = this;
544
544
  if (t === "open") {
545
545
  if (this.style.display = "block", e) {
@@ -620,11 +620,11 @@ const { MODALS: Be } = window, ut = {}, pi = (n, i, ...t) => {
620
620
  r("error", l), delete ut[t];
621
621
  }));
622
622
  };
623
- var K, ke, Lt, fi, St, vi;
623
+ var K, ke, At, fi, St, vi;
624
624
  const B = class B {
625
625
  constructor(i, t = {}) {
626
626
  h(this, K);
627
- h(this, Lt);
627
+ h(this, At);
628
628
  h(this, St);
629
629
  this.__storage__ = {
630
630
  el: i,
@@ -657,14 +657,14 @@ const B = class B {
657
657
  };
658
658
  K = new WeakSet(), ke = function() {
659
659
  const { el: i, options: t } = this.__storage__;
660
- if (!ct(i) || !T(i))
660
+ if (!ct(i) || !E(i))
661
661
  return;
662
662
  const { SETTINGS: e, EVENTS: s } = P;
663
663
  if (this.elements = t.state == "not active" ? x(i + `:not([${this.active}])`) : x(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
664
664
  for (const [o, a] of Object.entries(this.options.on))
665
665
  this.__events__[o] = [a];
666
- d(this, Lt, fi).call(this);
667
- }, Lt = new WeakSet(), fi = function() {
666
+ d(this, At, fi).call(this);
667
+ }, At = new WeakSet(), fi = function() {
668
668
  const { elements: i, options: t } = this;
669
669
  i.forEach((e) => {
670
670
  e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this, St, vi), 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, "");
@@ -696,9 +696,9 @@ const Ns = (n, i) => {
696
696
  s.classList.add(o);
697
697
  }, a);
698
698
  else {
699
- const y = s.classList.contains(o) && c === "down" && p - e >= m || c === "up" && g - e <= v || c === !0;
699
+ const b = s.classList.contains(o) && c === "down" && p - e >= m || c === "up" && g - e <= v || c === !0;
700
700
  setTimeout(() => {
701
- y && s.classList.remove(o);
701
+ b && s.classList.remove(o);
702
702
  }, a);
703
703
  }
704
704
  });
@@ -717,7 +717,7 @@ class bi {
717
717
  const { elements: t, options: e } = this;
718
718
  if (!t)
719
719
  return this;
720
- const { scroller: s } = e, o = s === window || !T(s) ? window : $(s);
720
+ const { scroller: s } = e, o = s === window || !E(s) ? window : $(s);
721
721
  return o.aost && (o.removeEventListener("scroll", o.aost.eventHandler), delete o.aost), t.forEach((a) => {
722
722
  if (!a.aost)
723
723
  return;
@@ -732,7 +732,7 @@ class bi {
732
732
  }
733
733
  tt = new WeakSet(), $e = function() {
734
734
  const { el: i, options: t } = this.__storage__;
735
- if (!ct(i) || !T(i))
735
+ if (!ct(i) || !E(i))
736
736
  return;
737
737
  const { SETTINGS: e, EVENTS: s } = ti;
738
738
  if (this.elements = t.state == "not active" ? x(i + `:not([${this.active}])`) : x(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
@@ -740,7 +740,7 @@ tt = new WeakSet(), $e = function() {
740
740
  this.__events__[o] = [a];
741
741
  d(this, Dt, yi).call(this);
742
742
  }, Dt = new WeakSet(), yi = function() {
743
- const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !T(e) ? window : $(e);
743
+ const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !E(e) ? window : $(e);
744
744
  this.eventHandler = () => {
745
745
  Ns(s, i);
746
746
  }, i.forEach((a) => {
@@ -758,7 +758,7 @@ const js = (n) => {
758
758
  s.append(o);
759
759
  }), e.children[0];
760
760
  };
761
- var kt, wi, $t, Ti, xt, Ei, _t, Ai, Ct, Li, Ht, Si, Mt, Di, qt, ki, It, $i, Ot, xi;
761
+ var kt, wi, $t, Ti, xt, Ei, _t, Li, Ct, Ai, Ht, Si, Mt, Di, It, ki, qt, $i, Ot, xi;
762
762
  class zs extends HTMLElement {
763
763
  constructor() {
764
764
  super();
@@ -773,10 +773,10 @@ class zs extends HTMLElement {
773
773
  h(this, Ht);
774
774
  h(this, Mt);
775
775
  // 2025.02.11 新增 ig
776
- h(this, qt);
777
- // 2025.02.11 新增 tiktok
778
776
  h(this, It);
779
- // 2026.01.15 新增 tiktok
777
+ // 2025.02.11 新增 tiktok
778
+ h(this, qt);
779
+ // 2026.01.15 新增 video
780
780
  h(this, Ot);
781
781
  d(this, kt, wi).call(this);
782
782
  }
@@ -849,7 +849,7 @@ kt = new WeakSet(), wi = function() {
849
849
  case "youtubeAPI":
850
850
  break;
851
851
  case "youtube":
852
- document.body.wd_youtube == !1 ? o("video-player") : s = d(this, _t, Ai).call(this);
852
+ document.body.wd_youtube == !1 ? o("video-player") : s = d(this, _t, Li).call(this);
853
853
  break;
854
854
  case "youkuAPI":
855
855
  break;
@@ -857,16 +857,16 @@ kt = new WeakSet(), wi = function() {
857
857
  document.body.wd_youku == !1 ? o("video-player") : s = d(this, Ht, Si).call(this);
858
858
  break;
859
859
  case "vimeo":
860
- document.body.wd_vimeo == !1 ? o("video-player") : s = d(this, Ct, Li).call(this);
860
+ document.body.wd_vimeo == !1 ? o("video-player") : s = d(this, Ct, Ai).call(this);
861
861
  break;
862
862
  case "bilibili":
863
863
  document.body.wd_bilibili == !1 ? o("video-player") : s = d(this, Mt, Di).call(this);
864
864
  break;
865
865
  case "instagram":
866
- document.body.wd_instagram == !1 ? o(".instagram-media") : s = d(this, qt, ki).call(this);
866
+ document.body.wd_instagram == !1 ? o(".instagram-media") : s = d(this, It, ki).call(this);
867
867
  break;
868
868
  case "tiktok":
869
- document.body.wd_tiktok == !1 ? o("video-player") : s = d(this, It, $i).call(this);
869
+ document.body.wd_tiktok == !1 ? o("video-player") : s = d(this, qt, $i).call(this);
870
870
  break;
871
871
  case "videojs":
872
872
  break;
@@ -874,11 +874,11 @@ kt = new WeakSet(), wi = function() {
874
874
  s = d(this, Ot, xi).call(this);
875
875
  break;
876
876
  }
877
- this.querySelector(".player-wrapper").insertAdjacentHTML(L.prepend, s);
878
- }, _t = new WeakSet(), Ai = function() {
877
+ this.querySelector(".player-wrapper").insertAdjacentHTML(S.prepend, s);
878
+ }, _t = new WeakSet(), Li = function() {
879
879
  const { videoId: t, autoplay: e, startTime: s } = this;
880
880
  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>`;
881
- }, Ct = new WeakSet(), Li = function() {
881
+ }, Ct = new WeakSet(), Ai = function() {
882
882
  const { videoId: t, autoplay: e, hash: s } = this;
883
883
  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>`;
884
884
  }, Ht = new WeakSet(), Si = function() {
@@ -887,15 +887,15 @@ kt = new WeakSet(), wi = function() {
887
887
  }, Mt = new WeakSet(), Di = function() {
888
888
  const { videoId: t, autoplay: e } = this;
889
889
  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>`;
890
- }, qt = new WeakSet(), ki = function() {
890
+ }, It = new WeakSet(), ki = function() {
891
891
  const { videoId: t, autoplay: e } = this;
892
892
  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>`;
893
- }, It = new WeakSet(), $i = function() {
893
+ }, qt = new WeakSet(), $i = function() {
894
894
  const { videoId: t, autoplay: e } = this;
895
895
  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>`;
896
896
  }, Ot = new WeakSet(), xi = function() {
897
897
  const { videoId: t, autoplay: e } = this;
898
- return `<video src="${t}" autoplay muted playsinline controls></video>`;
898
+ return `<video src="${t}" ${e == "on" ? "autoplay" : ""} muted playsinline controls></video>`;
899
899
  };
900
900
  const Sn = (n) => new Promise((i) => {
901
901
  let t = setTimeout(() => (clearTimeout(t), i()), n);
@@ -989,7 +989,7 @@ function Mn(n, i) {
989
989
  f(this).toggleClass(i);
990
990
  });
991
991
  }
992
- function qn(n, i) {
992
+ function In(n, i) {
993
993
  f(n).on("click", function() {
994
994
  f(n).not(this).removeClass(i), f(this).addClass(i);
995
995
  });
@@ -1003,7 +1003,7 @@ function Ws(n, i = 250) {
1003
1003
  }, i);
1004
1004
  };
1005
1005
  }
1006
- function In(n, i = 250) {
1006
+ function qn(n, i = 250) {
1007
1007
  let t, e;
1008
1008
  return function() {
1009
1009
  const s = this, o = arguments, a = +/* @__PURE__ */ new Date();
@@ -1126,7 +1126,7 @@ function Jn(n) {
1126
1126
  return i.innerHTML = n, i.childNodes[0];
1127
1127
  }
1128
1128
  const Fe = (n) => n.videoId !== "" || typeof n.videoId < "u", Gs = (n) => n.$selector.getAttribute("video4-active") === "on", ht = (n) => `<video-player video-id="${n.videoId}" video-type="${n.videoType}" video-startTime="${n.videoStartTime}" video-autoplay="${n.videoAutoplay}"></video-player>`;
1129
- var et, _e, Nt, Hi, Pt, Mi, it, Ce, jt, qi;
1129
+ var et, _e, Nt, Hi, Pt, Mi, it, Ce, jt, Ii;
1130
1130
  const X = class X {
1131
1131
  //*-* 給Article4用的 **//
1132
1132
  constructor(i, t = {}) {
@@ -1135,7 +1135,7 @@ const X = class X {
1135
1135
  h(this, Pt);
1136
1136
  h(this, it);
1137
1137
  h(this, jt);
1138
- if (!ct(i) && !Le(i) && !dt(i)) {
1138
+ if (!ct(i) && !Ae(i) && !dt(i)) {
1139
1139
  Xe("video4", `找不到該物件 -> ${i}`);
1140
1140
  return;
1141
1141
  }
@@ -1167,33 +1167,46 @@ et = new WeakSet(), _e = function() {
1167
1167
  }, Nt = new WeakSet(), Hi = function() {
1168
1168
  const { elements: i, options: t } = this;
1169
1169
  i.forEach((e) => {
1170
- e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this, jt, qi).call(this, e), e.video.methods = {}, e.video.methods.update = this.update, e.setAttribute(this.active, ""), Fe(e.video.params) && !Gs(e.video.params) && (e.setAttribute("video4-active", "on"), d(this, Pt, Mi).call(this, e)), Fe(e.video.params) || Xe("video4", "無法取得影片 ID");
1170
+ e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this, jt, Ii).call(this, e), e.video.methods = {}, e.video.methods.update = this.update, e.setAttribute(this.active, ""), Fe(e.video.params) && !Gs(e.video.params) && (e.setAttribute("video4-active", "on"), d(this, Pt, Mi).call(this, e)), Fe(e.video.params) || Xe("video4", "無法取得影片 ID");
1171
1171
  }), this.emit("init");
1172
1172
  }, Pt = new WeakSet(), Mi = function(i) {
1173
1173
  const { LAYOUT: t } = this.options, e = i.video.params, { $selector: s, videoLayoutNo: o, videoId: a, videoType: r, videoMode: l, videoButton: c, videoCover: u, videoHighQualityPic: p } = e;
1174
1174
  if (l === "onBox" || l === "inBox") {
1175
1175
  let g = null;
1176
1176
  if (u === "on") {
1177
- i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(L.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), A("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
1177
+ i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(S.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), A("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
1178
1178
  const m = s.querySelector("img"), v = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src")), w = t[o] ? t[o] : t[0] || "";
1179
- w ? m.insertAdjacentHTML(L.after, w) : A("video4", `找不到對應的 LAYOUT 設定 (No: ${o}),且無預設樣式。`), !v && r == "youtube" ? p == "on" ? m.setAttribute("src", `https://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`) : !v && r == "vimeo" ? m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !v && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((y) => y.json()).then((y) => {
1180
- const S = y.thumbnail_url;
1181
- m.setAttribute("src", `${S}`);
1182
- }).catch(function(y) {
1183
- console.log("error");
1184
- }) : A("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
1179
+ if (w ? m.insertAdjacentHTML(S.after, w) : A("video4", `找不到對應的 LAYOUT 設定 (No: ${o}),且無預設樣式。`), !v && r == "youtube")
1180
+ p == "on" ? m.setAttribute("src", `https://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`);
1181
+ else if (!v && r == "vimeo")
1182
+ m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`);
1183
+ else if (!v && r === "video") {
1184
+ const b = document.createElement("video");
1185
+ b.src = a, b.preload = "metadata", b.muted = !0, b.playsInline = !0, b.crossOrigin = "anonymous", b.onloadeddata = () => {
1186
+ b.currentTime = 0.5;
1187
+ }, b.onseeked = () => {
1188
+ const T = document.createElement("canvas");
1189
+ T.width = b.videoWidth, T.height = b.videoHeight, T.getContext("2d").drawImage(b, 0, 0), m.src = T.toDataURL("image/jpeg", 0.85);
1190
+ };
1191
+ } else
1192
+ !v && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((b) => b.json()).then((b) => {
1193
+ const T = b.thumbnail_url;
1194
+ m.setAttribute("src", `${T}`);
1195
+ }).catch(function(b) {
1196
+ console.log("error");
1197
+ }) : A("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
1185
1198
  }
1186
1199
  c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || A("video4", `找不到 videoButton 設定的 element -> '${c}' , 點擊物件轉移至 '${this.__storage__.el}'`)), g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, it, Ce), g.addEventListener("click", g.video.eventHandler);
1187
1200
  } else if (l === "onPage") {
1188
1201
  let g = null;
1189
1202
  if (u == "on") {
1190
- i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(L.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), A("video", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構"));
1203
+ i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(S.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), A("video", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構"));
1191
1204
  const m = s.querySelector("img");
1192
- m.insertAdjacentHTML(L.after, t[o]);
1205
+ m.insertAdjacentHTML(S.after, t[o]);
1193
1206
  const v = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src"));
1194
1207
  !v && 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`) : !v && r == "vimeo" ? m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !v && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((w) => w.json()).then((w) => {
1195
- const y = w.thumbnail_url;
1196
- m.setAttribute("src", `${y}`);
1208
+ const b = w.thumbnail_url;
1209
+ m.setAttribute("src", `${b}`);
1197
1210
  }).catch(function(w) {
1198
1211
  console.log("error");
1199
1212
  }) : v || A("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片"), c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || A("video4", `找不到 videoButton 設定的 element -> '${c}', 點擊物件轉移至 '${this.__storage__.el}'`));
@@ -1217,8 +1230,8 @@ et = new WeakSet(), _e = function() {
1217
1230
  videoButton: m,
1218
1231
  videoLayoutNo: v,
1219
1232
  videoStartTime: w
1220
- } = t.params, y = new Ke({ callback_loaded: (C) => {
1221
- } }), S = new URLSearchParams({
1233
+ } = t.params, b = new Ke({ callback_loaded: (C) => {
1234
+ } }), T = new URLSearchParams({
1222
1235
  video_mode: o,
1223
1236
  video_type: u,
1224
1237
  video_id: l
@@ -1226,25 +1239,25 @@ et = new WeakSet(), _e = function() {
1226
1239
  if (o == "onBox" || o == "inBox") {
1227
1240
  const C = {
1228
1241
  target: a,
1229
- route: c + `?${S.toString()}`,
1242
+ route: c + `?${T.toString()}`,
1230
1243
  on: {
1231
- complete(b) {
1244
+ complete(y) {
1232
1245
  var D;
1233
- o == "onBox" && (u == "instagram" ? (b.setAttribute("video-typeStyle", `${u}`), (D = window.instgrm) != null && D.Embeds ? window.instgrm.Embeds.process() : console.log("window.instgrm is undefined")) : (b.querySelector(".modal-content").insertAdjacentHTML("beforeend", ht(t.params)), b.setAttribute("video-typeStyle", `${u}`))), o == "inBox" && b.setAttribute("video-typeStyle", `${u}`);
1246
+ o == "onBox" && (u == "instagram" ? (y.setAttribute("video-typeStyle", `${u}`), (D = window.instgrm) != null && D.Embeds ? window.instgrm.Embeds.process() : console.log("window.instgrm is undefined")) : (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", ht(t.params)), y.setAttribute("video-typeStyle", `${u}`))), o == "inBox" && y.setAttribute("video-typeStyle", `${u}`);
1234
1247
  },
1235
- open(b) {
1248
+ open(y) {
1236
1249
  var U;
1237
- const D = b.querySelectorAll("[data-overlayscrollbars-viewport]");
1238
- if (y.update(), _i([...D]), o == "onBox" && u == "instagram") {
1239
- const E = document.querySelector("[video-template] .modal-content");
1250
+ const D = y.querySelectorAll("[data-overlayscrollbars-viewport]");
1251
+ if (b.update(), _i([...D]), o == "onBox" && u == "instagram") {
1252
+ const L = document.querySelector("[video-template] .modal-content");
1240
1253
  new ResizeObserver((We) => {
1241
- We[0].contentRect.height > 50 && E.classList.add("active");
1242
- }).observe(E);
1254
+ We[0].contentRect.height > 50 && L.classList.add("active");
1255
+ }).observe(L);
1243
1256
  }
1244
1257
  if (o == "inBox") {
1245
- const E = g || ((U = s.querySelector("img")) == null ? void 0 : U.src);
1258
+ const L = g || ((U = s.querySelector("img")) == null ? void 0 : U.src);
1246
1259
  let z;
1247
- E == null ? z = `
1260
+ L == null ? z = `
1248
1261
  <div
1249
1262
  class="photo-box"
1250
1263
  video-target
@@ -1268,28 +1281,28 @@ et = new WeakSet(), _e = function() {
1268
1281
  >
1269
1282
  <picture>
1270
1283
  <source
1271
- srcset="${E}"
1284
+ srcset="${L}"
1272
1285
  type="image/webp"
1273
1286
  />
1274
1287
  <source
1275
- srcset="${E}"
1288
+ srcset="${L}"
1276
1289
  type="image/jpeg"
1277
1290
  />
1278
- <img src="${E}" alt="" />
1291
+ <img src="${L}" alt="" />
1279
1292
  </picture>
1280
- </div>`, b.querySelector(".video-content").insertAdjacentHTML(L.prepend, z);
1281
- const Ge = b.querySelectorAll("[video-target]");
1293
+ </div>`, y.querySelector(".video-content").insertAdjacentHTML(S.prepend, z);
1294
+ const Ge = y.querySelectorAll("[video-target]");
1282
1295
  Ge.length > 0 && new X(Ge, {
1283
1296
  LAYOUT: t.params.LAYOUT,
1284
1297
  videoLayoutNo: t.params.videoLayoutNo
1285
1298
  });
1286
1299
  }
1287
1300
  },
1288
- close(b) {
1289
- const D = b.querySelectorAll("[data-overlayscrollbars-viewport]");
1301
+ close(y) {
1302
+ const D = y.querySelectorAll("[data-overlayscrollbars-viewport]");
1290
1303
  Ci([...D]);
1291
1304
  },
1292
- destroy(b) {
1305
+ destroy(y) {
1293
1306
  }
1294
1307
  }
1295
1308
  };
@@ -1304,7 +1317,7 @@ et = new WeakSet(), _e = function() {
1304
1317
  (s.querySelector(r) ?? s).insertAdjacentHTML("beforeend", ht(t.params));
1305
1318
  return;
1306
1319
  }
1307
- }, jt = new WeakSet(), qi = function(i) {
1320
+ }, jt = new WeakSet(), Ii = function(i) {
1308
1321
  const t = this.options;
1309
1322
  return {
1310
1323
  $selector: i,
@@ -2178,9 +2191,9 @@ const Xs = (n) => {
2178
2191
  const i = (t = n.getAttribute("control-elements")) == null ? void 0 : t.split(",");
2179
2192
  i && i.forEach((e) => {
2180
2193
  const s = document.querySelector(e);
2181
- s || A("dropdown", `Can't not find control element(${e})`), s && s.classList.contains("disabled") && (s.classList.remove("disabled"), s.tagName === "DROPDOWN-EL" && s.s.activeLi && q(s, [...s.s.allLi].indexOf(s.s.activeLi)));
2194
+ s || A("dropdown", `Can't not find control element(${e})`), s && s.classList.contains("disabled") && (s.classList.remove("disabled"), s.tagName === "DROPDOWN-EL" && s.s.activeLi && I(s, [...s.s.allLi].indexOf(s.s.activeLi)));
2182
2195
  });
2183
- }, q = (n, i) => {
2196
+ }, I = (n, i) => {
2184
2197
  const t = n.getAttribute("d4-placeholder"), e = n.querySelectorAll(".dropdown-list li");
2185
2198
  if (i < 0 || i.length === 0) {
2186
2199
  switch (e.forEach((s) => {
@@ -2221,7 +2234,7 @@ const Xs = (n) => {
2221
2234
  const o = n.querySelectorAll(".dropdown-list li.active");
2222
2235
  o.length <= 0 ? n.s.selectDisplayEl.textContent = t.trim() : (n.s.selectDisplayEl.textContent = "", o.forEach((r) => {
2223
2236
  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>`;
2224
- n.s.selectDisplayEl.insertAdjacentHTML(L.append, u);
2237
+ n.s.selectDisplayEl.insertAdjacentHTML(S.append, u);
2225
2238
  })), n.s.activeLi = o, n.s.value = [...o].map((r) => ({
2226
2239
  index: [...e].indexOf(r),
2227
2240
  id: r.getAttribute("data-option"),
@@ -2244,7 +2257,7 @@ const Xs = (n) => {
2244
2257
  const o = document.createElement("li");
2245
2258
  o.textContent = e[0], o.setAttribute("data-option", e[0]), n.querySelector(".dropdown-list").append(o);
2246
2259
  });
2247
- }, Ii = () => {
2260
+ }, qi = () => {
2248
2261
  x('dropdown-el[d4-status="open"]').forEach((i) => {
2249
2262
  i.close();
2250
2263
  });
@@ -2258,7 +2271,7 @@ const Xs = (n) => {
2258
2271
  };
2259
2272
  Js();
2260
2273
  document.addEventListener("click", function() {
2261
- Ii();
2274
+ qi();
2262
2275
  });
2263
2276
  var zt, Ni, Bt, Pi, Wt, ji, Gt, zi;
2264
2277
  class Oi extends HTMLElement {
@@ -2288,26 +2301,26 @@ class Oi extends HTMLElement {
2288
2301
  switch (o.hasAttribute("multiple") ? "multiple" : "single") {
2289
2302
  case "single":
2290
2303
  const r = o.querySelector(`.dropdown-list li[data-option="${s}"]`);
2291
- T(r) ? q(o, [...o.s.allLi].indexOf(r)) : q(o, -1);
2304
+ E(r) ? I(o, [...o.s.allLi].indexOf(r)) : I(o, -1);
2292
2305
  break;
2293
2306
  case "multiple":
2294
2307
  const l = [];
2295
2308
  o.querySelector(".dropdown-list li").classList.remove("active"), s.split(",").forEach((u) => {
2296
2309
  const p = o.querySelector(`.dropdown-list li[data-option="${u}"]`);
2297
- T(p) && (p.classList.add("active"), l.push(p));
2310
+ E(p) && (p.classList.add("active"), l.push(p));
2298
2311
  });
2299
2312
  const c = l.map((u) => [...o.s.allLi].indexOf(u));
2300
- q(o, c);
2313
+ I(o, c);
2301
2314
  break;
2302
2315
  }
2303
2316
  else
2304
- q(o, -1);
2317
+ I(o, -1);
2305
2318
  o.emit("change");
2306
2319
  break;
2307
2320
  case "d4-placeholder":
2308
2321
  if (e === null)
2309
2322
  return;
2310
- e !== s && o.s.value.index < 0 && q(o, o.s.value.index);
2323
+ e !== s && o.s.value.index < 0 && I(o, o.s.value.index);
2311
2324
  break;
2312
2325
  }
2313
2326
  }
@@ -2317,7 +2330,7 @@ class Oi extends HTMLElement {
2317
2330
  }
2318
2331
  open() {
2319
2332
  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;
2320
- return Ii(), t.setAttribute("d4-status", "open"), t.setAttribute("d4-default-height", o()), t.style.cssText = `--maxHeight: ${o()}px;`, t.s.dropdownEl.style.cssText = `
2333
+ return qi(), t.setAttribute("d4-status", "open"), t.setAttribute("d4-default-height", o()), t.style.cssText = `--maxHeight: ${o()}px;`, t.s.dropdownEl.style.cssText = `
2321
2334
  height: ${o()}px;
2322
2335
  z-index: 2;
2323
2336
  `, this;
@@ -2362,7 +2375,7 @@ zt = new WeakSet(), Ni = function() {
2362
2375
  }
2363
2376
  } else
2364
2377
  o = t.querySelector(`.dropdown-list li[data-option="${e}"]`);
2365
- T(o) ? (o.classList.add("active"), t.s.activeLi = o, t.s.value = {
2378
+ E(o) ? (o.classList.add("active"), t.s.activeLi = o, t.s.value = {
2366
2379
  index: [...t.s.allLi].indexOf(o),
2367
2380
  id: e,
2368
2381
  el: o
@@ -2376,7 +2389,7 @@ zt = new WeakSet(), Ni = function() {
2376
2389
  const a = [];
2377
2390
  e.split(",").forEach((r) => {
2378
2391
  const l = t.querySelector(`.dropdown-list li[data-option="${r}"]`);
2379
- T(l) && a.push(l);
2392
+ E(l) && a.push(l);
2380
2393
  }), a.length > 0 ? t.s.value = {
2381
2394
  index: a.map((r) => [...t.s.allLi].indexOf(r)),
2382
2395
  id: a.map((r) => r.getAttribute("data-option")),
@@ -2388,7 +2401,7 @@ zt = new WeakSet(), Ni = function() {
2388
2401
  };
2389
2402
  break;
2390
2403
  }
2391
- q(t, t.s.value.index), d(s = t, Gt, zi).call(s), t.classList.add("d4-initialize");
2404
+ I(t, t.s.value.index), d(s = t, Gt, zi).call(s), t.classList.add("d4-initialize");
2392
2405
  }, Gt = new WeakSet(), zi = function() {
2393
2406
  const t = this;
2394
2407
  t.__events__.dropdownToggle = () => {
@@ -2411,7 +2424,7 @@ zt = new WeakSet(), Ni = function() {
2411
2424
  const r = t.querySelector(".dropdown-scroller"), l = () => {
2412
2425
  if (t.__scroller__) {
2413
2426
  const { viewport: c } = t.__scroller__.elements();
2414
- if (T(t.s.activeLi)) {
2427
+ if (E(t.s.activeLi)) {
2415
2428
  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;
2416
2429
  c.scrollTo({
2417
2430
  top: g,
@@ -2449,12 +2462,12 @@ zt = new WeakSet(), Ni = function() {
2449
2462
  const u = this, p = [...e.s.allLi].indexOf(u), g = parseInt(e.getAttribute("d4-default-height"));
2450
2463
  if (u.classList.contains("has-sublayer")) {
2451
2464
  c.stopPropagation();
2452
- const v = u.querySelector(".sub-dropdown"), w = v.querySelector(".sub-dropdown-list"), y = parseInt(getComputedStyle(w).marginTop) + parseInt(getComputedStyle(w).marginBottom);
2453
- v.style.cssText = `--height: ${w.offsetHeight + y}px`;
2454
- const S = parseInt(v.style.cssText.replace("--height:", "").trim()), C = parseInt(getComputedStyle(a).maxHeight), b = () => {
2465
+ const v = u.querySelector(".sub-dropdown"), w = v.querySelector(".sub-dropdown-list"), b = parseInt(getComputedStyle(w).marginTop) + parseInt(getComputedStyle(w).marginBottom);
2466
+ v.style.cssText = `--height: ${w.offsetHeight + b}px`;
2467
+ const T = parseInt(v.style.cssText.replace("--height:", "").trim()), C = parseInt(getComputedStyle(a).maxHeight), y = () => {
2455
2468
  s = g + e.s.subDropdownTotalH, o = s > C ? C : s, e.style.cssText = `--maxHeight: ${o}px;`, e.s.dropdownEl.style.height = `${o}px`;
2456
2469
  };
2457
- u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -= S, b()) : (u.classList.add("open"), e.s.subDropdownTotalH += S, b());
2470
+ u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -= T, y()) : (u.classList.add("open"), e.s.subDropdownTotalH += T, y());
2458
2471
  const D = () => {
2459
2472
  e.__scroller__.update(!0), v.removeEventListener("transitionend", D);
2460
2473
  };
@@ -2463,16 +2476,16 @@ zt = new WeakSet(), Ni = function() {
2463
2476
  switch (Ys(e), e.s.selectType) {
2464
2477
  case "single":
2465
2478
  if (e.setAttribute("d4-value", u.getAttribute("data-option")), r) {
2466
- const v = e.s.cityLang, w = l.textContent.trim(), y = document.getElementById(e.getAttribute("dist-select"));
2467
- y && (y.querySelector(".dropdown-list").textContent = "", q(y, -1), Z[v][w].forEach((S, C) => {
2468
- const b = document.createElement("li");
2469
- b.textContent = S[0], b.setAttribute("data-option", S[0]), y.querySelector(".dropdown-list").append(b);
2470
- }), e.__events__.selectOption(y));
2479
+ const v = e.s.cityLang, w = l.textContent.trim(), b = document.getElementById(e.getAttribute("dist-select"));
2480
+ b && (b.querySelector(".dropdown-list").textContent = "", I(b, -1), Z[v][w].forEach((T, C) => {
2481
+ const y = document.createElement("li");
2482
+ y.textContent = T[0], y.setAttribute("data-option", T[0]), b.querySelector(".dropdown-list").append(y);
2483
+ }), e.__events__.selectOption(b));
2471
2484
  }
2472
2485
  (m = u.parentNode.closest("li")) != null && m.classList.contains("has-sublayer") && (c.stopPropagation(), e.close());
2473
2486
  break;
2474
2487
  case "multiple":
2475
- c.stopPropagation(), u.classList.toggle("active"), q(e, p);
2488
+ c.stopPropagation(), u.classList.toggle("active"), I(e, p);
2476
2489
  break;
2477
2490
  }
2478
2491
  });
@@ -2806,7 +2819,7 @@ Ut = new WeakSet(), Xi = function() {
2806
2819
  }), t = !0);
2807
2820
  };
2808
2821
  i.$wrapper.removeEventListener("scroll", e), i.$wrapper.addEventListener("scroll", e), window.removeEventListener("resize", e), window.addEventListener("resize", e), (i.option.draggable || i.$element.s.type == "collapse") && d(s = i, Zt, Fi).call(s), i.option.navigation && i.$element.s.type !== "collapse" && (i.$container.insertAdjacentHTML(
2809
- L.prepend,
2822
+ S.prepend,
2810
2823
  `<div class="navigation">
2811
2824
  <div class="button prev">
2812
2825
  <div></div>
@@ -2919,7 +2932,7 @@ Vt = new WeakSet(), Ji = function() {
2919
2932
  this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this, Kt, Zi).call(this) && d(this, te, Qi).call(this), d(this, ee, Vi).call(this));
2920
2933
  }, Kt = new WeakSet(), Zi = function() {
2921
2934
  const i = this.$element.querySelector(".drag-container"), t = i.querySelector(".wrapper");
2922
- return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(L.append, '<div class="open-collapse"></div>'), this.$button = i.querySelector(".open-collapse"), k(this.$element, "noScrollable"), !0) : (_(this.$element, "noScrollable"), !1);
2935
+ return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(S.append, '<div class="open-collapse"></div>'), this.$button = i.querySelector(".open-collapse"), k(this.$element, "noScrollable"), !0) : (_(this.$element, "noScrollable"), !1);
2923
2936
  }, te = new WeakSet(), Qi = function() {
2924
2937
  const { $element: i, $button: t } = this, e = function() {
2925
2938
  i.classList.contains("expand") ? i.classList.remove("expand") : i.classList.add("expand");
@@ -2941,7 +2954,7 @@ Vt = new WeakSet(), Ji = function() {
2941
2954
  };
2942
2955
  const tn = (n) => {
2943
2956
  const { type: i, option: t, originalDomString: e } = n.s, s = document.createElement("div");
2944
- return i == "drag" && (s.innerHTML = I.TEMPLATE[i]().trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(L.append, e)), i == "collapse" && (s.innerHTML = I.TEMPLATE[i](t == null ? void 0 : t.collapse).trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(L.append, e), s.querySelector(".collapse-container .wrapper").insertAdjacentHTML(L.append, e)), i == "dropdown" && (s.innerHTML = I.TEMPLATE[i](t == null ? void 0 : t.dropdown).trim(), s.querySelector("dropdown-el").insertAdjacentHTML(L.append, e)), s.children;
2957
+ return i == "drag" && (s.innerHTML = q.TEMPLATE[i]().trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(S.append, e)), i == "collapse" && (s.innerHTML = q.TEMPLATE[i](t == null ? void 0 : t.collapse).trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(S.append, e), s.querySelector(".collapse-container .wrapper").insertAdjacentHTML(S.append, e)), i == "dropdown" && (s.innerHTML = q.TEMPLATE[i](t == null ? void 0 : t.dropdown).trim(), s.querySelector("dropdown-el").insertAdjacentHTML(S.append, e)), s.children;
2945
2958
  };
2946
2959
  var ie, Ki, se, ts, nt, Me, F, ft;
2947
2960
  class en extends HTMLElement {
@@ -2989,7 +3002,7 @@ class en extends HTMLElement {
2989
3002
  }
2990
3003
  ie = new WeakSet(), Ki = function() {
2991
3004
  let t = {};
2992
- this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ?? I.SETTINGS.type, this.hasAttribute("m4-option") && (t = this.getAttribute("m4-option") ? JSON.parse(this.getAttribute("m4-option")) : {}, this.removeAttribute("m4-option"));
3005
+ this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ?? q.SETTINGS.type, this.hasAttribute("m4-option") && (t = this.getAttribute("m4-option") ? JSON.parse(this.getAttribute("m4-option")) : {}, this.removeAttribute("m4-option"));
2993
3006
  const e = (s) => {
2994
3007
  if (s.type === "resize") {
2995
3008
  if (window.innerWidth === this.previousWidth)
@@ -2998,7 +3011,7 @@ ie = new WeakSet(), Ki = function() {
2998
3011
  }
2999
3012
  this.update();
3000
3013
  };
3001
- window.removeEventListener("resize", Je(e)), window.addEventListener("resize", Je(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, I.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, I.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, I.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, I.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint), d(this, se, ts).call(this);
3014
+ window.removeEventListener("resize", Je(e)), window.addEventListener("resize", Je(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, q.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, q.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, q.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, q.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint), d(this, se, ts).call(this);
3002
3015
  }, se = new WeakSet(), ts = function() {
3003
3016
  this.classList.add("m4-init"), d(this, nt, Me).call(this);
3004
3017
  }, nt = new WeakSet(), Me = function() {
@@ -3029,7 +3042,7 @@ ie = new WeakSet(), Ki = function() {
3029
3042
  (o = this.drag) == null || o.update();
3030
3043
  };
3031
3044
  customElements.define("multipurpose-nav", en);
3032
- var ne, is, oe, ss, ot, qe, W, J, ae, ns, re, os, le, as, ce, rs, de, ls, ue, cs, he, ds, pe, us, me, hs, N, R, ge, ps, fe, ms, ve, gs, be, fs;
3045
+ var ne, is, oe, ss, ot, Ie, W, J, ae, ns, re, os, le, as, ce, rs, de, ls, ue, cs, he, ds, pe, us, me, hs, N, R, ge, ps, fe, ms, ve, gs, be, fs;
3033
3046
  class es extends HTMLElement {
3034
3047
  // 定義組件的初始狀態
3035
3048
  constructor(t, e) {
@@ -3106,7 +3119,7 @@ class es extends HTMLElement {
3106
3119
  }
3107
3120
  // 外部呼叫方法 $0.update()
3108
3121
  update() {
3109
- this.t.tabs = d(this, ot, qe).call(this), vs(), console.log("tab update!!!!");
3122
+ this.t.tabs = d(this, ot, Ie).call(this), vs(), console.log("tab update!!!!");
3110
3123
  }
3111
3124
  }
3112
3125
  ne = new WeakSet(), is = function() {
@@ -3129,14 +3142,14 @@ ne = new WeakSet(), is = function() {
3129
3142
  delay: this.getAttribute("t4-delay") || e.transition.delay
3130
3143
  },
3131
3144
  tabGroup: this.getAttribute("t4-group") || e.tabGroup
3132
- }, this.__events__ = {}, this.t.tabs = d(this, ot, qe).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this, oe, ss).call(this);
3145
+ }, this.__events__ = {}, this.t.tabs = d(this, ot, Ie).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this, oe, ss).call(this);
3133
3146
  }, oe = new WeakSet(), ss = function() {
3134
3147
  if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this, ae, ns).call(this), this.t.recordUrl) {
3135
3148
  const e = new URLSearchParams(document.location.search).get(this.t.name), s = document.querySelectorAll(`[t4-name="${this.t.name}"] .tab-panel[t4-id="${e}"]`);
3136
3149
  e && s.length === 1 ? this.t.activeTab = e : console.warn(`沒有${e}這頁喔!!`);
3137
3150
  }
3138
3151
  this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this, be, fs).call(this);
3139
- }, ot = new WeakSet(), qe = function() {
3152
+ }, ot = new WeakSet(), Ie = function() {
3140
3153
  const { t } = this, e = Array.from(document.querySelectorAll(`[t4-control="${t.name}"][t4-role="tab"]`));
3141
3154
  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) => {
3142
3155
  s.getAttribute("t4-id") || console.warn(s, "請幫我設定id!!");
@@ -3196,7 +3209,7 @@ ne = new WeakSet(), is = function() {
3196
3209
  }, N = new WeakSet(), R = function(t, e, s) {
3197
3210
  switch (t) {
3198
3211
  case "step":
3199
- Le(this.t.step) && d(this, ue, cs).call(this, e);
3212
+ Ae(this.t.step) && d(this, ue, cs).call(this, e);
3200
3213
  break;
3201
3214
  case "eventAnchor":
3202
3215
  this.t.anchor && d(this, ce, rs).call(this);
@@ -3314,23 +3327,23 @@ const Qe = (n) => {
3314
3327
  const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e), a = o.children[0].offsetHeight;
3315
3328
  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";
3316
3329
  };
3317
- var at, Ie, ye, bs, we, ys, rt, Oe;
3330
+ var at, qe, ye, bs, we, ys, rt, Oe;
3318
3331
  class on {
3319
3332
  constructor(i, t = {}) {
3320
3333
  h(this, at);
3321
3334
  h(this, ye);
3322
3335
  h(this, we);
3323
3336
  h(this, rt);
3324
- !ct(i) && !Le(i) && !dt(i) && !T(i) || (this.__storage__ = {
3337
+ !ct(i) && !Ae(i) && !dt(i) && !E(i) || (this.__storage__ = {
3325
3338
  el: i,
3326
3339
  options: t
3327
- }, this.active = "data-collapse-active", d(this, at, Ie).call(this));
3340
+ }, this.active = "data-collapse-active", d(this, at, qe).call(this));
3328
3341
  }
3329
3342
  update() {
3330
- d(this, at, Ie).call(this);
3343
+ d(this, at, qe).call(this);
3331
3344
  }
3332
3345
  }
3333
- at = new WeakSet(), Ie = function() {
3346
+ at = new WeakSet(), qe = function() {
3334
3347
  const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } = ii;
3335
3348
  if (this.elements = t.state == "not active" ? x(i + `:not([${this.active}])`) : x(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
3336
3349
  for (const [o, a] of Object.entries(this.options.on))
@@ -3369,14 +3382,14 @@ function ws() {
3369
3382
  });
3370
3383
  }
3371
3384
  document.addEventListener("click", ws);
3372
- var lt, Ne, Te, Ts, Ee, Es, Ae, As;
3385
+ var lt, Ne, Te, Ts, Ee, Es, Le, Ls;
3373
3386
  class rn extends HTMLElement {
3374
3387
  constructor() {
3375
3388
  super();
3376
3389
  h(this, lt);
3377
3390
  h(this, Te);
3378
3391
  h(this, Ee);
3379
- h(this, Ae);
3392
+ h(this, Le);
3380
3393
  this.initialize = !1;
3381
3394
  }
3382
3395
  connectedCallback() {
@@ -3404,11 +3417,11 @@ lt = new WeakSet(), Ne = function() {
3404
3417
  };
3405
3418
  this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this, Te, Ts).call(this);
3406
3419
  }, Te = new WeakSet(), Ts = function() {
3407
- d(this, Ee, Es).call(this), d(this, Ae, As).call(this), this.classList.add("r4-initialize");
3420
+ d(this, Ee, Es).call(this), d(this, Le, Ls).call(this), this.classList.add("r4-initialize");
3408
3421
  }, Ee = new WeakSet(), Es = function() {
3409
3422
  const t = this, e = document.createElement("i");
3410
3423
  e.classList.add("hover-ball"), e.style.transitionDuration = `${t.s.options.speed}ms`, t.appendChild(e);
3411
- }, Ae = new WeakSet(), As = function() {
3424
+ }, Le = new WeakSet(), Ls = function() {
3412
3425
  const t = this.querySelector("i.hover-ball"), e = this;
3413
3426
  e.addEventListener("click", function(a) {
3414
3427
  a.stopPropagation(), e.s.options.click && an(a, e);
@@ -3610,8 +3623,8 @@ export {
3610
3623
  Oi as D,
3611
3624
  Hn as E,
3612
3625
  Mn as F,
3613
- qn as G,
3614
- In as H,
3626
+ In as G,
3627
+ qn as H,
3615
3628
  ln as I,
3616
3629
  On as J,
3617
3630
  Nn as K,
@@ -3629,14 +3642,14 @@ export {
3629
3642
  Yn as W,
3630
3643
  Fn as X,
3631
3644
  Un as Y,
3632
- T as a,
3645
+ E as a,
3633
3646
  dt as b,
3634
3647
  Cs as c,
3635
3648
  _s as d,
3636
3649
  je as e,
3637
- L as f,
3650
+ S as f,
3638
3651
  x as g,
3639
- Ln as h,
3652
+ An as h,
3640
3653
  ct as i,
3641
3654
  bi as j,
3642
3655
  Vs as k,