@unicom-cloud/ui 0.8.109 → 0.8.110

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