@deot/docs-client 1.1.3 → 1.1.5

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.
Files changed (55) hide show
  1. package/README.md +88 -4
  2. package/dist/chunks/browser-Cmwcvs-d.js +505 -0
  3. package/dist/chunks/cdn-DQoETju_-DS-873Vi.js +38 -0
  4. package/dist/chunks/chunk-rhk8Qtmk-CUgXtmq_.js +14 -0
  5. package/dist/chunks/compile-BHD98Ttf-BJaenUUQ.js +79915 -0
  6. package/dist/chunks/compiler-sfc.esm-browser-B4_kBkG5.js +24975 -0
  7. package/dist/chunks/dayjs.min-B3g34Qcz.js +300 -0
  8. package/dist/chunks/dist-0ySyXNpo.js +415 -0
  9. package/dist/chunks/dist-9UPCn_ag.js +24601 -0
  10. package/dist/chunks/dist-B44jICwZ.js +22 -0
  11. package/dist/chunks/dist-BQyOK8Qy.js +17 -0
  12. package/dist/chunks/dist-BUw25nXJ.js +65 -0
  13. package/dist/chunks/dist-BeOE8qTX.js +345 -0
  14. package/dist/chunks/dist-C3V7reR4.js +197 -0
  15. package/dist/chunks/dist-C8z9l0mA.js +58 -0
  16. package/dist/chunks/dist-CI9Lp9Cj.js +247 -0
  17. package/dist/chunks/dist-COjpr4FU.js +426 -0
  18. package/dist/chunks/dist-CQir6D4y.js +244 -0
  19. package/dist/chunks/dist-Cxf7_ocf.js +44 -0
  20. package/dist/chunks/dist-DF4kisl2.js +43 -0
  21. package/dist/chunks/dist-DLj8yJdm.js +38 -0
  22. package/dist/chunks/dist-DWn6r6un.js +76 -0
  23. package/dist/chunks/dist-DWqBe2Ah.js +132 -0
  24. package/dist/chunks/dist-D_Uqh6m9.js +80 -0
  25. package/dist/chunks/dist-DcIU51zW.js +166 -0
  26. package/dist/chunks/dist-kiZUqqzR.js +27 -0
  27. package/dist/chunks/dist-oZ12SGqg.js +6 -0
  28. package/dist/chunks/dist-uXnwGrO3.js +76 -0
  29. package/dist/chunks/dist-va7FmnW4.js +156 -0
  30. package/dist/chunks/{echarts-I1Rk_oCV.js → echarts-Dk-pu7GM.js} +450 -398
  31. package/dist/chunks/files-BqucFldk-B-hTQ-ip.js +148 -0
  32. package/dist/chunks/html2canvas-Deo0mM5K.js +4022 -0
  33. package/dist/chunks/index.es-UlJ0gfdF.js +5757 -0
  34. package/dist/chunks/jspdf.es.min-CJc40v7q.js +17873 -0
  35. package/dist/chunks/jsx-CwMPlI4_-CAiik-V7.js +128454 -0
  36. package/dist/chunks/jszip.min-BbVwZKYP.js +3044 -0
  37. package/dist/chunks/linker-xqjVl0X0-CWWI367H.js +118 -0
  38. package/dist/chunks/local-sandbox-DvcgaBOa-CzJxrdVx.js +298 -0
  39. package/dist/chunks/lodash-Cxf6dD_I.js +5161 -0
  40. package/dist/chunks/modules-BGzPcoRR-C9BWX8hC.js +154 -0
  41. package/dist/chunks/{photoswipe.esm-CT37djgx.js → photoswipe.esm-B0V-xGTB.js} +36 -31
  42. package/dist/chunks/pinia-pDJilYOg.js +326 -0
  43. package/dist/chunks/purify.es-BiqY1C6m.js +867 -0
  44. package/dist/chunks/remote-mq4zvrI1-Bib9tTkb.js +104 -0
  45. package/dist/chunks/script-DjUf9uWK-Cu5Kla_E.js +15055 -0
  46. package/dist/chunks/store-BOyC8F2y-CbodPye0.js +17037 -0
  47. package/dist/chunks/vue-router-C0mj8Ot5.js +1196 -0
  48. package/dist/chunks/vue.runtime.esm-bundler-XxHGOLq2.js +4879 -0
  49. package/dist/index.cjs +997 -340
  50. package/dist/index.d.ts +2 -1
  51. package/dist/index.js +42205 -103464
  52. package/dist/index.style.css +3 -4
  53. package/package.json +9 -9
  54. package/dist/chunks/_commonjsHelpers-BFTU3MAI-D_7z5o6A.js +0 -8
  55. package/dist/chunks/jsx-H2PmTOgp-C0GVSSMR.js +0 -128281
@@ -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 };
@@ -0,0 +1,426 @@
1
+ globalThis.process;
2
+ import { n as e } from "./rolldown-runtime-Ce3zPWPd.js";
3
+ import { t } from "./dist-Cxf7_ocf.js";
4
+ //#region node_modules/.pnpm/@deot+helper-fp@1.1.6/node_modules/@deot/helper-fp/dist/index.js
5
+ var n = /* @__PURE__ */ e({
6
+ AMonad: () => T,
7
+ APointed: () => E,
8
+ ATask: () => D,
9
+ Either: () => N,
10
+ IO: () => P,
11
+ Job: () => L,
12
+ Maybe: () => k,
13
+ Monad: () => O,
14
+ Parallel: () => R,
15
+ Pointed: () => I,
16
+ Task: () => F,
17
+ add: () => g,
18
+ alternation: () => b,
19
+ catch$: () => l,
20
+ compose: () => o,
21
+ curry: () => i,
22
+ divide: () => v,
23
+ filter: () => p,
24
+ fork: () => x,
25
+ identity: () => S,
26
+ map: () => f,
27
+ memoize: () => u,
28
+ multiply: () => y,
29
+ partial: () => d,
30
+ pipe: () => s,
31
+ reduce: () => m,
32
+ reverse: () => h,
33
+ sequence: () => C,
34
+ subtract: () => _,
35
+ tap: () => w,
36
+ then$: () => c
37
+ }), r = (e, t, n) => (e = e.map((e) => e === n && t.length ? t.shift() : e), e.concat(t)), i = (e) => function t(...n) {
38
+ return n.length >= e.length && !n.includes(i) ? e.apply(this, n) : function(...e) {
39
+ let a = r(n, e, i);
40
+ return t.apply(this, a);
41
+ };
42
+ };
43
+ i.placeholder = i;
44
+ var a = (e) => (...t) => t.length === 0 ? (e) => e : t.length === 1 ? t[0] : t[e]((e, t) => function(...n) {
45
+ return e.call(this, t.apply(this, n));
46
+ }), o = a("reduce"), s = a("reduceRight"), c = i(function(e, t) {
47
+ return t.then(e);
48
+ }), l = i(function(e, t) {
49
+ return t.catch(e);
50
+ }), u = (e, t) => {
51
+ if (e.length === 0) return e;
52
+ let n = function(...r) {
53
+ let i = t ? t.apply(this, r) : r[0];
54
+ return n.cache.has(i) || n.cache.set(i, e.apply(this, r)), n.cache.get(i);
55
+ };
56
+ return n.cache = /* @__PURE__ */ new Map(), n;
57
+ }, d = (e, ...t) => function(...n) {
58
+ return e.apply(this, r(t, n, d));
59
+ };
60
+ d.placeholder = d;
61
+ var f = i((e, t) => t instanceof Array ? t.map((t) => e(t)) : Object.keys(t).reduce((n, r) => (n[r] = e(t[r]), n), {})), p = i((e, t) => t instanceof Array ? t.filter((t) => e(t)) : Object.keys(t).reduce((n, r) => (e(t[r]) && (n[r] = t[r]), n), {})), m = i((e, t, n) => n.reduce(e, t)), h = (e) => typeof e == "string" ? e.split("").reverse().join("") : e instanceof Array ? e.slice().reverse() : e, g = i((e, t) => {
62
+ let n, r;
63
+ try {
64
+ n = e.toString().split(".")[1].length;
65
+ } catch {
66
+ n = 0;
67
+ }
68
+ try {
69
+ r = t.toString().split(".")[1].length;
70
+ } catch {
71
+ r = 0;
72
+ }
73
+ let i = Math.abs(n - r), a = 10 ** Math.max(n, r);
74
+ if (i > 0) {
75
+ let a = 10 ** i;
76
+ n > r ? (e = Number(e.toString().replace(".", "")), t = Number(t.toString().replace(".", "")) * a) : (e = Number(e.toString().replace(".", "")) * a, t = Number(t.toString().replace(".", "")));
77
+ } else e = Number(e.toString().replace(".", "")), t = Number(t.toString().replace(".", ""));
78
+ return (e + t) / a;
79
+ }), _ = i((e, t) => {
80
+ let n, r;
81
+ try {
82
+ n = e.toString().split(".")[1].length;
83
+ } catch {
84
+ n = 0;
85
+ }
86
+ try {
87
+ r = t.toString().split(".")[1].length;
88
+ } catch {
89
+ r = 0;
90
+ }
91
+ let i = 10 ** Math.max(n, r), a = n >= r ? n : r;
92
+ return +((e * i - t * i) / i).toFixed(a);
93
+ }), v = i((e, t) => {
94
+ let n = 0, r = 0;
95
+ try {
96
+ n = e.toString().split(".")[1].length;
97
+ } catch {}
98
+ try {
99
+ r = t.toString().split(".")[1].length;
100
+ } catch {}
101
+ let i = 10 ** Math.max(n, r);
102
+ return e * i / (t * i);
103
+ }), y = i((e, t) => {
104
+ let n = 0, r = e.toString(), i = t.toString();
105
+ try {
106
+ n += r.split(".")[1].length;
107
+ } catch {}
108
+ try {
109
+ n += i.split(".")[1].length;
110
+ } catch {}
111
+ return Number(r.replace(".", "")) * Number(i.replace(".", "")) / 10 ** n;
112
+ }), b = i((e, t) => (n) => e(n) || t(n)), x = i((e, t, n) => (r) => e(t(r), n(r))), S = (e) => e, C = (...e) => (t) => {
113
+ e.forEach((e) => e(t));
114
+ }, w = i((e, t) => (e(t), t)), T = class e {
115
+ value;
116
+ constructor(e) {
117
+ this.value = e;
118
+ }
119
+ flatMap(e) {
120
+ let t = this.join();
121
+ return this.value = t.value, this.map(e);
122
+ }
123
+ join() {
124
+ return this.value instanceof e ? this.value.join() : this;
125
+ }
126
+ valueOf() {
127
+ return this.value;
128
+ }
129
+ }, E = class {
130
+ value;
131
+ constructor(e) {
132
+ this.value = e;
133
+ }
134
+ valueOf() {
135
+ return this.value;
136
+ }
137
+ }, D = class extends t {
138
+ _pasuer;
139
+ pasuer = Promise.resolve();
140
+ canceler = Promise.resolve();
141
+ isCancel = !1;
142
+ isPasue = !1;
143
+ async suspend(e, t) {
144
+ return t && t.then && await t, e;
145
+ }
146
+ setPasueStatus(e) {
147
+ this.isPasue = e, this.isPasue ? this.pasuer = new Promise((e) => {
148
+ this._pasuer = e;
149
+ }) : this._pasuer();
150
+ }
151
+ setCancelStatus(e) {
152
+ this.isCancel = e, this.canceler = this.isCancel ? new Promise(() => {}) : Promise.resolve();
153
+ }
154
+ end() {
155
+ return this.cancel();
156
+ }
157
+ immediate() {
158
+ return this.start();
159
+ }
160
+ }, O = class e extends T {
161
+ static of(t) {
162
+ return new e(t);
163
+ }
164
+ map(t) {
165
+ return e.of(t(this.value));
166
+ }
167
+ toString() {
168
+ return `Monad(${this.value})`;
169
+ }
170
+ }, k = class e extends T {
171
+ static of(t) {
172
+ return new e(t);
173
+ }
174
+ map(t) {
175
+ return this.isNothing() ? e.of(this.value) : e.of(t(this.value));
176
+ }
177
+ toString() {
178
+ return this.isNothing() ? "Maybe.Nothing" : `Maybe.Just(${this.value})`;
179
+ }
180
+ isNothing() {
181
+ return this.value === null || this.value === void 0;
182
+ }
183
+ isJust() {
184
+ return !this.isNothing();
185
+ }
186
+ valueOf(e) {
187
+ return e !== void 0 && this.isNothing() ? e : this.value;
188
+ }
189
+ }, A = (e) => new N(e), j = (e) => new N(e, !0), M = (e) => {
190
+ try {
191
+ return A(e());
192
+ } catch (e) {
193
+ return j(e);
194
+ }
195
+ }, N = class e extends T {
196
+ static of = M;
197
+ static try = M;
198
+ static ok = A;
199
+ static right = A;
200
+ static left = j;
201
+ static error = j;
202
+ isLeft;
203
+ isRight;
204
+ constructor(e, t) {
205
+ super(e), this.isLeft = !!t, this.isRight = !t;
206
+ }
207
+ map(t) {
208
+ return this.isLeft ? e.left(this.value) : e.right(t(this.value));
209
+ }
210
+ toString() {
211
+ return `Either.${this.isLeft ? "Left" : "Right"}(${this.value})`;
212
+ }
213
+ }, P = class e extends T {
214
+ static of(t) {
215
+ return new e(t);
216
+ }
217
+ map(t) {
218
+ let n = o(t, this.value._isIO ? this.value : () => this.value);
219
+ return n._isIO = !0, e.of(n);
220
+ }
221
+ toString() {
222
+ return `IO(${this.value()})`;
223
+ }
224
+ valueOf() {
225
+ return this.value();
226
+ }
227
+ }, F = class e extends T {
228
+ static of(t, n) {
229
+ return new e(t, n);
230
+ }
231
+ result = "";
232
+ cancelHooks = [];
233
+ isCancel = !1;
234
+ isComplete = !1;
235
+ isStart;
236
+ parent;
237
+ child = null;
238
+ record = null;
239
+ ready;
240
+ _ready;
241
+ pasuer = Promise.resolve();
242
+ _pasuer;
243
+ constructor(e, t) {
244
+ super(e), this.parent = t, this.isStart = t?.isStart || !1, this.ready = this.isStart ? Promise.resolve() : new Promise((e) => {
245
+ this._ready = e;
246
+ });
247
+ }
248
+ map(t) {
249
+ this.record ||= ["map", t];
250
+ let n = e.of(this.ready.then(() => this.value).then((e) => this.pasuer.then(() => e)).then((e) => new Promise((r, i) => {
251
+ let a, o;
252
+ n.isCancel || (async () => {
253
+ try {
254
+ o = await Promise.race([new Promise((e, t) => {
255
+ n.cancelHooks.push(t);
256
+ }), t(e)]);
257
+ } catch (e) {
258
+ a = e;
259
+ } finally {
260
+ n.isCancel || (n.isComplete = !0, a ? i(a) : (n.result = o, r(o)));
261
+ }
262
+ })();
263
+ })), this);
264
+ return this.child = n, n;
265
+ }
266
+ flatMap(e) {
267
+ return this.record = ["flatMap", e], super.flatMap(e);
268
+ }
269
+ reduce(e, t) {
270
+ return this.map(async (n) => (typeof e == "function" && (e = await e(n)), e.reduce((e, n, r, i) => e.then((e) => t(e, n, r, i)), Promise.resolve(n))));
271
+ }
272
+ start() {
273
+ return this.isStart ? this : (this.isStart = !0, this.parent?.start(), this._ready(), this);
274
+ }
275
+ pasue() {
276
+ return this.parent?.pasue(), this.pasuer = new Promise((e) => {
277
+ this._pasuer = e;
278
+ }), this;
279
+ }
280
+ resume() {
281
+ return this._pasuer(), this.parent?.resume(), this;
282
+ }
283
+ cancel() {
284
+ return this.isCancel || this.isComplete ? this : (this.isCancel = !0, this.cancelHooks.forEach((e) => e()), this.parent?.cancel(), this);
285
+ }
286
+ end() {
287
+ return this.cancel();
288
+ }
289
+ immediate() {
290
+ return this.start();
291
+ }
292
+ restart(t) {
293
+ this.cancel();
294
+ let n = this, r = n.parent || n;
295
+ for (; r && r.parent;) r = r.parent;
296
+ n = e.of(t || r.value);
297
+ let i = r;
298
+ for (; i && i.child;) {
299
+ let [e, t] = i.record;
300
+ e && (n = n[e](t)), i = i.child;
301
+ }
302
+ return n.isStart || n.start(), n;
303
+ }
304
+ toPromise() {
305
+ return this.isStart || this.start(), this.value;
306
+ }
307
+ toString() {
308
+ return `Task(${this.result})`;
309
+ }
310
+ valueOf() {
311
+ return this.result;
312
+ }
313
+ }, I = class e extends E {
314
+ static of(t) {
315
+ return new e(t);
316
+ }
317
+ map(t) {
318
+ return e.of(t(this.value));
319
+ }
320
+ toString() {
321
+ return `Pointed(${this.value})`;
322
+ }
323
+ }, L = class e extends D {
324
+ static of(t, n) {
325
+ return new e(t, n);
326
+ }
327
+ original;
328
+ task;
329
+ interval;
330
+ isStart = !1;
331
+ constructor(e, t) {
332
+ super(), this.task = e, this.original = e, this.interval = t || 0, this.task instanceof F && this.task.isStart && this.start();
333
+ }
334
+ process(e) {
335
+ e ||= this.original, this.task !== e && (this.task = e);
336
+ let t = (e) => Promise.resolve(e).then((e) => this.suspend(e, new Promise((e) => {
337
+ setTimeout(e, this.interval);
338
+ }))).then((e) => this.suspend(e, this.canceler)).then((e) => this.suspend(e, this.pasuer));
339
+ return this.original instanceof F ? Promise.resolve().then(() => e.isCancel ? Promise.resolve() : e.value).then((e) => this.suspend(e, this.emit("fulfilled", e))).catch((e) => this.suspend(e, this.emit("rejected", e))).then((e) => t(e)).then(() => e.restart()).then((e) => this.process(e)) : Promise.resolve().then(() => this.original()).then((e) => this.suspend(e, this.emit("fulfilled", e))).catch((e) => this.suspend(e, this.emit("rejected", e))).then((e) => t(e)).then((e) => this.process(e));
340
+ }
341
+ start() {
342
+ this.isStart || (this.isStart = !0, this.original instanceof F && !this.original.isStart && this.original.start(), this.process());
343
+ }
344
+ pasue() {
345
+ this.task instanceof F && this.task.pasue(), this.setPasueStatus(!0);
346
+ }
347
+ resume() {
348
+ this.task instanceof F && this.task.resume(), this.setPasueStatus(!1);
349
+ }
350
+ cancel() {
351
+ this.task instanceof F && this.task.cancel(), this.setCancelStatus(!0);
352
+ }
353
+ restart() {
354
+ this.task instanceof F && (this.task.pasue(), this.task.cancel()), this.setCancelStatus(!1), this.isStart = !1, this.process();
355
+ }
356
+ }, R = class e extends D {
357
+ static of(t, n, r) {
358
+ return new e(t, n, r);
359
+ }
360
+ original;
361
+ task;
362
+ isStart = !1;
363
+ target = null;
364
+ _target = null;
365
+ tasks = [];
366
+ concurrency;
367
+ options;
368
+ constructor(e, t, n) {
369
+ super(), this.options = {
370
+ skipError: !0,
371
+ ...n
372
+ }, this.task = e, this.original = e instanceof Array ? [...e] : e, this.concurrency = t || 1;
373
+ }
374
+ setConcurrency(e) {
375
+ return typeof e == "number" && e > 0 && (this.concurrency = e, this.target && this.process()), this.concurrency;
376
+ }
377
+ process() {
378
+ for (; this.tasks.length < this.concurrency && (typeof this.task == "function" || this.task instanceof F || this.task instanceof Array && this.task.length);) {
379
+ let e;
380
+ if (this.task instanceof Array) {
381
+ let t = this.task.pop();
382
+ /* istanbul ignore else -- @preserve */
383
+ typeof t == "function" ? e = t() : t instanceof F && (e = t.restart());
384
+ } else e = this.task instanceof F ? this.task.restart() : this.task();
385
+ this.tasks.push(e), Promise.resolve().then(() => e instanceof F ? e.value : e).then((e) => this.suspend(e, this.canceler)).then((e) => this.suspend(e, this.pasuer)).finally(() => {
386
+ this.tasks = this.tasks.filter((t) => t !== e);
387
+ }).then(this.onFulfilled).catch(this.onRejected);
388
+ }
389
+ this.task instanceof Array && !this.task.length && this.tasks.length === 0 && (this._target.resolve(), this.target = null, this.tasks = []);
390
+ }
391
+ onFulfilled = (e) => {
392
+ /* istanbul ignore if -- @preserve */
393
+ this.target && (this.emit("fulfilled", e), this.process());
394
+ };
395
+ onRejected = (e) => {
396
+ /* istanbul ignore if -- @preserve */
397
+ this.target && (this.emit("rejected", e), this.options.skipError ? this.process() : (this._target.reject(e), this.target = null, this.tasks = []));
398
+ };
399
+ start() {
400
+ return this.target ||= new Promise((e, t) => {
401
+ this._target = {
402
+ reject: t,
403
+ resolve: e
404
+ }, this.process();
405
+ }), this.target;
406
+ }
407
+ async cancel() {
408
+ if (!this.target) return;
409
+ let e = this.tasks;
410
+ this.setCancelStatus(!0), this.target = null, this.tasks = [], e.some((e) => e instanceof F) ? e.forEach((e) => e.cancel()) : await Promise.allSettled(e);
411
+ }
412
+ async pasue() {
413
+ let e = this.tasks;
414
+ this.setPasueStatus(!0), e.some((e) => e instanceof F) ? e.forEach((e) => e.pasue()) : await Promise.allSettled(e);
415
+ }
416
+ resume() {
417
+ this.setPasueStatus(!1);
418
+ let e = this.tasks;
419
+ e.some((e) => e instanceof F) && e.forEach((e) => e.resume());
420
+ }
421
+ async restart() {
422
+ return await this.cancel(), this.setCancelStatus(!1), this.original instanceof Array && (this.task = [...this.original]), this.start();
423
+ }
424
+ };
425
+ //#endregion
426
+ export { n as i, R as n, F as r, L as t };