@gientech/modual 2.0.4 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (419) hide show
  1. package/.editorconfig +38 -0
  2. package/.prettierignore +16 -0
  3. package/.prettierrc +17 -0
  4. package/README.md +643 -643
  5. package/USAGE.md +247 -0
  6. package/bash.exe.stackdump +40 -0
  7. package/components.json +21 -0
  8. package/dist/README.md +643 -0
  9. package/{assets/GientechStreamReader-CzB5AuYo.js → dist/assets/GientechStreamReader-DUCq-O5X.js} +1 -1
  10. package/{assets → dist/assets}/database.svg +11 -11
  11. package/{assets → dist/assets}/database_add.svg +53 -53
  12. package/{assets → dist/assets}/database_connect.svg +66 -66
  13. package/{assets → dist/assets}/database_upload.svg +29 -29
  14. package/{assets → dist/assets}/databse.svg +6 -6
  15. package/{assets → dist/assets}/defaultWeLogo.svg +14 -14
  16. package/{assets → dist/assets}/graph.svg +4 -4
  17. package/{assets/index-CN2AYX8Q.js → dist/assets/index-B2yNvzjy.js} +1 -1
  18. package/{assets/index-D9lYd8TZ.js → dist/assets/index-BKe5FgcC.js} +1 -1
  19. package/{assets/index-CBTA5S-5.js → dist/assets/index-D72cKELw.js} +1 -1
  20. package/{assets/index-s0cmC4Ks.js → dist/assets/index-DdVFXD_y.js} +1 -1
  21. package/{assets/index-B1ZDDbC1.js → dist/assets/index-DrkSoKz6.js} +1 -1
  22. package/{assets/index-B2rFliXg.js → dist/assets/index-KCfkkJKb.js} +1 -1
  23. package/{assets/index-DnBY0UXI.js → dist/assets/index-QI9biQrR.js} +2 -2
  24. package/{assets/index-DYhXjvk4.js → dist/assets/index-ZopkeZtI.js} +1 -1
  25. package/{assets/index-LDFwTu47.js → dist/assets/index-g-SUxfJH.js} +1 -1
  26. package/{assets/index-NFQIKNFn.js → dist/assets/index-j0kQJd0a.js} +1 -1
  27. package/{assets → dist/assets}/knowledge.svg +4 -4
  28. package/{assets/MySQL.svg → dist/assets/mysql.svg} +14 -14
  29. package/{assets/plus-G7zGXf6S.js → dist/assets/plus-V9zUoSq6.js} +1 -1
  30. package/{assets → dist/assets}/sensitive.svg +5 -5
  31. package/{assets/style-Bn7b5XHU.js → dist/assets/style-CGmZ5osp.js} +2 -2
  32. package/{assets/x-vfKYzKkK.js → dist/assets/x-CnaaLGJF.js} +1 -1
  33. package/dist/assistantConfig.js +1 -0
  34. package/dist/chat.js +824 -0
  35. package/dist/database.js +20 -0
  36. package/dist/databaseId.js +1 -0
  37. package/{databaseTable.js → dist/databaseTable.js} +1 -1
  38. package/dist/index.js +1 -0
  39. package/{modelManage.js → dist/modelManage.js} +1 -1
  40. package/dist/package.json +68 -0
  41. package/{sensitive.js → dist/sensitive.js} +1 -1
  42. package/dist/streamFilesReader.js +1 -0
  43. package/{worker → dist/worker}/pdf.worker.min.js +21 -21
  44. package/doc_assets/2.png +0 -0
  45. package/doc_assets/demo.md +27 -0
  46. package/doc_assets/demos/dist-app/assets/index.Dh-ZAS9Z.css +2 -0
  47. package/doc_assets/demos/dist-app/assets/index.Dv8KVW18.js +23699 -0
  48. package/doc_assets/demos/dist-app/assets/index.Dv8KVW18.js.map +1 -0
  49. package/doc_assets/demos/dist-app/index.html +14 -0
  50. package/doc_assets/demos/dist-app/vite.svg +1 -0
  51. package/doc_assets/images/1.png +0 -0
  52. package/doc_assets/images/3.png +0 -0
  53. package/doc_assets/images/component-screenshot.png +1 -0
  54. package/doc_assets/install.md +5 -0
  55. package/doc_assets//346/226/271/346/241/210//344/274/230/345/214/226/346/226/271/346/241/210-/345/244/232/344/274/232/350/257/235SSE/350/277/236/346/216/245/347/256/241/347/220/206.md +504 -0
  56. package/eslint.config.js +92 -0
  57. package/index.html +13 -0
  58. package/package.json +106 -44
  59. package/package.json.demo-backup +109 -0
  60. package/postcss.config.cjs +19 -0
  61. package/public/icons/answerAwartar.png +0 -0
  62. package/public/icons/docx-file.png +0 -0
  63. package/public/icons/folder.png +0 -0
  64. package/public/icons/html.png +0 -0
  65. package/public/icons/image.png +0 -0
  66. package/public/icons/jpg-file.png +0 -0
  67. package/public/icons/json.png +0 -0
  68. package/public/icons/md.png +0 -0
  69. package/public/icons/pdf.png +0 -0
  70. package/public/icons/pptx.png +0 -0
  71. package/public/icons/questionAwartar.png +0 -0
  72. package/public/icons/sheets.png +0 -0
  73. package/public/icons/txt.png +0 -0
  74. package/public/icons/xlsx.png +0 -0
  75. package/public/vite.svg +1 -0
  76. package/public/worker/pdf.worker.min.js +22 -0
  77. package/scripts/README.md +133 -0
  78. package/scripts/build-demo.js +88 -0
  79. package/scripts/decrypt-api-key.js +95 -0
  80. package/scripts/demo-selector.js +216 -0
  81. package/scripts/dev-demo.js +76 -0
  82. package/scripts/preview-demo.js +130 -0
  83. package/scripts/run-demo.bat +34 -0
  84. package/src/assets/img/close.png +0 -0
  85. package/src/assets/img/database.png +0 -0
  86. package/src/assets/img/downArrow.png +0 -0
  87. package/src/assets/img/downLoad.png +0 -0
  88. package/src/assets/img/excel.png +0 -0
  89. package/src/assets/img/graphIcon.png +0 -0
  90. package/src/assets/img/img.png +0 -0
  91. package/src/assets/img/pdf.png +0 -0
  92. package/src/assets/img/ppt.png +0 -0
  93. package/src/assets/img/singleQa.png +0 -0
  94. package/src/assets/img/txt.png +0 -0
  95. package/src/assets/img/webSearch.png +0 -0
  96. package/src/assets/img/word.png +0 -0
  97. package/src/assets/login/homeBg.png +0 -0
  98. package/src/assets/login/left.jpg +0 -0
  99. package/src/assets/login/logoImg.png +0 -0
  100. package/src/examples/ConversationAssistantPage/index.tsx +41 -0
  101. package/src/examples/Demo/index.tsx +12 -0
  102. package/src/examples/LoginPage/index.tsx +18 -0
  103. package/src/examples/chat/components/DrawerGraphPreview.tsx +78 -0
  104. package/src/examples/chat/index.tsx +154 -0
  105. package/src/examples/chat/logo03.png +0 -0
  106. package/src/examples/gientechStreamFilesReader/index.tsx +951 -0
  107. package/src/examples/headlessChat/index.tsx +234 -0
  108. package/src/examples/ragDatabaseDataPage/index.tsx +40 -0
  109. package/src/examples/ragDatabaseIdPage/index.tsx +47 -0
  110. package/src/examples/ragDatabasePage/index.tsx +36 -0
  111. package/src/examples/ragModelManagePage/index.tsx +38 -0
  112. package/src/examples/ragSearchPage/index.tsx +0 -0
  113. package/src/examples/ragSensitiveWordsPage/index.tsx +32 -0
  114. package/src/examples/streamFiles/index.tsx +417 -0
  115. package/src/lib_enter.ts +43 -0
  116. package/src/main.tsx +5 -0
  117. package/src/main.tsx.backup +5 -0
  118. package/src/modules/CHAT_UNIFICATION_PLAN.md +324 -0
  119. package/src/modules/assistantConfig/assets/databse.svg +6 -0
  120. package/src/modules/assistantConfig/assets/empty.png +0 -0
  121. package/src/modules/assistantConfig/assets/graph.svg +4 -0
  122. package/src/modules/assistantConfig/assets/knowledge.svg +4 -0
  123. package/src/modules/assistantConfig/assets/sensitive.svg +5 -0
  124. package/src/modules/assistantConfig/components/Database.tsx +171 -0
  125. package/src/modules/assistantConfig/components/Graph.tsx +177 -0
  126. package/src/modules/assistantConfig/components/Knowledge.tsx +276 -0
  127. package/src/modules/assistantConfig/components/NotFoundContent.tsx +21 -0
  128. package/src/modules/assistantConfig/components/Paragraph.tsx +51 -0
  129. package/src/modules/assistantConfig/components/ParamsItem.tsx +39 -0
  130. package/src/modules/assistantConfig/components/ResourceBinderItem.tsx +133 -0
  131. package/src/modules/assistantConfig/components/SearchableSelector.tsx +500 -0
  132. package/src/modules/assistantConfig/components/Sensitive.tsx +221 -0
  133. package/src/modules/assistantConfig/components/SliderInput.tsx +65 -0
  134. package/src/modules/assistantConfig/constants.tsx +75 -0
  135. package/src/modules/assistantConfig/index.tsx +710 -0
  136. package/src/modules/assistantConfig/server.ts +262 -0
  137. package/src/modules/chat/Conversations/Item.tsx +167 -0
  138. package/src/modules/chat/Conversations/List.tsx +210 -0
  139. package/src/modules/chat/Conversations/groupByTime.ts +39 -0
  140. package/src/modules/chat/Conversations/index.tsx +252 -0
  141. package/src/modules/chat/ReferenceBar.tsx +622 -0
  142. package/src/modules/chat/constants.tsx +52 -0
  143. package/src/modules/chat/data.txt +82 -0
  144. package/src/modules/chat/index.tsx +2054 -0
  145. package/src/modules/chat/referenceCom/DeleteModal.tsx +75 -0
  146. package/src/modules/chat/referenceCom/DrawerContent.tsx +136 -0
  147. package/src/modules/chat/referenceCom/DrawerDatabase.tsx +102 -0
  148. package/src/modules/chat/referenceCom/DrawerGraphPreview.tsx +86 -0
  149. package/src/modules/chat/referenceCom/DrawerPreview.tsx +73 -0
  150. package/src/modules/chat/referenceCom/DrawerTitle.tsx +26 -0
  151. package/src/modules/chat/referenceCom/RenameModal.tsx +86 -0
  152. package/src/modules/chat/referenceCom/TagCom.tsx +30 -0
  153. package/src/modules/chat/style.less +3 -0
  154. package/src/modules/chat/types.ts +17 -0
  155. package/src/modules/chat/utils/index.ts +348 -0
  156. package/src/modules/database/CreateModal.tsx +403 -0
  157. package/src/modules/database/assets/Doris.png +0 -0
  158. package/src/modules/database/assets/PostgreSQL.png +0 -0
  159. package/src/modules/database/assets/SQLServer.png +0 -0
  160. package/src/modules/database/assets/database.svg +11 -0
  161. package/src/modules/database/assets/database_add.svg +53 -0
  162. package/src/modules/database/assets/database_connect.svg +66 -0
  163. package/src/modules/database/assets/database_upload.svg +29 -0
  164. package/src/modules/database/assets/empty.png +0 -0
  165. package/src/modules/database/assets/mysql.svg +14 -0
  166. package/src/modules/database/index.tsx +477 -0
  167. package/src/modules/database/server.ts +196 -0
  168. package/src/modules/databaseId/CustomCom.tsx +156 -0
  169. package/src/modules/databaseId/EditConfig.tsx +280 -0
  170. package/src/modules/databaseId/UploadDrawer.tsx +535 -0
  171. package/src/modules/databaseId/assets/aiOptimize.svg +10 -0
  172. package/src/modules/databaseId/assets/empty.png +0 -0
  173. package/src/modules/databaseId/assets/template.svg +6 -0
  174. package/src/modules/databaseId/assets/upload.svg +9 -0
  175. package/src/modules/databaseId/assets/useTemp.svg +6 -0
  176. package/src/modules/databaseId/index.tsx +769 -0
  177. package/src/modules/databaseId/server.ts +286 -0
  178. package/src/modules/databaseId/style.css +5 -0
  179. package/src/modules/databaseTable/EditRowDrawer.tsx +124 -0
  180. package/src/modules/databaseTable/index.tsx +359 -0
  181. package/src/modules/databaseTable/server.ts +180 -0
  182. package/src/modules/headlessChat/ReferenceBar.tsx +783 -0
  183. package/src/modules/headlessChat/constants.tsx +54 -0
  184. package/src/modules/headlessChat/index.tsx +1706 -0
  185. package/src/modules/headlessChat/referenceCom/DeleteModal.tsx +75 -0
  186. package/src/modules/headlessChat/referenceCom/DrawerContent.tsx +136 -0
  187. package/src/modules/headlessChat/referenceCom/DrawerDatabase.tsx +102 -0
  188. package/src/modules/headlessChat/referenceCom/DrawerGraphPreview.tsx +86 -0
  189. package/src/modules/headlessChat/referenceCom/DrawerPreview.tsx +73 -0
  190. package/src/modules/headlessChat/referenceCom/DrawerTitle.tsx +26 -0
  191. package/src/modules/headlessChat/referenceCom/RenameModal.tsx +86 -0
  192. package/src/modules/headlessChat/referenceCom/TagCom.tsx +30 -0
  193. package/src/modules/headlessChat/style.less +3 -0
  194. package/src/modules/headlessChat/types.ts +23 -0
  195. package/src/modules/headlessChat/utils/index.ts +348 -0
  196. package/src/modules/login/components/Login/LoginBox/index.tsx +102 -0
  197. package/src/modules/login/components/Login/RegisterBox/index.tsx +180 -0
  198. package/src/modules/login/components/Login/index.tsx +100 -0
  199. package/src/modules/login/index.tsx +106 -0
  200. package/src/modules/login/style.css +3 -0
  201. package/src/modules/login/useServices.ts +53 -0
  202. package/src/modules/login/utils.ts +42 -0
  203. package/src/modules/modelManage/ConfigDrawer.tsx +249 -0
  204. package/src/modules/modelManage/ReplaceModal.tsx +124 -0
  205. package/src/modules/modelManage/assets/empty.png +0 -0
  206. package/src/modules/modelManage/const.ts +51 -0
  207. package/src/modules/modelManage/index.tsx +606 -0
  208. package/src/modules/modelManage/server.ts +223 -0
  209. package/src/modules/nodegraph/index.tsx +1 -0
  210. package/src/modules/search/assets/Icon-history.svg +8 -0
  211. package/src/modules/search/assets/answerAwartar.png +0 -0
  212. package/src/modules/search/assets/doc.png +0 -0
  213. package/src/modules/search/assets/genera.gif +0 -0
  214. package/src/modules/search/assets/icon-robot.svg +9 -0
  215. package/src/modules/search/assets/icon-search-bar.svg +14 -0
  216. package/src/modules/search/assets/icon-sub-title.svg +3 -0
  217. package/src/modules/search/assets/icon-title.svg +9 -0
  218. package/src/modules/search/assets/icon-zoomOut.svg +9 -0
  219. package/src/modules/search/assets/iconAi.svg +9 -0
  220. package/src/modules/search/assets/pdf.png +0 -0
  221. package/src/modules/search/assets/ppt.png +0 -0
  222. package/src/modules/search/assets/search.svg +3 -0
  223. package/src/modules/search/assets/selected.svg +4 -0
  224. package/src/modules/search/assets/txt.png +0 -0
  225. package/src/modules/search/assets/xls.png +0 -0
  226. package/src/modules/search/components/AssisSelect.tsx +137 -0
  227. package/src/modules/search/components/Editor/ChatViewEditor.tsx +261 -0
  228. package/src/modules/search/components/Editor/aichat.css +1 -0
  229. package/src/modules/search/components/Editor/constant.ts +13 -0
  230. package/src/modules/search/components/Editor/index.tsx +113 -0
  231. package/src/modules/search/components/Editor/plugins/autofomatRules.ts +332 -0
  232. package/src/modules/search/components/Editor/plugins/convertImgPlugins.tsx +20 -0
  233. package/src/modules/search/components/Editor/plugins/createIndexes.tsx +38 -0
  234. package/src/modules/search/components/Editor/plugins/displayer.ts +298 -0
  235. package/src/modules/search/components/Editor/plugins/imageClick.tsx +32 -0
  236. package/src/modules/search/components/Editor/plugins/myplugin.tsx +98 -0
  237. package/src/modules/search/components/Editor/ui/avatar.tsx +19 -0
  238. package/src/modules/search/components/Editor/ui/blockquote-element.tsx +21 -0
  239. package/src/modules/search/components/Editor/ui/button.tsx +58 -0
  240. package/src/modules/search/components/Editor/ui/calendar.tsx +68 -0
  241. package/src/modules/search/components/Editor/ui/caption.tsx +46 -0
  242. package/src/modules/search/components/Editor/ui/checkbox.tsx +27 -0
  243. package/src/modules/search/components/Editor/ui/code-block-combobox.tsx +188 -0
  244. package/src/modules/search/components/Editor/ui/code-block-element.css +434 -0
  245. package/src/modules/search/components/Editor/ui/code-block-element.tsx +39 -0
  246. package/src/modules/search/components/Editor/ui/code-leaf.tsx +24 -0
  247. package/src/modules/search/components/Editor/ui/code-line-element.tsx +10 -0
  248. package/src/modules/search/components/Editor/ui/code-syntax-leaf.tsx +21 -0
  249. package/src/modules/search/components/Editor/ui/column-element.tsx +30 -0
  250. package/src/modules/search/components/Editor/ui/column-group-element.tsx +94 -0
  251. package/src/modules/search/components/Editor/ui/command.tsx +75 -0
  252. package/src/modules/search/components/Editor/ui/comment-avatar.tsx +22 -0
  253. package/src/modules/search/components/Editor/ui/comment-create-form.tsx +37 -0
  254. package/src/modules/search/components/Editor/ui/comment-item.tsx +74 -0
  255. package/src/modules/search/components/Editor/ui/comment-leaf.tsx +49 -0
  256. package/src/modules/search/components/Editor/ui/comment-more-dropdown.tsx +42 -0
  257. package/src/modules/search/components/Editor/ui/comment-reply-items.tsx +22 -0
  258. package/src/modules/search/components/Editor/ui/comment-resolve-button.tsx +32 -0
  259. package/src/modules/search/components/Editor/ui/comment-value.tsx +34 -0
  260. package/src/modules/search/components/Editor/ui/comments-popover.tsx +63 -0
  261. package/src/modules/search/components/Editor/ui/date-element.tsx +83 -0
  262. package/src/modules/search/components/Editor/ui/dialog.tsx +63 -0
  263. package/src/modules/search/components/Editor/ui/draggable.tsx +177 -0
  264. package/src/modules/search/components/Editor/ui/dropdown-menu.tsx +180 -0
  265. package/src/modules/search/components/Editor/ui/emoji-input-element.tsx +85 -0
  266. package/src/modules/search/components/Editor/ui/excalidraw-element.tsx +28 -0
  267. package/src/modules/search/components/Editor/ui/fixed-toolbar-buttons.tsx +76 -0
  268. package/src/modules/search/components/Editor/ui/fixed-toolbar.tsx +8 -0
  269. package/src/modules/search/components/Editor/ui/floating-toolbar-buttons.tsx +51 -0
  270. package/src/modules/search/components/Editor/ui/floating-toolbar.tsx +77 -0
  271. package/src/modules/search/components/Editor/ui/heading-element.tsx +48 -0
  272. package/src/modules/search/components/Editor/ui/highlight-leaf.tsx +17 -0
  273. package/src/modules/search/components/Editor/ui/hr-element.tsx +30 -0
  274. package/src/modules/search/components/Editor/ui/icons.tsx +267 -0
  275. package/src/modules/search/components/Editor/ui/image-element.tsx +74 -0
  276. package/src/modules/search/components/Editor/ui/inline-combobox.tsx +368 -0
  277. package/src/modules/search/components/Editor/ui/input.tsx +25 -0
  278. package/src/modules/search/components/Editor/ui/insert-dropdown-menu.tsx +218 -0
  279. package/src/modules/search/components/Editor/ui/kbd-leaf.tsx +20 -0
  280. package/src/modules/search/components/Editor/ui/link-element.tsx +29 -0
  281. package/src/modules/search/components/Editor/ui/link-floating-toolbar.tsx +161 -0
  282. package/src/modules/search/components/Editor/ui/list-element.tsx +30 -0
  283. package/src/modules/search/components/Editor/ui/mark-toolbar-button.tsx +24 -0
  284. package/src/modules/search/components/Editor/ui/media-embed-element.tsx +133 -0
  285. package/src/modules/search/components/Editor/ui/media-popover.tsx +97 -0
  286. package/src/modules/search/components/Editor/ui/mention-element.tsx +43 -0
  287. package/src/modules/search/components/Editor/ui/mention-input-element.tsx +141 -0
  288. package/src/modules/search/components/Editor/ui/mode-dropdown-menu.tsx +93 -0
  289. package/src/modules/search/components/Editor/ui/more-dropdown-menu.tsx +67 -0
  290. package/src/modules/search/components/Editor/ui/paragraph-element.tsx +4 -0
  291. package/src/modules/search/components/Editor/ui/placeholder.tsx +52 -0
  292. package/src/modules/search/components/Editor/ui/popover.tsx +32 -0
  293. package/src/modules/search/components/Editor/ui/resizable.tsx +66 -0
  294. package/src/modules/search/components/Editor/ui/separator.tsx +25 -0
  295. package/src/modules/search/components/Editor/ui/style.less +12 -0
  296. package/src/modules/search/components/Editor/ui/table-cell-element.tsx +143 -0
  297. package/src/modules/search/components/Editor/ui/table-element.tsx +243 -0
  298. package/src/modules/search/components/Editor/ui/table-row-element.tsx +22 -0
  299. package/src/modules/search/components/Editor/ui/tableValue.tsx +135 -0
  300. package/src/modules/search/components/Editor/ui/todo-list-element.tsx +43 -0
  301. package/src/modules/search/components/Editor/ui/toggle-element.tsx +31 -0
  302. package/src/modules/search/components/Editor/ui/toolbar.tsx +157 -0
  303. package/src/modules/search/components/Editor/ui/tooltip.tsx +65 -0
  304. package/src/modules/search/components/Editor/ui/turn-into-dropdown-menu.tsx +160 -0
  305. package/src/modules/search/components/Editor/ui/with-draggables.tsx +175 -0
  306. package/src/modules/search/components/FileList.tsx +287 -0
  307. package/src/modules/search/components/ImageGroupView/index.tsx +85 -0
  308. package/src/modules/search/components/ResultContent.tsx +232 -0
  309. package/src/modules/search/components/SearchInput.tsx +232 -0
  310. package/src/modules/search/components/SearchLanding.tsx +74 -0
  311. package/src/modules/search/components/SearchView.tsx +563 -0
  312. package/src/modules/search/components/SimpleEditor.tsx +158 -0
  313. package/src/modules/search/components/SimpleFileList.tsx +215 -0
  314. package/src/modules/search/index.tsx +10 -0
  315. package/src/modules/search/reademe.md +1 -0
  316. package/src/modules/search/servers/apis.tsx +19 -0
  317. package/src/modules/search/servers/index.ts +184 -0
  318. package/src/modules/search/style.less +503 -0
  319. package/src/modules/search/type.ts +22 -0
  320. package/src/modules/search/utils.ts +34 -0
  321. package/src/modules/sensitive/index.tsx +313 -0
  322. package/src/modules/sensitive/server.ts +122 -0
  323. package/src/modules/streamFilesReader/GientechStreamReader.tsx +1625 -0
  324. package/src/modules/streamFilesReader/components/Header/Toolbar.tsx +0 -0
  325. package/src/modules/streamFilesReader/components/Header/index.tsx +297 -0
  326. package/src/modules/streamFilesReader/index.tsx +3 -0
  327. package/src/style.css +6 -0
  328. package/src/type.d.ts +0 -0
  329. package/src/utils/commonFn.tsx +111 -0
  330. package/src/utils/decryptApiKey.ts +40 -0
  331. package/src/utils/gientechCommon/components/AppError.tsx +32 -0
  332. package/src/utils/gientechCommon/components/AppLoading.tsx +75 -0
  333. package/src/utils/gientechCommon/components/DeleteModal.tsx +75 -0
  334. package/src/utils/gientechCommon/components/DisplayError.tsx +33 -0
  335. package/src/utils/gientechCommon/components/DisplayLoading.tsx +38 -0
  336. package/src/utils/gientechCommon/components/FeedBackModal.tsx +319 -0
  337. package/src/utils/gientechCommon/components/FileCardCommon.tsx +82 -0
  338. package/src/utils/gientechCommon/components/FileManager/index.tsx +400 -0
  339. package/src/utils/gientechCommon/components/FileManager/style.css +5 -0
  340. package/src/utils/gientechCommon/components/Messages/GientechNewChatWelcome.tsx +581 -0
  341. package/src/utils/gientechCommon/components/Messages/ReferenceCard.tsx +359 -0
  342. package/src/utils/gientechCommon/components/Messages/RetriveItem.tsx +245 -0
  343. package/src/utils/gientechCommon/components/Messages/WebRetriveItem.tsx +209 -0
  344. package/src/utils/gientechCommon/components/Messages/defaultBot.png +0 -0
  345. package/src/utils/gientechCommon/components/Messages/defaultStyleSet.tsx +148 -0
  346. package/src/utils/gientechCommon/components/Messages/defaultWeLogo.svg +14 -0
  347. package/src/utils/gientechCommon/components/RenameModal.tsx +86 -0
  348. package/src/utils/gientechCommon/components/style.less +11 -0
  349. package/src/utils/gientechCommon/configs/commonConfig.ts +2 -0
  350. package/src/utils/gientechCommon/configs/senderConfig.ts +0 -0
  351. package/src/utils/gientechCommon/configs/stylesConfig.ts +142 -0
  352. package/src/utils/gientechCommon/hooks/AichatUseController.tsx +417 -0
  353. package/src/utils/gientechCommon/hooks/useFileDisplayTools.tsx +204 -0
  354. package/src/utils/gientechCommon/hooks/useFileManager.ts +193 -0
  355. package/src/utils/gientechCommon/slate/converters/deserializers.ts +763 -0
  356. package/src/utils/gientechCommon/slate/converters/mockData.ts +232 -0
  357. package/src/utils/gientechCommon/slate/converters/slateConverters.ts +258 -0
  358. package/src/utils/gientechCommon/slate/richElements/index.tsx +499 -0
  359. package/src/utils/gientechCommon/utils/fileUtils.ts +86 -0
  360. package/src/utils/gientechCommon/utils/request.ts +37 -0
  361. package/src/utils/gientechCommon/utils/serverFn.ts +172 -0
  362. package/src/utils/index.tsx +142 -0
  363. package/src/utils/testconfigs/demologin/index.tsx +32 -0
  364. package/src/utils/testconfigs/index.ts +59 -0
  365. package/src/vite-env.d.ts +42 -0
  366. package/stats.html +4949 -0
  367. package/tailwind.config.js +170 -0
  368. package/tsconfig.app.json +30 -0
  369. package/tsconfig.app.tsbuildinfo +11 -0
  370. package/tsconfig.json +13 -0
  371. package/tsconfig.node.json +22 -0
  372. package/tsconfig.node.tsbuildinfo +1 -0
  373. package/vite.config.app.ts +93 -0
  374. package/vite.config.ts +232 -0
  375. package/workflows/release.yml +60 -0
  376. package//346/215/242/350/241/214/346/240/274/345/274/217/344/277/235/346/214/201/344/274/230/345/214/226/346/226/271/346/241/210.md +359 -0
  377. package/assistantConfig.js +0 -1
  378. package/chat.js +0 -786
  379. package/database.js +0 -20
  380. package/databaseId.js +0 -1
  381. package/index.js +0 -1
  382. package/streamFilesReader.js +0 -1
  383. /package/{assets → dist/assets}/Doris.png +0 -0
  384. /package/{assets → dist/assets}/PostgreSQL.png +0 -0
  385. /package/{assets → dist/assets}/SQLServer.png +0 -0
  386. /package/{assets → dist/assets}/empty.png +0 -0
  387. /package/{assets → dist/assets}/homeBg.png +0 -0
  388. /package/{assets → dist/assets}/index-CpW6Dhpp.js +0 -0
  389. /package/{assets → dist/assets}/left.jpg +0 -0
  390. /package/{assets → dist/assets}/logoImg.png +0 -0
  391. /package/{assets → dist/assets}/style.css +0 -0
  392. /package/{assets → dist/assets}/style2.css +0 -0
  393. /package/{assets → dist/assets}/style3.css +0 -0
  394. /package/{assets → dist/assets}/style4.css +0 -0
  395. /package/{assets → dist/assets}/worker-BbpylX7l.js +0 -0
  396. /package/{assistantConfig.d.ts → dist/assistantConfig.d.ts} +0 -0
  397. /package/{chat.d.ts → dist/chat.d.ts} +0 -0
  398. /package/{database.d.ts → dist/database.d.ts} +0 -0
  399. /package/{databaseId.d.ts → dist/databaseId.d.ts} +0 -0
  400. /package/{databaseTable.d.ts → dist/databaseTable.d.ts} +0 -0
  401. /package/{icons → dist/icons}/answerAwartar.png +0 -0
  402. /package/{icons → dist/icons}/docx-file.png +0 -0
  403. /package/{icons → dist/icons}/folder.png +0 -0
  404. /package/{icons → dist/icons}/html.png +0 -0
  405. /package/{icons → dist/icons}/image.png +0 -0
  406. /package/{icons → dist/icons}/jpg-file.png +0 -0
  407. /package/{icons → dist/icons}/json.png +0 -0
  408. /package/{icons → dist/icons}/md.png +0 -0
  409. /package/{icons → dist/icons}/pdf.png +0 -0
  410. /package/{icons → dist/icons}/pptx.png +0 -0
  411. /package/{icons → dist/icons}/questionAwartar.png +0 -0
  412. /package/{icons → dist/icons}/sheets.png +0 -0
  413. /package/{icons → dist/icons}/txt.png +0 -0
  414. /package/{icons → dist/icons}/xlsx.png +0 -0
  415. /package/{index.d.ts → dist/index.d.ts} +0 -0
  416. /package/{modelManage.d.ts → dist/modelManage.d.ts} +0 -0
  417. /package/{sensitive.d.ts → dist/sensitive.d.ts} +0 -0
  418. /package/{streamFilesReader.d.ts → dist/streamFilesReader.d.ts} +0 -0
  419. /package/{vite.svg → dist/vite.svg} +0 -0
@@ -1,6 +1,6 @@
1
- import{jsx as a,jsxs as O,Fragment as he}from"react/jsx-runtime";import*as j from"react";import{isValidElement as $e,useMemo as ie,useState as h,useRef as Ce,useCallback as ue,useEffect as xe}from"react";import{u as Ve}from"./index-CpW6Dhpp.js";import{F as Pe,J as K,C as Re,T as je,U as We,m as Ue}from"./index-CN2AYX8Q.js";import{a as He,g as Ge,m as Ze,$ as qe,a0 as Ye,r as Ke,a1 as Xe,a2 as Je,a3 as Qe,l as et,f as le,a4 as tt,u as ut,a5 as at,T as ce,Z as st,o as ot,M as nt,b as rt,a6 as it,i as be}from"./index-LDFwTu47.js";import{O as we}from"./index-DYhXjvk4.js";/* empty css */import{s as Y,M as ye}from"./style-Bn7b5XHU.js";import{I as ke}from"./index-B2rFliXg.js";import{D as Ie}from"./index-CBTA5S-5.js";import{X as ge}from"./x-vfKYzKkK.js";import"react-dom";import{B as De,T as Te}from"./index-s0cmC4Ks.js";/**
1
+ import{jsx as a,jsxs as O,Fragment as he}from"react/jsx-runtime";import*as j from"react";import{isValidElement as $e,useMemo as ie,useState as h,useRef as Ce,useCallback as ue,useEffect as xe}from"react";import{u as Ve}from"./index-CpW6Dhpp.js";import{F as Pe,J as K,C as Re,T as je,U as We,m as Ue}from"./index-B2yNvzjy.js";import{a as He,g as Ge,m as Ze,$ as qe,a0 as Ye,r as Ke,a1 as Xe,a2 as Je,a3 as Qe,l as et,f as le,a4 as tt,u as ut,a5 as at,T as ce,Z as st,o as ot,M as nt,b as rt,a6 as it,i as be}from"./index-g-SUxfJH.js";import{O as we}from"./index-ZopkeZtI.js";/* empty css */import{s as Y,M as ye}from"./style-CGmZ5osp.js";import{I as ke}from"./index-KCfkkJKb.js";import{D as Ie}from"./index-D72cKELw.js";import{X as ge}from"./x-CnaaLGJF.js";import"react-dom";import{B as De,T as Te}from"./index-DdVFXD_y.js";/**
2
2
  * @license lucide-react v0.456.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const lt=He("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),de=e=>e?typeof e=="function"?e():e:null,ct=e=>{const{componentCls:r,popoverColor:o,titleMinWidth:s,fontWeightStrong:i,innerPadding:p,boxShadowSecondary:S,colorTextHeading:m,borderRadiusLG:_,zIndexPopup:B,titleMarginBottom:b,colorBgElevated:E,popoverBg:F,titleBorderBottom:L,innerContentPadding:$,titlePadding:x}=e;return[{[r]:Object.assign(Object.assign({},Ke(e)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:B,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:["var(--valid-offset-x, 50%)","var(--arrow-y, 50%)"].join(" "),"--antd-arrow-background-color":E,width:"max-content",maxWidth:"100vw","&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${r}-content`]:{position:"relative"},[`${r}-inner`]:{backgroundColor:F,backgroundClip:"padding-box",borderRadius:_,boxShadow:S,padding:p},[`${r}-title`]:{minWidth:s,marginBottom:b,color:m,fontWeight:i,borderBottom:L,padding:x},[`${r}-inner-content`]:{color:o,padding:$}})},Ye(e,"var(--antd-arrow-background-color)"),{[`${r}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block",[`${r}-content`]:{display:"inline-block"}}}]},dt=e=>{const{componentCls:r}=e;return{[r]:Xe.map(o=>{const s=e[`${o}6`];return{[`&${r}-${o}`]:{"--antd-arrow-background-color":s,[`${r}-inner`]:{backgroundColor:s},[`${r}-arrow`]:{background:"transparent"}}}})}},pt=e=>{const{lineWidth:r,controlHeight:o,fontHeight:s,padding:i,wireframe:p,zIndexPopupBase:S,borderRadiusLG:m,marginXS:_,lineType:B,colorSplit:b,paddingSM:E}=e,F=o-s,L=F/2,$=F/2-r,x=i;return Object.assign(Object.assign(Object.assign({titleMinWidth:177,zIndexPopup:S+30},Je(e)),Qe({contentRadius:m,limitVerticalRadius:!0})),{innerPadding:p?0:12,titleMarginBottom:p?0:_,titlePadding:p?`${L}px ${x}px ${$}px`:0,titleBorderBottom:p?`${r}px ${B} ${b}`:"none",innerContentPadding:p?`${E}px ${x}px`:0})},Se=Ge("Popover",e=>{const{colorBgElevated:r,colorText:o}=e,s=Ze(e,{popoverBg:r,popoverColor:o});return[ct(s),dt(s),qe(s,"zoom-big")]},pt,{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]});var mt=function(e,r){var o={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&r.indexOf(s)<0&&(o[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,s=Object.getOwnPropertySymbols(e);i<s.length;i++)r.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(o[s[i]]=e[s[i]]);return o};const Me=({title:e,content:r,prefixCls:o})=>!e&&!r?null:j.createElement(j.Fragment,null,e&&j.createElement("div",{className:`${o}-title`},e),r&&j.createElement("div",{className:`${o}-inner-content`},r)),Ft=e=>{const{hashId:r,prefixCls:o,className:s,style:i,placement:p="top",title:S,content:m,children:_}=e,B=de(S),b=de(m),E=le(r,o,`${o}-pure`,`${o}-placement-${p}`,s);return j.createElement("div",{className:E,style:i},j.createElement("div",{className:`${o}-arrow`}),j.createElement(tt,Object.assign({},e,{className:r,prefixCls:o}),_||j.createElement(Me,{prefixCls:o,title:B,content:b})))},ft=e=>{const{prefixCls:r,className:o}=e,s=mt(e,["prefixCls","className"]),{getPrefixCls:i}=j.useContext(et),p=i("popover",r),[S,m,_]=Se(p);return S(j.createElement(Ft,Object.assign({},s,{prefixCls:p,hashId:m,className:le(o,_)})))};var Ct=function(e,r){var o={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&r.indexOf(s)<0&&(o[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,s=Object.getOwnPropertySymbols(e);i<s.length;i++)r.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(o[s[i]]=e[s[i]]);return o};const gt=j.forwardRef((e,r)=>{var o,s;const{prefixCls:i,title:p,content:S,overlayClassName:m,placement:_="top",trigger:B="hover",children:b,mouseEnterDelay:E=.1,mouseLeaveDelay:F=.1,onOpenChange:L,overlayStyle:$={},styles:x,classNames:M}=e,t=Ct(e,["prefixCls","title","content","overlayClassName","placement","trigger","children","mouseEnterDelay","mouseLeaveDelay","onOpenChange","overlayStyle","styles","classNames"]),{getPrefixCls:n,className:c,style:l,classNames:A,styles:D}=ut("popover"),y=n("popover",i),[C,W,G]=Se(y),Z=n(),q=le(m,W,G,c,A.root,M==null?void 0:M.root),se=le(A.body,M==null?void 0:M.body),[oe,ne]=at(!1,{value:(o=e.open)!==null&&o!==void 0?o:e.visible,defaultValue:(s=e.defaultOpen)!==null&&s!==void 0?s:e.defaultVisible}),X=(P,J)=>{ne(P,!0),L==null||L(P,J)},re=P=>{P.keyCode===nt.ESC&&X(!1,P)},ae=P=>{X(P)},Q=de(p),ee=de(S);return C(j.createElement(ce,Object.assign({placement:_,trigger:B,mouseEnterDelay:E,mouseLeaveDelay:F},t,{prefixCls:y,classNames:{root:q,body:se},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},D.root),l),$),x==null?void 0:x.root),body:Object.assign(Object.assign({},D.body),x==null?void 0:x.body)},ref:r,open:oe,onOpenChange:ae,overlay:Q||ee?j.createElement(Me,{prefixCls:y,title:Q,content:ee}):null,transitionName:st(Z,"zoom-big",t.transitionName),"data-popover-inject":!0}),ot(b,{onKeyDown:P=>{var J,te;$e(b)&&((te=b==null?void 0:(J=b.props).onKeyDown)===null||te===void 0||te.call(J,P)),re(P)}})))}),Ne=gt;Ne._InternalPanelDoNotUseOrYouWillBeFired=ft;const Et="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%201C13.4997%201.50025%2013.25%201.99975%2013.25%202.5C13.25%203.00025%2013.4997%203.49975%2014%204C13.4997%203.49975%2013.0003%203.25%2012.5%203.25C11.9997%203.25%2011.5003%203.49975%2011%204C11.5003%203.49975%2011.75%203.00025%2011.75%202.5C11.75%201.99975%2011.5003%201.50025%2011%201C11.5003%201.50025%2011.9997%201.75%2012.5%201.75C13.0003%201.75%2013.4997%201.50025%2014%201Z'%20fill='%23055AFF'/%3e%3cpath%20d='M13%206.28571V13C13%2013.5523%2012.5523%2014%2012%2014H4C3.44772%2014%203%2013.5523%203%2013V3C3%202.44772%203.44772%202%204%202H9.25'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cline%20x1='5.65'%20y1='6.35'%20x2='10.35'%20y2='6.35'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cline%20x1='5.65'%20y1='9.35'%20x2='8.35'%20y2='9.35'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3c/svg%3e",yt="data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42%2022C43.1046%2022%2044%2022.8954%2044%2024V42C44%2043.1046%2043.1046%2044%2042%2044H6C4.89543%2044%204%2043.1046%204%2042V24.0088C4%2022.9042%204.89543%2022.0078%206%2022.0078C7.10457%2022.0078%208%2022.9042%208%2024.0088V40H40V24C40%2022.8954%2040.8954%2022%2042%2022ZM24.0293%204.00195C24.0808%204.00272%2024.1322%204.00504%2024.1836%204.00977C24.1904%204.01042%2024.1973%204.011%2024.2041%204.01172C24.2673%204.01819%2024.3301%204.02757%2024.3926%204.04004C24.3939%204.04031%2024.3952%204.04075%2024.3965%204.04102C24.7693%204.11623%2025.125%204.29691%2025.4141%204.58594L34.4141%2013.5859C35.1951%2014.367%2035.1951%2015.633%2034.4141%2016.4141C33.633%2017.1951%2032.367%2017.1951%2031.5859%2016.4141L25.9922%2010.8203V32C25.9922%2033.1046%2025.0968%2034%2023.9922%2034C22.8876%2034%2021.9922%2033.1046%2021.9922%2032V10.8359L16.4141%2016.4141C15.633%2017.1951%2014.367%2017.1951%2013.5859%2016.4141C12.8049%2015.633%2012.8049%2014.367%2013.5859%2013.5859L22.498%204.67285C22.8016%204.33138%2023.2194%204.09559%2023.6924%204.02441C23.7122%204.02135%2023.732%204.01809%2023.752%204.01562C23.7862%204.01152%2023.8207%204.00919%2023.8555%204.00684C23.8887%204.00446%2023.9218%204.00268%2023.9551%204.00195C23.9674%204.00173%2023.9798%204%2023.9922%204C24.0046%204%2024.0169%204.00173%2024.0293%204.00195Z'%20fill='url(%23paint0_linear_4072_34663)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_4072_34663'%20x1='4'%20y1='-7.25'%20x2='54.4707'%20y2='1.556'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%232B69FF'/%3e%3cstop%20offset='1'%20stop-color='%238F91FF'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",ze=({url:e,token:r,role:o,eventsEmit:s})=>{const i=rt.create({baseURL:e,timeout:1e6});return i.interceptors.request.use(t=>{let n=r;return!n&&!["user/login","user/kaptcha","user/regist"].some(l=>t.url.includes(l))?(s&&s("request:error_auth",{errorMsg:"\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F",redirect:"/login"}),Promise.reject(new Error("\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"))):(t.headers.Authorization=n||"",t.headers.userName=o==="\u672A\u767B\u5F55\u7528\u6237"?"":o,t)}),i.interceptors.response.use(t=>{const n=["user/kaptcha"],c=t.data;if(n.some(y=>t.config.url&&t.config.url.includes(y))||c.size&&c.type)return c;const{success:l,errorMsg:A,errorCode:D}=c;if(l)return c;s&&s("request:error_business",{errorCode:D,errorMsg:A||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",response:c})},t=>{var n,c,l,A,D,y,C,W,G;if(t.message==="canceled")return Promise.reject(t);if(s){let Z="request:error_network",q={errorMsg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:t};((n=t==null?void 0:t.response)==null?void 0:n.status)===401?(Z="request:error_auth",q={errorMsg:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650",error:t,redirect:"/login"}):(((l=(c=t==null?void 0:t.response)==null?void 0:c.data)==null?void 0:l.errorCode)==="30013"||((D=(A=t==null?void 0:t.response)==null?void 0:A.data)==null?void 0:D.errorCode)==="30023")&&(Z="request:error_business",q={errorCode:(C=(y=t==null?void 0:t.response)==null?void 0:y.data)==null?void 0:C.errorCode,errorMsg:((G=(W=t==null?void 0:t.response)==null?void 0:W.data)==null?void 0:G.errorMsg)||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",error:t}),s(Z,q)}return Promise.reject(t)}),{getTableList:async t=>{try{const n=await i.get(`/directDB/queryTableList/${t}`),{success:c,data:l}=n;if(c)return l}catch(n){console.log("getTableList error:",n)}},getTableTreeList:async t=>{try{const n=await i.get(`/dataTable/queryTableFileTreeList/${t}`),{success:c,data:l}=n;if(c)return l}catch(n){console.log("getTableTreeList error:",n)}},getDBDetailById:async(t,n)=>{const c=Be(n);try{const l=await i.get(`/${c}/queryDBInfo/${t}`),{success:A,data:D}=l;if(A)return D}catch(l){console.log("getDBDetailById error:",l)}},delTableById:async(t,n)=>{const c=Be(n);try{const l=await i.delete(`/${c}/deleteTable/${t}`),{success:A,data:D}=l;if(A)return D}catch(l){console.log("delTableById error:",l)}},delFileById:async t=>{try{const n=await i.delete(`/dataTable/deleteTableFileData/${t}`),{success:c,data:l}=n;if(c)return l}catch(n){console.log("delFileById",n)}},parseFiles:async({fileIds:t,isGenDescription:n,tableDescriptionMap:c})=>{try{const l=await i.post("/dataTable/parseFiles",{fileIds:t,isGenDescription:n,tableDescriptionMap:c}),{success:A,data:D}=l;if(A)return D}catch(l){console.log("parseFiles error:",l)}},reParseFile:async t=>{try{const n=await i.post(`/dataTable/reParseFile/${t}`),{success:c,data:l}=n;if(c)return l}catch(n){console.log("reParseFile error:",n)}},parseAppendFile:async({fileIds:t,tableId:n})=>{try{const c=await i.post("/dataTable/parseAppendFiles",{fileIds:t,tableId:n}),{success:l,data:A}=c;if(l)return A}catch(c){console.log("parseAppendFile error:",c)}},deleteUploadedFiles:async t=>{try{const n=await i.post("/dataTable/cancelUploadFile",{fileIds:t}),{success:c,data:l}=n;if(c)return l}catch(n){console.log("deleteUploadedFiles error:",n)}},getTableInfoById:async t=>{try{const n=await i.get(`/dataTable/queryTableMeta/${t}`),{success:c,data:l}=n;if(c)return l}catch(n){console.log("getTableInfoById error:",n)}},updateTableInfo:async({tableId:t,description:n,businessName:c})=>{try{const l=await i.post("/dataTable/updateTableInfo",{tableId:t,businessName:c,description:n}),{success:A,data:D}=l;if(A)return D}catch(l){console.log("updateTableInfo error:",l)}},optimizeDesc:async t=>{try{const n=await i.get(`/genTableDescription/${t}`),{success:c,data:l}=n;if(c)return l}catch(n){console.log("optimizeDesc error:",n)}}}},Be=e=>e=="DataTable"?"dataTable":"directDB",me='<template key="type" placeholder="\u8F93\u5165\u8868\u683C\u7C7B\u578B"></template>\u8868\u683C\u4E3B\u8981\u5C55\u793A\u4E86<template key="scene" placeholder="\u8F93\u5165\u573A\u666F\u540D\u79F0"></template>\u573A\u666F\u7684\u6570\u636E,\u5305\u542B<template key="primary_key" placeholder="\u4E3B\u8981\u5B57\u6BB5(\u53EF\u5199\u591A\u4E2A,\u7528\u987F\u53F7\u5206\u9694)"></template>\u7B49\u4E3B\u8981\u5B57\u6BB5,\u652F\u6301\u7528\u6237\u67E5\u8BE2<template key="search_direction" placeholder="\u5927\u6982\u4ECB\u7ECD\u9700\u8981\u67E5\u8BE2\u7684\u65B9\u5411"></template>\u95EE\u9898,\u5982\u679C\u8BBE\u8BA1\u591A\u8868\u5173\u8054\u67E5\u8BE2,\u6700\u597D\u8BF4\u660E\u6B64\u8868\u683C\u901A\u8FC7<template key="key_name" placeholder="\u5B57\u6BB5\u540D\u79F0"></template>\u5B57\u6BB5\u53EF\u4EE5\u5173\u8054\u53E6\u4E00\u4E2A<template key="table_name" placeholder="\u8868\u683C\u540D\u79F0"></template>\u8868\u683C\u3002',ht={colors:{background:"#ffffff",border:"#e5e7eb",appBackground:"#ffffff",listBackground:"#ffffff",dashboardBackground:"#ffffff"},space:{padding:"0",margin:"md",shadow:"none"}},bt=({drawerTitle:e,drawerVisible:r,uploadUrl:o,handleDrawerClose:s,dbId:i,tableInfo:p,token:S,url:m,role:_})=>{const B=ie(()=>({id:"upload",layout:"vertical",formWidth:"670px",fields:[{id:"fileIds",name:"fileIds",type:"uploader",required:!1,defaultValue:"",uploaderConfig:{multiple:!p,accept:".csv,.xlsx,.xls",maxFiles:p?1:20,url:o,autoUpload:!0,headers:{Authorization:S},queryParams:{databaseId:i,...p&&{tableId:p.tableId}},placeholder:O("div",{children:[a("div",{className:"text-lg font-bold",children:"\u70B9\u51FB\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u5904\u4E0A\u4F20"}),O("div",{className:"flex flex-col gap-1.8 mt-[12px]",children:[a("div",{className:"text-[#888888] font-[12px]",children:"\u6570\u91CF\uFF1A\u226420 \u6587\u4EF6\uFF08\u5F53\u524D 0/20\uFF09"}),a("div",{className:"text-[#888888] font-[12px]",style:{width:"580px"},children:"\u683C\u5F0F\uFF1A.xlsx / .xls / .csv /\uFF08\u7B2C\u4E00\u884C\u662F\u8868\u5934\uFF0C\u5176\u4ED6\u884C\u662F\u6570\u636E\uFF1BCSV \u652F\u6301 UTF-8/GBK/GB2312\u2026\uFF09"}),a("div",{className:"text-[#888888] font-[12px]",children:"\u5355\u6587\u4EF6\u9650\u5236\uFF1A \u226410\u4E07\u884C\uFF0C\u226460\u5217\uFF08\u8D85\u51FA\u81EA\u52A8\u5FFD\u7565\uFF09\uFF1B \u6BCF\u6587\u4EF6 \u22641\u4E2ASheet"}),a("div",{className:"text-[#888888] font-[12px]",children:"\u4E0A\u4F20\u7684\u6587\u4EF6\uFF0C\u5982\u679C\u6709\u4E0D\u7B26\u5408\u6587\u672C\u683C\u5F0F\u7684\u6570\u636E\u7CFB\u7EDF\u81EA\u52A8\u5FFD\u7565"})]})]}),listName:p?"\u8FFD\u52A0\u6587\u4EF6":"\u4E0A\u4F20\u6587\u4EF6\u5217\u8868",icons:{dragUpload:a("img",{src:yt,width:40}),itemStatus:{pending:a("span",{style:{fontSize:"12px",color:"#6b7280"}}),uploading:a("span",{style:{fontSize:"12px",color:"#007bff"}}),success:a("span",{style:{fontSize:"12px",color:"#10b981"}}),error:a("span",{style:{fontSize:"12px",color:"#ef4444"},children:"\u5931\u8D25"})},fileType:{default:a(Pe,{size:20,style:{color:"#6b7280"}})}},...!p&&{buttons:[{label:"\u4F7F\u7528\u6A21\u7248",icon:a("img",{src:Et}),mode:"text",onClick:()=>{l(!0)}}]},...!p&&{itemForm:[{type:"textarea",name:"description",counter:150,placeholder:"\u4E3A\u4E86\u63D0\u9AD8\u95EE\u7B54\u51C6\u786E\u7387\uFF0C\u8BF7\u8F93\u5165\u63CF\u8FF0"}]}}}]}),[p]),[b,E]=h(!1),[F,L]=h({}),$=Ce(null),[x,M]=h(!1),[t,n]=h([]),[c,l]=h(!1),[A,D]=h(me),[y,C]=h(null),[W,G]=h(me),[Z,q]=h(0),{parseFiles:se,parseAppendFile:oe,deleteUploadedFiles:ne}=ze({url:m,token:S,role:_}),X=ue(async(g,f,V)=>{var w;switch(console.log("[DynamicFormAdopter] \u4E8B\u4EF6:",g,f),g){case"form:ready":f.formRef?$.current=f.formRef:console.log("\u274C data.formRef \u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u4FDD\u5B58\u8868\u5355\u5F15\u7528");break;case"form:submit":ae();break;case"form_field_change":L(k=>({...k,[f.fieldId]:f.value}));break;case"uploader:error":(w=f.item)!=null&&w.id?n(k=>[{id:f.item.id,status:f.item.status},...k]):Y.error(f==null?void 0:f.message);break;case"uploader:success":n(k=>[{id:f.item.id,status:f.item.status},...k]);break;case"uploader:remove":const U=f.item.status;n(k=>k.filter(d=>d.id!==f.item.id)),U=="success"&&await ee([f.item.uploadApiRes]);break;default:console.log("\u672A\u5904\u7406\u7684\u4E8B\u4EF6:",g)}},[]),re=ie(()=>({label:"\u52A8\u6001\u8868\u5355\u793A\u4F8B",defaultActiveId:"form-view",model:null,views:[{label:"\u7528\u6237\u6CE8\u518C\u8868\u5355",id:"form-view",type:"form",size:"md",formWidth:B.formWidth,formConfig:{layout:B.layout,showReset:!1,showSubmit:!1,formWidth:B.formWidth,getFormData:()=>({...F,timestamp:new Date().toISOString(),formId:B.id}),onFieldChange:(g,f)=>{X("form_field_change",{fieldId:g,value:f},void 0)},onValidationError:g=>{X("form_validation_error",g,void 0)}}}],dataSource:[{id:B.id,fields:B.fields,defaultValues:{}}],eventsEmit:X,styles:{theme:ht}}),[p,B]),ae=async()=>{var g;try{E(!0);const f=await $.current.getAllData();if(f.isValid){const V=(g=f.fields.find(w=>w.name=="fileIds"))==null?void 0:g.value;if(Array.isArray(V)&&(V==null?void 0:V.length)>0){let w;if(p)w=await oe({fileIds:V.map(U=>U.uploadApiRes),tableId:p.id});else{const U={fileIds:V.map(k=>k.uploadApiRes),tableDescriptionMap:V.reduce((k,d)=>(k[d.uploadApiRes]=d.formData.description,k),{}),isGenDescription:x};w=await se(U)}w&&s("refresh")}}}catch(f){console.error("\u8868\u5355\u6570\u636E\u5931\u8D25:",f)}finally{s(),E(!1),M(!1)}},Q=async g=>{var f;try{const V=await $.current.getAllData();if(V.isValid){const w=(f=V.fields.find(U=>U.name=="fileIds"))==null?void 0:f.value;if(w&&Array.isArray(w)&&(w==null?void 0:w.length)>0){const U=w.map(d=>d.uploadApiRes),k=await ee(U)}}}catch(V){console.error("\u8868\u5355\u6570\u636E\u5931\u8D25:",V)}finally{s(),M(!1)}},ee=async g=>{try{const f=await ne(g);if(f)return f}catch(f){console.error("\u5220\u9664\u6587\u4EF6\u6570\u636E\u5931\u8D25:",f)}},P=g=>{M(g)},J=ue(g=>{D(g),console.log("\u6A21\u7248\u5185\u5BB9\u53D8\u5316:",g)},[]),te=ue(g=>{C(()=>g),console.log("getData\u51FD\u6570\u5DF2\u8BBE\u7F6E")},[]),pe=ue(async()=>{try{if(!y){console.error("getData\u51FD\u6570\u5C1A\u672A\u51C6\u5907\u597D\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}const g=y("pure_string");await navigator.clipboard.writeText(g),Y.success("\u5DF2\u590D\u5236",1)}catch(g){console.error("\u590D\u5236\u5931\u8D25:",g)}finally{l(!1)}},[y]);return O(Ie,{title:e,className:"database-upload-drawer",placement:"right",width:720,closeIcon:!1,extra:a(ge,{size:20,color:"#888888",onClick:()=>Q(),className:"cursor-pointer"}),open:r,destroyOnHidden:!0,footer:O("div",{className:"flex items-center",style:{justifyContent:p?"end":"space-between"},children:[!p&&O("div",{className:"flex gap-2 items-center",children:[a("span",{children:"\u81EA\u52A8\u751F\u6210\u6570\u636E\u8868\u63CF\u8FF0"})," ",a(ce,{title:"\u81EA\u52A8\u751F\u6210\u5F00\u542F\u65F6\u5C06\u57FA\u4E8E\u6570\u636E\u667A\u80FD\u751F\u6210\u63CF\u8FF0\uFF1B\u82E5\u5F00\u542F\u6B64\u529F\u80FD\u5E76\u624B\u52A8\u586B\u5199\u63CF\u8FF0\uFF0C\u5C06\u4F18\u5148\u91C7\u7528\u7528\u6237\u586B\u5199\u7684\u5185\u5BB9\u3002",children:a(Re,{size:14})}),a(it,{onChange:P})]}),O("div",{className:"flex self-end gap-3",children:[a(K,{mode:"default",style:{marginRight:10},label:"\u53D6\u6D88",onClick:Q}),a(K,{mode:"primary",label:"\u786E\u8BA4\u5BFC\u5165",loading:b,disabled:t.some(g=>g.status=="error"),onClick:async()=>{await ae()}})]})]}),children:[a(we,{...re},"upload-file"),a(ye,{title:O("div",{children:["\u6A21\u7248",a("span",{className:"text-[12px] text-[#888888] ml-[8px]",children:"\u5B8C\u6210\u7F16\u8F91\u540E\uFF0C\u53EF\u5C06\u6587\u672C\u590D\u5236\u7C98\u8D34\u5230\u76F8\u5E94\u63CF\u8FF0\u6846\u4E2D\u3002"})]}),width:672,destroyOnHidden:!0,open:c,onCancel:()=>l(!1),footer:O("div",{className:"flex justify-end items-center gap-3",children:[a(K,{mode:"default",label:"\u91CD\u7F6E",onClick:()=>{G(me),q(g=>g+1)}}),a(K,{mode:"primary",label:"\u590D\u5236",onClick:pe})]}),children:a(ke,{data:W,onChange:J,onGetData:te,styles:{theme:{colors:{primary:"#0969da",secondary:"#6b7280",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#3b82f6",background:"#ffffff",text:"#1f2937",border:"#e5e7eb",disabled:"#9ca3af",disabledBackground:"#f3f4f6",disabledText:"#6b7280",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)",appBackground:"transparent",listBackground:"#f9fafb",dashboardBackground:"#ffffff",textSecondary:"#6b7280"},space:{sidebar:"260px",size:"12px",radius:"8px",padding:"1rem",margin:"1rem",shadow:"0 2px 8px rgba(0,0,0,0.1)",lineHeight:"1.8"},icons:{},fonts:{body:{size:"14px",weight:"normal",family:"PingFang SC, Microsoft YaHei, Arial, sans-serif"},heading:{size:"14px",weight:"600",family:"PingFang SC, Microsoft YaHei, Arial, sans-serif"}},others:{baseFontWeight:"normal"}},templateField:{backgroundColor:"#E5EEFF",borderColor:"#84ADFF",borderRadius:"6px",padding:"6px 12px",margin:"2px",fontSize:"14px",fontWeight:"500",minWidth:"80px",textColor:"#84ADFF"}}},Z)})]})},Dt="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%201C13.4997%201.50025%2013.25%201.99975%2013.25%202.5C13.25%203.00025%2013.4997%203.49975%2014%204C13.4997%203.49975%2013.0003%203.25%2012.5%203.25C11.9997%203.25%2011.5003%203.49975%2011%204C11.5003%203.49975%2011.75%203.00025%2011.75%202.5C11.75%201.99975%2011.5003%201.50025%2011%201C11.5003%201.50025%2011.9997%201.75%2012.5%201.75C13.0003%201.75%2013.4997%201.50025%2014%201Z'%20fill='%23055AFF'/%3e%3cpath%20d='M13%206.28571V13C13%2013.5523%2012.5523%2014%2012%2014H4C3.44772%2014%203%2013.5523%203%2013V3C3%202.44772%203.44772%202%204%202H9.25'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cline%20x1='5.65'%20y1='6.35'%20x2='10.35'%20y2='6.35'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cline%20x1='5.65'%20y1='9.35'%20x2='8.35'%20y2='9.35'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3c/svg%3e",Bt="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_4199_8826)'%3e%3cpath%20d='M15.5554%2012.4444C14.9626%2013.0373%2014.6666%2013.6293%2014.6666%2014.2222C14.6666%2014.8151%2014.9626%2015.4071%2015.5554%2016C14.9626%2015.4071%2014.3706%2015.1111%2013.7777%2015.1111C13.1848%2015.1111%2012.5928%2015.4071%2011.9999%2016C12.5928%2015.4071%2012.8888%2014.8151%2012.8888%2014.2222C12.8888%2013.6293%2012.5928%2013.0373%2011.9999%2012.4444C12.5928%2013.0373%2013.1848%2013.3333%2013.7777%2013.3333C14.3706%2013.3333%2014.9626%2013.0373%2015.5554%2012.4444ZM14.6488%204.01778C15.1905%204.55954%2015.4948%205.29431%2015.4948%206.06044C15.4948%206.82658%2015.1905%207.56135%2014.6488%208.10311L7.735%2015.0169C7.46766%2015.2892%207.14901%2015.5058%206.79746%2015.6543C6.44592%2015.8028%206.06844%2015.8801%205.68684%2015.8819C5.30523%2015.8836%204.92706%2015.8097%204.57417%2015.6645C4.22127%2015.5193%203.90065%2015.3056%203.63081%2015.0357C3.36097%2014.7659%203.14727%2014.4453%203.00205%2014.0924C2.85682%2013.7395%202.78295%2013.3613%202.7847%2012.9797C2.78646%2012.5981%202.8638%2012.2206%203.01226%2011.8691C3.16072%2011.5176%203.37736%2011.1989%203.64967%2010.9316L3.95545%2010.6249L3.85145%2010.5244C3.30922%2010.0267%202.76522%209.77778%202.22211%209.77778C1.62923%209.77778%201.03722%2010.0738%200.444336%2010.6667C1.03722%2010.0738%201.33322%209.48178%201.33322%208.88889C1.33322%208.296%201.03722%207.704%200.444336%207.11111C1.03722%207.704%201.62923%208%202.22211%208C2.815%208%203.407%207.704%203.99989%207.11111C3.407%207.704%203.111%208.296%203.111%208.88889C3.111%209.46667%203.39278%2010.0444%203.95545%2010.6222L10.5634%204.01778C11.1052%203.47606%2011.84%203.17173%2012.6061%203.17173C13.3723%203.17173%2014.107%203.47606%2014.6488%204.01778ZM9.55189%206.91378L4.59189%2011.8738C4.30004%2012.1655%204.13603%2012.5612%204.13594%2012.9739C4.1359%2013.1782%204.17611%2013.3806%204.25426%2013.5694C4.33242%2013.7582%204.44699%2013.9297%204.59145%2014.0742C4.7359%2014.2187%204.9074%2014.3334%205.09617%2014.4116C5.28493%2014.4898%205.48725%2014.5301%205.69158%2014.5302C6.10424%2014.5303%206.50004%2014.3664%206.79189%2014.0747L11.7519%209.11378L9.55189%206.91378ZM11.5066%204.96089L10.495%205.97156L12.695%208.17156L13.7057%207.16C13.9846%206.86582%2014.1377%206.47437%2014.1323%206.069C14.1269%205.66364%2013.9635%205.27639%2013.6768%204.98973C13.3902%204.70306%2013.0029%204.53964%2012.5976%204.53425C12.1922%204.52887%2011.8007%204.68194%2011.5066%204.96089ZM9.59545%200C8.85589%200.740444%208.48434%201.48178%208.48434%202.22222C8.48434%202.96267%208.85589%203.704%209.59545%204.44444C8.85589%203.704%208.11456%203.33333%207.37322%203.33333C6.63367%203.33333%205.89234%203.704%205.151%204.44444C5.89234%203.704%206.26211%202.96267%206.26211%202.22222C6.26211%201.48178%205.89322%200.740444%205.15189%200C5.89322%200.740444%206.63456%201.11111%207.37411%201.11111C8.11545%201.11111%208.85678%200.740444%209.59634%200H9.59545Z'%20fill='%23055AFF'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_4199_8826'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",{confirm:At}=ye,vt='<template key="type" placeholder="\u8F93\u5165\u8868\u683C\u7C7B\u578B"></template>\u8868\u683C\u4E3B\u8981\u5C55\u793A\u4E86<template key="scene" placeholder="\u8F93\u5165\u573A\u666F\u540D\u79F0"></template>\u573A\u666F\u7684\u6570\u636E,\u5305\u542B<template key="primary_key" placeholder="\u4E3B\u8981\u5B57\u6BB5(\u53EF\u5199\u591A\u4E2A,\u7528\u987F\u53F7\u5206\u9694)"></template>\u7B49\u4E3B\u8981\u5B57\u6BB5,\u652F\u6301\u7528\u6237\u67E5\u8BE2<template key="search_direction" placeholder="\u5927\u6982\u4ECB\u7ECD\u9700\u8981\u67E5\u8BE2\u7684\u65B9\u5411"></template>\u95EE\u9898,\u5982\u679C\u8BBE\u8BA1\u591A\u8868\u5173\u8054\u67E5\u8BE2,\u6700\u597D\u8BF4\u660E\u6B64\u8868\u683C\u901A\u8FC7<template key="key_name" placeholder="\u5B57\u6BB5\u540D\u79F0"></template>\u5B57\u6BB5\u53EF\u4EE5\u5173\u8054\u53E6\u4E00\u4E2A<template key="table_name" placeholder="\u8868\u683C\u540D\u79F0"></template>\u8868\u683C\u3002',xt=({drawerTitle:e,drawerVisible:r,tableInfo:o,handleDrawerClose:s,optimizeDesc:i,eventsEmit:p})=>{const S=ie(()=>(o==null?void 0:o.data.find(C=>C.columnId=="name").value)||"-",[o]),[m,_]=h(""),[B,b]=h(null),[E,F]=h(""),[L,$]=h(0),[x,M]=h(!1),[t,n]=h(!1);xe(()=>{const C=(o==null?void 0:o.data.find(W=>W.columnId=="description").value)||"-";F(C)},[o]);const c=()=>{At({title:"\u4F60\u786E\u5B9A\u8981\u4F7F\u7528\u6A21\u677F\u5417\uFF1F",content:"\u8FD9\u5C06\u66FF\u6362\u4F60\u5F53\u524D\u5DF2\u586B\u5199\u7684\u5185\u5BB9\uFF0C\u4E14\u65E0\u6CD5\u64A4\u9500\u3002",okText:"\u786E\u8BA4\u66FF\u6362",cancelText:"\u53D6\u6D88",onOk(){F(vt),$(C=>C+1)},onCancel(){console.log("Cancel")}})},l=ue(C=>{_(C),console.log("\u6A21\u7248\u5185\u5BB9\u53D8\u5316:",C)},[]),A=ue(C=>{b(()=>C),console.log("getData\u51FD\u6570\u5DF2\u8BBE\u7F6E")},[]),D=async()=>{try{M(!0);const C=await i(o.tableId);C&&(F(C),$(W=>W+1),M(!1))}catch{Y.error("AI \u4F18\u5316\u5931\u8D25")}},y=ue(()=>{if(!B){console.error("getData\u51FD\u6570\u5C1A\u672A\u51C6\u5907\u597D\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}const C=B("pure_string");p("table_info:update",C)},[B,p]);return O(Ie,{title:e,placement:"right",width:720,onClose:s,closeIcon:!1,extra:a(ge,{size:20,color:"#888888",onClick:s,className:"cursor-pointer"}),open:r,destroyOnHidden:!0,footer:a("div",{className:"flex items-center",style:{justifyContent:"end"},children:O("div",{className:"flex self-end gap-3",children:[a(K,{mode:"default",style:{marginRight:10},label:"\u53D6\u6D88",onClick:s}),a(K,{mode:"primary",label:"\u786E\u8BA4",onClick:()=>y(),disabled:x})]})}),children:[a("div",{className:"mb-[10px] font-bold",children:S}),O("div",{className:"mb-[10px]",children:[a("span",{style:{color:"#FF3B30",marginRight:"4px"},children:"*"}),a("span",{children:"\u6570\u636E\u8868\u63CF\u8FF0"}),a("span",{className:"text-[#888888] ml-[4px]",children:"(\u8BF7\u51C6\u786E\u586B\u5199\u8868\u683C\u7684\u5E94\u7528\u573A\u666F\u63CF\u8FF0\uFF0C\u5927\u6A21\u578B\u5C06\u4F9D\u8D56\u6B64\u4FE1\u606F\u8BC6\u522B\u5E76\u6B63\u786E\u8C03\u7528\u8BE5\u6570\u636E\u8868\u3002)"})]}),a(ke,{data:E,onChange:l,onGetData:A,styles:{theme:{colors:{primary:"#0969da",secondary:"#6b7280",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#3b82f6",background:"#ffffff",text:"#1f2937",border:"#e5e7eb",disabled:"#9ca3af",disabledBackground:"#f3f4f6",disabledText:"#6b7280",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)",appBackground:"transparent",listBackground:"#f9fafb",dashboardBackground:"#ffffff",textSecondary:"#6b7280"},space:{sidebar:"260px",size:"12px",radius:"8px",padding:"1rem",margin:"1rem",shadow:"0 2px 8px rgba(0,0,0,0.1)",lineHeight:"1.8"},icons:{},fonts:{body:{size:"14px",weight:"normal",family:"PingFang SC, Microsoft YaHei, Arial, sans-serif"},heading:{size:"14px",weight:"600",family:"PingFang SC, Microsoft YaHei, Arial, sans-serif"}},others:{baseFontWeight:"normal"}},templateField:{backgroundColor:"#E5EEFF",borderColor:"#84ADFF",borderRadius:"6px",padding:"6px 12px",margin:"2px",fontSize:"14px",fontWeight:"500",minWidth:"80px",textColor:"#84ADFF"}}},L),O("div",{children:[a(Ne,{open:t,onOpenChange:C=>n(!!C),content:a("div",{style:{width:"600px",margin:"10px",padding:"10px"},onClick:c,className:"hover:bg-gray-100 h-[80px] cursor-pointer rounded",children:"______\u8868\u683C\u4E3B\u8981\u5C55\u793A\u4E86______\u573A\u666F\u7684\u6570\u636E\uFF0C\u5305\u542B______\u3001______\u3001______\u7B49\u4E3B\u8981\u5B57\u6BB5\uFF0C\u652F\u6301\u7528\u6237\u67E5\u8BE2______\u95EE\u9898(\u5927\u6982\u4ECB\u7ECD)\u5982\u679C\u6D89\u53CA\u591A\u8868\u5173\u8054\u67E5\u8BE2\uFF0C\u6700\u597D\u8BF4\u660E\u6B64\u8868\u683C\u901A\u8FC7______\u5B57\u6BB5\u53EF\u4EE5\u5173\u8054\u53E6\u4E00\u4E2A______\u8868\u683C\u3002"}),title:O("div",{className:"flex justify-between items-center",style:{margin:"10px"},children:[a("div",{className:"text-[16px]",children:"\u6A21\u7248"}),a(ge,{size:20,color:"#888888",onClick:()=>n(!1),className:"cursor-pointer"})]}),trigger:"click",destroyOnHidden:!0,placement:"bottomRight",getPopupContainer:C=>C,children:a("span",{children:a(K,{mode:"text",icon:a("img",{src:Dt}),children:"\u4F7F\u7528\u6A21\u7248"})})}),a(K,{onClick:D,mode:"text",icon:a("img",{src:Bt}),loading:x,children:"AI\u4F18\u5316"})]})]})},wt=""+new URL("empty.png",import.meta.url).href;var H=(e=>(e[e.DATE=0]="DATE",e[e.VIEW=1]="VIEW",e[e.ERROR=2]="ERROR",e[e.AUTHORIZE=3]="AUTHORIZE",e[e.DELETE=4]="DELETE",e[e.ANALYSIS_OR_EXTRACT=5]="ANALYSIS_OR_EXTRACT",e[e.DOWNLOAD=6]="DOWNLOAD",e[e.EDIT=7]="EDIT",e[e.ADD=8]="ADD",e[e.ANALYSIS_CONFIG=9]="ANALYSIS_CONFIG",e[e.AUTHORIZE_CONFIG=10]="AUTHORIZE_CONFIG",e))(H||{}),Ee=(e=>(e.GENERATING="generating",e.SUCCESS="success",e.FAIL="fail",e))(Ee||{});const Fe={success:"green",error:"red",warning:"orange",processing:"blue",info:"cyan",default:"default"},kt=e=>typeof e=="string"&&e in Fe?Fe[e]:Fe.default,fe=e=>{const{value:r,cell:o}=e;switch(o.columnId){case"importstatus":return r?a(ce,{title:"\u6709\u8FFD\u52A0\u5931\u8D25\u7684\u6587\u4EF6\uFF0C\u8BF7\u53CA\u65F6\u5904\u7406",children:a(je,{color:"red",bordered:!1,children:"\u8FFD\u52A0\u5931\u8D25"})}):a(he,{});case"status":const s=kt(e.cell.statusType);return r=="\u5BFC\u5165\u5931\u8D25"?a(ce,{title:o.errorMsg,children:O("div",{className:"flex items-center gap-2",children:[a(De,{color:s,text:r}),a(Te,{size:14,color:"red"})]})}):a(De,{color:s,text:r});default:return a(he,{})}},Ae=[{statusType:"success",value:"\u5BFC\u5165\u6210\u529F",status:"30"},{statusType:"error",value:"\u5BFC\u5165\u5931\u8D25",status:"00"},{statusType:"default",value:"\u5F85\u5BFC\u5165",status:"10"},{statusType:"processing",value:"\u5BFC\u5165\u4E2D",status:"20"},{statusType:"processing",value:"\u5BFC\u5165\u4E2D",status:"11"}],It=e=>{var s,i;const{cell:r,value:o}=e;return typeof o=="string"?a("div",{title:o,style:{maxWidth:240,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o}):(s=r.tableMeta)!=null&&s.isGenDescription&&((i=r.tableMeta)==null?void 0:i.generateDescriptionStatus)=="generating"?O("div",{className:"flex items-center gap-1 text-[#84ADFF]",style:{color:"#84ADFF"},children:[a("span",{children:"\u751F\u6210\u4E2D"}),a(lt,{size:14})]}):"-"},Tt=({dbInfo:e,setDrawerTitle:r,setDrawerVisible:o,getBtnDisabled:s})=>O("div",{className:"flex flex-col items-center justify-center h-full",children:[a("div",{className:"text-xl font-semibold mb-3",children:a("img",{src:wt,width:120})}),a("div",{className:"text-base mb-2",style:{color:"#888888"},children:"\u6682\u65E0\u6570\u636E\u6587\u4EF6"}),a("div",{className:"flex gap-3",children:a(K,{mode:"primary",label:"\u4E0A\u4F20\u6570\u636E\u6587\u4EF6",disabled:s&&s(8,e==null?void 0:e.permission),onClick:()=>{r("\u4E0A\u4F20\u6570\u636E\u6587\u4EF6"),o(!0)}})})]}),{confirm:ve}=ye,Ut=e=>{const{url:r,token:o,role:s,id:i,dbType:p,CustomComponents:S,getBtnDisabled:m,uploadUrl:_}=e,[B,b]=h({container:"ready",content:"ready"}),E=Ce(null),F=Ce(null),[L,$]=h(),[x,M]=h({}),[t,n]=h(),[c,l]=h(!1),[A,D]=h(""),[y,C]=h(),[W,G]=h(!1),[Z,q]=h(""),{getTableList:se,delTableById:oe,delFileById:ne,updateTableInfo:X,optimizeDesc:re,getTableTreeList:ae,reParseFile:Q,getDBDetailById:ee}=ze({url:r,token:o,role:s,eventsEmit:e.eventsEmit});xe(()=>(i&&p&&(b(d=>({...d,container:"loading"})),P()),()=>{F.current&&(clearTimeout(F.current),F.current=null)}),[i,p]);const P=async()=>{try{const d=await ee(i,p);d&&(n(d),b(u=>({...u,container:"ready",content:"loading"})))}catch(d){console.log("[TableApiError] getDBInfo:",d)}await k()},J=async()=>{try{if(p=="DirectDB"){const d=await se(i);if(d){const u=pe(d);return $(u||[]),b(R=>({...R,content:"ready"})),u||[]}else b(u=>({...u,content:"error"}))}else{const d=await ae(i);if(d){const u=te(d);return $(u||[]),b(R=>({...R,content:"ready"})),u||[]}else b(u=>({...u,content:"error"}))}}catch(d){console.log("[TableApiError] getTableList:",d)}};function te(d){return(d||[]).map((u,R)=>{var I,z;let v=Ae.find(T=>T.status==u.status);const N=u.children.some(T=>T.status=="00");return{id:u.fileId.toString(),tableId:u.tableId,data:[{columnId:"name",value:(u==null?void 0:u.originalFilename)||"-",type:"label"},{columnId:"description",value:(I=u==null?void 0:u.tableMeta)==null?void 0:I.description,type:"customized",tableMeta:u==null?void 0:u.tableMeta},{columnId:"count",value:`${u.rowCount}\u884C\uFF0C${u.columnCount}\u5217`,type:"text"},{columnId:"status",...v,type:"customized",errorMsg:u.errorMsg},{columnId:"importstatus",value:N,type:"customized"},{columnId:"createdAt",value:u.gmtCreate,type:"date"},{columnId:"updatedAt",value:u.gmtModified,type:"date"},...u.status=="30"?[{columnId:"actions",value:"view",label:"\u67E5\u770B",type:"action",disabled:m&&m(H.VIEW,u.permission)},{columnId:"actions",value:"edit",label:"\u4FEE\u6539\u914D\u7F6E",type:"action",disabled:m&&m(H.EDIT,u.permission)},{columnId:"actions",value:"addData",label:"\u8FFD\u52A0\u6570\u636E",type:"action",disabled:m&&m(H.EDIT,u.permission)}]:[],...u.status=="00"?[{columnId:"actions",value:"reValidate",label:"\u91CD\u65B0\u5BFC\u5165",type:"action"}]:[],{columnId:"actions",value:"delete",label:"\u5220\u9664",type:"action",disabled:m&&m(H.DELETE,u.permission)}],expanded:!1,...u.children&&((z=u.children)==null?void 0:z.length)>0&&{children:[...(u.children||[]).map(T=>{const Oe=Ae.find(Le=>Le.status==T.status),_e=[{columnId:"name",value:T.originalFilename,type:"text"},{columnId:"count",value:`${T.rowCount}\u884C\uFF0C${T.columnCount}\u5217`,type:"text"},{columnId:"status",...Oe,errorMsg:T.errorMsg,type:"customized"},{columnId:"createdAt",value:T.gmtCreate,type:"date"},{columnId:"updatedAt",value:T.gmtModified,type:"date"},...T.status=="30"?[{columnId:"actions",value:"view",label:"\u67E5\u770B",type:"action",disabled:m&&m(H.VIEW,T.permission)}]:[],...T.status=="00"?[{columnId:"actions",value:"reValidate",label:"\u91CD\u65B0\u5BFC\u5165",type:"action",disabled:m&&m(H.ADD,T.permission)}]:[],{columnId:"actions",value:"delete_sub",label:"\u5220\u9664",type:"action",disabled:m&&m(H.DELETE,T.permission)}];return{id:T.fileId.toString(),tableId:T.tableId,data:_e}})]}}})}function pe(d){return(d||[]).map((u,R)=>({id:u.id||Ve(8),data:[{columnId:"name",value:u.physicalName},{columnId:"cnname",value:u.businessName},{columnId:"colcount",value:u.columnCount},{columnId:"count",value:`${u.rowCount}\u884C\uFF0C${u.columnCount}\u5217`},{columnId:"actions",value:"view",label:"\u67E5\u770B",disabled:m&&m(H.VIEW,u.permission)}]}))}async function g(d,u,R){switch(console.log("[adopter] mergedEventsEmit",d,u,R),d){case"table_action_delete":{try{if(console.log("[delete] \u5220\u9664\u4E8B\u4EF6\u6570\u636E:",u),!u||!u.tableId&&!u.id){console.error("[delete] \u5220\u9664\u4E8B\u4EF6\u6570\u636E\u4E0D\u5B8C\u6574:",u),Y.error("\u5220\u9664\u5931\u8D25\uFF1A\u6570\u636E\u4E0D\u5B8C\u6574");return}const v=u.tableId||u.id,N=u.id;ve({title:"\u786E\u8BA4\u5220\u9664\u6570\u636E\u5E93\uFF1F",content:"\u8BE5\u6570\u636E\u8868\u53CA\u5176\u8FFD\u52A0\u6570\u636E\u90FD\u5C06\u88AB\u5220\u9664\u4E14\u65E0\u6CD5\u6062\u590D",icon:a(Te,{color:"#FF4D4F",className:"mr-[8px]"}),okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",async onOk(){await oe(v,p)&&(E!=null&&E.current)?(E==null||E.current.appFn.removeItem(N),Y.success("\u5220\u9664\u6210\u529F")):Y.error("\u5220\u9664\u5931\u8D25")}})}catch(v){console.error("\u5220\u9664\u8868\u6570\u636E\u5931\u8D25:",v),Y.error("\u5220\u9664\u5931\u8D25")}break}case"table_action_edit":{q("\u4FEE\u6539\u6570\u636E\u914D\u7F6E"),G(!0),C(u);break}case"toolbar_upload":{D("\u4E0A\u4F20\u6570\u636E\u6587\u4EF6"),l(!0);break}case"table_action_addData":{D("\u8FFD\u52A0\u6570\u636E"),l(!0),C(u);break}case"table_action_reValidate":{await Q(u.id)&&(F.current&&(clearTimeout(F.current),F.current=null),await k());break}case"table_info:update":{try{if(y!=null&&y.id){const v=(y==null?void 0:y.data.find(I=>I.columnId=="name").value)||"-";if(await X({tableId:y.tableId,description:u,businessName:v})&&(E!=null&&E.current)){const I={...y,data:y.data.map(z=>z.columnId=="description"?{...z,value:u}:z)};E==null||E.current.appFn.updateItem(I,y.id),Y.success("\u4FEE\u6539\u914D\u7F6E\u6210\u529F")}}}catch(v){console.error("\u4FEE\u6539\u914D\u7F6E\u5931\u8D25",v)}finally{w()}break}case"table_action_delete_sub":{try{ve({title:"\u786E\u8BA4\u5220\u9664\u6570\u636E\uFF1F",content:"\u5220\u9664\u540E\uFF0C\u8BE5\u6570\u636E\u5C06\u65E0\u6CD5\u6062\u590D",okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",async onOk(){const{id:v,tableId:N}=u;await ne(u.id)&&(E!=null&&E.current)&&(M(z=>({...z,[N]:[...z[N]||[],v]})),u.data.find(z=>z.status=="00")&&(F.current&&(clearTimeout(F.current),F.current=null),k()),R.removeItem(v,N),Y.success("\u8FFD\u52A0\u6587\u4EF6\u6570\u636E\u5220\u9664\u6210\u529F"))}})}catch{console.log("\u5220\u9664\u8868\u6570\u636E\u5931\u8D25")}break}case"toolbar_auth":{typeof e.eventsEmit=="function"&&e.eventsEmit("toolbar_auth",t);break}default:typeof e.eventsEmit=="function"&&e.eventsEmit(d,u);break}}const f=ie(()=>({label:"\u6570\u636E\u8868\u7BA1\u7406",model:null,defaultActiveId:"direct-table-view",views:[{label:"\u6211\u7684\u6570\u636E\u5E93",id:"direct-table-view",type:"table",viewBehavior:"pagination",allowMultiSelect:!1,columns:[{id:"name",title:"\u6570\u636E\u8868\u82F1\u6587\u540D\u79F0",type:"label"},{id:"cnname",title:"\u6570\u636E\u8868\u4E2D\u6587\u540D\u79F0",type:"label"},{id:"colcount",title:"\u5B57\u6BB5\u6570",type:"text"},{id:"count",title:"\u6570\u636E\u91CF",type:"text"},{id:"actions",title:"\u64CD\u4F5C",type:"action"}],toolbar:[{type:"fuzzy_search",key:"search",label:"\u641C\u7D22",searchKeys:["name","description"],position:"right"},{type:"button",key:"auth",label:"\u914D\u7F6E",btnType:"default",position:"right"}]}]}),[L,p]),V=ie(()=>({label:"\u6570\u636E\u8868\u7BA1\u7406",model:null,defaultActiveId:"data-table-view",views:[{label:"\u4E0A\u4F20\u6570\u636E\u5217\u8868",id:"data-table-view",type:"table",viewBehavior:"pagination",allowMultiSelect:!1,viewPageSize:10,columns:[{id:"name",title:"\u6587\u4EF6\u540D",type:"label",tip:"\u6587\u4EF6\u540D"},{id:"description",title:"\u63CF\u8FF0",type:"customized",component:a(It,{}),helpText:"\u6253\u5F00\u81EA\u52A8\u751F\u6210\u63CF\u8FF0\u5F00\u5173\u540E\uFF0C\u82E5\u63CF\u8FF0\u672A\u6B63\u5E38\u751F\u6210\uFF0C\u5219\u63CF\u8FF0\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u5982\u60A8\u4ECD\u7136\u9700\u8981\u63CF\u8FF0\uFF0C\u5219\u9700\u8981\u624B\u52A8\u6DFB\u52A0"},{id:"count",title:"\u6570\u636E\u91CF",type:"text",tip:"\u6570\u636E\u91CF"},{id:"status",title:"\u5BFC\u5165\u72B6\u6001",type:"customized",component:a(fe,{})},{id:"importstatus",title:"\u8FFD\u52A0\u63D0\u793A",type:"customized",component:a(fe,{})},{id:"createdAt",title:"\u521B\u5EFA\u65F6\u95F4",type:"date",tip:"\u521B\u5EFA\u65F6\u95F4"},{id:"updatedAt",title:"\u66F4\u65B0\u65F6\u95F4",type:"date",tip:"\u66F4\u65B0\u65F6\u95F4"},{id:"actions",title:"\u64CD\u4F5C",type:"action"}],toolbar:[{type:"button",key:"upload",label:"\u4E0A\u4F20\u6570\u636E\u6587\u4EF6",btnType:"primary",disabled:m&&m(H.ADD,t==null?void 0:t.permission),icon:a(We,{size:12})},{type:"fuzzy_search",key:"search",label:"\u641C\u7D22",searchKeys:["name","description",["name"]],position:"right"},{type:"button",key:"auth",label:"\u914D\u7F6E",btnType:"default",position:"right"}]}],subTableConfig:{type:"table",allowMultiSelect:!1,viewBehavior:"pagination",viewPageSize:5,columns:[{title:"\u8FFD\u52A0\u6587\u4EF6\u540D",id:"name",type:"text",tip:"\u8FFD\u52A0\u6587\u4EF6\u540D"},{title:"\u6570\u636E\u91CF",id:"count",type:"text",tip:"\u6570\u636E\u91CF"},{id:"status",title:"\u5BFC\u5165\u72B6\u6001",type:"customized",tip:"\u5BFC\u5165\u72B6\u6001",component:a(fe,{})},{title:"\u521B\u5EFA\u65F6\u95F4",id:"createdAt",type:"date",tip:"\u521B\u5EFA\u65F6\u95F4"},{title:"\u66F4\u6539\u65F6\u95F4",id:"updatedAt",type:"date",tip:"\u66F4\u6539\u65F6\u95F4"},{title:"\u64CD\u4F5C",id:"actions",type:"action"}]},subTablePendingIds:x,onSubTableRowAnimationComplete:(d,u)=>{M(R=>({...R,[d]:(R[d]||[]).filter(v=>v!==u)}))}}),[x,L,p,t]),w=d=>{l(!1),G(!1),C(void 0),d=="refresh"&&(F.current&&(clearTimeout(F.current),F.current=null),k())};function U(d){var u,R;if(!Array.isArray(d))return!0;for(const v of d){if(v.data){const N=v.data.find(z=>z.columnId==="status"),I=v.data.find(z=>z.columnId==="description");if(console.log("+++++",N.status==="20"||N.status==="11"||((u=I==null?void 0:I.tableMeta)==null?void 0:u.generateDescriptionStatus)==Ee.GENERATING),N&&(N.status==="20"||N.status==="11"||((R=I==null?void 0:I.tableMeta)==null?void 0:R.generateDescriptionStatus)==Ee.GENERATING))return!1}if(Array.isArray(v.children)){for(const N of v.children)if(N.data){const I=N.data.find(z=>z.columnId==="status");if(I&&(I.status==="20"||I.status==="11"))return!1}}}return!0}const k=async()=>{const d=await J();U(d||[])?F.current&&(clearTimeout(F.current),F.current=null):(F.current&&(clearTimeout(F.current),F.current=null),F.current=setTimeout(()=>{k()},5e3))};return O(Ue,{title:t==null?void 0:t.name,description:(t==null?void 0:t.description)||"-",goBack:()=>{var d;(d=e.eventsEmit)==null||d.call(e,"goBack",{})},children:[a(we,{dataSource:L,ref:E,eventsEmit:g,status:B,styles:{theme:{...be,colors:{...be.colors,tableFirstColumnBg:"#ffffff",tableLastColumnBg:"#ffffff",paginationBackground:"#ffffff",subTableBackground:"#F5F5F5",tableHeaderBg:"#F5F5F5"}},mode:"light"},CustomComponents:{EmptyData:()=>a(Tt,{dbInfo:t,setDrawerTitle:D,setDrawerVisible:l,getBtnDisabled:m}),...S},...p=="DataTable"?V:f}),a(bt,{drawerTitle:A,drawerVisible:c,handleDrawerClose:w,dbId:i,token:o,url:r,uploadUrl:_,role:s,tableInfo:y}),a(xt,{drawerTitle:Z,drawerVisible:W,handleDrawerClose:w,tableInfo:y,optimizeDesc:re,eventsEmit:g})]})};export{Ut as D,Ne as P};
6
+ */const lt=He("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),de=e=>e?typeof e=="function"?e():e:null,ct=e=>{const{componentCls:r,popoverColor:o,titleMinWidth:s,fontWeightStrong:i,innerPadding:p,boxShadowSecondary:S,colorTextHeading:m,borderRadiusLG:_,zIndexPopup:B,titleMarginBottom:b,colorBgElevated:E,popoverBg:F,titleBorderBottom:L,innerContentPadding:$,titlePadding:x}=e;return[{[r]:Object.assign(Object.assign({},Ke(e)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:B,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:["var(--valid-offset-x, 50%)","var(--arrow-y, 50%)"].join(" "),"--antd-arrow-background-color":E,width:"max-content",maxWidth:"100vw","&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${r}-content`]:{position:"relative"},[`${r}-inner`]:{backgroundColor:F,backgroundClip:"padding-box",borderRadius:_,boxShadow:S,padding:p},[`${r}-title`]:{minWidth:s,marginBottom:b,color:m,fontWeight:i,borderBottom:L,padding:x},[`${r}-inner-content`]:{color:o,padding:$}})},Ye(e,"var(--antd-arrow-background-color)"),{[`${r}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block",[`${r}-content`]:{display:"inline-block"}}}]},dt=e=>{const{componentCls:r}=e;return{[r]:Xe.map(o=>{const s=e[`${o}6`];return{[`&${r}-${o}`]:{"--antd-arrow-background-color":s,[`${r}-inner`]:{backgroundColor:s},[`${r}-arrow`]:{background:"transparent"}}}})}},pt=e=>{const{lineWidth:r,controlHeight:o,fontHeight:s,padding:i,wireframe:p,zIndexPopupBase:S,borderRadiusLG:m,marginXS:_,lineType:B,colorSplit:b,paddingSM:E}=e,F=o-s,L=F/2,$=F/2-r,x=i;return Object.assign(Object.assign(Object.assign({titleMinWidth:177,zIndexPopup:S+30},Je(e)),Qe({contentRadius:m,limitVerticalRadius:!0})),{innerPadding:p?0:12,titleMarginBottom:p?0:_,titlePadding:p?`${L}px ${x}px ${$}px`:0,titleBorderBottom:p?`${r}px ${B} ${b}`:"none",innerContentPadding:p?`${E}px ${x}px`:0})},Se=Ge("Popover",e=>{const{colorBgElevated:r,colorText:o}=e,s=Ze(e,{popoverBg:r,popoverColor:o});return[ct(s),dt(s),qe(s,"zoom-big")]},pt,{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]});var mt=function(e,r){var o={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&r.indexOf(s)<0&&(o[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,s=Object.getOwnPropertySymbols(e);i<s.length;i++)r.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(o[s[i]]=e[s[i]]);return o};const Me=({title:e,content:r,prefixCls:o})=>!e&&!r?null:j.createElement(j.Fragment,null,e&&j.createElement("div",{className:`${o}-title`},e),r&&j.createElement("div",{className:`${o}-inner-content`},r)),Ft=e=>{const{hashId:r,prefixCls:o,className:s,style:i,placement:p="top",title:S,content:m,children:_}=e,B=de(S),b=de(m),E=le(r,o,`${o}-pure`,`${o}-placement-${p}`,s);return j.createElement("div",{className:E,style:i},j.createElement("div",{className:`${o}-arrow`}),j.createElement(tt,Object.assign({},e,{className:r,prefixCls:o}),_||j.createElement(Me,{prefixCls:o,title:B,content:b})))},ft=e=>{const{prefixCls:r,className:o}=e,s=mt(e,["prefixCls","className"]),{getPrefixCls:i}=j.useContext(et),p=i("popover",r),[S,m,_]=Se(p);return S(j.createElement(Ft,Object.assign({},s,{prefixCls:p,hashId:m,className:le(o,_)})))};var Ct=function(e,r){var o={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&r.indexOf(s)<0&&(o[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,s=Object.getOwnPropertySymbols(e);i<s.length;i++)r.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(o[s[i]]=e[s[i]]);return o};const gt=j.forwardRef((e,r)=>{var o,s;const{prefixCls:i,title:p,content:S,overlayClassName:m,placement:_="top",trigger:B="hover",children:b,mouseEnterDelay:E=.1,mouseLeaveDelay:F=.1,onOpenChange:L,overlayStyle:$={},styles:x,classNames:M}=e,t=Ct(e,["prefixCls","title","content","overlayClassName","placement","trigger","children","mouseEnterDelay","mouseLeaveDelay","onOpenChange","overlayStyle","styles","classNames"]),{getPrefixCls:n,className:c,style:l,classNames:A,styles:D}=ut("popover"),y=n("popover",i),[C,W,G]=Se(y),Z=n(),q=le(m,W,G,c,A.root,M==null?void 0:M.root),se=le(A.body,M==null?void 0:M.body),[oe,ne]=at(!1,{value:(o=e.open)!==null&&o!==void 0?o:e.visible,defaultValue:(s=e.defaultOpen)!==null&&s!==void 0?s:e.defaultVisible}),X=(P,J)=>{ne(P,!0),L==null||L(P,J)},re=P=>{P.keyCode===nt.ESC&&X(!1,P)},ae=P=>{X(P)},Q=de(p),ee=de(S);return C(j.createElement(ce,Object.assign({placement:_,trigger:B,mouseEnterDelay:E,mouseLeaveDelay:F},t,{prefixCls:y,classNames:{root:q,body:se},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},D.root),l),$),x==null?void 0:x.root),body:Object.assign(Object.assign({},D.body),x==null?void 0:x.body)},ref:r,open:oe,onOpenChange:ae,overlay:Q||ee?j.createElement(Me,{prefixCls:y,title:Q,content:ee}):null,transitionName:st(Z,"zoom-big",t.transitionName),"data-popover-inject":!0}),ot(b,{onKeyDown:P=>{var J,te;$e(b)&&((te=b==null?void 0:(J=b.props).onKeyDown)===null||te===void 0||te.call(J,P)),re(P)}})))}),Ne=gt;Ne._InternalPanelDoNotUseOrYouWillBeFired=ft;const Et="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%201C13.4997%201.50025%2013.25%201.99975%2013.25%202.5C13.25%203.00025%2013.4997%203.49975%2014%204C13.4997%203.49975%2013.0003%203.25%2012.5%203.25C11.9997%203.25%2011.5003%203.49975%2011%204C11.5003%203.49975%2011.75%203.00025%2011.75%202.5C11.75%201.99975%2011.5003%201.50025%2011%201C11.5003%201.50025%2011.9997%201.75%2012.5%201.75C13.0003%201.75%2013.4997%201.50025%2014%201Z'%20fill='%23055AFF'/%3e%3cpath%20d='M13%206.28571V13C13%2013.5523%2012.5523%2014%2012%2014H4C3.44772%2014%203%2013.5523%203%2013V3C3%202.44772%203.44772%202%204%202H9.25'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cline%20x1='5.65'%20y1='6.35'%20x2='10.35'%20y2='6.35'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cline%20x1='5.65'%20y1='9.35'%20x2='8.35'%20y2='9.35'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3c/svg%3e",yt="data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42%2022C43.1046%2022%2044%2022.8954%2044%2024V42C44%2043.1046%2043.1046%2044%2042%2044H6C4.89543%2044%204%2043.1046%204%2042V24.0088C4%2022.9042%204.89543%2022.0078%206%2022.0078C7.10457%2022.0078%208%2022.9042%208%2024.0088V40H40V24C40%2022.8954%2040.8954%2022%2042%2022ZM24.0293%204.00195C24.0808%204.00272%2024.1322%204.00504%2024.1836%204.00977C24.1904%204.01042%2024.1973%204.011%2024.2041%204.01172C24.2673%204.01819%2024.3301%204.02757%2024.3926%204.04004C24.3939%204.04031%2024.3952%204.04075%2024.3965%204.04102C24.7693%204.11623%2025.125%204.29691%2025.4141%204.58594L34.4141%2013.5859C35.1951%2014.367%2035.1951%2015.633%2034.4141%2016.4141C33.633%2017.1951%2032.367%2017.1951%2031.5859%2016.4141L25.9922%2010.8203V32C25.9922%2033.1046%2025.0968%2034%2023.9922%2034C22.8876%2034%2021.9922%2033.1046%2021.9922%2032V10.8359L16.4141%2016.4141C15.633%2017.1951%2014.367%2017.1951%2013.5859%2016.4141C12.8049%2015.633%2012.8049%2014.367%2013.5859%2013.5859L22.498%204.67285C22.8016%204.33138%2023.2194%204.09559%2023.6924%204.02441C23.7122%204.02135%2023.732%204.01809%2023.752%204.01562C23.7862%204.01152%2023.8207%204.00919%2023.8555%204.00684C23.8887%204.00446%2023.9218%204.00268%2023.9551%204.00195C23.9674%204.00173%2023.9798%204%2023.9922%204C24.0046%204%2024.0169%204.00173%2024.0293%204.00195Z'%20fill='url(%23paint0_linear_4072_34663)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_4072_34663'%20x1='4'%20y1='-7.25'%20x2='54.4707'%20y2='1.556'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%232B69FF'/%3e%3cstop%20offset='1'%20stop-color='%238F91FF'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",ze=({url:e,token:r,role:o,eventsEmit:s})=>{const i=rt.create({baseURL:e,timeout:1e6});return i.interceptors.request.use(t=>{let n=r;return!n&&!["user/login","user/kaptcha","user/regist"].some(l=>t.url.includes(l))?(s&&s("request:error_auth",{errorMsg:"\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F",redirect:"/login"}),Promise.reject(new Error("\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"))):(t.headers.Authorization=n||"",t.headers.userName=o==="\u672A\u767B\u5F55\u7528\u6237"?"":o,t)}),i.interceptors.response.use(t=>{const n=["user/kaptcha"],c=t.data;if(n.some(y=>t.config.url&&t.config.url.includes(y))||c.size&&c.type)return c;const{success:l,errorMsg:A,errorCode:D}=c;if(l)return c;s&&s("request:error_business",{errorCode:D,errorMsg:A||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",response:c})},t=>{var n,c,l,A,D,y,C,W,G;if(t.message==="canceled")return Promise.reject(t);if(s){let Z="request:error_network",q={errorMsg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:t};((n=t==null?void 0:t.response)==null?void 0:n.status)===401?(Z="request:error_auth",q={errorMsg:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650",error:t,redirect:"/login"}):(((l=(c=t==null?void 0:t.response)==null?void 0:c.data)==null?void 0:l.errorCode)==="30013"||((D=(A=t==null?void 0:t.response)==null?void 0:A.data)==null?void 0:D.errorCode)==="30023")&&(Z="request:error_business",q={errorCode:(C=(y=t==null?void 0:t.response)==null?void 0:y.data)==null?void 0:C.errorCode,errorMsg:((G=(W=t==null?void 0:t.response)==null?void 0:W.data)==null?void 0:G.errorMsg)||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",error:t}),s(Z,q)}return Promise.reject(t)}),{getTableList:async t=>{try{const n=await i.get(`/directDB/queryTableList/${t}`),{success:c,data:l}=n;if(c)return l}catch(n){console.log("getTableList error:",n)}},getTableTreeList:async t=>{try{const n=await i.get(`/dataTable/queryTableFileTreeList/${t}`),{success:c,data:l}=n;if(c)return l}catch(n){console.log("getTableTreeList error:",n)}},getDBDetailById:async(t,n)=>{const c=Be(n);try{const l=await i.get(`/${c}/queryDBInfo/${t}`),{success:A,data:D}=l;if(A)return D}catch(l){console.log("getDBDetailById error:",l)}},delTableById:async(t,n)=>{const c=Be(n);try{const l=await i.delete(`/${c}/deleteTable/${t}`),{success:A,data:D}=l;if(A)return D}catch(l){console.log("delTableById error:",l)}},delFileById:async t=>{try{const n=await i.delete(`/dataTable/deleteTableFileData/${t}`),{success:c,data:l}=n;if(c)return l}catch(n){console.log("delFileById",n)}},parseFiles:async({fileIds:t,isGenDescription:n,tableDescriptionMap:c})=>{try{const l=await i.post("/dataTable/parseFiles",{fileIds:t,isGenDescription:n,tableDescriptionMap:c}),{success:A,data:D}=l;if(A)return D}catch(l){console.log("parseFiles error:",l)}},reParseFile:async t=>{try{const n=await i.post(`/dataTable/reParseFile/${t}`),{success:c,data:l}=n;if(c)return l}catch(n){console.log("reParseFile error:",n)}},parseAppendFile:async({fileIds:t,tableId:n})=>{try{const c=await i.post("/dataTable/parseAppendFiles",{fileIds:t,tableId:n}),{success:l,data:A}=c;if(l)return A}catch(c){console.log("parseAppendFile error:",c)}},deleteUploadedFiles:async t=>{try{const n=await i.post("/dataTable/cancelUploadFile",{fileIds:t}),{success:c,data:l}=n;if(c)return l}catch(n){console.log("deleteUploadedFiles error:",n)}},getTableInfoById:async t=>{try{const n=await i.get(`/dataTable/queryTableMeta/${t}`),{success:c,data:l}=n;if(c)return l}catch(n){console.log("getTableInfoById error:",n)}},updateTableInfo:async({tableId:t,description:n,businessName:c})=>{try{const l=await i.post("/dataTable/updateTableInfo",{tableId:t,businessName:c,description:n}),{success:A,data:D}=l;if(A)return D}catch(l){console.log("updateTableInfo error:",l)}},optimizeDesc:async t=>{try{const n=await i.get(`/genTableDescription/${t}`),{success:c,data:l}=n;if(c)return l}catch(n){console.log("optimizeDesc error:",n)}}}},Be=e=>e=="DataTable"?"dataTable":"directDB",me='<template key="type" placeholder="\u8F93\u5165\u8868\u683C\u7C7B\u578B"></template>\u8868\u683C\u4E3B\u8981\u5C55\u793A\u4E86<template key="scene" placeholder="\u8F93\u5165\u573A\u666F\u540D\u79F0"></template>\u573A\u666F\u7684\u6570\u636E,\u5305\u542B<template key="primary_key" placeholder="\u4E3B\u8981\u5B57\u6BB5(\u53EF\u5199\u591A\u4E2A,\u7528\u987F\u53F7\u5206\u9694)"></template>\u7B49\u4E3B\u8981\u5B57\u6BB5,\u652F\u6301\u7528\u6237\u67E5\u8BE2<template key="search_direction" placeholder="\u5927\u6982\u4ECB\u7ECD\u9700\u8981\u67E5\u8BE2\u7684\u65B9\u5411"></template>\u95EE\u9898,\u5982\u679C\u8BBE\u8BA1\u591A\u8868\u5173\u8054\u67E5\u8BE2,\u6700\u597D\u8BF4\u660E\u6B64\u8868\u683C\u901A\u8FC7<template key="key_name" placeholder="\u5B57\u6BB5\u540D\u79F0"></template>\u5B57\u6BB5\u53EF\u4EE5\u5173\u8054\u53E6\u4E00\u4E2A<template key="table_name" placeholder="\u8868\u683C\u540D\u79F0"></template>\u8868\u683C\u3002',ht={colors:{background:"#ffffff",border:"#e5e7eb",appBackground:"#ffffff",listBackground:"#ffffff",dashboardBackground:"#ffffff"},space:{padding:"0",margin:"md",shadow:"none"}},bt=({drawerTitle:e,drawerVisible:r,uploadUrl:o,handleDrawerClose:s,dbId:i,tableInfo:p,token:S,url:m,role:_})=>{const B=ie(()=>({id:"upload",layout:"vertical",formWidth:"670px",fields:[{id:"fileIds",name:"fileIds",type:"uploader",required:!1,defaultValue:"",uploaderConfig:{multiple:!p,accept:".csv,.xlsx,.xls",maxFiles:p?1:20,url:o,autoUpload:!0,headers:{Authorization:S},queryParams:{databaseId:i,...p&&{tableId:p.tableId}},placeholder:O("div",{children:[a("div",{className:"text-lg font-bold",children:"\u70B9\u51FB\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u5904\u4E0A\u4F20"}),O("div",{className:"flex flex-col gap-1.8 mt-[12px]",children:[a("div",{className:"text-[#888888] font-[12px]",children:"\u6570\u91CF\uFF1A\u226420 \u6587\u4EF6\uFF08\u5F53\u524D 0/20\uFF09"}),a("div",{className:"text-[#888888] font-[12px]",style:{width:"580px"},children:"\u683C\u5F0F\uFF1A.xlsx / .xls / .csv /\uFF08\u7B2C\u4E00\u884C\u662F\u8868\u5934\uFF0C\u5176\u4ED6\u884C\u662F\u6570\u636E\uFF1BCSV \u652F\u6301 UTF-8/GBK/GB2312\u2026\uFF09"}),a("div",{className:"text-[#888888] font-[12px]",children:"\u5355\u6587\u4EF6\u9650\u5236\uFF1A \u226410\u4E07\u884C\uFF0C\u226460\u5217\uFF08\u8D85\u51FA\u81EA\u52A8\u5FFD\u7565\uFF09\uFF1B \u6BCF\u6587\u4EF6 \u22641\u4E2ASheet"}),a("div",{className:"text-[#888888] font-[12px]",children:"\u4E0A\u4F20\u7684\u6587\u4EF6\uFF0C\u5982\u679C\u6709\u4E0D\u7B26\u5408\u6587\u672C\u683C\u5F0F\u7684\u6570\u636E\u7CFB\u7EDF\u81EA\u52A8\u5FFD\u7565"})]})]}),listName:p?"\u8FFD\u52A0\u6587\u4EF6":"\u4E0A\u4F20\u6587\u4EF6\u5217\u8868",icons:{dragUpload:a("img",{src:yt,width:40}),itemStatus:{pending:a("span",{style:{fontSize:"12px",color:"#6b7280"}}),uploading:a("span",{style:{fontSize:"12px",color:"#007bff"}}),success:a("span",{style:{fontSize:"12px",color:"#10b981"}}),error:a("span",{style:{fontSize:"12px",color:"#ef4444"},children:"\u5931\u8D25"})},fileType:{default:a(Pe,{size:20,style:{color:"#6b7280"}})}},...!p&&{buttons:[{label:"\u4F7F\u7528\u6A21\u7248",icon:a("img",{src:Et}),mode:"text",onClick:()=>{l(!0)}}]},...!p&&{itemForm:[{type:"textarea",name:"description",counter:150,placeholder:"\u4E3A\u4E86\u63D0\u9AD8\u95EE\u7B54\u51C6\u786E\u7387\uFF0C\u8BF7\u8F93\u5165\u63CF\u8FF0"}]}}}]}),[p]),[b,E]=h(!1),[F,L]=h({}),$=Ce(null),[x,M]=h(!1),[t,n]=h([]),[c,l]=h(!1),[A,D]=h(me),[y,C]=h(null),[W,G]=h(me),[Z,q]=h(0),{parseFiles:se,parseAppendFile:oe,deleteUploadedFiles:ne}=ze({url:m,token:S,role:_}),X=ue(async(g,f,V)=>{var w;switch(console.log("[DynamicFormAdopter] \u4E8B\u4EF6:",g,f),g){case"form:ready":f.formRef?$.current=f.formRef:console.log("\u274C data.formRef \u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u4FDD\u5B58\u8868\u5355\u5F15\u7528");break;case"form:submit":ae();break;case"form_field_change":L(k=>({...k,[f.fieldId]:f.value}));break;case"uploader:error":(w=f.item)!=null&&w.id?n(k=>[{id:f.item.id,status:f.item.status},...k]):Y.error(f==null?void 0:f.message);break;case"uploader:success":n(k=>[{id:f.item.id,status:f.item.status},...k]);break;case"uploader:remove":const U=f.item.status;n(k=>k.filter(d=>d.id!==f.item.id)),U=="success"&&await ee([f.item.uploadApiRes]);break;default:console.log("\u672A\u5904\u7406\u7684\u4E8B\u4EF6:",g)}},[]),re=ie(()=>({label:"\u52A8\u6001\u8868\u5355\u793A\u4F8B",defaultActiveId:"form-view",model:null,views:[{label:"\u7528\u6237\u6CE8\u518C\u8868\u5355",id:"form-view",type:"form",size:"md",formWidth:B.formWidth,formConfig:{layout:B.layout,showReset:!1,showSubmit:!1,formWidth:B.formWidth,getFormData:()=>({...F,timestamp:new Date().toISOString(),formId:B.id}),onFieldChange:(g,f)=>{X("form_field_change",{fieldId:g,value:f},void 0)},onValidationError:g=>{X("form_validation_error",g,void 0)}}}],dataSource:[{id:B.id,fields:B.fields,defaultValues:{}}],eventsEmit:X,styles:{theme:ht}}),[p,B]),ae=async()=>{var g;try{E(!0);const f=await $.current.getAllData();if(f.isValid){const V=(g=f.fields.find(w=>w.name=="fileIds"))==null?void 0:g.value;if(Array.isArray(V)&&(V==null?void 0:V.length)>0){let w;if(p)w=await oe({fileIds:V.map(U=>U.uploadApiRes),tableId:p.id});else{const U={fileIds:V.map(k=>k.uploadApiRes),tableDescriptionMap:V.reduce((k,d)=>(k[d.uploadApiRes]=d.formData.description,k),{}),isGenDescription:x};w=await se(U)}w&&s("refresh")}}}catch(f){console.error("\u8868\u5355\u6570\u636E\u5931\u8D25:",f)}finally{s(),E(!1),M(!1)}},Q=async g=>{var f;try{const V=await $.current.getAllData();if(V.isValid){const w=(f=V.fields.find(U=>U.name=="fileIds"))==null?void 0:f.value;if(w&&Array.isArray(w)&&(w==null?void 0:w.length)>0){const U=w.map(d=>d.uploadApiRes),k=await ee(U)}}}catch(V){console.error("\u8868\u5355\u6570\u636E\u5931\u8D25:",V)}finally{s(),M(!1)}},ee=async g=>{try{const f=await ne(g);if(f)return f}catch(f){console.error("\u5220\u9664\u6587\u4EF6\u6570\u636E\u5931\u8D25:",f)}},P=g=>{M(g)},J=ue(g=>{D(g),console.log("\u6A21\u7248\u5185\u5BB9\u53D8\u5316:",g)},[]),te=ue(g=>{C(()=>g),console.log("getData\u51FD\u6570\u5DF2\u8BBE\u7F6E")},[]),pe=ue(async()=>{try{if(!y){console.error("getData\u51FD\u6570\u5C1A\u672A\u51C6\u5907\u597D\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}const g=y("pure_string");await navigator.clipboard.writeText(g),Y.success("\u5DF2\u590D\u5236",1)}catch(g){console.error("\u590D\u5236\u5931\u8D25:",g)}finally{l(!1)}},[y]);return O(Ie,{title:e,className:"database-upload-drawer",placement:"right",width:720,closeIcon:!1,extra:a(ge,{size:20,color:"#888888",onClick:()=>Q(),className:"cursor-pointer"}),open:r,destroyOnHidden:!0,footer:O("div",{className:"flex items-center",style:{justifyContent:p?"end":"space-between"},children:[!p&&O("div",{className:"flex gap-2 items-center",children:[a("span",{children:"\u81EA\u52A8\u751F\u6210\u6570\u636E\u8868\u63CF\u8FF0"})," ",a(ce,{title:"\u81EA\u52A8\u751F\u6210\u5F00\u542F\u65F6\u5C06\u57FA\u4E8E\u6570\u636E\u667A\u80FD\u751F\u6210\u63CF\u8FF0\uFF1B\u82E5\u5F00\u542F\u6B64\u529F\u80FD\u5E76\u624B\u52A8\u586B\u5199\u63CF\u8FF0\uFF0C\u5C06\u4F18\u5148\u91C7\u7528\u7528\u6237\u586B\u5199\u7684\u5185\u5BB9\u3002",children:a(Re,{size:14})}),a(it,{onChange:P})]}),O("div",{className:"flex self-end gap-3",children:[a(K,{mode:"default",style:{marginRight:10},label:"\u53D6\u6D88",onClick:Q}),a(K,{mode:"primary",label:"\u786E\u8BA4\u5BFC\u5165",loading:b,disabled:t.some(g=>g.status=="error"),onClick:async()=>{await ae()}})]})]}),children:[a(we,{...re},"upload-file"),a(ye,{title:O("div",{children:["\u6A21\u7248",a("span",{className:"text-[12px] text-[#888888] ml-[8px]",children:"\u5B8C\u6210\u7F16\u8F91\u540E\uFF0C\u53EF\u5C06\u6587\u672C\u590D\u5236\u7C98\u8D34\u5230\u76F8\u5E94\u63CF\u8FF0\u6846\u4E2D\u3002"})]}),width:672,destroyOnHidden:!0,open:c,onCancel:()=>l(!1),footer:O("div",{className:"flex justify-end items-center gap-3",children:[a(K,{mode:"default",label:"\u91CD\u7F6E",onClick:()=>{G(me),q(g=>g+1)}}),a(K,{mode:"primary",label:"\u590D\u5236",onClick:pe})]}),children:a(ke,{data:W,onChange:J,onGetData:te,styles:{theme:{colors:{primary:"#0969da",secondary:"#6b7280",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#3b82f6",background:"#ffffff",text:"#1f2937",border:"#e5e7eb",disabled:"#9ca3af",disabledBackground:"#f3f4f6",disabledText:"#6b7280",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)",appBackground:"transparent",listBackground:"#f9fafb",dashboardBackground:"#ffffff",textSecondary:"#6b7280"},space:{sidebar:"260px",size:"12px",radius:"8px",padding:"1rem",margin:"1rem",shadow:"0 2px 8px rgba(0,0,0,0.1)",lineHeight:"1.8"},icons:{},fonts:{body:{size:"14px",weight:"normal",family:"PingFang SC, Microsoft YaHei, Arial, sans-serif"},heading:{size:"14px",weight:"600",family:"PingFang SC, Microsoft YaHei, Arial, sans-serif"}},others:{baseFontWeight:"normal"}},templateField:{backgroundColor:"#E5EEFF",borderColor:"#84ADFF",borderRadius:"6px",padding:"6px 12px",margin:"2px",fontSize:"14px",fontWeight:"500",minWidth:"80px",textColor:"#84ADFF"}}},Z)})]})},Dt="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%201C13.4997%201.50025%2013.25%201.99975%2013.25%202.5C13.25%203.00025%2013.4997%203.49975%2014%204C13.4997%203.49975%2013.0003%203.25%2012.5%203.25C11.9997%203.25%2011.5003%203.49975%2011%204C11.5003%203.49975%2011.75%203.00025%2011.75%202.5C11.75%201.99975%2011.5003%201.50025%2011%201C11.5003%201.50025%2011.9997%201.75%2012.5%201.75C13.0003%201.75%2013.4997%201.50025%2014%201Z'%20fill='%23055AFF'/%3e%3cpath%20d='M13%206.28571V13C13%2013.5523%2012.5523%2014%2012%2014H4C3.44772%2014%203%2013.5523%203%2013V3C3%202.44772%203.44772%202%204%202H9.25'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cline%20x1='5.65'%20y1='6.35'%20x2='10.35'%20y2='6.35'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cline%20x1='5.65'%20y1='9.35'%20x2='8.35'%20y2='9.35'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3c/svg%3e",Bt="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_4199_8826)'%3e%3cpath%20d='M15.5554%2012.4444C14.9626%2013.0373%2014.6666%2013.6293%2014.6666%2014.2222C14.6666%2014.8151%2014.9626%2015.4071%2015.5554%2016C14.9626%2015.4071%2014.3706%2015.1111%2013.7777%2015.1111C13.1848%2015.1111%2012.5928%2015.4071%2011.9999%2016C12.5928%2015.4071%2012.8888%2014.8151%2012.8888%2014.2222C12.8888%2013.6293%2012.5928%2013.0373%2011.9999%2012.4444C12.5928%2013.0373%2013.1848%2013.3333%2013.7777%2013.3333C14.3706%2013.3333%2014.9626%2013.0373%2015.5554%2012.4444ZM14.6488%204.01778C15.1905%204.55954%2015.4948%205.29431%2015.4948%206.06044C15.4948%206.82658%2015.1905%207.56135%2014.6488%208.10311L7.735%2015.0169C7.46766%2015.2892%207.14901%2015.5058%206.79746%2015.6543C6.44592%2015.8028%206.06844%2015.8801%205.68684%2015.8819C5.30523%2015.8836%204.92706%2015.8097%204.57417%2015.6645C4.22127%2015.5193%203.90065%2015.3056%203.63081%2015.0357C3.36097%2014.7659%203.14727%2014.4453%203.00205%2014.0924C2.85682%2013.7395%202.78295%2013.3613%202.7847%2012.9797C2.78646%2012.5981%202.8638%2012.2206%203.01226%2011.8691C3.16072%2011.5176%203.37736%2011.1989%203.64967%2010.9316L3.95545%2010.6249L3.85145%2010.5244C3.30922%2010.0267%202.76522%209.77778%202.22211%209.77778C1.62923%209.77778%201.03722%2010.0738%200.444336%2010.6667C1.03722%2010.0738%201.33322%209.48178%201.33322%208.88889C1.33322%208.296%201.03722%207.704%200.444336%207.11111C1.03722%207.704%201.62923%208%202.22211%208C2.815%208%203.407%207.704%203.99989%207.11111C3.407%207.704%203.111%208.296%203.111%208.88889C3.111%209.46667%203.39278%2010.0444%203.95545%2010.6222L10.5634%204.01778C11.1052%203.47606%2011.84%203.17173%2012.6061%203.17173C13.3723%203.17173%2014.107%203.47606%2014.6488%204.01778ZM9.55189%206.91378L4.59189%2011.8738C4.30004%2012.1655%204.13603%2012.5612%204.13594%2012.9739C4.1359%2013.1782%204.17611%2013.3806%204.25426%2013.5694C4.33242%2013.7582%204.44699%2013.9297%204.59145%2014.0742C4.7359%2014.2187%204.9074%2014.3334%205.09617%2014.4116C5.28493%2014.4898%205.48725%2014.5301%205.69158%2014.5302C6.10424%2014.5303%206.50004%2014.3664%206.79189%2014.0747L11.7519%209.11378L9.55189%206.91378ZM11.5066%204.96089L10.495%205.97156L12.695%208.17156L13.7057%207.16C13.9846%206.86582%2014.1377%206.47437%2014.1323%206.069C14.1269%205.66364%2013.9635%205.27639%2013.6768%204.98973C13.3902%204.70306%2013.0029%204.53964%2012.5976%204.53425C12.1922%204.52887%2011.8007%204.68194%2011.5066%204.96089ZM9.59545%200C8.85589%200.740444%208.48434%201.48178%208.48434%202.22222C8.48434%202.96267%208.85589%203.704%209.59545%204.44444C8.85589%203.704%208.11456%203.33333%207.37322%203.33333C6.63367%203.33333%205.89234%203.704%205.151%204.44444C5.89234%203.704%206.26211%202.96267%206.26211%202.22222C6.26211%201.48178%205.89322%200.740444%205.15189%200C5.89322%200.740444%206.63456%201.11111%207.37411%201.11111C8.11545%201.11111%208.85678%200.740444%209.59634%200H9.59545Z'%20fill='%23055AFF'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_4199_8826'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",{confirm:At}=ye,vt='<template key="type" placeholder="\u8F93\u5165\u8868\u683C\u7C7B\u578B"></template>\u8868\u683C\u4E3B\u8981\u5C55\u793A\u4E86<template key="scene" placeholder="\u8F93\u5165\u573A\u666F\u540D\u79F0"></template>\u573A\u666F\u7684\u6570\u636E,\u5305\u542B<template key="primary_key" placeholder="\u4E3B\u8981\u5B57\u6BB5(\u53EF\u5199\u591A\u4E2A,\u7528\u987F\u53F7\u5206\u9694)"></template>\u7B49\u4E3B\u8981\u5B57\u6BB5,\u652F\u6301\u7528\u6237\u67E5\u8BE2<template key="search_direction" placeholder="\u5927\u6982\u4ECB\u7ECD\u9700\u8981\u67E5\u8BE2\u7684\u65B9\u5411"></template>\u95EE\u9898,\u5982\u679C\u8BBE\u8BA1\u591A\u8868\u5173\u8054\u67E5\u8BE2,\u6700\u597D\u8BF4\u660E\u6B64\u8868\u683C\u901A\u8FC7<template key="key_name" placeholder="\u5B57\u6BB5\u540D\u79F0"></template>\u5B57\u6BB5\u53EF\u4EE5\u5173\u8054\u53E6\u4E00\u4E2A<template key="table_name" placeholder="\u8868\u683C\u540D\u79F0"></template>\u8868\u683C\u3002',xt=({drawerTitle:e,drawerVisible:r,tableInfo:o,handleDrawerClose:s,optimizeDesc:i,eventsEmit:p})=>{const S=ie(()=>(o==null?void 0:o.data.find(C=>C.columnId=="name").value)||"-",[o]),[m,_]=h(""),[B,b]=h(null),[E,F]=h(""),[L,$]=h(0),[x,M]=h(!1),[t,n]=h(!1);xe(()=>{const C=(o==null?void 0:o.data.find(W=>W.columnId=="description").value)||"-";F(C)},[o]);const c=()=>{At({title:"\u4F60\u786E\u5B9A\u8981\u4F7F\u7528\u6A21\u677F\u5417\uFF1F",content:"\u8FD9\u5C06\u66FF\u6362\u4F60\u5F53\u524D\u5DF2\u586B\u5199\u7684\u5185\u5BB9\uFF0C\u4E14\u65E0\u6CD5\u64A4\u9500\u3002",okText:"\u786E\u8BA4\u66FF\u6362",cancelText:"\u53D6\u6D88",onOk(){F(vt),$(C=>C+1)},onCancel(){console.log("Cancel")}})},l=ue(C=>{_(C),console.log("\u6A21\u7248\u5185\u5BB9\u53D8\u5316:",C)},[]),A=ue(C=>{b(()=>C),console.log("getData\u51FD\u6570\u5DF2\u8BBE\u7F6E")},[]),D=async()=>{try{M(!0);const C=await i(o.tableId);C&&(F(C),$(W=>W+1),M(!1))}catch{Y.error("AI \u4F18\u5316\u5931\u8D25")}},y=ue(()=>{if(!B){console.error("getData\u51FD\u6570\u5C1A\u672A\u51C6\u5907\u597D\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}const C=B("pure_string");p("table_info:update",C)},[B,p]);return O(Ie,{title:e,placement:"right",width:720,onClose:s,closeIcon:!1,extra:a(ge,{size:20,color:"#888888",onClick:s,className:"cursor-pointer"}),open:r,destroyOnHidden:!0,footer:a("div",{className:"flex items-center",style:{justifyContent:"end"},children:O("div",{className:"flex self-end gap-3",children:[a(K,{mode:"default",style:{marginRight:10},label:"\u53D6\u6D88",onClick:s}),a(K,{mode:"primary",label:"\u786E\u8BA4",onClick:()=>y(),disabled:x})]})}),children:[a("div",{className:"mb-[10px] font-bold",children:S}),O("div",{className:"mb-[10px]",children:[a("span",{style:{color:"#FF3B30",marginRight:"4px"},children:"*"}),a("span",{children:"\u6570\u636E\u8868\u63CF\u8FF0"}),a("span",{className:"text-[#888888] ml-[4px]",children:"(\u8BF7\u51C6\u786E\u586B\u5199\u8868\u683C\u7684\u5E94\u7528\u573A\u666F\u63CF\u8FF0\uFF0C\u5927\u6A21\u578B\u5C06\u4F9D\u8D56\u6B64\u4FE1\u606F\u8BC6\u522B\u5E76\u6B63\u786E\u8C03\u7528\u8BE5\u6570\u636E\u8868\u3002)"})]}),a(ke,{data:E,onChange:l,onGetData:A,styles:{theme:{colors:{primary:"#0969da",secondary:"#6b7280",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#3b82f6",background:"#ffffff",text:"#1f2937",border:"#e5e7eb",disabled:"#9ca3af",disabledBackground:"#f3f4f6",disabledText:"#6b7280",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)",appBackground:"transparent",listBackground:"#f9fafb",dashboardBackground:"#ffffff",textSecondary:"#6b7280"},space:{sidebar:"260px",size:"12px",radius:"8px",padding:"1rem",margin:"1rem",shadow:"0 2px 8px rgba(0,0,0,0.1)",lineHeight:"1.8"},icons:{},fonts:{body:{size:"14px",weight:"normal",family:"PingFang SC, Microsoft YaHei, Arial, sans-serif"},heading:{size:"14px",weight:"600",family:"PingFang SC, Microsoft YaHei, Arial, sans-serif"}},others:{baseFontWeight:"normal"}},templateField:{backgroundColor:"#E5EEFF",borderColor:"#84ADFF",borderRadius:"6px",padding:"6px 12px",margin:"2px",fontSize:"14px",fontWeight:"500",minWidth:"80px",textColor:"#84ADFF"}}},L),O("div",{children:[a(Ne,{open:t,onOpenChange:C=>n(!!C),content:a("div",{style:{width:"600px",margin:"10px",padding:"10px"},onClick:c,className:"hover:bg-gray-100 h-[80px] cursor-pointer rounded",children:"______\u8868\u683C\u4E3B\u8981\u5C55\u793A\u4E86______\u573A\u666F\u7684\u6570\u636E\uFF0C\u5305\u542B______\u3001______\u3001______\u7B49\u4E3B\u8981\u5B57\u6BB5\uFF0C\u652F\u6301\u7528\u6237\u67E5\u8BE2______\u95EE\u9898(\u5927\u6982\u4ECB\u7ECD)\u5982\u679C\u6D89\u53CA\u591A\u8868\u5173\u8054\u67E5\u8BE2\uFF0C\u6700\u597D\u8BF4\u660E\u6B64\u8868\u683C\u901A\u8FC7______\u5B57\u6BB5\u53EF\u4EE5\u5173\u8054\u53E6\u4E00\u4E2A______\u8868\u683C\u3002"}),title:O("div",{className:"flex justify-between items-center",style:{margin:"10px"},children:[a("div",{className:"text-[16px]",children:"\u6A21\u7248"}),a(ge,{size:20,color:"#888888",onClick:()=>n(!1),className:"cursor-pointer"})]}),trigger:"click",destroyOnHidden:!0,placement:"bottomRight",getPopupContainer:C=>C,children:a("span",{children:a(K,{mode:"text",icon:a("img",{src:Dt}),children:"\u4F7F\u7528\u6A21\u7248"})})}),a(K,{onClick:D,mode:"text",icon:a("img",{src:Bt}),loading:x,children:"AI\u4F18\u5316"})]})]})},wt=""+new URL("empty.png",import.meta.url).href;var H=(e=>(e[e.DATE=0]="DATE",e[e.VIEW=1]="VIEW",e[e.ERROR=2]="ERROR",e[e.AUTHORIZE=3]="AUTHORIZE",e[e.DELETE=4]="DELETE",e[e.ANALYSIS_OR_EXTRACT=5]="ANALYSIS_OR_EXTRACT",e[e.DOWNLOAD=6]="DOWNLOAD",e[e.EDIT=7]="EDIT",e[e.ADD=8]="ADD",e[e.ANALYSIS_CONFIG=9]="ANALYSIS_CONFIG",e[e.AUTHORIZE_CONFIG=10]="AUTHORIZE_CONFIG",e))(H||{}),Ee=(e=>(e.GENERATING="generating",e.SUCCESS="success",e.FAIL="fail",e))(Ee||{});const Fe={success:"green",error:"red",warning:"orange",processing:"blue",info:"cyan",default:"default"},kt=e=>typeof e=="string"&&e in Fe?Fe[e]:Fe.default,fe=e=>{const{value:r,cell:o}=e;switch(o.columnId){case"importstatus":return r?a(ce,{title:"\u6709\u8FFD\u52A0\u5931\u8D25\u7684\u6587\u4EF6\uFF0C\u8BF7\u53CA\u65F6\u5904\u7406",children:a(je,{color:"red",bordered:!1,children:"\u8FFD\u52A0\u5931\u8D25"})}):a(he,{});case"status":const s=kt(e.cell.statusType);return r=="\u5BFC\u5165\u5931\u8D25"?a(ce,{title:o.errorMsg,children:O("div",{className:"flex items-center gap-2",children:[a(De,{color:s,text:r}),a(Te,{size:14,color:"red"})]})}):a(De,{color:s,text:r});default:return a(he,{})}},Ae=[{statusType:"success",value:"\u5BFC\u5165\u6210\u529F",status:"30"},{statusType:"error",value:"\u5BFC\u5165\u5931\u8D25",status:"00"},{statusType:"default",value:"\u5F85\u5BFC\u5165",status:"10"},{statusType:"processing",value:"\u5BFC\u5165\u4E2D",status:"20"},{statusType:"processing",value:"\u5BFC\u5165\u4E2D",status:"11"}],It=e=>{var s,i;const{cell:r,value:o}=e;return typeof o=="string"?a("div",{title:o,style:{maxWidth:240,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o}):(s=r.tableMeta)!=null&&s.isGenDescription&&((i=r.tableMeta)==null?void 0:i.generateDescriptionStatus)=="generating"?O("div",{className:"flex items-center gap-1 text-[#84ADFF]",style:{color:"#84ADFF"},children:[a("span",{children:"\u751F\u6210\u4E2D"}),a(lt,{size:14})]}):"-"},Tt=({dbInfo:e,setDrawerTitle:r,setDrawerVisible:o,getBtnDisabled:s})=>O("div",{className:"flex flex-col items-center justify-center h-full",children:[a("div",{className:"text-xl font-semibold mb-3",children:a("img",{src:wt,width:120})}),a("div",{className:"text-base mb-2",style:{color:"#888888"},children:"\u6682\u65E0\u6570\u636E\u6587\u4EF6"}),a("div",{className:"flex gap-3",children:a(K,{mode:"primary",label:"\u4E0A\u4F20\u6570\u636E\u6587\u4EF6",disabled:s&&s(8,e==null?void 0:e.permission),onClick:()=>{r("\u4E0A\u4F20\u6570\u636E\u6587\u4EF6"),o(!0)}})})]}),{confirm:ve}=ye,Ut=e=>{const{url:r,token:o,role:s,id:i,dbType:p,CustomComponents:S,getBtnDisabled:m,uploadUrl:_}=e,[B,b]=h({container:"ready",content:"ready"}),E=Ce(null),F=Ce(null),[L,$]=h(),[x,M]=h({}),[t,n]=h(),[c,l]=h(!1),[A,D]=h(""),[y,C]=h(),[W,G]=h(!1),[Z,q]=h(""),{getTableList:se,delTableById:oe,delFileById:ne,updateTableInfo:X,optimizeDesc:re,getTableTreeList:ae,reParseFile:Q,getDBDetailById:ee}=ze({url:r,token:o,role:s,eventsEmit:e.eventsEmit});xe(()=>(i&&p&&(b(d=>({...d,container:"loading"})),P()),()=>{F.current&&(clearTimeout(F.current),F.current=null)}),[i,p]);const P=async()=>{try{const d=await ee(i,p);d&&(n(d),b(u=>({...u,container:"ready",content:"loading"})))}catch(d){console.log("[TableApiError] getDBInfo:",d)}await k()},J=async()=>{try{if(p=="DirectDB"){const d=await se(i);if(d){const u=pe(d);return $(u||[]),b(R=>({...R,content:"ready"})),u||[]}else b(u=>({...u,content:"error"}))}else{const d=await ae(i);if(d){const u=te(d);return $(u||[]),b(R=>({...R,content:"ready"})),u||[]}else b(u=>({...u,content:"error"}))}}catch(d){console.log("[TableApiError] getTableList:",d)}};function te(d){return(d||[]).map((u,R)=>{var I,z;let v=Ae.find(T=>T.status==u.status);const N=u.children.some(T=>T.status=="00");return{id:u.fileId.toString(),tableId:u.tableId,data:[{columnId:"name",value:(u==null?void 0:u.originalFilename)||"-",type:"label"},{columnId:"description",value:(I=u==null?void 0:u.tableMeta)==null?void 0:I.description,type:"customized",tableMeta:u==null?void 0:u.tableMeta},{columnId:"count",value:`${u.rowCount}\u884C\uFF0C${u.columnCount}\u5217`,type:"text"},{columnId:"status",...v,type:"customized",errorMsg:u.errorMsg},{columnId:"importstatus",value:N,type:"customized"},{columnId:"createdAt",value:u.gmtCreate,type:"date"},{columnId:"updatedAt",value:u.gmtModified,type:"date"},...u.status=="30"?[{columnId:"actions",value:"view",label:"\u67E5\u770B",type:"action",disabled:m&&m(H.VIEW,u.permission)},{columnId:"actions",value:"edit",label:"\u4FEE\u6539\u914D\u7F6E",type:"action",disabled:m&&m(H.EDIT,u.permission)},{columnId:"actions",value:"addData",label:"\u8FFD\u52A0\u6570\u636E",type:"action",disabled:m&&m(H.EDIT,u.permission)}]:[],...u.status=="00"?[{columnId:"actions",value:"reValidate",label:"\u91CD\u65B0\u5BFC\u5165",type:"action"}]:[],{columnId:"actions",value:"delete",label:"\u5220\u9664",type:"action",disabled:m&&m(H.DELETE,u.permission)}],expanded:!1,...u.children&&((z=u.children)==null?void 0:z.length)>0&&{children:[...(u.children||[]).map(T=>{const Oe=Ae.find(Le=>Le.status==T.status),_e=[{columnId:"name",value:T.originalFilename,type:"text"},{columnId:"count",value:`${T.rowCount}\u884C\uFF0C${T.columnCount}\u5217`,type:"text"},{columnId:"status",...Oe,errorMsg:T.errorMsg,type:"customized"},{columnId:"createdAt",value:T.gmtCreate,type:"date"},{columnId:"updatedAt",value:T.gmtModified,type:"date"},...T.status=="30"?[{columnId:"actions",value:"view",label:"\u67E5\u770B",type:"action",disabled:m&&m(H.VIEW,T.permission)}]:[],...T.status=="00"?[{columnId:"actions",value:"reValidate",label:"\u91CD\u65B0\u5BFC\u5165",type:"action",disabled:m&&m(H.ADD,T.permission)}]:[],{columnId:"actions",value:"delete_sub",label:"\u5220\u9664",type:"action",disabled:m&&m(H.DELETE,T.permission)}];return{id:T.fileId.toString(),tableId:T.tableId,data:_e}})]}}})}function pe(d){return(d||[]).map((u,R)=>({id:u.id||Ve(8),data:[{columnId:"name",value:u.physicalName},{columnId:"cnname",value:u.businessName},{columnId:"colcount",value:u.columnCount},{columnId:"count",value:`${u.rowCount}\u884C\uFF0C${u.columnCount}\u5217`},{columnId:"actions",value:"view",label:"\u67E5\u770B",disabled:m&&m(H.VIEW,u.permission)}]}))}async function g(d,u,R){switch(console.log("[adopter] mergedEventsEmit",d,u,R),d){case"table_action_delete":{try{if(console.log("[delete] \u5220\u9664\u4E8B\u4EF6\u6570\u636E:",u),!u||!u.tableId&&!u.id){console.error("[delete] \u5220\u9664\u4E8B\u4EF6\u6570\u636E\u4E0D\u5B8C\u6574:",u),Y.error("\u5220\u9664\u5931\u8D25\uFF1A\u6570\u636E\u4E0D\u5B8C\u6574");return}const v=u.tableId||u.id,N=u.id;ve({title:"\u786E\u8BA4\u5220\u9664\u6570\u636E\u5E93\uFF1F",content:"\u8BE5\u6570\u636E\u8868\u53CA\u5176\u8FFD\u52A0\u6570\u636E\u90FD\u5C06\u88AB\u5220\u9664\u4E14\u65E0\u6CD5\u6062\u590D",icon:a(Te,{color:"#FF4D4F",className:"mr-[8px]"}),okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",async onOk(){await oe(v,p)&&(E!=null&&E.current)?(E==null||E.current.appFn.removeItem(N),Y.success("\u5220\u9664\u6210\u529F")):Y.error("\u5220\u9664\u5931\u8D25")}})}catch(v){console.error("\u5220\u9664\u8868\u6570\u636E\u5931\u8D25:",v),Y.error("\u5220\u9664\u5931\u8D25")}break}case"table_action_edit":{q("\u4FEE\u6539\u6570\u636E\u914D\u7F6E"),G(!0),C(u);break}case"toolbar_upload":{D("\u4E0A\u4F20\u6570\u636E\u6587\u4EF6"),l(!0);break}case"table_action_addData":{D("\u8FFD\u52A0\u6570\u636E"),l(!0),C(u);break}case"table_action_reValidate":{await Q(u.id)&&(F.current&&(clearTimeout(F.current),F.current=null),await k());break}case"table_info:update":{try{if(y!=null&&y.id){const v=(y==null?void 0:y.data.find(I=>I.columnId=="name").value)||"-";if(await X({tableId:y.tableId,description:u,businessName:v})&&(E!=null&&E.current)){const I={...y,data:y.data.map(z=>z.columnId=="description"?{...z,value:u}:z)};E==null||E.current.appFn.updateItem(I,y.id),Y.success("\u4FEE\u6539\u914D\u7F6E\u6210\u529F")}}}catch(v){console.error("\u4FEE\u6539\u914D\u7F6E\u5931\u8D25",v)}finally{w()}break}case"table_action_delete_sub":{try{ve({title:"\u786E\u8BA4\u5220\u9664\u6570\u636E\uFF1F",content:"\u5220\u9664\u540E\uFF0C\u8BE5\u6570\u636E\u5C06\u65E0\u6CD5\u6062\u590D",okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",async onOk(){const{id:v,tableId:N}=u;await ne(u.id)&&(E!=null&&E.current)&&(M(z=>({...z,[N]:[...z[N]||[],v]})),u.data.find(z=>z.status=="00")&&(F.current&&(clearTimeout(F.current),F.current=null),k()),R.removeItem(v,N),Y.success("\u8FFD\u52A0\u6587\u4EF6\u6570\u636E\u5220\u9664\u6210\u529F"))}})}catch{console.log("\u5220\u9664\u8868\u6570\u636E\u5931\u8D25")}break}case"toolbar_auth":{typeof e.eventsEmit=="function"&&e.eventsEmit("toolbar_auth",t);break}default:typeof e.eventsEmit=="function"&&e.eventsEmit(d,u);break}}const f=ie(()=>({label:"\u6570\u636E\u8868\u7BA1\u7406",model:null,defaultActiveId:"direct-table-view",views:[{label:"\u6211\u7684\u6570\u636E\u5E93",id:"direct-table-view",type:"table",viewBehavior:"pagination",allowMultiSelect:!1,columns:[{id:"name",title:"\u6570\u636E\u8868\u82F1\u6587\u540D\u79F0",type:"label"},{id:"cnname",title:"\u6570\u636E\u8868\u4E2D\u6587\u540D\u79F0",type:"label"},{id:"colcount",title:"\u5B57\u6BB5\u6570",type:"text"},{id:"count",title:"\u6570\u636E\u91CF",type:"text"},{id:"actions",title:"\u64CD\u4F5C",type:"action"}],toolbar:[{type:"fuzzy_search",key:"search",label:"\u641C\u7D22",searchKeys:["name","description"],position:"right"},{type:"button",key:"auth",label:"\u914D\u7F6E",btnType:"default",position:"right"}]}]}),[L,p]),V=ie(()=>({label:"\u6570\u636E\u8868\u7BA1\u7406",model:null,defaultActiveId:"data-table-view",views:[{label:"\u4E0A\u4F20\u6570\u636E\u5217\u8868",id:"data-table-view",type:"table",viewBehavior:"pagination",allowMultiSelect:!1,viewPageSize:10,columns:[{id:"name",title:"\u6587\u4EF6\u540D",type:"label",tip:"\u6587\u4EF6\u540D"},{id:"description",title:"\u63CF\u8FF0",type:"customized",component:a(It,{}),helpText:"\u6253\u5F00\u81EA\u52A8\u751F\u6210\u63CF\u8FF0\u5F00\u5173\u540E\uFF0C\u82E5\u63CF\u8FF0\u672A\u6B63\u5E38\u751F\u6210\uFF0C\u5219\u63CF\u8FF0\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u5982\u60A8\u4ECD\u7136\u9700\u8981\u63CF\u8FF0\uFF0C\u5219\u9700\u8981\u624B\u52A8\u6DFB\u52A0"},{id:"count",title:"\u6570\u636E\u91CF",type:"text",tip:"\u6570\u636E\u91CF"},{id:"status",title:"\u5BFC\u5165\u72B6\u6001",type:"customized",component:a(fe,{})},{id:"importstatus",title:"\u8FFD\u52A0\u63D0\u793A",type:"customized",component:a(fe,{})},{id:"createdAt",title:"\u521B\u5EFA\u65F6\u95F4",type:"date",tip:"\u521B\u5EFA\u65F6\u95F4"},{id:"updatedAt",title:"\u66F4\u65B0\u65F6\u95F4",type:"date",tip:"\u66F4\u65B0\u65F6\u95F4"},{id:"actions",title:"\u64CD\u4F5C",type:"action"}],toolbar:[{type:"button",key:"upload",label:"\u4E0A\u4F20\u6570\u636E\u6587\u4EF6",btnType:"primary",disabled:m&&m(H.ADD,t==null?void 0:t.permission),icon:a(We,{size:12})},{type:"fuzzy_search",key:"search",label:"\u641C\u7D22",searchKeys:["name","description",["name"]],position:"right"},{type:"button",key:"auth",label:"\u914D\u7F6E",btnType:"default",position:"right"}]}],subTableConfig:{type:"table",allowMultiSelect:!1,viewBehavior:"pagination",viewPageSize:5,columns:[{title:"\u8FFD\u52A0\u6587\u4EF6\u540D",id:"name",type:"text",tip:"\u8FFD\u52A0\u6587\u4EF6\u540D"},{title:"\u6570\u636E\u91CF",id:"count",type:"text",tip:"\u6570\u636E\u91CF"},{id:"status",title:"\u5BFC\u5165\u72B6\u6001",type:"customized",tip:"\u5BFC\u5165\u72B6\u6001",component:a(fe,{})},{title:"\u521B\u5EFA\u65F6\u95F4",id:"createdAt",type:"date",tip:"\u521B\u5EFA\u65F6\u95F4"},{title:"\u66F4\u6539\u65F6\u95F4",id:"updatedAt",type:"date",tip:"\u66F4\u6539\u65F6\u95F4"},{title:"\u64CD\u4F5C",id:"actions",type:"action"}]},subTablePendingIds:x,onSubTableRowAnimationComplete:(d,u)=>{M(R=>({...R,[d]:(R[d]||[]).filter(v=>v!==u)}))}}),[x,L,p,t]),w=d=>{l(!1),G(!1),C(void 0),d=="refresh"&&(F.current&&(clearTimeout(F.current),F.current=null),k())};function U(d){var u,R;if(!Array.isArray(d))return!0;for(const v of d){if(v.data){const N=v.data.find(z=>z.columnId==="status"),I=v.data.find(z=>z.columnId==="description");if(console.log("+++++",N.status==="20"||N.status==="11"||((u=I==null?void 0:I.tableMeta)==null?void 0:u.generateDescriptionStatus)==Ee.GENERATING),N&&(N.status==="20"||N.status==="11"||((R=I==null?void 0:I.tableMeta)==null?void 0:R.generateDescriptionStatus)==Ee.GENERATING))return!1}if(Array.isArray(v.children)){for(const N of v.children)if(N.data){const I=N.data.find(z=>z.columnId==="status");if(I&&(I.status==="20"||I.status==="11"))return!1}}}return!0}const k=async()=>{const d=await J();U(d||[])?F.current&&(clearTimeout(F.current),F.current=null):(F.current&&(clearTimeout(F.current),F.current=null),F.current=setTimeout(()=>{k()},5e3))};return O(Ue,{title:t==null?void 0:t.name,description:(t==null?void 0:t.description)||"-",goBack:()=>{var d;(d=e.eventsEmit)==null||d.call(e,"goBack",{})},children:[a(we,{dataSource:L,ref:E,eventsEmit:g,status:B,styles:{theme:{...be,colors:{...be.colors,tableFirstColumnBg:"#ffffff",tableLastColumnBg:"#ffffff",paginationBackground:"#ffffff",subTableBackground:"#F5F5F5",tableHeaderBg:"#F5F5F5"}},mode:"light"},CustomComponents:{EmptyData:()=>a(Tt,{dbInfo:t,setDrawerTitle:D,setDrawerVisible:l,getBtnDisabled:m}),...S},...p=="DataTable"?V:f}),a(bt,{drawerTitle:A,drawerVisible:c,handleDrawerClose:w,dbId:i,token:o,url:r,uploadUrl:_,role:s,tableInfo:y}),a(xt,{drawerTitle:Z,drawerVisible:W,handleDrawerClose:w,tableInfo:y,optimizeDesc:re,eventsEmit:g})]})};export{Ut as D,ft as P,Ne as a,de as g};
@@ -1,4 +1,4 @@
1
- import{jsxs as Ee,jsx as B,Fragment as _l}from"react/jsx-runtime";import*as p from"react";import X,{forwardRef as sr,createElement as Ya,version as dm,useMemo as _t,useState as vt,useRef as Pe,useCallback as Xe,useEffect as wt,useImperativeHandle as Ki,createContext as Li,useContext as An,Children as fm,useLayoutEffect as pm,isValidElement as mm}from"react";import{l as gm,b as hm,a as vm,J as ym,i as bm}from"./index-CN2AYX8Q.js";import{d as Ht,c as xm,h as Cm,i as Js}from"./index-LDFwTu47.js";import"./style-Bn7b5XHU.js";import*as wm from"react-dom";import $s,{flushSync as Xa,createPortal as dd,unstable_batchedUpdates as km}from"react-dom";var Gr=(e=>(e.FLAT="files",e.NAV="nav",e))(Gr||{});const Em=()=>B("div",{className:"main relative h-full w-full flex items-center justify-center",children:B("div",{className:"text-2xl font-bold",children:"\u5E94\u7528\u52A0\u8F7D\u4E2D..."})}),Sm=()=>B("div",{className:"main relative h-full w-full flex items-center justify-center",children:B("div",{className:"text-2xl font-bold",children:"\u5E94\u7528\u9519\u8BEF"})}),Am=()=>B("div",{className:"main relative h-full w-full flex items-center justify-center",children:B("div",{className:"text-lg font-medium",children:"\u5BB9\u5668\u52A0\u8F7D\u4E2D..."})}),Om=()=>B("div",{className:"main relative h-full w-full flex items-center justify-center",children:B("div",{className:"text-lg font-medium",children:"\u5BB9\u5668\u9519\u8BEF"})}),Im=()=>B("div",{className:"main relative h-full w-full flex items-center justify-center",children:B("div",{className:"text-base font-medium",children:"\u5185\u5BB9\u52A0\u8F7D\u4E2D..."})}),Nm=()=>B("div",{className:"main relative h-full w-full flex items-center justify-center",children:B("div",{className:"text-base font-medium",children:"\u5185\u5BB9\u9519\u8BEF"})}),Mm=({viewType:e,cardType:t})=>Ee("div",{className:"main relative h-full w-full flex flex-col items-center justify-center",children:[B("div",{className:"text-6xl mb-4",style:{color:"#d1d5db"},children:"\u{1F4ED}"}),B("div",{className:"text-lg font-medium mb-2",style:{color:"#6b7280"},children:e==="card"?"\u6682\u65E0\u6570\u636E":e==="table"?"\u6682\u65E0\u8868\u683C\u6570\u636E":"\u6682\u65E0\u6570\u636E"}),B("div",{className:"text-sm",style:{color:"#9ca3af"},children:e==="card"?"\u70B9\u51FB\u4E0A\u65B9\u6309\u94AE\u6DFB\u52A0\u6570\u636E":e==="table"?"\u8BF7\u5148\u6DFB\u52A0\u6570\u636E\u5230\u8868\u683C\u4E2D":"\u8BF7\u5148\u6DFB\u52A0\u6570\u636E"})]}),xn=(e,t)=>{console.log("[findNodeById] Searching for id:",t,"in nodes:",e);for(const n of e){if(console.log("[findNodeById] Checking node:",n),n.id===t)return console.log("[findNodeById] Found node:",n),n;if(n.children){const r=Array.isArray(n.children)?n.children:Object.values(n.children);console.log("[findNodeById] Searching in children:",r);const o=xn(r,t);if(o)return console.log("[findNodeById] Found in children:",o),o}}return console.log("[findNodeById] Node not found for id:",t),null},Za=e=>{for(const t of e){if(t.type)return t.id;if(t.children){const n=Array.isArray(t.children)?t.children:Object.values(t.children),r=Za(n);if(r)return r}}},Pm=e=>{const t=n=>{let r=[];return n.children&&(r=Array.isArray(n.children)?n.children:Object.values(n.children)),{title:n.label,key:n.id,children:r.length>0?r.map(t):void 0,selectable:!0}};return e.map(t)},Fm=(e,t)=>Array.isArray(e)?t==="table"?e.filter(n=>n&&n.data&&Array.isArray(n.data)):e:e&&typeof e=="object"?[e]:[],Rm=e=>{const t=new Set;return e.forEach(n=>{n.adding&&t.add(n.id)}),t},Bm=(e,t)=>{const[n,r]=vt(()=>{const g=Array.isArray(e)?e:[];return console.log("[useAppState] \u521D\u59CB\u5316innerData:",g),g}),[o,i]=vt(new Set),[a,s]=vt(new Set),[l,c]=vt(""),[u,d]=vt([]);wt(()=>{if(console.log("[useAppState] \u6570\u636E\u6E90\u53D8\u5316:",{dataSource:e,activeNodeType:t}),t==="form"){const f=Array.isArray(e)?e:[];r(f);return}const g=Fm(e,t);console.log("[useAppState] \u9A8C\u8BC1\u540E\u7684\u6570\u636E:",g),r(g);const v=Rm(g);s(v),d([])},[e,t]);const m=Xe(()=>{d([]),c(""),i(new Set)},[]);return{innerData:n,setInnerData:r,pendingIds:o,setPendingIds:i,addingIds:a,setAddingIds:s,fuzzyValue:l,setFuzzyValue:c,selectedIds:u,setSelectedIds:d,resetStateOnNodeChange:m}},jm=(e,t,n,r,o,i,a)=>{const s=Xe((S,M)=>{const{tableId:P,...O}=M||{};M!=null&&M.animate?(r(S.id),e(N=>{if(P)return N.map(R=>{if(R.id===P){const T=[...R.children||[],{...S,adding:!0}];return{...R,children:T}}return R});const F={...S,adding:!0};if((O==null?void 0:O.position)==="start"||(O==null?void 0:O.position)===void 0)return[F,...N];if(typeof(O==null?void 0:O.position)=="number"){const R=[...N];return R.splice(O.position,0,F),R}return[F,...N]})):e(N=>{if(P)return N.map(F=>{if(F.id===P){const R=[...F.children||[],S];return{...F,children:R}}return F});if((O==null?void 0:O.position)==="start")return[S,...N];if(typeof(O==null?void 0:O.position)=="number"){const F=[...N];return F.splice(O.position,0,S),F}return[...N,S]})},[e,r]),l=Xe((S,M)=>{S&&e(P=>{if(!Array.isArray(P))return console.warn("[useAppFunctions] removeItem: prev\u4E0D\u662F\u6570\u7EC4\uFF0C\u91CD\u7F6E\u4E3A\u7A7A\u6570\u7EC4"),[];if(M)return P.map(N=>{if(N.id===M&&N.children){const F=N.children.map(R=>R.id===S?{...R,removing:!0}:R);return{...N,children:F}}return N});const O=P.map(N=>N.id===S?{...N,removing:!0}:N);return console.log("[useAppFunctions] removeItem \u8BBE\u7F6Eremoving",S,O),O})},[e]),c=Xe((S,M)=>{e(P=>Array.isArray(P)?P.map(O=>{if(O.id===M&&O.children){const N=O.children.filter(F=>F.id!==S);if(N.length===0){const{children:F,...R}=O;return R}return{...O,children:N}}return O}):[])},[e]),u=Xe((S,M)=>{!S||S.length===0||e(P=>{if(!Array.isArray(P))return console.warn("[useAppFunctions] removeItems: prev\u4E0D\u662F\u6570\u7EC4\uFF0C\u91CD\u7F6E\u4E3A\u7A7A\u6570\u7EC4"),[];if(M)return P.map(N=>{if(N.id===M&&N.children){const F=N.children.map(R=>S.includes(R.id)?{...R,removing:!0}:R);return{...N,children:F}}return N});const O=P.map(N=>S.includes(N.id)?{...N,removing:!0}:N);return console.log("[useAppFunctions] removeItems \u8BBE\u7F6Eremoving",S,O),O})},[e]),d=Xe(S=>{e(M=>{const P=M.find(O=>O.id===S);return P?P.hasOwnProperty("children")?(console.error(`[addSubTable] \u884C ${S} \u5DF2\u7ECF\u6709\u5B50table\u529F\u80FD\uFF0C\u65E0\u9700\u91CD\u590D\u6DFB\u52A0`),M):M.map(O=>O.id===S?{...O,children:[]}:O):(console.error(`[addSubTable] \u672A\u627E\u5230ID\u4E3A ${S} \u7684\u884C`),M)})},[e]),m=Xe(S=>{e(M=>{const P=M.find(N=>N.id===S);if(!P)return console.error(`[deleteSubTable] \u672A\u627E\u5230ID\u4E3A ${S} \u7684\u884C`),M;if(!P.hasOwnProperty("children"))return console.error(`[deleteSubTable] \u884C ${S} \u6CA1\u6709\u5B50table\u529F\u80FD`),M;const O=(P.children||[]).filter(N=>!N.removing).length;return O>0?(console.error(`[deleteSubTable] \u884C ${S} \u7684\u5B50table\u8FD8\u6709 ${O} \u6761\u6570\u636E\uFF0C\u65E0\u6CD5\u5220\u9664\u5B50table\u529F\u80FD\u3002\u8BF7\u5148\u5220\u9664\u6240\u6709\u5B50table\u6570\u636E\u3002`),M):M.map(N=>{if(N.id===S&&N.hasOwnProperty("children")){const{children:F,...R}=N;return R}return N})})},[e]),g=Xe((S,M,P)=>{M&&e(O=>O.map(N=>P&&N.id===P&&N.children?{...N,children:N.children.map(F=>F.id===M&&typeof F=="object"?v(F,S):F)}:N.id===M&&typeof N=="object"?v(N,S):N))},[e]),v=Xe((S,M)=>{if(Array.isArray(M)){const P=[...S.data];return M.forEach(O=>{const N=P.findIndex(F=>F.columnId===O.columnId);N>=0?P[N]={...P[N],value:O.value}:P.push(O)}),{...S,data:P}}else if(typeof M=="object")return{...S,...M};return S},[]),f=Xe(S=>{if(!S)return;const M=document.querySelector(`[data-item-id="${S}"]`);M&&M.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})},[]),h=Xe((S,M)=>{e(M?P=>P.map(O=>{if(O.id!==M)return O;if(!O.hasOwnProperty("children"))return console.warn(`[useAppFunctions] \u884C ${M} \u6CA1\u6709children\u5B57\u6BB5\uFF0C\u8DF3\u8FC7\u66F4\u65B0`),O;const N=O.children||[],F=N.findIndex(R=>R.id===S.id);if(F>=0){const R=[...N];return R[F]=S,{...O,children:R}}else return{...O,children:[...N,S]}}):Array.isArray(S)?S:[])},[e]);Xe(S=>{e(M=>Array.isArray(M)?Array.isArray(S)?[...M,...S]:M:Array.isArray(S)?S:[])},[e]);const y=Xe(S=>{t(S)},[t]),x=Xe(S=>{e(M=>M.map(P=>P.id===S?{...P,tableLoading:!0}:P))},[e]),b=Xe(S=>{e(M=>M.map(P=>P.id===S?{...P,tableLoading:!1}:P))},[e]),E=Xe(S=>{n(S)},[n]),w=Xe(S=>i.has(S),[i]),k=Xe(S=>{r(S)},[r]),A=Xe(S=>{o(S)},[o]),C=Xe(S=>a.has(S),[a]);return{addItem:s,removeItem:l,removeItems:u,updateItem:g,scrollToItem:f,syncSourceData:h,addPending:y,removePending:E,isPending:w,addAdding:k,removeAdding:A,isAdding:C,tablePending:x,removeTablePending:b,addSubTable:d,deleteSubTable:m,removeSubTableRow:c}};/**
1
+ import{jsxs as Ee,jsx as B,Fragment as _l}from"react/jsx-runtime";import*as p from"react";import X,{forwardRef as sr,createElement as Ya,version as dm,useMemo as _t,useState as vt,useRef as Pe,useCallback as Xe,useEffect as wt,useImperativeHandle as Ki,createContext as Li,useContext as An,Children as fm,useLayoutEffect as pm,isValidElement as mm}from"react";import{l as gm,b as hm,a as vm,J as ym,i as bm}from"./index-B2yNvzjy.js";import{d as Ht,c as xm,h as Cm,i as Js}from"./index-g-SUxfJH.js";import"./style-CGmZ5osp.js";import*as wm from"react-dom";import $s,{flushSync as Xa,createPortal as dd,unstable_batchedUpdates as km}from"react-dom";var Gr=(e=>(e.FLAT="files",e.NAV="nav",e))(Gr||{});const Em=()=>B("div",{className:"main relative h-full w-full flex items-center justify-center",children:B("div",{className:"text-2xl font-bold",children:"\u5E94\u7528\u52A0\u8F7D\u4E2D..."})}),Sm=()=>B("div",{className:"main relative h-full w-full flex items-center justify-center",children:B("div",{className:"text-2xl font-bold",children:"\u5E94\u7528\u9519\u8BEF"})}),Am=()=>B("div",{className:"main relative h-full w-full flex items-center justify-center",children:B("div",{className:"text-lg font-medium",children:"\u5BB9\u5668\u52A0\u8F7D\u4E2D..."})}),Om=()=>B("div",{className:"main relative h-full w-full flex items-center justify-center",children:B("div",{className:"text-lg font-medium",children:"\u5BB9\u5668\u9519\u8BEF"})}),Im=()=>B("div",{className:"main relative h-full w-full flex items-center justify-center",children:B("div",{className:"text-base font-medium",children:"\u5185\u5BB9\u52A0\u8F7D\u4E2D..."})}),Nm=()=>B("div",{className:"main relative h-full w-full flex items-center justify-center",children:B("div",{className:"text-base font-medium",children:"\u5185\u5BB9\u9519\u8BEF"})}),Mm=({viewType:e,cardType:t})=>Ee("div",{className:"main relative h-full w-full flex flex-col items-center justify-center",children:[B("div",{className:"text-6xl mb-4",style:{color:"#d1d5db"},children:"\u{1F4ED}"}),B("div",{className:"text-lg font-medium mb-2",style:{color:"#6b7280"},children:e==="card"?"\u6682\u65E0\u6570\u636E":e==="table"?"\u6682\u65E0\u8868\u683C\u6570\u636E":"\u6682\u65E0\u6570\u636E"}),B("div",{className:"text-sm",style:{color:"#9ca3af"},children:e==="card"?"\u70B9\u51FB\u4E0A\u65B9\u6309\u94AE\u6DFB\u52A0\u6570\u636E":e==="table"?"\u8BF7\u5148\u6DFB\u52A0\u6570\u636E\u5230\u8868\u683C\u4E2D":"\u8BF7\u5148\u6DFB\u52A0\u6570\u636E"})]}),xn=(e,t)=>{console.log("[findNodeById] Searching for id:",t,"in nodes:",e);for(const n of e){if(console.log("[findNodeById] Checking node:",n),n.id===t)return console.log("[findNodeById] Found node:",n),n;if(n.children){const r=Array.isArray(n.children)?n.children:Object.values(n.children);console.log("[findNodeById] Searching in children:",r);const o=xn(r,t);if(o)return console.log("[findNodeById] Found in children:",o),o}}return console.log("[findNodeById] Node not found for id:",t),null},Za=e=>{for(const t of e){if(t.type)return t.id;if(t.children){const n=Array.isArray(t.children)?t.children:Object.values(t.children),r=Za(n);if(r)return r}}},Pm=e=>{const t=n=>{let r=[];return n.children&&(r=Array.isArray(n.children)?n.children:Object.values(n.children)),{title:n.label,key:n.id,children:r.length>0?r.map(t):void 0,selectable:!0}};return e.map(t)},Fm=(e,t)=>Array.isArray(e)?t==="table"?e.filter(n=>n&&n.data&&Array.isArray(n.data)):e:e&&typeof e=="object"?[e]:[],Rm=e=>{const t=new Set;return e.forEach(n=>{n.adding&&t.add(n.id)}),t},Bm=(e,t)=>{const[n,r]=vt(()=>{const g=Array.isArray(e)?e:[];return console.log("[useAppState] \u521D\u59CB\u5316innerData:",g),g}),[o,i]=vt(new Set),[a,s]=vt(new Set),[l,c]=vt(""),[u,d]=vt([]);wt(()=>{if(console.log("[useAppState] \u6570\u636E\u6E90\u53D8\u5316:",{dataSource:e,activeNodeType:t}),t==="form"){const f=Array.isArray(e)?e:[];r(f);return}const g=Fm(e,t);console.log("[useAppState] \u9A8C\u8BC1\u540E\u7684\u6570\u636E:",g),r(g);const v=Rm(g);s(v),d([])},[e,t]);const m=Xe(()=>{d([]),c(""),i(new Set)},[]);return{innerData:n,setInnerData:r,pendingIds:o,setPendingIds:i,addingIds:a,setAddingIds:s,fuzzyValue:l,setFuzzyValue:c,selectedIds:u,setSelectedIds:d,resetStateOnNodeChange:m}},jm=(e,t,n,r,o,i,a)=>{const s=Xe((S,M)=>{const{tableId:P,...O}=M||{};M!=null&&M.animate?(r(S.id),e(N=>{if(P)return N.map(R=>{if(R.id===P){const T=[...R.children||[],{...S,adding:!0}];return{...R,children:T}}return R});const F={...S,adding:!0};if((O==null?void 0:O.position)==="start"||(O==null?void 0:O.position)===void 0)return[F,...N];if(typeof(O==null?void 0:O.position)=="number"){const R=[...N];return R.splice(O.position,0,F),R}return[F,...N]})):e(N=>{if(P)return N.map(F=>{if(F.id===P){const R=[...F.children||[],S];return{...F,children:R}}return F});if((O==null?void 0:O.position)==="start")return[S,...N];if(typeof(O==null?void 0:O.position)=="number"){const F=[...N];return F.splice(O.position,0,S),F}return[...N,S]})},[e,r]),l=Xe((S,M)=>{S&&e(P=>{if(!Array.isArray(P))return console.warn("[useAppFunctions] removeItem: prev\u4E0D\u662F\u6570\u7EC4\uFF0C\u91CD\u7F6E\u4E3A\u7A7A\u6570\u7EC4"),[];if(M)return P.map(N=>{if(N.id===M&&N.children){const F=N.children.map(R=>R.id===S?{...R,removing:!0}:R);return{...N,children:F}}return N});const O=P.map(N=>N.id===S?{...N,removing:!0}:N);return console.log("[useAppFunctions] removeItem \u8BBE\u7F6Eremoving",S,O),O})},[e]),c=Xe((S,M)=>{e(P=>Array.isArray(P)?P.map(O=>{if(O.id===M&&O.children){const N=O.children.filter(F=>F.id!==S);if(N.length===0){const{children:F,...R}=O;return R}return{...O,children:N}}return O}):[])},[e]),u=Xe((S,M)=>{!S||S.length===0||e(P=>{if(!Array.isArray(P))return console.warn("[useAppFunctions] removeItems: prev\u4E0D\u662F\u6570\u7EC4\uFF0C\u91CD\u7F6E\u4E3A\u7A7A\u6570\u7EC4"),[];if(M)return P.map(N=>{if(N.id===M&&N.children){const F=N.children.map(R=>S.includes(R.id)?{...R,removing:!0}:R);return{...N,children:F}}return N});const O=P.map(N=>S.includes(N.id)?{...N,removing:!0}:N);return console.log("[useAppFunctions] removeItems \u8BBE\u7F6Eremoving",S,O),O})},[e]),d=Xe(S=>{e(M=>{const P=M.find(O=>O.id===S);return P?P.hasOwnProperty("children")?(console.error(`[addSubTable] \u884C ${S} \u5DF2\u7ECF\u6709\u5B50table\u529F\u80FD\uFF0C\u65E0\u9700\u91CD\u590D\u6DFB\u52A0`),M):M.map(O=>O.id===S?{...O,children:[]}:O):(console.error(`[addSubTable] \u672A\u627E\u5230ID\u4E3A ${S} \u7684\u884C`),M)})},[e]),m=Xe(S=>{e(M=>{const P=M.find(N=>N.id===S);if(!P)return console.error(`[deleteSubTable] \u672A\u627E\u5230ID\u4E3A ${S} \u7684\u884C`),M;if(!P.hasOwnProperty("children"))return console.error(`[deleteSubTable] \u884C ${S} \u6CA1\u6709\u5B50table\u529F\u80FD`),M;const O=(P.children||[]).filter(N=>!N.removing).length;return O>0?(console.error(`[deleteSubTable] \u884C ${S} \u7684\u5B50table\u8FD8\u6709 ${O} \u6761\u6570\u636E\uFF0C\u65E0\u6CD5\u5220\u9664\u5B50table\u529F\u80FD\u3002\u8BF7\u5148\u5220\u9664\u6240\u6709\u5B50table\u6570\u636E\u3002`),M):M.map(N=>{if(N.id===S&&N.hasOwnProperty("children")){const{children:F,...R}=N;return R}return N})})},[e]),g=Xe((S,M,P)=>{M&&e(O=>O.map(N=>P&&N.id===P&&N.children?{...N,children:N.children.map(F=>F.id===M&&typeof F=="object"?v(F,S):F)}:N.id===M&&typeof N=="object"?v(N,S):N))},[e]),v=Xe((S,M)=>{if(Array.isArray(M)){const P=[...S.data];return M.forEach(O=>{const N=P.findIndex(F=>F.columnId===O.columnId);N>=0?P[N]={...P[N],value:O.value}:P.push(O)}),{...S,data:P}}else if(typeof M=="object")return{...S,...M};return S},[]),f=Xe(S=>{if(!S)return;const M=document.querySelector(`[data-item-id="${S}"]`);M&&M.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})},[]),h=Xe((S,M)=>{e(M?P=>P.map(O=>{if(O.id!==M)return O;if(!O.hasOwnProperty("children"))return console.warn(`[useAppFunctions] \u884C ${M} \u6CA1\u6709children\u5B57\u6BB5\uFF0C\u8DF3\u8FC7\u66F4\u65B0`),O;const N=O.children||[],F=N.findIndex(R=>R.id===S.id);if(F>=0){const R=[...N];return R[F]=S,{...O,children:R}}else return{...O,children:[...N,S]}}):Array.isArray(S)?S:[])},[e]);Xe(S=>{e(M=>Array.isArray(M)?Array.isArray(S)?[...M,...S]:M:Array.isArray(S)?S:[])},[e]);const y=Xe(S=>{t(S)},[t]),x=Xe(S=>{e(M=>M.map(P=>P.id===S?{...P,tableLoading:!0}:P))},[e]),b=Xe(S=>{e(M=>M.map(P=>P.id===S?{...P,tableLoading:!1}:P))},[e]),E=Xe(S=>{n(S)},[n]),w=Xe(S=>i.has(S),[i]),k=Xe(S=>{r(S)},[r]),A=Xe(S=>{o(S)},[o]),C=Xe(S=>a.has(S),[a]);return{addItem:s,removeItem:l,removeItems:u,updateItem:g,scrollToItem:f,syncSourceData:h,addPending:y,removePending:E,isPending:w,addAdding:k,removeAdding:A,isAdding:C,tablePending:x,removeTablePending:b,addSubTable:d,deleteSubTable:m,removeSubTableRow:c}};/**
2
2
  * @license lucide-react v0.456.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -277,4 +277,4 @@ html body {
277
277
  `,$P=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],ol={},Rr;function EP(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&ol[r])return ol[r];var n=window.getComputedStyle(e),o=n.getPropertyValue("box-sizing")||n.getPropertyValue("-moz-box-sizing")||n.getPropertyValue("-webkit-box-sizing"),a=parseFloat(n.getPropertyValue("padding-bottom"))+parseFloat(n.getPropertyValue("padding-top")),i=parseFloat(n.getPropertyValue("border-bottom-width"))+parseFloat(n.getPropertyValue("border-top-width")),s=$P.map(function(c){return"".concat(c,":").concat(n.getPropertyValue(c))}).join(";"),l={sizingStyle:s,paddingSize:a,borderSize:i,boxSizing:o};return t&&r&&(ol[r]=l),l}function OP(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;Rr||(Rr=document.createElement("textarea"),Rr.setAttribute("tab-index","-1"),Rr.setAttribute("aria-hidden","true"),Rr.setAttribute("name","hiddenTextarea"),document.body.appendChild(Rr)),e.getAttribute("wrap")?Rr.setAttribute("wrap",e.getAttribute("wrap")):Rr.removeAttribute("wrap");var o=EP(e,t),a=o.paddingSize,i=o.borderSize,s=o.boxSizing,l=o.sizingStyle;Rr.setAttribute("style","".concat(l,";").concat(xP)),Rr.value=e.value||e.placeholder||"";var c=void 0,u=void 0,f,g=Rr.scrollHeight;if(s==="border-box"?g+=i:s==="content-box"&&(g-=a),r!==null||n!==null){Rr.value=" ";var h=Rr.scrollHeight-a;r!==null&&(c=h*r,s==="border-box"&&(c=c+a+i),g=Math.max(c,g)),n!==null&&(u=h*n,s==="border-box"&&(u=u+a+i),f=g>u?"":"hidden",g=Math.min(u,g))}var v={height:g,overflowY:f,resize:"none"};return c&&(v.minHeight=c),u&&(v.maxHeight=u),v}var RP=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],al=0,il=1,sl=2,IP=d.forwardRef(function(e,t){var r=e,n=r.prefixCls,o=r.defaultValue,a=r.value,i=r.autoSize,s=r.onResize,l=r.className,c=r.style,u=r.disabled,f=r.onChange;r.onInternalAutoSize;var g=ft(r,RP),h=zr(o,{value:a,postState:function(q){return q??""}}),v=X(h,2),p=v[0],m=v[1],b=function(q){m(q.target.value),f==null||f(q)},y=d.useRef();d.useImperativeHandle(t,function(){return{textArea:y.current}});var S=d.useMemo(function(){return i&&Ue(i)==="object"?[i.minRows,i.maxRows]:[]},[i]),C=X(S,2),x=C[0],$=C[1],w=!!i,E=d.useState(sl),O=X(E,2),R=O[0],I=O[1],P=d.useState(),M=X(P,2),_=M[0],F=M[1],A=function(){I(al)};Ct(function(){w&&A()},[a,x,$,w]),Ct(function(){if(R===al)I(il);else if(R===il){var L=OP(y.current,!1,x,$);I(sl),F(L)}},[R]);var N=d.useRef(),D=function(){mt.cancel(N.current)},W=function(q){R===sl&&(s==null||s(q),i&&(D(),N.current=mt(function(){A()})))};d.useEffect(function(){return D},[]);var G=w?_:null,z=j(j({},c),G);return(R===al||R===il)&&(z.overflowY="hidden",z.overflowX="hidden"),d.createElement(Rn,{onResize:W,disabled:!(i||s)},d.createElement("textarea",Ge({},g,{ref:y,style:z,className:ne(n,l,T({},"".concat(n,"-disabled"),u)),disabled:u,value:p,onChange:b})))}),PP=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],MP=ae.forwardRef(function(e,t){var r,n=e.defaultValue,o=e.value,a=e.onFocus,i=e.onBlur,s=e.onChange,l=e.allowClear,c=e.maxLength,u=e.onCompositionStart,f=e.onCompositionEnd,g=e.suffix,h=e.prefixCls,v=h===void 0?"rc-textarea":h,p=e.showCount,m=e.count,b=e.className,y=e.style,S=e.disabled,C=e.hidden,x=e.classNames,$=e.styles,w=e.onResize,E=e.onClear,O=e.onPressEnter,R=e.readOnly,I=e.autoSize,P=e.onKeyDown,M=ft(e,PP),_=zr(n,{value:o,defaultValue:n}),F=X(_,2),A=F[0],N=F[1],D=A==null?"":String(A),W=ae.useState(!1),G=X(W,2),z=G[0],L=G[1],q=ae.useRef(!1),V=ae.useState(null),B=X(V,2),H=B[0],Z=B[1],k=He(null),J=He(null),oe=function(){var Ce;return(Ce=J.current)===null||Ce===void 0?void 0:Ce.textArea},K=function(){oe().focus()};Di(t,function(){var Oe;return{resizableTextArea:J.current,focus:K,blur:function(){oe().blur()},nativeElement:((Oe=k.current)===null||Oe===void 0?void 0:Oe.nativeElement)||oe()}}),dr(function(){L(function(Oe){return!S&&Oe})},[S]);var U=ae.useState(null),te=X(U,2),ie=te[0],Q=te[1];ae.useEffect(function(){if(ie){var Oe;(Oe=oe()).setSelectionRange.apply(Oe,ve(ie))}},[ie]);var re=tp(m,p),de=(r=re.max)!==null&&r!==void 0?r:c,se=Number(de)>0,ue=re.strategy(D),we=!!de&&ue>de,be=function(Ce,ze){var Ze=ze;!q.current&&re.exceedFormatter&&re.max&&re.strategy(ze)>re.max&&(Ze=re.exceedFormatter(ze,{max:re.max}),ze!==Ze&&Q([oe().selectionStart||0,oe().selectionEnd||0])),N(Ze),Ai(Ce.currentTarget,Ce,s,Ze)},Se=function(Ce){q.current=!0,u==null||u(Ce)},me=function(Ce){q.current=!1,be(Ce,Ce.currentTarget.value),f==null||f(Ce)},ee=function(Ce){be(Ce,Ce.target.value)},xe=function(Ce){Ce.key==="Enter"&&O&&O(Ce),P==null||P(Ce)},Le=function(Ce){L(!0),a==null||a(Ce)},Fe=function(Ce){L(!1),i==null||i(Ce)},Me=function(Ce){N(""),K(),Ai(oe(),Ce,s)},Ee=g,Be;re.show&&(re.showFormatter?Be=re.showFormatter({value:D,count:ue,maxLength:de}):Be="".concat(ue).concat(se?" / ".concat(de):""),Ee=ae.createElement(ae.Fragment,null,Ee,ae.createElement("span",{className:ne("".concat(v,"-data-count"),x==null?void 0:x.count),style:$==null?void 0:$.count},Be)));var Te=function(Ce){var ze;w==null||w(Ce),(ze=oe())!==null&&ze!==void 0&&ze.style.height&&Z(!0)},je=!I&&!p&&!l;return ae.createElement(hu,{ref:k,value:D,allowClear:l,handleReset:Me,suffix:Ee,prefixCls:v,classNames:j(j({},x),{},{affixWrapper:ne(x==null?void 0:x.affixWrapper,T(T({},"".concat(v,"-show-count"),p),"".concat(v,"-textarea-allow-clear"),l))}),disabled:S,focused:z,className:ne(b,we&&"".concat(v,"-out-of-range")),style:j(j({},y),H&&!je?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof Be=="string"?Be:void 0}},hidden:C,readOnly:R,onClear:E},ae.createElement(IP,Ge({},M,{autoSize:I,maxLength:c,onKeyDown:xe,onChange:ee,onFocus:Le,onBlur:Fe,onCompositionStart:Se,onCompositionEnd:me,className:ne(x==null?void 0:x.textarea),style:j(j({},$==null?void 0:$.textarea),{},{resize:y==null?void 0:y.resize}),disabled:S,prefixCls:v,onResize:Te,ref:J,readOnly:R})))});const TP=e=>{const{componentCls:t,paddingLG:r}=e,n=`${t}-textarea`;return{[`textarea${t}`]:{maxWidth:"100%",height:"auto",minHeight:e.controlHeight,lineHeight:e.lineHeight,verticalAlign:"bottom",transition:`all ${e.motionDurationSlow}`,resize:"vertical",[`&${t}-mouse-active`]:{transition:`all ${e.motionDurationSlow}, height 0s, width 0s`}},[`${t}-textarea-affix-wrapper-resize-dirty`]:{width:"auto"},[n]:{position:"relative","&-show-count":{[`${t}-data-count`]:{position:"absolute",bottom:e.calc(e.fontSize).mul(e.lineHeight).mul(-1).equal(),insetInlineEnd:0,color:e.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},[`
278
278
  &-allow-clear > ${t},
279
279
  &-affix-wrapper${n}-has-feedback ${t}
280
- `]:{paddingInlineEnd:r},[`&-affix-wrapper${t}-affix-wrapper`]:{padding:0,[`> textarea${t}`]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent",minHeight:e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(),"&:focus":{boxShadow:"none !important"}},[`${t}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${t}-clear-icon`]:{position:"absolute",insetInlineEnd:e.paddingInline,insetBlockStart:e.paddingXS},[`${n}-suffix`]:{position:"absolute",top:0,insetInlineEnd:e.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}},[`&-affix-wrapper${t}-affix-wrapper-rtl`]:{[`${t}-suffix`]:{[`${t}-data-count`]:{direction:"ltr",insetInlineStart:0}}},[`&-affix-wrapper${t}-affix-wrapper-sm`]:{[`${t}-suffix`]:{[`${t}-clear-icon`]:{insetInlineEnd:e.paddingInlineSM}}}}}},NP=vr(["Input","TextArea"],e=>{const t=Ot(e,_a(e));return TP(t)},Aa,{resetFont:!1});var FP=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const _P=un((e,t)=>{var r;const{prefixCls:n,bordered:o=!0,size:a,disabled:i,status:s,allowClear:l,classNames:c,rootClassName:u,className:f,style:g,styles:h,variant:v,showCount:p,onMouseDown:m,onResize:b}=e,y=FP(e,["prefixCls","bordered","size","disabled","status","allowClear","classNames","rootClassName","className","style","styles","variant","showCount","onMouseDown","onResize"]),{getPrefixCls:S,direction:C,allowClear:x,autoComplete:$,className:w,style:E,classNames:O,styles:R}=In("textArea"),I=d.useContext(Mr),P=i??I,{status:M,hasFeedback:_,feedbackIcon:F}=d.useContext(pr),A=Na(M,s),N=d.useRef(null);d.useImperativeHandle(t,()=>{var re;return{resizableTextArea:(re=N.current)===null||re===void 0?void 0:re.resizableTextArea,focus:de=>{var se,ue;gu((ue=(se=N.current)===null||se===void 0?void 0:se.resizableTextArea)===null||ue===void 0?void 0:ue.textArea,de)},blur:()=>{var de;return(de=N.current)===null||de===void 0?void 0:de.blur()}}});const D=S("input",n),W=dn(D),[G,z,L]=Uh(D,u),[q]=NP(D,W),{compactSize:V,compactItemClassnames:B}=Bo(D,C),H=on(re=>{var de;return(de=a??V)!==null&&de!==void 0?de:re}),[Z,k]=fs("textArea",v,o),J=np(l??x),[oe,K]=d.useState(!1),[U,te]=d.useState(!1),ie=re=>{K(!0),m==null||m(re);const de=()=>{K(!1),document.removeEventListener("mouseup",de)};document.addEventListener("mouseup",de)},Q=re=>{var de,se;if(b==null||b(re),oe&&typeof getComputedStyle=="function"){const ue=(se=(de=N.current)===null||de===void 0?void 0:de.nativeElement)===null||se===void 0?void 0:se.querySelector("textarea");ue&&getComputedStyle(ue).resize==="both"&&te(!0)}};return G(q(d.createElement(MP,Object.assign({autoComplete:$},y,{style:Object.assign(Object.assign({},E),g),styles:Object.assign(Object.assign({},R),h),disabled:P,allowClear:J,className:ne(L,W,f,u,B,w,U&&`${D}-textarea-affix-wrapper-resize-dirty`),classNames:Object.assign(Object.assign(Object.assign({},c),O),{textarea:ne({[`${D}-sm`]:H==="small",[`${D}-lg`]:H==="large"},z,c==null?void 0:c.textarea,O.textarea,oe&&`${D}-mouse-active`),variant:ne({[`${D}-${Z}`]:k},To(D,A)),affixWrapper:ne(`${D}-textarea-affix-wrapper`,{[`${D}-affix-wrapper-rtl`]:C==="rtl",[`${D}-affix-wrapper-sm`]:H==="small",[`${D}-affix-wrapper-lg`]:H==="large",[`${D}-textarea-show-count`]:p||((r=e.count)===null||r===void 0?void 0:r.show)},z)}),prefixCls:D,suffix:_&&d.createElement("span",{className:`${D}-textarea-suffix`},F),showCount:p,ref:N,onResize:Q,onMouseDown:ie}))))}),ja=gs;ja.Group=iP;ja.Search=wP;ja.TextArea=_P;ja.Password=SP;ja.OTP=mP;var AP=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],dp=d.forwardRef(function(e,t){var r,n=e.prefixCls,o=n===void 0?"rc-switch":n,a=e.className,i=e.checked,s=e.defaultChecked,l=e.disabled,c=e.loadingIcon,u=e.checkedChildren,f=e.unCheckedChildren,g=e.onClick,h=e.onChange,v=e.onKeyDown,p=ft(e,AP),m=zr(!1,{value:i,defaultValue:s}),b=X(m,2),y=b[0],S=b[1];function C(E,O){var R=y;return l||(R=E,S(R),h==null||h(R,O)),R}function x(E){E.which===De.LEFT?C(!1,E):E.which===De.RIGHT&&C(!0,E),v==null||v(E)}function $(E){var O=C(!y,E);g==null||g(O,E)}var w=ne(o,a,(r={},T(r,"".concat(o,"-checked"),y),T(r,"".concat(o,"-disabled"),l),r));return d.createElement("button",Ge({},p,{type:"button",role:"switch","aria-checked":y,disabled:l,className:w,ref:t,onKeyDown:x,onClick:$}),c,d.createElement("span",{className:"".concat(o,"-inner")},d.createElement("span",{className:"".concat(o,"-inner-checked")},u),d.createElement("span",{className:"".concat(o,"-inner-unchecked")},f)))});dp.displayName="Switch";const jP=e=>{const{componentCls:t,trackHeightSM:r,trackPadding:n,trackMinWidthSM:o,innerMinMarginSM:a,innerMaxMarginSM:i,handleSizeSM:s,calc:l}=e,c=`${t}-inner`,u=fe(l(s).add(l(n).mul(2)).equal()),f=fe(l(i).mul(2).equal());return{[t]:{[`&${t}-small`]:{minWidth:o,height:r,lineHeight:fe(r),[`${t}-inner`]:{paddingInlineStart:i,paddingInlineEnd:a,[`${c}-checked, ${c}-unchecked`]:{minHeight:r},[`${c}-checked`]:{marginInlineStart:`calc(-100% + ${u} - ${f})`,marginInlineEnd:`calc(100% - ${u} + ${f})`},[`${c}-unchecked`]:{marginTop:l(r).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},[`${t}-handle`]:{width:s,height:s},[`${t}-loading-icon`]:{top:l(l(s).sub(e.switchLoadingIconSize)).div(2).equal(),fontSize:e.switchLoadingIconSize},[`&${t}-checked`]:{[`${t}-inner`]:{paddingInlineStart:a,paddingInlineEnd:i,[`${c}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${c}-unchecked`]:{marginInlineStart:`calc(100% - ${u} + ${f})`,marginInlineEnd:`calc(-100% + ${u} - ${f})`}},[`${t}-handle`]:{insetInlineStart:`calc(100% - ${fe(l(s).add(n).equal())})`}},[`&:not(${t}-disabled):active`]:{[`&:not(${t}-checked) ${c}`]:{[`${c}-unchecked`]:{marginInlineStart:l(e.marginXXS).div(2).equal(),marginInlineEnd:l(e.marginXXS).mul(-1).div(2).equal()}},[`&${t}-checked ${c}`]:{[`${c}-checked`]:{marginInlineStart:l(e.marginXXS).mul(-1).div(2).equal(),marginInlineEnd:l(e.marginXXS).div(2).equal()}}}}}}},DP=e=>{const{componentCls:t,handleSize:r,calc:n}=e;return{[t]:{[`${t}-loading-icon${e.iconCls}`]:{position:"relative",top:n(n(r).sub(e.fontSize)).div(2).equal(),color:e.switchLoadingIconColor,verticalAlign:"top"},[`&${t}-checked ${t}-loading-icon`]:{color:e.switchColor}}}},LP=e=>{const{componentCls:t,trackPadding:r,handleBg:n,handleShadow:o,handleSize:a,calc:i}=e,s=`${t}-handle`;return{[t]:{[s]:{position:"absolute",top:r,insetInlineStart:r,width:a,height:a,transition:`all ${e.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:n,borderRadius:i(a).div(2).equal(),boxShadow:o,transition:`all ${e.switchDuration} ease-in-out`,content:'""'}},[`&${t}-checked ${s}`]:{insetInlineStart:`calc(100% - ${fe(i(a).add(r).equal())})`},[`&:not(${t}-disabled):active`]:{[`${s}::before`]:{insetInlineEnd:e.switchHandleActiveInset,insetInlineStart:0},[`&${t}-checked ${s}::before`]:{insetInlineEnd:0,insetInlineStart:e.switchHandleActiveInset}}}}},BP=e=>{const{componentCls:t,trackHeight:r,trackPadding:n,innerMinMargin:o,innerMaxMargin:a,handleSize:i,calc:s}=e,l=`${t}-inner`,c=fe(s(i).add(s(n).mul(2)).equal()),u=fe(s(a).mul(2).equal());return{[t]:{[l]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:a,paddingInlineEnd:o,transition:`padding-inline-start ${e.switchDuration} ease-in-out, padding-inline-end ${e.switchDuration} ease-in-out`,[`${l}-checked, ${l}-unchecked`]:{display:"block",color:e.colorTextLightSolid,fontSize:e.fontSizeSM,transition:`margin-inline-start ${e.switchDuration} ease-in-out, margin-inline-end ${e.switchDuration} ease-in-out`,pointerEvents:"none",minHeight:r},[`${l}-checked`]:{marginInlineStart:`calc(-100% + ${c} - ${u})`,marginInlineEnd:`calc(100% - ${c} + ${u})`},[`${l}-unchecked`]:{marginTop:s(r).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},[`&${t}-checked ${l}`]:{paddingInlineStart:o,paddingInlineEnd:a,[`${l}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${l}-unchecked`]:{marginInlineStart:`calc(100% - ${c} + ${u})`,marginInlineEnd:`calc(-100% + ${c} - ${u})`}},[`&:not(${t}-disabled):active`]:{[`&:not(${t}-checked) ${l}`]:{[`${l}-unchecked`]:{marginInlineStart:s(n).mul(2).equal(),marginInlineEnd:s(n).mul(-1).mul(2).equal()}},[`&${t}-checked ${l}`]:{[`${l}-checked`]:{marginInlineStart:s(n).mul(-1).mul(2).equal(),marginInlineEnd:s(n).mul(2).equal()}}}}}},zP=e=>{const{componentCls:t,trackHeight:r,trackMinWidth:n}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},fr(e)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:n,height:r,lineHeight:fe(r),verticalAlign:"middle",background:e.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${e.motionDurationMid}`,userSelect:"none",[`&:hover:not(${t}-disabled)`]:{background:e.colorTextTertiary}}),qc(e)),{[`&${t}-checked`]:{background:e.switchColor,[`&:hover:not(${t}-disabled)`]:{background:e.colorPrimaryHover}},[`&${t}-loading, &${t}-disabled`]:{cursor:"not-allowed",opacity:e.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${t}-rtl`]:{direction:"rtl"}})}},HP=e=>{const{fontSize:t,lineHeight:r,controlHeight:n,colorWhite:o}=e,a=t*r,i=n/2,s=2,l=a-s*2,c=i-s*2;return{trackHeight:a,trackHeightSM:i,trackMinWidth:l*2+s*4,trackMinWidthSM:c*2+s*2,trackPadding:s,handleBg:o,handleSize:l,handleSizeSM:c,handleShadow:`0 2px 4px 0 ${new bt("#00230b").setA(.2).toRgbString()}`,innerMinMargin:l/2,innerMaxMargin:l+s+s*2,innerMinMarginSM:c/2,innerMaxMarginSM:c+s+s*2}},VP=vr("Switch",e=>{const t=Ot(e,{switchDuration:e.motionDurationMid,switchColor:e.colorPrimary,switchDisabledOpacity:e.opacityLoading,switchLoadingIconSize:e.calc(e.fontSizeIcon).mul(.75).equal(),switchLoadingIconColor:`rgba(0, 0, 0, ${e.opacityLoading})`,switchHandleActiveInset:"-30%"});return[zP(t),BP(t),LP(t),DP(t),jP(t)]},HP);var WP=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const kP=d.forwardRef((e,t)=>{const{prefixCls:r,size:n,disabled:o,loading:a,className:i,rootClassName:s,style:l,checked:c,value:u,defaultChecked:f,defaultValue:g,onChange:h}=e,v=WP(e,["prefixCls","size","disabled","loading","className","rootClassName","style","checked","value","defaultChecked","defaultValue","onChange"]),[p,m]=zr(!1,{value:c??u,defaultValue:f??g}),{getPrefixCls:b,direction:y,switch:S}=d.useContext(wt),C=d.useContext(Mr),x=(o??C)||a,$=b("switch",r),w=d.createElement("div",{className:`${$}-handle`},a&&d.createElement(ts,{className:`${$}-loading-icon`})),[E,O,R]=VP($),I=on(n),P=ne(S==null?void 0:S.className,{[`${$}-small`]:I==="small",[`${$}-loading`]:a,[`${$}-rtl`]:y==="rtl"},i,s,O,R),M=Object.assign(Object.assign({},S==null?void 0:S.style),l),_=(...F)=>{m(F[0]),h==null||h.apply(void 0,F)};return E(d.createElement(Qc,{component:"Switch",disabled:x},d.createElement(dp,Object.assign({},v,{checked:p,onChange:_,prefixCls:$,className:P,style:M,disabled:x,ref:t,loadingIcon:w}))))}),qP=kP;qP.__ANT_SWITCH=!0;export{$x as $,Ge as A,tu as B,RM as C,KO as D,Io as E,Mn as F,nr as G,X as H,ja as I,j as J,$t as K,T as L,De as M,Ct as N,EM as O,kg as P,$M as Q,wI as R,Fa as S,du as T,qc as U,Hr as V,Pg as W,Mo as X,Rg as Y,Ng as Z,ve as _,ty as a,Qc as a$,zR as a0,Gn as a1,LR as a2,Rh as a3,Eh as a4,zr as a5,qP as a6,vM as a7,bM as a8,Qh as a9,Ro as aA,IM as aB,qg as aC,Gy as aD,xr as aE,Pn as aF,SM as aG,Jv as aH,sE as aI,WC as aJ,Yn as aK,xM as aL,$w as aM,$n as aN,cE as aO,K0 as aP,dh as aQ,mt as aR,Zo as aS,Xc as aT,Rn as aU,Wt as aV,Vt as aW,Ma as aX,pr as aY,Mr as aZ,tI as a_,TM as aa,XI as ab,br as ac,Ue as ad,_a as ae,ag as af,Aa as ag,ms as ah,Fh as ai,fu as aj,kh as ak,sg as al,Vr as am,Oa as an,eC as ao,S1 as ap,Lt as aq,OM as ar,dn as as,ts as at,K1 as au,Gc as av,H1 as aw,Wc as ax,Eg as ay,Jc as az,Ut as b,eI as b0,Yc as b1,kf as b2,eR as b3,JO as b4,bt as b5,_h as b6,Hh as b7,Lh as b8,jh as b9,$a as bA,Xn as bB,Xi as bC,Ri as bD,En as bE,On as bF,yM as bG,Qw as bH,Ra as bI,Xd as bJ,kR as bK,Dr as bL,Nc as bM,fv as bN,PM as bO,r$ as bP,gh as bQ,wh as bR,mI as bS,gs as bT,xh as bU,wM as bV,us as ba,tf as bb,ef as bc,jg as bd,Lg as be,Ag as bf,Dg as bg,Gl as bh,BR as bi,Vh as bj,wR as bk,Bo as bl,fs as bm,To as bn,Na as bo,hd as bp,uE as bq,MM as br,ew as bs,gM as bt,ia as bu,at as bv,Nh as bw,Fn as bx,mM as by,sw as bz,pM as c,Kb as d,jw as e,ne as f,vr as g,hM as h,Yb as i,GC as j,fe as k,wt as l,Ot as m,XR as n,Po as o,Do as p,Zh as q,fr as r,on as s,qn as t,In as u,Wd as v,FR as w,pa as x,ft as y,xa as z};
280
+ `]:{paddingInlineEnd:r},[`&-affix-wrapper${t}-affix-wrapper`]:{padding:0,[`> textarea${t}`]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent",minHeight:e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(),"&:focus":{boxShadow:"none !important"}},[`${t}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${t}-clear-icon`]:{position:"absolute",insetInlineEnd:e.paddingInline,insetBlockStart:e.paddingXS},[`${n}-suffix`]:{position:"absolute",top:0,insetInlineEnd:e.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}},[`&-affix-wrapper${t}-affix-wrapper-rtl`]:{[`${t}-suffix`]:{[`${t}-data-count`]:{direction:"ltr",insetInlineStart:0}}},[`&-affix-wrapper${t}-affix-wrapper-sm`]:{[`${t}-suffix`]:{[`${t}-clear-icon`]:{insetInlineEnd:e.paddingInlineSM}}}}}},NP=vr(["Input","TextArea"],e=>{const t=Ot(e,_a(e));return TP(t)},Aa,{resetFont:!1});var FP=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const _P=un((e,t)=>{var r;const{prefixCls:n,bordered:o=!0,size:a,disabled:i,status:s,allowClear:l,classNames:c,rootClassName:u,className:f,style:g,styles:h,variant:v,showCount:p,onMouseDown:m,onResize:b}=e,y=FP(e,["prefixCls","bordered","size","disabled","status","allowClear","classNames","rootClassName","className","style","styles","variant","showCount","onMouseDown","onResize"]),{getPrefixCls:S,direction:C,allowClear:x,autoComplete:$,className:w,style:E,classNames:O,styles:R}=In("textArea"),I=d.useContext(Mr),P=i??I,{status:M,hasFeedback:_,feedbackIcon:F}=d.useContext(pr),A=Na(M,s),N=d.useRef(null);d.useImperativeHandle(t,()=>{var re;return{resizableTextArea:(re=N.current)===null||re===void 0?void 0:re.resizableTextArea,focus:de=>{var se,ue;gu((ue=(se=N.current)===null||se===void 0?void 0:se.resizableTextArea)===null||ue===void 0?void 0:ue.textArea,de)},blur:()=>{var de;return(de=N.current)===null||de===void 0?void 0:de.blur()}}});const D=S("input",n),W=dn(D),[G,z,L]=Uh(D,u),[q]=NP(D,W),{compactSize:V,compactItemClassnames:B}=Bo(D,C),H=on(re=>{var de;return(de=a??V)!==null&&de!==void 0?de:re}),[Z,k]=fs("textArea",v,o),J=np(l??x),[oe,K]=d.useState(!1),[U,te]=d.useState(!1),ie=re=>{K(!0),m==null||m(re);const de=()=>{K(!1),document.removeEventListener("mouseup",de)};document.addEventListener("mouseup",de)},Q=re=>{var de,se;if(b==null||b(re),oe&&typeof getComputedStyle=="function"){const ue=(se=(de=N.current)===null||de===void 0?void 0:de.nativeElement)===null||se===void 0?void 0:se.querySelector("textarea");ue&&getComputedStyle(ue).resize==="both"&&te(!0)}};return G(q(d.createElement(MP,Object.assign({autoComplete:$},y,{style:Object.assign(Object.assign({},E),g),styles:Object.assign(Object.assign({},R),h),disabled:P,allowClear:J,className:ne(L,W,f,u,B,w,U&&`${D}-textarea-affix-wrapper-resize-dirty`),classNames:Object.assign(Object.assign(Object.assign({},c),O),{textarea:ne({[`${D}-sm`]:H==="small",[`${D}-lg`]:H==="large"},z,c==null?void 0:c.textarea,O.textarea,oe&&`${D}-mouse-active`),variant:ne({[`${D}-${Z}`]:k},To(D,A)),affixWrapper:ne(`${D}-textarea-affix-wrapper`,{[`${D}-affix-wrapper-rtl`]:C==="rtl",[`${D}-affix-wrapper-sm`]:H==="small",[`${D}-affix-wrapper-lg`]:H==="large",[`${D}-textarea-show-count`]:p||((r=e.count)===null||r===void 0?void 0:r.show)},z)}),prefixCls:D,suffix:_&&d.createElement("span",{className:`${D}-textarea-suffix`},F),showCount:p,ref:N,onResize:Q,onMouseDown:ie}))))}),ja=gs;ja.Group=iP;ja.Search=wP;ja.TextArea=_P;ja.Password=SP;ja.OTP=mP;var AP=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],dp=d.forwardRef(function(e,t){var r,n=e.prefixCls,o=n===void 0?"rc-switch":n,a=e.className,i=e.checked,s=e.defaultChecked,l=e.disabled,c=e.loadingIcon,u=e.checkedChildren,f=e.unCheckedChildren,g=e.onClick,h=e.onChange,v=e.onKeyDown,p=ft(e,AP),m=zr(!1,{value:i,defaultValue:s}),b=X(m,2),y=b[0],S=b[1];function C(E,O){var R=y;return l||(R=E,S(R),h==null||h(R,O)),R}function x(E){E.which===De.LEFT?C(!1,E):E.which===De.RIGHT&&C(!0,E),v==null||v(E)}function $(E){var O=C(!y,E);g==null||g(O,E)}var w=ne(o,a,(r={},T(r,"".concat(o,"-checked"),y),T(r,"".concat(o,"-disabled"),l),r));return d.createElement("button",Ge({},p,{type:"button",role:"switch","aria-checked":y,disabled:l,className:w,ref:t,onKeyDown:x,onClick:$}),c,d.createElement("span",{className:"".concat(o,"-inner")},d.createElement("span",{className:"".concat(o,"-inner-checked")},u),d.createElement("span",{className:"".concat(o,"-inner-unchecked")},f)))});dp.displayName="Switch";const jP=e=>{const{componentCls:t,trackHeightSM:r,trackPadding:n,trackMinWidthSM:o,innerMinMarginSM:a,innerMaxMarginSM:i,handleSizeSM:s,calc:l}=e,c=`${t}-inner`,u=fe(l(s).add(l(n).mul(2)).equal()),f=fe(l(i).mul(2).equal());return{[t]:{[`&${t}-small`]:{minWidth:o,height:r,lineHeight:fe(r),[`${t}-inner`]:{paddingInlineStart:i,paddingInlineEnd:a,[`${c}-checked, ${c}-unchecked`]:{minHeight:r},[`${c}-checked`]:{marginInlineStart:`calc(-100% + ${u} - ${f})`,marginInlineEnd:`calc(100% - ${u} + ${f})`},[`${c}-unchecked`]:{marginTop:l(r).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},[`${t}-handle`]:{width:s,height:s},[`${t}-loading-icon`]:{top:l(l(s).sub(e.switchLoadingIconSize)).div(2).equal(),fontSize:e.switchLoadingIconSize},[`&${t}-checked`]:{[`${t}-inner`]:{paddingInlineStart:a,paddingInlineEnd:i,[`${c}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${c}-unchecked`]:{marginInlineStart:`calc(100% - ${u} + ${f})`,marginInlineEnd:`calc(-100% + ${u} - ${f})`}},[`${t}-handle`]:{insetInlineStart:`calc(100% - ${fe(l(s).add(n).equal())})`}},[`&:not(${t}-disabled):active`]:{[`&:not(${t}-checked) ${c}`]:{[`${c}-unchecked`]:{marginInlineStart:l(e.marginXXS).div(2).equal(),marginInlineEnd:l(e.marginXXS).mul(-1).div(2).equal()}},[`&${t}-checked ${c}`]:{[`${c}-checked`]:{marginInlineStart:l(e.marginXXS).mul(-1).div(2).equal(),marginInlineEnd:l(e.marginXXS).div(2).equal()}}}}}}},DP=e=>{const{componentCls:t,handleSize:r,calc:n}=e;return{[t]:{[`${t}-loading-icon${e.iconCls}`]:{position:"relative",top:n(n(r).sub(e.fontSize)).div(2).equal(),color:e.switchLoadingIconColor,verticalAlign:"top"},[`&${t}-checked ${t}-loading-icon`]:{color:e.switchColor}}}},LP=e=>{const{componentCls:t,trackPadding:r,handleBg:n,handleShadow:o,handleSize:a,calc:i}=e,s=`${t}-handle`;return{[t]:{[s]:{position:"absolute",top:r,insetInlineStart:r,width:a,height:a,transition:`all ${e.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:n,borderRadius:i(a).div(2).equal(),boxShadow:o,transition:`all ${e.switchDuration} ease-in-out`,content:'""'}},[`&${t}-checked ${s}`]:{insetInlineStart:`calc(100% - ${fe(i(a).add(r).equal())})`},[`&:not(${t}-disabled):active`]:{[`${s}::before`]:{insetInlineEnd:e.switchHandleActiveInset,insetInlineStart:0},[`&${t}-checked ${s}::before`]:{insetInlineEnd:0,insetInlineStart:e.switchHandleActiveInset}}}}},BP=e=>{const{componentCls:t,trackHeight:r,trackPadding:n,innerMinMargin:o,innerMaxMargin:a,handleSize:i,calc:s}=e,l=`${t}-inner`,c=fe(s(i).add(s(n).mul(2)).equal()),u=fe(s(a).mul(2).equal());return{[t]:{[l]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:a,paddingInlineEnd:o,transition:`padding-inline-start ${e.switchDuration} ease-in-out, padding-inline-end ${e.switchDuration} ease-in-out`,[`${l}-checked, ${l}-unchecked`]:{display:"block",color:e.colorTextLightSolid,fontSize:e.fontSizeSM,transition:`margin-inline-start ${e.switchDuration} ease-in-out, margin-inline-end ${e.switchDuration} ease-in-out`,pointerEvents:"none",minHeight:r},[`${l}-checked`]:{marginInlineStart:`calc(-100% + ${c} - ${u})`,marginInlineEnd:`calc(100% - ${c} + ${u})`},[`${l}-unchecked`]:{marginTop:s(r).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},[`&${t}-checked ${l}`]:{paddingInlineStart:o,paddingInlineEnd:a,[`${l}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${l}-unchecked`]:{marginInlineStart:`calc(100% - ${c} + ${u})`,marginInlineEnd:`calc(-100% + ${c} - ${u})`}},[`&:not(${t}-disabled):active`]:{[`&:not(${t}-checked) ${l}`]:{[`${l}-unchecked`]:{marginInlineStart:s(n).mul(2).equal(),marginInlineEnd:s(n).mul(-1).mul(2).equal()}},[`&${t}-checked ${l}`]:{[`${l}-checked`]:{marginInlineStart:s(n).mul(-1).mul(2).equal(),marginInlineEnd:s(n).mul(2).equal()}}}}}},zP=e=>{const{componentCls:t,trackHeight:r,trackMinWidth:n}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},fr(e)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:n,height:r,lineHeight:fe(r),verticalAlign:"middle",background:e.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${e.motionDurationMid}`,userSelect:"none",[`&:hover:not(${t}-disabled)`]:{background:e.colorTextTertiary}}),qc(e)),{[`&${t}-checked`]:{background:e.switchColor,[`&:hover:not(${t}-disabled)`]:{background:e.colorPrimaryHover}},[`&${t}-loading, &${t}-disabled`]:{cursor:"not-allowed",opacity:e.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${t}-rtl`]:{direction:"rtl"}})}},HP=e=>{const{fontSize:t,lineHeight:r,controlHeight:n,colorWhite:o}=e,a=t*r,i=n/2,s=2,l=a-s*2,c=i-s*2;return{trackHeight:a,trackHeightSM:i,trackMinWidth:l*2+s*4,trackMinWidthSM:c*2+s*2,trackPadding:s,handleBg:o,handleSize:l,handleSizeSM:c,handleShadow:`0 2px 4px 0 ${new bt("#00230b").setA(.2).toRgbString()}`,innerMinMargin:l/2,innerMaxMargin:l+s+s*2,innerMinMarginSM:c/2,innerMaxMarginSM:c+s+s*2}},VP=vr("Switch",e=>{const t=Ot(e,{switchDuration:e.motionDurationMid,switchColor:e.colorPrimary,switchDisabledOpacity:e.opacityLoading,switchLoadingIconSize:e.calc(e.fontSizeIcon).mul(.75).equal(),switchLoadingIconColor:`rgba(0, 0, 0, ${e.opacityLoading})`,switchHandleActiveInset:"-30%"});return[zP(t),BP(t),LP(t),DP(t),jP(t)]},HP);var WP=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const kP=d.forwardRef((e,t)=>{const{prefixCls:r,size:n,disabled:o,loading:a,className:i,rootClassName:s,style:l,checked:c,value:u,defaultChecked:f,defaultValue:g,onChange:h}=e,v=WP(e,["prefixCls","size","disabled","loading","className","rootClassName","style","checked","value","defaultChecked","defaultValue","onChange"]),[p,m]=zr(!1,{value:c??u,defaultValue:f??g}),{getPrefixCls:b,direction:y,switch:S}=d.useContext(wt),C=d.useContext(Mr),x=(o??C)||a,$=b("switch",r),w=d.createElement("div",{className:`${$}-handle`},a&&d.createElement(ts,{className:`${$}-loading-icon`})),[E,O,R]=VP($),I=on(n),P=ne(S==null?void 0:S.className,{[`${$}-small`]:I==="small",[`${$}-loading`]:a,[`${$}-rtl`]:y==="rtl"},i,s,O,R),M=Object.assign(Object.assign({},S==null?void 0:S.style),l),_=(...F)=>{m(F[0]),h==null||h.apply(void 0,F)};return E(d.createElement(Qc,{component:"Switch",disabled:x},d.createElement(dp,Object.assign({},v,{checked:p,onChange:_,prefixCls:$,className:P,style:M,disabled:x,ref:t,loadingIcon:w}))))}),qP=kP;qP.__ANT_SWITCH=!0;export{$x as $,Ge as A,tu as B,RM as C,KO as D,Io as E,Mn as F,nr as G,X as H,ja as I,j as J,$t as K,T as L,De as M,Ct as N,EM as O,kg as P,$M as Q,wI as R,Fa as S,du as T,qc as U,Hr as V,Pg as W,Mo as X,Rg as Y,Ng as Z,ve as _,ty as a,Qc as a$,zR as a0,Gn as a1,LR as a2,Rh as a3,Eh as a4,zr as a5,qP as a6,vM as a7,bM as a8,Qh as a9,Ro as aA,IM as aB,qg as aC,Gy as aD,xr as aE,Pn as aF,SM as aG,Jv as aH,sE as aI,WC as aJ,Yn as aK,xM as aL,$w as aM,$n as aN,cE as aO,K0 as aP,dh as aQ,mt as aR,Zo as aS,Xc as aT,Rn as aU,Wt as aV,Vt as aW,Ma as aX,pr as aY,Mr as aZ,tI as a_,TM as aa,XI as ab,br as ac,Ue as ad,_a as ae,ag as af,Aa as ag,ms as ah,Fh as ai,fu as aj,kh as ak,sg as al,Vr as am,Oa as an,eC as ao,S1 as ap,Lt as aq,OM as ar,dn as as,ts as at,K1 as au,Gc as av,H1 as aw,Wc as ax,Eg as ay,Jc as az,Ut as b,mM as b$,eI as b0,Yc as b1,kf as b2,eR as b3,JO as b4,bt as b5,_h as b6,Hh as b7,Lh as b8,jh as b9,On as bA,yM as bB,Qw as bC,Ra as bD,Xd as bE,kR as bF,Dr as bG,Nc as bH,fv as bI,PM as bJ,r$ as bK,gh as bL,wh as bM,at as bN,mI as bO,gs as bP,xh as bQ,Fn as bR,wM as bS,As as bT,pR as bU,Qn as bV,mr as bW,Pi as bX,aP as bY,ia as bZ,Nh as b_,us as ba,tf as bb,ef as bc,jg as bd,Lg as be,Ag as bf,Dg as bg,Gl as bh,BR as bi,Vh as bj,wR as bk,Bo as bl,fs as bm,To as bn,Na as bo,hd as bp,uE as bq,MM as br,ew as bs,gM as bt,sw as bu,$a as bv,Xn as bw,Xi as bx,Ri as by,En as bz,pM as c,Kb as d,jw as e,ne as f,vr as g,hM as h,Yb as i,GC as j,fe as k,wt as l,Ot as m,XR as n,Po as o,Do as p,Zh as q,fr as r,on as s,qn as t,In as u,Wd as v,FR as w,pa as x,ft as y,xa as z};
@@ -1 +1 @@
1
- import*as n from"react";import U from"react";import{u as X,t as Y,e as Z,f as O,C as ee}from"./index-LDFwTu47.js";function $(e){return["small","middle","large"].includes(e)}function I(e){return e?typeof e=="number"&&!Number.isNaN(e):!1}const P=U.createContext({latestIndex:0}),te=P.Provider,se=({className:e,index:l,children:s,split:t,style:a})=>{const{latestIndex:o}=n.useContext(P);return s==null?null:n.createElement(n.Fragment,null,n.createElement("div",{className:e,style:a},s),l<o&&t&&n.createElement("span",{className:`${e}-split`},t))};var ae=function(e,l){var s={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&l.indexOf(t)<0&&(s[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,t=Object.getOwnPropertySymbols(e);a<t.length;a++)l.indexOf(t[a])<0&&Object.prototype.propertyIsEnumerable.call(e,t[a])&&(s[t[a]]=e[t[a]]);return s};const ne=n.forwardRef((e,l)=>{var s;const{getPrefixCls:t,direction:a,size:o,className:j,style:w,classNames:E,styles:V}=X("space"),{size:i=o??"small",align:C,className:h,rootClassName:_,children:A,direction:S="horizontal",prefixCls:k,split:G,style:R,wrap:H=!1,classNames:x,styles:g}=e,L=ae(e,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[m,u]=Array.isArray(i)?i:[i,i],v=$(u),N=$(m),F=I(u),M=I(m),p=Y(A,{keepEmpty:!0}),b=C===void 0&&S==="horizontal"?"center":C,r=t("space",k),[W,q,B]=Z(r),D=O(r,j,q,`${r}-${S}`,{[`${r}-rtl`]:a==="rtl",[`${r}-align-${b}`]:b,[`${r}-gap-row-${u}`]:v,[`${r}-gap-col-${m}`]:N},h,_,B),z=O(`${r}-item`,(s=x==null?void 0:x.item)!==null&&s!==void 0?s:E.item),J=Object.assign(Object.assign({},V.item),g==null?void 0:g.item),K=p.map((c,f)=>{const y=(c==null?void 0:c.key)||`${z}-${f}`;return n.createElement(se,{className:z,key:y,index:f,split:G,style:J},c)}),Q=n.useMemo(()=>({latestIndex:p.reduce((f,y,T)=>y!=null?T:f,0)}),[p]);if(p.length===0)return null;const d={};return H&&(d.flexWrap="wrap"),!N&&M&&(d.columnGap=m),!v&&F&&(d.rowGap=u),W(n.createElement("div",Object.assign({ref:l,className:D,style:Object.assign(Object.assign(Object.assign({},d),w),R)},L),n.createElement(te,{value:Q},K)))}),re=ne;re.Compact=ee;export{re as S};
1
+ import*as n from"react";import U from"react";import{u as X,t as Y,e as Z,f as O,C as ee}from"./index-g-SUxfJH.js";function $(e){return["small","middle","large"].includes(e)}function I(e){return e?typeof e=="number"&&!Number.isNaN(e):!1}const P=U.createContext({latestIndex:0}),te=P.Provider,se=({className:e,index:l,children:s,split:t,style:a})=>{const{latestIndex:o}=n.useContext(P);return s==null?null:n.createElement(n.Fragment,null,n.createElement("div",{className:e,style:a},s),l<o&&t&&n.createElement("span",{className:`${e}-split`},t))};var ae=function(e,l){var s={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&l.indexOf(t)<0&&(s[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,t=Object.getOwnPropertySymbols(e);a<t.length;a++)l.indexOf(t[a])<0&&Object.prototype.propertyIsEnumerable.call(e,t[a])&&(s[t[a]]=e[t[a]]);return s};const ne=n.forwardRef((e,l)=>{var s;const{getPrefixCls:t,direction:a,size:o,className:j,style:w,classNames:E,styles:V}=X("space"),{size:i=o??"small",align:C,className:h,rootClassName:_,children:A,direction:S="horizontal",prefixCls:k,split:G,style:R,wrap:H=!1,classNames:x,styles:g}=e,L=ae(e,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[m,u]=Array.isArray(i)?i:[i,i],v=$(u),N=$(m),F=I(u),M=I(m),p=Y(A,{keepEmpty:!0}),b=C===void 0&&S==="horizontal"?"center":C,r=t("space",k),[W,q,B]=Z(r),D=O(r,j,q,`${r}-${S}`,{[`${r}-rtl`]:a==="rtl",[`${r}-align-${b}`]:b,[`${r}-gap-row-${u}`]:v,[`${r}-gap-col-${m}`]:N},h,_,B),z=O(`${r}-item`,(s=x==null?void 0:x.item)!==null&&s!==void 0?s:E.item),J=Object.assign(Object.assign({},V.item),g==null?void 0:g.item),K=p.map((c,f)=>{const y=(c==null?void 0:c.key)||`${z}-${f}`;return n.createElement(se,{className:z,key:y,index:f,split:G,style:J},c)}),Q=n.useMemo(()=>({latestIndex:p.reduce((f,y,T)=>y!=null?T:f,0)}),[p]);if(p.length===0)return null;const d={};return H&&(d.flexWrap="wrap"),!N&&M&&(d.columnGap=m),!v&&F&&(d.rowGap=u),W(n.createElement("div",Object.assign({ref:l,className:D,style:Object.assign(Object.assign(Object.assign({},d),w),R)},L),n.createElement(te,{value:Q},K)))}),re=ne;re.Compact=ee;export{re as S};
@@ -1,4 +1,4 @@
1
- <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <rect width="20" height="20" rx="2.22222" fill="#00B2F9"/>
3
- <path d="M5.3125 13.9672V13.975C5.32812 14.6938 5.89922 15.2734 6.61875 15.2734H13.9062C14.3375 15.2734 14.6875 14.9289 14.6875 14.4977V5.50703C14.6875 5.40447 14.6673 5.30292 14.628 5.20818C14.5887 5.11344 14.5312 5.02736 14.4586 4.95488C14.3861 4.8824 14.2999 4.82492 14.2052 4.78575C14.1104 4.74657 14.0088 4.72646 13.9062 4.72656H6.875C6.01172 4.72656 5.3125 5.42031 5.3125 6.28359V13.9672ZM7.5 9.24531V6.25C7.5 6.07813 7.64062 5.9375 7.8125 5.9375H9.6875C9.86016 5.9375 10 6.07813 10 6.25V9.24531C10 9.30716 9.98175 9.36762 9.94741 9.41906C9.91308 9.47049 9.86425 9.51058 9.80712 9.53426C9.74999 9.55793 9.68712 9.56412 9.62647 9.55204C9.56581 9.53996 9.51011 9.51016 9.46641 9.46641L8.97109 8.97109C8.94207 8.94204 8.90761 8.91899 8.86967 8.90326C8.83173 8.88754 8.79107 8.87944 8.75 8.87944C8.70893 8.87944 8.66827 8.88754 8.63033 8.90326C8.59239 8.91899 8.55793 8.94204 8.52891 8.97109L8.03359 9.46641C7.98989 9.51016 7.93418 9.53996 7.87353 9.55204C7.81288 9.56412 7.75001 9.55793 7.69288 9.53426C7.63575 9.51058 7.58692 9.47049 7.55259 9.41906C7.51825 9.36762 7.49995 9.30716 7.5 9.24531ZM6.54375 14.2063C6.45208 14.1156 6.40625 14.0052 6.40625 13.875C6.40625 13.7458 6.45208 13.6354 6.54375 13.5438C6.6349 13.4521 6.74531 13.4062 6.875 13.4062H13.5938V14.3438H6.875C6.74531 14.3438 6.6349 14.2979 6.54375 14.2063Z" fill="white"/>
4
- </svg>
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="20" height="20" rx="2.22222" fill="#00B2F9"/>
3
+ <path d="M5.3125 13.9672V13.975C5.32812 14.6938 5.89922 15.2734 6.61875 15.2734H13.9062C14.3375 15.2734 14.6875 14.9289 14.6875 14.4977V5.50703C14.6875 5.40447 14.6673 5.30292 14.628 5.20818C14.5887 5.11344 14.5312 5.02736 14.4586 4.95488C14.3861 4.8824 14.2999 4.82492 14.2052 4.78575C14.1104 4.74657 14.0088 4.72646 13.9062 4.72656H6.875C6.01172 4.72656 5.3125 5.42031 5.3125 6.28359V13.9672ZM7.5 9.24531V6.25C7.5 6.07813 7.64062 5.9375 7.8125 5.9375H9.6875C9.86016 5.9375 10 6.07813 10 6.25V9.24531C10 9.30716 9.98175 9.36762 9.94741 9.41906C9.91308 9.47049 9.86425 9.51058 9.80712 9.53426C9.74999 9.55793 9.68712 9.56412 9.62647 9.55204C9.56581 9.53996 9.51011 9.51016 9.46641 9.46641L8.97109 8.97109C8.94207 8.94204 8.90761 8.91899 8.86967 8.90326C8.83173 8.88754 8.79107 8.87944 8.75 8.87944C8.70893 8.87944 8.66827 8.88754 8.63033 8.90326C8.59239 8.91899 8.55793 8.94204 8.52891 8.97109L8.03359 9.46641C7.98989 9.51016 7.93418 9.53996 7.87353 9.55204C7.81288 9.56412 7.75001 9.55793 7.69288 9.53426C7.63575 9.51058 7.58692 9.47049 7.55259 9.41906C7.51825 9.36762 7.49995 9.30716 7.5 9.24531ZM6.54375 14.2063C6.45208 14.1156 6.40625 14.0052 6.40625 13.875C6.40625 13.7458 6.45208 13.6354 6.54375 13.5438C6.6349 13.4521 6.74531 13.4062 6.875 13.4062H13.5938V14.3438H6.875C6.74531 14.3438 6.6349 14.2979 6.54375 14.2063Z" fill="white"/>
4
+ </svg>