@unicom-cloud/ui 0.8.110 → 0.8.112
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/Affix.js +3 -3
- package/Alert.js +1 -1
- package/AutoComplete.js +1 -1
- package/BackTop.js +1 -1
- package/Badge.js +1 -1
- package/Breadcrumb.js +2 -2
- package/Button.js +1 -1
- package/Calendar.js +1 -1
- package/Card.js +1 -1
- package/Carousel.js +2 -2
- package/Cascader.js +1 -1
- package/Checkbox.js +1 -1
- package/ColorPicker.js +1 -1
- package/Comment.js +1 -1
- package/ConfigProvider.js +1 -1
- package/Copy.js +2 -2
- package/Countdown.js +17 -17
- package/DatePicker.js +1 -1
- package/Descriptions.js +1 -1
- package/Details.js +19 -19
- package/Development.js +1 -1
- package/Divider.js +1 -1
- package/Draggable.js +1 -1
- package/Dropdown.js +1 -1
- package/Empty.js +1 -1
- package/Flex.js +18 -18
- package/Form.js +1 -1
- package/Icon.js +1 -1
- package/IconHover.js +1 -1
- package/Image.js +1 -1
- package/InputNumber.js +1 -1
- package/Layout.js +1 -1
- package/Link.js +1 -1
- package/LiquidFill.js +19 -19
- package/List.js +1 -1
- package/Loading.js +18 -18
- package/Marquee.js +19 -19
- package/Mentions.js +1 -1
- package/Menu.js +1 -1
- package/Message.js +1 -1
- package/Modal.js +1 -1
- package/Notice.js +18 -18
- package/Notification.js +1 -1
- package/OverflowEllipsis.js +2 -2
- package/PageHeader.js +2 -2
- package/Popconfirm.js +1 -1
- package/Popover.js +1 -1
- package/Progress.js +1 -1
- package/QrCode.js +18 -18
- package/Radio.js +1 -1
- package/Rate.js +1 -1
- package/ResizeBox.js +1 -1
- package/Result.js +1 -1
- package/RichText.js +13 -70
- package/Segmented.js +20 -20
- package/Skeleton.js +1 -1
- package/Slider.js +1 -1
- package/Space.js +18 -18
- package/Spin.js +1 -1
- package/Statistic.js +1 -1
- package/Steps.js +1 -1
- package/Switch.js +1 -1
- package/Table.js +1 -1
- package/Tabs.js +1 -1
- package/Tag.js +1 -1
- package/Tooltip.js +1 -1
- package/Tour.js +19 -19
- package/Transfer.js +1 -1
- package/Tree.js +1 -1
- package/TreeSelect.js +1 -1
- package/Trigger.js +2 -2
- package/affix/index.js +3 -3
- package/alert/index.js +1 -1
- package/anchor/Anchor.js +1 -1
- package/anchor/Link.js +1 -1
- package/app/App.js +2 -2
- package/auto-complete/index.js +1 -1
- package/avatar/Avatar.js +1 -1
- package/avatar/Group.js +1 -1
- package/back-top/index.js +1 -1
- package/badge/index.js +1 -1
- package/breadcrumb/index.js +2 -2
- package/button/Group.js +1 -1
- package/button/index.js +1 -1
- package/calendar/index.js +2 -2
- package/card/Grid.js +1 -1
- package/card/Meta.js +1 -1
- package/card/index.js +1 -1
- package/carousel/Arrow.js +1 -1
- package/carousel/Indicator.js +1 -1
- package/carousel/index.js +2 -2
- package/cascader/Cascader.js +3 -3
- package/cascader/index.js +1 -1
- package/cascader/util.js +1 -1
- package/checkbox/Checkbox.js +2 -2
- package/checkbox/Group.js +2 -2
- package/checkbox/GroupBlock.js +2 -2
- package/checkbox/index.js +2 -2
- package/chunk/{Y_GQsZUt.js → 0BhDjhcd.js} +1 -1
- package/chunk/{BDMqvmVH.js → BCmfDFV4.js} +28 -30
- package/chunk/{n1tirBXA.js → BfVlSL8A.js} +3 -3
- package/chunk/BiZSULcr.js +1872 -0
- package/chunk/{BcEZk8pT.js → C1vY8016.js} +14 -14
- package/chunk/{qsVvkBLU.js → C3kH2ES3.js} +1 -1
- package/chunk/{BGJspFG9.js → C5CbL5ku.js} +1 -1
- package/chunk/CAA93JLq.js +6 -0
- package/chunk/{B8W1N4er.js → CHQ8c547.js} +11 -10
- package/chunk/{Dbw0YUY1.js → CYssV-zz.js} +36 -36
- package/chunk/CrOzsnI0.js +51 -0
- package/chunk/{CFyN9Eio.js → CtCFA4ht.js} +4 -4
- package/chunk/{BnUWOu3_.js → Cx92e1S8.js} +3 -3
- package/chunk/{BeHcDey_.js → CylbdYce.js} +1 -1
- package/chunk/{BUNoUPLs.js → DMv8Hn4u.js} +1 -1
- package/chunk/{zFFM4RBT.js → DfUcAhyT.js} +703 -680
- package/chunk/{DSqW_efI.js → DfbO4QTS.js} +152 -156
- package/chunk/{CgN4U7Ou.js → DhAvt6tJ.js} +2 -2
- package/chunk/DsuIQH0F.js +200 -0
- package/chunk/{Lyh0cz3R.js → KPBMJlOB.js} +1 -1
- package/chunk/{B_c0gPsX.js → vP3qfmKM.js} +24 -23
- package/collapse/Collapse.js +1 -1
- package/collapse/Item.js +1 -1
- package/color-picker/ControlBar.js +1 -1
- package/color-picker/InputAlpha.js +1 -1
- package/color-picker/InputHex.js +1 -1
- package/color-picker/InputRgb.js +1 -1
- package/color-picker/Palette.js +1 -1
- package/color-picker/Panel.js +2 -2
- package/color-picker/index.js +1 -1
- package/comment/index.js +1 -1
- package/config-provider/ConfigProvider.js +1 -1
- package/config-provider/context.js +1 -1
- package/config-provider/index.js +2 -2
- package/copy/index.js +2 -2
- package/countdown/index.js +17 -17
- package/date-picker/Picker.js +1 -1
- package/date-picker/RangePicker.js +2 -2
- package/date-picker/index.js +1 -1
- package/descriptions/index.js +1 -1
- package/details/index.js +19 -19
- package/development/index.js +1 -1
- package/divider/index.js +1 -1
- package/draggable/index.js +1 -1
- package/drawer/Drawer.js +1 -1
- package/dropdown/Button.js +1 -1
- package/dropdown/index.js +1 -1
- package/empty/index.js +1 -1
- package/flex/index.js +18 -18
- package/form/Form.js +2 -2
- package/form/FormItem.js +1 -1
- package/form/index.js +1 -1
- package/grid/Grid.js +1 -1
- package/grid/Item.js +1 -1
- package/hooks/index.js +96 -97
- package/hooks/useId.js +1 -1
- package/hooks/useIsomorphicLayoutEffect.js +1 -1
- package/hooks/useResizeObserver.js +58 -2
- package/hooks/useWindowSize.js +1 -1
- package/icon/index.js +1 -1
- package/icon-hover/index.js +1 -1
- package/icons/file.js +1 -1
- package/image/Image.js +2 -2
- package/image/ImagePreview.js +22 -22
- package/image/ImagePreviewArrow.js +1 -1
- package/image/ImagePreviewGroup.js +1 -1
- package/image/index.js +1 -1
- package/index.js +691 -693
- package/input/Button.js +1 -1
- package/input/Group.js +1 -1
- package/input/Input.js +2 -2
- package/input/InputElement.js +2 -2
- package/input/Password.js +1 -1
- package/input/Search.js +1 -1
- package/input/Textarea.js +2 -2
- package/input-number/index.js +1 -1
- package/input-number/useSelectionRange.js +1 -1
- package/input-tag/InputTag.js +1 -1
- package/layout/Content.js +1 -1
- package/layout/Footer.js +1 -1
- package/layout/Header.js +1 -1
- package/layout/Sider.js +1 -1
- package/layout/index.js +1 -1
- package/link/index.js +1 -1
- package/liquid-fill/index.js +24 -24
- package/list/Item.js +1 -1
- package/list/Meta.js +1 -1
- package/list/index.js +1 -1
- package/loading/index.js +18 -18
- package/marquee/index.js +22 -22
- package/marquee-/index.js +22 -22
- package/mentions/index.js +1 -1
- package/menu/Menu.js +3 -3
- package/menu/OverflowWrap.js +2 -2
- package/menu/index.js +2 -2
- package/message/index.js +1 -1
- package/message/useMessage.js +1 -1
- package/modal/Confirm.js +2 -2
- package/modal/Modal.js +2 -2
- package/modal/index.js +2 -2
- package/notice/index.js +18 -18
- package/notification/index.js +1 -1
- package/notification/useNotification.js +1 -1
- package/overflow-ellipsis/OverflowItem.js +2 -2
- package/overflow-ellipsis/index.js +2 -2
- package/package.json +1 -1
- package/page-header/index.js +2 -2
- package/pagination/PageItem.js +1 -1
- package/pagination/PageJumper.js +1 -1
- package/pagination/PageOption.js +1 -1
- package/pagination/Pagination.js +1 -1
- package/picker/Input.js +1 -1
- package/picker/InputRange.js +1 -1
- package/popconfirm/index.js +1 -1
- package/popover/index.js +1 -1
- package/progress/CircleProgress.js +1 -1
- package/progress/index.js +1 -1
- package/qr-code/index.js +18 -18
- package/radio/Group.js +2 -2
- package/radio/GroupBlock.js +2 -2
- package/radio/Radio.js +2 -2
- package/radio/index.js +2 -2
- package/rate/index.js +1 -1
- package/resize-box/ResizeTrigger.js +2 -2
- package/resize-box/Split.js +2 -2
- package/resize-box/SplitGroup.js +1 -1
- package/resize-box/index.js +1 -1
- package/result/index.js +1 -1
- package/rich-text/core.js +1 -1
- package/rich-text/index.js +65 -128
- package/rich-text/rich.js +406 -936
- package/row-col/Col-.js +1 -1
- package/row-col/Col.js +71 -74
- package/row-col/Row.js +1 -1
- package/segmented/index.js +23 -23
- package/select/Option.js +1 -1
- package/select/Select.js +4 -4
- package/select-view/Core.js +1 -1
- package/skeleton/index.js +1 -1
- package/slider/Button.js +1 -1
- package/slider/index.js +1 -1
- package/space/index.js +18 -18
- package/spin/DotLoading.js +1 -1
- package/spin/index.js +1 -1
- package/splitter/Panel.js +1 -1
- package/splitter/SplitBar.js +2 -2
- package/splitter/Splitter.js +3 -3
- package/statistic/index.js +1 -1
- package/steps/index.js +1 -1
- package/style.css +1 -1
- package/switch/index.js +1 -1
- package/table/Table.js +61 -11
- package/table/index.js +4 -4
- package/tabs/Tab.js +3 -3
- package/tabs/TabContent.js +2 -2
- package/tabs/TabPane.js +1 -1
- package/tabs/index.js +2 -2
- package/tag/index.js +1 -1
- package/time-picker/Picker.js +1 -1
- package/time-picker/TimePicker.js +1 -1
- package/timeline/Item.js +1 -1
- package/timeline/Timeline.js +1 -1
- package/tooltip/index.js +1 -1
- package/tour/index.js +27 -27
- package/transfer/Item.js +2 -2
- package/transfer/List.js +2 -2
- package/transfer/index.js +1 -1
- package/tree/Animation.js +2 -2
- package/tree/Node.js +3 -3
- package/tree/NodeList.js +1 -1
- package/tree/Tree.js +2 -2
- package/tree/index.js +1 -1
- package/tree-select/Select.js +3 -3
- package/tree-select/index.js +1 -1
- package/trigger/index.js +2 -2
- package/types/common/hooks/src/use-size/index.d.ts +1 -1
- package/types/common/hooks/src/use-theme/index.d.ts +2 -2
- package/types/common/hooks/src/utils/isBrowser.d.ts +1 -1
- package/types/common/hooks/useResizeObserver.d.ts +1 -5
- package/types/common/hooks/useWindowSize.d.ts +1 -1
- package/types/common/utils/emitter.d.ts +1 -0
- package/types/common/utils/index.d.ts +1 -1
- package/types/pc/index.d.ts +1 -1
- package/types/pc/menu/context.d.ts +1 -1
- package/types/pc/rich-text/blots/scroll.d.ts +2 -8
- package/types/pc/rich-text/core/emitter.d.ts +2 -3
- package/types/pc/rich-text/core/rich.d.ts +11 -44
- package/types/pc/rich-text/core/selection.d.ts +1 -8
- package/types/pc/rich-text/core/theme.d.ts +3 -0
- package/types/pc/rich-text/parchment/blot/abstract/parent.d.ts +2 -4
- package/types/pc/rich-text/themes/base.d.ts +3 -0
- package/types/pc/rich-text/themes/{snow.d.ts → pqb.d.ts} +2 -2
- package/types/pc/rich-text/ui/tooltip.d.ts +2 -0
- package/types/pc/utils/emitter.d.ts +1 -0
- package/types/pc/utils/index.d.ts +1 -1
- package/typography/Base.js +2 -2
- package/typography/Ellipsis.js +3 -3
- package/typography/Operations.js +2 -2
- package/typography/Paragraph.js +1 -1
- package/typography/Typography.js +1 -1
- package/typography/useEllipsis.js +1 -1
- package/upload/TriggerNode.js +1 -1
- package/upload/Upload.js +1 -1
- package/utils/contextHolder.js +1 -1
- package/utils/emitter.js +5 -0
- package/utils/index.js +3 -3
- package/utils/resizeObserver.js +1 -1
- package/verification-code/VerificationCode.js +1 -1
- package/version/index.js +1 -1
- package/virtual-list/VirtualList.js +2 -2
- package/watermark/Watermark.js +1 -1
- package/chunk/BDgzrqDN.js +0 -154
- package/chunk/COc48wzV.js +0 -64
- package/chunk/COsRZOz1.js +0 -1813
- package/chunk/CylJZkp8.js +0 -6
- package/chunk/Di5KBCVQ.js +0 -4
- package/chunk/cW_5U6dL.js +0 -28
- package/rich-text/eventemitter/index.d.ts +0 -135
- package/types/common/utils/mitt.d.ts +0 -1
- package/types/pc/rich-text/eventemitter/index.d.ts +0 -101
- package/types/pc/rich-text/themes/bubble.d.ts +0 -18
- package/types/pc/utils/mitt.d.ts +0 -1
- package/utils/mitt.js +0 -5
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { useEffect as
|
|
1
|
+
import { useEffect as C, useState as b, useMemo as x, useRef as E, useLayoutEffect as Pe, useCallback as q } from "react";
|
|
2
2
|
import "./DsaQZE4X.js";
|
|
3
|
-
import { isFunction as k, isString as
|
|
4
|
-
import { g as
|
|
3
|
+
import { isFunction as k, isString as te, isNumber as F, isEqual as qe, isBoolean as Ve, isUndefined as Ue, isObject as $e } from "@unicom-cloud/utils/is";
|
|
4
|
+
import { g as D, u as L, d as U, b as W, i as We, s as Ge, e as Ke, f as Je } from "./DsuIQH0F.js";
|
|
5
5
|
import { a as y } from "./D1iEYgh3.js";
|
|
6
|
-
import { u as
|
|
7
|
-
import
|
|
6
|
+
import { u as ne } from "./BJeTDXdz.js";
|
|
7
|
+
import ce from "@unicom-cloud/utils/js-cookie";
|
|
8
8
|
import Qe from "dayjs";
|
|
9
|
-
import
|
|
10
|
-
import { i as
|
|
9
|
+
import Ce from "lodash/debounce";
|
|
10
|
+
import { i as re } from "./CdXR6dj7.js";
|
|
11
11
|
import { u as K, c as Ze } from "./DfChiMIE.js";
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import { u as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import * as
|
|
20
|
-
function
|
|
12
|
+
import { isBrowser as V, isAppleDevice as et } from "@unicom-cloud/utils/constant/platform";
|
|
13
|
+
import X from "@unicom-cloud/utils/screenfull";
|
|
14
|
+
import { a as De, u as tt } from "./CrOzsnI0.js";
|
|
15
|
+
import { u as se } from "./BO_5qdS_.js";
|
|
16
|
+
import Me from "lodash/throttle";
|
|
17
|
+
import de from "lodash/isPlainObject";
|
|
18
|
+
import ae from "@unicom-cloud/utils/query-string";
|
|
19
|
+
import * as nt from "react-router";
|
|
20
|
+
function rt(e) {
|
|
21
21
|
return k(e[Symbol.asyncIterator]);
|
|
22
22
|
}
|
|
23
23
|
function dn(e, t) {
|
|
24
|
-
|
|
24
|
+
C(() => {
|
|
25
25
|
const n = e();
|
|
26
26
|
let r = !1;
|
|
27
27
|
async function s() {
|
|
28
|
-
if (
|
|
28
|
+
if (rt(n))
|
|
29
29
|
for (; !((await n.next()).done || r); )
|
|
30
30
|
;
|
|
31
31
|
else
|
|
@@ -36,7 +36,7 @@ function dn(e, t) {
|
|
|
36
36
|
};
|
|
37
37
|
}, t);
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function st(e = !1, t) {
|
|
40
40
|
const [n, r] = b(e), s = x(() => {
|
|
41
41
|
const o = t === void 0 ? !e : t;
|
|
42
42
|
return {
|
|
@@ -48,39 +48,39 @@ function rt(e = !1, t) {
|
|
|
48
48
|
}, []);
|
|
49
49
|
return [n, s];
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
const [t, { toggle: n, set: r }] =
|
|
51
|
+
function ot(e = !1) {
|
|
52
|
+
const [t, { toggle: n, set: r }] = st(!!e), s = x(() => ({
|
|
53
53
|
toggle: n,
|
|
54
|
-
set: (
|
|
54
|
+
set: (c) => r(!!c),
|
|
55
55
|
setTrue: () => r(!0),
|
|
56
56
|
setFalse: () => r(!1)
|
|
57
57
|
}), []);
|
|
58
58
|
return [t, s];
|
|
59
59
|
}
|
|
60
|
-
const
|
|
61
|
-
const n =
|
|
60
|
+
const ct = (e) => e.every((t) => {
|
|
61
|
+
const n = D(t);
|
|
62
62
|
return n ? n.getRootNode() instanceof ShadowRoot : !1;
|
|
63
|
-
}),
|
|
63
|
+
}), at = (e) => e ? e.getRootNode() : document, ut = (e) => {
|
|
64
64
|
if (!e || !document.getRootNode)
|
|
65
65
|
return document;
|
|
66
66
|
const t = Array.isArray(e) ? e : [e];
|
|
67
|
-
return
|
|
67
|
+
return ct(t) ? at(D(t[0])) : document;
|
|
68
68
|
};
|
|
69
69
|
function mn(e, t, n = "click") {
|
|
70
|
-
const r =
|
|
71
|
-
|
|
70
|
+
const r = L(e);
|
|
71
|
+
U(
|
|
72
72
|
() => {
|
|
73
|
-
const s = (
|
|
73
|
+
const s = (c) => {
|
|
74
74
|
(Array.isArray(t) ? t : [t]).some((i) => {
|
|
75
|
-
const l =
|
|
76
|
-
return !l || l.contains(
|
|
77
|
-
}) || r.current(
|
|
78
|
-
}, o =
|
|
79
|
-
return
|
|
80
|
-
(
|
|
75
|
+
const l = D(i);
|
|
76
|
+
return !l || l.contains(c.target);
|
|
77
|
+
}) || r.current(c);
|
|
78
|
+
}, o = ut(t), a = Array.isArray(n) ? n : [n];
|
|
79
|
+
return a.forEach(
|
|
80
|
+
(c) => o.addEventListener(c, s)
|
|
81
81
|
), () => {
|
|
82
|
-
|
|
83
|
-
(
|
|
82
|
+
a.forEach(
|
|
83
|
+
(c) => o.removeEventListener(c, s)
|
|
84
84
|
);
|
|
85
85
|
};
|
|
86
86
|
},
|
|
@@ -93,101 +93,101 @@ function gn(e, t = {}) {
|
|
|
93
93
|
defaultValue: r,
|
|
94
94
|
defaultValuePropName: s = "defaultValue",
|
|
95
95
|
valuePropName: o = "value",
|
|
96
|
-
trigger:
|
|
97
|
-
} = t,
|
|
96
|
+
trigger: a = "onChange"
|
|
97
|
+
} = t, c = n[o], d = Object.prototype.hasOwnProperty.call(
|
|
98
98
|
n,
|
|
99
99
|
o
|
|
100
|
-
), i = x(() => d ?
|
|
101
|
-
d && (l.current =
|
|
102
|
-
const u =
|
|
100
|
+
), i = x(() => d ? c : Object.prototype.hasOwnProperty.call(n, s) ? n[s] : r, []), l = E(i);
|
|
101
|
+
d && (l.current = c);
|
|
102
|
+
const u = ne();
|
|
103
103
|
function m(h, ...p) {
|
|
104
104
|
const f = k(h) ? h(l.current) : h;
|
|
105
|
-
d || (l.current = f, u()), n[
|
|
105
|
+
d || (l.current = f, u()), n[a] && n[a](f, ...p);
|
|
106
106
|
}
|
|
107
107
|
return [l.current, y(m)];
|
|
108
108
|
}
|
|
109
109
|
function hn(e, t = {}) {
|
|
110
110
|
const [n, r] = b(() => {
|
|
111
|
-
const o =
|
|
112
|
-
return
|
|
111
|
+
const o = ce.get(e);
|
|
112
|
+
return te(o) ? o : k(t.defaultValue) ? t.defaultValue() : t.defaultValue;
|
|
113
113
|
}), s = y(
|
|
114
|
-
(o,
|
|
115
|
-
const { defaultValue:
|
|
116
|
-
r(i), i === void 0 ?
|
|
114
|
+
(o, a = {}) => {
|
|
115
|
+
const { defaultValue: c, ...d } = { ...t, ...a }, i = k(o) ? o(n) : o;
|
|
116
|
+
r(i), i === void 0 ? ce.remove(e) : ce.set(e, i, d);
|
|
117
117
|
}
|
|
118
118
|
);
|
|
119
119
|
return [n, s];
|
|
120
120
|
}
|
|
121
|
-
const
|
|
121
|
+
const ue = (e) => {
|
|
122
122
|
if (!e)
|
|
123
123
|
return 0;
|
|
124
124
|
const t = Qe(e).valueOf() - Date.now();
|
|
125
125
|
return t < 0 ? 0 : t;
|
|
126
|
-
},
|
|
126
|
+
}, it = (e) => ({
|
|
127
127
|
days: Math.floor(e / 864e5),
|
|
128
128
|
hours: Math.floor(e / 36e5) % 24,
|
|
129
129
|
minutes: Math.floor(e / 6e4) % 60,
|
|
130
130
|
seconds: Math.floor(e / 1e3) % 60,
|
|
131
131
|
milliseconds: Math.floor(e) % 1e3
|
|
132
132
|
}), pn = (e = {}) => {
|
|
133
|
-
const { leftTime: t, targetDate: n, interval: r = 1e3, onEnd: s } = e || {}, o = x(() => F(t) && t > 0 ? Date.now() + t : void 0, [t]),
|
|
134
|
-
|
|
135
|
-
if (!
|
|
133
|
+
const { leftTime: t, targetDate: n, interval: r = 1e3, onEnd: s } = e || {}, o = x(() => F(t) && t > 0 ? Date.now() + t : void 0, [t]), a = "leftTime" in e ? o : n, [c, d] = b(() => ue(a)), i = L(s);
|
|
134
|
+
C(() => {
|
|
135
|
+
if (!a) {
|
|
136
136
|
d(0);
|
|
137
137
|
return;
|
|
138
138
|
}
|
|
139
|
-
d(
|
|
139
|
+
d(ue(a));
|
|
140
140
|
const u = setInterval(() => {
|
|
141
|
-
const m =
|
|
141
|
+
const m = ue(a);
|
|
142
142
|
d(m), m === 0 && (clearInterval(u), i.current?.());
|
|
143
143
|
}, r);
|
|
144
144
|
return () => clearInterval(u);
|
|
145
|
-
}, [
|
|
146
|
-
const l = x(() =>
|
|
147
|
-
return [
|
|
145
|
+
}, [a, r]);
|
|
146
|
+
const l = x(() => it(c), [c]);
|
|
147
|
+
return [c, l];
|
|
148
148
|
};
|
|
149
|
-
function
|
|
149
|
+
function ye(e, t = {}) {
|
|
150
150
|
const { min: n, max: r } = t;
|
|
151
151
|
let s = e;
|
|
152
152
|
return F(r) && (s = Math.min(r, s)), F(n) && (s = Math.max(n, s)), s;
|
|
153
153
|
}
|
|
154
154
|
function vn(e = 0, t = {}) {
|
|
155
|
-
const { min: n, max: r } = t, [s, o] = b(() =>
|
|
155
|
+
const { min: n, max: r } = t, [s, o] = b(() => ye(e, {
|
|
156
156
|
min: n,
|
|
157
157
|
max: r
|
|
158
|
-
})),
|
|
158
|
+
})), a = (u) => {
|
|
159
159
|
o((m) => {
|
|
160
160
|
const h = F(u) ? u : u(m);
|
|
161
|
-
return
|
|
161
|
+
return ye(h, {
|
|
162
162
|
max: r,
|
|
163
163
|
min: n
|
|
164
164
|
});
|
|
165
165
|
});
|
|
166
|
-
},
|
|
167
|
-
|
|
166
|
+
}, c = (u = 1) => {
|
|
167
|
+
a((m) => m + u);
|
|
168
168
|
}, d = (u = 1) => {
|
|
169
|
-
|
|
169
|
+
a((m) => m - u);
|
|
170
170
|
}, i = (u) => {
|
|
171
|
-
|
|
171
|
+
a(u);
|
|
172
172
|
}, l = () => {
|
|
173
|
-
|
|
173
|
+
a(e);
|
|
174
174
|
};
|
|
175
175
|
return [
|
|
176
176
|
s,
|
|
177
177
|
{
|
|
178
|
-
inc: y(
|
|
178
|
+
inc: y(c),
|
|
179
179
|
dec: y(d),
|
|
180
180
|
set: y(i),
|
|
181
181
|
reset: y(l)
|
|
182
182
|
}
|
|
183
183
|
];
|
|
184
184
|
}
|
|
185
|
-
function
|
|
186
|
-
|
|
185
|
+
function Ne(e, t) {
|
|
186
|
+
re && (k(e) || console.error(
|
|
187
187
|
`useDebounceFn expected parameter is a function, got ${typeof e}`
|
|
188
188
|
));
|
|
189
|
-
const n =
|
|
190
|
-
() =>
|
|
189
|
+
const n = L(e), r = t?.wait ?? 1e3, s = x(
|
|
190
|
+
() => Ce(
|
|
191
191
|
(...o) => n.current(...o),
|
|
192
192
|
r,
|
|
193
193
|
t
|
|
@@ -203,42 +203,42 @@ function Me(e, t) {
|
|
|
203
203
|
};
|
|
204
204
|
}
|
|
205
205
|
function yn(e, t) {
|
|
206
|
-
const [n, r] = b(e), { run: s } =
|
|
206
|
+
const [n, r] = b(e), { run: s } = Ne(() => {
|
|
207
207
|
r(e);
|
|
208
208
|
}, t);
|
|
209
|
-
return
|
|
209
|
+
return C(() => {
|
|
210
210
|
s();
|
|
211
211
|
}, [e]), n;
|
|
212
212
|
}
|
|
213
213
|
function En(e, t, n) {
|
|
214
|
-
const [r, s] = b({}), { run: o } =
|
|
214
|
+
const [r, s] = b({}), { run: o } = Ne(() => {
|
|
215
215
|
s({});
|
|
216
216
|
}, n);
|
|
217
|
-
|
|
217
|
+
C(() => o(), t), K(e, [r]);
|
|
218
218
|
}
|
|
219
|
-
const
|
|
219
|
+
const Oe = (e = [], t = []) => qe(e, t), xe = (e) => (t, n) => {
|
|
220
220
|
const r = E(void 0), s = E(0);
|
|
221
|
-
(n === void 0 || !
|
|
222
|
-
},
|
|
223
|
-
function
|
|
224
|
-
const { enable: r = !0 } = n, s =
|
|
225
|
-
|
|
221
|
+
(n === void 0 || !Oe(n, r.current)) && (s.current += 1), r.current = n, e(t, [s.current]);
|
|
222
|
+
}, Sn = xe(C), wn = xe(Pe);
|
|
223
|
+
function j(e, t, n = {}) {
|
|
224
|
+
const { enable: r = !0 } = n, s = L(t);
|
|
225
|
+
U(
|
|
226
226
|
() => {
|
|
227
227
|
if (!r)
|
|
228
228
|
return;
|
|
229
|
-
const o =
|
|
229
|
+
const o = D(n.target, window);
|
|
230
230
|
if (!o?.addEventListener)
|
|
231
231
|
return;
|
|
232
|
-
const
|
|
233
|
-
return
|
|
234
|
-
o.addEventListener(d,
|
|
232
|
+
const a = (d) => s.current(d), c = Array.isArray(e) ? e : [e];
|
|
233
|
+
return c.forEach((d) => {
|
|
234
|
+
o.addEventListener(d, a, {
|
|
235
235
|
capture: n.capture,
|
|
236
236
|
once: n.once,
|
|
237
237
|
passive: n.passive
|
|
238
238
|
});
|
|
239
239
|
}), () => {
|
|
240
|
-
|
|
241
|
-
o.removeEventListener(d,
|
|
240
|
+
c.forEach((d) => {
|
|
241
|
+
o.removeEventListener(d, a, {
|
|
242
242
|
capture: n.capture
|
|
243
243
|
});
|
|
244
244
|
});
|
|
@@ -248,42 +248,42 @@ function X(e, t, n = {}) {
|
|
|
248
248
|
n.target
|
|
249
249
|
);
|
|
250
250
|
}
|
|
251
|
-
const
|
|
251
|
+
const Ee = () => V ? document.visibilityState : "visible";
|
|
252
252
|
function bn() {
|
|
253
|
-
const [e, t] = b(
|
|
254
|
-
return
|
|
253
|
+
const [e, t] = b(Ee);
|
|
254
|
+
return j(
|
|
255
255
|
"visibilitychange",
|
|
256
256
|
() => {
|
|
257
|
-
t(
|
|
257
|
+
t(Ee());
|
|
258
258
|
},
|
|
259
259
|
{
|
|
260
260
|
target: () => document
|
|
261
261
|
}
|
|
262
262
|
), e;
|
|
263
263
|
}
|
|
264
|
-
const
|
|
265
|
-
|
|
264
|
+
const Fe = (e) => {
|
|
265
|
+
re && (k(e) || console.error(
|
|
266
266
|
`useMount: parameter \`fn\` expected to be a function, but got "${typeof e}".`
|
|
267
|
-
)),
|
|
267
|
+
)), C(() => e?.(), []);
|
|
268
268
|
}, Rn = (e, t, n = {}) => {
|
|
269
|
-
const r =
|
|
270
|
-
|
|
271
|
-
if (
|
|
272
|
-
const { image:
|
|
273
|
-
if (
|
|
269
|
+
const r = L(n), s = L(e), o = E(void 0), { dragImage: a } = r.current;
|
|
270
|
+
Fe(() => {
|
|
271
|
+
if (a?.image) {
|
|
272
|
+
const { image: c } = a;
|
|
273
|
+
if (te(c)) {
|
|
274
274
|
const d = new Image();
|
|
275
|
-
d.src =
|
|
275
|
+
d.src = c, o.current = d;
|
|
276
276
|
} else
|
|
277
|
-
o.current =
|
|
277
|
+
o.current = c;
|
|
278
278
|
}
|
|
279
|
-
}),
|
|
279
|
+
}), U(
|
|
280
280
|
() => {
|
|
281
|
-
const
|
|
282
|
-
if (!
|
|
281
|
+
const c = D(t);
|
|
282
|
+
if (!c?.addEventListener)
|
|
283
283
|
return;
|
|
284
284
|
const d = (l) => {
|
|
285
|
-
if (r.current.onDragStart?.(l), l.dataTransfer.setData("custom", JSON.stringify(s.current)),
|
|
286
|
-
const { offsetX: u = 0, offsetY: m = 0 } =
|
|
285
|
+
if (r.current.onDragStart?.(l), l.dataTransfer.setData("custom", JSON.stringify(s.current)), a?.image && o.current) {
|
|
286
|
+
const { offsetX: u = 0, offsetY: m = 0 } = a;
|
|
287
287
|
l.dataTransfer.setDragImage(
|
|
288
288
|
o.current,
|
|
289
289
|
u,
|
|
@@ -293,18 +293,18 @@ const xe = (e) => {
|
|
|
293
293
|
}, i = (l) => {
|
|
294
294
|
r.current.onDragEnd?.(l);
|
|
295
295
|
};
|
|
296
|
-
return
|
|
297
|
-
|
|
296
|
+
return c.setAttribute("draggable", "true"), c.addEventListener("dragstart", d), c.addEventListener("dragend", i), () => {
|
|
297
|
+
c.removeEventListener("dragstart", d), c.removeEventListener("dragend", i);
|
|
298
298
|
};
|
|
299
299
|
},
|
|
300
300
|
[],
|
|
301
301
|
t
|
|
302
302
|
);
|
|
303
303
|
}, Tn = (e, t = {}) => {
|
|
304
|
-
const n =
|
|
305
|
-
|
|
304
|
+
const n = L(t), r = E(void 0);
|
|
305
|
+
U(
|
|
306
306
|
() => {
|
|
307
|
-
const s =
|
|
307
|
+
const s = D(e);
|
|
308
308
|
if (!s?.addEventListener)
|
|
309
309
|
return;
|
|
310
310
|
const o = (u, m) => {
|
|
@@ -333,9 +333,9 @@ const xe = (e) => {
|
|
|
333
333
|
u.items && u.items.length && n.current.onText && u.items[0].getAsString((f) => {
|
|
334
334
|
n.current.onText(f, m);
|
|
335
335
|
});
|
|
336
|
-
}, c = (u) => {
|
|
337
|
-
u.preventDefault(), u.stopPropagation(), r.current = u.target, n.current.onDragEnter?.(u);
|
|
338
336
|
}, a = (u) => {
|
|
337
|
+
u.preventDefault(), u.stopPropagation(), r.current = u.target, n.current.onDragEnter?.(u);
|
|
338
|
+
}, c = (u) => {
|
|
339
339
|
u.preventDefault(), n.current.onDragOver?.(u);
|
|
340
340
|
}, d = (u) => {
|
|
341
341
|
u.target === r.current && n.current.onDragLeave?.(u);
|
|
@@ -344,54 +344,113 @@ const xe = (e) => {
|
|
|
344
344
|
}, l = (u) => {
|
|
345
345
|
o(u.clipboardData, u), n.current.onPaste?.(u);
|
|
346
346
|
};
|
|
347
|
-
return s.addEventListener("dragenter",
|
|
348
|
-
s.removeEventListener("dragenter",
|
|
347
|
+
return s.addEventListener("dragenter", a), s.addEventListener("dragover", c), s.addEventListener("dragleave", d), s.addEventListener("drop", i), s.addEventListener("paste", l), () => {
|
|
348
|
+
s.removeEventListener("dragenter", a), s.removeEventListener("dragover", c), s.removeEventListener("dragleave", d), s.removeEventListener("drop", i), s.removeEventListener("paste", l);
|
|
349
349
|
};
|
|
350
350
|
},
|
|
351
351
|
[],
|
|
352
352
|
e
|
|
353
353
|
);
|
|
354
354
|
};
|
|
355
|
-
function
|
|
356
|
-
const { initialValue: t, transformer: n } = e || {}, [r, s] = b(t), o =
|
|
355
|
+
function Ln(e) {
|
|
356
|
+
const { initialValue: t, transformer: n } = e || {}, [r, s] = b(t), o = L(n), a = q(() => s(t), []), c = q((d) => {
|
|
357
357
|
const i = d.target.value;
|
|
358
358
|
return k(o.current) ? s(o.current(i)) : s(i);
|
|
359
359
|
}, []);
|
|
360
360
|
return [
|
|
361
361
|
r,
|
|
362
362
|
{
|
|
363
|
-
onChange:
|
|
364
|
-
reset:
|
|
363
|
+
onChange: c,
|
|
364
|
+
reset: a
|
|
365
365
|
}
|
|
366
366
|
];
|
|
367
367
|
}
|
|
368
|
-
const
|
|
368
|
+
const J = {}, lt = (e, t = {}) => {
|
|
369
|
+
const n = document.querySelector(`script[src="${e}"]`);
|
|
370
|
+
if (!n) {
|
|
371
|
+
const r = document.createElement("script");
|
|
372
|
+
return r.src = e, Object.keys(t).forEach((s) => {
|
|
373
|
+
r[s] = t[s];
|
|
374
|
+
}), r.setAttribute("data-status", "loading"), document.body.appendChild(r), {
|
|
375
|
+
ref: r,
|
|
376
|
+
status: "loading"
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
return {
|
|
380
|
+
ref: n,
|
|
381
|
+
status: n.getAttribute("data-status") || "ready"
|
|
382
|
+
};
|
|
383
|
+
}, ft = (e, t = {}) => {
|
|
384
|
+
const n = document.querySelector(`link[href="${e}"]`);
|
|
385
|
+
if (!n) {
|
|
386
|
+
const r = document.createElement("link");
|
|
387
|
+
return r.rel = "stylesheet", r.href = e, Object.keys(t).forEach((o) => {
|
|
388
|
+
r[o] = t[o];
|
|
389
|
+
}), "hideFocus" in r && r.relList && (r.rel = "preload", r.as = "style"), r.setAttribute("data-status", "loading"), document.head.appendChild(r), {
|
|
390
|
+
ref: r,
|
|
391
|
+
status: "loading"
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
return {
|
|
395
|
+
ref: n,
|
|
396
|
+
status: n.getAttribute("data-status") || "ready"
|
|
397
|
+
};
|
|
398
|
+
}, An = (e, t) => {
|
|
399
|
+
const [n, r] = b(e ? "loading" : "unset"), s = E(void 0);
|
|
400
|
+
return C(() => {
|
|
401
|
+
if (!e) {
|
|
402
|
+
r("unset");
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
const o = e.replace(/[|#].*$/, "");
|
|
406
|
+
if (t?.type === "css" || !t?.type && /(^css!|\.css$)/.test(o)) {
|
|
407
|
+
const c = ft(e, t?.css);
|
|
408
|
+
s.current = c.ref, r(c.status);
|
|
409
|
+
} else if (t?.type === "js" || !t?.type && /(^js!|\.js$)/.test(o)) {
|
|
410
|
+
const c = lt(e, t?.js);
|
|
411
|
+
s.current = c.ref, r(c.status);
|
|
412
|
+
} else
|
|
413
|
+
console.error(
|
|
414
|
+
"Cannot infer the type of external resource, and please provide a type ('js' | 'css'). "
|
|
415
|
+
);
|
|
416
|
+
if (!s.current)
|
|
417
|
+
return;
|
|
418
|
+
J[e] === void 0 ? J[e] = 1 : J[e] += 1;
|
|
419
|
+
const a = (c) => {
|
|
420
|
+
const d = c.type === "load" ? "ready" : "error";
|
|
421
|
+
s.current?.setAttribute("data-status", d), r(d);
|
|
422
|
+
};
|
|
423
|
+
return s.current.addEventListener("load", a), s.current.addEventListener("error", a), () => {
|
|
424
|
+
s.current?.removeEventListener("load", a), s.current?.removeEventListener("error", a), J[e] -= 1, J[e] === 0 && !t?.keepWhenUnused && s.current?.remove(), s.current = void 0;
|
|
425
|
+
};
|
|
426
|
+
}, [e]), n;
|
|
427
|
+
}, dt = {
|
|
369
428
|
SVG: "image/svg+xml",
|
|
370
429
|
ICO: "image/x-icon",
|
|
371
430
|
GIF: "image/gif",
|
|
372
431
|
PNG: "image/png"
|
|
373
432
|
}, Pn = (e) => {
|
|
374
|
-
|
|
433
|
+
C(() => {
|
|
375
434
|
if (!e)
|
|
376
435
|
return;
|
|
377
436
|
const t = e.split("."), n = t[t.length - 1].toLocaleUpperCase(), r = document.querySelector("link[rel*='icon']") || document.createElement("link");
|
|
378
|
-
r.type =
|
|
437
|
+
r.type = dt[n], r.href = e, r.rel = "shortcut icon", document.getElementsByTagName("head")[0].appendChild(r);
|
|
379
438
|
}, [e]);
|
|
380
439
|
};
|
|
381
|
-
function
|
|
382
|
-
const [n, r] = b(!1), { onFocus: s, onBlur: o, onChange:
|
|
383
|
-
return
|
|
440
|
+
function Cn(e, t) {
|
|
441
|
+
const [n, r] = b(!1), { onFocus: s, onBlur: o, onChange: a } = t || {};
|
|
442
|
+
return j(
|
|
384
443
|
"focusin",
|
|
385
|
-
(
|
|
386
|
-
n || (s?.(
|
|
444
|
+
(c) => {
|
|
445
|
+
n || (s?.(c), a?.(!0), r(!0));
|
|
387
446
|
},
|
|
388
447
|
{
|
|
389
448
|
target: e
|
|
390
449
|
}
|
|
391
|
-
),
|
|
450
|
+
), j(
|
|
392
451
|
"focusout",
|
|
393
|
-
(
|
|
394
|
-
n && !
|
|
452
|
+
(c) => {
|
|
453
|
+
n && !c.currentTarget?.contains?.(c.relatedTarget) && (o?.(c), a?.(!1), r(!1));
|
|
395
454
|
},
|
|
396
455
|
{
|
|
397
456
|
target: e
|
|
@@ -399,92 +458,92 @@ function Ln(e, t) {
|
|
|
399
458
|
), n;
|
|
400
459
|
}
|
|
401
460
|
const Dn = (e, t) => {
|
|
402
|
-
const { onExit: n, onEnter: r, pageFullscreen: s = !1 } = t || {}, { className: o = "@unicom-cloud-ui-hooks-page-fullscreen", zIndex:
|
|
461
|
+
const { onExit: n, onEnter: r, pageFullscreen: s = !1 } = t || {}, { className: o = "@unicom-cloud-ui-hooks-page-fullscreen", zIndex: a = 999999 } = Ve(s) || !s ? {} : s, c = L(n), d = L(r), [i, l] = b(m), u = E(m());
|
|
403
462
|
function m() {
|
|
404
|
-
return
|
|
463
|
+
return X.isEnabled && !!X.element && X.element === D(e);
|
|
405
464
|
}
|
|
406
465
|
const h = (v) => {
|
|
407
|
-
v ? d.current?.() :
|
|
466
|
+
v ? d.current?.() : c.current?.();
|
|
408
467
|
}, p = (v) => {
|
|
409
468
|
u.current !== v && (h(v), l(v), u.current = v);
|
|
410
469
|
}, f = () => {
|
|
411
470
|
const v = m();
|
|
412
471
|
p(v);
|
|
413
472
|
}, T = (v) => {
|
|
414
|
-
const
|
|
415
|
-
if (!
|
|
473
|
+
const S = D(e);
|
|
474
|
+
if (!S)
|
|
416
475
|
return;
|
|
417
476
|
let R = document.getElementById(o);
|
|
418
|
-
v ? (
|
|
477
|
+
v ? (S.classList.add(o), R || (R = document.createElement("style"), R.setAttribute("id", o), R.textContent = `
|
|
419
478
|
.${o} {
|
|
420
479
|
position: fixed; left: 0; top: 0; right: 0; bottom: 0;
|
|
421
480
|
width: 100% !important; height: 100% !important;
|
|
422
|
-
z-index: ${
|
|
423
|
-
}`,
|
|
424
|
-
},
|
|
425
|
-
const v =
|
|
481
|
+
z-index: ${a};
|
|
482
|
+
}`, S.appendChild(R))) : (S.classList.remove(o), R && R.remove()), p(v);
|
|
483
|
+
}, A = () => {
|
|
484
|
+
const v = D(e);
|
|
426
485
|
if (v) {
|
|
427
486
|
if (s) {
|
|
428
487
|
T(!0);
|
|
429
488
|
return;
|
|
430
489
|
}
|
|
431
|
-
if (
|
|
490
|
+
if (X.isEnabled)
|
|
432
491
|
try {
|
|
433
|
-
|
|
434
|
-
} catch (
|
|
435
|
-
console.error(
|
|
492
|
+
X.request(v);
|
|
493
|
+
} catch (S) {
|
|
494
|
+
console.error(S);
|
|
436
495
|
}
|
|
437
496
|
}
|
|
438
497
|
}, O = () => {
|
|
439
|
-
const v =
|
|
498
|
+
const v = D(e);
|
|
440
499
|
if (v) {
|
|
441
500
|
if (s) {
|
|
442
501
|
T(!1);
|
|
443
502
|
return;
|
|
444
503
|
}
|
|
445
|
-
|
|
504
|
+
X.isEnabled && X.element === v && X.exit();
|
|
446
505
|
}
|
|
447
506
|
}, g = () => {
|
|
448
|
-
i ? O() :
|
|
507
|
+
i ? O() : A();
|
|
449
508
|
};
|
|
450
|
-
return
|
|
451
|
-
if (!(!
|
|
452
|
-
return
|
|
453
|
-
|
|
509
|
+
return C(() => {
|
|
510
|
+
if (!(!X.isEnabled || s))
|
|
511
|
+
return X.on("change", f), () => {
|
|
512
|
+
X.off("change", f);
|
|
454
513
|
};
|
|
455
514
|
}, []), [
|
|
456
515
|
i,
|
|
457
516
|
{
|
|
458
|
-
enterFullscreen: y(
|
|
517
|
+
enterFullscreen: y(A),
|
|
459
518
|
exitFullscreen: y(O),
|
|
460
519
|
toggleFullscreen: y(g),
|
|
461
|
-
isEnabled:
|
|
520
|
+
isEnabled: X.isEnabled
|
|
462
521
|
}
|
|
463
522
|
];
|
|
464
523
|
};
|
|
465
|
-
function
|
|
466
|
-
const [t, n] = b(e), r =
|
|
524
|
+
function Mn(e) {
|
|
525
|
+
const [t, n] = b(e), r = L(t), s = q(() => r.current, []);
|
|
467
526
|
return [t, n, s];
|
|
468
527
|
}
|
|
469
|
-
const
|
|
528
|
+
const mt = (e, t) => {
|
|
470
529
|
let n = e > 0 ? e - 1 : t.length + e;
|
|
471
530
|
return n >= t.length - 1 && (n = t.length - 1), n < 0 && (n = 0), n;
|
|
472
531
|
}, Se = (e, t) => {
|
|
473
|
-
const n =
|
|
532
|
+
const n = mt(e, t);
|
|
474
533
|
return {
|
|
475
534
|
_current: t[n],
|
|
476
535
|
_before: t.slice(0, n),
|
|
477
536
|
_after: t.slice(n + 1)
|
|
478
537
|
};
|
|
479
538
|
};
|
|
480
|
-
function
|
|
539
|
+
function Nn(e, t = 0) {
|
|
481
540
|
const [n, r] = b({
|
|
482
541
|
present: e,
|
|
483
542
|
past: [],
|
|
484
543
|
future: []
|
|
485
|
-
}), { present: s, past: o, future:
|
|
486
|
-
const p = h.length > 0 ? h[0] :
|
|
487
|
-
|
|
544
|
+
}), { present: s, past: o, future: a } = n, c = E(e), d = (...h) => {
|
|
545
|
+
const p = h.length > 0 ? h[0] : c.current;
|
|
546
|
+
c.current = p, r({
|
|
488
547
|
present: p,
|
|
489
548
|
future: [],
|
|
490
549
|
past: []
|
|
@@ -497,9 +556,9 @@ function Mn(e, t = 0) {
|
|
|
497
556
|
past: p
|
|
498
557
|
});
|
|
499
558
|
}, l = (h = 1) => {
|
|
500
|
-
if (
|
|
559
|
+
if (a.length === 0)
|
|
501
560
|
return;
|
|
502
|
-
const { _before: p, _current: f, _after: T } = Se(h,
|
|
561
|
+
const { _before: p, _current: f, _after: T } = Se(h, a);
|
|
503
562
|
r({
|
|
504
563
|
past: [...o, s, ...p],
|
|
505
564
|
present: f,
|
|
@@ -512,7 +571,7 @@ function Mn(e, t = 0) {
|
|
|
512
571
|
r({
|
|
513
572
|
past: p,
|
|
514
573
|
present: f,
|
|
515
|
-
future: [...T, s, ...
|
|
574
|
+
future: [...T, s, ...a]
|
|
516
575
|
});
|
|
517
576
|
}, m = (h) => {
|
|
518
577
|
const p = F(h) ? h : Number(h);
|
|
@@ -525,7 +584,7 @@ function Mn(e, t = 0) {
|
|
|
525
584
|
return {
|
|
526
585
|
value: s,
|
|
527
586
|
backLength: o.length,
|
|
528
|
-
forwardLength:
|
|
587
|
+
forwardLength: a.length,
|
|
529
588
|
setValue: y(i),
|
|
530
589
|
go: y(m),
|
|
531
590
|
back: y(() => {
|
|
@@ -537,41 +596,41 @@ function Mn(e, t = 0) {
|
|
|
537
596
|
reset: y(d)
|
|
538
597
|
};
|
|
539
598
|
}
|
|
540
|
-
const
|
|
541
|
-
const { onEnter: n, onLeave: r, onChange: s } = t || {}, [o, { setTrue:
|
|
542
|
-
return
|
|
599
|
+
const On = (e, t) => {
|
|
600
|
+
const { onEnter: n, onLeave: r, onChange: s } = t || {}, [o, { setTrue: a, setFalse: c }] = ot(!1);
|
|
601
|
+
return j(
|
|
543
602
|
"mouseenter",
|
|
544
603
|
() => {
|
|
545
|
-
n?.(),
|
|
604
|
+
n?.(), a(), s?.(!0);
|
|
546
605
|
},
|
|
547
606
|
{
|
|
548
607
|
target: e
|
|
549
608
|
}
|
|
550
|
-
),
|
|
609
|
+
), j(
|
|
551
610
|
"mouseleave",
|
|
552
611
|
() => {
|
|
553
|
-
r?.(),
|
|
612
|
+
r?.(), c(), s?.(!1);
|
|
554
613
|
},
|
|
555
614
|
{
|
|
556
615
|
target: e
|
|
557
616
|
}
|
|
558
617
|
), o;
|
|
559
618
|
};
|
|
560
|
-
function
|
|
561
|
-
const { callback: n, ...r } = t || {}, [s, o] = b(), [
|
|
562
|
-
return
|
|
619
|
+
function xn(e, t) {
|
|
620
|
+
const { callback: n, ...r } = t || {}, [s, o] = b(), [a, c] = b();
|
|
621
|
+
return U(
|
|
563
622
|
() => {
|
|
564
|
-
const i = (Array.isArray(e) ? e : [e]).map((u) =>
|
|
623
|
+
const i = (Array.isArray(e) ? e : [e]).map((u) => D(u)).filter(Boolean);
|
|
565
624
|
if (!i.length)
|
|
566
625
|
return;
|
|
567
626
|
const l = new IntersectionObserver(
|
|
568
627
|
(u) => {
|
|
569
628
|
for (const m of u)
|
|
570
|
-
|
|
629
|
+
c(m.intersectionRatio), o(m.isIntersecting), n?.(m);
|
|
571
630
|
},
|
|
572
631
|
{
|
|
573
632
|
...r,
|
|
574
|
-
root:
|
|
633
|
+
root: D(t?.root)
|
|
575
634
|
}
|
|
576
635
|
);
|
|
577
636
|
return i.forEach((u) => l.observe(u)), () => {
|
|
@@ -580,9 +639,9 @@ function On(e, t) {
|
|
|
580
639
|
},
|
|
581
640
|
[t?.rootMargin, t?.threshold, n],
|
|
582
641
|
e
|
|
583
|
-
), [s,
|
|
642
|
+
), [s, a];
|
|
584
643
|
}
|
|
585
|
-
const G = /* @__PURE__ */ new Map(),
|
|
644
|
+
const G = /* @__PURE__ */ new Map(), gt = (e, t, n) => {
|
|
586
645
|
const r = G.get(e);
|
|
587
646
|
r?.timer && clearTimeout(r.timer);
|
|
588
647
|
let s;
|
|
@@ -592,36 +651,36 @@ const G = /* @__PURE__ */ new Map(), ft = (e, t, n) => {
|
|
|
592
651
|
...n,
|
|
593
652
|
timer: s
|
|
594
653
|
});
|
|
595
|
-
},
|
|
654
|
+
}, ht = (e) => G.get(e), Fn = (e) => {
|
|
596
655
|
e ? (Array.isArray(e) ? e : [e]).forEach((n) => G.delete(n)) : G.clear();
|
|
597
|
-
},
|
|
598
|
-
|
|
599
|
-
|
|
656
|
+
}, Z = /* @__PURE__ */ new Map(), pt = (e) => Z.get(e), vt = (e, t) => {
|
|
657
|
+
Z.set(e, t), t.then((n) => (Z.delete(e), n)).catch(() => {
|
|
658
|
+
Z.delete(e);
|
|
600
659
|
});
|
|
601
|
-
}, $ = {},
|
|
660
|
+
}, $ = {}, yt = (e, t) => {
|
|
602
661
|
$[e] && $[e].forEach((n) => n(t));
|
|
603
|
-
},
|
|
662
|
+
}, ie = (e, t) => ($[e] || ($[e] = []), $[e].push(t), function() {
|
|
604
663
|
const r = $[e].indexOf(t);
|
|
605
664
|
$[e].splice(r, 1);
|
|
606
|
-
}),
|
|
665
|
+
}), Et = (e, {
|
|
607
666
|
cacheKey: t,
|
|
608
667
|
cacheTime: n = 300 * 1e3,
|
|
609
668
|
staleTime: r = 0,
|
|
610
669
|
setCache: s,
|
|
611
670
|
getCache: o
|
|
612
671
|
}) => {
|
|
613
|
-
const
|
|
614
|
-
s ? s(u) :
|
|
615
|
-
}, i = (l, u = []) => o ? o(u) :
|
|
616
|
-
return
|
|
672
|
+
const a = E(void 0), c = E(void 0), d = (l, u) => {
|
|
673
|
+
s ? s(u) : gt(l, n, u), yt(l, u.data);
|
|
674
|
+
}, i = (l, u = []) => o ? o(u) : ht(l);
|
|
675
|
+
return se(() => {
|
|
617
676
|
if (!t)
|
|
618
677
|
return;
|
|
619
678
|
const l = i(t);
|
|
620
|
-
l && Object.hasOwnProperty.call(l, "data") && (e.state.data = l.data, e.state.params = l.params, (r === -1 || Date.now() - l.time <= r) && (e.state.loading = !1)),
|
|
679
|
+
l && Object.hasOwnProperty.call(l, "data") && (e.state.data = l.data, e.state.params = l.params, (r === -1 || Date.now() - l.time <= r) && (e.state.loading = !1)), a.current = ie(t, (u) => {
|
|
621
680
|
e.setState({ data: u });
|
|
622
681
|
});
|
|
623
682
|
}, []), W(() => {
|
|
624
|
-
|
|
683
|
+
a.current?.();
|
|
625
684
|
}), t ? {
|
|
626
685
|
onBefore: (l) => {
|
|
627
686
|
const u = i(t, l);
|
|
@@ -636,56 +695,56 @@ const G = /* @__PURE__ */ new Map(), ft = (e, t, n) => {
|
|
|
636
695
|
};
|
|
637
696
|
},
|
|
638
697
|
onRequest: (l, u) => {
|
|
639
|
-
let m =
|
|
640
|
-
return m && m !==
|
|
698
|
+
let m = pt(t);
|
|
699
|
+
return m && m !== c.current ? { servicePromise: m } : (m = l(...u), c.current = m, vt(t, m), { servicePromise: m });
|
|
641
700
|
},
|
|
642
701
|
onSuccess: (l, u) => {
|
|
643
|
-
t && (
|
|
702
|
+
t && (a.current?.(), d(t, {
|
|
644
703
|
data: l,
|
|
645
704
|
params: u,
|
|
646
705
|
time: Date.now()
|
|
647
|
-
}),
|
|
706
|
+
}), a.current = ie(t, (m) => {
|
|
648
707
|
e.setState({ data: m });
|
|
649
708
|
}));
|
|
650
709
|
},
|
|
651
710
|
onMutate: (l) => {
|
|
652
|
-
t && (
|
|
711
|
+
t && (a.current?.(), d(t, {
|
|
653
712
|
data: l,
|
|
654
713
|
params: e.state.params,
|
|
655
714
|
time: Date.now()
|
|
656
|
-
}),
|
|
715
|
+
}), a.current = ie(t, (u) => {
|
|
657
716
|
e.setState({ data: u });
|
|
658
717
|
}));
|
|
659
718
|
}
|
|
660
719
|
} : {};
|
|
661
|
-
},
|
|
662
|
-
const o = E(void 0),
|
|
663
|
-
const
|
|
664
|
-
return n !== void 0 && (
|
|
720
|
+
}, St = (e, { debounceWait: t, debounceLeading: n, debounceTrailing: r, debounceMaxWait: s }) => {
|
|
721
|
+
const o = E(void 0), a = x(() => {
|
|
722
|
+
const c = {};
|
|
723
|
+
return n !== void 0 && (c.leading = n), r !== void 0 && (c.trailing = r), s !== void 0 && (c.maxWait = s), c;
|
|
665
724
|
}, [n, r, s]);
|
|
666
|
-
return
|
|
725
|
+
return C(() => {
|
|
667
726
|
if (t) {
|
|
668
|
-
const
|
|
669
|
-
return o.current =
|
|
727
|
+
const c = e.runAsync.bind(e);
|
|
728
|
+
return o.current = Ce(
|
|
670
729
|
(d) => {
|
|
671
730
|
d();
|
|
672
731
|
},
|
|
673
732
|
t,
|
|
674
|
-
|
|
733
|
+
a
|
|
675
734
|
), e.runAsync = (...d) => new Promise((i, l) => {
|
|
676
735
|
o.current?.(() => {
|
|
677
|
-
|
|
736
|
+
c(...d).then(i).catch(l);
|
|
678
737
|
});
|
|
679
738
|
}), () => {
|
|
680
|
-
o.current?.cancel(), e.runAsync =
|
|
739
|
+
o.current?.cancel(), e.runAsync = c;
|
|
681
740
|
};
|
|
682
741
|
}
|
|
683
|
-
}, [t,
|
|
742
|
+
}, [t, a]), t ? {
|
|
684
743
|
onCancel: () => {
|
|
685
744
|
o.current?.cancel();
|
|
686
745
|
}
|
|
687
746
|
} : {};
|
|
688
|
-
},
|
|
747
|
+
}, wt = (e, { loadingDelay: t, ready: n }) => {
|
|
689
748
|
const r = E(void 0);
|
|
690
749
|
if (!t)
|
|
691
750
|
return {};
|
|
@@ -707,36 +766,36 @@ const G = /* @__PURE__ */ new Map(), ft = (e, t, n) => {
|
|
|
707
766
|
s();
|
|
708
767
|
}
|
|
709
768
|
};
|
|
710
|
-
},
|
|
711
|
-
const s = E(void 0), o = E(void 0),
|
|
769
|
+
}, bt = (e, { pollingInterval: t, pollingWhenHidden: n = !0, pollingErrorRetryCount: r = -1 }) => {
|
|
770
|
+
const s = E(void 0), o = E(void 0), a = E(0), c = () => {
|
|
712
771
|
s.current && clearTimeout(s.current), o.current?.();
|
|
713
772
|
};
|
|
714
773
|
return K(() => {
|
|
715
|
-
t ||
|
|
774
|
+
t || c();
|
|
716
775
|
}, [t]), t ? {
|
|
717
776
|
onBefore: () => {
|
|
718
|
-
|
|
777
|
+
c();
|
|
719
778
|
},
|
|
720
779
|
onError: () => {
|
|
721
|
-
|
|
780
|
+
a.current += 1;
|
|
722
781
|
},
|
|
723
782
|
onSuccess: () => {
|
|
724
|
-
|
|
783
|
+
a.current = 0;
|
|
725
784
|
},
|
|
726
785
|
onFinally: () => {
|
|
727
786
|
r === -1 || // When an error occurs, the request is not repeated after pollingErrorRetryCount retries
|
|
728
|
-
r !== -1 &&
|
|
729
|
-
!n && !We() ? o.current =
|
|
787
|
+
r !== -1 && a.current <= r ? s.current = setTimeout(() => {
|
|
788
|
+
!n && !We() ? o.current = Ge(() => {
|
|
730
789
|
e.refresh();
|
|
731
790
|
}) : e.refresh();
|
|
732
|
-
}, t) :
|
|
791
|
+
}, t) : a.current = 0;
|
|
733
792
|
},
|
|
734
793
|
onCancel: () => {
|
|
735
|
-
|
|
794
|
+
c();
|
|
736
795
|
}
|
|
737
796
|
} : {};
|
|
738
797
|
};
|
|
739
|
-
function
|
|
798
|
+
function Rt(e, t) {
|
|
740
799
|
let n = !1;
|
|
741
800
|
return (...r) => {
|
|
742
801
|
n || (n = !0, e(...r), setTimeout(() => {
|
|
@@ -744,17 +803,17 @@ function wt(e, t) {
|
|
|
744
803
|
}, t));
|
|
745
804
|
};
|
|
746
805
|
}
|
|
747
|
-
const
|
|
806
|
+
const Tt = (e, { refreshOnWindowFocus: t, focusTimespan: n = 5e3 }) => {
|
|
748
807
|
const r = E(void 0), s = () => {
|
|
749
808
|
r.current?.();
|
|
750
809
|
};
|
|
751
|
-
return
|
|
810
|
+
return C(() => {
|
|
752
811
|
if (t) {
|
|
753
|
-
const o =
|
|
812
|
+
const o = Rt(
|
|
754
813
|
e.refresh.bind(e),
|
|
755
814
|
n
|
|
756
815
|
);
|
|
757
|
-
r.current =
|
|
816
|
+
r.current = Ke(() => {
|
|
758
817
|
o();
|
|
759
818
|
});
|
|
760
819
|
}
|
|
@@ -764,7 +823,7 @@ const St = (e, { refreshOnWindowFocus: t, focusTimespan: n = 5e3 }) => {
|
|
|
764
823
|
}, [t, n]), W(() => {
|
|
765
824
|
s();
|
|
766
825
|
}), {};
|
|
767
|
-
},
|
|
826
|
+
}, Lt = (e, { retryInterval: t, retryCount: n }) => {
|
|
768
827
|
const r = E(void 0), s = E(0), o = E(!1);
|
|
769
828
|
return n ? {
|
|
770
829
|
onBefore: () => {
|
|
@@ -775,10 +834,10 @@ const St = (e, { refreshOnWindowFocus: t, focusTimespan: n = 5e3 }) => {
|
|
|
775
834
|
},
|
|
776
835
|
onError: () => {
|
|
777
836
|
if (s.current += 1, n === -1 || s.current <= n) {
|
|
778
|
-
const
|
|
837
|
+
const a = t ?? Math.min(1e3 * 2 ** s.current, 3e4);
|
|
779
838
|
r.current = setTimeout(() => {
|
|
780
839
|
o.current = !0, e.refresh();
|
|
781
|
-
},
|
|
840
|
+
}, a);
|
|
782
841
|
} else
|
|
783
842
|
s.current = 0;
|
|
784
843
|
},
|
|
@@ -786,23 +845,23 @@ const St = (e, { refreshOnWindowFocus: t, focusTimespan: n = 5e3 }) => {
|
|
|
786
845
|
s.current = 0, r.current && clearTimeout(r.current);
|
|
787
846
|
}
|
|
788
847
|
} : {};
|
|
789
|
-
},
|
|
848
|
+
}, At = (e, { throttleWait: t, throttleLeading: n, throttleTrailing: r }) => {
|
|
790
849
|
const s = E(void 0), o = {};
|
|
791
|
-
return n !== void 0 && (o.leading = n), r !== void 0 && (o.trailing = r),
|
|
850
|
+
return n !== void 0 && (o.leading = n), r !== void 0 && (o.trailing = r), C(() => {
|
|
792
851
|
if (t) {
|
|
793
|
-
const
|
|
794
|
-
return s.current =
|
|
795
|
-
(
|
|
796
|
-
|
|
852
|
+
const a = e.runAsync.bind(e);
|
|
853
|
+
return s.current = Me(
|
|
854
|
+
(c) => {
|
|
855
|
+
c();
|
|
797
856
|
},
|
|
798
857
|
t,
|
|
799
858
|
o
|
|
800
|
-
), e.runAsync = (...
|
|
859
|
+
), e.runAsync = (...c) => new Promise((d, i) => {
|
|
801
860
|
s.current?.(() => {
|
|
802
|
-
|
|
861
|
+
a(...c).then(d).catch(i);
|
|
803
862
|
});
|
|
804
863
|
}), () => {
|
|
805
|
-
e.runAsync =
|
|
864
|
+
e.runAsync = a, s.current?.cancel();
|
|
806
865
|
};
|
|
807
866
|
}
|
|
808
867
|
}, [t, n, r]), t ? {
|
|
@@ -811,7 +870,7 @@ const St = (e, { refreshOnWindowFocus: t, focusTimespan: n = 5e3 }) => {
|
|
|
811
870
|
}
|
|
812
871
|
} : {};
|
|
813
872
|
};
|
|
814
|
-
class
|
|
873
|
+
class Pt {
|
|
815
874
|
constructor(t, n, r, s = {}) {
|
|
816
875
|
this.serviceRef = t, this.options = n, this.subscribe = r, this.initState = s, this.count = 0, this.state = {
|
|
817
876
|
loading: !1,
|
|
@@ -852,27 +911,27 @@ class Tt {
|
|
|
852
911
|
return Promise.resolve(o.data);
|
|
853
912
|
this.options.onBefore?.(t);
|
|
854
913
|
try {
|
|
855
|
-
let { servicePromise:
|
|
914
|
+
let { servicePromise: a } = this.runPluginHandler(
|
|
856
915
|
"onRequest",
|
|
857
916
|
this.serviceRef.current,
|
|
858
917
|
t
|
|
859
918
|
);
|
|
860
|
-
|
|
861
|
-
const
|
|
919
|
+
a || (a = this.serviceRef.current(...t));
|
|
920
|
+
const c = await a;
|
|
862
921
|
return n !== this.count ? new Promise(() => {
|
|
863
922
|
}) : (this.setState({
|
|
864
|
-
data:
|
|
923
|
+
data: c,
|
|
865
924
|
error: void 0,
|
|
866
925
|
loading: !1
|
|
867
|
-
}), this.options.onSuccess?.(
|
|
868
|
-
} catch (
|
|
926
|
+
}), this.options.onSuccess?.(c, t), this.runPluginHandler("onSuccess", c, t), this.options.onFinally?.(t, c, void 0), n === this.count && this.runPluginHandler("onFinally", t, c, void 0), c);
|
|
927
|
+
} catch (a) {
|
|
869
928
|
if (n !== this.count)
|
|
870
929
|
return new Promise(() => {
|
|
871
930
|
});
|
|
872
931
|
throw this.setState({
|
|
873
|
-
error:
|
|
932
|
+
error: a,
|
|
874
933
|
loading: !1
|
|
875
|
-
}), this.options.onError?.(
|
|
934
|
+
}), this.options.onError?.(a, t), this.runPluginHandler("onError", a, t), this.options.onFinally?.(t, void 0, a), n === this.count && this.runPluginHandler("onFinally", t, void 0, a), a;
|
|
876
935
|
}
|
|
877
936
|
}
|
|
878
937
|
run(...t) {
|
|
@@ -898,27 +957,27 @@ class Tt {
|
|
|
898
957
|
});
|
|
899
958
|
}
|
|
900
959
|
}
|
|
901
|
-
function
|
|
960
|
+
function Ct(e, t = {}, n = []) {
|
|
902
961
|
const { manual: r = !1, ready: s = !0, ...o } = t;
|
|
903
|
-
|
|
962
|
+
re && t.defaultParams && !Array.isArray(t.defaultParams) && console.warn(
|
|
904
963
|
`expected defaultParams is array, got ${typeof t.defaultParams}`
|
|
905
964
|
);
|
|
906
|
-
const
|
|
965
|
+
const a = {
|
|
907
966
|
manual: r,
|
|
908
967
|
ready: s,
|
|
909
968
|
...o
|
|
910
|
-
},
|
|
911
|
-
const l = n.map((u) => u?.onInit?.(
|
|
912
|
-
return new
|
|
913
|
-
a,
|
|
969
|
+
}, c = L(e), d = ne(), i = se(() => {
|
|
970
|
+
const l = n.map((u) => u?.onInit?.(a)).filter(Boolean);
|
|
971
|
+
return new Pt(
|
|
914
972
|
c,
|
|
973
|
+
a,
|
|
915
974
|
d,
|
|
916
975
|
Object.assign({}, ...l)
|
|
917
976
|
);
|
|
918
977
|
}, []);
|
|
919
|
-
return i.options =
|
|
920
|
-
(l) => l(i,
|
|
921
|
-
),
|
|
978
|
+
return i.options = a, i.pluginImpls = n.map(
|
|
979
|
+
(l) => l(i, a)
|
|
980
|
+
), Fe(() => {
|
|
922
981
|
if (!r && s) {
|
|
923
982
|
const l = i.state.params || t.defaultParams || [];
|
|
924
983
|
i.run(...l);
|
|
@@ -938,41 +997,41 @@ function At(e, t = {}, n = []) {
|
|
|
938
997
|
mutate: y(i.mutate.bind(i))
|
|
939
998
|
};
|
|
940
999
|
}
|
|
941
|
-
function
|
|
942
|
-
return
|
|
1000
|
+
function ke(e, t, n) {
|
|
1001
|
+
return Ct(e, t, [
|
|
943
1002
|
...n || [],
|
|
944
|
-
vt,
|
|
945
|
-
yt,
|
|
946
|
-
Et,
|
|
947
1003
|
St,
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
1004
|
+
wt,
|
|
1005
|
+
bt,
|
|
1006
|
+
Tt,
|
|
1007
|
+
At,
|
|
1008
|
+
Je,
|
|
1009
|
+
Et,
|
|
1010
|
+
Lt
|
|
952
1011
|
]);
|
|
953
1012
|
}
|
|
954
|
-
const
|
|
1013
|
+
const Dt = (e) => e === document || e === document.documentElement || e === document.body ? Math.max(
|
|
955
1014
|
window.pageYOffset,
|
|
956
1015
|
document.documentElement.scrollTop,
|
|
957
1016
|
document.body.scrollTop
|
|
958
|
-
) : e.scrollTop,
|
|
1017
|
+
) : e.scrollTop, we = (e) => e.scrollHeight || Math.max(document.documentElement.scrollHeight, document.body.scrollHeight), Mt = (e) => e.clientHeight || Math.max(document.documentElement.clientHeight, document.body.clientHeight), kn = (e, t = {}) => {
|
|
959
1018
|
const {
|
|
960
1019
|
target: n,
|
|
961
1020
|
isNoMore: r,
|
|
962
1021
|
threshold: s = 100,
|
|
963
1022
|
direction: o = "bottom",
|
|
964
|
-
reloadDeps:
|
|
965
|
-
manual:
|
|
1023
|
+
reloadDeps: a = [],
|
|
1024
|
+
manual: c,
|
|
966
1025
|
onBefore: d,
|
|
967
1026
|
onSuccess: i,
|
|
968
1027
|
onError: l,
|
|
969
1028
|
onFinally: u
|
|
970
|
-
} = t, [m, h] = b(), [p, f] = b(!1), T = o === "top",
|
|
1029
|
+
} = t, [m, h] = b(), [p, f] = b(!1), T = o === "top", A = E(void 0), O = E(0), g = x(() => r ? r(m) : !1, [m]), { loading: v, error: S, run: R, runAsync: N, cancel: I } = ke(
|
|
971
1030
|
async (M) => ({ currentData: await e(M), lastData: M }),
|
|
972
1031
|
{
|
|
973
|
-
manual:
|
|
974
|
-
onFinally: (M,
|
|
975
|
-
f(!1), u?.(
|
|
1032
|
+
manual: c,
|
|
1033
|
+
onFinally: (M, H, z) => {
|
|
1034
|
+
f(!1), u?.(H?.currentData, z);
|
|
976
1035
|
},
|
|
977
1036
|
onBefore: () => d?.(),
|
|
978
1037
|
onSuccess: (M) => {
|
|
@@ -984,50 +1043,50 @@ const Pt = (e) => e === document || e === document.documentElement || e === docu
|
|
|
984
1043
|
list: [...M.currentData.list ?? []]
|
|
985
1044
|
}), setTimeout(() => {
|
|
986
1045
|
if (T) {
|
|
987
|
-
let
|
|
988
|
-
if (
|
|
989
|
-
const
|
|
990
|
-
|
|
1046
|
+
let H = D(n);
|
|
1047
|
+
if (H = H === document ? document.documentElement : H, H) {
|
|
1048
|
+
const z = we(H);
|
|
1049
|
+
H.scrollTo(0, z - O.current);
|
|
991
1050
|
}
|
|
992
1051
|
} else
|
|
993
|
-
|
|
1052
|
+
pe();
|
|
994
1053
|
}), i?.(M.currentData);
|
|
995
1054
|
},
|
|
996
1055
|
onError: (M) => l?.(M)
|
|
997
1056
|
}
|
|
998
|
-
),
|
|
1057
|
+
), w = y(() => {
|
|
999
1058
|
g || (f(!0), R(m));
|
|
1000
|
-
}), Y = async (M) => (await N(M)).currentData,
|
|
1001
|
-
const M =
|
|
1059
|
+
}), Y = async (M) => (await N(M)).currentData, P = y(() => g ? Promise.reject() : (f(!0), Y(m))), _ = () => (f(!1), R()), oe = () => (f(!1), Y()), pe = () => {
|
|
1060
|
+
const M = D(n);
|
|
1002
1061
|
if (!M)
|
|
1003
1062
|
return;
|
|
1004
|
-
const
|
|
1005
|
-
T ? (
|
|
1063
|
+
const H = M === document ? document.documentElement : M, z = Dt(H), ve = we(H), Be = Mt(H);
|
|
1064
|
+
T ? (A.current !== void 0 && A.current > z && z <= s && w(), A.current = z, O.current = ve - z) : ve - z <= Be + s && w();
|
|
1006
1065
|
};
|
|
1007
|
-
return
|
|
1066
|
+
return j(
|
|
1008
1067
|
"scroll",
|
|
1009
1068
|
() => {
|
|
1010
|
-
v || p ||
|
|
1069
|
+
v || p || pe();
|
|
1011
1070
|
},
|
|
1012
1071
|
{ target: n }
|
|
1013
1072
|
), K(() => {
|
|
1014
1073
|
R();
|
|
1015
|
-
}, [...
|
|
1074
|
+
}, [...a]), {
|
|
1016
1075
|
data: m,
|
|
1017
1076
|
loading: !p && v,
|
|
1018
|
-
error:
|
|
1077
|
+
error: S,
|
|
1019
1078
|
loadingMore: p,
|
|
1020
1079
|
noMore: g,
|
|
1021
|
-
loadMore:
|
|
1022
|
-
loadMoreAsync:
|
|
1023
|
-
reload: y(
|
|
1024
|
-
reloadAsync: y(
|
|
1080
|
+
loadMore: w,
|
|
1081
|
+
loadMoreAsync: P,
|
|
1082
|
+
reload: y(_),
|
|
1083
|
+
reloadAsync: y(oe),
|
|
1025
1084
|
mutate: h,
|
|
1026
1085
|
cancel: I
|
|
1027
1086
|
};
|
|
1028
|
-
},
|
|
1087
|
+
}, _e = (e, t, n) => {
|
|
1029
1088
|
const r = E(void 0), s = E(0);
|
|
1030
|
-
|
|
1089
|
+
Oe(t, r.current) || (s.current += 1), r.current = t, U(e, [s.current], n);
|
|
1031
1090
|
}, He = {
|
|
1032
1091
|
0: 48,
|
|
1033
1092
|
1: 49,
|
|
@@ -1129,20 +1188,20 @@ const Pt = (e) => e === document || e === document.documentElement || e === docu
|
|
|
1129
1188
|
backslash: 220,
|
|
1130
1189
|
closebracket: 221,
|
|
1131
1190
|
singlequote: 222
|
|
1132
|
-
},
|
|
1191
|
+
}, me = {
|
|
1133
1192
|
ctrl: (e) => e.ctrlKey,
|
|
1134
1193
|
shift: (e) => e.shiftKey,
|
|
1135
1194
|
alt: (e) => e.altKey,
|
|
1136
1195
|
meta: (e) => e.type === "keyup" ? He.meta.includes(e.keyCode) : e.metaKey
|
|
1137
1196
|
};
|
|
1138
|
-
function
|
|
1139
|
-
return
|
|
1197
|
+
function Ie(e) {
|
|
1198
|
+
return te(e) || F(e);
|
|
1140
1199
|
}
|
|
1141
|
-
function
|
|
1142
|
-
const t = Object.keys(
|
|
1200
|
+
function Nt(e) {
|
|
1201
|
+
const t = Object.keys(me).reduce((n, r) => me[r](e) ? n + 1 : n, 0);
|
|
1143
1202
|
return [16, 17, 18, 91, 92].includes(e.keyCode) ? t : t + 1;
|
|
1144
1203
|
}
|
|
1145
|
-
function
|
|
1204
|
+
function be(e, t, n) {
|
|
1146
1205
|
if (!e.key)
|
|
1147
1206
|
return !1;
|
|
1148
1207
|
if (F(t))
|
|
@@ -1150,66 +1209,66 @@ function Re(e, t, n) {
|
|
|
1150
1209
|
const r = t.split(".");
|
|
1151
1210
|
let s = 0;
|
|
1152
1211
|
for (const o of r) {
|
|
1153
|
-
const
|
|
1154
|
-
(
|
|
1212
|
+
const a = me[o], c = He[o.toLowerCase()];
|
|
1213
|
+
(a && a(e) || c && c === e.keyCode) && s++;
|
|
1155
1214
|
}
|
|
1156
|
-
return n ? s === r.length &&
|
|
1215
|
+
return n ? s === r.length && Nt(e) === r.length ? t : !1 : s === r.length ? t : !1;
|
|
1157
1216
|
}
|
|
1158
|
-
function
|
|
1159
|
-
return k(e) ? e :
|
|
1217
|
+
function Ot(e, t) {
|
|
1218
|
+
return k(e) ? e : Ie(e) ? (n) => be(n, e, t) : Array.isArray(e) ? (n) => e.find((r) => be(n, r, t)) : () => !!e;
|
|
1160
1219
|
}
|
|
1161
|
-
const
|
|
1162
|
-
function
|
|
1220
|
+
const xt = ["keydown"];
|
|
1221
|
+
function _n(e, t, n) {
|
|
1163
1222
|
const {
|
|
1164
|
-
events: r =
|
|
1223
|
+
events: r = xt,
|
|
1165
1224
|
target: s,
|
|
1166
1225
|
exactMatch: o = !1,
|
|
1167
|
-
useCapture:
|
|
1168
|
-
} = n || {},
|
|
1169
|
-
|
|
1226
|
+
useCapture: a = !1
|
|
1227
|
+
} = n || {}, c = L(t), d = L(e);
|
|
1228
|
+
_e(
|
|
1170
1229
|
() => {
|
|
1171
|
-
const i =
|
|
1230
|
+
const i = D(s, window);
|
|
1172
1231
|
if (!i)
|
|
1173
1232
|
return;
|
|
1174
1233
|
const l = (u) => {
|
|
1175
|
-
const h =
|
|
1234
|
+
const h = Ot(d.current, o)(u), p = Ie(h) ? h : u.key;
|
|
1176
1235
|
if (h)
|
|
1177
|
-
return
|
|
1236
|
+
return c.current?.(u, p);
|
|
1178
1237
|
};
|
|
1179
1238
|
for (const u of r)
|
|
1180
|
-
i?.addEventListener?.(u, l,
|
|
1239
|
+
i?.addEventListener?.(u, l, a);
|
|
1181
1240
|
return () => {
|
|
1182
1241
|
for (const u of r)
|
|
1183
|
-
i?.removeEventListener?.(u, l,
|
|
1242
|
+
i?.removeEventListener?.(u, l, a);
|
|
1184
1243
|
};
|
|
1185
1244
|
},
|
|
1186
1245
|
[r],
|
|
1187
1246
|
s
|
|
1188
1247
|
);
|
|
1189
1248
|
}
|
|
1190
|
-
const
|
|
1191
|
-
function
|
|
1249
|
+
const Re = "HOOKS_SYNC_STORAGE_EVENT_NAME";
|
|
1250
|
+
function Ye(e) {
|
|
1192
1251
|
function t(n, r = {}) {
|
|
1193
1252
|
let s;
|
|
1194
1253
|
const {
|
|
1195
1254
|
listenStorageChange: o = !1,
|
|
1196
|
-
onError:
|
|
1255
|
+
onError: a = (f) => {
|
|
1197
1256
|
console.error(f);
|
|
1198
1257
|
}
|
|
1199
1258
|
} = r;
|
|
1200
1259
|
try {
|
|
1201
1260
|
s = e();
|
|
1202
1261
|
} catch (f) {
|
|
1203
|
-
|
|
1262
|
+
a(f);
|
|
1204
1263
|
}
|
|
1205
|
-
const
|
|
1264
|
+
const c = (f) => r.serializer ? r.serializer(f) : JSON.stringify(f), d = (f) => r.deserializer ? r.deserializer(f) : JSON.parse(f);
|
|
1206
1265
|
function i() {
|
|
1207
1266
|
try {
|
|
1208
1267
|
const f = s?.getItem(n);
|
|
1209
1268
|
if (f)
|
|
1210
1269
|
return d(f);
|
|
1211
1270
|
} catch (f) {
|
|
1212
|
-
|
|
1271
|
+
a(f);
|
|
1213
1272
|
}
|
|
1214
1273
|
return k(r.defaultValue) ? r.defaultValue() : r.defaultValue;
|
|
1215
1274
|
}
|
|
@@ -1221,32 +1280,32 @@ function Ie(e) {
|
|
|
1221
1280
|
const T = k(f) ? f(l) : f;
|
|
1222
1281
|
o || u(T);
|
|
1223
1282
|
try {
|
|
1224
|
-
let
|
|
1283
|
+
let A;
|
|
1225
1284
|
const O = s?.getItem(n);
|
|
1226
|
-
|
|
1285
|
+
Ue(T) ? (A = null, s?.removeItem(n)) : (A = c(T), s?.setItem(n, A)), dispatchEvent(
|
|
1227
1286
|
// send custom event to communicate within same page
|
|
1228
1287
|
// importantly this should not be a StorageEvent since those cannot
|
|
1229
1288
|
// be constructed with a non-built-in storage area
|
|
1230
|
-
new CustomEvent(
|
|
1289
|
+
new CustomEvent(Re, {
|
|
1231
1290
|
detail: {
|
|
1232
1291
|
key: n,
|
|
1233
|
-
newValue:
|
|
1292
|
+
newValue: A,
|
|
1234
1293
|
oldValue: O,
|
|
1235
1294
|
storageArea: s
|
|
1236
1295
|
}
|
|
1237
1296
|
})
|
|
1238
1297
|
);
|
|
1239
|
-
} catch (
|
|
1240
|
-
|
|
1298
|
+
} catch (A) {
|
|
1299
|
+
a(A);
|
|
1241
1300
|
}
|
|
1242
1301
|
}, h = (f) => {
|
|
1243
1302
|
f.key !== n || f.storageArea !== s || u(i());
|
|
1244
1303
|
}, p = (f) => {
|
|
1245
1304
|
h(f.detail);
|
|
1246
1305
|
};
|
|
1247
|
-
return
|
|
1306
|
+
return j("storage", h, {
|
|
1248
1307
|
enable: o
|
|
1249
|
-
}),
|
|
1308
|
+
}), j(Re, p, {
|
|
1250
1309
|
enable: o
|
|
1251
1310
|
}), [
|
|
1252
1311
|
l,
|
|
@@ -1255,12 +1314,12 @@ function Ie(e) {
|
|
|
1255
1314
|
}
|
|
1256
1315
|
return t;
|
|
1257
1316
|
}
|
|
1258
|
-
const Hn =
|
|
1259
|
-
() =>
|
|
1317
|
+
const Hn = Ye(
|
|
1318
|
+
() => V ? localStorage : void 0
|
|
1260
1319
|
);
|
|
1261
|
-
function
|
|
1320
|
+
function In(e) {
|
|
1262
1321
|
const t = E(!1);
|
|
1263
|
-
return
|
|
1322
|
+
return q(
|
|
1264
1323
|
async (...n) => {
|
|
1265
1324
|
if (!t.current) {
|
|
1266
1325
|
t.current = !0;
|
|
@@ -1276,68 +1335,58 @@ function _n(e) {
|
|
|
1276
1335
|
[e]
|
|
1277
1336
|
);
|
|
1278
1337
|
}
|
|
1279
|
-
function
|
|
1280
|
-
const
|
|
1281
|
-
|
|
1338
|
+
function Yn(e, t, { delay: n = 300, moveThreshold: r, onClick: s, onLongPressEnd: o } = {}) {
|
|
1339
|
+
const a = L(e), c = L(s), d = L(o), i = E(void 0), l = E(!1), u = E({ x: 0, y: 0 }), m = E(!1), h = E(!1), p = !!(r?.x && r.x > 0 || r?.y && r.y > 0);
|
|
1340
|
+
U(
|
|
1282
1341
|
() => {
|
|
1283
|
-
const f =
|
|
1342
|
+
const f = D(t);
|
|
1284
1343
|
if (!f?.addEventListener)
|
|
1285
1344
|
return;
|
|
1286
|
-
const T = (
|
|
1287
|
-
const { clientX: Y, clientY:
|
|
1288
|
-
return !!(r?.x &&
|
|
1345
|
+
const T = (w) => {
|
|
1346
|
+
const { clientX: Y, clientY: P } = A(w), _ = Math.abs(Y - u.current.x), oe = Math.abs(P - u.current.y);
|
|
1347
|
+
return !!(r?.x && _ > r.x || r?.y && oe > r.y);
|
|
1289
1348
|
};
|
|
1290
|
-
function
|
|
1291
|
-
return "TouchEvent" in window &&
|
|
1292
|
-
clientX:
|
|
1293
|
-
clientY:
|
|
1294
|
-
} :
|
|
1295
|
-
clientX:
|
|
1296
|
-
clientY:
|
|
1349
|
+
function A(w) {
|
|
1350
|
+
return "TouchEvent" in window && w instanceof TouchEvent ? {
|
|
1351
|
+
clientX: w.touches[0].clientX,
|
|
1352
|
+
clientY: w.touches[0].clientY
|
|
1353
|
+
} : w instanceof MouseEvent ? {
|
|
1354
|
+
clientX: w.clientX,
|
|
1355
|
+
clientY: w.clientY
|
|
1297
1356
|
} : { clientX: 0, clientY: 0 };
|
|
1298
1357
|
}
|
|
1299
|
-
const O = (
|
|
1358
|
+
const O = (w) => {
|
|
1300
1359
|
i.current = setTimeout(() => {
|
|
1301
|
-
|
|
1360
|
+
a.current(w), l.current = !0;
|
|
1302
1361
|
}, n);
|
|
1303
|
-
}, g = (
|
|
1362
|
+
}, g = (w) => {
|
|
1304
1363
|
if (!h.current) {
|
|
1305
1364
|
if (h.current = !0, p) {
|
|
1306
|
-
const { clientX: Y, clientY:
|
|
1307
|
-
u.current.x = Y, u.current.y =
|
|
1365
|
+
const { clientX: Y, clientY: P } = A(w);
|
|
1366
|
+
u.current.x = Y, u.current.y = P;
|
|
1308
1367
|
}
|
|
1309
|
-
O(
|
|
1368
|
+
O(w);
|
|
1310
1369
|
}
|
|
1311
|
-
}, v = (
|
|
1312
|
-
|
|
1313
|
-
},
|
|
1314
|
-
i.current && T(
|
|
1315
|
-
}, R = (
|
|
1316
|
-
h.current && (h.current = !1, i.current && (clearTimeout(i.current), i.current = void 0), l.current ? d.current?.(
|
|
1317
|
-
}, N = (
|
|
1318
|
-
|
|
1319
|
-
}, I = (
|
|
1320
|
-
m.current && (m.current = !1, i.current && (clearTimeout(i.current), i.current = void 0), l.current && (d.current?.(
|
|
1370
|
+
}, v = (w) => {
|
|
1371
|
+
w?.sourceCapabilities?.firesTouchEvents || (m.current = !0, p && (u.current.x = w.clientX, u.current.y = w.clientY), O(w));
|
|
1372
|
+
}, S = (w) => {
|
|
1373
|
+
i.current && T(w) && (clearTimeout(i.current), i.current = void 0);
|
|
1374
|
+
}, R = (w) => {
|
|
1375
|
+
h.current && (h.current = !1, i.current && (clearTimeout(i.current), i.current = void 0), l.current ? d.current?.(w) : c.current && c.current(w), l.current = !1);
|
|
1376
|
+
}, N = (w) => {
|
|
1377
|
+
w?.sourceCapabilities?.firesTouchEvents || m.current && (m.current = !1, i.current && (clearTimeout(i.current), i.current = void 0), l.current ? d.current?.(w) : c.current && c.current(w), l.current = !1);
|
|
1378
|
+
}, I = (w) => {
|
|
1379
|
+
m.current && (m.current = !1, i.current && (clearTimeout(i.current), i.current = void 0), l.current && (d.current?.(w), l.current = !1));
|
|
1321
1380
|
};
|
|
1322
|
-
return f.addEventListener("mousedown", v), f.addEventListener("mouseup", N), f.addEventListener("mouseleave", I), f.addEventListener("touchstart", g), f.addEventListener("touchend", R), p && (f.addEventListener("mousemove",
|
|
1323
|
-
i.current && (clearTimeout(i.current), l.current = !1), f.removeEventListener("mousedown", v), f.removeEventListener("mouseup", N), f.removeEventListener("mouseleave", I), f.removeEventListener("touchstart", g), f.removeEventListener("touchend", R), p && (f.removeEventListener("mousemove",
|
|
1381
|
+
return f.addEventListener("mousedown", v), f.addEventListener("mouseup", N), f.addEventListener("mouseleave", I), f.addEventListener("touchstart", g), f.addEventListener("touchend", R), p && (f.addEventListener("mousemove", S), f.addEventListener("touchmove", S)), () => {
|
|
1382
|
+
i.current && (clearTimeout(i.current), l.current = !1), f.removeEventListener("mousedown", v), f.removeEventListener("mouseup", N), f.removeEventListener("mouseleave", I), f.removeEventListener("touchstart", g), f.removeEventListener("touchend", R), p && (f.removeEventListener("mousemove", S), f.removeEventListener("touchmove", S));
|
|
1324
1383
|
};
|
|
1325
1384
|
},
|
|
1326
1385
|
[],
|
|
1327
1386
|
t
|
|
1328
1387
|
);
|
|
1329
1388
|
}
|
|
1330
|
-
|
|
1331
|
-
const t = E(0), [n, r] = b(e), s = V((o) => {
|
|
1332
|
-
cancelAnimationFrame(t.current), t.current = requestAnimationFrame(() => {
|
|
1333
|
-
r(o);
|
|
1334
|
-
});
|
|
1335
|
-
}, []);
|
|
1336
|
-
return W(() => {
|
|
1337
|
-
cancelAnimationFrame(t.current);
|
|
1338
|
-
}), [n, s];
|
|
1339
|
-
}
|
|
1340
|
-
const Nt = {
|
|
1389
|
+
const Ft = {
|
|
1341
1390
|
screenX: NaN,
|
|
1342
1391
|
screenY: NaN,
|
|
1343
1392
|
clientX: NaN,
|
|
@@ -1350,16 +1399,16 @@ const Nt = {
|
|
|
1350
1399
|
elementW: NaN,
|
|
1351
1400
|
elementPosX: NaN,
|
|
1352
1401
|
elementPosY: NaN
|
|
1353
|
-
},
|
|
1354
|
-
const [t, n] =
|
|
1355
|
-
return
|
|
1402
|
+
}, Xn = (e) => {
|
|
1403
|
+
const [t, n] = De(Ft);
|
|
1404
|
+
return j(
|
|
1356
1405
|
"mousemove",
|
|
1357
1406
|
(r) => {
|
|
1358
|
-
const { screenX: s, screenY: o, clientX:
|
|
1407
|
+
const { screenX: s, screenY: o, clientX: a, clientY: c, pageX: d, pageY: i } = r, l = {
|
|
1359
1408
|
screenX: s,
|
|
1360
1409
|
screenY: o,
|
|
1361
|
-
clientX:
|
|
1362
|
-
clientY:
|
|
1410
|
+
clientX: a,
|
|
1411
|
+
clientY: c,
|
|
1363
1412
|
pageX: d,
|
|
1364
1413
|
pageY: i,
|
|
1365
1414
|
elementX: NaN,
|
|
@@ -1368,7 +1417,7 @@ const Nt = {
|
|
|
1368
1417
|
elementW: NaN,
|
|
1369
1418
|
elementPosX: NaN,
|
|
1370
1419
|
elementPosY: NaN
|
|
1371
|
-
}, u =
|
|
1420
|
+
}, u = D(e);
|
|
1372
1421
|
if (u) {
|
|
1373
1422
|
const { left: m, top: h, width: p, height: f } = u.getBoundingClientRect();
|
|
1374
1423
|
l.elementPosX = m + window.pageXOffset, l.elementPosY = h + window.pageYOffset, l.elementX = d - l.elementPosX, l.elementY = i - l.elementPosY, l.elementW = p, l.elementH = f;
|
|
@@ -1379,11 +1428,11 @@ const Nt = {
|
|
|
1379
1428
|
target: () => document
|
|
1380
1429
|
}
|
|
1381
1430
|
), t;
|
|
1382
|
-
},
|
|
1383
|
-
const r =
|
|
1384
|
-
|
|
1431
|
+
}, jn = (e, t, n = {}) => {
|
|
1432
|
+
const r = L(e);
|
|
1433
|
+
_e(
|
|
1385
1434
|
() => {
|
|
1386
|
-
const s =
|
|
1435
|
+
const s = D(t);
|
|
1387
1436
|
if (!s)
|
|
1388
1437
|
return;
|
|
1389
1438
|
const o = new MutationObserver(r.current);
|
|
@@ -1395,12 +1444,12 @@ const Nt = {
|
|
|
1395
1444
|
t
|
|
1396
1445
|
);
|
|
1397
1446
|
};
|
|
1398
|
-
function
|
|
1447
|
+
function Xe() {
|
|
1399
1448
|
const e = navigator;
|
|
1400
|
-
return
|
|
1449
|
+
return $e(e) ? e.connection || e.mozConnection || e.webkitConnection : null;
|
|
1401
1450
|
}
|
|
1402
|
-
function
|
|
1403
|
-
const e =
|
|
1451
|
+
function Te() {
|
|
1452
|
+
const e = Xe();
|
|
1404
1453
|
return e ? {
|
|
1405
1454
|
rtt: e.rtt,
|
|
1406
1455
|
type: e.type,
|
|
@@ -1410,33 +1459,33 @@ function Ae() {
|
|
|
1410
1459
|
effectiveType: e.effectiveType
|
|
1411
1460
|
} : {};
|
|
1412
1461
|
}
|
|
1413
|
-
function
|
|
1462
|
+
function zn() {
|
|
1414
1463
|
const [e, t] = b(() => ({
|
|
1415
1464
|
since: void 0,
|
|
1416
1465
|
online: navigator?.onLine,
|
|
1417
|
-
...
|
|
1466
|
+
...Te()
|
|
1418
1467
|
}));
|
|
1419
|
-
return
|
|
1468
|
+
return C(() => {
|
|
1420
1469
|
const n = () => {
|
|
1421
|
-
t((
|
|
1422
|
-
...
|
|
1470
|
+
t((a) => ({
|
|
1471
|
+
...a,
|
|
1423
1472
|
online: !0,
|
|
1424
1473
|
since: /* @__PURE__ */ new Date()
|
|
1425
1474
|
}));
|
|
1426
1475
|
}, r = () => {
|
|
1427
|
-
t((
|
|
1428
|
-
...
|
|
1476
|
+
t((a) => ({
|
|
1477
|
+
...a,
|
|
1429
1478
|
online: !1,
|
|
1430
1479
|
since: /* @__PURE__ */ new Date()
|
|
1431
1480
|
}));
|
|
1432
1481
|
}, s = () => {
|
|
1433
|
-
t((
|
|
1434
|
-
...
|
|
1435
|
-
...
|
|
1482
|
+
t((a) => ({
|
|
1483
|
+
...a,
|
|
1484
|
+
...Te()
|
|
1436
1485
|
}));
|
|
1437
1486
|
};
|
|
1438
1487
|
window.addEventListener("online", n), window.addEventListener("offline", r);
|
|
1439
|
-
const o =
|
|
1488
|
+
const o = Xe();
|
|
1440
1489
|
return o?.addEventListener("change", s), () => {
|
|
1441
1490
|
window.removeEventListener("online", n), window.removeEventListener("offline", r), o?.removeEventListener(
|
|
1442
1491
|
"change",
|
|
@@ -1446,19 +1495,19 @@ function Xn() {
|
|
|
1446
1495
|
}, []), e;
|
|
1447
1496
|
}
|
|
1448
1497
|
const Bn = (e, t = {}) => {
|
|
1449
|
-
const { defaultPageSize: n = 10, defaultCurrent: r = 1, ...s } = t, o =
|
|
1498
|
+
const { defaultPageSize: n = 10, defaultCurrent: r = 1, ...s } = t, o = ke(e, {
|
|
1450
1499
|
defaultParams: [{ current: r, pageSize: n }],
|
|
1451
1500
|
refreshDepsAction: () => {
|
|
1452
1501
|
u(1);
|
|
1453
1502
|
},
|
|
1454
1503
|
...s
|
|
1455
|
-
}), { current:
|
|
1456
|
-
() => Math.ceil(d /
|
|
1457
|
-
[
|
|
1504
|
+
}), { current: a = 1, pageSize: c = n } = o.params[0] || {}, d = o.data?.total || 0, i = x(
|
|
1505
|
+
() => Math.ceil(d / c),
|
|
1506
|
+
[c, d]
|
|
1458
1507
|
), l = (h, p) => {
|
|
1459
1508
|
let f = h <= 0 ? 1 : h;
|
|
1460
|
-
const T = p <= 0 ? 1 : p,
|
|
1461
|
-
f >
|
|
1509
|
+
const T = p <= 0 ? 1 : p, A = Math.ceil(d / T);
|
|
1510
|
+
f > A && (f = Math.max(1, A));
|
|
1462
1511
|
const [O = {}, ...g] = o.params || [];
|
|
1463
1512
|
o.run(
|
|
1464
1513
|
{
|
|
@@ -1469,15 +1518,15 @@ const Bn = (e, t = {}) => {
|
|
|
1469
1518
|
...g
|
|
1470
1519
|
);
|
|
1471
1520
|
}, u = (h) => {
|
|
1472
|
-
l(h,
|
|
1521
|
+
l(h, c);
|
|
1473
1522
|
}, m = (h) => {
|
|
1474
|
-
l(
|
|
1523
|
+
l(a, h);
|
|
1475
1524
|
};
|
|
1476
1525
|
return {
|
|
1477
1526
|
...o,
|
|
1478
1527
|
pagination: {
|
|
1479
|
-
current:
|
|
1480
|
-
pageSize:
|
|
1528
|
+
current: a,
|
|
1529
|
+
pageSize: c,
|
|
1481
1530
|
total: d,
|
|
1482
1531
|
totalPage: i,
|
|
1483
1532
|
onChange: y(l),
|
|
@@ -1485,7 +1534,7 @@ const Bn = (e, t = {}) => {
|
|
|
1485
1534
|
changePageSize: y(m)
|
|
1486
1535
|
}
|
|
1487
1536
|
};
|
|
1488
|
-
},
|
|
1537
|
+
}, kt = (e, t = 0) => {
|
|
1489
1538
|
if (typeof requestAnimationFrame > "u")
|
|
1490
1539
|
return {
|
|
1491
1540
|
id: setInterval(e, t)
|
|
@@ -1497,23 +1546,23 @@ const Bn = (e, t = {}) => {
|
|
|
1497
1546
|
Date.now() - n >= t && (e(), n = Date.now()), r.id = requestAnimationFrame(s);
|
|
1498
1547
|
};
|
|
1499
1548
|
return r.id = requestAnimationFrame(s), r;
|
|
1500
|
-
},
|
|
1501
|
-
if (
|
|
1549
|
+
}, _t = (e) => typeof cancelAnimationFrame > "u", Ht = (e) => {
|
|
1550
|
+
if (_t(e.id))
|
|
1502
1551
|
return clearInterval(e.id);
|
|
1503
1552
|
cancelAnimationFrame(e.id);
|
|
1504
1553
|
};
|
|
1505
|
-
function
|
|
1506
|
-
const r = n?.immediate, s =
|
|
1507
|
-
o.current &&
|
|
1554
|
+
function qn(e, t, n) {
|
|
1555
|
+
const r = n?.immediate, s = L(e), o = E(void 0), a = q(() => {
|
|
1556
|
+
o.current && Ht(o.current);
|
|
1508
1557
|
}, []);
|
|
1509
|
-
return
|
|
1558
|
+
return C(() => {
|
|
1510
1559
|
if (!(!F(t) || t < 0))
|
|
1511
|
-
return r && s.current(), o.current =
|
|
1560
|
+
return r && s.current(), o.current = kt(() => {
|
|
1512
1561
|
s.current();
|
|
1513
|
-
}, t),
|
|
1514
|
-
}, [t]),
|
|
1562
|
+
}, t), a;
|
|
1563
|
+
}, [t]), a;
|
|
1515
1564
|
}
|
|
1516
|
-
const
|
|
1565
|
+
const It = (e, t = 0) => {
|
|
1517
1566
|
if (typeof requestAnimationFrame > "u")
|
|
1518
1567
|
return {
|
|
1519
1568
|
id: setTimeout(e, t)
|
|
@@ -1524,124 +1573,124 @@ const kt = (e, t = 0) => {
|
|
|
1524
1573
|
Date.now() - r >= t ? e() : n.id = requestAnimationFrame(s);
|
|
1525
1574
|
};
|
|
1526
1575
|
return n.id = requestAnimationFrame(s), n;
|
|
1527
|
-
},
|
|
1528
|
-
if (
|
|
1576
|
+
}, Yt = (e) => typeof cancelAnimationFrame > "u", Xt = (e) => {
|
|
1577
|
+
if (Yt(e.id))
|
|
1529
1578
|
return clearTimeout(e.id);
|
|
1530
1579
|
cancelAnimationFrame(e.id);
|
|
1531
1580
|
};
|
|
1532
|
-
function
|
|
1533
|
-
const n =
|
|
1534
|
-
r.current &&
|
|
1581
|
+
function Vn(e, t) {
|
|
1582
|
+
const n = L(e), r = E(void 0), s = q(() => {
|
|
1583
|
+
r.current && Xt(r.current);
|
|
1535
1584
|
}, []);
|
|
1536
|
-
return
|
|
1585
|
+
return C(() => {
|
|
1537
1586
|
if (!(!F(t) || t < 0))
|
|
1538
|
-
return r.current =
|
|
1587
|
+
return r.current = It(() => {
|
|
1539
1588
|
n.current();
|
|
1540
1589
|
}, t), s;
|
|
1541
1590
|
}, [t]), s;
|
|
1542
1591
|
}
|
|
1543
|
-
const
|
|
1544
|
-
function
|
|
1545
|
-
const n =
|
|
1592
|
+
const Le = /* @__PURE__ */ new WeakMap(), Ae = /* @__PURE__ */ new WeakMap();
|
|
1593
|
+
function je(e, t) {
|
|
1594
|
+
const n = Le.get(e);
|
|
1546
1595
|
if (n)
|
|
1547
1596
|
return n;
|
|
1548
|
-
if (
|
|
1597
|
+
if (Ae.has(e))
|
|
1549
1598
|
return e;
|
|
1550
1599
|
const r = new Proxy(e, {
|
|
1551
|
-
get(s, o,
|
|
1552
|
-
const
|
|
1553
|
-
return !d?.configurable && !d?.writable ?
|
|
1600
|
+
get(s, o, a) {
|
|
1601
|
+
const c = Reflect.get(s, o, a), d = Reflect.getOwnPropertyDescriptor(s, o);
|
|
1602
|
+
return !d?.configurable && !d?.writable ? c : de(c) || Array.isArray(c) ? je(c, t) : c;
|
|
1554
1603
|
},
|
|
1555
|
-
set(s, o,
|
|
1556
|
-
const
|
|
1557
|
-
return t(),
|
|
1604
|
+
set(s, o, a) {
|
|
1605
|
+
const c = Reflect.set(s, o, a);
|
|
1606
|
+
return t(), c;
|
|
1558
1607
|
},
|
|
1559
1608
|
deleteProperty(s, o) {
|
|
1560
|
-
const
|
|
1561
|
-
return t(),
|
|
1609
|
+
const a = Reflect.deleteProperty(s, o);
|
|
1610
|
+
return t(), a;
|
|
1562
1611
|
}
|
|
1563
1612
|
});
|
|
1564
|
-
return
|
|
1613
|
+
return Le.set(e, r), Ae.set(r, e), r;
|
|
1565
1614
|
}
|
|
1566
|
-
function
|
|
1567
|
-
const t =
|
|
1568
|
-
return
|
|
1615
|
+
function Un(e) {
|
|
1616
|
+
const t = ne(), n = E(e);
|
|
1617
|
+
return se(() => je(n.current, () => {
|
|
1569
1618
|
t();
|
|
1570
1619
|
}), []);
|
|
1571
1620
|
}
|
|
1572
|
-
const
|
|
1573
|
-
const t = E(e), n =
|
|
1621
|
+
const $n = (e) => {
|
|
1622
|
+
const t = E(e), n = se(
|
|
1574
1623
|
() => k(t.current) ? t.current() : t.current,
|
|
1575
1624
|
[]
|
|
1576
1625
|
), [r, s] = b(n), o = y(() => {
|
|
1577
1626
|
s(n);
|
|
1578
1627
|
});
|
|
1579
1628
|
return [r, s, o];
|
|
1580
|
-
},
|
|
1581
|
-
let
|
|
1629
|
+
}, ee = /* @__PURE__ */ new Set();
|
|
1630
|
+
let B, ge = {
|
|
1582
1631
|
xs: 0,
|
|
1583
1632
|
sm: 576,
|
|
1584
1633
|
md: 768,
|
|
1585
1634
|
lg: 992,
|
|
1586
1635
|
xl: 1200
|
|
1587
1636
|
};
|
|
1588
|
-
function
|
|
1589
|
-
const e =
|
|
1590
|
-
if (
|
|
1591
|
-
for (const t of
|
|
1637
|
+
function le() {
|
|
1638
|
+
const e = B;
|
|
1639
|
+
if (he(), e !== B)
|
|
1640
|
+
for (const t of ee)
|
|
1592
1641
|
t();
|
|
1593
1642
|
}
|
|
1594
|
-
let
|
|
1595
|
-
function
|
|
1643
|
+
let Q = !1;
|
|
1644
|
+
function he() {
|
|
1596
1645
|
const e = window.innerWidth, t = {};
|
|
1597
1646
|
let n = !1;
|
|
1598
|
-
for (const r of Object.keys(
|
|
1599
|
-
t[r] = e >=
|
|
1600
|
-
n && (
|
|
1647
|
+
for (const r of Object.keys(ge))
|
|
1648
|
+
t[r] = e >= ge[r], t[r] !== B[r] && (n = !0);
|
|
1649
|
+
n && (B = t);
|
|
1601
1650
|
}
|
|
1602
1651
|
function Wn(e) {
|
|
1603
|
-
|
|
1652
|
+
ge = e, B && he();
|
|
1604
1653
|
}
|
|
1605
|
-
function
|
|
1606
|
-
|
|
1607
|
-
const [e, t] = b(
|
|
1608
|
-
return
|
|
1609
|
-
if (!
|
|
1654
|
+
function Gn() {
|
|
1655
|
+
V && !Q && (B = {}, he(), window.addEventListener("resize", le), Q = !0);
|
|
1656
|
+
const [e, t] = b(B);
|
|
1657
|
+
return C(() => {
|
|
1658
|
+
if (!V)
|
|
1610
1659
|
return;
|
|
1611
|
-
|
|
1660
|
+
Q || window.addEventListener("resize", le);
|
|
1612
1661
|
const n = () => {
|
|
1613
|
-
t(
|
|
1662
|
+
t(B);
|
|
1614
1663
|
};
|
|
1615
|
-
return
|
|
1616
|
-
|
|
1664
|
+
return ee.add(n), () => {
|
|
1665
|
+
ee.delete(n), ee.size === 0 && (window.removeEventListener("resize", le), Q = !1);
|
|
1617
1666
|
};
|
|
1618
1667
|
}, []), e;
|
|
1619
1668
|
}
|
|
1620
|
-
const
|
|
1669
|
+
const jt = () => {
|
|
1621
1670
|
const e = E(!1);
|
|
1622
|
-
return
|
|
1671
|
+
return C(() => (e.current = !1, () => {
|
|
1623
1672
|
e.current = !0;
|
|
1624
1673
|
}), []), e;
|
|
1625
1674
|
};
|
|
1626
|
-
function
|
|
1627
|
-
const t =
|
|
1675
|
+
function Kn(e) {
|
|
1676
|
+
const t = jt(), [n, r] = b(e), s = q((o) => {
|
|
1628
1677
|
t.current || r(o);
|
|
1629
1678
|
}, []);
|
|
1630
1679
|
return [n, s];
|
|
1631
1680
|
}
|
|
1632
|
-
function
|
|
1633
|
-
const [n, r] =
|
|
1634
|
-
return
|
|
1681
|
+
function Jn(e, t = () => !0) {
|
|
1682
|
+
const [n, r] = De(), s = L(t);
|
|
1683
|
+
return U(
|
|
1635
1684
|
() => {
|
|
1636
|
-
const o =
|
|
1685
|
+
const o = D(e, document);
|
|
1637
1686
|
if (!o)
|
|
1638
1687
|
return;
|
|
1639
|
-
const
|
|
1640
|
-
let
|
|
1641
|
-
o === document ? document.scrollingElement ?
|
|
1688
|
+
const a = () => {
|
|
1689
|
+
let c;
|
|
1690
|
+
o === document ? document.scrollingElement ? c = {
|
|
1642
1691
|
left: document.scrollingElement.scrollLeft,
|
|
1643
1692
|
top: document.scrollingElement.scrollTop
|
|
1644
|
-
} :
|
|
1693
|
+
} : c = {
|
|
1645
1694
|
left: Math.max(
|
|
1646
1695
|
window.pageXOffset,
|
|
1647
1696
|
document.documentElement.scrollLeft,
|
|
@@ -1652,59 +1701,59 @@ function Kn(e, t = () => !0) {
|
|
|
1652
1701
|
document.documentElement.scrollTop,
|
|
1653
1702
|
document.body.scrollTop
|
|
1654
1703
|
)
|
|
1655
|
-
} :
|
|
1704
|
+
} : c = {
|
|
1656
1705
|
left: o.scrollLeft,
|
|
1657
1706
|
top: o.scrollTop
|
|
1658
|
-
}, s.current(
|
|
1707
|
+
}, s.current(c) && r(c);
|
|
1659
1708
|
};
|
|
1660
|
-
return
|
|
1661
|
-
o.removeEventListener("scroll",
|
|
1709
|
+
return a(), o.addEventListener("scroll", a), () => {
|
|
1710
|
+
o.removeEventListener("scroll", a);
|
|
1662
1711
|
};
|
|
1663
1712
|
},
|
|
1664
1713
|
[],
|
|
1665
1714
|
e
|
|
1666
1715
|
), n;
|
|
1667
1716
|
}
|
|
1668
|
-
function
|
|
1717
|
+
function Qn(e, t) {
|
|
1669
1718
|
let n = [], r;
|
|
1670
|
-
Array.isArray(t) ? n = t :
|
|
1671
|
-
const s = (g) => k(r) ? r(g) :
|
|
1719
|
+
Array.isArray(t) ? n = t : de(t) && (n = t?.defaultSelected ?? n, r = t?.itemKey ?? r);
|
|
1720
|
+
const s = (g) => k(r) ? r(g) : te(r) && de(g) ? g[r] : g, [o, a] = b(n), c = x(() => {
|
|
1672
1721
|
const g = /* @__PURE__ */ new Map();
|
|
1673
1722
|
return Array.isArray(o) && o.forEach((v) => {
|
|
1674
1723
|
g.set(s(v), v);
|
|
1675
1724
|
}), g;
|
|
1676
|
-
}, [o]), d = (g) =>
|
|
1677
|
-
|
|
1725
|
+
}, [o]), d = (g) => c.has(s(g)), i = (g) => {
|
|
1726
|
+
c.set(s(g), g), a(Array.from(c.values()));
|
|
1678
1727
|
}, l = (g) => {
|
|
1679
|
-
|
|
1728
|
+
c.delete(s(g)), a(Array.from(c.values()));
|
|
1680
1729
|
}, u = (g) => {
|
|
1681
1730
|
d(g) ? l(g) : i(g);
|
|
1682
1731
|
}, m = () => {
|
|
1683
1732
|
e.forEach((g) => {
|
|
1684
|
-
|
|
1685
|
-
}),
|
|
1733
|
+
c.set(s(g), g);
|
|
1734
|
+
}), a(Array.from(c.values()));
|
|
1686
1735
|
}, h = () => {
|
|
1687
1736
|
e.forEach((g) => {
|
|
1688
|
-
|
|
1689
|
-
}),
|
|
1737
|
+
c.delete(s(g));
|
|
1738
|
+
}), a(Array.from(c.values()));
|
|
1690
1739
|
}, p = x(
|
|
1691
|
-
() => e.every((g) => !
|
|
1692
|
-
[e,
|
|
1740
|
+
() => e.every((g) => !c.has(s(g))),
|
|
1741
|
+
[e, c]
|
|
1693
1742
|
), f = x(
|
|
1694
|
-
() => e.every((g) =>
|
|
1695
|
-
[e,
|
|
1743
|
+
() => e.every((g) => c.has(s(g))) && !p,
|
|
1744
|
+
[e, c, p]
|
|
1696
1745
|
), T = x(
|
|
1697
1746
|
() => !p && !f,
|
|
1698
1747
|
[p, f]
|
|
1699
|
-
),
|
|
1700
|
-
|
|
1748
|
+
), A = () => f ? h() : m(), O = () => {
|
|
1749
|
+
c.clear(), a([]);
|
|
1701
1750
|
};
|
|
1702
1751
|
return {
|
|
1703
1752
|
selected: o,
|
|
1704
1753
|
noneSelected: p,
|
|
1705
1754
|
allSelected: f,
|
|
1706
1755
|
partiallySelected: T,
|
|
1707
|
-
setSelected:
|
|
1756
|
+
setSelected: a,
|
|
1708
1757
|
isSelected: d,
|
|
1709
1758
|
select: y(i),
|
|
1710
1759
|
unSelect: y(l),
|
|
@@ -1712,47 +1761,22 @@ function Jn(e, t) {
|
|
|
1712
1761
|
selectAll: y(m),
|
|
1713
1762
|
unSelectAll: y(h),
|
|
1714
1763
|
clearAll: y(O),
|
|
1715
|
-
toggleAll: y(
|
|
1764
|
+
toggleAll: y(A)
|
|
1716
1765
|
};
|
|
1717
1766
|
}
|
|
1718
|
-
const
|
|
1719
|
-
() =>
|
|
1720
|
-
),
|
|
1767
|
+
const Zn = Ye(
|
|
1768
|
+
() => V ? sessionStorage : void 0
|
|
1769
|
+
), er = (e) => {
|
|
1721
1770
|
const [t, n] = b(e), r = y((s) => {
|
|
1722
1771
|
n((o) => {
|
|
1723
|
-
const
|
|
1724
|
-
return
|
|
1772
|
+
const a = k(s) ? s(o) : s;
|
|
1773
|
+
return a ? { ...o, ...a } : o;
|
|
1725
1774
|
});
|
|
1726
1775
|
});
|
|
1727
1776
|
return [t, r];
|
|
1728
|
-
},
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
const r = C(e);
|
|
1732
|
-
return r ? { width: r.clientWidth, height: r.clientHeight } : void 0;
|
|
1733
|
-
});
|
|
1734
|
-
return zt(
|
|
1735
|
-
() => {
|
|
1736
|
-
const r = C(e);
|
|
1737
|
-
if (!r)
|
|
1738
|
-
return;
|
|
1739
|
-
const s = new ResizeObserver((o) => {
|
|
1740
|
-
o.forEach((c) => {
|
|
1741
|
-
const { clientWidth: a, clientHeight: d } = c.target;
|
|
1742
|
-
n({ width: a, height: d });
|
|
1743
|
-
});
|
|
1744
|
-
});
|
|
1745
|
-
return s.observe(r), () => {
|
|
1746
|
-
s.disconnect();
|
|
1747
|
-
};
|
|
1748
|
-
},
|
|
1749
|
-
[],
|
|
1750
|
-
e
|
|
1751
|
-
), t;
|
|
1752
|
-
}
|
|
1753
|
-
const Bt = () => {
|
|
1754
|
-
const e = q ? window.matchMedia("(prefers-color-scheme: dark)") : void 0, [t, n] = b(() => q && e?.matches ? "dark" : "light");
|
|
1755
|
-
return D(() => {
|
|
1777
|
+
}, zt = () => {
|
|
1778
|
+
const e = V ? window.matchMedia("(prefers-color-scheme: dark)") : void 0, [t, n] = b(() => V && e?.matches ? "dark" : "light");
|
|
1779
|
+
return C(() => {
|
|
1756
1780
|
const r = (s) => {
|
|
1757
1781
|
s.matches ? n(
|
|
1758
1782
|
"dark"
|
|
@@ -1767,22 +1791,22 @@ const Bt = () => {
|
|
|
1767
1791
|
};
|
|
1768
1792
|
}, []), t;
|
|
1769
1793
|
};
|
|
1770
|
-
function
|
|
1771
|
-
const { localStorageKey: t } = e, [n, r] = b(() => t?.length && localStorage.getItem(t) || "system"), s = (
|
|
1772
|
-
r(
|
|
1773
|
-
}, o =
|
|
1794
|
+
function tr(e = {}) {
|
|
1795
|
+
const { localStorageKey: t } = e, [n, r] = b(() => t?.length && localStorage.getItem(t) || "system"), s = (c) => {
|
|
1796
|
+
r(c), t?.length && localStorage.setItem(t, c);
|
|
1797
|
+
}, o = zt();
|
|
1774
1798
|
return {
|
|
1775
1799
|
theme: n === "system" ? o : n,
|
|
1776
1800
|
themeMode: n,
|
|
1777
1801
|
setThemeMode: y(s)
|
|
1778
1802
|
};
|
|
1779
1803
|
}
|
|
1780
|
-
function
|
|
1781
|
-
|
|
1804
|
+
function ze(e, t) {
|
|
1805
|
+
re && (k(e) || console.error(
|
|
1782
1806
|
`useThrottleFn expected parameter is a function, got ${typeof e}`
|
|
1783
1807
|
));
|
|
1784
|
-
const n =
|
|
1785
|
-
() =>
|
|
1808
|
+
const n = L(e), r = t?.wait ?? 1e3, s = x(
|
|
1809
|
+
() => Me(
|
|
1786
1810
|
(...o) => n.current(...o),
|
|
1787
1811
|
r,
|
|
1788
1812
|
t
|
|
@@ -1797,62 +1821,62 @@ function Xe(e, t) {
|
|
|
1797
1821
|
flush: s.flush
|
|
1798
1822
|
};
|
|
1799
1823
|
}
|
|
1800
|
-
function
|
|
1801
|
-
const [n, r] = b(e), { run: s } =
|
|
1824
|
+
function nr(e, t) {
|
|
1825
|
+
const [n, r] = b(e), { run: s } = ze(() => {
|
|
1802
1826
|
r(e);
|
|
1803
1827
|
}, t);
|
|
1804
|
-
return
|
|
1828
|
+
return C(() => {
|
|
1805
1829
|
s();
|
|
1806
1830
|
}, [e]), n;
|
|
1807
1831
|
}
|
|
1808
|
-
function
|
|
1809
|
-
const [r, s] = b({}), { run: o } =
|
|
1832
|
+
function rr(e, t, n) {
|
|
1833
|
+
const [r, s] = b({}), { run: o } = ze(() => {
|
|
1810
1834
|
s({});
|
|
1811
1835
|
}, n);
|
|
1812
|
-
|
|
1836
|
+
C(() => o(), t), K(e, [r]);
|
|
1813
1837
|
}
|
|
1814
|
-
const
|
|
1815
|
-
const n = y(e), r = E(null), s =
|
|
1838
|
+
const sr = (e, t) => {
|
|
1839
|
+
const n = y(e), r = E(null), s = q(() => {
|
|
1816
1840
|
r.current && clearTimeout(r.current);
|
|
1817
1841
|
}, []);
|
|
1818
|
-
return
|
|
1842
|
+
return C(() => {
|
|
1819
1843
|
if (!(!F(t) || t < 0))
|
|
1820
1844
|
return r.current = setTimeout(n, t), s;
|
|
1821
1845
|
}, [t]), s;
|
|
1822
|
-
},
|
|
1846
|
+
}, Bt = {
|
|
1823
1847
|
restoreOnUnmount: !1
|
|
1824
1848
|
};
|
|
1825
|
-
function
|
|
1826
|
-
const n = E(
|
|
1827
|
-
|
|
1849
|
+
function or(e, t = Bt) {
|
|
1850
|
+
const n = E(V ? document.title : "");
|
|
1851
|
+
C(() => {
|
|
1828
1852
|
document.title = e;
|
|
1829
1853
|
}, [e]), W(() => {
|
|
1830
1854
|
t.restoreOnUnmount && (document.title = n.current);
|
|
1831
1855
|
});
|
|
1832
1856
|
}
|
|
1833
|
-
const qt = (e, t) => e ? e.map((n, r) => Object.is(e[r], t?.[r]) ? -1 : r).filter((n) => n >= 0) : t ? t.map((n, r) => r) : [],
|
|
1857
|
+
const qt = (e, t) => e ? e.map((n, r) => Object.is(e[r], t?.[r]) ? -1 : r).filter((n) => n >= 0) : t ? t.map((n, r) => r) : [], cr = (e, t) => {
|
|
1834
1858
|
const n = E(void 0);
|
|
1835
|
-
|
|
1859
|
+
C(() => {
|
|
1836
1860
|
const r = qt(n.current, t), s = n.current;
|
|
1837
1861
|
return n.current = t, e(r, s, t);
|
|
1838
1862
|
}, t);
|
|
1839
|
-
},
|
|
1863
|
+
}, ar = Ze(Pe), fe = nt, Vt = {
|
|
1840
1864
|
parseNumbers: !1,
|
|
1841
1865
|
parseBooleans: !1
|
|
1842
1866
|
}, Ut = {
|
|
1843
1867
|
skipNull: !1,
|
|
1844
1868
|
skipEmptyString: !1
|
|
1845
|
-
},
|
|
1869
|
+
}, ur = (e, t) => {
|
|
1846
1870
|
const {
|
|
1847
1871
|
navigateMode: n = "push",
|
|
1848
1872
|
parseOptions: r,
|
|
1849
1873
|
stringifyOptions: s
|
|
1850
|
-
} = t || {}, o = { ...
|
|
1874
|
+
} = t || {}, o = { ...Vt, ...r }, a = {
|
|
1851
1875
|
...Ut,
|
|
1852
1876
|
...s
|
|
1853
|
-
},
|
|
1877
|
+
}, c = fe.useLocation(), d = fe.useHistory?.(), i = fe.useNavigate?.(), l = ne(), u = E(
|
|
1854
1878
|
typeof e == "function" ? e() : e || {}
|
|
1855
|
-
), m = x(() =>
|
|
1879
|
+
), m = x(() => ae.parse(c.search, o), [c.search]), h = x(
|
|
1856
1880
|
() => ({
|
|
1857
1881
|
...u.current,
|
|
1858
1882
|
...m
|
|
@@ -1863,164 +1887,164 @@ const qt = (e, t) => e ? e.map((n, r) => Object.is(e[r], t?.[r]) ? -1 : r).filte
|
|
|
1863
1887
|
const T = typeof f == "function" ? f(h) : f;
|
|
1864
1888
|
l(), d && d[n](
|
|
1865
1889
|
{
|
|
1866
|
-
hash:
|
|
1867
|
-
search:
|
|
1890
|
+
hash: c.hash,
|
|
1891
|
+
search: ae.stringify(
|
|
1868
1892
|
{ ...m, ...T },
|
|
1869
|
-
|
|
1893
|
+
a
|
|
1870
1894
|
) || "?"
|
|
1871
1895
|
},
|
|
1872
|
-
|
|
1896
|
+
c.state
|
|
1873
1897
|
), i && i(
|
|
1874
1898
|
{
|
|
1875
|
-
hash:
|
|
1876
|
-
search:
|
|
1899
|
+
hash: c.hash,
|
|
1900
|
+
search: ae.stringify(
|
|
1877
1901
|
{ ...m, ...T },
|
|
1878
|
-
|
|
1902
|
+
a
|
|
1879
1903
|
) || "?"
|
|
1880
1904
|
},
|
|
1881
1905
|
{
|
|
1882
1906
|
replace: n === "replace",
|
|
1883
|
-
state:
|
|
1907
|
+
state: c.state
|
|
1884
1908
|
}
|
|
1885
1909
|
);
|
|
1886
1910
|
})];
|
|
1887
|
-
},
|
|
1888
|
-
const { containerTarget: n, wrapperTarget: r, itemHeight: s, overscan: o = 5 } = t,
|
|
1911
|
+
}, ir = (e, t) => {
|
|
1912
|
+
const { containerTarget: n, wrapperTarget: r, itemHeight: s, overscan: o = 5 } = t, a = L(s), c = tt(n), d = E(!1), [i, l] = b(
|
|
1889
1913
|
[]
|
|
1890
1914
|
), [u, m] = b({}), h = (g, v) => {
|
|
1891
|
-
if (F(
|
|
1892
|
-
return Math.ceil(g /
|
|
1893
|
-
let
|
|
1915
|
+
if (F(a.current))
|
|
1916
|
+
return Math.ceil(g / a.current);
|
|
1917
|
+
let S = 0, R = 0;
|
|
1894
1918
|
for (let N = v; N < e.length; N++) {
|
|
1895
|
-
const I =
|
|
1896
|
-
if (
|
|
1919
|
+
const I = a.current(N, e[N]);
|
|
1920
|
+
if (S += I, R = N, S >= g)
|
|
1897
1921
|
break;
|
|
1898
1922
|
}
|
|
1899
1923
|
return R - v;
|
|
1900
1924
|
}, p = (g) => {
|
|
1901
|
-
if (F(
|
|
1902
|
-
return Math.floor(g /
|
|
1903
|
-
let v = 0,
|
|
1925
|
+
if (F(a.current))
|
|
1926
|
+
return Math.floor(g / a.current);
|
|
1927
|
+
let v = 0, S = 0;
|
|
1904
1928
|
for (let R = 0; R < e.length; R++) {
|
|
1905
|
-
const N =
|
|
1929
|
+
const N = a.current(R, e[R]);
|
|
1906
1930
|
if (v += N, v >= g) {
|
|
1907
|
-
|
|
1931
|
+
S = R;
|
|
1908
1932
|
break;
|
|
1909
1933
|
}
|
|
1910
1934
|
}
|
|
1911
|
-
return
|
|
1912
|
-
}, f = (g) => F(
|
|
1913
|
-
(
|
|
1935
|
+
return S + 1;
|
|
1936
|
+
}, f = (g) => F(a.current) ? g * a.current : e.slice(0, g).reduce(
|
|
1937
|
+
(S, R, N) => S + a.current(N, e[N]),
|
|
1914
1938
|
0
|
|
1915
|
-
), T = x(() => F(
|
|
1916
|
-
(g, v,
|
|
1939
|
+
), T = x(() => F(a.current) ? e.length * a.current : e.reduce(
|
|
1940
|
+
(g, v, S) => g + a.current(S, e[S]),
|
|
1917
1941
|
0
|
|
1918
|
-
), [e]),
|
|
1919
|
-
const g =
|
|
1942
|
+
), [e]), A = () => {
|
|
1943
|
+
const g = D(n);
|
|
1920
1944
|
if (g) {
|
|
1921
|
-
const { scrollTop: v, clientHeight:
|
|
1945
|
+
const { scrollTop: v, clientHeight: S } = g, R = p(v), N = h(S, R), I = Math.max(0, R - o), w = Math.min(e.length, R + N + o), Y = f(I);
|
|
1922
1946
|
m({
|
|
1923
1947
|
height: T - Y + "px",
|
|
1924
1948
|
marginTop: Y + "px"
|
|
1925
1949
|
}), l(
|
|
1926
|
-
e.slice(I,
|
|
1927
|
-
data:
|
|
1928
|
-
index:
|
|
1950
|
+
e.slice(I, w).map((P, _) => ({
|
|
1951
|
+
data: P,
|
|
1952
|
+
index: _ + I
|
|
1929
1953
|
}))
|
|
1930
1954
|
);
|
|
1931
1955
|
}
|
|
1932
1956
|
};
|
|
1933
1957
|
return K(() => {
|
|
1934
|
-
const g =
|
|
1958
|
+
const g = D(r);
|
|
1935
1959
|
g && Object.keys(u).forEach(
|
|
1936
1960
|
(v) => g.style[v] = u[v]
|
|
1937
1961
|
);
|
|
1938
|
-
}, [u]),
|
|
1939
|
-
!
|
|
1940
|
-
}, [
|
|
1962
|
+
}, [u]), C(() => {
|
|
1963
|
+
!c?.width || !c?.height || A();
|
|
1964
|
+
}, [c?.width, c?.height, e]), j(
|
|
1941
1965
|
"scroll",
|
|
1942
1966
|
(g) => {
|
|
1943
1967
|
if (d.current) {
|
|
1944
1968
|
d.current = !1;
|
|
1945
1969
|
return;
|
|
1946
1970
|
}
|
|
1947
|
-
g.preventDefault(),
|
|
1971
|
+
g.preventDefault(), A();
|
|
1948
1972
|
},
|
|
1949
1973
|
{
|
|
1950
1974
|
target: n
|
|
1951
1975
|
}
|
|
1952
1976
|
), [i, y((g) => {
|
|
1953
|
-
const v =
|
|
1954
|
-
v && (d.current = !0, v.scrollTop = f(g),
|
|
1977
|
+
const v = D(n);
|
|
1978
|
+
v && (d.current = !0, v.scrollTop = f(g), A());
|
|
1955
1979
|
})];
|
|
1956
1980
|
};
|
|
1957
|
-
function
|
|
1981
|
+
function lr(e, t = {}) {
|
|
1958
1982
|
const {
|
|
1959
1983
|
reconnectLimit: n = 3,
|
|
1960
1984
|
reconnectInterval: r = 3 * 1e3,
|
|
1961
1985
|
manual: s = !1,
|
|
1962
1986
|
onOpen: o,
|
|
1963
|
-
onClose:
|
|
1964
|
-
onMessage:
|
|
1987
|
+
onClose: a,
|
|
1988
|
+
onMessage: c,
|
|
1965
1989
|
onError: d,
|
|
1966
1990
|
protocols: i
|
|
1967
1991
|
} = t, [l, u] = b(), [m, h] = b(
|
|
1968
1992
|
3
|
|
1969
1993
|
/* Closed */
|
|
1970
|
-
), p =
|
|
1971
|
-
g.current < n &&
|
|
1994
|
+
), p = L(o), f = L(a), T = L(c), A = L(d), O = L(m), g = E(0), v = E(void 0), S = E(void 0), R = () => {
|
|
1995
|
+
g.current < n && S.current?.readyState !== 1 && (v.current && clearTimeout(v.current), v.current = setTimeout(() => {
|
|
1972
1996
|
N(), g.current++;
|
|
1973
1997
|
}, r));
|
|
1974
1998
|
}, N = () => {
|
|
1975
|
-
v.current && clearTimeout(v.current),
|
|
1976
|
-
const
|
|
1999
|
+
v.current && clearTimeout(v.current), S.current && S.current.close();
|
|
2000
|
+
const P = new WebSocket(e, i);
|
|
1977
2001
|
h(
|
|
1978
2002
|
0
|
|
1979
2003
|
/* Connecting */
|
|
1980
|
-
),
|
|
1981
|
-
|
|
1982
|
-
|
|
2004
|
+
), P.onerror = (_) => {
|
|
2005
|
+
S.current === P && (R(), A.current?.(_, P), h(
|
|
2006
|
+
P.readyState || 3
|
|
1983
2007
|
/* Closed */
|
|
1984
2008
|
));
|
|
1985
|
-
},
|
|
1986
|
-
|
|
1987
|
-
|
|
2009
|
+
}, P.onopen = (_) => {
|
|
2010
|
+
S.current === P && (p.current?.(_, P), g.current = 0, h(
|
|
2011
|
+
P.readyState || 1
|
|
1988
2012
|
/* Open */
|
|
1989
2013
|
));
|
|
1990
|
-
},
|
|
1991
|
-
|
|
1992
|
-
},
|
|
1993
|
-
f.current?.(
|
|
1994
|
-
|
|
2014
|
+
}, P.onmessage = (_) => {
|
|
2015
|
+
S.current === P && (T.current?.(_, P), u(_));
|
|
2016
|
+
}, P.onclose = (_) => {
|
|
2017
|
+
f.current?.(_, P), S.current === P && R(), (!S.current || S.current === P) && h(
|
|
2018
|
+
P.readyState || 3
|
|
1995
2019
|
/* Closed */
|
|
1996
2020
|
);
|
|
1997
|
-
},
|
|
1998
|
-
}, I = (
|
|
2021
|
+
}, S.current = P;
|
|
2022
|
+
}, I = (P) => {
|
|
1999
2023
|
if (O.current === 1)
|
|
2000
|
-
|
|
2024
|
+
S.current?.send(P);
|
|
2001
2025
|
else
|
|
2002
2026
|
throw new Error("WebSocket disconnected");
|
|
2003
|
-
},
|
|
2027
|
+
}, w = () => {
|
|
2004
2028
|
g.current = 0, N();
|
|
2005
2029
|
}, Y = () => {
|
|
2006
|
-
v.current && clearTimeout(v.current), g.current = n,
|
|
2030
|
+
v.current && clearTimeout(v.current), g.current = n, S.current?.close(), S.current = void 0;
|
|
2007
2031
|
};
|
|
2008
|
-
return
|
|
2009
|
-
!s && e &&
|
|
2032
|
+
return C(() => {
|
|
2033
|
+
!s && e && w();
|
|
2010
2034
|
}, [e, s]), W(() => {
|
|
2011
2035
|
Y();
|
|
2012
2036
|
}), {
|
|
2013
2037
|
latestMessage: l,
|
|
2014
2038
|
sendMessage: y(I),
|
|
2015
|
-
connect: y(
|
|
2039
|
+
connect: y(w),
|
|
2016
2040
|
disconnect: y(Y),
|
|
2017
2041
|
readyState: m,
|
|
2018
|
-
webSocketIns:
|
|
2042
|
+
webSocketIns: S.current
|
|
2019
2043
|
};
|
|
2020
2044
|
}
|
|
2021
|
-
function
|
|
2045
|
+
function fr(e, t) {
|
|
2022
2046
|
const n = E({});
|
|
2023
|
-
|
|
2047
|
+
C(() => {
|
|
2024
2048
|
if (n.current) {
|
|
2025
2049
|
const r = Object.keys({ ...n.current, ...t }), s = {};
|
|
2026
2050
|
r.forEach((o) => {
|
|
@@ -2034,46 +2058,45 @@ function lr(e, t) {
|
|
|
2034
2058
|
});
|
|
2035
2059
|
}
|
|
2036
2060
|
export {
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2061
|
+
or as $,
|
|
2062
|
+
kn as A,
|
|
2063
|
+
xn as B,
|
|
2064
|
+
_n as C,
|
|
2065
|
+
Hn as D,
|
|
2042
2066
|
In as E,
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2067
|
+
Yn as F,
|
|
2068
|
+
Fe as G,
|
|
2069
|
+
Xn as H,
|
|
2070
|
+
jn as I,
|
|
2071
|
+
zn as J,
|
|
2072
|
+
Bn as K,
|
|
2073
|
+
qn as L,
|
|
2074
|
+
Vn as M,
|
|
2075
|
+
Un as N,
|
|
2076
|
+
ke as O,
|
|
2077
|
+
$n as P,
|
|
2078
|
+
Gn as Q,
|
|
2079
|
+
Kn as R,
|
|
2080
|
+
Jn as S,
|
|
2081
|
+
Qn as T,
|
|
2082
|
+
Zn as U,
|
|
2083
|
+
er as V,
|
|
2084
|
+
tr as W,
|
|
2085
|
+
nr as X,
|
|
2086
|
+
rr as Y,
|
|
2087
|
+
ze as Z,
|
|
2088
|
+
sr as _,
|
|
2065
2089
|
Wn as a,
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
xn as c,
|
|
2090
|
+
st as a0,
|
|
2091
|
+
cr as a1,
|
|
2092
|
+
jt as a2,
|
|
2093
|
+
ar as a3,
|
|
2094
|
+
ur as a4,
|
|
2095
|
+
ir as a5,
|
|
2096
|
+
lr as a6,
|
|
2097
|
+
fr as a7,
|
|
2098
|
+
ot as b,
|
|
2099
|
+
Fn as c,
|
|
2077
2100
|
mn as d,
|
|
2078
2101
|
gn as e,
|
|
2079
2102
|
hn as f,
|
|
@@ -2081,20 +2104,20 @@ export {
|
|
|
2081
2104
|
vn as h,
|
|
2082
2105
|
yn as i,
|
|
2083
2106
|
En as j,
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2107
|
+
Ne as k,
|
|
2108
|
+
Sn as l,
|
|
2109
|
+
wn as m,
|
|
2087
2110
|
bn as n,
|
|
2088
2111
|
Rn as o,
|
|
2089
2112
|
Tn as p,
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2113
|
+
j as q,
|
|
2114
|
+
Ln as r,
|
|
2115
|
+
An as s,
|
|
2116
|
+
Pn as t,
|
|
2094
2117
|
dn as u,
|
|
2095
|
-
|
|
2096
|
-
|
|
2118
|
+
Cn as v,
|
|
2119
|
+
Dn as w,
|
|
2097
2120
|
Mn as x,
|
|
2098
2121
|
Nn as y,
|
|
2099
|
-
|
|
2122
|
+
On as z
|
|
2100
2123
|
};
|