@deot/docs-client 1.1.2 → 1.1.4
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/README.md +2 -3
- package/dist/chunks/browser-Cmwcvs-d.js +505 -0
- package/dist/chunks/cdn-DEvdGJu2-bmlgKy4E.js +38 -0
- package/dist/chunks/chunk-rhk8Qtmk-CUgXtmq_.js +14 -0
- package/dist/chunks/compile-Bw7v7QE--Dd1-R95H.js +79920 -0
- package/dist/chunks/compiler-sfc.esm-browser-B4_kBkG5.js +24975 -0
- package/dist/chunks/dayjs.min-B3g34Qcz.js +300 -0
- package/dist/chunks/dist-0ySyXNpo.js +415 -0
- package/dist/chunks/dist-BUw25nXJ.js +65 -0
- package/dist/chunks/dist-BeOE8qTX.js +345 -0
- package/dist/chunks/dist-Bm7SK-km.js +24517 -0
- package/dist/chunks/dist-C3V7reR4.js +197 -0
- package/dist/chunks/dist-C8z9l0mA.js +58 -0
- package/dist/chunks/dist-CI9Lp9Cj.js +247 -0
- package/dist/chunks/dist-COjpr4FU.js +426 -0
- package/dist/chunks/dist-CQir6D4y.js +244 -0
- package/dist/chunks/dist-CuJyl-ef.js +17 -0
- package/dist/chunks/dist-Cxf7_ocf.js +44 -0
- package/dist/chunks/dist-DF4kisl2.js +43 -0
- package/dist/chunks/dist-DLj8yJdm.js +38 -0
- package/dist/chunks/dist-DN0sqx7H.js +39 -0
- package/dist/chunks/dist-DWqBe2Ah.js +132 -0
- package/dist/chunks/dist-D_Uqh6m9.js +80 -0
- package/dist/chunks/dist-DcIU51zW.js +166 -0
- package/dist/chunks/dist-DlmO7OlF.js +22 -0
- package/dist/chunks/dist-kiZUqqzR.js +27 -0
- package/dist/chunks/dist-oZ12SGqg.js +6 -0
- package/dist/chunks/dist-uXnwGrO3.js +76 -0
- package/dist/chunks/dist-va7FmnW4.js +156 -0
- package/dist/chunks/{echarts-I1Rk_oCV.js → echarts-Dk-pu7GM.js} +450 -398
- package/dist/chunks/files-C5UMzYxA-q9oJ4PrI.js +110 -0
- package/dist/chunks/html2canvas-Deo0mM5K.js +4022 -0
- package/dist/chunks/index.es-UlJ0gfdF.js +5757 -0
- package/dist/chunks/jspdf.es.min-CJc40v7q.js +17873 -0
- package/dist/chunks/jsx-CwMPlI4_-CAiik-V7.js +128454 -0
- package/dist/chunks/jszip.min-BbVwZKYP.js +3044 -0
- package/dist/chunks/linker-JHdz37DK-CWgUtxZ5.js +118 -0
- package/dist/chunks/local-sandbox-B8IJ5jWb-BgfU3iQ4.js +300 -0
- package/dist/chunks/lodash-Cxf6dD_I.js +5161 -0
- package/dist/chunks/modules-DlLJF_vd-DcNdL6sc.js +153 -0
- package/dist/chunks/{photoswipe.esm-CT37djgx.js → photoswipe.esm-B0V-xGTB.js} +36 -31
- package/dist/chunks/pinia-pDJilYOg.js +326 -0
- package/dist/chunks/purify.es-BiqY1C6m.js +867 -0
- package/dist/chunks/remote-DfXAsO9n-C_MtPVYr.js +75 -0
- package/dist/chunks/script-xKUjE8pf-oF69rg-w.js +14941 -0
- package/dist/chunks/store-D8vwi-HV-RFStijWr.js +16936 -0
- package/dist/chunks/vue-router-C0mj8Ot5.js +1196 -0
- package/dist/chunks/vue.runtime.esm-bundler-XxHGOLq2.js +4879 -0
- package/dist/index.cjs +17 -17
- package/dist/index.d.ts +1 -1
- package/dist/index.js +41759 -103263
- package/dist/index.style.css +3 -4
- package/package.json +9 -9
- package/dist/chunks/_commonjsHelpers-BFTU3MAI-D_7z5o6A.js +0 -8
- package/dist/chunks/jsx-H2PmTOgp-C0GVSSMR.js +0 -128281
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
globalThis.process;
|
|
2
|
+
import { n as e } from "./rolldown-runtime-Ce3zPWPd.js";
|
|
3
|
+
//#region node_modules/.pnpm/@deot+helper-utils@1.1.9/node_modules/@deot/helper-utils/dist/index.js
|
|
4
|
+
var t = /* @__PURE__ */ e({
|
|
5
|
+
asterisk: () => n,
|
|
6
|
+
autoCatch: () => r,
|
|
7
|
+
cAF: () => x,
|
|
8
|
+
cIC: () => T,
|
|
9
|
+
caf: () => C,
|
|
10
|
+
canvasToImage: () => o,
|
|
11
|
+
cic: () => D,
|
|
12
|
+
cloneDeepEasier: () => s,
|
|
13
|
+
compressImage: () => c,
|
|
14
|
+
dataURLToFile: () => a,
|
|
15
|
+
debounce: () => l,
|
|
16
|
+
def: () => u,
|
|
17
|
+
flatten: () => M,
|
|
18
|
+
flattenJSONParse: () => N,
|
|
19
|
+
generateString: () => I,
|
|
20
|
+
getPropByPath: () => d,
|
|
21
|
+
getUid: () => m,
|
|
22
|
+
hasOwn: () => h,
|
|
23
|
+
numberToUnit: () => v,
|
|
24
|
+
preZero: () => y,
|
|
25
|
+
probs: () => k,
|
|
26
|
+
rAF: () => b,
|
|
27
|
+
rIC: () => w,
|
|
28
|
+
raf: () => S,
|
|
29
|
+
range: () => O,
|
|
30
|
+
ric: () => E,
|
|
31
|
+
sleep: () => A,
|
|
32
|
+
throttle: () => j,
|
|
33
|
+
toPromise: () => L
|
|
34
|
+
}), n = (e, t, n) => {
|
|
35
|
+
t ||= 3, n ||= 4;
|
|
36
|
+
let r = n, i = e.substring(0, t);
|
|
37
|
+
for (; r;) i += "*", r--;
|
|
38
|
+
return i += e.substring(t + n), i;
|
|
39
|
+
}, r = async (e, t = {}) => {
|
|
40
|
+
let { onError: n = console.error } = t;
|
|
41
|
+
try {
|
|
42
|
+
let t = e;
|
|
43
|
+
return typeof t == "function" && (t = t()), await t;
|
|
44
|
+
} catch (e) {
|
|
45
|
+
n(e);
|
|
46
|
+
}
|
|
47
|
+
}, i = (e) => {
|
|
48
|
+
let t;
|
|
49
|
+
return typeof e == "string" && e.includes(".") && (t = e.split(".").pop()), t ? `image/${t}` : "image/jpeg";
|
|
50
|
+
}, a = (e, t, n) => {
|
|
51
|
+
/data:[^;]+;[^,]+,/g.test(e) || (e = `data:${n || i(t)};base64,${e}`);
|
|
52
|
+
let [r, a] = e.split(","), o = r.match(/:(.*?);/)?.[1], s = window.atob(a), c = s.length, l = new Uint8Array(c);
|
|
53
|
+
for (; c--;) l[c] = s.charCodeAt(c);
|
|
54
|
+
return new File([l], t || "__filename", { type: o });
|
|
55
|
+
}, o = (e, t) => {
|
|
56
|
+
let n = e.toDataURL("image/png");
|
|
57
|
+
return new Promise((e) => {
|
|
58
|
+
let r = { dataURL: n };
|
|
59
|
+
typeof t == "string" && (r.file = a(n, t)), e(r);
|
|
60
|
+
});
|
|
61
|
+
}, s = (e) => JSON.parse(JSON.stringify(e)), c = (e, t) => {
|
|
62
|
+
let { width: n, height: r, filetype: i = "image/jpeg", encoderOptions: o } = t || {};
|
|
63
|
+
return new Promise((t, s) => {
|
|
64
|
+
let c = new Image(), l = new FileReader();
|
|
65
|
+
l.readAsDataURL(e), l.onload = (e) => {
|
|
66
|
+
c.src = e.target.result;
|
|
67
|
+
};
|
|
68
|
+
let u = document.createElement("canvas"), d = u.getContext("2d");
|
|
69
|
+
c.onload = () => {
|
|
70
|
+
let s = c.width, l = c.height, f = n || s, p = r || l, m = s, h = l;
|
|
71
|
+
(s > f || l > p) && (s / l > f / p ? (m = f, h = Math.round(l / s * f)) : (h = p, m = Math.round(s / l * p))), u.width = m, u.height = h, d.clearRect(0, 0, m, h), d.drawImage(c, 0, 0, m, h);
|
|
72
|
+
let g = u.toDataURL(i, o);
|
|
73
|
+
t({
|
|
74
|
+
dataURL: g,
|
|
75
|
+
file: a(g, e.name)
|
|
76
|
+
});
|
|
77
|
+
}, c.onerror = (e) => {
|
|
78
|
+
s(e);
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
}, l = (e, t, n) => {
|
|
82
|
+
let { leading: r, trailing: i = !0, throttle: a } = n || {}, o, s, c = () => {
|
|
83
|
+
o && clearTimeout(o), o = null;
|
|
84
|
+
}, l = () => {
|
|
85
|
+
o = setTimeout(() => {
|
|
86
|
+
o = null, i && s && s();
|
|
87
|
+
}, t);
|
|
88
|
+
}, u = function(...n) {
|
|
89
|
+
if (s = () => {
|
|
90
|
+
e.apply(this, n), s = null;
|
|
91
|
+
}, !t && a) return s();
|
|
92
|
+
o ? a || (c(), l()) : (r && s(), l());
|
|
93
|
+
};
|
|
94
|
+
return u.cancel = () => {
|
|
95
|
+
c(), s = null;
|
|
96
|
+
}, u.flush = () => {
|
|
97
|
+
c(), i && s && s();
|
|
98
|
+
}, u;
|
|
99
|
+
}, u = (e, t, n, r) => Object.defineProperty(e, t, {
|
|
100
|
+
value: n,
|
|
101
|
+
enumerable: !1,
|
|
102
|
+
writable: !0,
|
|
103
|
+
configurable: !0,
|
|
104
|
+
...r
|
|
105
|
+
}), d = (e, t) => {
|
|
106
|
+
let n = e;
|
|
107
|
+
t = t.replace(/\[(\w+)\]/g, ".$1"), t = t.replace(/^\./, "");
|
|
108
|
+
let r = t.split("."), i = 0;
|
|
109
|
+
for (let e = r.length; i < e - 1; ++i) {
|
|
110
|
+
let e = r[i];
|
|
111
|
+
try {
|
|
112
|
+
if (e in n) n = n[e];
|
|
113
|
+
else throw Error();
|
|
114
|
+
} catch {
|
|
115
|
+
throw Error("无效路径!");
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
o: n,
|
|
120
|
+
k: r[i],
|
|
121
|
+
v: n[r[i]]
|
|
122
|
+
};
|
|
123
|
+
}, f = +/* @__PURE__ */ new Date(), p = 0, m = (e) => `${e ? `${e}-` : ""}${f}-${++p}`, h = (e, t) => Object.prototype.hasOwnProperty.call(e, t), g = (e) => {
|
|
124
|
+
let t = -1;
|
|
125
|
+
for (; e >= 1;) t++, e /= 10;
|
|
126
|
+
return t;
|
|
127
|
+
}, _ = (e, t, n, r) => {
|
|
128
|
+
let i = g(e);
|
|
129
|
+
if (i > 3) {
|
|
130
|
+
let e = i % 8;
|
|
131
|
+
return e >= 5 && (e = 4), Math.round(t / 10 ** (e + n - r)) / 10 ** r + "万";
|
|
132
|
+
}
|
|
133
|
+
return Math.round(t / 10 ** (n - r)) / 10 ** r + "";
|
|
134
|
+
}, v = (e, t) => {
|
|
135
|
+
e > 2 ** 53 - 1 && (e = 2 ** 53 - 1), t ??= 2;
|
|
136
|
+
let n = Math.floor(e), r = g(n), i = [];
|
|
137
|
+
if (r > 3) {
|
|
138
|
+
let a = Math.floor(r / 8);
|
|
139
|
+
if (a >= 1) {
|
|
140
|
+
let r = Math.round(n / 10 ** (8 * a));
|
|
141
|
+
i.push(_(r, e, 8 * a, t));
|
|
142
|
+
for (let e = 0; e < a; e++) i.push("亿");
|
|
143
|
+
return i.join("");
|
|
144
|
+
}
|
|
145
|
+
return _(n, e, 0, t);
|
|
146
|
+
}
|
|
147
|
+
return e;
|
|
148
|
+
}, y = (e) => e < 10 && e > 0 ? "0" + e : e <= 0 ? "00" : "" + e, b = typeof window < "u" && window.requestAnimationFrame || ((e) => setTimeout(e, 16)), x = typeof window < "u" && window.cancelAnimationFrame || ((e) => clearTimeout(e)), S = b, C = x, w = typeof window < "u" && window.requestIdleCallback || ((e) => {
|
|
149
|
+
let t = Date.now();
|
|
150
|
+
return setTimeout(() => e({
|
|
151
|
+
didTimeout: !1,
|
|
152
|
+
timeRemaining: () => Math.max(0, 50 - (Date.now() - t))
|
|
153
|
+
}), 1);
|
|
154
|
+
}), T = typeof window < "u" && window.cancelIdleCallback || ((e) => clearTimeout(e)), E = w, D = T, O = (e, t) => Math.floor(Math.random() * (t - e + 1) + e), k = (e) => {
|
|
155
|
+
let t = e.reduce((e, t) => e + (!t || t <= 0 ? 0 : t), 0);
|
|
156
|
+
if (!t) throw Error("不可能得到索引值");
|
|
157
|
+
let n = e.map((e) => e / t), r = 0, i = Math.random();
|
|
158
|
+
for (; i > 0;) i -= n[r], r++;
|
|
159
|
+
return r--, r;
|
|
160
|
+
}, A = (e, t) => {
|
|
161
|
+
let n;
|
|
162
|
+
return n = typeof e == "object" ? O(e.min, e.max) : e || 0, new Promise((e) => {
|
|
163
|
+
let r = setTimeout(e, n);
|
|
164
|
+
t && t(r, n, e);
|
|
165
|
+
});
|
|
166
|
+
}, j = (e, t, n) => {
|
|
167
|
+
let { leading: r = !0, trailing: i = !0 } = n || {};
|
|
168
|
+
return l(e, t, {
|
|
169
|
+
leading: r,
|
|
170
|
+
trailing: i,
|
|
171
|
+
throttle: !0
|
|
172
|
+
});
|
|
173
|
+
}, M = (e, t, n) => {
|
|
174
|
+
let r = !0, i = 1, a = e;
|
|
175
|
+
for (; r;) {
|
|
176
|
+
if (i > 1e3) throw Error(e);
|
|
177
|
+
try {
|
|
178
|
+
let e = (t || decodeURIComponent)(a);
|
|
179
|
+
(a === e || typeof n == "function" && n(e)) && (r = !1), a = e;
|
|
180
|
+
} catch {
|
|
181
|
+
r = !1;
|
|
182
|
+
}
|
|
183
|
+
i++;
|
|
184
|
+
}
|
|
185
|
+
return a;
|
|
186
|
+
}, N = (e) => e === null ? null : /^-?\d+[eE]\d+$/.test(e) || /^\d+$/.test(e) && e.length >= 16 && +e > 2 ** 53 - 1 ? e : M(e, JSON.parse, (e) => typeof e == "object"), P = "abcdefghijklmnopqrstuvwxyz", F = P + P.toUpperCase() + "0123456789-_", I = (e, t) => {
|
|
187
|
+
e ||= 16, t ||= F;
|
|
188
|
+
let n = "", { length: r } = t;
|
|
189
|
+
for (; e--;) n += t[Math.random() * r | 0];
|
|
190
|
+
return n;
|
|
191
|
+
}, L = (e, t) => {
|
|
192
|
+
let n = e, r = e;
|
|
193
|
+
if (!r || r.then || r.catch || r.finally) throw Error("TypeError");
|
|
194
|
+
return n.then = (e, n) => t.then(e, n), n.catch = (e) => t.catch(e), n.finally = (e) => t.finally(e), n;
|
|
195
|
+
};
|
|
196
|
+
//#endregion
|
|
197
|
+
export { N as a, h as c, j as d, M as i, y as l, o as n, d as o, t as r, m as s, C as t, S as u };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
globalThis.process;
|
|
2
|
+
import { n as e } from "./rolldown-runtime-Ce3zPWPd.js";
|
|
3
|
+
import { n as t, r as n, t as r } from "./dist-COjpr4FU.js";
|
|
4
|
+
//#region node_modules/.pnpm/@deot+helper-scheduler@1.1.9/node_modules/@deot/helper-scheduler/dist/index.js
|
|
5
|
+
var i = /* @__PURE__ */ e({
|
|
6
|
+
Interrupter: () => a,
|
|
7
|
+
Job: () => r,
|
|
8
|
+
Parallel: () => t,
|
|
9
|
+
Task: () => n
|
|
10
|
+
}), a = class e {
|
|
11
|
+
static of(t) {
|
|
12
|
+
return new e(t);
|
|
13
|
+
}
|
|
14
|
+
options = {};
|
|
15
|
+
_success;
|
|
16
|
+
_fail;
|
|
17
|
+
_task;
|
|
18
|
+
_finish = !1;
|
|
19
|
+
constructor(e) {
|
|
20
|
+
e && (this.options = e), this._generateTask();
|
|
21
|
+
}
|
|
22
|
+
_generateTask = () => {
|
|
23
|
+
this._task = new Promise((e, t) => {
|
|
24
|
+
this._success = (t) => {
|
|
25
|
+
this._fail = void 0, e(t);
|
|
26
|
+
}, this._fail = (e) => {
|
|
27
|
+
this._success = void 0, t(e);
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
next = async (e) => {
|
|
32
|
+
this._finish ? await this._task : (this._success?.(e), await this._task, await Promise.resolve(), this._generateTask());
|
|
33
|
+
};
|
|
34
|
+
nextWithError = async (e) => {
|
|
35
|
+
if (this._finish) await this._task;
|
|
36
|
+
else {
|
|
37
|
+
this._fail?.(e);
|
|
38
|
+
try {
|
|
39
|
+
await this._task;
|
|
40
|
+
} catch {
|
|
41
|
+
await Promise.resolve(), this._generateTask();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
finish = (e) => (this._success?.(e), this._finish = !0, this);
|
|
46
|
+
finishWithError = (e) => (this._fail?.(e), this._finish = !0, this);
|
|
47
|
+
then(e, t) {
|
|
48
|
+
return this._task.then(e, t);
|
|
49
|
+
}
|
|
50
|
+
catch(e) {
|
|
51
|
+
return this._task.catch(e);
|
|
52
|
+
}
|
|
53
|
+
finally(e) {
|
|
54
|
+
return this._task.finally(e);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
//#endregion
|
|
58
|
+
export { i as n, a as t };
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
globalThis.process;
|
|
2
|
+
import { i as e, n as t, t as n } from "./rolldown-runtime-Ce3zPWPd.js";
|
|
3
|
+
//#region node_modules/.pnpm/normalize-wheel@1.0.1/node_modules/normalize-wheel/src/UserAgent_DEPRECATED.js
|
|
4
|
+
var r = /* @__PURE__ */ n(((e, t) => {
|
|
5
|
+
var n = !1, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _;
|
|
6
|
+
function v() {
|
|
7
|
+
if (!n) {
|
|
8
|
+
n = !0;
|
|
9
|
+
var e = navigator.userAgent, t = /(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e), v = /(Mac OS X)|(Windows)|(Linux)/.exec(e);
|
|
10
|
+
if (m = /\b(iPhone|iP[ao]d)/.exec(e), h = /\b(iP[ao]d)/.exec(e), f = /Android/i.exec(e), g = /FBAN\/\w+;/i.exec(e), _ = /Mobile/i.exec(e), p = !!/Win64/.exec(e), t) {
|
|
11
|
+
r = t[1] ? parseFloat(t[1]) : t[5] ? parseFloat(t[5]) : NaN, r && document && document.documentMode && (r = document.documentMode);
|
|
12
|
+
var y = /(?:Trident\/(\d+.\d+))/.exec(e);
|
|
13
|
+
c = y ? parseFloat(y[1]) + 4 : r, i = t[2] ? parseFloat(t[2]) : NaN, a = t[3] ? parseFloat(t[3]) : NaN, o = t[4] ? parseFloat(t[4]) : NaN, o ? (t = /(?:Chrome\/(\d+\.\d+))/.exec(e), s = t && t[1] ? parseFloat(t[1]) : NaN) : s = NaN;
|
|
14
|
+
} else r = i = a = s = o = NaN;
|
|
15
|
+
if (v) {
|
|
16
|
+
if (v[1]) {
|
|
17
|
+
var b = /(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);
|
|
18
|
+
l = !b || parseFloat(b[1].replace("_", "."));
|
|
19
|
+
} else l = !1;
|
|
20
|
+
u = !!v[2], d = !!v[3];
|
|
21
|
+
} else l = u = d = !1;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
var y = {
|
|
25
|
+
ie: function() {
|
|
26
|
+
return v() || r;
|
|
27
|
+
},
|
|
28
|
+
ieCompatibilityMode: function() {
|
|
29
|
+
return v() || c > r;
|
|
30
|
+
},
|
|
31
|
+
ie64: function() {
|
|
32
|
+
return y.ie() && p;
|
|
33
|
+
},
|
|
34
|
+
firefox: function() {
|
|
35
|
+
return v() || i;
|
|
36
|
+
},
|
|
37
|
+
opera: function() {
|
|
38
|
+
return v() || a;
|
|
39
|
+
},
|
|
40
|
+
webkit: function() {
|
|
41
|
+
return v() || o;
|
|
42
|
+
},
|
|
43
|
+
safari: function() {
|
|
44
|
+
return y.webkit();
|
|
45
|
+
},
|
|
46
|
+
chrome: function() {
|
|
47
|
+
return v() || s;
|
|
48
|
+
},
|
|
49
|
+
windows: function() {
|
|
50
|
+
return v() || u;
|
|
51
|
+
},
|
|
52
|
+
osx: function() {
|
|
53
|
+
return v() || l;
|
|
54
|
+
},
|
|
55
|
+
linux: function() {
|
|
56
|
+
return v() || d;
|
|
57
|
+
},
|
|
58
|
+
iphone: function() {
|
|
59
|
+
return v() || m;
|
|
60
|
+
},
|
|
61
|
+
mobile: function() {
|
|
62
|
+
return v() || m || h || f || _;
|
|
63
|
+
},
|
|
64
|
+
nativeApp: function() {
|
|
65
|
+
return v() || g;
|
|
66
|
+
},
|
|
67
|
+
android: function() {
|
|
68
|
+
return v() || f;
|
|
69
|
+
},
|
|
70
|
+
ipad: function() {
|
|
71
|
+
return v() || h;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
t.exports = y;
|
|
75
|
+
})), i = /* @__PURE__ */ n(((e, t) => {
|
|
76
|
+
var n = !!(typeof window < "u" && window.document && window.document.createElement);
|
|
77
|
+
t.exports = {
|
|
78
|
+
canUseDOM: n,
|
|
79
|
+
canUseWorkers: typeof Worker < "u",
|
|
80
|
+
canUseEventListeners: n && !!(window.addEventListener || window.attachEvent),
|
|
81
|
+
canUseViewport: n && !!window.screen,
|
|
82
|
+
isInWorker: !n
|
|
83
|
+
};
|
|
84
|
+
})), a = /* @__PURE__ */ n(((e, t) => {
|
|
85
|
+
var n = i(), r;
|
|
86
|
+
n.canUseDOM && (r = document.implementation && document.implementation.hasFeature && document.implementation.hasFeature("", "") !== !0);
|
|
87
|
+
function a(e, t) {
|
|
88
|
+
if (!n.canUseDOM || t && !("addEventListener" in document)) return !1;
|
|
89
|
+
var i = "on" + e, a = i in document;
|
|
90
|
+
if (!a) {
|
|
91
|
+
var o = document.createElement("div");
|
|
92
|
+
o.setAttribute(i, "return;"), a = typeof o[i] == "function";
|
|
93
|
+
}
|
|
94
|
+
return !a && r && e === "wheel" && (a = document.implementation.hasFeature("Events.wheel", "3.0")), a;
|
|
95
|
+
}
|
|
96
|
+
t.exports = a;
|
|
97
|
+
})), o = /* @__PURE__ */ n(((e, t) => {
|
|
98
|
+
var n = r(), i = a(), o = 10, s = 40, c = 800;
|
|
99
|
+
function l(e) {
|
|
100
|
+
var t = 0, n = 0, r = 0, i = 0;
|
|
101
|
+
return "detail" in e && (n = e.detail), "wheelDelta" in e && (n = -e.wheelDelta / 120), "wheelDeltaY" in e && (n = -e.wheelDeltaY / 120), "wheelDeltaX" in e && (t = -e.wheelDeltaX / 120), "axis" in e && e.axis === e.HORIZONTAL_AXIS && (t = n, n = 0), r = t * o, i = n * o, "deltaY" in e && (i = e.deltaY), "deltaX" in e && (r = e.deltaX), (r || i) && e.deltaMode && (e.deltaMode == 1 ? (r *= s, i *= s) : (r *= c, i *= c)), r && !t && (t = r < 1 ? -1 : 1), i && !n && (n = i < 1 ? -1 : 1), {
|
|
102
|
+
spinX: t,
|
|
103
|
+
spinY: n,
|
|
104
|
+
pixelX: r,
|
|
105
|
+
pixelY: i
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
l.getEventType = function() {
|
|
109
|
+
return n.firefox() ? "DOMMouseScroll" : i("wheel") ? "wheel" : "mousewheel";
|
|
110
|
+
}, t.exports = l;
|
|
111
|
+
})), s = /* @__PURE__ */ n(((e, t) => {
|
|
112
|
+
t.exports = o();
|
|
113
|
+
})), c = /* @__PURE__ */ t({ Wheel: () => p }), l = /* @__PURE__ */ e(s(), 1), u = 30, d = /* @__PURE__ */ new Set();
|
|
114
|
+
if (typeof document < "u") {
|
|
115
|
+
let e = () => {
|
|
116
|
+
d.forEach((e) => {
|
|
117
|
+
e.timer && clearTimeout(e.timer), e.timer = setTimeout(() => {
|
|
118
|
+
e.clear(), d.delete(e);
|
|
119
|
+
}, u);
|
|
120
|
+
});
|
|
121
|
+
}, t = () => {
|
|
122
|
+
document.body.addEventListener("wheel", e, !0), document.body.addEventListener("mousedown", e, !0);
|
|
123
|
+
};
|
|
124
|
+
/* istanbul ignore else -- @preserve */
|
|
125
|
+
document.body ? t() : window.addEventListener("DOMContentLoaded", t);
|
|
126
|
+
}
|
|
127
|
+
var f = (e, t) => {
|
|
128
|
+
let n = t[0] - e[0], r = t[1] - e[1];
|
|
129
|
+
return Math.abs(360 * Math.atan(r / n) / (2 * Math.PI));
|
|
130
|
+
}, p = class e {
|
|
131
|
+
static of(t, n) {
|
|
132
|
+
return new e(t, n);
|
|
133
|
+
}
|
|
134
|
+
static shouldWheelX = (e, t) => e.offsetWidth === e.scrollWidth || (t = Math.round(t), t === 0) ? !1 : t < 0 && e.scrollLeft > 0 || t >= 0 && Math.ceil(e.scrollLeft) < e.scrollWidth - e.offsetWidth;
|
|
135
|
+
static shouldWheelY = (e, t) => e.offsetHeight === e.scrollHeight || (t = Math.round(t), t === 0) ? !1 : t < 0 && e.scrollTop > 0 || t >= 0 && Math.ceil(e.scrollTop) < e.scrollHeight - e.offsetHeight;
|
|
136
|
+
el;
|
|
137
|
+
needThresholdWait = !1;
|
|
138
|
+
animationFrameID = null;
|
|
139
|
+
deltaX = 0;
|
|
140
|
+
deltaY = 0;
|
|
141
|
+
isTouching = !1;
|
|
142
|
+
startTime = 0;
|
|
143
|
+
startX = 0;
|
|
144
|
+
startY = 0;
|
|
145
|
+
moveX = 0;
|
|
146
|
+
moveY = 0;
|
|
147
|
+
listeners = [];
|
|
148
|
+
timer = null;
|
|
149
|
+
options;
|
|
150
|
+
defaultOnWheel = null;
|
|
151
|
+
constructor(t, n) {
|
|
152
|
+
this.el = t, this.options = {
|
|
153
|
+
native: !0,
|
|
154
|
+
freedom: !1,
|
|
155
|
+
stopPropagation: () => !0,
|
|
156
|
+
shouldWheelX: (n) => e.shouldWheelX(t, n),
|
|
157
|
+
shouldWheelY: (n) => e.shouldWheelY(t, n),
|
|
158
|
+
...n
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
handleTouchStart = (e) => {
|
|
162
|
+
this.isTouching = !0;
|
|
163
|
+
let t = e.touches[0].screenX, n = e.touches[0].screenY;
|
|
164
|
+
this.startX = t, this.startY = n, this.moveX = t, this.moveY = n, this.startTime = Date.now();
|
|
165
|
+
};
|
|
166
|
+
handleTouchMove = (e) => {
|
|
167
|
+
if (!this.isTouching) return;
|
|
168
|
+
let t = e.touches[0].screenX, n = e.touches[0].screenY, r = this.moveX - t, i = this.moveY - n;
|
|
169
|
+
this.moveX = t, this.moveY = n, this.emitScroll(e, {
|
|
170
|
+
x: r,
|
|
171
|
+
y: i,
|
|
172
|
+
angle: f([this.startX, this.startY], [this.moveX, this.moveY])
|
|
173
|
+
});
|
|
174
|
+
};
|
|
175
|
+
handleTouchEnd = (e) => {
|
|
176
|
+
this.isTouching = !1;
|
|
177
|
+
let t = e.changedTouches[0].screenX, n = e.changedTouches[0].screenY, r = f([this.startX, this.startY], [t, n]), i = Date.now() - this.startTime;
|
|
178
|
+
if (i <= 500 && i > 50) {
|
|
179
|
+
let a = this.startX - t, o = this.startY - n, s = a / i, c = o / i;
|
|
180
|
+
for (let t = 0; t <= 300; t++) setTimeout(() => {
|
|
181
|
+
this.emitScroll(e, {
|
|
182
|
+
x: s,
|
|
183
|
+
y: c,
|
|
184
|
+
angle: r
|
|
185
|
+
});
|
|
186
|
+
}, t);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
handleMouseMove = (e) => {
|
|
190
|
+
e.which === 2 && this.emitScroll(e, {
|
|
191
|
+
x: e.movementX,
|
|
192
|
+
y: e.movementY,
|
|
193
|
+
angle: f([0, 0], [e.movementX, e.movementY])
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
handleWheel = (e) => {
|
|
197
|
+
let { pixelX: t, pixelY: n } = (0, l.default)(e);
|
|
198
|
+
this.emitScroll(e, {
|
|
199
|
+
x: t,
|
|
200
|
+
y: n,
|
|
201
|
+
angle: f([this.deltaX, this.deltaY], [this.deltaX + t, this.deltaY + n])
|
|
202
|
+
});
|
|
203
|
+
};
|
|
204
|
+
clear = () => {
|
|
205
|
+
this.needThresholdWait = !1;
|
|
206
|
+
};
|
|
207
|
+
didWheel = () => {
|
|
208
|
+
this.listeners?.forEach((e) => e(this.deltaX, this.deltaY)), this.animationFrameID = null, this.deltaX = 0, this.deltaY = 0;
|
|
209
|
+
};
|
|
210
|
+
preventParentScroll(e, t, n) {
|
|
211
|
+
return !t && !n ? (this.options.native && this.needThresholdWait && (e.cancelable && e.preventDefault(), this.timer && clearTimeout(this.timer), this.timer = setTimeout(this.clear, u), d.add(this)), !0) : (e.cancelable && e.preventDefault(), this.options.native &&
|
|
212
|
+
/* istanbul ignore next -- @preserve */
|
|
213
|
+
(this.timer && clearTimeout(this.timer), this.needThresholdWait = !0), !1);
|
|
214
|
+
}
|
|
215
|
+
emitScroll(e, t) {
|
|
216
|
+
let { x: n, y: r, angle: i } = t, a = n, o = r;
|
|
217
|
+
this.options.freedom || (i < 30 && (o = 0), i > 60 && (a = 0));
|
|
218
|
+
let s = this.deltaX + a, c = this.deltaY + o, l = this.options.shouldWheelX(s, c), u = this.options.shouldWheelY(c, s);
|
|
219
|
+
this.preventParentScroll(e, l, u) || (this.deltaX += l ? a : 0, this.deltaY += u ? o : 0, (this.deltaX !== 0 || this.deltaY !== 0) &&
|
|
220
|
+
/* istanbul ignore next -- @preserve */
|
|
221
|
+
(this.options.stopPropagation(this.deltaX, this.deltaY) && e.stopPropagation(), this.animationFrameID === null && (this.animationFrameID = window.requestAnimationFrame(this.didWheel))));
|
|
222
|
+
}
|
|
223
|
+
operateDOMEvents(e) {
|
|
224
|
+
if (typeof window > "u") return;
|
|
225
|
+
let t = (e === "add" ? this.el.addEventListener : this.el.removeEventListener).bind(this.el);
|
|
226
|
+
t("wheel", this.handleWheel, !1), document.ontouchend || document.ontouchend === null ? (t("touchstart", this.handleTouchStart, !1), t("touchmove", this.handleTouchMove, { passive: !1 }), t("touchend", this.handleTouchEnd, !1)) : t("mousemove", this.handleMouseMove, !1);
|
|
227
|
+
}
|
|
228
|
+
on(e) {
|
|
229
|
+
return this.listeners.length || this.operateDOMEvents("add"), this.listeners.push(e), () => this.off(e);
|
|
230
|
+
}
|
|
231
|
+
off(e) {
|
|
232
|
+
if (e) {
|
|
233
|
+
let t = this.listeners.indexOf(e);
|
|
234
|
+
if (t === -1) return;
|
|
235
|
+
this.listeners.splice(t, 1);
|
|
236
|
+
} else this.listeners = [];
|
|
237
|
+
this.listeners.length || this.operateDOMEvents("remove");
|
|
238
|
+
}
|
|
239
|
+
enable() {
|
|
240
|
+
return this.defaultOnWheel && this.off(this.defaultOnWheel), this.defaultOnWheel = (e, t) => {
|
|
241
|
+
/* istanbul ignore next -- @preserve */
|
|
242
|
+
t && this.el.scrollHeight > this.el.offsetHeight && (this.el.scrollTop = Math.min(Math.max(0, this.el.scrollTop + t), this.el.scrollHeight - this.el.offsetHeight)), e && this.el.scrollWidth > this.el.offsetWidth && (this.el.scrollLeft = Math.min(Math.max(0, this.el.scrollLeft + e), this.el.scrollWidth - this.el.offsetWidth));
|
|
243
|
+
}, this.on(this.defaultOnWheel);
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
//#endregion
|
|
247
|
+
export { c as n, p as t };
|