@xwadex/fesd 0.0.24 → 0.0.25

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,18 +1,18 @@
1
- var Z = (r, e, t) => {
2
- if (!e.has(r))
3
- throw TypeError("Cannot " + t);
1
+ var ht = (r, t, e) => {
2
+ if (!t.has(r))
3
+ throw TypeError("Cannot " + e);
4
4
  };
5
- var d = (r, e, t) => {
6
- if (e.has(r))
5
+ var m = (r, t, e) => {
6
+ if (t.has(r))
7
7
  throw TypeError("Cannot add the same private member more than once");
8
- e instanceof WeakSet ? e.add(r) : e.set(r, t);
8
+ t instanceof WeakSet ? t.add(r) : t.set(r, e);
9
9
  };
10
- var l = (r, e, t) => (Z(r, e, "access private method"), t);
11
- import { i as F, a as B, g as C, v as ee, c as te, b as se, d as re, e as ie, f as oe, s as ae } from "./image-preview-bundle.js";
12
- import { A as xe, j as Se, C as Ee, h as Ce, D as Le, m as qe, I as We, k as ke, M as Te, l as _e, R as Me, T as Oe } from "./image-preview-bundle.js";
13
- import { S as ne } from "./vendor-bundle.js";
14
- const $ = () => {
15
- const r = navigator.userAgent, e = {
10
+ var p = (r, t, e) => (ht(r, t, "access private method"), e);
11
+ import { i as Q, a as F, g as T, v as mt, c as gt, b as bt, d as ft, e as wt, f as vt, s as yt } from "./image-preview-bundle.js";
12
+ import { A as Nt, j as Dt, C as zt, h as Ht, D as jt, m as Pt, I as Ft, k as Ut, M as Vt, l as Yt, R as Gt, T as Jt } from "./image-preview-bundle.js";
13
+ import { S as $t, m as At, p as St } from "./vendor-bundle.js";
14
+ const E = () => {
15
+ const r = navigator.userAgent, t = {
16
16
  // Firefox 1.0+
17
17
  isFirefox: typeof InstallTrigger < "u",
18
18
  // Opera 8.0+
@@ -30,7 +30,7 @@ const $ = () => {
30
30
  isSafari: !/chrome|crios|crmo/i.test(r) && /safari/i.test(r),
31
31
  // Chrome 1 - 79
32
32
  isChrome: !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime) || /chrome|crios|crmo/i.test(r)
33
- }, t = {
33
+ }, e = {
34
34
  // Android
35
35
  isAndroid: r.indexOf("Android") > -1 || r.indexOf("Adr") > -1,
36
36
  // iOS | ipad
@@ -45,124 +45,227 @@ const $ = () => {
45
45
  // Linux
46
46
  isLinux: r.indexOf("Linux") > -1
47
47
  };
48
- return { browser: e, mobile: t, os: s };
49
- }, le = () => {
50
- const { browser: r } = $();
51
- return Object.keys(r).find((e) => {
52
- if (r[e])
53
- return r[e];
48
+ return { browser: t, mobile: e, os: s };
49
+ }, xt = () => {
50
+ const { browser: r } = E();
51
+ return Object.keys(r).find((t) => {
52
+ if (r[t])
53
+ return r[t];
54
54
  });
55
- }, ce = () => {
56
- const { mobile: r } = $();
57
- return Object.keys(r).some((e) => {
58
- if (r[e])
59
- return r[e];
55
+ }, Et = () => {
56
+ const { mobile: r } = E();
57
+ return Object.keys(r).some((t) => {
58
+ if (r[t])
59
+ return r[t];
60
60
  });
61
- }, de = () => {
62
- const { os: r } = $();
63
- return Object.keys(r).find((e) => {
64
- if (r[e])
65
- return r[e];
61
+ }, Ct = () => {
62
+ const { os: r } = E();
63
+ return Object.keys(r).find((t) => {
64
+ if (r[t])
65
+ return r[t];
66
66
  });
67
- }, ue = () => console.dir($());
68
- function we() {
67
+ }, Lt = () => console.dir(E());
68
+ function Ot() {
69
69
  return {
70
- init: $,
71
- isBrowser4: le,
72
- isMobile4: ce,
73
- isOs4: de,
74
- logs: ue
70
+ init: E,
71
+ isBrowser4: xt,
72
+ isMobile4: Et,
73
+ isOs4: Ct,
74
+ logs: Lt
75
75
  };
76
76
  }
77
- const u = (r, e, t) => {
78
- r && (se(r) ? r.forEach((s) => s.style[e] = t) : r.style[e] = t);
77
+ const f = (r, t, e) => {
78
+ r && (bt(r) ? r.forEach((s) => s.style[t] = e) : r.style[t] = e);
79
79
  };
80
- var L, U, q, V, f, R, W, z, y, j, k, G;
81
- class ve {
82
- constructor(e, t = {}) {
83
- d(this, L);
84
- d(this, q);
80
+ var k, Z, q, tt, A, U, W, et, _, st, O, rt, M, it, R, ot, I, at, X, nt, S, V, B, lt, x, Y;
81
+ class Mt {
82
+ constructor(t, e = {}) {
83
+ m(this, k);
84
+ m(this, q);
85
85
  // 取得元件上的設定值
86
- d(this, f);
86
+ m(this, A);
87
87
  // 設置設定值的 CSS 樣式
88
- d(this, W);
89
- d(this, y);
90
- d(this, k);
91
- !F(e) || !B(e) || (this.__storage__ = {
92
- el: e,
93
- options: t
94
- }, this.active = "data-article-active", l(this, L, U).call(this));
88
+ m(this, W);
89
+ // 表格拖曳功能
90
+ m(this, _);
91
+ // 設置表格凍結
92
+ m(this, O);
93
+ m(this, M);
94
+ m(this, R);
95
+ m(this, I);
96
+ // Markdown 設置
97
+ m(this, X);
98
+ m(this, S);
99
+ m(this, B);
100
+ m(this, x);
101
+ !Q(t) || !F(t) || (this.__storage__ = {
102
+ el: t,
103
+ options: e
104
+ }, this.active = "data-article-active", p(this, k, Z).call(this));
95
105
  }
96
106
  update() {
97
- const { elements: e } = this;
98
- e.forEach((t) => {
99
- t.querySelectorAll("._article").forEach((s) => {
100
- s.article = {}, s.article.parent = t, s.article.params = l(this, f, R).call(this, s), l(this, y, j).call(this, s);
107
+ const { elements: t } = this;
108
+ t.forEach((e) => {
109
+ e.querySelectorAll("._article").forEach((s) => {
110
+ s.article = {}, s.article.parent = e, s.article.params = p(this, A, U).call(this, s), p(this, S, V).call(this, s), p(this, x, Y).call(this, s);
101
111
  });
102
112
  });
103
113
  }
104
114
  }
105
- L = new WeakSet(), U = function() {
106
- const { el: e, options: t } = this.__storage__, { SETTINGS: s } = re;
107
- this.elements = t.state == "not active" ? C(e + `:not([${this.active}])`) : C(e), this.elements = C(e), this.options = Object.assign({}, s, t), l(this, q, V).call(this);
108
- }, q = new WeakSet(), V = function() {
109
- const { elements: e } = this;
110
- e.forEach((t) => {
111
- t.setAttribute(this.active, ""), t.querySelectorAll("._article").forEach((s) => {
115
+ k = new WeakSet(), Z = function() {
116
+ const { el: t, options: e } = this.__storage__, { SETTINGS: s } = ft;
117
+ this.elements = e.state == "not active" ? T(t + `:not([${this.active}])`) : T(t), this.elements = T(t), this.options = Object.assign({}, s, e), p(this, q, tt).call(this);
118
+ }, q = new WeakSet(), tt = function() {
119
+ const { elements: t } = this;
120
+ t.forEach((e) => {
121
+ e.setAttribute(this.active, ""), e.querySelectorAll("._article").forEach((s) => {
112
122
  var i, a;
113
- s.article = {}, s.article.parent = t, s.article.params = l(this, f, R).call(this, s), s.article.methods = {}, s.article.methods.update = this.update, l(a = l(i = l(this, W, z).call(this, s), y, j).call(i, s), k, G).call(a, s);
123
+ s.article = {}, s.article.parent = e, s.article.params = p(this, A, U).call(this, s), s.article.methods = {}, s.article.methods.update = this.update, p(a = p(i = p(this, W, et).call(this, s), S, V).call(i, s), B, lt).call(a, s), p(this, x, Y).call(this, s);
114
124
  });
115
125
  });
116
- }, f = new WeakSet(), R = function(e) {
126
+ }, A = new WeakSet(), U = function(t) {
117
127
  return {
118
128
  // 元件本身
119
- $selector: e,
129
+ $selector: t,
120
130
  // 父層元件
121
- $backgroundWrap: e.querySelector("._backgroundWrap"),
122
- $contentWrap: e.querySelector("._contentWrap"),
123
- $wordCover: e.querySelector("._wordCover"),
124
- $buttonCover: e.querySelector("._buttonCover"),
125
- $imgCover: e.querySelector("._imgCover"),
126
- $cover: e.querySelectorAll("._cover"),
127
- $swiper: e.querySelector(".swiper"),
128
- $swiperButtonCover: e.querySelector(".swiper-button-cover"),
131
+ $backgroundWrap: t.querySelector("._backgroundWrap"),
132
+ $contentWrap: t.querySelector("._contentWrap"),
133
+ $wordCover: t.querySelector("._wordCover"),
134
+ $buttonCover: t.querySelector("._buttonCover"),
135
+ $imgCover: t.querySelector("._imgCover"),
136
+ $cover: t.querySelectorAll("._cover"),
137
+ $swiper: t.querySelector(".swiper"),
138
+ $table: t.querySelector("._table"),
139
+ $swiperButtonCover: t.querySelector(".swiper-button-cover"),
129
140
  // 子層元件
130
- $h: e.querySelector("._H"),
131
- $subH: e.querySelector("._subH"),
132
- $p: e.querySelector("._P"),
133
- $button: e.querySelector("._button"),
134
- $description: e.querySelectorAll("._description"),
135
- $video: e.querySelectorAll("[video-id]"),
141
+ $h: t.querySelector("._H"),
142
+ $subH: t.querySelector("._subH"),
143
+ $p: t.querySelector("._P"),
144
+ $button: t.querySelector("._button"),
145
+ $description: t.querySelectorAll("._description"),
146
+ $video: t.querySelectorAll("[video-id]"),
136
147
  // 父層設定
137
- typeFullColor: e.getAttribute("typeFull-color"),
138
- typeFullBoxColor: e.getAttribute("typeFull-boxcolor"),
148
+ typeFullColor: t.getAttribute("typeFull-color"),
149
+ typeFullBoxColor: t.getAttribute("typeFull-boxcolor"),
139
150
  // 子層設定
140
- hColor: e.getAttribute("h-color"),
141
- subHColor: e.getAttribute("subh-color"),
142
- pColor: e.getAttribute("p-color"),
143
- buttonColor: e.getAttribute("button-color"),
144
- buttonColorHover: e.getAttribute("button-color-hover"),
145
- buttonTextColor: e.getAttribute("button-textcolor"),
146
- descriptionColor: e.getAttribute("description-color")
151
+ hColor: t.getAttribute("h-color"),
152
+ subHColor: t.getAttribute("subh-color"),
153
+ pColor: t.getAttribute("p-color"),
154
+ buttonColor: t.getAttribute("button-color"),
155
+ buttonColorHover: t.getAttribute("button-color-hover"),
156
+ buttonTextColor: t.getAttribute("button-textcolor"),
157
+ descriptionColor: t.getAttribute("description-color")
147
158
  };
148
- }, W = new WeakSet(), z = function(e) {
149
- const { params: t } = e.article;
150
- return u(t.$h, "color", t.hColor), u(t.$subH, "color", t.subHColor), u(t.$p, "color", t.pColor), u(t.$description, "color", t.descriptionColor), u(t.$button, "backgroundColor", t.buttonColor), u(t.$button, "color", t.buttonTextColor), t.buttonColorHover && t.$button && (t.$button.appendChild(document.createElement("span")), u(t.$button.querySelector("span"), "backgroundColor", t.buttonColorHover)), u(t.$backgroundWrap, "backgroundColor", t.typeFullColor), u(t.$contentWrap, "backgroundColor", t.typeFullBoxColor), this;
151
- }, y = new WeakSet(), j = function(e) {
152
- const { params: t } = e.article;
153
- return t.$video.length && new ee(t.$video), this;
154
- }, k = new WeakSet(), G = function(e) {
155
- const { basic_rwd: t } = this.options, { params: s } = e.article;
159
+ }, W = new WeakSet(), et = function(t) {
160
+ const { params: e } = t.article;
161
+ return f(e.$h, "color", e.hColor), f(e.$subH, "color", e.subHColor), f(e.$p, "color", e.pColor), f(e.$description, "color", e.descriptionColor), f(e.$button, "backgroundColor", e.buttonColor), f(e.$button, "color", e.buttonTextColor), e.buttonColorHover && e.$button && (e.$button.appendChild(document.createElement("span")), f(e.$button.querySelector("span"), "backgroundColor", e.buttonColorHover)), f(e.$backgroundWrap, "backgroundColor", e.typeFullColor), f(e.$contentWrap, "backgroundColor", e.typeFullBoxColor), this;
162
+ }, _ = new WeakSet(), st = function(t) {
163
+ const { params: e } = t.article, s = e.$table;
164
+ let i = !1, a, o, l, u;
165
+ s.addEventListener("mousedown", function(n) {
166
+ n.preventDefault(), i = !0;
167
+ const c = s.getBoundingClientRect();
168
+ a = n.pageX - c.left, o = n.pageY - c.top, l = s.scrollLeft, u = s.scrollTop;
169
+ }), s.addEventListener("mouseleave", function() {
170
+ i = !1;
171
+ }), s.addEventListener("mouseup", function() {
172
+ i = !1;
173
+ }), s.addEventListener("mousemove", function(n) {
174
+ if (!i)
175
+ return;
176
+ n.preventDefault();
177
+ const c = s.getBoundingClientRect(), d = n.pageX - c.left, g = n.pageY - c.top, b = d - a, h = g - o;
178
+ s.scrollLeft = l - b, s.scrollTop = u - h;
179
+ });
180
+ }, O = new WeakSet(), rt = function(t, e, s) {
181
+ const { basic_rwd: i } = this.options, a = window.innerWidth < i, o = [...t.querySelectorAll("tr")];
182
+ if (a || !o.length)
183
+ return;
184
+ const l = p(this, M, it).call(this, o);
185
+ p(this, I, at).call(this, t, l, e, s);
186
+ }, M = new WeakSet(), it = function(t) {
187
+ const e = [], s = /* @__PURE__ */ new Set();
188
+ return t.forEach((i, a) => {
189
+ const o = [...i.children];
190
+ e[a] = [];
191
+ let l = 0;
192
+ o.forEach((u) => {
193
+ const n = +u.getAttribute("rowspan") || 1, c = +u.getAttribute("colspan") || 1;
194
+ for (; e[a][l] || s.has(`${a},${l}`); )
195
+ l++;
196
+ for (let d = 0; d < n; d++) {
197
+ const g = a + d;
198
+ e[g] ?? (e[g] = []);
199
+ for (let b = 0; b < c; b++) {
200
+ const h = l + b;
201
+ e[g][h] = {
202
+ el: d === 0 && b === 0 ? u : null,
203
+ topRow: a,
204
+ leftCol: l,
205
+ rowspan: n,
206
+ colspan: c
207
+ }, d > 0 && s.add(`${g},${h}`);
208
+ }
209
+ }
210
+ l += c;
211
+ });
212
+ }), e;
213
+ }, R = new WeakSet(), ot = function(t, e) {
214
+ var o;
215
+ const s = e.length, i = Array(s).fill(0), a = t.getBoundingClientRect().top;
216
+ for (let l = 0; l < s; l++)
217
+ for (let u = 0; u < (((o = e[l]) == null ? void 0 : o.length) || 0); u++) {
218
+ const n = e[l][u];
219
+ if (n != null && n.el) {
220
+ const c = n.el.getBoundingClientRect().top;
221
+ i[l] = c - a;
222
+ break;
223
+ }
224
+ }
225
+ return i;
226
+ }, I = new WeakSet(), at = function(t, e, s, i) {
227
+ var u;
228
+ const a = p(this, R, ot).call(this, t, e), o = ((u = e[0]) == null ? void 0 : u.length) ?? 0, l = Array(o).fill(0);
229
+ for (let n = 0; n < o; n++)
230
+ for (let c = 0; c < e.length; c++) {
231
+ const d = e[c][n];
232
+ if (d != null && d.el) {
233
+ l[n] = d.el.offsetLeft;
234
+ break;
235
+ }
236
+ }
237
+ e.forEach(
238
+ (n) => n.forEach((c) => {
239
+ if (!(c != null && c.el))
240
+ return;
241
+ const { el: d, topRow: g, leftCol: b } = c, h = g < s, v = b < i;
242
+ d.style.position = "sticky", d.style.zIndex = h && v ? 3 : h ? 2 : v ? 1 : 0, d.style.backgroundColor = getComputedStyle(d).backgroundColor, h && (d.style.top = `${a[g]}px`), v && (d.style.left = `${l[b]}px`);
243
+ })
244
+ );
245
+ }, X = new WeakSet(), nt = function(t) {
246
+ const e = ["h1", "h2", "h3", "h4", "h5", "h6", "b", "del", "i", "em", "strong", "p", "ul", "ol", "li", "br"], s = (o) => St.sanitize(o, {
247
+ ALLOWED_TAGS: e,
248
+ RETURN_TRUSTED_TYPE: !1
249
+ }), i = (o) => s(At.parse(o));
250
+ t.querySelectorAll("td,th").forEach((o) => {
251
+ const l = o.textContent.trim();
252
+ o.innerHTML = i(l);
253
+ });
254
+ }, S = new WeakSet(), V = function(t) {
255
+ const { params: e } = t.article;
256
+ return e.$video.length && new mt(e.$video), this;
257
+ }, B = new WeakSet(), lt = function(t) {
258
+ const { basic_rwd: e } = this.options, { params: s } = t.article;
156
259
  if (!s.$swiper)
157
260
  return;
158
- const i = te(), a = this;
261
+ const i = gt(), a = this;
159
262
  let o = {
160
263
  on: {
161
264
  init(n) {
162
- const g = n.$el[0];
163
- s.$video.length && ([...g.querySelectorAll("[video4-active]")].forEach((v) => {
164
- var x, p;
165
- (x = v.querySelector(ie.SETTINGS.videoButton)) == null || x.remove(), (p = v.querySelector(".overlay")) == null || p.remove(), v.removeAttribute("video4-active");
265
+ const c = n.$el[0];
266
+ s.$video.length && ([...c.querySelectorAll("[video4-active]")].forEach((g) => {
267
+ var b, h;
268
+ (b = g.querySelector(wt.SETTINGS.videoButton)) == null || b.remove(), (h = g.querySelector(".overlay")) == null || h.remove(), g.removeAttribute("video4-active");
166
269
  }), a.update());
167
270
  },
168
271
  observerUpdate(n) {
@@ -175,8 +278,8 @@ L = new WeakSet(), U = function() {
175
278
  if (s.$selector.setAttribute("img-swiper", "on"), s.$selector.classList.add(`swiper-${i}`), s.$selector.getAttribute("swiper-arrow") !== "off" && s.$selector.getAttribute("swiper-arrow")) {
176
279
  const n = document.createElement("div");
177
280
  n.className = `swiper-button-next swiper-${i}`, s.$swiperButtonCover.appendChild(n);
178
- const g = document.createElement("div");
179
- g.className = `swiper-button-prev swiper-${i}`, s.$swiperButtonCover.appendChild(g), o.navigation = {
281
+ const c = document.createElement("div");
282
+ c.className = `swiper-button-prev swiper-${i}`, s.$swiperButtonCover.appendChild(c), o.navigation = {
180
283
  nextEl: `.swiper-button-next.swiper-${i}`,
181
284
  prevEl: `.swiper-button-prev.swiper-${i}`
182
285
  };
@@ -188,27 +291,35 @@ L = new WeakSet(), U = function() {
188
291
  clickable: !0
189
292
  };
190
293
  }
191
- Number.parseInt(s.$selector.getAttribute("swiper-num")) && (o.breakpoints[t] = {
294
+ Number.parseInt(s.$selector.getAttribute("swiper-num")) && (o.breakpoints[e] = {
192
295
  slidesPerView: s.$selector.getAttribute("swiper-num") ? Number.parseInt(s.$selector.getAttribute("swiper-num")) > 5 ? 5 : Number.parseInt(s.$selector.getAttribute("swiper-num")) : 1
193
296
  }), (s.$selector.getAttribute("swiper-autoplay") !== "off" || !s.$selector.getAttribute("swiper-autoplay")) && (o.autoplay = {
194
297
  delay: 3e3,
195
298
  disableOnInteraction: !1
196
299
  }), (s.$selector.getAttribute("swiper-loop") !== "off" || !s.$selector.getAttribute("swiper-loop")) && (o.loop = !0), s.$selector.getAttribute("swiper-speed") && (o.speed = parseInt(s.$selector.getAttribute("swiper-speed"))), s.$selector.getAttribute("swiper-parallax") !== "off" && !s.$selector.getAttribute("swiper-loop") && (o.parallax = !0), s.$selector.getAttribute("swiper-pagination-dynamic") === "on" && (o.pagination.dynamicBullets = !0, o.pagination ? o.pagination.dynamicBullets = !0 : console.warn("pagination undefined"));
197
- let c = () => window.innerWidth > t && Number(s.$selector.getAttribute("swiper-num")) || 1;
198
- s.$swiper.querySelectorAll(".swiper-slide").length <= c() && (o.navigation = !1, o.pagination = !1, o.autoplay = !1, o.loop = !1, s.$selector.querySelector(".swiper-button-cover").style.display = "none", s.$selector.querySelector(".swiper-pagination").style.display = "none", s.$swiper.classList.add("swiper-no-swiping"));
199
- const h = new ne(s.$swiper, o);
200
- return e.article.swiperList = [], e.article.swiperList.push(h), this;
300
+ let l = () => window.innerWidth > e && Number(s.$selector.getAttribute("swiper-num")) || 1;
301
+ s.$swiper.querySelectorAll(".swiper-slide").length <= l() && (o.navigation = !1, o.pagination = !1, o.autoplay = !1, o.loop = !1, s.$selector.querySelector(".swiper-button-cover").style.display = "none", s.$selector.querySelector(".swiper-pagination").style.display = "none", s.$swiper.classList.add("swiper-no-swiping"));
302
+ const u = new $t(s.$swiper, o);
303
+ return t.article.swiperList = [], t.article.swiperList.push(u), this;
304
+ }, x = new WeakSet(), Y = function(t) {
305
+ const { params: e } = t.article;
306
+ if (!e.$table)
307
+ return;
308
+ const s = t.getAttribute("freeze-table") === "on", i = parseInt(t.getAttribute("freeze-table-row") ?? "1", 10), a = parseInt(t.getAttribute("freeze-table-col") ?? "1", 10), o = t.querySelector("table"), l = t.querySelector("._tipText"), u = t.offsetWidth, n = o.offsetWidth, c = u < n, d = () => {
309
+ s && p(this, O, rt).call(this, o, i, a), (s || c) && p(this, _, st).call(this, t), c ? (t.classList.add("overflow"), l.style.display = "flex") : (t.classList.remove("overflow"), l.style.display = "none"), p(this, X, nt).call(this, o);
310
+ };
311
+ return d(), window.addEventListener("resize", d), this;
201
312
  };
202
- let D = "ontouchstart" in document.documentElement ? "touchstart" : "mousedown", H = "ontouchend" in document.documentElement ? "touchend" : "mouseup", N = "ontouchmove" in document.documentElement ? "touchmove" : "mousemove";
203
- function m(r) {
204
- const e = window.getComputedStyle(r), t = e.transform || e.mozTransform;
205
- if (t === "none")
313
+ let G = "ontouchstart" in document.documentElement ? "touchstart" : "mousedown", J = "ontouchend" in document.documentElement ? "touchend" : "mouseup", j = "ontouchmove" in document.documentElement ? "touchmove" : "mousemove";
314
+ function w(r) {
315
+ const t = window.getComputedStyle(r), e = t.transform || t.mozTransform;
316
+ if (e === "none")
206
317
  return {
207
318
  x: 0,
208
319
  y: 0,
209
320
  z: 0
210
321
  };
211
- const s = t.includes("3d") ? "3d" : "2d", i = t.match(/matrix.*\((.+)\)/)[1].split(", ");
322
+ const s = e.includes("3d") ? "3d" : "2d", i = e.match(/matrix.*\((.+)\)/)[1].split(", ");
212
323
  if (s === "2d")
213
324
  return {
214
325
  x: Number(i[4]),
@@ -222,26 +333,26 @@ function m(r) {
222
333
  z: Number(i[14])
223
334
  };
224
335
  }
225
- function E(r) {
226
- const t = r.querySelector(".wrapper").querySelectorAll(".item");
336
+ function L(r) {
337
+ const e = r.querySelector(".wrapper").querySelectorAll(".item");
227
338
  let s = 0;
228
- return t.forEach((i) => {
229
- const a = getComputedStyle(i), o = parseInt(a.marginLeft), c = parseInt(a.marginRight);
230
- s += i.getBoundingClientRect().width + o + c;
339
+ return e.forEach((i) => {
340
+ const a = getComputedStyle(i), o = parseInt(a.marginLeft), l = parseInt(a.marginRight);
341
+ s += i.getBoundingClientRect().width + o + l;
231
342
  }), s;
232
343
  }
233
- function X(r) {
234
- if (m(r.slideWrapEl).x >= r.translateMin)
344
+ function P(r) {
345
+ if (w(r.slideWrapEl).x >= r.translateMin)
235
346
  return "is-start";
236
- if (m(r.slideWrapEl).x <= r.translateMax)
347
+ if (w(r.slideWrapEl).x <= r.translateMax)
237
348
  return "is-end";
238
- if (m(r.slideWrapEl).x < r.translateMin && m(r.slideWrapEl).x > r.translateMax)
349
+ if (w(r.slideWrapEl).x < r.translateMin && w(r.slideWrapEl).x > r.translateMax)
239
350
  return "is-middle";
240
351
  }
241
- function pe(r) {
242
- const e = r.el, t = e.querySelector(".wrapper");
243
- t.addEventListener(D, function(s) {
244
- switch (r.isDown = !0, r.slidable && t.classList.add("dragging"), D) {
352
+ function Tt(r) {
353
+ const t = r.el, e = t.querySelector(".wrapper");
354
+ e.addEventListener(G, function(s) {
355
+ switch (r.isDown = !0, r.slidable && e.classList.add("dragging"), G) {
245
356
  case "mousedown":
246
357
  r.startX = s.pageX;
247
358
  break;
@@ -249,11 +360,11 @@ function pe(r) {
249
360
  r.startX = s.changedTouches[0].pageX;
250
361
  break;
251
362
  }
252
- r.nowTranslateX = m(t).x;
253
- }), t.addEventListener(H, function(s) {
254
- r.isDown = !1, t.classList.remove("dragging"), t.classList.remove("moving");
363
+ r.nowTranslateX = w(e).x;
364
+ }), e.addEventListener(J, function(s) {
365
+ r.isDown = !1, e.classList.remove("dragging"), e.classList.remove("moving");
255
366
  let i;
256
- switch (N) {
367
+ switch (j) {
257
368
  case "mousemove":
258
369
  i = s.pageX - r.startX;
259
370
  break;
@@ -262,22 +373,22 @@ function pe(r) {
262
373
  break;
263
374
  }
264
375
  if (i === 0 && s.target.closest(".item")) {
265
- if (H === "mouseup" && s.button !== 0)
376
+ if (J === "mouseup" && s.button !== 0)
266
377
  return;
267
- t.querySelectorAll(".item").forEach((o) => {
378
+ e.querySelectorAll(".item").forEach((o) => {
268
379
  o.classList.remove("active");
269
380
  }), s.target.closest(".item").classList.add("active"), r.moveActive(r.params.speed);
270
381
  } else
271
- r.slidable && r.resetPos(e);
272
- }), t.addEventListener("mouseleave", function() {
273
- r.isDown && r.slidable && (r.isDown = !1, t.classList.remove("dragging"), t.classList.remove("moving"), r.resetPos(e));
274
- }), t.addEventListener(N, function(s) {
382
+ r.slidable && r.resetPos(t);
383
+ }), e.addEventListener("mouseleave", function() {
384
+ r.isDown && r.slidable && (r.isDown = !1, e.classList.remove("dragging"), e.classList.remove("moving"), r.resetPos(t));
385
+ }), e.addEventListener(j, function(s) {
275
386
  if (r.draggable && r.slidable) {
276
387
  if (!r.isDown)
277
388
  return;
278
389
  s.preventDefault();
279
390
  let i;
280
- switch (N) {
391
+ switch (j) {
281
392
  case "mousemove":
282
393
  i = s.pageX - r.startX;
283
394
  break;
@@ -286,123 +397,123 @@ function pe(r) {
286
397
  break;
287
398
  }
288
399
  if (i !== 0) {
289
- t.classList.add("moving");
400
+ e.classList.add("moving");
290
401
  const a = {
291
402
  transition: "all 0ms ease 0s",
292
403
  transform: `translate3d(${r.nowTranslateX + i}px,0,0)`
293
404
  };
294
- Object.assign(t.style, a);
405
+ Object.assign(e.style, a);
295
406
  }
296
407
  }
297
408
  });
298
409
  }
299
- function me(r) {
300
- const e = r.querySelectorAll("a");
301
- for (var t = 0, s = e.length; t < s; t++)
302
- e[t].draggable = !1;
410
+ function kt(r) {
411
+ const t = r.querySelectorAll("a");
412
+ for (var e = 0, s = t.length; e < s; e++)
413
+ t[e].draggable = !1;
303
414
  }
304
- class fe {
305
- constructor(e, t) {
306
- this.el = typeof e == "string" ? document.querySelector(e) : e, this.slideWrapEl = this.el.querySelector(".wrapper"), this.params = {
415
+ class Rt {
416
+ constructor(t, e) {
417
+ this.el = typeof t == "string" ? document.querySelector(t) : t, this.slideWrapEl = this.el.querySelector(".wrapper"), this.params = {
307
418
  speed: 300,
308
419
  clickSwitch: !0,
309
420
  breakpoint: !1
310
- }, Object.assign(this.params, t), this.draggable = !0, this.isDown = !1, this.startX = 0, this.nowTranslateX = m(this.slideWrapEl).x, this.slideTotalWidth = E(this.el), this.translateMin = 0, this.translateMax = -Math.floor(
421
+ }, Object.assign(this.params, e), this.draggable = !0, this.isDown = !1, this.startX = 0, this.nowTranslateX = w(this.slideWrapEl).x, this.slideTotalWidth = L(this.el), this.translateMin = 0, this.translateMax = -Math.floor(
311
422
  Math.abs(
312
- E(this.el) - this.el.querySelector(".wrapper").getBoundingClientRect().width
423
+ L(this.el) - this.el.querySelector(".wrapper").getBoundingClientRect().width
313
424
  )
314
425
  ), this.slidable = this.slideTotalWidth > Math.round(this.el.getBoundingClientRect().width) && (!this.params.breakpoint || window.innerWidth <= this.params.breakpoint), this.init();
315
426
  }
316
427
  init() {
317
- const e = this;
318
- e.slidable && (e.slideWrapEl.style.width = `${e.slideTotalWidth}px`, e.el.classList.add("slidable"), e.slideWrapEl.querySelector(".item.active") && e.moveActive()), window.addEventListener("resize", function() {
319
- e.update();
320
- }), pe(e), me(e.el);
428
+ const t = this;
429
+ t.slidable && (t.slideWrapEl.style.width = `${t.slideTotalWidth}px`, t.el.classList.add("slidable"), t.slideWrapEl.querySelector(".item.active") && t.moveActive()), window.addEventListener("resize", function() {
430
+ t.update();
431
+ }), Tt(t), kt(t.el);
321
432
  }
322
- moveActive(e) {
323
- const t = this, s = t.slideWrapEl.querySelector(".item.active"), a = s.previousElementSibling ? s.offsetLeft - t.el.clientWidth / 2 + s.clientWidth / 2 : 0;
324
- if (t.slidable) {
325
- if (-a < 0 && -a > t.translateMax) {
433
+ moveActive(t) {
434
+ const e = this, s = e.slideWrapEl.querySelector(".item.active"), a = s.previousElementSibling ? s.offsetLeft - e.el.clientWidth / 2 + s.clientWidth / 2 : 0;
435
+ if (e.slidable) {
436
+ if (-a < 0 && -a > e.translateMax) {
326
437
  const o = {
327
- transition: `all ${e || 0}ms ease 0s`,
438
+ transition: `all ${t || 0}ms ease 0s`,
328
439
  transform: `translate3d(-${a}px,0,0)`
329
440
  };
330
- Object.assign(t.slideWrapEl.style, o);
441
+ Object.assign(e.slideWrapEl.style, o);
331
442
  } else if (-a >= 0) {
332
443
  const o = {
333
- transition: `all ${e || 0}ms ease 0s`,
444
+ transition: `all ${t || 0}ms ease 0s`,
334
445
  transform: "translate3d(0,0,0)"
335
446
  };
336
- Object.assign(t.slideWrapEl.style, o);
447
+ Object.assign(e.slideWrapEl.style, o);
337
448
  } else {
338
449
  const o = {
339
- transition: `all ${e || 0}ms ease 0s`,
340
- transform: `translate3d(${t.translateMax}px,0,0)`
450
+ transition: `all ${t || 0}ms ease 0s`,
451
+ transform: `translate3d(${e.translateMax}px,0,0)`
341
452
  };
342
- Object.assign(t.slideWrapEl.style, o);
453
+ Object.assign(e.slideWrapEl.style, o);
343
454
  }
344
- if (e)
345
- t.slideWrapEl.addEventListener(
455
+ if (t)
456
+ e.slideWrapEl.addEventListener(
346
457
  "transitionend",
347
458
  function() {
348
- switch (t.nowTranslateX = m(t.slideWrapEl).x, X(t)) {
459
+ switch (e.nowTranslateX = w(e.slideWrapEl).x, P(e)) {
349
460
  case "is-start":
350
- t.el.classList.add("is-start"), t.el.classList.remove("is-end");
461
+ e.el.classList.add("is-start"), e.el.classList.remove("is-end");
351
462
  break;
352
463
  case "is-middle":
353
- t.el.classList.remove("is-start"), t.el.classList.remove("is-end");
464
+ e.el.classList.remove("is-start"), e.el.classList.remove("is-end");
354
465
  break;
355
466
  case "is-end":
356
- t.el.classList.remove("is-start"), t.el.classList.add("is-end");
467
+ e.el.classList.remove("is-start"), e.el.classList.add("is-end");
357
468
  break;
358
469
  }
359
470
  },
360
471
  !1
361
472
  );
362
473
  else
363
- switch (t.nowTranslateX = m(t.slideWrapEl).x, X(t)) {
474
+ switch (e.nowTranslateX = w(e.slideWrapEl).x, P(e)) {
364
475
  case "is-start":
365
- t.el.classList.add("is-start"), t.el.classList.remove("is-end");
476
+ e.el.classList.add("is-start"), e.el.classList.remove("is-end");
366
477
  break;
367
478
  case "is-middle":
368
- t.el.classList.remove("is-start"), t.el.classList.remove("is-end");
479
+ e.el.classList.remove("is-start"), e.el.classList.remove("is-end");
369
480
  break;
370
481
  case "is-end":
371
- t.el.classList.remove("is-start"), t.el.classList.add("is-end");
482
+ e.el.classList.remove("is-start"), e.el.classList.add("is-end");
372
483
  break;
373
484
  }
374
485
  }
375
486
  }
376
487
  resetPos() {
377
- const e = this;
378
- switch (X(e)) {
488
+ const t = this;
489
+ switch (P(t)) {
379
490
  case "is-start":
380
- e.el.classList.add("is-start"), e.el.classList.remove("is-end"), Object.assign(e.slideWrapEl.style, {
381
- transition: `all ${e.params.speed}ms ease 0s`,
491
+ t.el.classList.add("is-start"), t.el.classList.remove("is-end"), Object.assign(t.slideWrapEl.style, {
492
+ transition: `all ${t.params.speed}ms ease 0s`,
382
493
  transform: "translate3d(0,0,0)"
383
494
  });
384
495
  break;
385
496
  case "is-middle":
386
- e.el.classList.remove("is-start"), e.el.classList.remove("is-end");
497
+ t.el.classList.remove("is-start"), t.el.classList.remove("is-end");
387
498
  break;
388
499
  case "is-end":
389
- e.el.classList.remove("is-start"), e.el.classList.add("is-end"), Object.assign(e.slideWrapEl.style, {
390
- transition: `all ${e.params.speed}ms ease 0s`,
391
- transform: `translate3d(${e.translateMax}px,0,0)`
500
+ t.el.classList.remove("is-start"), t.el.classList.add("is-end"), Object.assign(t.slideWrapEl.style, {
501
+ transition: `all ${t.params.speed}ms ease 0s`,
502
+ transform: `translate3d(${t.translateMax}px,0,0)`
392
503
  });
393
504
  break;
394
505
  }
395
506
  }
396
507
  update() {
397
- const e = this;
398
- e.el.querySelector(".wrapper").removeAttribute("style"), e.slideTotalWidth = E(e.el), e.translateMax = -Math.floor(
508
+ const t = this;
509
+ t.el.querySelector(".wrapper").removeAttribute("style"), t.slideTotalWidth = L(t.el), t.translateMax = -Math.floor(
399
510
  Math.abs(
400
- E(e.el) - e.el.querySelector(".wrapper").getBoundingClientRect().width
511
+ L(t.el) - t.el.querySelector(".wrapper").getBoundingClientRect().width
401
512
  )
402
- ), e.slidable = e.slideTotalWidth > Math.round(e.el.getBoundingClientRect().width) && (!e.params.breakpoint || window.innerWidth <= e.params.breakpoint), e.slidable ? (e.slideWrapEl.style.width = `${e.slideTotalWidth}px`, e.el.classList.add("slidable"), e.slideWrapEl.querySelector(".item.active") && e.moveActive()) : (e.el.classList.remove("slidable"), e.el.classList.remove("is-start"), e.el.classList.remove("is-end"), e.slideWrapEl.removeAttribute("style"));
513
+ ), t.slidable = t.slideTotalWidth > Math.round(t.el.getBoundingClientRect().width) && (!t.params.breakpoint || window.innerWidth <= t.params.breakpoint), t.slidable ? (t.slideWrapEl.style.width = `${t.slideTotalWidth}px`, t.el.classList.add("slidable"), t.slideWrapEl.querySelector(".item.active") && t.moveActive()) : (t.el.classList.remove("slidable"), t.el.classList.remove("is-start"), t.el.classList.remove("is-end"), t.slideWrapEl.removeAttribute("style"));
403
514
  }
404
515
  }
405
- const P = (r) => {
516
+ const K = (r) => {
406
517
  if (r == "facebook")
407
518
  return "https://www.facebook.com/sharer/sharer.php?u=";
408
519
  if (r == "line")
@@ -414,95 +525,95 @@ const P = (r) => {
414
525
  if (r == "telegram")
415
526
  return "https://telegram.me/share/url?url=";
416
527
  };
417
- var T, Y, _, J, M, K;
418
- class ye {
419
- constructor(e, t = {}) {
420
- d(this, T);
421
- d(this, _);
422
- d(this, M);
528
+ var N, ct, D, dt, z, ut;
529
+ class It {
530
+ constructor(t, e = {}) {
531
+ m(this, N);
532
+ m(this, D);
533
+ m(this, z);
423
534
  this.__storage__ = {
424
- el: e,
425
- options: t
426
- }, l(this, T, Y).call(this);
535
+ el: t,
536
+ options: e
537
+ }, p(this, N, ct).call(this);
427
538
  }
428
539
  }
429
- T = new WeakSet(), Y = function() {
430
- const { el: e, options: t } = this.__storage__, { SETTINGS: s } = ae;
431
- !F(e) || !B(e) || (this.elements = C(e), this.options = Object.assign({}, s, t), l(this, _, J).call(this));
432
- }, _ = new WeakSet(), J = function() {
433
- const { elements: e, options: t } = this;
434
- e.forEach((s) => {
540
+ N = new WeakSet(), ct = function() {
541
+ const { el: t, options: e } = this.__storage__, { SETTINGS: s } = yt;
542
+ !Q(t) || !F(t) || (this.elements = T(t), this.options = Object.assign({}, s, e), p(this, D, dt).call(this));
543
+ }, D = new WeakSet(), dt = function() {
544
+ const { elements: t, options: e } = this;
545
+ t.forEach((s) => {
435
546
  s.querySelectorAll("[share-target]").forEach((i) => {
436
- i.share = {}, i.share.instance = this, i.share.params = t, i.share.eventHandler = l(this, M, K), i.addEventListener("click", i.share.eventHandler);
547
+ i.share = {}, i.share.instance = this, i.share.params = e, i.share.eventHandler = p(this, z, ut), i.addEventListener("click", i.share.eventHandler);
437
548
  });
438
549
  });
439
- }, M = new WeakSet(), K = function() {
440
- const { eventHandler: e, params: t } = this.share, s = this.getAttribute("share-target"), i = {
550
+ }, z = new WeakSet(), ut = function() {
551
+ const { eventHandler: t, params: e } = this.share, s = this.getAttribute("share-target"), i = {
441
552
  source: this.getAttribute("utm-source"),
442
553
  medium: this.getAttribute("utm-medium"),
443
554
  campaign: this.getAttribute("utm-campaign")
444
555
  }, a = {
445
- success: this.getAttribute("copy-success") || t.success,
446
- text: this.getAttribute("copy-text") || t.text,
447
- className: this.getAttribute("copy-class") || t.className,
448
- duration: this.getAttribute("copy-duration") || t.duration
556
+ success: this.getAttribute("copy-success") || e.success,
557
+ text: this.getAttribute("copy-text") || e.text,
558
+ className: this.getAttribute("copy-class") || e.className,
559
+ duration: this.getAttribute("copy-duration") || e.duration
449
560
  }, o = encodeURIComponent(document.URL);
450
- let c = o;
561
+ let l = o;
451
562
  if (s == "wechat") {
452
563
  window.open(`https://api.qrserver.com/v1/create-qr-code/?data=${o}&size=250x250`, "share to wechat", "width=300,height=300");
453
564
  return;
454
565
  }
455
566
  if (s == "url") {
456
- if (B(".copied-wrapper"))
567
+ if (F(".copied-wrapper"))
457
568
  return;
458
- document.querySelector("body").insertAdjacentHTML(oe.append, `<div class='copied-wrapper'><div class='text'>${a.success ? a.success : ""}</div><input id='clipboard' type='text' readonly></div>`);
459
- const h = document.querySelector(".copied-wrapper");
460
- a.className && h.classList.add(a.className), h.style.top = this.getBoundingClientRect().top + window.scrollY + "px", h.style.left = this.getBoundingClientRect().left + this.getBoundingClientRect().width / 2 + "px", h.style.display = "block";
569
+ document.querySelector("body").insertAdjacentHTML(vt.append, `<div class='copied-wrapper'><div class='text'>${a.success ? a.success : ""}</div><input id='clipboard' type='text' readonly></div>`);
570
+ const u = document.querySelector(".copied-wrapper");
571
+ a.className && u.classList.add(a.className), u.style.top = this.getBoundingClientRect().top + window.scrollY + "px", u.style.left = this.getBoundingClientRect().left + this.getBoundingClientRect().width / 2 + "px", u.style.display = "block";
461
572
  const n = document.querySelector("#clipboard");
462
573
  if (n.value = a.text ?? window.location.href, n.setSelectionRange(0, 9999), n.select(), document.execCommand("copy")) {
463
574
  document.execCommand("copy");
464
- const g = document.querySelector(".copied-wrapper"), A = document.querySelector(".copied-wrapper .text");
465
- A.style.display = "block", A.style.opacity = 0;
466
- const v = (p, O) => {
467
- let b = 0;
468
- const w = 50, S = w / O, I = setInterval(function() {
469
- b += S, p.style.opacity = b, b >= 1 && (clearInterval(I), setTimeout(function() {
470
- x(p, 300, function() {
471
- g.remove();
575
+ const c = document.querySelector(".copied-wrapper"), d = document.querySelector(".copied-wrapper .text");
576
+ d.style.display = "block", d.style.opacity = 0;
577
+ const g = (h, v) => {
578
+ let y = 0;
579
+ const $ = 50, C = $ / v, H = setInterval(function() {
580
+ y += C, h.style.opacity = y, y >= 1 && (clearInterval(H), setTimeout(function() {
581
+ b(h, 300, function() {
582
+ c.remove();
472
583
  });
473
584
  }, a.duration));
474
- }, w);
475
- }, x = (p, O, b) => {
476
- let w = 1;
477
- const S = 50, I = S / O, Q = setInterval(() => {
478
- w -= I, p.style.opacity = w, w <= 0 && (clearInterval(Q), p.style.display = "none", b && b());
479
- }, S);
585
+ }, $);
586
+ }, b = (h, v, y) => {
587
+ let $ = 1;
588
+ const C = 50, H = C / v, pt = setInterval(() => {
589
+ $ -= H, h.style.opacity = $, $ <= 0 && (clearInterval(pt), h.style.display = "none", y && y());
590
+ }, C);
480
591
  };
481
- v(A, 300);
592
+ g(d, 300);
482
593
  }
483
594
  return;
484
595
  }
485
- c = `${c}${i.source ? `?utm_source=${i.source}` : ""}${i.medium ? `&utm_medium${i.medium}` : ""}${i.campaign ? `&utm_campaign${i.campaign}` : ""}`, c = c.replace("?", "%3F").replace(new RegExp("&", "g"), "%26"), s == "line" ? window.open(`${P(s)}${o}`) : window.open(`${P(s)}${c}&quote=${c}`), this.removeEventListener("click", e), setTimeout(() => {
486
- this.addEventListener("click", e);
596
+ l = `${l}${i.source ? `?utm_source=${i.source}` : ""}${i.medium ? `&utm_medium${i.medium}` : ""}${i.campaign ? `&utm_campaign${i.campaign}` : ""}`, l = l.replace("?", "%3F").replace(new RegExp("&", "g"), "%26"), s == "line" ? window.open(`${K(s)}${o}`) : window.open(`${K(s)}${l}&quote=${l}`), this.removeEventListener("click", t), setTimeout(() => {
597
+ this.addEventListener("click", t);
487
598
  }, 100);
488
599
  };
489
600
  export {
490
- xe as Anchor4,
491
- Se as Aost4,
492
- ve as Article4,
493
- fe as CategorySlider,
494
- Ee as Collapse4,
495
- Ce as Configs,
496
- we as Detect4,
497
- Le as Dropdown4,
498
- qe as ImagePreview,
499
- We as ImageValidate,
500
- ke as Marquee4,
501
- Te as Modal4,
502
- _e as Multipurpose4,
503
- Me as Ripple4,
504
- ye as Share4,
505
- Oe as Tab4,
506
- ee as Video4
601
+ Nt as Anchor4,
602
+ Dt as Aost4,
603
+ Mt as Article4,
604
+ Rt as CategorySlider,
605
+ zt as Collapse4,
606
+ Ht as Configs,
607
+ Ot as Detect4,
608
+ jt as Dropdown4,
609
+ Pt as ImagePreview,
610
+ Ft as ImageValidate,
611
+ Ut as Marquee4,
612
+ Vt as Modal4,
613
+ Yt as Multipurpose4,
614
+ Gt as Ripple4,
615
+ It as Share4,
616
+ Jt as Tab4,
617
+ mt as Video4
507
618
  };
508
619
  //# sourceMappingURL=fesd-bundle.js.map