@xwadex/fesd 0.0.68 → 0.0.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fesd-bundle.css +1 -9
- package/dist/fesd-bundle.js +480 -516
- package/dist/fesd-bundle.js.map +1 -1
- package/dist/image-preview-bundle.js +1923 -2020
- package/dist/image-preview-bundle.js.map +1 -1
- package/dist/tools-bundle.js +277 -316
- package/dist/tools-bundle.js.map +1 -1
- package/dist/vendor-bundle.js +1960 -2122
- package/dist/vendor-bundle.js.map +1 -1
- package/package.json +3 -3
package/dist/fesd-bundle.js
CHANGED
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
if (e.has(s))
|
|
7
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
8
|
-
e instanceof WeakSet ? e.add(s) : e.set(s, t);
|
|
9
|
-
};
|
|
10
|
-
var h = (s, e, t) => (be(s, e, "access private method"), t);
|
|
11
|
-
import { i as te, a as V, g as T, v as we, c as ve, b as ye, d as $e, e as xe, f as Ae, s as ke } from "./image-preview-bundle.js";
|
|
12
|
-
import { A as je, j as Pe, C as Fe, h as Ue, D as Ve, m as Ye, I as Ge, k as Je, M as Ke, l as Qe, R as Ze, T as et } from "./image-preview-bundle.js";
|
|
13
|
-
import K from "jquery";
|
|
14
|
-
import { m as x, S as Se, p as Le } from "./vendor-bundle.js";
|
|
15
|
-
const L = () => {
|
|
1
|
+
import { F as M, B as C, g as R, s as A, W as B, m as I, X as z, E as N, P as X, z as D } from "./image-preview-bundle.js";
|
|
2
|
+
import { A as oe, a as ae, C as ne, k as le, D as ce, I as de, b as ue, M as pe, c as he, d as me, R as ge, T as fe } from "./image-preview-bundle.js";
|
|
3
|
+
import T from "jquery";
|
|
4
|
+
import { m as v, S as H, p as j } from "./vendor-bundle.js";
|
|
5
|
+
const y = () => {
|
|
16
6
|
const s = navigator.userAgent, e = {
|
|
17
7
|
// Firefox 1.0+
|
|
18
8
|
isFirefox: typeof InstallTrigger < "u",
|
|
@@ -47,419 +37,398 @@ const L = () => {
|
|
|
47
37
|
isLinux: s.indexOf("Linux") > -1
|
|
48
38
|
};
|
|
49
39
|
return { browser: e, mobile: t, os: r };
|
|
50
|
-
},
|
|
51
|
-
const { browser: s } =
|
|
40
|
+
}, P = () => {
|
|
41
|
+
const { browser: s } = y();
|
|
52
42
|
return Object.keys(s).find((e) => {
|
|
53
|
-
if (s[e])
|
|
54
|
-
return s[e];
|
|
43
|
+
if (s[e]) return s[e];
|
|
55
44
|
});
|
|
56
|
-
},
|
|
57
|
-
const { mobile: s } =
|
|
45
|
+
}, F = () => {
|
|
46
|
+
const { mobile: s } = y();
|
|
58
47
|
return Object.keys(s).some((e) => {
|
|
59
|
-
if (s[e])
|
|
60
|
-
return s[e];
|
|
48
|
+
if (s[e]) return s[e];
|
|
61
49
|
});
|
|
62
|
-
},
|
|
63
|
-
const { os: s } =
|
|
50
|
+
}, U = () => {
|
|
51
|
+
const { os: s } = y();
|
|
64
52
|
return Object.keys(s).find((e) => {
|
|
65
|
-
if (s[e])
|
|
66
|
-
return s[e];
|
|
53
|
+
if (s[e]) return s[e];
|
|
67
54
|
});
|
|
68
|
-
},
|
|
69
|
-
function
|
|
55
|
+
}, V = () => console.dir(y());
|
|
56
|
+
function Z() {
|
|
70
57
|
return {
|
|
71
|
-
init:
|
|
72
|
-
isBrowser4:
|
|
73
|
-
isMobile4:
|
|
74
|
-
isOs4:
|
|
75
|
-
logs:
|
|
58
|
+
init: y,
|
|
59
|
+
isBrowser4: P,
|
|
60
|
+
isMobile4: F,
|
|
61
|
+
isOs4: U,
|
|
62
|
+
logs: V
|
|
76
63
|
};
|
|
77
64
|
}
|
|
78
|
-
const
|
|
79
|
-
s && (
|
|
65
|
+
const g = (s, e, t) => {
|
|
66
|
+
s && (N(s) ? s.forEach((r) => r.style[e] = t) : s.style[e] = t);
|
|
80
67
|
};
|
|
81
|
-
|
|
82
|
-
class ze {
|
|
68
|
+
class ee {
|
|
83
69
|
constructor(e, t = {}) {
|
|
84
|
-
|
|
85
|
-
m(this, W);
|
|
86
|
-
// 取得元件上的設定值
|
|
87
|
-
m(this, A);
|
|
88
|
-
// 設置設定值的 CSS 樣式
|
|
89
|
-
m(this, _);
|
|
90
|
-
// 表格拖曳功能
|
|
91
|
-
m(this, O);
|
|
92
|
-
// 設置表格凍結
|
|
93
|
-
m(this, M);
|
|
94
|
-
m(this, R);
|
|
95
|
-
m(this, B);
|
|
96
|
-
m(this, N);
|
|
97
|
-
// Markdown 設置
|
|
98
|
-
m(this, z);
|
|
99
|
-
// Navigation 設置
|
|
100
|
-
m(this, I);
|
|
101
|
-
m(this, k);
|
|
102
|
-
m(this, X);
|
|
103
|
-
m(this, S);
|
|
104
|
-
!te(e) || !V(e) || (this.__storage__ = {
|
|
70
|
+
!M(e) || !C(e) || (this.__storage__ = {
|
|
105
71
|
el: e,
|
|
106
72
|
options: t
|
|
107
|
-
}, this.active = "data-article-active",
|
|
73
|
+
}, this.active = "data-article-active", this.#t());
|
|
108
74
|
}
|
|
109
|
-
|
|
75
|
+
#t() {
|
|
76
|
+
const { el: e, options: t } = this.__storage__, { SETTINGS: r } = R;
|
|
77
|
+
this.elements = t.state == "not active" ? A(e + `:not([${this.active}])`) : A(e), this.elements = A(e), this.options = Object.assign({}, r, t), this.#r();
|
|
78
|
+
}
|
|
79
|
+
#r() {
|
|
110
80
|
const { elements: e } = this;
|
|
111
81
|
e.forEach((t) => {
|
|
112
|
-
t.querySelectorAll("._article").forEach((r) => {
|
|
113
|
-
r.article = {}, r.article.parent = t, r.article.params =
|
|
82
|
+
t.setAttribute(this.active, ""), t.querySelectorAll("._article").forEach((r) => {
|
|
83
|
+
r.article = {}, r.article.parent = t, r.article.params = this.#e(r), r.article.methods = {}, r.article.methods.update = this.update, this.#o(r).#s(r).#h(r), this.#i(r);
|
|
114
84
|
});
|
|
115
85
|
});
|
|
116
86
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
87
|
+
// 取得元件上的設定值
|
|
88
|
+
#e(e) {
|
|
89
|
+
return {
|
|
90
|
+
// 元件本身
|
|
91
|
+
$selector: e,
|
|
92
|
+
// 父層元件
|
|
93
|
+
$backgroundWrap: e.querySelector("._backgroundWrap"),
|
|
94
|
+
$contentWrap: e.querySelector("._contentWrap"),
|
|
95
|
+
$wordCover: e.querySelector("._wordCover"),
|
|
96
|
+
$buttonCover: e.querySelector("._buttonCover"),
|
|
97
|
+
$imgCover: e.querySelector("._imgCover"),
|
|
98
|
+
$cover: e.querySelectorAll("._cover"),
|
|
99
|
+
$swiper: e.querySelector(".swiper"),
|
|
100
|
+
$table: e.querySelector("._table"),
|
|
101
|
+
$quote: e.querySelector("._quote"),
|
|
102
|
+
$swiperButtonCover: e.querySelector(".swiper-button-cover"),
|
|
103
|
+
// 子層元件
|
|
104
|
+
$h: e.querySelector("._H"),
|
|
105
|
+
$subH: e.querySelector("._subH"),
|
|
106
|
+
$p: e.querySelector("._P"),
|
|
107
|
+
$button: e.querySelector("._button"),
|
|
108
|
+
$description: e.querySelectorAll("._description"),
|
|
109
|
+
$video: e.querySelectorAll("[video-id]"),
|
|
110
|
+
// 父層設定
|
|
111
|
+
typeFullColor: e.getAttribute("typeFull-color"),
|
|
112
|
+
typeFullBoxColor: e.getAttribute("typeFull-boxcolor"),
|
|
113
|
+
// 子層設定
|
|
114
|
+
hColor: e.getAttribute("h-color"),
|
|
115
|
+
subHColor: e.getAttribute("subh-color"),
|
|
116
|
+
pColor: e.getAttribute("p-color"),
|
|
117
|
+
buttonColor: e.getAttribute("button-color"),
|
|
118
|
+
buttonColorHover: e.getAttribute("button-color-hover"),
|
|
119
|
+
buttonTextColor: e.getAttribute("button-textcolor"),
|
|
120
|
+
descriptionColor: e.getAttribute("description-color"),
|
|
121
|
+
quoteColor: e.getAttribute("quote-color"),
|
|
122
|
+
markdown: e.getAttribute("data-table-markdown") ?? !1
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
// 設置設定值的 CSS 樣式
|
|
126
|
+
#o(e) {
|
|
127
|
+
const { params: t } = e.article;
|
|
128
|
+
return g(t.$h, "color", t.hColor), g(t.$subH, "color", t.subHColor), g(t.$p, "color", t.pColor), g(t.$description, "color", t.descriptionColor), g(t.$button, "backgroundColor", t.buttonColor), g(t.$button, "color", t.buttonTextColor), t.buttonColorHover && t.$button && (t.$button.appendChild(document.createElement("span")), g(t.$button.querySelector("span"), "backgroundColor", t.buttonColorHover)), g(t.$backgroundWrap, "backgroundColor", t.typeFullColor), g(t.$contentWrap, "backgroundColor", t.typeFullBoxColor), g(t.$quote, "color", t.quoteColor), this;
|
|
129
|
+
}
|
|
130
|
+
// 表格拖曳功能
|
|
131
|
+
#a(e) {
|
|
132
|
+
const { params: t } = e.article, r = t.$table;
|
|
133
|
+
let o = !1, n, a, d, u;
|
|
134
|
+
r.addEventListener("mousedown", function(l) {
|
|
135
|
+
l.preventDefault(), o = !0;
|
|
136
|
+
const i = r.getBoundingClientRect();
|
|
137
|
+
n = l.pageX - i.left, a = l.pageY - i.top, d = r.scrollLeft, u = r.scrollTop;
|
|
138
|
+
}), r.addEventListener("mouseleave", function() {
|
|
139
|
+
o = !1;
|
|
140
|
+
}), r.addEventListener("mouseup", function() {
|
|
141
|
+
o = !1;
|
|
142
|
+
}), r.addEventListener("mousemove", function(l) {
|
|
143
|
+
if (!o) return;
|
|
144
|
+
l.preventDefault();
|
|
145
|
+
const i = r.getBoundingClientRect(), p = l.pageX - i.left, c = l.pageY - i.top, h = p - n, m = c - a;
|
|
146
|
+
r.scrollLeft = d - h, r.scrollTop = u - m;
|
|
127
147
|
});
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
buttonColorHover: e.getAttribute("button-color-hover"),
|
|
160
|
-
buttonTextColor: e.getAttribute("button-textcolor"),
|
|
161
|
-
descriptionColor: e.getAttribute("description-color"),
|
|
162
|
-
quoteColor: e.getAttribute("quote-color"),
|
|
163
|
-
markdown: e.getAttribute("data-table-markdown") ?? !1
|
|
164
|
-
};
|
|
165
|
-
}, _ = new WeakSet(), ie = function(e) {
|
|
166
|
-
const { params: t } = e.article;
|
|
167
|
-
return b(t.$h, "color", t.hColor), b(t.$subH, "color", t.subHColor), b(t.$p, "color", t.pColor), b(t.$description, "color", t.descriptionColor), b(t.$button, "backgroundColor", t.buttonColor), b(t.$button, "color", t.buttonTextColor), t.buttonColorHover && t.$button && (t.$button.appendChild(document.createElement("span")), b(t.$button.querySelector("span"), "backgroundColor", t.buttonColorHover)), b(t.$backgroundWrap, "backgroundColor", t.typeFullColor), b(t.$contentWrap, "backgroundColor", t.typeFullBoxColor), b(t.$quote, "color", t.quoteColor), this;
|
|
168
|
-
}, O = new WeakSet(), oe = function(e) {
|
|
169
|
-
const { params: t } = e.article, r = t.$table;
|
|
170
|
-
let o = !1, l, n, u, p;
|
|
171
|
-
r.addEventListener("mousedown", function(c) {
|
|
172
|
-
c.preventDefault(), o = !0;
|
|
173
|
-
const i = r.getBoundingClientRect();
|
|
174
|
-
l = c.pageX - i.left, n = c.pageY - i.top, u = r.scrollLeft, p = r.scrollTop;
|
|
175
|
-
}), r.addEventListener("mouseleave", function() {
|
|
176
|
-
o = !1;
|
|
177
|
-
}), r.addEventListener("mouseup", function() {
|
|
178
|
-
o = !1;
|
|
179
|
-
}), r.addEventListener("mousemove", function(c) {
|
|
180
|
-
if (!o)
|
|
181
|
-
return;
|
|
182
|
-
c.preventDefault();
|
|
183
|
-
const i = r.getBoundingClientRect(), a = c.pageX - i.left, d = c.pageY - i.top, g = a - l, f = d - n;
|
|
184
|
-
r.scrollLeft = u - g, r.scrollTop = p - f;
|
|
185
|
-
});
|
|
186
|
-
}, M = new WeakSet(), ae = function(e, t, r) {
|
|
187
|
-
const { basic_rwd: o } = this.options, l = window.innerWidth < o, n = [...e.querySelectorAll("tr")];
|
|
188
|
-
if (l || !n.length)
|
|
189
|
-
return;
|
|
190
|
-
const u = h(this, R, ne).call(this, n);
|
|
191
|
-
h(this, N, ce).call(this, e, u, t, r);
|
|
192
|
-
}, R = new WeakSet(), ne = function(e) {
|
|
193
|
-
const t = [], r = /* @__PURE__ */ new Set();
|
|
194
|
-
return e.forEach((o, l) => {
|
|
195
|
-
const n = [...o.children];
|
|
196
|
-
t[l] = [];
|
|
197
|
-
let u = 0;
|
|
198
|
-
n.forEach((p) => {
|
|
199
|
-
const c = +p.getAttribute("rowspan") || 1, i = +p.getAttribute("colspan") || 1;
|
|
200
|
-
for (; t[l][u] || r.has(`${l},${u}`); )
|
|
201
|
-
u++;
|
|
202
|
-
for (let a = 0; a < c; a++) {
|
|
203
|
-
const d = l + a;
|
|
204
|
-
t[d] ?? (t[d] = []);
|
|
205
|
-
for (let g = 0; g < i; g++) {
|
|
206
|
-
const f = u + g;
|
|
207
|
-
t[d][f] = {
|
|
208
|
-
el: a === 0 && g === 0 ? p : null,
|
|
209
|
-
topRow: l,
|
|
210
|
-
leftCol: u,
|
|
211
|
-
rowspan: c,
|
|
212
|
-
colspan: i
|
|
213
|
-
}, a > 0 && r.add(`${d},${f}`);
|
|
148
|
+
}
|
|
149
|
+
// 設置表格凍結
|
|
150
|
+
#n(e, t, r) {
|
|
151
|
+
const { basic_rwd: o } = this.options, n = window.innerWidth < o, a = [...e.querySelectorAll("tr")];
|
|
152
|
+
if (n || !a.length) return;
|
|
153
|
+
const d = this.#l(a);
|
|
154
|
+
this.#d(e, d, t, r);
|
|
155
|
+
}
|
|
156
|
+
#l(e) {
|
|
157
|
+
const t = [], r = /* @__PURE__ */ new Set();
|
|
158
|
+
return e.forEach((o, n) => {
|
|
159
|
+
const a = [...o.children];
|
|
160
|
+
t[n] = [];
|
|
161
|
+
let d = 0;
|
|
162
|
+
a.forEach((u) => {
|
|
163
|
+
const l = +u.getAttribute("rowspan") || 1, i = +u.getAttribute("colspan") || 1;
|
|
164
|
+
for (; t[n][d] || r.has(`${n},${d}`); )
|
|
165
|
+
d++;
|
|
166
|
+
for (let p = 0; p < l; p++) {
|
|
167
|
+
const c = n + p;
|
|
168
|
+
t[c] ??= [];
|
|
169
|
+
for (let h = 0; h < i; h++) {
|
|
170
|
+
const m = d + h;
|
|
171
|
+
t[c][m] = {
|
|
172
|
+
el: p === 0 && h === 0 ? u : null,
|
|
173
|
+
topRow: n,
|
|
174
|
+
leftCol: d,
|
|
175
|
+
rowspan: l,
|
|
176
|
+
colspan: i
|
|
177
|
+
}, p > 0 && r.add(`${c},${m}`);
|
|
178
|
+
}
|
|
214
179
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
break;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
return o;
|
|
232
|
-
}, N = new WeakSet(), ce = function(e, t, r, o) {
|
|
233
|
-
var p;
|
|
234
|
-
const l = h(this, B, le).call(this, e, t), n = ((p = t[0]) == null ? void 0 : p.length) ?? 0, u = Array(n).fill(0);
|
|
235
|
-
for (let c = 0; c < n; c++)
|
|
236
|
-
for (let i = 0; i < t.length; i++) {
|
|
237
|
-
const a = t[i][c];
|
|
238
|
-
if (a != null && a.el) {
|
|
239
|
-
u[c] = a.el.offsetLeft;
|
|
240
|
-
break;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
t.forEach(
|
|
244
|
-
(c) => c.forEach((i) => {
|
|
245
|
-
if (!(i != null && i.el))
|
|
246
|
-
return;
|
|
247
|
-
const { el: a, topRow: d, leftCol: g } = i, f = d < r, v = g < o;
|
|
248
|
-
a.style.position = "sticky", a.style.zIndex = f && v ? 3 : f ? 2 : v ? 1 : 0, a.style.backgroundColor = getComputedStyle(a).backgroundColor, f && (a.style.top = `${l[d]}px`), v && (a.style.left = `${u[g]}px`);
|
|
249
|
-
})
|
|
250
|
-
);
|
|
251
|
-
}, z = new WeakSet(), de = function(e) {
|
|
252
|
-
const { markdownLink: t, markdownImg: r, markdownLinkBlank: o } = this.options;
|
|
253
|
-
if (e.hasAttribute("data-markdown-rendered"))
|
|
254
|
-
return;
|
|
255
|
-
new x.Renderer(), x.use({
|
|
256
|
-
extensions: [
|
|
257
|
-
{
|
|
258
|
-
name: "center",
|
|
259
|
-
level: "block",
|
|
260
|
-
start(i) {
|
|
261
|
-
var a;
|
|
262
|
-
return (a = i.match(/@center@/)) == null ? void 0 : a.index;
|
|
263
|
-
},
|
|
264
|
-
tokenizer(i) {
|
|
265
|
-
const d = /^@center@(.+?)@center@/s.exec(i);
|
|
266
|
-
if (d)
|
|
267
|
-
return {
|
|
268
|
-
type: "center",
|
|
269
|
-
raw: d[0],
|
|
270
|
-
text: d[1],
|
|
271
|
-
tokens: this.lexer.inlineTokens(d[1])
|
|
272
|
-
};
|
|
273
|
-
},
|
|
274
|
-
renderer(i) {
|
|
275
|
-
return `<div data-center="true">${x.parser(i.tokens)}</div>`;
|
|
180
|
+
d += i;
|
|
181
|
+
});
|
|
182
|
+
}), t;
|
|
183
|
+
}
|
|
184
|
+
#c(e, t) {
|
|
185
|
+
const r = t.length, o = Array(r).fill(0), n = e.getBoundingClientRect().top;
|
|
186
|
+
for (let a = 0; a < r; a++)
|
|
187
|
+
for (let d = 0; d < (t[a]?.length || 0); d++) {
|
|
188
|
+
const u = t[a][d];
|
|
189
|
+
if (u?.el) {
|
|
190
|
+
const l = u.el.getBoundingClientRect().top;
|
|
191
|
+
o[a] = l - n;
|
|
192
|
+
break;
|
|
276
193
|
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
return {
|
|
289
|
-
type: "left",
|
|
290
|
-
raw: d[0],
|
|
291
|
-
text: d[1],
|
|
292
|
-
tokens: this.lexer.inlineTokens(d[1])
|
|
293
|
-
};
|
|
294
|
-
},
|
|
295
|
-
renderer(i) {
|
|
296
|
-
return `<div data-left="true">${x.parser(i.tokens)}</div>`;
|
|
194
|
+
}
|
|
195
|
+
return o;
|
|
196
|
+
}
|
|
197
|
+
#d(e, t, r, o) {
|
|
198
|
+
const n = this.#c(e, t), a = t[0]?.length ?? 0, d = Array(a).fill(0);
|
|
199
|
+
for (let u = 0; u < a; u++)
|
|
200
|
+
for (let l = 0; l < t.length; l++) {
|
|
201
|
+
const i = t[l][u];
|
|
202
|
+
if (i?.el) {
|
|
203
|
+
d[u] = i.el.offsetLeft;
|
|
204
|
+
break;
|
|
297
205
|
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
206
|
+
}
|
|
207
|
+
t.forEach(
|
|
208
|
+
(u) => u.forEach((l) => {
|
|
209
|
+
if (!l?.el) return;
|
|
210
|
+
const { el: i, topRow: p, leftCol: c } = l, h = p < r, m = c < o;
|
|
211
|
+
i.style.position = "sticky", i.style.zIndex = h && m ? 3 : h ? 2 : m ? 1 : 0, i.style.backgroundColor = getComputedStyle(i).backgroundColor, h && (i.style.top = `${n[p]}px`), m && (i.style.left = `${d[c]}px`);
|
|
212
|
+
})
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
// Markdown 設置
|
|
216
|
+
#u(e) {
|
|
217
|
+
const { markdownLink: t, markdownImg: r, markdownLinkBlank: o } = this.options;
|
|
218
|
+
if (e.hasAttribute("data-markdown-rendered")) return;
|
|
219
|
+
new v.Renderer(), v.use({
|
|
220
|
+
extensions: [
|
|
221
|
+
{
|
|
222
|
+
name: "center",
|
|
223
|
+
level: "block",
|
|
224
|
+
start(i) {
|
|
225
|
+
return i.match(/@center@/)?.index;
|
|
226
|
+
},
|
|
227
|
+
tokenizer(i) {
|
|
228
|
+
const c = /^@center@(.+?)@center@/s.exec(i);
|
|
229
|
+
if (c)
|
|
230
|
+
return {
|
|
231
|
+
type: "center",
|
|
232
|
+
raw: c[0],
|
|
233
|
+
text: c[1],
|
|
234
|
+
tokens: this.lexer.inlineTokens(c[1])
|
|
235
|
+
};
|
|
236
|
+
},
|
|
237
|
+
renderer(i) {
|
|
238
|
+
return `<div data-center="true">${v.parser(i.tokens)}</div>`;
|
|
239
|
+
}
|
|
305
240
|
},
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
241
|
+
{
|
|
242
|
+
name: "left",
|
|
243
|
+
level: "block",
|
|
244
|
+
start(i) {
|
|
245
|
+
return i.match(/@left@/)?.index;
|
|
246
|
+
},
|
|
247
|
+
tokenizer(i) {
|
|
248
|
+
const c = /^@left@(.+?)@left@/s.exec(i);
|
|
249
|
+
if (c)
|
|
250
|
+
return {
|
|
251
|
+
type: "left",
|
|
252
|
+
raw: c[0],
|
|
253
|
+
text: c[1],
|
|
254
|
+
tokens: this.lexer.inlineTokens(c[1])
|
|
255
|
+
};
|
|
256
|
+
},
|
|
257
|
+
renderer(i) {
|
|
258
|
+
return `<div data-left="true">${v.parser(i.tokens)}</div>`;
|
|
259
|
+
}
|
|
315
260
|
},
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
261
|
+
{
|
|
262
|
+
name: "right",
|
|
263
|
+
level: "block",
|
|
264
|
+
start(i) {
|
|
265
|
+
return i.match(/@right@/)?.index;
|
|
266
|
+
},
|
|
267
|
+
tokenizer(i) {
|
|
268
|
+
const c = /^@right@(.+?)@right@/s.exec(i);
|
|
269
|
+
if (c)
|
|
270
|
+
return {
|
|
271
|
+
type: "right",
|
|
272
|
+
raw: c[0],
|
|
273
|
+
text: c[1],
|
|
274
|
+
tokens: this.lexer.inlineTokens(c[1])
|
|
275
|
+
};
|
|
276
|
+
},
|
|
277
|
+
renderer(i) {
|
|
278
|
+
return `<div data-right="true">${v.parser(i.tokens)}</div>`;
|
|
279
|
+
}
|
|
326
280
|
},
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
281
|
+
{
|
|
282
|
+
name: "sup",
|
|
283
|
+
level: "inline",
|
|
284
|
+
start(i) {
|
|
285
|
+
return i.match(/@sup@/)?.index;
|
|
286
|
+
},
|
|
287
|
+
tokenizer(i) {
|
|
288
|
+
const c = /^@sup@(.+?)@sup@/.exec(i);
|
|
289
|
+
if (c)
|
|
290
|
+
return {
|
|
291
|
+
type: "sup",
|
|
292
|
+
raw: c[0],
|
|
293
|
+
text: c[1],
|
|
294
|
+
tokens: this.lexer.inlineTokens(c[1])
|
|
295
|
+
};
|
|
296
|
+
},
|
|
297
|
+
renderer(i) {
|
|
298
|
+
return `<sup>${i.text}</sup>`;
|
|
299
|
+
}
|
|
336
300
|
},
|
|
337
|
-
|
|
338
|
-
|
|
301
|
+
{
|
|
302
|
+
name: "sub",
|
|
303
|
+
level: "inline",
|
|
304
|
+
start(i) {
|
|
305
|
+
return i.match(/@sub@/)?.index;
|
|
306
|
+
},
|
|
307
|
+
tokenizer(i) {
|
|
308
|
+
const c = /^@sub@(.+?)@sub@/.exec(i);
|
|
309
|
+
if (c)
|
|
310
|
+
return {
|
|
311
|
+
type: "sub",
|
|
312
|
+
raw: c[0],
|
|
313
|
+
text: c[1],
|
|
314
|
+
tokens: this.lexer.inlineTokens(c[1])
|
|
315
|
+
};
|
|
316
|
+
},
|
|
317
|
+
renderer(i) {
|
|
318
|
+
return `<sub>${i.text}</sub>`;
|
|
319
|
+
}
|
|
339
320
|
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
321
|
+
]
|
|
322
|
+
});
|
|
323
|
+
const n = ["h2", "h3", "h4", "h5", "h6", "b", "del", "i", "em", "strong", "p", "ul", "ol", "li", "br", "span", "div", "sup", "sub"], a = ["data-center", "data-right", "data-left"], d = (i) => j.sanitize(i, {
|
|
324
|
+
ALLOWED_TAGS: [
|
|
325
|
+
...n,
|
|
326
|
+
...t ? ["a"] : [],
|
|
327
|
+
...r ? ["img"] : []
|
|
328
|
+
],
|
|
329
|
+
ALLOWED_ATTR: [
|
|
330
|
+
...a,
|
|
331
|
+
...t ? ["href", "title", "target"] : [],
|
|
332
|
+
...r ? ["src", "alt", "title"] : []
|
|
333
|
+
],
|
|
334
|
+
RETURN_TRUSTED_TYPE: !1
|
|
335
|
+
}), u = (i) => d(v.parse(i));
|
|
336
|
+
e.querySelectorAll("td,th").forEach((i) => {
|
|
337
|
+
i.innerHTML = i.textContent;
|
|
338
|
+
const p = i.textContent.trim().replace(/<[^>]*>/g, "");
|
|
339
|
+
i.innerHTML = u(p), o && T(i).find("a") && T(i).find("a").attr({
|
|
340
|
+
target: "_blank",
|
|
341
|
+
rel: "noopener noreferrer"
|
|
342
|
+
});
|
|
343
|
+
}), e.setAttribute("data-markdown-rendered", "true");
|
|
344
|
+
}
|
|
345
|
+
// Navigation 設置
|
|
346
|
+
#p(e) {
|
|
347
|
+
const { scrollStep: t } = this.options, r = e.querySelector("._contentWrap"), o = e.querySelector("._tableCover"), n = e.querySelector("._table"), a = typeof t == "number" ? t : r.clientWidth * 0.5;
|
|
348
|
+
if (!r || !o || o.querySelector(".table_navigation")) return;
|
|
349
|
+
const d = document.createElement("div");
|
|
350
|
+
d.className = "table_navigation";
|
|
351
|
+
const u = document.createElement("div"), l = document.createElement("div");
|
|
352
|
+
u.className = "table-nav-left", l.className = "table-nav-right", d.appendChild(u), d.appendChild(l), o.appendChild(d);
|
|
353
|
+
const i = () => {
|
|
354
|
+
const p = n.scrollLeft, c = n.scrollWidth - n.clientWidth;
|
|
355
|
+
u.classList.toggle("disabled", p <= 0), l.classList.toggle("disabled", p >= c - 1);
|
|
356
|
+
};
|
|
357
|
+
u.addEventListener("click", () => {
|
|
358
|
+
n.scrollBy({ left: -a, behavior: "smooth" });
|
|
359
|
+
}), l.addEventListener("click", () => {
|
|
360
|
+
n.scrollBy({ left: a, behavior: "smooth" });
|
|
361
|
+
}), n.addEventListener("scroll", i), window.addEventListener("resize", i), i();
|
|
362
|
+
}
|
|
363
|
+
#s(e) {
|
|
364
|
+
const { params: t } = e.article;
|
|
365
|
+
return t.$video.length && new B(t.$video, this.options.videoOptions), this;
|
|
366
|
+
}
|
|
367
|
+
#h(e) {
|
|
368
|
+
const { basic_rwd: t } = this.options, { params: r } = e.article;
|
|
369
|
+
if (!r.$swiper) return;
|
|
370
|
+
const o = I(), n = this;
|
|
371
|
+
let a = {
|
|
372
|
+
on: {
|
|
373
|
+
init(l) {
|
|
374
|
+
const i = l.$el[0];
|
|
375
|
+
r.$video.length && ([...i.querySelectorAll("[video4-active]")].forEach((c) => {
|
|
376
|
+
c.querySelector(z.SETTINGS.videoButton)?.remove(), c.querySelector(".overlay")?.remove(), c.removeAttribute("video4-active");
|
|
377
|
+
}), n.update());
|
|
357
378
|
},
|
|
358
|
-
|
|
359
|
-
|
|
379
|
+
observerUpdate(l) {
|
|
380
|
+
l.params.autoplay.enabled && (l.autoplay.start(), l.update());
|
|
360
381
|
}
|
|
361
|
-
}
|
|
362
|
-
]
|
|
363
|
-
});
|
|
364
|
-
const l = ["h2", "h3", "h4", "h5", "h6", "b", "del", "i", "em", "strong", "p", "ul", "ol", "li", "br", "span", "div", "sup", "sub"], n = ["data-center", "data-right", "data-left"], u = (i) => Le.sanitize(i, {
|
|
365
|
-
ALLOWED_TAGS: [
|
|
366
|
-
...l,
|
|
367
|
-
...t ? ["a"] : [],
|
|
368
|
-
...r ? ["img"] : []
|
|
369
|
-
],
|
|
370
|
-
ALLOWED_ATTR: [
|
|
371
|
-
...n,
|
|
372
|
-
...t ? ["href", "title", "target"] : [],
|
|
373
|
-
...r ? ["src", "alt", "title"] : []
|
|
374
|
-
],
|
|
375
|
-
RETURN_TRUSTED_TYPE: !1
|
|
376
|
-
}), p = (i) => u(x.parse(i));
|
|
377
|
-
e.querySelectorAll("td,th").forEach((i) => {
|
|
378
|
-
i.innerHTML = i.textContent;
|
|
379
|
-
const a = i.textContent.trim().replace(/<[^>]*>/g, "");
|
|
380
|
-
i.innerHTML = p(a), o && K(i).find("a") && K(i).find("a").attr({
|
|
381
|
-
target: "_blank",
|
|
382
|
-
rel: "noopener noreferrer"
|
|
383
|
-
});
|
|
384
|
-
}), e.setAttribute("data-markdown-rendered", "true");
|
|
385
|
-
}, I = new WeakSet(), ue = function(e) {
|
|
386
|
-
const { scrollStep: t } = this.options, r = e.querySelector("._contentWrap"), o = e.querySelector("._tableCover"), l = e.querySelector("._table"), n = typeof t == "number" ? t : r.clientWidth * 0.5;
|
|
387
|
-
if (!r || !o || o.querySelector(".table_navigation"))
|
|
388
|
-
return;
|
|
389
|
-
const u = document.createElement("div");
|
|
390
|
-
u.className = "table_navigation";
|
|
391
|
-
const p = document.createElement("div"), c = document.createElement("div");
|
|
392
|
-
p.className = "table-nav-left", c.className = "table-nav-right", u.appendChild(p), u.appendChild(c), o.appendChild(u);
|
|
393
|
-
const i = () => {
|
|
394
|
-
const a = l.scrollLeft, d = l.scrollWidth - l.clientWidth;
|
|
395
|
-
p.classList.toggle("disabled", a <= 0), c.classList.toggle("disabled", a >= d - 1);
|
|
396
|
-
};
|
|
397
|
-
p.addEventListener("click", () => {
|
|
398
|
-
l.scrollBy({ left: -n, behavior: "smooth" });
|
|
399
|
-
}), c.addEventListener("click", () => {
|
|
400
|
-
l.scrollBy({ left: n, behavior: "smooth" });
|
|
401
|
-
}), l.addEventListener("scroll", i), window.addEventListener("resize", i), i();
|
|
402
|
-
}, k = new WeakSet(), G = function(e) {
|
|
403
|
-
const { params: t } = e.article;
|
|
404
|
-
return t.$video.length && new we(t.$video, this.options.videoOptions), this;
|
|
405
|
-
}, X = new WeakSet(), pe = function(e) {
|
|
406
|
-
const { basic_rwd: t } = this.options, { params: r } = e.article;
|
|
407
|
-
if (!r.$swiper)
|
|
408
|
-
return;
|
|
409
|
-
const o = ve(), l = this;
|
|
410
|
-
let n = {
|
|
411
|
-
on: {
|
|
412
|
-
init(c) {
|
|
413
|
-
const i = c.$el[0];
|
|
414
|
-
r.$video.length && ([...i.querySelectorAll("[video4-active]")].forEach((d) => {
|
|
415
|
-
var g, f;
|
|
416
|
-
(g = d.querySelector(xe.SETTINGS.videoButton)) == null || g.remove(), (f = d.querySelector(".overlay")) == null || f.remove(), d.removeAttribute("video4-active");
|
|
417
|
-
}), l.update());
|
|
418
382
|
},
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
}
|
|
422
|
-
},
|
|
423
|
-
observer: !0,
|
|
424
|
-
breakpoints: {}
|
|
425
|
-
};
|
|
426
|
-
if (r.$selector.setAttribute("img-swiper", "on"), r.$selector.classList.add(`swiper-${o}`), r.$selector.getAttribute("swiper-arrow") !== "off" && r.$selector.getAttribute("swiper-arrow")) {
|
|
427
|
-
const c = document.createElement("div");
|
|
428
|
-
c.className = `swiper-button-next swiper-${o}`, r.$swiperButtonCover.appendChild(c);
|
|
429
|
-
const i = document.createElement("div");
|
|
430
|
-
i.className = `swiper-button-prev swiper-${o}`, r.$swiperButtonCover.appendChild(i), n.navigation = {
|
|
431
|
-
nextEl: `.swiper-button-next.swiper-${o}`,
|
|
432
|
-
prevEl: `.swiper-button-prev.swiper-${o}`
|
|
383
|
+
observer: !0,
|
|
384
|
+
breakpoints: {}
|
|
433
385
|
};
|
|
386
|
+
if (r.$selector.setAttribute("img-swiper", "on"), r.$selector.classList.add(`swiper-${o}`), r.$selector.getAttribute("swiper-arrow") !== "off" && r.$selector.getAttribute("swiper-arrow")) {
|
|
387
|
+
const l = document.createElement("div");
|
|
388
|
+
l.className = `swiper-button-next swiper-${o}`, r.$swiperButtonCover.appendChild(l);
|
|
389
|
+
const i = document.createElement("div");
|
|
390
|
+
i.className = `swiper-button-prev swiper-${o}`, r.$swiperButtonCover.appendChild(i), a.navigation = {
|
|
391
|
+
nextEl: `.swiper-button-next.swiper-${o}`,
|
|
392
|
+
prevEl: `.swiper-button-prev.swiper-${o}`
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
if (r.$selector.getAttribute("swiper-nav") !== "off" || !r.$selector.getAttribute("swiper-nav")) {
|
|
396
|
+
const l = document.createElement("div");
|
|
397
|
+
l.className = `swiper-pagination swiper-${o}`, r.$swiper.appendChild(l), a.pagination = {
|
|
398
|
+
el: `.swiper-pagination.swiper-${o}`,
|
|
399
|
+
clickable: !0
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
Number.parseInt(r.$selector.getAttribute("swiper-num")) && (a.breakpoints[t] = {
|
|
403
|
+
slidesPerView: r.$selector.getAttribute("swiper-num") ? Number.parseInt(r.$selector.getAttribute("swiper-num")) > 5 ? 5 : Number.parseInt(r.$selector.getAttribute("swiper-num")) : 1
|
|
404
|
+
}), (r.$selector.getAttribute("swiper-autoplay") !== "off" || !r.$selector.getAttribute("swiper-autoplay")) && (a.autoplay = {
|
|
405
|
+
delay: 3e3,
|
|
406
|
+
disableOnInteraction: !1
|
|
407
|
+
}), (r.$selector.getAttribute("swiper-loop") !== "off" || !r.$selector.getAttribute("swiper-loop")) && (a.loop = !0), r.$selector.getAttribute("swiper-speed") && (a.speed = parseInt(r.$selector.getAttribute("swiper-speed"))), r.$selector.getAttribute("swiper-parallax") !== "off" && !r.$selector.getAttribute("swiper-loop") && (a.parallax = !0), r.$selector.getAttribute("swiper-pagination-dynamic") === "on" && (a.pagination.dynamicBullets = !0, a.pagination ? a.pagination.dynamicBullets = !0 : console.warn("pagination undefined"));
|
|
408
|
+
let d = () => window.innerWidth > t && Number(r.$selector.getAttribute("swiper-num")) || 1;
|
|
409
|
+
r.$swiper.querySelectorAll(".swiper-slide").length <= d() && (a.navigation = !1, a.pagination = !1, a.autoplay = !1, a.loop = !1, r.$selector.querySelector(".swiper-button-cover").style.display = "none", r.$selector.querySelector(".swiper-pagination").style.display = "none", r.$swiper.classList.add("swiper-no-swiping"));
|
|
410
|
+
const u = new H(r.$swiper, a);
|
|
411
|
+
return e.article.swiperList = [], e.article.swiperList.push(u), this;
|
|
434
412
|
}
|
|
435
|
-
|
|
436
|
-
const
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
413
|
+
#i(e) {
|
|
414
|
+
const { navigation: t } = this.options, { params: r } = e.article;
|
|
415
|
+
if (!r.$table) return;
|
|
416
|
+
const o = e.getAttribute("freeze-table") === "on", n = parseInt(e.getAttribute("freeze-table-row") ?? "0", 10), a = parseInt(e.getAttribute("freeze-table-col") ?? "0", 10), d = e.querySelector("table"), u = e.querySelector("._tipText"), l = e.offsetWidth, i = d.offsetWidth, p = l < i, c = r.markdown === "on", h = () => {
|
|
417
|
+
o && this.#n(d, n, a), (o || p) && this.#a(e), c && this.#u(d), t && p && this.#p(e), p ? (e.classList.add("overflow"), u.style.display = "flex") : (e.classList.remove("overflow"), u.style.display = "none");
|
|
440
418
|
};
|
|
419
|
+
return h(), window.addEventListener("resize", h), this;
|
|
441
420
|
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
const { navigation: t } = this.options, { params: r } = e.article;
|
|
454
|
-
if (!r.$table)
|
|
455
|
-
return;
|
|
456
|
-
const o = e.getAttribute("freeze-table") === "on", l = parseInt(e.getAttribute("freeze-table-row") ?? "0", 10), n = parseInt(e.getAttribute("freeze-table-col") ?? "0", 10), u = e.querySelector("table"), p = e.querySelector("._tipText"), c = e.offsetWidth, i = u.offsetWidth, a = c < i, d = r.markdown === "on", g = () => {
|
|
457
|
-
o && h(this, M, ae).call(this, u, l, n), (o || a) && h(this, O, oe).call(this, e), d && h(this, z, de).call(this, u), t && a && h(this, I, ue).call(this, e), a ? (e.classList.add("overflow"), p.style.display = "flex") : (e.classList.remove("overflow"), p.style.display = "none");
|
|
458
|
-
};
|
|
459
|
-
return g(), window.addEventListener("resize", g), this;
|
|
460
|
-
};
|
|
461
|
-
let Q = "ontouchstart" in document.documentElement ? "touchstart" : "mousedown", Z = "ontouchend" in document.documentElement ? "touchend" : "mouseup", F = "ontouchmove" in document.documentElement ? "touchmove" : "mousemove";
|
|
462
|
-
function w(s) {
|
|
421
|
+
update() {
|
|
422
|
+
const { elements: e } = this;
|
|
423
|
+
e.forEach((t) => {
|
|
424
|
+
t.querySelectorAll("._article").forEach((r) => {
|
|
425
|
+
r.article = {}, r.article.parent = t, r.article.params = this.#e(r), this.#s(r), this.#i(r);
|
|
426
|
+
});
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
let q = "ontouchstart" in document.documentElement ? "touchstart" : "mousedown", W = "ontouchend" in document.documentElement ? "touchend" : "mouseup", E = "ontouchmove" in document.documentElement ? "touchmove" : "mousemove";
|
|
431
|
+
function f(s) {
|
|
463
432
|
const e = window.getComputedStyle(s), t = e.transform || e.mozTransform;
|
|
464
433
|
if (t === "none")
|
|
465
434
|
return {
|
|
@@ -481,26 +450,26 @@ function w(s) {
|
|
|
481
450
|
z: Number(o[14])
|
|
482
451
|
};
|
|
483
452
|
}
|
|
484
|
-
function
|
|
453
|
+
function x(s) {
|
|
485
454
|
const t = s.querySelector(".wrapper").querySelectorAll(".item");
|
|
486
455
|
let r = 0;
|
|
487
456
|
return t.forEach((o) => {
|
|
488
|
-
const
|
|
489
|
-
r += o.getBoundingClientRect().width +
|
|
457
|
+
const n = getComputedStyle(o), a = parseInt(n.marginLeft), d = parseInt(n.marginRight);
|
|
458
|
+
r += o.getBoundingClientRect().width + a + d;
|
|
490
459
|
}), r;
|
|
491
460
|
}
|
|
492
|
-
function
|
|
493
|
-
if (
|
|
461
|
+
function L(s) {
|
|
462
|
+
if (f(s.slideWrapEl).x >= s.translateMin)
|
|
494
463
|
return "is-start";
|
|
495
|
-
if (
|
|
464
|
+
if (f(s.slideWrapEl).x <= s.translateMax)
|
|
496
465
|
return "is-end";
|
|
497
|
-
if (
|
|
466
|
+
if (f(s.slideWrapEl).x < s.translateMin && f(s.slideWrapEl).x > s.translateMax)
|
|
498
467
|
return "is-middle";
|
|
499
468
|
}
|
|
500
|
-
function
|
|
469
|
+
function Y(s) {
|
|
501
470
|
const e = s.el, t = e.querySelector(".wrapper");
|
|
502
|
-
t.addEventListener(
|
|
503
|
-
switch (s.isDown = !0, s.slidable && t.classList.add("dragging"),
|
|
471
|
+
t.addEventListener(q, function(r) {
|
|
472
|
+
switch (s.isDown = !0, s.slidable && t.classList.add("dragging"), q) {
|
|
504
473
|
case "mousedown":
|
|
505
474
|
s.startX = r.pageX;
|
|
506
475
|
break;
|
|
@@ -508,11 +477,11 @@ function We(s) {
|
|
|
508
477
|
s.startX = r.changedTouches[0].pageX;
|
|
509
478
|
break;
|
|
510
479
|
}
|
|
511
|
-
s.nowTranslateX =
|
|
512
|
-
}), t.addEventListener(
|
|
480
|
+
s.nowTranslateX = f(t).x;
|
|
481
|
+
}), t.addEventListener(W, function(r) {
|
|
513
482
|
s.isDown = !1, t.classList.remove("dragging"), t.classList.remove("moving");
|
|
514
483
|
let o;
|
|
515
|
-
switch (
|
|
484
|
+
switch (E) {
|
|
516
485
|
case "mousemove":
|
|
517
486
|
o = r.pageX - s.startX;
|
|
518
487
|
break;
|
|
@@ -521,22 +490,20 @@ function We(s) {
|
|
|
521
490
|
break;
|
|
522
491
|
}
|
|
523
492
|
if (o === 0 && r.target.closest(".item")) {
|
|
524
|
-
if (
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
n.classList.remove("active");
|
|
493
|
+
if (W === "mouseup" && r.button !== 0) return;
|
|
494
|
+
t.querySelectorAll(".item").forEach((a) => {
|
|
495
|
+
a.classList.remove("active");
|
|
528
496
|
}), r.target.closest(".item").classList.add("active"), s.moveActive(s.params.speed);
|
|
529
497
|
} else
|
|
530
498
|
s.slidable && s.resetPos(e);
|
|
531
499
|
}), t.addEventListener("mouseleave", function() {
|
|
532
500
|
s.isDown && s.slidable && (s.isDown = !1, t.classList.remove("dragging"), t.classList.remove("moving"), s.resetPos(e));
|
|
533
|
-
}), t.addEventListener(
|
|
501
|
+
}), t.addEventListener(E, function(r) {
|
|
534
502
|
if (s.draggable && s.slidable) {
|
|
535
|
-
if (!s.isDown)
|
|
536
|
-
return;
|
|
503
|
+
if (!s.isDown) return;
|
|
537
504
|
r.preventDefault();
|
|
538
505
|
let o;
|
|
539
|
-
switch (
|
|
506
|
+
switch (E) {
|
|
540
507
|
case "mousemove":
|
|
541
508
|
o = r.pageX - s.startX;
|
|
542
509
|
break;
|
|
@@ -546,29 +513,29 @@ function We(s) {
|
|
|
546
513
|
}
|
|
547
514
|
if (o !== 0) {
|
|
548
515
|
t.classList.add("moving");
|
|
549
|
-
const
|
|
516
|
+
const n = {
|
|
550
517
|
transition: "all 0ms ease 0s",
|
|
551
518
|
transform: `translate3d(${s.nowTranslateX + o}px,0,0)`
|
|
552
519
|
};
|
|
553
|
-
Object.assign(t.style,
|
|
520
|
+
Object.assign(t.style, n);
|
|
554
521
|
}
|
|
555
522
|
}
|
|
556
523
|
});
|
|
557
524
|
}
|
|
558
|
-
function
|
|
525
|
+
function G(s) {
|
|
559
526
|
const e = s.querySelectorAll("a");
|
|
560
527
|
for (var t = 0, r = e.length; t < r; t++)
|
|
561
528
|
e[t].draggable = !1;
|
|
562
529
|
}
|
|
563
|
-
class
|
|
530
|
+
class te {
|
|
564
531
|
constructor(e, t) {
|
|
565
532
|
this.el = typeof e == "string" ? document.querySelector(e) : e, this.slideWrapEl = this.el.querySelector(".wrapper"), this.params = {
|
|
566
533
|
speed: 300,
|
|
567
534
|
clickSwitch: !0,
|
|
568
535
|
breakpoint: !1
|
|
569
|
-
}, Object.assign(this.params, t), this.draggable = !0, this.isDown = !1, this.startX = 0, this.nowTranslateX =
|
|
536
|
+
}, Object.assign(this.params, t), this.draggable = !0, this.isDown = !1, this.startX = 0, this.nowTranslateX = f(this.slideWrapEl).x, this.slideTotalWidth = x(this.el), this.translateMin = 0, this.translateMax = -Math.floor(
|
|
570
537
|
Math.abs(
|
|
571
|
-
|
|
538
|
+
x(this.el) - this.el.querySelector(".wrapper").getBoundingClientRect().width
|
|
572
539
|
)
|
|
573
540
|
), this.slidable = this.slideTotalWidth > Math.round(this.el.getBoundingClientRect().width) && (!this.params.breakpoint || window.innerWidth <= this.params.breakpoint), this.init();
|
|
574
541
|
}
|
|
@@ -576,35 +543,35 @@ class Ie {
|
|
|
576
543
|
const e = this;
|
|
577
544
|
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() {
|
|
578
545
|
e.update();
|
|
579
|
-
}),
|
|
546
|
+
}), Y(e), G(e.el);
|
|
580
547
|
}
|
|
581
548
|
moveActive(e) {
|
|
582
|
-
const t = this, r = t.slideWrapEl.querySelector(".item.active"),
|
|
549
|
+
const t = this, r = t.slideWrapEl.querySelector(".item.active"), n = r.previousElementSibling ? r.offsetLeft - t.el.clientWidth / 2 + r.clientWidth / 2 : 0;
|
|
583
550
|
if (t.slidable) {
|
|
584
|
-
if (-
|
|
585
|
-
const
|
|
551
|
+
if (-n < 0 && -n > t.translateMax) {
|
|
552
|
+
const a = {
|
|
586
553
|
transition: `all ${e || 0}ms ease 0s`,
|
|
587
|
-
transform: `translate3d(-${
|
|
554
|
+
transform: `translate3d(-${n}px,0,0)`
|
|
588
555
|
};
|
|
589
|
-
Object.assign(t.slideWrapEl.style,
|
|
590
|
-
} else if (-
|
|
591
|
-
const
|
|
556
|
+
Object.assign(t.slideWrapEl.style, a);
|
|
557
|
+
} else if (-n >= 0) {
|
|
558
|
+
const a = {
|
|
592
559
|
transition: `all ${e || 0}ms ease 0s`,
|
|
593
560
|
transform: "translate3d(0,0,0)"
|
|
594
561
|
};
|
|
595
|
-
Object.assign(t.slideWrapEl.style,
|
|
562
|
+
Object.assign(t.slideWrapEl.style, a);
|
|
596
563
|
} else {
|
|
597
|
-
const
|
|
564
|
+
const a = {
|
|
598
565
|
transition: `all ${e || 0}ms ease 0s`,
|
|
599
566
|
transform: `translate3d(${t.translateMax}px,0,0)`
|
|
600
567
|
};
|
|
601
|
-
Object.assign(t.slideWrapEl.style,
|
|
568
|
+
Object.assign(t.slideWrapEl.style, a);
|
|
602
569
|
}
|
|
603
570
|
if (e)
|
|
604
571
|
t.slideWrapEl.addEventListener(
|
|
605
572
|
"transitionend",
|
|
606
573
|
function() {
|
|
607
|
-
switch (t.nowTranslateX =
|
|
574
|
+
switch (t.nowTranslateX = f(t.slideWrapEl).x, L(t)) {
|
|
608
575
|
case "is-start":
|
|
609
576
|
t.el.classList.add("is-start"), t.el.classList.remove("is-end");
|
|
610
577
|
break;
|
|
@@ -619,7 +586,7 @@ class Ie {
|
|
|
619
586
|
!1
|
|
620
587
|
);
|
|
621
588
|
else
|
|
622
|
-
switch (t.nowTranslateX =
|
|
589
|
+
switch (t.nowTranslateX = f(t.slideWrapEl).x, L(t)) {
|
|
623
590
|
case "is-start":
|
|
624
591
|
t.el.classList.add("is-start"), t.el.classList.remove("is-end");
|
|
625
592
|
break;
|
|
@@ -634,7 +601,7 @@ class Ie {
|
|
|
634
601
|
}
|
|
635
602
|
resetPos() {
|
|
636
603
|
const e = this;
|
|
637
|
-
switch (
|
|
604
|
+
switch (L(e)) {
|
|
638
605
|
case "is-start":
|
|
639
606
|
e.el.classList.add("is-start"), e.el.classList.remove("is-end"), Object.assign(e.slideWrapEl.style, {
|
|
640
607
|
transition: `all ${e.params.speed}ms ease 0s`,
|
|
@@ -654,14 +621,14 @@ class Ie {
|
|
|
654
621
|
}
|
|
655
622
|
update() {
|
|
656
623
|
const e = this;
|
|
657
|
-
e.el.querySelector(".wrapper").removeAttribute("style"), e.slideTotalWidth =
|
|
624
|
+
e.el.querySelector(".wrapper").removeAttribute("style"), e.slideTotalWidth = x(e.el), e.translateMax = -Math.floor(
|
|
658
625
|
Math.abs(
|
|
659
|
-
|
|
626
|
+
x(e.el) - e.el.querySelector(".wrapper").getBoundingClientRect().width
|
|
660
627
|
)
|
|
661
628
|
), 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"));
|
|
662
629
|
}
|
|
663
630
|
}
|
|
664
|
-
const
|
|
631
|
+
const _ = (s) => {
|
|
665
632
|
if (s == "facebook")
|
|
666
633
|
return "https://www.facebook.com/sharer/sharer.php?u=";
|
|
667
634
|
if (s == "line")
|
|
@@ -675,95 +642,92 @@ const ee = (s) => {
|
|
|
675
642
|
if (s == "weibo")
|
|
676
643
|
return "https://service.weibo.com/share/share.php?url=";
|
|
677
644
|
};
|
|
678
|
-
|
|
679
|
-
class Xe {
|
|
645
|
+
class re {
|
|
680
646
|
constructor(e, t = {}) {
|
|
681
|
-
m(this, D);
|
|
682
|
-
m(this, H);
|
|
683
|
-
m(this, j);
|
|
684
647
|
this.__storage__ = {
|
|
685
648
|
el: e,
|
|
686
649
|
options: t
|
|
687
|
-
},
|
|
650
|
+
}, this.#t();
|
|
688
651
|
}
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
652
|
+
#t() {
|
|
653
|
+
const { el: e, options: t } = this.__storage__, { SETTINGS: r } = X;
|
|
654
|
+
!M(e) || !C(e) || (this.elements = A(e), this.options = Object.assign({}, r, t), this.#r());
|
|
655
|
+
}
|
|
656
|
+
#r() {
|
|
657
|
+
const { elements: e, options: t } = this;
|
|
658
|
+
e.forEach((r) => {
|
|
659
|
+
r.querySelectorAll("[share-target]").forEach((o) => {
|
|
660
|
+
o.share = {}, o.share.instance = this, o.share.params = t, o.share.eventHandler = this.#e, o.addEventListener("click", o.share.eventHandler);
|
|
661
|
+
});
|
|
698
662
|
});
|
|
699
|
-
});
|
|
700
|
-
}, j = new WeakSet(), ge = function() {
|
|
701
|
-
const { eventHandler: e, params: t } = this.share, r = this.getAttribute("share-target"), o = {
|
|
702
|
-
source: this.getAttribute("utm-source"),
|
|
703
|
-
medium: this.getAttribute("utm-medium"),
|
|
704
|
-
campaign: this.getAttribute("utm-campaign")
|
|
705
|
-
}, l = {
|
|
706
|
-
success: this.getAttribute("copy-success") || t.success,
|
|
707
|
-
text: this.getAttribute("copy-text") || t.text,
|
|
708
|
-
className: this.getAttribute("copy-class") || t.className,
|
|
709
|
-
duration: this.getAttribute("copy-duration") || t.duration
|
|
710
|
-
}, n = encodeURIComponent(document.URL);
|
|
711
|
-
let u = n;
|
|
712
|
-
if (r == "wechat") {
|
|
713
|
-
window.open(`https://api.qrserver.com/v1/create-qr-code/?data=${n}&size=250x250`, "share to wechat", "width=300,height=300");
|
|
714
|
-
return;
|
|
715
663
|
}
|
|
716
|
-
|
|
717
|
-
|
|
664
|
+
#e() {
|
|
665
|
+
const { eventHandler: e, params: t } = this.share, r = this.getAttribute("share-target"), o = {
|
|
666
|
+
source: this.getAttribute("utm-source"),
|
|
667
|
+
medium: this.getAttribute("utm-medium"),
|
|
668
|
+
campaign: this.getAttribute("utm-campaign")
|
|
669
|
+
}, n = {
|
|
670
|
+
success: this.getAttribute("copy-success") || t.success,
|
|
671
|
+
text: this.getAttribute("copy-text") || t.text,
|
|
672
|
+
className: this.getAttribute("copy-class") || t.className,
|
|
673
|
+
duration: this.getAttribute("copy-duration") || t.duration
|
|
674
|
+
}, a = encodeURIComponent(document.URL);
|
|
675
|
+
let d = a;
|
|
676
|
+
if (r == "wechat") {
|
|
677
|
+
window.open(`https://api.qrserver.com/v1/create-qr-code/?data=${a}&size=250x250`, "share to wechat", "width=300,height=300");
|
|
718
678
|
return;
|
|
719
|
-
document.querySelector("body").insertAdjacentHTML(Ae.append, `<div class='copied-wrapper'><div class='text'>${l.success ? l.success : ""}</div><input id='clipboard' type='text' readonly></div>`);
|
|
720
|
-
const p = document.querySelector(".copied-wrapper");
|
|
721
|
-
l.className && p.classList.add(l.className), p.style.top = this.getBoundingClientRect().top + window.scrollY + "px", p.style.left = this.getBoundingClientRect().left + this.getBoundingClientRect().width / 2 + "px", p.style.display = "block";
|
|
722
|
-
const c = document.querySelector("#clipboard");
|
|
723
|
-
if (c.value = l.text ?? window.location.href, c.setSelectionRange(0, 9999), c.select(), document.execCommand("copy")) {
|
|
724
|
-
document.execCommand("copy");
|
|
725
|
-
const i = document.querySelector(".copied-wrapper"), a = document.querySelector(".copied-wrapper .text");
|
|
726
|
-
a.style.display = "block", a.style.opacity = 0;
|
|
727
|
-
const d = (f, v) => {
|
|
728
|
-
let y = 0;
|
|
729
|
-
const $ = 50, E = $ / v, P = setInterval(function() {
|
|
730
|
-
y += E, f.style.opacity = y, y >= 1 && (clearInterval(P), setTimeout(function() {
|
|
731
|
-
g(f, 300, function() {
|
|
732
|
-
i.remove();
|
|
733
|
-
});
|
|
734
|
-
}, l.duration));
|
|
735
|
-
}, $);
|
|
736
|
-
}, g = (f, v, y) => {
|
|
737
|
-
let $ = 1;
|
|
738
|
-
const E = 50, P = E / v, fe = setInterval(() => {
|
|
739
|
-
$ -= P, f.style.opacity = $, $ <= 0 && (clearInterval(fe), f.style.display = "none", y && y());
|
|
740
|
-
}, E);
|
|
741
|
-
};
|
|
742
|
-
d(a, 300);
|
|
743
679
|
}
|
|
744
|
-
|
|
680
|
+
if (r == "url") {
|
|
681
|
+
if (C(".copied-wrapper")) return;
|
|
682
|
+
document.querySelector("body").insertAdjacentHTML(D.append, `<div class='copied-wrapper'><div class='text'>${n.success ? n.success : ""}</div><input id='clipboard' type='text' readonly></div>`);
|
|
683
|
+
const u = document.querySelector(".copied-wrapper");
|
|
684
|
+
n.className && u.classList.add(n.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";
|
|
685
|
+
const l = document.querySelector("#clipboard");
|
|
686
|
+
if (l.value = n.text ?? window.location.href, l.setSelectionRange(0, 9999), l.select(), document.execCommand("copy")) {
|
|
687
|
+
document.execCommand("copy");
|
|
688
|
+
const i = document.querySelector(".copied-wrapper"), p = document.querySelector(".copied-wrapper .text");
|
|
689
|
+
p.style.display = "block", p.style.opacity = 0;
|
|
690
|
+
const c = (m, k) => {
|
|
691
|
+
let b = 0;
|
|
692
|
+
const w = 50, $ = w / k, S = setInterval(function() {
|
|
693
|
+
b += $, m.style.opacity = b, b >= 1 && (clearInterval(S), setTimeout(function() {
|
|
694
|
+
h(m, 300, function() {
|
|
695
|
+
i.remove();
|
|
696
|
+
});
|
|
697
|
+
}, n.duration));
|
|
698
|
+
}, w);
|
|
699
|
+
}, h = (m, k, b) => {
|
|
700
|
+
let w = 1;
|
|
701
|
+
const $ = 50, S = $ / k, O = setInterval(() => {
|
|
702
|
+
w -= S, m.style.opacity = w, w <= 0 && (clearInterval(O), m.style.display = "none", b && b());
|
|
703
|
+
}, $);
|
|
704
|
+
};
|
|
705
|
+
c(p, 300);
|
|
706
|
+
}
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
709
|
+
d = `${d}${o.source ? `?utm_source=${o.source}` : ""}${o.medium ? `&utm_medium${o.medium}` : ""}${o.campaign ? `&utm_campaign${o.campaign}` : ""}`, d = d.replace("?", "%3F").replace(new RegExp("&", "g"), "%26"), r == "line" ? window.open(`${_(r)}${a}`) : window.open(`${_(r)}${d}"e=${d}`), this.removeEventListener("click", e), setTimeout(() => {
|
|
710
|
+
this.addEventListener("click", e);
|
|
711
|
+
}, 100);
|
|
745
712
|
}
|
|
746
|
-
|
|
747
|
-
this.addEventListener("click", e);
|
|
748
|
-
}, 100);
|
|
749
|
-
};
|
|
713
|
+
}
|
|
750
714
|
export {
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
715
|
+
oe as Anchor4,
|
|
716
|
+
ae as Aost4,
|
|
717
|
+
ee as Article4,
|
|
718
|
+
te as CategorySlider,
|
|
719
|
+
ne as Collapse4,
|
|
720
|
+
le as Configs,
|
|
721
|
+
Z as Detect4,
|
|
722
|
+
ce as Dropdown4,
|
|
723
|
+
de as ImagePreview,
|
|
724
|
+
ue as ImageValidate,
|
|
725
|
+
pe as Marquee4,
|
|
726
|
+
he as Modal4,
|
|
727
|
+
me as Multipurpose4,
|
|
728
|
+
ge as Ripple4,
|
|
729
|
+
re as Share4,
|
|
730
|
+
fe as Tab4,
|
|
731
|
+
B as Video4
|
|
768
732
|
};
|
|
769
733
|
//# sourceMappingURL=fesd-bundle.js.map
|