bkui-vue 0.0.1-beta.39 → 0.0.1-beta.390

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 (718) hide show
  1. package/License.txt +14 -0
  2. package/dist/index.cjs.js +161 -36
  3. package/dist/index.esm.js +32306 -13036
  4. package/dist/index.umd.js +161 -36
  5. package/dist/style.css +1 -1
  6. package/dist/style.variable.css +1 -0
  7. package/lib/affix/affix.css +3 -0
  8. package/lib/affix/affix.d.ts +47 -0
  9. package/lib/affix/affix.less +5 -0
  10. package/lib/affix/affix.variable.css +123 -0
  11. package/lib/affix/index.d.ts +143 -0
  12. package/lib/affix/index.js +285 -0
  13. package/lib/alert/alert.css +81 -0
  14. package/lib/alert/alert.d.ts +62 -0
  15. package/lib/alert/alert.less +119 -0
  16. package/lib/alert/alert.variable.css +201 -0
  17. package/lib/alert/index.d.ts +180 -0
  18. package/lib/alert/index.js +183 -0
  19. package/lib/animate-number/animate-number.d.ts +27 -0
  20. package/lib/animate-number/index.d.ts +97 -0
  21. package/lib/animate-number/index.js +162 -0
  22. package/lib/backtop/backtop.css +50 -0
  23. package/lib/backtop/backtop.d.ts +60 -0
  24. package/lib/backtop/backtop.less +26 -0
  25. package/lib/backtop/backtop.variable.css +170 -0
  26. package/lib/backtop/index.d.ts +166 -0
  27. package/lib/backtop/index.js +188 -0
  28. package/lib/badge/badge.css +120 -0
  29. package/lib/badge/badge.d.ts +112 -0
  30. package/lib/badge/badge.less +135 -0
  31. package/lib/badge/badge.variable.css +240 -0
  32. package/lib/badge/index.d.ts +267 -0
  33. package/lib/badge/index.js +210 -0
  34. package/lib/breadcrumb/breadcrumb-item.d.ts +38 -0
  35. package/lib/breadcrumb/breadcrumb.css +119 -0
  36. package/lib/breadcrumb/breadcrumb.d.ts +54 -0
  37. package/lib/breadcrumb/breadcrumb.less +65 -0
  38. package/lib/breadcrumb/breadcrumb.variable.css +239 -0
  39. package/lib/breadcrumb/index.d.ts +196 -0
  40. package/lib/breadcrumb/index.js +263 -0
  41. package/lib/breadcrumb/props.d.ts +4 -0
  42. package/lib/button/button-group.d.ts +6 -0
  43. package/lib/button/button.css +300 -0
  44. package/lib/button/button.d.ts +163 -0
  45. package/lib/button/button.less +225 -0
  46. package/lib/button/button.variable.css +420 -0
  47. package/lib/button/index.d.ts +256 -0
  48. package/lib/button/index.js +292 -0
  49. package/lib/card/card.css +158 -0
  50. package/lib/card/card.d.ts +110 -0
  51. package/lib/card/card.less +92 -0
  52. package/lib/card/card.variable.css +278 -0
  53. package/lib/card/index.d.ts +283 -0
  54. package/lib/card/index.js +241 -0
  55. package/lib/cascader/cascader-panel.d.ts +100 -0
  56. package/lib/cascader/cascader.css +173 -0
  57. package/lib/cascader/cascader.d.ts +303 -0
  58. package/lib/cascader/cascader.less +196 -0
  59. package/lib/cascader/cascader.variable.css +293 -0
  60. package/lib/cascader/index.d.ts +868 -0
  61. package/lib/cascader/index.js +2094 -0
  62. package/lib/cascader/interface.d.ts +51 -0
  63. package/lib/cascader/node.d.ts +31 -0
  64. package/lib/cascader/store.d.ts +23 -0
  65. package/lib/checkbox/checkbox-group.d.ts +64 -0
  66. package/lib/checkbox/checkbox.css +100 -0
  67. package/lib/checkbox/checkbox.d.ts +126 -0
  68. package/lib/checkbox/checkbox.less +128 -0
  69. package/lib/checkbox/checkbox.variable.css +220 -0
  70. package/lib/checkbox/common.d.ts +14 -0
  71. package/lib/checkbox/index.d.ts +293 -0
  72. package/lib/checkbox/index.js +509 -0
  73. package/lib/checkbox/type.d.ts +15 -0
  74. package/lib/code-diff/code-diff.css +206 -0
  75. package/lib/code-diff/code-diff.d.ts +80 -0
  76. package/lib/code-diff/code-diff.less +273 -0
  77. package/lib/code-diff/code-diff.variable.css +326 -0
  78. package/lib/code-diff/index.d.ts +154 -0
  79. package/lib/code-diff/index.js +5478 -0
  80. package/lib/collapse/collapse-panel.d.ts +67 -0
  81. package/lib/collapse/collapse.css +46 -0
  82. package/lib/collapse/collapse.d.ts +65 -0
  83. package/lib/collapse/collapse.less +62 -0
  84. package/lib/collapse/collapse.variable.css +166 -0
  85. package/lib/collapse/index.d.ts +258 -0
  86. package/lib/collapse/index.js +632 -0
  87. package/lib/collapse/props.d.ts +79 -0
  88. package/lib/collapse/utils.d.ts +11 -0
  89. package/lib/color-picker/color-picker.css +275 -0
  90. package/lib/color-picker/color-picker.d.ts +144 -0
  91. package/lib/color-picker/color-picker.less +325 -0
  92. package/lib/color-picker/color-picker.variable.css +395 -0
  93. package/lib/color-picker/components/color-input.d.ts +42 -0
  94. package/lib/color-picker/components/hue-slider.d.ts +41 -0
  95. package/lib/color-picker/components/input-container.d.ts +42 -0
  96. package/lib/color-picker/components/recommend-colors.d.ts +51 -0
  97. package/lib/color-picker/components/saturation-panel.d.ts +41 -0
  98. package/lib/color-picker/index.d.ts +254 -0
  99. package/lib/color-picker/index.js +2764 -0
  100. package/lib/color-picker/utils.d.ts +37 -0
  101. package/lib/components.d.ts +59 -0
  102. package/lib/components.js +522 -0
  103. package/lib/container/col.d.ts +51 -0
  104. package/lib/container/container.css +91 -0
  105. package/lib/container/container.d.ts +83 -0
  106. package/lib/container/container.less +20 -0
  107. package/lib/container/container.variable.css +211 -0
  108. package/lib/container/index.d.ts +223 -0
  109. package/lib/container/index.js +308 -0
  110. package/lib/container/row.d.ts +4 -0
  111. package/lib/date-picker/base/confirm.d.ts +74 -0
  112. package/lib/date-picker/base/date-table.d.ts +96 -0
  113. package/lib/date-picker/base/picker-dropdown.d.ts +74 -0
  114. package/lib/date-picker/base/time-spinner.d.ts +151 -0
  115. package/lib/date-picker/date-picker.css +434 -0
  116. package/lib/date-picker/date-picker.d.ts +323 -0
  117. package/lib/date-picker/date-picker.less +558 -0
  118. package/lib/date-picker/date-picker.variable.css +554 -0
  119. package/lib/date-picker/fecha.d.ts +6 -0
  120. package/lib/date-picker/index.d.ts +780 -0
  121. package/lib/date-picker/index.js +5500 -0
  122. package/lib/date-picker/interface.d.ts +32 -0
  123. package/lib/date-picker/panel/date-range.d.ts +309 -0
  124. package/lib/date-picker/panel/date.d.ts +206 -0
  125. package/lib/date-picker/panel/time-range.d.ts +489 -0
  126. package/lib/date-picker/panel/time.d.ts +448 -0
  127. package/lib/date-picker/props.d.ts +161 -0
  128. package/lib/date-picker/time-picker.d.ts +381 -0
  129. package/lib/date-picker/utils.d.ts +117 -0
  130. package/lib/dialog/dialog.css +190 -0
  131. package/lib/dialog/dialog.d.ts +311 -0
  132. package/lib/dialog/dialog.less +153 -0
  133. package/lib/dialog/dialog.variable.css +310 -0
  134. package/lib/dialog/index.d.ts +722 -0
  135. package/lib/dialog/index.js +455 -0
  136. package/lib/dialog/props.d.ts +130 -0
  137. package/lib/directives/clickoutside.d.ts +3 -0
  138. package/lib/directives/ellipsis.d.ts +7 -0
  139. package/lib/directives/index.d.ts +4 -0
  140. package/lib/directives/index.js +1374 -0
  141. package/lib/directives/mousewheel.d.ts +3 -0
  142. package/lib/directives/tooltips.d.ts +18 -0
  143. package/lib/dist.index.js +81 -0
  144. package/lib/divider/divider.css +38 -0
  145. package/lib/divider/divider.d.ts +48 -0
  146. package/lib/divider/divider.less +53 -0
  147. package/lib/divider/divider.variable.css +158 -0
  148. package/lib/divider/index.d.ts +142 -0
  149. package/lib/divider/index.js +444 -0
  150. package/lib/divider/props.d.ts +21 -0
  151. package/lib/dropdown/dropdown-item.d.ts +19 -0
  152. package/lib/dropdown/dropdown-menu.d.ts +16 -0
  153. package/lib/dropdown/dropdown.css +49 -0
  154. package/lib/dropdown/dropdown.d.ts +93 -0
  155. package/lib/dropdown/dropdown.less +67 -0
  156. package/lib/dropdown/dropdown.variable.css +169 -0
  157. package/lib/dropdown/index.d.ts +256 -0
  158. package/lib/dropdown/index.js +332 -0
  159. package/lib/exception/exception.css +58 -0
  160. package/lib/exception/exception.d.ts +33 -0
  161. package/lib/exception/exception.less +76 -0
  162. package/lib/exception/exception.variable.css +178 -0
  163. package/lib/exception/index.d.ts +111 -0
  164. package/lib/exception/index.js +357 -0
  165. package/lib/exception/typings/index.d.ts +4 -0
  166. package/lib/fixed-navbar/fixed-navbar.css +42 -0
  167. package/lib/fixed-navbar/fixed-navbar.d.ts +48 -0
  168. package/lib/fixed-navbar/fixed-navbar.less +53 -0
  169. package/lib/fixed-navbar/fixed-navbar.variable.css +162 -0
  170. package/lib/fixed-navbar/index.d.ts +147 -0
  171. package/lib/fixed-navbar/index.js +150 -0
  172. package/lib/form/compose-form-item.d.ts +16 -0
  173. package/lib/form/form-item.d.ts +160 -0
  174. package/lib/form/form.css +137 -0
  175. package/lib/form/form.d.ts +88 -0
  176. package/lib/form/form.less +170 -0
  177. package/lib/form/form.variable.css +257 -0
  178. package/lib/form/index.d.ts +319 -0
  179. package/lib/form/index.js +900 -0
  180. package/lib/form/type.d.ts +22 -0
  181. package/lib/form/utils.d.ts +2 -0
  182. package/lib/form/validator.d.ts +9 -0
  183. package/lib/icon/angle-double-down-line.d.ts +4 -0
  184. package/lib/icon/angle-double-down-line.js +366 -0
  185. package/lib/icon/angle-double-left-line.d.ts +4 -0
  186. package/lib/icon/angle-double-left-line.js +366 -0
  187. package/lib/icon/angle-double-left.d.ts +4 -0
  188. package/lib/icon/angle-double-left.js +366 -0
  189. package/lib/icon/angle-double-right-line.d.ts +4 -0
  190. package/lib/icon/angle-double-right-line.js +366 -0
  191. package/lib/icon/angle-double-right.d.ts +4 -0
  192. package/lib/icon/angle-double-right.js +366 -0
  193. package/lib/icon/angle-double-up-line.d.ts +4 -0
  194. package/lib/icon/angle-double-up-line.js +366 -0
  195. package/lib/icon/angle-down-fill.d.ts +4 -0
  196. package/lib/icon/angle-down-fill.js +366 -0
  197. package/lib/icon/angle-down-line.d.ts +4 -0
  198. package/lib/icon/angle-down-line.js +366 -0
  199. package/lib/icon/angle-down.d.ts +4 -0
  200. package/lib/icon/angle-down.js +366 -0
  201. package/lib/icon/angle-left.d.ts +4 -0
  202. package/lib/icon/angle-left.js +366 -0
  203. package/lib/icon/angle-right.d.ts +4 -0
  204. package/lib/icon/angle-right.js +366 -0
  205. package/lib/icon/angle-up-fill.d.ts +4 -0
  206. package/lib/icon/angle-up-fill.js +366 -0
  207. package/lib/icon/angle-up.d.ts +4 -0
  208. package/lib/icon/angle-up.js +366 -0
  209. package/lib/icon/archive-fill.d.ts +4 -0
  210. package/lib/icon/archive-fill.js +366 -0
  211. package/lib/icon/arrows-left.d.ts +4 -0
  212. package/lib/icon/arrows-left.js +366 -0
  213. package/lib/icon/arrows-right.d.ts +4 -0
  214. package/lib/icon/arrows-right.js +366 -0
  215. package/lib/icon/audio-fill.d.ts +4 -0
  216. package/lib/icon/audio-fill.js +366 -0
  217. package/lib/icon/bk.d.ts +4 -0
  218. package/lib/icon/bk.js +366 -0
  219. package/lib/icon/circle.d.ts +4 -0
  220. package/lib/icon/circle.js +366 -0
  221. package/lib/icon/close-line.d.ts +4 -0
  222. package/lib/icon/close-line.js +366 -0
  223. package/lib/icon/close.d.ts +4 -0
  224. package/lib/icon/close.js +366 -0
  225. package/lib/icon/code.d.ts +4 -0
  226. package/lib/icon/code.js +366 -0
  227. package/lib/icon/cog-shape.d.ts +4 -0
  228. package/lib/icon/cog-shape.js +366 -0
  229. package/lib/icon/collapse-left.d.ts +4 -0
  230. package/lib/icon/collapse-left.js +366 -0
  231. package/lib/icon/copy.d.ts +4 -0
  232. package/lib/icon/copy.js +366 -0
  233. package/lib/icon/data-shape.d.ts +4 -0
  234. package/lib/icon/data-shape.js +366 -0
  235. package/lib/icon/del.d.ts +4 -0
  236. package/lib/icon/del.js +366 -0
  237. package/lib/icon/doc-fill.d.ts +4 -0
  238. package/lib/icon/doc-fill.js +366 -0
  239. package/lib/icon/done.d.ts +4 -0
  240. package/lib/icon/done.js +366 -0
  241. package/lib/icon/down-shape.d.ts +4 -0
  242. package/lib/icon/down-shape.js +366 -0
  243. package/lib/icon/down-small.d.ts +4 -0
  244. package/lib/icon/down-small.js +366 -0
  245. package/lib/icon/edit-line.d.ts +4 -0
  246. package/lib/icon/edit-line.js +366 -0
  247. package/lib/icon/ellipsis.d.ts +4 -0
  248. package/lib/icon/ellipsis.js +366 -0
  249. package/lib/icon/enlarge-line.d.ts +4 -0
  250. package/lib/icon/enlarge-line.js +366 -0
  251. package/lib/icon/error.d.ts +4 -0
  252. package/lib/icon/error.js +366 -0
  253. package/lib/icon/excel-fill.d.ts +4 -0
  254. package/lib/icon/excel-fill.js +366 -0
  255. package/lib/icon/exclamation-circle-shape.d.ts +4 -0
  256. package/lib/icon/exclamation-circle-shape.js +366 -0
  257. package/lib/icon/eye.d.ts +4 -0
  258. package/lib/icon/eye.js +366 -0
  259. package/lib/icon/filliscreen-line.d.ts +4 -0
  260. package/lib/icon/filliscreen-line.js +366 -0
  261. package/lib/icon/folder-open.d.ts +4 -0
  262. package/lib/icon/folder-open.js +366 -0
  263. package/lib/icon/folder-shape-open.d.ts +4 -0
  264. package/lib/icon/folder-shape-open.js +366 -0
  265. package/lib/icon/folder-shape.d.ts +4 -0
  266. package/lib/icon/folder-shape.js +366 -0
  267. package/lib/icon/folder.d.ts +4 -0
  268. package/lib/icon/folder.js +366 -0
  269. package/lib/icon/funnel.d.ts +4 -0
  270. package/lib/icon/funnel.js +366 -0
  271. package/lib/icon/help-document-fill.d.ts +4 -0
  272. package/lib/icon/help-document-fill.js +366 -0
  273. package/lib/icon/help-fill.d.ts +4 -0
  274. package/lib/icon/help-fill.js +366 -0
  275. package/lib/icon/help.d.ts +4 -0
  276. package/lib/icon/help.js +366 -0
  277. package/lib/icon/icon.d.ts +12 -0
  278. package/lib/icon/image-fill.d.ts +4 -0
  279. package/lib/icon/image-fill.js +366 -0
  280. package/lib/icon/img-error.d.ts +4 -0
  281. package/lib/icon/img-placehoulder.d.ts +4 -0
  282. package/lib/icon/img-placehoulder.js +412 -0
  283. package/lib/icon/index.d.ts +79 -0
  284. package/lib/icon/index.js +2287 -0
  285. package/lib/icon/info-line.d.ts +4 -0
  286. package/lib/icon/info-line.js +412 -0
  287. package/lib/icon/info.d.ts +4 -0
  288. package/lib/icon/info.js +412 -0
  289. package/lib/icon/left-shape.d.ts +4 -0
  290. package/lib/icon/left-shape.js +412 -0
  291. package/lib/icon/left-turn-line.d.ts +4 -0
  292. package/lib/icon/left-turn-line.js +412 -0
  293. package/lib/icon/narrow-line.d.ts +4 -0
  294. package/lib/icon/narrow-line.js +412 -0
  295. package/lib/icon/original.d.ts +4 -0
  296. package/lib/icon/original.js +412 -0
  297. package/lib/icon/pdf-fill.d.ts +4 -0
  298. package/lib/icon/pdf-fill.js +412 -0
  299. package/lib/icon/play-shape.d.ts +4 -0
  300. package/lib/icon/play-shape.js +412 -0
  301. package/lib/icon/plus.d.ts +4 -0
  302. package/lib/icon/plus.js +412 -0
  303. package/lib/icon/ppt-fill.d.ts +4 -0
  304. package/lib/icon/ppt-fill.js +412 -0
  305. package/lib/icon/qq.d.ts +4 -0
  306. package/lib/icon/qq.js +412 -0
  307. package/lib/icon/right-shape.d.ts +4 -0
  308. package/lib/icon/right-shape.js +412 -0
  309. package/lib/icon/right-turn-line.d.ts +4 -0
  310. package/lib/icon/right-turn-line.js +412 -0
  311. package/lib/icon/search.d.ts +4 -0
  312. package/lib/icon/search.js +412 -0
  313. package/lib/icon/share.d.ts +4 -0
  314. package/lib/icon/share.js +412 -0
  315. package/lib/icon/spinner.d.ts +4 -0
  316. package/lib/icon/spinner.js +412 -0
  317. package/lib/icon/success.d.ts +4 -0
  318. package/lib/icon/success.js +412 -0
  319. package/lib/icon/switcher-loading.d.ts +4 -0
  320. package/lib/icon/switcher-loading.js +412 -0
  321. package/lib/icon/text-file.d.ts +4 -0
  322. package/lib/icon/text-file.js +412 -0
  323. package/lib/icon/text-fill.d.ts +4 -0
  324. package/lib/icon/text-fill.js +412 -0
  325. package/lib/icon/transfer.d.ts +4 -0
  326. package/lib/icon/transfer.js +412 -0
  327. package/lib/icon/tree-application-shape.d.ts +4 -0
  328. package/lib/icon/tree-application-shape.js +412 -0
  329. package/lib/icon/unfull-screen.d.ts +4 -0
  330. package/lib/icon/unfull-screen.js +412 -0
  331. package/lib/icon/unvisible.d.ts +4 -0
  332. package/lib/icon/unvisible.js +412 -0
  333. package/lib/icon/up-shape.d.ts +4 -0
  334. package/lib/icon/up-shape.js +412 -0
  335. package/lib/icon/upload.d.ts +4 -0
  336. package/lib/icon/upload.js +412 -0
  337. package/lib/icon/video-fill.d.ts +4 -0
  338. package/lib/icon/video-fill.js +412 -0
  339. package/lib/icon/warn.d.ts +4 -0
  340. package/lib/icon/warn.js +412 -0
  341. package/lib/icon/weixin.d.ts +4 -0
  342. package/lib/icon/weixin.js +412 -0
  343. package/lib/image/image-viewer.css +142 -0
  344. package/lib/image/image-viewer.d.ts +73 -0
  345. package/lib/image/image-viewer.less +168 -0
  346. package/lib/image/image-viewer.variable.css +142 -0
  347. package/lib/image/image.css +37 -0
  348. package/lib/image/image.d.ts +93 -0
  349. package/lib/image/image.less +44 -0
  350. package/lib/image/image.variable.css +37 -0
  351. package/lib/image/index.d.ts +246 -0
  352. package/lib/image/index.js +824 -0
  353. package/lib/image/props.d.ts +71 -0
  354. package/lib/index.d.ts +4 -0
  355. package/lib/index.js +85 -0
  356. package/lib/info-box/index.d.ts +6 -0
  357. package/lib/info-box/index.js +1730 -0
  358. package/lib/info-box/info-box.css +37 -0
  359. package/lib/info-box/info-box.d.ts +26 -0
  360. package/lib/info-box/info-box.less +51 -0
  361. package/lib/info-box/info-box.variable.css +157 -0
  362. package/lib/input/index.d.ts +528 -0
  363. package/lib/input/index.js +778 -0
  364. package/lib/input/input.css +351 -0
  365. package/lib/input/input.d.ts +337 -0
  366. package/lib/input/input.less +306 -0
  367. package/lib/input/input.variable.css +471 -0
  368. package/lib/link/index.d.ts +172 -0
  369. package/lib/link/index.js +158 -0
  370. package/lib/link/link.css +55 -0
  371. package/lib/link/link.d.ts +60 -0
  372. package/lib/link/link.less +76 -0
  373. package/lib/link/link.variable.css +175 -0
  374. package/lib/loading/index.d.ts +257 -0
  375. package/lib/loading/index.js +249 -0
  376. package/lib/loading/loading.css +305 -0
  377. package/lib/loading/loading.d.ts +160 -0
  378. package/lib/loading/loading.less +193 -0
  379. package/lib/loading/loading.variable.css +425 -0
  380. package/lib/menu/index.d.ts +180 -0
  381. package/lib/menu/index.js +732 -0
  382. package/lib/menu/menu-group.d.ts +14 -0
  383. package/lib/menu/menu-item.d.ts +16 -0
  384. package/lib/menu/menu.css +233 -0
  385. package/lib/menu/menu.d.ts +55 -0
  386. package/lib/menu/menu.less +180 -0
  387. package/lib/menu/menu.variable.css +353 -0
  388. package/lib/menu/submenu.css +3 -0
  389. package/lib/menu/submenu.d.ts +22 -0
  390. package/lib/menu/submenu.less +5 -0
  391. package/lib/menu/submenu.variable.css +123 -0
  392. package/lib/menu/utils.d.ts +41 -0
  393. package/lib/message/index.d.ts +2 -0
  394. package/lib/message/index.js +329 -0
  395. package/lib/message/message.css +74 -0
  396. package/lib/message/message.less +87 -0
  397. package/lib/message/message.variable.css +194 -0
  398. package/lib/message/messageConstructor.d.ts +109 -0
  399. package/lib/modal/index.d.ts +592 -0
  400. package/lib/modal/index.js +329 -0
  401. package/lib/modal/modal.css +73 -0
  402. package/lib/modal/modal.d.ts +209 -0
  403. package/lib/modal/modal.less +48 -0
  404. package/lib/modal/modal.variable.css +193 -0
  405. package/lib/modal/props.mixin.d.ts +87 -0
  406. package/lib/navigation/index.d.ts +311 -0
  407. package/lib/navigation/index.js +363 -0
  408. package/lib/navigation/navigation-title.d.ts +25 -0
  409. package/lib/navigation/navigation.css +184 -0
  410. package/lib/navigation/navigation.d.ts +120 -0
  411. package/lib/navigation/navigation.less +210 -0
  412. package/lib/navigation/navigation.variable.css +304 -0
  413. package/lib/notify/index.d.ts +2 -0
  414. package/lib/notify/index.js +358 -0
  415. package/lib/notify/notify.css +69 -0
  416. package/lib/notify/notify.less +81 -0
  417. package/lib/notify/notify.variable.css +189 -0
  418. package/lib/notify/notifyConstructor.d.ts +132 -0
  419. package/lib/overflow-title/components/OverflowTitle.d.ts +38 -0
  420. package/lib/overflow-title/directive/overflowTitle.d.ts +3 -0
  421. package/lib/overflow-title/index.d.ts +129 -0
  422. package/lib/overflow-title/index.js +476 -0
  423. package/lib/overflow-title/overflow.css +11 -0
  424. package/lib/overflow-title/overflow.less +13 -0
  425. package/lib/overflow-title/overflow.variable.css +11 -0
  426. package/lib/overflow-title/props.d.ts +16 -0
  427. package/lib/overflow-title/utils/getActualWidthByCanvas.d.ts +3 -0
  428. package/lib/overflow-title/utils/getActualWidthByDom.d.ts +3 -0
  429. package/lib/pagination/index.d.ts +410 -0
  430. package/lib/pagination/index.js +937 -0
  431. package/lib/pagination/pagination.css +205 -0
  432. package/lib/pagination/pagination.d.ts +230 -0
  433. package/lib/pagination/pagination.less +230 -0
  434. package/lib/pagination/pagination.variable.css +325 -0
  435. package/lib/pagination/type.d.ts +6 -0
  436. package/lib/pagination/use-limit.d.ts +8 -0
  437. package/lib/pagination/use-list.d.ts +8 -0
  438. package/lib/pagination/use-small-list.d.ts +5 -0
  439. package/lib/pagination/use-total.d.ts +5 -0
  440. package/lib/plugin-popover/index.d.ts +27 -0
  441. package/lib/plugin-popover/index.js +2400 -0
  442. package/lib/plugins/index.d.ts +1 -0
  443. package/lib/plugins/index.js +63 -0
  444. package/lib/popover/arrow.d.ts +2 -0
  445. package/lib/popover/const.d.ts +16 -0
  446. package/lib/popover/content.d.ts +32 -0
  447. package/lib/popover/index.d.ts +653 -0
  448. package/lib/popover/index.js +2408 -0
  449. package/lib/popover/plugin-popover.d.ts +12 -0
  450. package/lib/popover/popover.css +25 -0
  451. package/lib/popover/popover.d.ts +277 -0
  452. package/lib/popover/popover.less +35 -0
  453. package/lib/popover/popover.variable.css +145 -0
  454. package/lib/popover/props.d.ts +146 -0
  455. package/lib/popover/reference.d.ts +2 -0
  456. package/lib/popover/root.d.ts +16 -0
  457. package/lib/popover/use-floating.d.ts +34 -0
  458. package/lib/popover/use-platform.d.ts +30 -0
  459. package/lib/popover/use-popover-init.d.ts +23 -0
  460. package/lib/popover/use-popper-id.d.ts +6 -0
  461. package/lib/popover/utils.d.ts +2 -0
  462. package/lib/popover2/index.d.ts +44 -0
  463. package/lib/popover2/index.js +108 -0
  464. package/lib/popover2/popover.d.ts +2 -0
  465. package/lib/preset.d.ts +7 -0
  466. package/lib/preset.js +62 -0
  467. package/lib/process/index.d.ts +205 -0
  468. package/lib/process/index.js +1375 -0
  469. package/lib/process/process.css +151 -0
  470. package/lib/process/process.d.ts +131 -0
  471. package/lib/process/process.less +195 -0
  472. package/lib/process/process.variable.css +271 -0
  473. package/lib/progress/circle.d.ts +6 -0
  474. package/lib/progress/index.d.ts +398 -0
  475. package/lib/progress/index.js +415 -0
  476. package/lib/progress/line.d.ts +6 -0
  477. package/lib/progress/progress.css +145 -0
  478. package/lib/progress/progress.d.ts +171 -0
  479. package/lib/progress/progress.less +90 -0
  480. package/lib/progress/progress.variable.css +265 -0
  481. package/lib/radio/common.d.ts +13 -0
  482. package/lib/radio/index.d.ts +288 -0
  483. package/lib/radio/index.js +588 -0
  484. package/lib/radio/radio-button.d.ts +90 -0
  485. package/lib/radio/radio-group.d.ts +57 -0
  486. package/lib/radio/radio.css +139 -0
  487. package/lib/radio/radio.d.ts +87 -0
  488. package/lib/radio/radio.less +177 -0
  489. package/lib/radio/radio.variable.css +259 -0
  490. package/lib/radio/type.d.ts +14 -0
  491. package/lib/rate/index.d.ts +136 -0
  492. package/lib/rate/index.js +294 -0
  493. package/lib/rate/rate.css +10 -0
  494. package/lib/rate/rate.d.ts +43 -0
  495. package/lib/rate/rate.less +11 -0
  496. package/lib/rate/rate.variable.css +10 -0
  497. package/lib/rate/star.css +24 -0
  498. package/lib/rate/star.d.ts +74 -0
  499. package/lib/rate/star.less +29 -0
  500. package/lib/rate/star.variable.css +24 -0
  501. package/lib/resize-layout/index.d.ts +336 -0
  502. package/lib/resize-layout/index.js +427 -0
  503. package/lib/resize-layout/resize-layout.css +177 -0
  504. package/lib/resize-layout/resize-layout.d.ts +127 -0
  505. package/lib/resize-layout/resize-layout.less +217 -0
  506. package/lib/resize-layout/resize-layout.variable.css +297 -0
  507. package/lib/search-select/index.d.ts +823 -0
  508. package/lib/search-select/index.js +3336 -0
  509. package/lib/search-select/input.d.ts +89 -0
  510. package/lib/search-select/menu.d.ts +83 -0
  511. package/lib/search-select/search-select.css +424 -0
  512. package/lib/search-select/search-select.d.ts +342 -0
  513. package/lib/search-select/search-select.less +380 -0
  514. package/lib/search-select/search-select.variable.css +544 -0
  515. package/lib/search-select/selected.d.ts +143 -0
  516. package/lib/search-select/utils.d.ts +88 -0
  517. package/lib/select/common.d.ts +26 -0
  518. package/lib/select/index.d.ts +2039 -0
  519. package/lib/select/index.js +2740 -0
  520. package/lib/select/option.d.ts +37 -0
  521. package/lib/select/optionGroup.d.ts +54 -0
  522. package/lib/select/select.css +399 -0
  523. package/lib/select/select.d.ts +753 -0
  524. package/lib/select/select.less +443 -0
  525. package/lib/select/select.variable.css +519 -0
  526. package/lib/select/selectTagInput.d.ts +93 -0
  527. package/lib/select/type.d.ts +39 -0
  528. package/lib/shared/dom.d.ts +3 -0
  529. package/lib/shared/helper.d.ts +101 -0
  530. package/lib/shared/hooks/use-form-item.d.ts +2 -0
  531. package/lib/shared/hooks/use-form.d.ts +2 -0
  532. package/lib/shared/index.d.ts +74 -0
  533. package/lib/shared/index.js +2838 -0
  534. package/lib/shared/mask-manager.d.ts +80 -0
  535. package/lib/shared/pop-manager.d.ts +38 -0
  536. package/lib/shared/popover.d.ts +131 -0
  537. package/lib/shared/scrollbar-width.d.ts +1 -0
  538. package/lib/shared/token.d.ts +4 -0
  539. package/lib/shared/utils.d.ts +25 -0
  540. package/lib/shared/vue-types.d.ts +213 -0
  541. package/lib/shared/z-index-manager.d.ts +93 -0
  542. package/lib/sideslider/index.d.ts +477 -0
  543. package/lib/sideslider/index.js +1313 -0
  544. package/lib/sideslider/sideslider.css +114 -0
  545. package/lib/sideslider/sideslider.d.ts +203 -0
  546. package/lib/sideslider/sideslider.less +145 -0
  547. package/lib/sideslider/sideslider.variable.css +234 -0
  548. package/lib/slider/index.d.ts +440 -0
  549. package/lib/slider/index.js +2011 -0
  550. package/lib/slider/slider-button.d.ts +81 -0
  551. package/lib/slider/slider.css +149 -0
  552. package/lib/slider/slider.d.ts +201 -0
  553. package/lib/slider/slider.less +179 -0
  554. package/lib/slider/slider.variable.css +269 -0
  555. package/lib/steps/index.d.ts +250 -0
  556. package/lib/steps/index.js +1457 -0
  557. package/lib/steps/steps.css +300 -0
  558. package/lib/steps/steps.d.ts +161 -0
  559. package/lib/steps/steps.less +345 -0
  560. package/lib/steps/steps.variable.css +420 -0
  561. package/lib/styles/index.d.ts +53 -0
  562. package/lib/styles/mixins/animate.css +21 -0
  563. package/lib/styles/mixins/animate.less +27 -0
  564. package/lib/styles/mixins/animate.variable.css +21 -0
  565. package/lib/styles/mixins/clearfix.css +8 -0
  566. package/lib/styles/mixins/clearfix.less +10 -0
  567. package/lib/styles/mixins/clearfix.variable.css +8 -0
  568. package/lib/styles/mixins/ellipsis.less +8 -0
  569. package/lib/styles/mixins/mixins.css +72 -0
  570. package/lib/styles/mixins/mixins.less +5 -0
  571. package/lib/styles/mixins/mixins.variable.css +72 -0
  572. package/lib/styles/mixins/popper.css +43 -0
  573. package/lib/styles/mixins/popper.less +53 -0
  574. package/lib/styles/mixins/popper.variable.css +163 -0
  575. package/lib/styles/mixins/scroll.css +17 -0
  576. package/lib/styles/mixins/scroll.less +22 -0
  577. package/lib/styles/mixins/scroll.variable.css +137 -0
  578. package/lib/styles/mixins/size.less +13 -0
  579. package/lib/styles/reset.css +309 -0
  580. package/lib/styles/reset.less +337 -0
  581. package/lib/styles/reset.variable.css +309 -0
  582. package/lib/styles/themes/themes.less +162 -0
  583. package/lib/swiper/index.d.ts +181 -0
  584. package/lib/swiper/index.js +310 -0
  585. package/lib/swiper/swiper.css +91 -0
  586. package/lib/swiper/swiper.d.ts +65 -0
  587. package/lib/swiper/swiper.less +107 -0
  588. package/lib/swiper/swiper.variable.css +91 -0
  589. package/lib/switcher/index.d.ts +298 -0
  590. package/lib/switcher/index.js +240 -0
  591. package/lib/switcher/switcher.css +323 -0
  592. package/lib/switcher/switcher.d.ts +119 -0
  593. package/lib/switcher/switcher.less +337 -0
  594. package/lib/switcher/switcher.variable.css +443 -0
  595. package/lib/tab/index.d.ts +435 -0
  596. package/lib/tab/index.js +849 -0
  597. package/lib/tab/props.d.ts +207 -0
  598. package/lib/tab/tab-nav.d.ts +169 -0
  599. package/lib/tab/tab-panel.d.ts +68 -0
  600. package/lib/tab/tab.css +223 -0
  601. package/lib/tab/tab.d.ts +139 -0
  602. package/lib/tab/tab.less +285 -0
  603. package/lib/tab/tab.variable.css +343 -0
  604. package/lib/table/components/index.d.ts +3 -0
  605. package/lib/table/components/table-cell.d.ts +38 -0
  606. package/lib/table/components/table-column.d.ts +137 -0
  607. package/lib/table/components/table-row.d.ts +2 -0
  608. package/lib/table/const.d.ts +122 -0
  609. package/lib/table/index.d.ts +1141 -0
  610. package/lib/table/index.js +6520 -0
  611. package/lib/table/plugins/body-empty.d.ts +40 -0
  612. package/lib/table/plugins/col-group.d.ts +38 -0
  613. package/lib/table/plugins/common.d.ts +6 -0
  614. package/lib/table/plugins/head-filter.css +84 -0
  615. package/lib/table/plugins/head-filter.d.ts +26 -0
  616. package/lib/table/plugins/head-filter.less +110 -0
  617. package/lib/table/plugins/head-filter.variable.css +204 -0
  618. package/lib/table/plugins/head-sort.css +25 -0
  619. package/lib/table/plugins/head-sort.d.ts +22 -0
  620. package/lib/table/plugins/head-sort.less +31 -0
  621. package/lib/table/plugins/head-sort.variable.css +145 -0
  622. package/lib/table/plugins/index.d.ts +5 -0
  623. package/lib/table/plugins/settings.css +145 -0
  624. package/lib/table/plugins/settings.d.ts +37 -0
  625. package/lib/table/plugins/settings.less +179 -0
  626. package/lib/table/plugins/settings.variable.css +265 -0
  627. package/lib/table/plugins/use-active-columns.d.ts +16 -0
  628. package/lib/table/plugins/use-column-resize.d.ts +15 -0
  629. package/lib/table/plugins/use-fixed-column.d.ts +12 -0
  630. package/lib/table/plugins/use-pagination.d.ts +16 -0
  631. package/lib/table/plugins/use-scroll-loading.d.ts +5 -0
  632. package/lib/table/props.d.ts +434 -0
  633. package/lib/table/render.d.ts +125 -0
  634. package/lib/table/table.css +1272 -0
  635. package/lib/table/table.d.ts +350 -0
  636. package/lib/table/table.less +365 -0
  637. package/lib/table/table.variable.css +1392 -0
  638. package/lib/table/use-column.d.ts +11 -0
  639. package/lib/table/use-common.d.ts +98 -0
  640. package/lib/table/utils.d.ts +129 -0
  641. package/lib/table-column/index.d.ts +325 -0
  642. package/lib/table-column/index.js +669 -0
  643. package/lib/tag/index.d.ts +229 -0
  644. package/lib/tag/index.js +206 -0
  645. package/lib/tag/tag.css +130 -0
  646. package/lib/tag/tag.d.ts +84 -0
  647. package/lib/tag/tag.less +149 -0
  648. package/lib/tag/tag.variable.css +250 -0
  649. package/lib/tag-input/common.d.ts +36 -0
  650. package/lib/tag-input/index.d.ts +1349 -0
  651. package/lib/tag-input/index.js +1795 -0
  652. package/lib/tag-input/list-tag-render.d.ts +44 -0
  653. package/lib/tag-input/tag-input.css +205 -0
  654. package/lib/tag-input/tag-input.d.ts +631 -0
  655. package/lib/tag-input/tag-input.less +248 -0
  656. package/lib/tag-input/tag-input.variable.css +325 -0
  657. package/lib/tag-input/tag-props.d.ts +252 -0
  658. package/lib/tag-input/tag-render.d.ts +64 -0
  659. package/lib/time-picker/index.d.ts +904 -0
  660. package/lib/time-picker/index.js +71 -0
  661. package/lib/time-picker/time-picker.css +215 -0
  662. package/lib/time-picker/time-picker.less +260 -0
  663. package/lib/time-picker/time-picker.variable.css +335 -0
  664. package/lib/timeline/index.d.ts +129 -0
  665. package/lib/timeline/index.js +251 -0
  666. package/lib/timeline/timeline.css +242 -0
  667. package/lib/timeline/timeline.d.ts +81 -0
  668. package/lib/timeline/timeline.less +252 -0
  669. package/lib/timeline/timeline.variable.css +362 -0
  670. package/lib/transfer/const.d.ts +5 -0
  671. package/lib/transfer/index.d.ts +365 -0
  672. package/lib/transfer/index.js +573 -0
  673. package/lib/transfer/props.d.ts +54 -0
  674. package/lib/transfer/transfer.css +161 -0
  675. package/lib/transfer/transfer.d.ts +160 -0
  676. package/lib/transfer/transfer.less +151 -0
  677. package/lib/transfer/transfer.variable.css +281 -0
  678. package/lib/tree/constant.d.ts +62 -0
  679. package/lib/tree/index.d.ts +647 -0
  680. package/lib/tree/index.js +2840 -0
  681. package/lib/tree/props.d.ts +213 -0
  682. package/lib/tree/tree.css +218 -0
  683. package/lib/tree/tree.d.ts +283 -0
  684. package/lib/tree/tree.less +114 -0
  685. package/lib/tree/tree.variable.css +338 -0
  686. package/lib/tree/use-empty.d.ts +6 -0
  687. package/lib/tree/use-node-action.d.ts +12 -0
  688. package/lib/tree/use-node-async.d.ts +5 -0
  689. package/lib/tree/use-node-attribute.d.ts +33 -0
  690. package/lib/tree/use-node-drag.d.ts +3 -0
  691. package/lib/tree/use-search.d.ts +11 -0
  692. package/lib/tree/use-tree-init.d.ts +15 -0
  693. package/lib/tree/util.d.ts +68 -0
  694. package/lib/upload/index.d.ts +566 -0
  695. package/lib/upload/index.js +3681 -0
  696. package/lib/upload/props.d.ts +111 -0
  697. package/lib/upload/upload-list.d.ts +47 -0
  698. package/lib/upload/upload-trigger.d.ts +51 -0
  699. package/lib/upload/upload.css +425 -0
  700. package/lib/upload/upload.d.ts +246 -0
  701. package/lib/upload/upload.less +464 -0
  702. package/lib/upload/upload.type.d.ts +78 -0
  703. package/lib/upload/upload.variable.css +545 -0
  704. package/lib/upload/use-ajax-upload.d.ts +3 -0
  705. package/lib/upload/use-file-handler.d.ts +44 -0
  706. package/lib/use-message.d.ts +2 -0
  707. package/lib/virtual-render/index.d.ts +602 -0
  708. package/lib/virtual-render/index.js +757 -0
  709. package/lib/virtual-render/props.d.ts +172 -0
  710. package/lib/virtual-render/use-tag-render.d.ts +7 -0
  711. package/lib/virtual-render/v-virtual-render.d.ts +6 -0
  712. package/lib/virtual-render/virtual-render.css +33 -0
  713. package/lib/virtual-render/virtual-render.d.ts +266 -0
  714. package/lib/virtual-render/virtual-render.less +22 -0
  715. package/lib/virtual-render/virtual-render.variable.css +153 -0
  716. package/lib/volar.components.d.ts +101 -0
  717. package/package.json +58 -28
  718. package/LICENSE.txt +0 -22
@@ -0,0 +1,3681 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__ from "../shared";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
3
+ import * as __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__ from "../icon";
4
+ import * as __WEBPACK_EXTERNAL_MODULE__progress_ed4d3a99__ from "../progress";
5
+ import * as __WEBPACK_EXTERNAL_MODULE__button_59c00871__ from "../button";
6
+ /******/ var __webpack_modules__ = ({
7
+
8
+ /***/ 7162:
9
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10
+
11
+ module.exports = __webpack_require__(5047);
12
+
13
+
14
+ /***/ }),
15
+
16
+ /***/ 5047:
17
+ /***/ ((module) => {
18
+
19
+ /**
20
+ * Copyright (c) 2014-present, Facebook, Inc.
21
+ *
22
+ * This source code is licensed under the MIT license found in the
23
+ * LICENSE file in the root directory of this source tree.
24
+ */
25
+
26
+ var runtime = (function (exports) {
27
+ "use strict";
28
+
29
+ var Op = Object.prototype;
30
+ var hasOwn = Op.hasOwnProperty;
31
+ var undefined; // More compressible than void 0.
32
+ var $Symbol = typeof Symbol === "function" ? Symbol : {};
33
+ var iteratorSymbol = $Symbol.iterator || "@@iterator";
34
+ var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
35
+ var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
36
+
37
+ function define(obj, key, value) {
38
+ Object.defineProperty(obj, key, {
39
+ value: value,
40
+ enumerable: true,
41
+ configurable: true,
42
+ writable: true
43
+ });
44
+ return obj[key];
45
+ }
46
+ try {
47
+ // IE 8 has a broken Object.defineProperty that only works on DOM objects.
48
+ define({}, "");
49
+ } catch (err) {
50
+ define = function(obj, key, value) {
51
+ return obj[key] = value;
52
+ };
53
+ }
54
+
55
+ function wrap(innerFn, outerFn, self, tryLocsList) {
56
+ // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
57
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
58
+ var generator = Object.create(protoGenerator.prototype);
59
+ var context = new Context(tryLocsList || []);
60
+
61
+ // The ._invoke method unifies the implementations of the .next,
62
+ // .throw, and .return methods.
63
+ generator._invoke = makeInvokeMethod(innerFn, self, context);
64
+
65
+ return generator;
66
+ }
67
+ exports.wrap = wrap;
68
+
69
+ // Try/catch helper to minimize deoptimizations. Returns a completion
70
+ // record like context.tryEntries[i].completion. This interface could
71
+ // have been (and was previously) designed to take a closure to be
72
+ // invoked without arguments, but in all the cases we care about we
73
+ // already have an existing method we want to call, so there's no need
74
+ // to create a new function object. We can even get away with assuming
75
+ // the method takes exactly one argument, since that happens to be true
76
+ // in every case, so we don't have to touch the arguments object. The
77
+ // only additional allocation required is the completion record, which
78
+ // has a stable shape and so hopefully should be cheap to allocate.
79
+ function tryCatch(fn, obj, arg) {
80
+ try {
81
+ return { type: "normal", arg: fn.call(obj, arg) };
82
+ } catch (err) {
83
+ return { type: "throw", arg: err };
84
+ }
85
+ }
86
+
87
+ var GenStateSuspendedStart = "suspendedStart";
88
+ var GenStateSuspendedYield = "suspendedYield";
89
+ var GenStateExecuting = "executing";
90
+ var GenStateCompleted = "completed";
91
+
92
+ // Returning this object from the innerFn has the same effect as
93
+ // breaking out of the dispatch switch statement.
94
+ var ContinueSentinel = {};
95
+
96
+ // Dummy constructor functions that we use as the .constructor and
97
+ // .constructor.prototype properties for functions that return Generator
98
+ // objects. For full spec compliance, you may wish to configure your
99
+ // minifier not to mangle the names of these two functions.
100
+ function Generator() {}
101
+ function GeneratorFunction() {}
102
+ function GeneratorFunctionPrototype() {}
103
+
104
+ // This is a polyfill for %IteratorPrototype% for environments that
105
+ // don't natively support it.
106
+ var IteratorPrototype = {};
107
+ define(IteratorPrototype, iteratorSymbol, function () {
108
+ return this;
109
+ });
110
+
111
+ var getProto = Object.getPrototypeOf;
112
+ var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
113
+ if (NativeIteratorPrototype &&
114
+ NativeIteratorPrototype !== Op &&
115
+ hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
116
+ // This environment has a native %IteratorPrototype%; use it instead
117
+ // of the polyfill.
118
+ IteratorPrototype = NativeIteratorPrototype;
119
+ }
120
+
121
+ var Gp = GeneratorFunctionPrototype.prototype =
122
+ Generator.prototype = Object.create(IteratorPrototype);
123
+ GeneratorFunction.prototype = GeneratorFunctionPrototype;
124
+ define(Gp, "constructor", GeneratorFunctionPrototype);
125
+ define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
126
+ GeneratorFunction.displayName = define(
127
+ GeneratorFunctionPrototype,
128
+ toStringTagSymbol,
129
+ "GeneratorFunction"
130
+ );
131
+
132
+ // Helper for defining the .next, .throw, and .return methods of the
133
+ // Iterator interface in terms of a single ._invoke method.
134
+ function defineIteratorMethods(prototype) {
135
+ ["next", "throw", "return"].forEach(function(method) {
136
+ define(prototype, method, function(arg) {
137
+ return this._invoke(method, arg);
138
+ });
139
+ });
140
+ }
141
+
142
+ exports.isGeneratorFunction = function(genFun) {
143
+ var ctor = typeof genFun === "function" && genFun.constructor;
144
+ return ctor
145
+ ? ctor === GeneratorFunction ||
146
+ // For the native GeneratorFunction constructor, the best we can
147
+ // do is to check its .name property.
148
+ (ctor.displayName || ctor.name) === "GeneratorFunction"
149
+ : false;
150
+ };
151
+
152
+ exports.mark = function(genFun) {
153
+ if (Object.setPrototypeOf) {
154
+ Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
155
+ } else {
156
+ genFun.__proto__ = GeneratorFunctionPrototype;
157
+ define(genFun, toStringTagSymbol, "GeneratorFunction");
158
+ }
159
+ genFun.prototype = Object.create(Gp);
160
+ return genFun;
161
+ };
162
+
163
+ // Within the body of any async function, `await x` is transformed to
164
+ // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
165
+ // `hasOwn.call(value, "__await")` to determine if the yielded value is
166
+ // meant to be awaited.
167
+ exports.awrap = function(arg) {
168
+ return { __await: arg };
169
+ };
170
+
171
+ function AsyncIterator(generator, PromiseImpl) {
172
+ function invoke(method, arg, resolve, reject) {
173
+ var record = tryCatch(generator[method], generator, arg);
174
+ if (record.type === "throw") {
175
+ reject(record.arg);
176
+ } else {
177
+ var result = record.arg;
178
+ var value = result.value;
179
+ if (value &&
180
+ typeof value === "object" &&
181
+ hasOwn.call(value, "__await")) {
182
+ return PromiseImpl.resolve(value.__await).then(function(value) {
183
+ invoke("next", value, resolve, reject);
184
+ }, function(err) {
185
+ invoke("throw", err, resolve, reject);
186
+ });
187
+ }
188
+
189
+ return PromiseImpl.resolve(value).then(function(unwrapped) {
190
+ // When a yielded Promise is resolved, its final value becomes
191
+ // the .value of the Promise<{value,done}> result for the
192
+ // current iteration.
193
+ result.value = unwrapped;
194
+ resolve(result);
195
+ }, function(error) {
196
+ // If a rejected Promise was yielded, throw the rejection back
197
+ // into the async generator function so it can be handled there.
198
+ return invoke("throw", error, resolve, reject);
199
+ });
200
+ }
201
+ }
202
+
203
+ var previousPromise;
204
+
205
+ function enqueue(method, arg) {
206
+ function callInvokeWithMethodAndArg() {
207
+ return new PromiseImpl(function(resolve, reject) {
208
+ invoke(method, arg, resolve, reject);
209
+ });
210
+ }
211
+
212
+ return previousPromise =
213
+ // If enqueue has been called before, then we want to wait until
214
+ // all previous Promises have been resolved before calling invoke,
215
+ // so that results are always delivered in the correct order. If
216
+ // enqueue has not been called before, then it is important to
217
+ // call invoke immediately, without waiting on a callback to fire,
218
+ // so that the async generator function has the opportunity to do
219
+ // any necessary setup in a predictable way. This predictability
220
+ // is why the Promise constructor synchronously invokes its
221
+ // executor callback, and why async functions synchronously
222
+ // execute code before the first await. Since we implement simple
223
+ // async functions in terms of async generators, it is especially
224
+ // important to get this right, even though it requires care.
225
+ previousPromise ? previousPromise.then(
226
+ callInvokeWithMethodAndArg,
227
+ // Avoid propagating failures to Promises returned by later
228
+ // invocations of the iterator.
229
+ callInvokeWithMethodAndArg
230
+ ) : callInvokeWithMethodAndArg();
231
+ }
232
+
233
+ // Define the unified helper method that is used to implement .next,
234
+ // .throw, and .return (see defineIteratorMethods).
235
+ this._invoke = enqueue;
236
+ }
237
+
238
+ defineIteratorMethods(AsyncIterator.prototype);
239
+ define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
240
+ return this;
241
+ });
242
+ exports.AsyncIterator = AsyncIterator;
243
+
244
+ // Note that simple async functions are implemented on top of
245
+ // AsyncIterator objects; they just return a Promise for the value of
246
+ // the final result produced by the iterator.
247
+ exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
248
+ if (PromiseImpl === void 0) PromiseImpl = Promise;
249
+
250
+ var iter = new AsyncIterator(
251
+ wrap(innerFn, outerFn, self, tryLocsList),
252
+ PromiseImpl
253
+ );
254
+
255
+ return exports.isGeneratorFunction(outerFn)
256
+ ? iter // If outerFn is a generator, return the full iterator.
257
+ : iter.next().then(function(result) {
258
+ return result.done ? result.value : iter.next();
259
+ });
260
+ };
261
+
262
+ function makeInvokeMethod(innerFn, self, context) {
263
+ var state = GenStateSuspendedStart;
264
+
265
+ return function invoke(method, arg) {
266
+ if (state === GenStateExecuting) {
267
+ throw new Error("Generator is already running");
268
+ }
269
+
270
+ if (state === GenStateCompleted) {
271
+ if (method === "throw") {
272
+ throw arg;
273
+ }
274
+
275
+ // Be forgiving, per 25.3.3.3.3 of the spec:
276
+ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
277
+ return doneResult();
278
+ }
279
+
280
+ context.method = method;
281
+ context.arg = arg;
282
+
283
+ while (true) {
284
+ var delegate = context.delegate;
285
+ if (delegate) {
286
+ var delegateResult = maybeInvokeDelegate(delegate, context);
287
+ if (delegateResult) {
288
+ if (delegateResult === ContinueSentinel) continue;
289
+ return delegateResult;
290
+ }
291
+ }
292
+
293
+ if (context.method === "next") {
294
+ // Setting context._sent for legacy support of Babel's
295
+ // function.sent implementation.
296
+ context.sent = context._sent = context.arg;
297
+
298
+ } else if (context.method === "throw") {
299
+ if (state === GenStateSuspendedStart) {
300
+ state = GenStateCompleted;
301
+ throw context.arg;
302
+ }
303
+
304
+ context.dispatchException(context.arg);
305
+
306
+ } else if (context.method === "return") {
307
+ context.abrupt("return", context.arg);
308
+ }
309
+
310
+ state = GenStateExecuting;
311
+
312
+ var record = tryCatch(innerFn, self, context);
313
+ if (record.type === "normal") {
314
+ // If an exception is thrown from innerFn, we leave state ===
315
+ // GenStateExecuting and loop back for another invocation.
316
+ state = context.done
317
+ ? GenStateCompleted
318
+ : GenStateSuspendedYield;
319
+
320
+ if (record.arg === ContinueSentinel) {
321
+ continue;
322
+ }
323
+
324
+ return {
325
+ value: record.arg,
326
+ done: context.done
327
+ };
328
+
329
+ } else if (record.type === "throw") {
330
+ state = GenStateCompleted;
331
+ // Dispatch the exception by looping back around to the
332
+ // context.dispatchException(context.arg) call above.
333
+ context.method = "throw";
334
+ context.arg = record.arg;
335
+ }
336
+ }
337
+ };
338
+ }
339
+
340
+ // Call delegate.iterator[context.method](context.arg) and handle the
341
+ // result, either by returning a { value, done } result from the
342
+ // delegate iterator, or by modifying context.method and context.arg,
343
+ // setting context.delegate to null, and returning the ContinueSentinel.
344
+ function maybeInvokeDelegate(delegate, context) {
345
+ var method = delegate.iterator[context.method];
346
+ if (method === undefined) {
347
+ // A .throw or .return when the delegate iterator has no .throw
348
+ // method always terminates the yield* loop.
349
+ context.delegate = null;
350
+
351
+ if (context.method === "throw") {
352
+ // Note: ["return"] must be used for ES3 parsing compatibility.
353
+ if (delegate.iterator["return"]) {
354
+ // If the delegate iterator has a return method, give it a
355
+ // chance to clean up.
356
+ context.method = "return";
357
+ context.arg = undefined;
358
+ maybeInvokeDelegate(delegate, context);
359
+
360
+ if (context.method === "throw") {
361
+ // If maybeInvokeDelegate(context) changed context.method from
362
+ // "return" to "throw", let that override the TypeError below.
363
+ return ContinueSentinel;
364
+ }
365
+ }
366
+
367
+ context.method = "throw";
368
+ context.arg = new TypeError(
369
+ "The iterator does not provide a 'throw' method");
370
+ }
371
+
372
+ return ContinueSentinel;
373
+ }
374
+
375
+ var record = tryCatch(method, delegate.iterator, context.arg);
376
+
377
+ if (record.type === "throw") {
378
+ context.method = "throw";
379
+ context.arg = record.arg;
380
+ context.delegate = null;
381
+ return ContinueSentinel;
382
+ }
383
+
384
+ var info = record.arg;
385
+
386
+ if (! info) {
387
+ context.method = "throw";
388
+ context.arg = new TypeError("iterator result is not an object");
389
+ context.delegate = null;
390
+ return ContinueSentinel;
391
+ }
392
+
393
+ if (info.done) {
394
+ // Assign the result of the finished delegate to the temporary
395
+ // variable specified by delegate.resultName (see delegateYield).
396
+ context[delegate.resultName] = info.value;
397
+
398
+ // Resume execution at the desired location (see delegateYield).
399
+ context.next = delegate.nextLoc;
400
+
401
+ // If context.method was "throw" but the delegate handled the
402
+ // exception, let the outer generator proceed normally. If
403
+ // context.method was "next", forget context.arg since it has been
404
+ // "consumed" by the delegate iterator. If context.method was
405
+ // "return", allow the original .return call to continue in the
406
+ // outer generator.
407
+ if (context.method !== "return") {
408
+ context.method = "next";
409
+ context.arg = undefined;
410
+ }
411
+
412
+ } else {
413
+ // Re-yield the result returned by the delegate method.
414
+ return info;
415
+ }
416
+
417
+ // The delegate iterator is finished, so forget it and continue with
418
+ // the outer generator.
419
+ context.delegate = null;
420
+ return ContinueSentinel;
421
+ }
422
+
423
+ // Define Generator.prototype.{next,throw,return} in terms of the
424
+ // unified ._invoke helper method.
425
+ defineIteratorMethods(Gp);
426
+
427
+ define(Gp, toStringTagSymbol, "Generator");
428
+
429
+ // A Generator should always return itself as the iterator object when the
430
+ // @@iterator function is called on it. Some browsers' implementations of the
431
+ // iterator prototype chain incorrectly implement this, causing the Generator
432
+ // object to not be returned from this call. This ensures that doesn't happen.
433
+ // See https://github.com/facebook/regenerator/issues/274 for more details.
434
+ define(Gp, iteratorSymbol, function() {
435
+ return this;
436
+ });
437
+
438
+ define(Gp, "toString", function() {
439
+ return "[object Generator]";
440
+ });
441
+
442
+ function pushTryEntry(locs) {
443
+ var entry = { tryLoc: locs[0] };
444
+
445
+ if (1 in locs) {
446
+ entry.catchLoc = locs[1];
447
+ }
448
+
449
+ if (2 in locs) {
450
+ entry.finallyLoc = locs[2];
451
+ entry.afterLoc = locs[3];
452
+ }
453
+
454
+ this.tryEntries.push(entry);
455
+ }
456
+
457
+ function resetTryEntry(entry) {
458
+ var record = entry.completion || {};
459
+ record.type = "normal";
460
+ delete record.arg;
461
+ entry.completion = record;
462
+ }
463
+
464
+ function Context(tryLocsList) {
465
+ // The root entry object (effectively a try statement without a catch
466
+ // or a finally block) gives us a place to store values thrown from
467
+ // locations where there is no enclosing try statement.
468
+ this.tryEntries = [{ tryLoc: "root" }];
469
+ tryLocsList.forEach(pushTryEntry, this);
470
+ this.reset(true);
471
+ }
472
+
473
+ exports.keys = function(object) {
474
+ var keys = [];
475
+ for (var key in object) {
476
+ keys.push(key);
477
+ }
478
+ keys.reverse();
479
+
480
+ // Rather than returning an object with a next method, we keep
481
+ // things simple and return the next function itself.
482
+ return function next() {
483
+ while (keys.length) {
484
+ var key = keys.pop();
485
+ if (key in object) {
486
+ next.value = key;
487
+ next.done = false;
488
+ return next;
489
+ }
490
+ }
491
+
492
+ // To avoid creating an additional object, we just hang the .value
493
+ // and .done properties off the next function object itself. This
494
+ // also ensures that the minifier will not anonymize the function.
495
+ next.done = true;
496
+ return next;
497
+ };
498
+ };
499
+
500
+ function values(iterable) {
501
+ if (iterable) {
502
+ var iteratorMethod = iterable[iteratorSymbol];
503
+ if (iteratorMethod) {
504
+ return iteratorMethod.call(iterable);
505
+ }
506
+
507
+ if (typeof iterable.next === "function") {
508
+ return iterable;
509
+ }
510
+
511
+ if (!isNaN(iterable.length)) {
512
+ var i = -1, next = function next() {
513
+ while (++i < iterable.length) {
514
+ if (hasOwn.call(iterable, i)) {
515
+ next.value = iterable[i];
516
+ next.done = false;
517
+ return next;
518
+ }
519
+ }
520
+
521
+ next.value = undefined;
522
+ next.done = true;
523
+
524
+ return next;
525
+ };
526
+
527
+ return next.next = next;
528
+ }
529
+ }
530
+
531
+ // Return an iterator with no values.
532
+ return { next: doneResult };
533
+ }
534
+ exports.values = values;
535
+
536
+ function doneResult() {
537
+ return { value: undefined, done: true };
538
+ }
539
+
540
+ Context.prototype = {
541
+ constructor: Context,
542
+
543
+ reset: function(skipTempReset) {
544
+ this.prev = 0;
545
+ this.next = 0;
546
+ // Resetting context._sent for legacy support of Babel's
547
+ // function.sent implementation.
548
+ this.sent = this._sent = undefined;
549
+ this.done = false;
550
+ this.delegate = null;
551
+
552
+ this.method = "next";
553
+ this.arg = undefined;
554
+
555
+ this.tryEntries.forEach(resetTryEntry);
556
+
557
+ if (!skipTempReset) {
558
+ for (var name in this) {
559
+ // Not sure about the optimal order of these conditions:
560
+ if (name.charAt(0) === "t" &&
561
+ hasOwn.call(this, name) &&
562
+ !isNaN(+name.slice(1))) {
563
+ this[name] = undefined;
564
+ }
565
+ }
566
+ }
567
+ },
568
+
569
+ stop: function() {
570
+ this.done = true;
571
+
572
+ var rootEntry = this.tryEntries[0];
573
+ var rootRecord = rootEntry.completion;
574
+ if (rootRecord.type === "throw") {
575
+ throw rootRecord.arg;
576
+ }
577
+
578
+ return this.rval;
579
+ },
580
+
581
+ dispatchException: function(exception) {
582
+ if (this.done) {
583
+ throw exception;
584
+ }
585
+
586
+ var context = this;
587
+ function handle(loc, caught) {
588
+ record.type = "throw";
589
+ record.arg = exception;
590
+ context.next = loc;
591
+
592
+ if (caught) {
593
+ // If the dispatched exception was caught by a catch block,
594
+ // then let that catch block handle the exception normally.
595
+ context.method = "next";
596
+ context.arg = undefined;
597
+ }
598
+
599
+ return !! caught;
600
+ }
601
+
602
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
603
+ var entry = this.tryEntries[i];
604
+ var record = entry.completion;
605
+
606
+ if (entry.tryLoc === "root") {
607
+ // Exception thrown outside of any try block that could handle
608
+ // it, so set the completion value of the entire function to
609
+ // throw the exception.
610
+ return handle("end");
611
+ }
612
+
613
+ if (entry.tryLoc <= this.prev) {
614
+ var hasCatch = hasOwn.call(entry, "catchLoc");
615
+ var hasFinally = hasOwn.call(entry, "finallyLoc");
616
+
617
+ if (hasCatch && hasFinally) {
618
+ if (this.prev < entry.catchLoc) {
619
+ return handle(entry.catchLoc, true);
620
+ } else if (this.prev < entry.finallyLoc) {
621
+ return handle(entry.finallyLoc);
622
+ }
623
+
624
+ } else if (hasCatch) {
625
+ if (this.prev < entry.catchLoc) {
626
+ return handle(entry.catchLoc, true);
627
+ }
628
+
629
+ } else if (hasFinally) {
630
+ if (this.prev < entry.finallyLoc) {
631
+ return handle(entry.finallyLoc);
632
+ }
633
+
634
+ } else {
635
+ throw new Error("try statement without catch or finally");
636
+ }
637
+ }
638
+ }
639
+ },
640
+
641
+ abrupt: function(type, arg) {
642
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
643
+ var entry = this.tryEntries[i];
644
+ if (entry.tryLoc <= this.prev &&
645
+ hasOwn.call(entry, "finallyLoc") &&
646
+ this.prev < entry.finallyLoc) {
647
+ var finallyEntry = entry;
648
+ break;
649
+ }
650
+ }
651
+
652
+ if (finallyEntry &&
653
+ (type === "break" ||
654
+ type === "continue") &&
655
+ finallyEntry.tryLoc <= arg &&
656
+ arg <= finallyEntry.finallyLoc) {
657
+ // Ignore the finally entry if control is not jumping to a
658
+ // location outside the try/catch block.
659
+ finallyEntry = null;
660
+ }
661
+
662
+ var record = finallyEntry ? finallyEntry.completion : {};
663
+ record.type = type;
664
+ record.arg = arg;
665
+
666
+ if (finallyEntry) {
667
+ this.method = "next";
668
+ this.next = finallyEntry.finallyLoc;
669
+ return ContinueSentinel;
670
+ }
671
+
672
+ return this.complete(record);
673
+ },
674
+
675
+ complete: function(record, afterLoc) {
676
+ if (record.type === "throw") {
677
+ throw record.arg;
678
+ }
679
+
680
+ if (record.type === "break" ||
681
+ record.type === "continue") {
682
+ this.next = record.arg;
683
+ } else if (record.type === "return") {
684
+ this.rval = this.arg = record.arg;
685
+ this.method = "return";
686
+ this.next = "end";
687
+ } else if (record.type === "normal" && afterLoc) {
688
+ this.next = afterLoc;
689
+ }
690
+
691
+ return ContinueSentinel;
692
+ },
693
+
694
+ finish: function(finallyLoc) {
695
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
696
+ var entry = this.tryEntries[i];
697
+ if (entry.finallyLoc === finallyLoc) {
698
+ this.complete(entry.completion, entry.afterLoc);
699
+ resetTryEntry(entry);
700
+ return ContinueSentinel;
701
+ }
702
+ }
703
+ },
704
+
705
+ "catch": function(tryLoc) {
706
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
707
+ var entry = this.tryEntries[i];
708
+ if (entry.tryLoc === tryLoc) {
709
+ var record = entry.completion;
710
+ if (record.type === "throw") {
711
+ var thrown = record.arg;
712
+ resetTryEntry(entry);
713
+ }
714
+ return thrown;
715
+ }
716
+ }
717
+
718
+ // The context.catch method must only be called with a location
719
+ // argument that corresponds to a known catch block.
720
+ throw new Error("illegal catch attempt");
721
+ },
722
+
723
+ delegateYield: function(iterable, resultName, nextLoc) {
724
+ this.delegate = {
725
+ iterator: values(iterable),
726
+ resultName: resultName,
727
+ nextLoc: nextLoc
728
+ };
729
+
730
+ if (this.method === "next") {
731
+ // Deliberately forget the last sent value so that we don't
732
+ // accidentally pass it on to the delegate.
733
+ this.arg = undefined;
734
+ }
735
+
736
+ return ContinueSentinel;
737
+ }
738
+ };
739
+
740
+ // Regardless of whether this script is executing as a CommonJS module
741
+ // or not, return the runtime object so that we can declare the variable
742
+ // regeneratorRuntime in the outer scope, which allows this module to be
743
+ // injected easily by `bin/regenerator --include-runtime script.js`.
744
+ return exports;
745
+
746
+ }(
747
+ // If this script is executing as a CommonJS module, use module.exports
748
+ // as the regeneratorRuntime namespace. Otherwise create a new empty
749
+ // object. Either way, the resulting object will be used to initialize
750
+ // the regeneratorRuntime variable at the top of this file.
751
+ true ? module.exports : 0
752
+ ));
753
+
754
+ try {
755
+ regeneratorRuntime = runtime;
756
+ } catch (accidentalStrictMode) {
757
+ // This module should not be running in strict mode, so the above
758
+ // assignment should always work unless something is misconfigured. Just
759
+ // in case runtime.js accidentally runs in strict mode, in modern engines
760
+ // we can explicitly access globalThis. In older engines we can escape
761
+ // strict mode using a global Function call. This could conceivably fail
762
+ // if a Content Security Policy forbids using Function, but in that case
763
+ // the proper solution is to fix the accidental strict mode problem. If
764
+ // you've misconfigured your bundler to force strict mode and applied a
765
+ // CSP to forbid Function, and you're not willing to fix either of those
766
+ // problems, please detail your unique predicament in a GitHub issue.
767
+ if (typeof globalThis === "object") {
768
+ globalThis.regeneratorRuntime = runtime;
769
+ } else {
770
+ Function("r", "regeneratorRuntime = r")(runtime);
771
+ }
772
+ }
773
+
774
+
775
+ /***/ }),
776
+
777
+ /***/ 4791:
778
+ /***/ ((module) => {
779
+
780
+ (function (factory) {
781
+ if (true) {
782
+ // Node/CommonJS
783
+ module.exports = factory();
784
+ } else { var glob; }
785
+ }(function (undefined) {
786
+
787
+ 'use strict';
788
+
789
+ /*
790
+ * Fastest md5 implementation around (JKM md5).
791
+ * Credits: Joseph Myers
792
+ *
793
+ * @see http://www.myersdaily.org/joseph/javascript/md5-text.html
794
+ * @see http://jsperf.com/md5-shootout/7
795
+ */
796
+
797
+ /* this function is much faster,
798
+ so if possible we use it. Some IEs
799
+ are the only ones I know of that
800
+ need the idiotic second function,
801
+ generated by an if clause. */
802
+ var add32 = function (a, b) {
803
+ return (a + b) & 0xFFFFFFFF;
804
+ },
805
+ hex_chr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];
806
+
807
+
808
+ function cmn(q, a, b, x, s, t) {
809
+ a = add32(add32(a, q), add32(x, t));
810
+ return add32((a << s) | (a >>> (32 - s)), b);
811
+ }
812
+
813
+ function md5cycle(x, k) {
814
+ var a = x[0],
815
+ b = x[1],
816
+ c = x[2],
817
+ d = x[3];
818
+
819
+ a += (b & c | ~b & d) + k[0] - 680876936 | 0;
820
+ a = (a << 7 | a >>> 25) + b | 0;
821
+ d += (a & b | ~a & c) + k[1] - 389564586 | 0;
822
+ d = (d << 12 | d >>> 20) + a | 0;
823
+ c += (d & a | ~d & b) + k[2] + 606105819 | 0;
824
+ c = (c << 17 | c >>> 15) + d | 0;
825
+ b += (c & d | ~c & a) + k[3] - 1044525330 | 0;
826
+ b = (b << 22 | b >>> 10) + c | 0;
827
+ a += (b & c | ~b & d) + k[4] - 176418897 | 0;
828
+ a = (a << 7 | a >>> 25) + b | 0;
829
+ d += (a & b | ~a & c) + k[5] + 1200080426 | 0;
830
+ d = (d << 12 | d >>> 20) + a | 0;
831
+ c += (d & a | ~d & b) + k[6] - 1473231341 | 0;
832
+ c = (c << 17 | c >>> 15) + d | 0;
833
+ b += (c & d | ~c & a) + k[7] - 45705983 | 0;
834
+ b = (b << 22 | b >>> 10) + c | 0;
835
+ a += (b & c | ~b & d) + k[8] + 1770035416 | 0;
836
+ a = (a << 7 | a >>> 25) + b | 0;
837
+ d += (a & b | ~a & c) + k[9] - 1958414417 | 0;
838
+ d = (d << 12 | d >>> 20) + a | 0;
839
+ c += (d & a | ~d & b) + k[10] - 42063 | 0;
840
+ c = (c << 17 | c >>> 15) + d | 0;
841
+ b += (c & d | ~c & a) + k[11] - 1990404162 | 0;
842
+ b = (b << 22 | b >>> 10) + c | 0;
843
+ a += (b & c | ~b & d) + k[12] + 1804603682 | 0;
844
+ a = (a << 7 | a >>> 25) + b | 0;
845
+ d += (a & b | ~a & c) + k[13] - 40341101 | 0;
846
+ d = (d << 12 | d >>> 20) + a | 0;
847
+ c += (d & a | ~d & b) + k[14] - 1502002290 | 0;
848
+ c = (c << 17 | c >>> 15) + d | 0;
849
+ b += (c & d | ~c & a) + k[15] + 1236535329 | 0;
850
+ b = (b << 22 | b >>> 10) + c | 0;
851
+
852
+ a += (b & d | c & ~d) + k[1] - 165796510 | 0;
853
+ a = (a << 5 | a >>> 27) + b | 0;
854
+ d += (a & c | b & ~c) + k[6] - 1069501632 | 0;
855
+ d = (d << 9 | d >>> 23) + a | 0;
856
+ c += (d & b | a & ~b) + k[11] + 643717713 | 0;
857
+ c = (c << 14 | c >>> 18) + d | 0;
858
+ b += (c & a | d & ~a) + k[0] - 373897302 | 0;
859
+ b = (b << 20 | b >>> 12) + c | 0;
860
+ a += (b & d | c & ~d) + k[5] - 701558691 | 0;
861
+ a = (a << 5 | a >>> 27) + b | 0;
862
+ d += (a & c | b & ~c) + k[10] + 38016083 | 0;
863
+ d = (d << 9 | d >>> 23) + a | 0;
864
+ c += (d & b | a & ~b) + k[15] - 660478335 | 0;
865
+ c = (c << 14 | c >>> 18) + d | 0;
866
+ b += (c & a | d & ~a) + k[4] - 405537848 | 0;
867
+ b = (b << 20 | b >>> 12) + c | 0;
868
+ a += (b & d | c & ~d) + k[9] + 568446438 | 0;
869
+ a = (a << 5 | a >>> 27) + b | 0;
870
+ d += (a & c | b & ~c) + k[14] - 1019803690 | 0;
871
+ d = (d << 9 | d >>> 23) + a | 0;
872
+ c += (d & b | a & ~b) + k[3] - 187363961 | 0;
873
+ c = (c << 14 | c >>> 18) + d | 0;
874
+ b += (c & a | d & ~a) + k[8] + 1163531501 | 0;
875
+ b = (b << 20 | b >>> 12) + c | 0;
876
+ a += (b & d | c & ~d) + k[13] - 1444681467 | 0;
877
+ a = (a << 5 | a >>> 27) + b | 0;
878
+ d += (a & c | b & ~c) + k[2] - 51403784 | 0;
879
+ d = (d << 9 | d >>> 23) + a | 0;
880
+ c += (d & b | a & ~b) + k[7] + 1735328473 | 0;
881
+ c = (c << 14 | c >>> 18) + d | 0;
882
+ b += (c & a | d & ~a) + k[12] - 1926607734 | 0;
883
+ b = (b << 20 | b >>> 12) + c | 0;
884
+
885
+ a += (b ^ c ^ d) + k[5] - 378558 | 0;
886
+ a = (a << 4 | a >>> 28) + b | 0;
887
+ d += (a ^ b ^ c) + k[8] - 2022574463 | 0;
888
+ d = (d << 11 | d >>> 21) + a | 0;
889
+ c += (d ^ a ^ b) + k[11] + 1839030562 | 0;
890
+ c = (c << 16 | c >>> 16) + d | 0;
891
+ b += (c ^ d ^ a) + k[14] - 35309556 | 0;
892
+ b = (b << 23 | b >>> 9) + c | 0;
893
+ a += (b ^ c ^ d) + k[1] - 1530992060 | 0;
894
+ a = (a << 4 | a >>> 28) + b | 0;
895
+ d += (a ^ b ^ c) + k[4] + 1272893353 | 0;
896
+ d = (d << 11 | d >>> 21) + a | 0;
897
+ c += (d ^ a ^ b) + k[7] - 155497632 | 0;
898
+ c = (c << 16 | c >>> 16) + d | 0;
899
+ b += (c ^ d ^ a) + k[10] - 1094730640 | 0;
900
+ b = (b << 23 | b >>> 9) + c | 0;
901
+ a += (b ^ c ^ d) + k[13] + 681279174 | 0;
902
+ a = (a << 4 | a >>> 28) + b | 0;
903
+ d += (a ^ b ^ c) + k[0] - 358537222 | 0;
904
+ d = (d << 11 | d >>> 21) + a | 0;
905
+ c += (d ^ a ^ b) + k[3] - 722521979 | 0;
906
+ c = (c << 16 | c >>> 16) + d | 0;
907
+ b += (c ^ d ^ a) + k[6] + 76029189 | 0;
908
+ b = (b << 23 | b >>> 9) + c | 0;
909
+ a += (b ^ c ^ d) + k[9] - 640364487 | 0;
910
+ a = (a << 4 | a >>> 28) + b | 0;
911
+ d += (a ^ b ^ c) + k[12] - 421815835 | 0;
912
+ d = (d << 11 | d >>> 21) + a | 0;
913
+ c += (d ^ a ^ b) + k[15] + 530742520 | 0;
914
+ c = (c << 16 | c >>> 16) + d | 0;
915
+ b += (c ^ d ^ a) + k[2] - 995338651 | 0;
916
+ b = (b << 23 | b >>> 9) + c | 0;
917
+
918
+ a += (c ^ (b | ~d)) + k[0] - 198630844 | 0;
919
+ a = (a << 6 | a >>> 26) + b | 0;
920
+ d += (b ^ (a | ~c)) + k[7] + 1126891415 | 0;
921
+ d = (d << 10 | d >>> 22) + a | 0;
922
+ c += (a ^ (d | ~b)) + k[14] - 1416354905 | 0;
923
+ c = (c << 15 | c >>> 17) + d | 0;
924
+ b += (d ^ (c | ~a)) + k[5] - 57434055 | 0;
925
+ b = (b << 21 |b >>> 11) + c | 0;
926
+ a += (c ^ (b | ~d)) + k[12] + 1700485571 | 0;
927
+ a = (a << 6 | a >>> 26) + b | 0;
928
+ d += (b ^ (a | ~c)) + k[3] - 1894986606 | 0;
929
+ d = (d << 10 | d >>> 22) + a | 0;
930
+ c += (a ^ (d | ~b)) + k[10] - 1051523 | 0;
931
+ c = (c << 15 | c >>> 17) + d | 0;
932
+ b += (d ^ (c | ~a)) + k[1] - 2054922799 | 0;
933
+ b = (b << 21 |b >>> 11) + c | 0;
934
+ a += (c ^ (b | ~d)) + k[8] + 1873313359 | 0;
935
+ a = (a << 6 | a >>> 26) + b | 0;
936
+ d += (b ^ (a | ~c)) + k[15] - 30611744 | 0;
937
+ d = (d << 10 | d >>> 22) + a | 0;
938
+ c += (a ^ (d | ~b)) + k[6] - 1560198380 | 0;
939
+ c = (c << 15 | c >>> 17) + d | 0;
940
+ b += (d ^ (c | ~a)) + k[13] + 1309151649 | 0;
941
+ b = (b << 21 |b >>> 11) + c | 0;
942
+ a += (c ^ (b | ~d)) + k[4] - 145523070 | 0;
943
+ a = (a << 6 | a >>> 26) + b | 0;
944
+ d += (b ^ (a | ~c)) + k[11] - 1120210379 | 0;
945
+ d = (d << 10 | d >>> 22) + a | 0;
946
+ c += (a ^ (d | ~b)) + k[2] + 718787259 | 0;
947
+ c = (c << 15 | c >>> 17) + d | 0;
948
+ b += (d ^ (c | ~a)) + k[9] - 343485551 | 0;
949
+ b = (b << 21 | b >>> 11) + c | 0;
950
+
951
+ x[0] = a + x[0] | 0;
952
+ x[1] = b + x[1] | 0;
953
+ x[2] = c + x[2] | 0;
954
+ x[3] = d + x[3] | 0;
955
+ }
956
+
957
+ function md5blk(s) {
958
+ var md5blks = [],
959
+ i; /* Andy King said do it this way. */
960
+
961
+ for (i = 0; i < 64; i += 4) {
962
+ md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);
963
+ }
964
+ return md5blks;
965
+ }
966
+
967
+ function md5blk_array(a) {
968
+ var md5blks = [],
969
+ i; /* Andy King said do it this way. */
970
+
971
+ for (i = 0; i < 64; i += 4) {
972
+ md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24);
973
+ }
974
+ return md5blks;
975
+ }
976
+
977
+ function md51(s) {
978
+ var n = s.length,
979
+ state = [1732584193, -271733879, -1732584194, 271733878],
980
+ i,
981
+ length,
982
+ tail,
983
+ tmp,
984
+ lo,
985
+ hi;
986
+
987
+ for (i = 64; i <= n; i += 64) {
988
+ md5cycle(state, md5blk(s.substring(i - 64, i)));
989
+ }
990
+ s = s.substring(i - 64);
991
+ length = s.length;
992
+ tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
993
+ for (i = 0; i < length; i += 1) {
994
+ tail[i >> 2] |= s.charCodeAt(i) << ((i % 4) << 3);
995
+ }
996
+ tail[i >> 2] |= 0x80 << ((i % 4) << 3);
997
+ if (i > 55) {
998
+ md5cycle(state, tail);
999
+ for (i = 0; i < 16; i += 1) {
1000
+ tail[i] = 0;
1001
+ }
1002
+ }
1003
+
1004
+ // Beware that the final length might not fit in 32 bits so we take care of that
1005
+ tmp = n * 8;
1006
+ tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
1007
+ lo = parseInt(tmp[2], 16);
1008
+ hi = parseInt(tmp[1], 16) || 0;
1009
+
1010
+ tail[14] = lo;
1011
+ tail[15] = hi;
1012
+
1013
+ md5cycle(state, tail);
1014
+ return state;
1015
+ }
1016
+
1017
+ function md51_array(a) {
1018
+ var n = a.length,
1019
+ state = [1732584193, -271733879, -1732584194, 271733878],
1020
+ i,
1021
+ length,
1022
+ tail,
1023
+ tmp,
1024
+ lo,
1025
+ hi;
1026
+
1027
+ for (i = 64; i <= n; i += 64) {
1028
+ md5cycle(state, md5blk_array(a.subarray(i - 64, i)));
1029
+ }
1030
+
1031
+ // Not sure if it is a bug, however IE10 will always produce a sub array of length 1
1032
+ // containing the last element of the parent array if the sub array specified starts
1033
+ // beyond the length of the parent array - weird.
1034
+ // https://connect.microsoft.com/IE/feedback/details/771452/typed-array-subarray-issue
1035
+ a = (i - 64) < n ? a.subarray(i - 64) : new Uint8Array(0);
1036
+
1037
+ length = a.length;
1038
+ tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
1039
+ for (i = 0; i < length; i += 1) {
1040
+ tail[i >> 2] |= a[i] << ((i % 4) << 3);
1041
+ }
1042
+
1043
+ tail[i >> 2] |= 0x80 << ((i % 4) << 3);
1044
+ if (i > 55) {
1045
+ md5cycle(state, tail);
1046
+ for (i = 0; i < 16; i += 1) {
1047
+ tail[i] = 0;
1048
+ }
1049
+ }
1050
+
1051
+ // Beware that the final length might not fit in 32 bits so we take care of that
1052
+ tmp = n * 8;
1053
+ tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
1054
+ lo = parseInt(tmp[2], 16);
1055
+ hi = parseInt(tmp[1], 16) || 0;
1056
+
1057
+ tail[14] = lo;
1058
+ tail[15] = hi;
1059
+
1060
+ md5cycle(state, tail);
1061
+
1062
+ return state;
1063
+ }
1064
+
1065
+ function rhex(n) {
1066
+ var s = '',
1067
+ j;
1068
+ for (j = 0; j < 4; j += 1) {
1069
+ s += hex_chr[(n >> (j * 8 + 4)) & 0x0F] + hex_chr[(n >> (j * 8)) & 0x0F];
1070
+ }
1071
+ return s;
1072
+ }
1073
+
1074
+ function hex(x) {
1075
+ var i;
1076
+ for (i = 0; i < x.length; i += 1) {
1077
+ x[i] = rhex(x[i]);
1078
+ }
1079
+ return x.join('');
1080
+ }
1081
+
1082
+ // In some cases the fast add32 function cannot be used..
1083
+ if (hex(md51('hello')) !== '5d41402abc4b2a76b9719d911017c592') {
1084
+ add32 = function (x, y) {
1085
+ var lsw = (x & 0xFFFF) + (y & 0xFFFF),
1086
+ msw = (x >> 16) + (y >> 16) + (lsw >> 16);
1087
+ return (msw << 16) | (lsw & 0xFFFF);
1088
+ };
1089
+ }
1090
+
1091
+ // ---------------------------------------------------
1092
+
1093
+ /**
1094
+ * ArrayBuffer slice polyfill.
1095
+ *
1096
+ * @see https://github.com/ttaubert/node-arraybuffer-slice
1097
+ */
1098
+
1099
+ if (typeof ArrayBuffer !== 'undefined' && !ArrayBuffer.prototype.slice) {
1100
+ (function () {
1101
+ function clamp(val, length) {
1102
+ val = (val | 0) || 0;
1103
+
1104
+ if (val < 0) {
1105
+ return Math.max(val + length, 0);
1106
+ }
1107
+
1108
+ return Math.min(val, length);
1109
+ }
1110
+
1111
+ ArrayBuffer.prototype.slice = function (from, to) {
1112
+ var length = this.byteLength,
1113
+ begin = clamp(from, length),
1114
+ end = length,
1115
+ num,
1116
+ target,
1117
+ targetArray,
1118
+ sourceArray;
1119
+
1120
+ if (to !== undefined) {
1121
+ end = clamp(to, length);
1122
+ }
1123
+
1124
+ if (begin > end) {
1125
+ return new ArrayBuffer(0);
1126
+ }
1127
+
1128
+ num = end - begin;
1129
+ target = new ArrayBuffer(num);
1130
+ targetArray = new Uint8Array(target);
1131
+
1132
+ sourceArray = new Uint8Array(this, begin, num);
1133
+ targetArray.set(sourceArray);
1134
+
1135
+ return target;
1136
+ };
1137
+ })();
1138
+ }
1139
+
1140
+ // ---------------------------------------------------
1141
+
1142
+ /**
1143
+ * Helpers.
1144
+ */
1145
+
1146
+ function toUtf8(str) {
1147
+ if (/[\u0080-\uFFFF]/.test(str)) {
1148
+ str = unescape(encodeURIComponent(str));
1149
+ }
1150
+
1151
+ return str;
1152
+ }
1153
+
1154
+ function utf8Str2ArrayBuffer(str, returnUInt8Array) {
1155
+ var length = str.length,
1156
+ buff = new ArrayBuffer(length),
1157
+ arr = new Uint8Array(buff),
1158
+ i;
1159
+
1160
+ for (i = 0; i < length; i += 1) {
1161
+ arr[i] = str.charCodeAt(i);
1162
+ }
1163
+
1164
+ return returnUInt8Array ? arr : buff;
1165
+ }
1166
+
1167
+ function arrayBuffer2Utf8Str(buff) {
1168
+ return String.fromCharCode.apply(null, new Uint8Array(buff));
1169
+ }
1170
+
1171
+ function concatenateArrayBuffers(first, second, returnUInt8Array) {
1172
+ var result = new Uint8Array(first.byteLength + second.byteLength);
1173
+
1174
+ result.set(new Uint8Array(first));
1175
+ result.set(new Uint8Array(second), first.byteLength);
1176
+
1177
+ return returnUInt8Array ? result : result.buffer;
1178
+ }
1179
+
1180
+ function hexToBinaryString(hex) {
1181
+ var bytes = [],
1182
+ length = hex.length,
1183
+ x;
1184
+
1185
+ for (x = 0; x < length - 1; x += 2) {
1186
+ bytes.push(parseInt(hex.substr(x, 2), 16));
1187
+ }
1188
+
1189
+ return String.fromCharCode.apply(String, bytes);
1190
+ }
1191
+
1192
+ // ---------------------------------------------------
1193
+
1194
+ /**
1195
+ * SparkMD5 OOP implementation.
1196
+ *
1197
+ * Use this class to perform an incremental md5, otherwise use the
1198
+ * static methods instead.
1199
+ */
1200
+
1201
+ function SparkMD5() {
1202
+ // call reset to init the instance
1203
+ this.reset();
1204
+ }
1205
+
1206
+ /**
1207
+ * Appends a string.
1208
+ * A conversion will be applied if an utf8 string is detected.
1209
+ *
1210
+ * @param {String} str The string to be appended
1211
+ *
1212
+ * @return {SparkMD5} The instance itself
1213
+ */
1214
+ SparkMD5.prototype.append = function (str) {
1215
+ // Converts the string to utf8 bytes if necessary
1216
+ // Then append as binary
1217
+ this.appendBinary(toUtf8(str));
1218
+
1219
+ return this;
1220
+ };
1221
+
1222
+ /**
1223
+ * Appends a binary string.
1224
+ *
1225
+ * @param {String} contents The binary string to be appended
1226
+ *
1227
+ * @return {SparkMD5} The instance itself
1228
+ */
1229
+ SparkMD5.prototype.appendBinary = function (contents) {
1230
+ this._buff += contents;
1231
+ this._length += contents.length;
1232
+
1233
+ var length = this._buff.length,
1234
+ i;
1235
+
1236
+ for (i = 64; i <= length; i += 64) {
1237
+ md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i)));
1238
+ }
1239
+
1240
+ this._buff = this._buff.substring(i - 64);
1241
+
1242
+ return this;
1243
+ };
1244
+
1245
+ /**
1246
+ * Finishes the incremental computation, reseting the internal state and
1247
+ * returning the result.
1248
+ *
1249
+ * @param {Boolean} raw True to get the raw string, false to get the hex string
1250
+ *
1251
+ * @return {String} The result
1252
+ */
1253
+ SparkMD5.prototype.end = function (raw) {
1254
+ var buff = this._buff,
1255
+ length = buff.length,
1256
+ i,
1257
+ tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
1258
+ ret;
1259
+
1260
+ for (i = 0; i < length; i += 1) {
1261
+ tail[i >> 2] |= buff.charCodeAt(i) << ((i % 4) << 3);
1262
+ }
1263
+
1264
+ this._finish(tail, length);
1265
+ ret = hex(this._hash);
1266
+
1267
+ if (raw) {
1268
+ ret = hexToBinaryString(ret);
1269
+ }
1270
+
1271
+ this.reset();
1272
+
1273
+ return ret;
1274
+ };
1275
+
1276
+ /**
1277
+ * Resets the internal state of the computation.
1278
+ *
1279
+ * @return {SparkMD5} The instance itself
1280
+ */
1281
+ SparkMD5.prototype.reset = function () {
1282
+ this._buff = '';
1283
+ this._length = 0;
1284
+ this._hash = [1732584193, -271733879, -1732584194, 271733878];
1285
+
1286
+ return this;
1287
+ };
1288
+
1289
+ /**
1290
+ * Gets the internal state of the computation.
1291
+ *
1292
+ * @return {Object} The state
1293
+ */
1294
+ SparkMD5.prototype.getState = function () {
1295
+ return {
1296
+ buff: this._buff,
1297
+ length: this._length,
1298
+ hash: this._hash.slice()
1299
+ };
1300
+ };
1301
+
1302
+ /**
1303
+ * Gets the internal state of the computation.
1304
+ *
1305
+ * @param {Object} state The state
1306
+ *
1307
+ * @return {SparkMD5} The instance itself
1308
+ */
1309
+ SparkMD5.prototype.setState = function (state) {
1310
+ this._buff = state.buff;
1311
+ this._length = state.length;
1312
+ this._hash = state.hash;
1313
+
1314
+ return this;
1315
+ };
1316
+
1317
+ /**
1318
+ * Releases memory used by the incremental buffer and other additional
1319
+ * resources. If you plan to use the instance again, use reset instead.
1320
+ */
1321
+ SparkMD5.prototype.destroy = function () {
1322
+ delete this._hash;
1323
+ delete this._buff;
1324
+ delete this._length;
1325
+ };
1326
+
1327
+ /**
1328
+ * Finish the final calculation based on the tail.
1329
+ *
1330
+ * @param {Array} tail The tail (will be modified)
1331
+ * @param {Number} length The length of the remaining buffer
1332
+ */
1333
+ SparkMD5.prototype._finish = function (tail, length) {
1334
+ var i = length,
1335
+ tmp,
1336
+ lo,
1337
+ hi;
1338
+
1339
+ tail[i >> 2] |= 0x80 << ((i % 4) << 3);
1340
+ if (i > 55) {
1341
+ md5cycle(this._hash, tail);
1342
+ for (i = 0; i < 16; i += 1) {
1343
+ tail[i] = 0;
1344
+ }
1345
+ }
1346
+
1347
+ // Do the final computation based on the tail and length
1348
+ // Beware that the final length may not fit in 32 bits so we take care of that
1349
+ tmp = this._length * 8;
1350
+ tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
1351
+ lo = parseInt(tmp[2], 16);
1352
+ hi = parseInt(tmp[1], 16) || 0;
1353
+
1354
+ tail[14] = lo;
1355
+ tail[15] = hi;
1356
+ md5cycle(this._hash, tail);
1357
+ };
1358
+
1359
+ /**
1360
+ * Performs the md5 hash on a string.
1361
+ * A conversion will be applied if utf8 string is detected.
1362
+ *
1363
+ * @param {String} str The string
1364
+ * @param {Boolean} [raw] True to get the raw string, false to get the hex string
1365
+ *
1366
+ * @return {String} The result
1367
+ */
1368
+ SparkMD5.hash = function (str, raw) {
1369
+ // Converts the string to utf8 bytes if necessary
1370
+ // Then compute it using the binary function
1371
+ return SparkMD5.hashBinary(toUtf8(str), raw);
1372
+ };
1373
+
1374
+ /**
1375
+ * Performs the md5 hash on a binary string.
1376
+ *
1377
+ * @param {String} content The binary string
1378
+ * @param {Boolean} [raw] True to get the raw string, false to get the hex string
1379
+ *
1380
+ * @return {String} The result
1381
+ */
1382
+ SparkMD5.hashBinary = function (content, raw) {
1383
+ var hash = md51(content),
1384
+ ret = hex(hash);
1385
+
1386
+ return raw ? hexToBinaryString(ret) : ret;
1387
+ };
1388
+
1389
+ // ---------------------------------------------------
1390
+
1391
+ /**
1392
+ * SparkMD5 OOP implementation for array buffers.
1393
+ *
1394
+ * Use this class to perform an incremental md5 ONLY for array buffers.
1395
+ */
1396
+ SparkMD5.ArrayBuffer = function () {
1397
+ // call reset to init the instance
1398
+ this.reset();
1399
+ };
1400
+
1401
+ /**
1402
+ * Appends an array buffer.
1403
+ *
1404
+ * @param {ArrayBuffer} arr The array to be appended
1405
+ *
1406
+ * @return {SparkMD5.ArrayBuffer} The instance itself
1407
+ */
1408
+ SparkMD5.ArrayBuffer.prototype.append = function (arr) {
1409
+ var buff = concatenateArrayBuffers(this._buff.buffer, arr, true),
1410
+ length = buff.length,
1411
+ i;
1412
+
1413
+ this._length += arr.byteLength;
1414
+
1415
+ for (i = 64; i <= length; i += 64) {
1416
+ md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i)));
1417
+ }
1418
+
1419
+ this._buff = (i - 64) < length ? new Uint8Array(buff.buffer.slice(i - 64)) : new Uint8Array(0);
1420
+
1421
+ return this;
1422
+ };
1423
+
1424
+ /**
1425
+ * Finishes the incremental computation, reseting the internal state and
1426
+ * returning the result.
1427
+ *
1428
+ * @param {Boolean} raw True to get the raw string, false to get the hex string
1429
+ *
1430
+ * @return {String} The result
1431
+ */
1432
+ SparkMD5.ArrayBuffer.prototype.end = function (raw) {
1433
+ var buff = this._buff,
1434
+ length = buff.length,
1435
+ tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
1436
+ i,
1437
+ ret;
1438
+
1439
+ for (i = 0; i < length; i += 1) {
1440
+ tail[i >> 2] |= buff[i] << ((i % 4) << 3);
1441
+ }
1442
+
1443
+ this._finish(tail, length);
1444
+ ret = hex(this._hash);
1445
+
1446
+ if (raw) {
1447
+ ret = hexToBinaryString(ret);
1448
+ }
1449
+
1450
+ this.reset();
1451
+
1452
+ return ret;
1453
+ };
1454
+
1455
+ /**
1456
+ * Resets the internal state of the computation.
1457
+ *
1458
+ * @return {SparkMD5.ArrayBuffer} The instance itself
1459
+ */
1460
+ SparkMD5.ArrayBuffer.prototype.reset = function () {
1461
+ this._buff = new Uint8Array(0);
1462
+ this._length = 0;
1463
+ this._hash = [1732584193, -271733879, -1732584194, 271733878];
1464
+
1465
+ return this;
1466
+ };
1467
+
1468
+ /**
1469
+ * Gets the internal state of the computation.
1470
+ *
1471
+ * @return {Object} The state
1472
+ */
1473
+ SparkMD5.ArrayBuffer.prototype.getState = function () {
1474
+ var state = SparkMD5.prototype.getState.call(this);
1475
+
1476
+ // Convert buffer to a string
1477
+ state.buff = arrayBuffer2Utf8Str(state.buff);
1478
+
1479
+ return state;
1480
+ };
1481
+
1482
+ /**
1483
+ * Gets the internal state of the computation.
1484
+ *
1485
+ * @param {Object} state The state
1486
+ *
1487
+ * @return {SparkMD5.ArrayBuffer} The instance itself
1488
+ */
1489
+ SparkMD5.ArrayBuffer.prototype.setState = function (state) {
1490
+ // Convert string to buffer
1491
+ state.buff = utf8Str2ArrayBuffer(state.buff, true);
1492
+
1493
+ return SparkMD5.prototype.setState.call(this, state);
1494
+ };
1495
+
1496
+ SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;
1497
+
1498
+ SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;
1499
+
1500
+ /**
1501
+ * Performs the md5 hash on an array buffer.
1502
+ *
1503
+ * @param {ArrayBuffer} arr The array buffer
1504
+ * @param {Boolean} [raw] True to get the raw string, false to get the hex one
1505
+ *
1506
+ * @return {String} The result
1507
+ */
1508
+ SparkMD5.ArrayBuffer.hash = function (arr, raw) {
1509
+ var hash = md51_array(new Uint8Array(arr)),
1510
+ ret = hex(hash);
1511
+
1512
+ return raw ? hexToBinaryString(ret) : ret;
1513
+ };
1514
+
1515
+ return SparkMD5;
1516
+ }));
1517
+
1518
+
1519
+ /***/ })
1520
+
1521
+ /******/ });
1522
+ /************************************************************************/
1523
+ /******/ // The module cache
1524
+ /******/ var __webpack_module_cache__ = {};
1525
+ /******/
1526
+ /******/ // The require function
1527
+ /******/ function __webpack_require__(moduleId) {
1528
+ /******/ // Check if module is in cache
1529
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
1530
+ /******/ if (cachedModule !== undefined) {
1531
+ /******/ return cachedModule.exports;
1532
+ /******/ }
1533
+ /******/ // Create a new module (and put it into the cache)
1534
+ /******/ var module = __webpack_module_cache__[moduleId] = {
1535
+ /******/ // no module.id needed
1536
+ /******/ // no module.loaded needed
1537
+ /******/ exports: {}
1538
+ /******/ };
1539
+ /******/
1540
+ /******/ // Execute the module function
1541
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
1542
+ /******/
1543
+ /******/ // Return the exports of the module
1544
+ /******/ return module.exports;
1545
+ /******/ }
1546
+ /******/
1547
+ /************************************************************************/
1548
+ /******/ /* webpack/runtime/compat get default export */
1549
+ /******/ (() => {
1550
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
1551
+ /******/ __webpack_require__.n = (module) => {
1552
+ /******/ var getter = module && module.__esModule ?
1553
+ /******/ () => (module['default']) :
1554
+ /******/ () => (module);
1555
+ /******/ __webpack_require__.d(getter, { a: getter });
1556
+ /******/ return getter;
1557
+ /******/ };
1558
+ /******/ })();
1559
+ /******/
1560
+ /******/ /* webpack/runtime/define property getters */
1561
+ /******/ (() => {
1562
+ /******/ // define getter functions for harmony exports
1563
+ /******/ __webpack_require__.d = (exports, definition) => {
1564
+ /******/ for(var key in definition) {
1565
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
1566
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
1567
+ /******/ }
1568
+ /******/ }
1569
+ /******/ };
1570
+ /******/ })();
1571
+ /******/
1572
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
1573
+ /******/ (() => {
1574
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
1575
+ /******/ })();
1576
+ /******/
1577
+ /************************************************************************/
1578
+ var __webpack_exports__ = {};
1579
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
1580
+ (() => {
1581
+
1582
+ // EXPORTS
1583
+ __webpack_require__.d(__webpack_exports__, {
1584
+ "Z": () => (/* binding */ src)
1585
+ });
1586
+
1587
+ ;// CONCATENATED MODULE: external "../shared"
1588
+ var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1589
+ var y = x => () => x
1590
+ const external_shared_namespaceObject = x({ ["classes"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.classes, ["isNullOrUndef"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.isNullOrUndef, ["withInstall"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.withInstall });
1591
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
1592
+ function _defineProperty(obj, key, value) {
1593
+ if (key in obj) {
1594
+ Object.defineProperty(obj, key, {
1595
+ value: value,
1596
+ enumerable: true,
1597
+ configurable: true,
1598
+ writable: true
1599
+ });
1600
+ } else {
1601
+ obj[key] = value;
1602
+ }
1603
+
1604
+ return obj;
1605
+ }
1606
+ ;// CONCATENATED MODULE: external "vue"
1607
+ var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1608
+ var external_vue_y = x => () => x
1609
+ const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["TransitionGroup"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.TransitionGroup, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["h"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.h, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["shallowRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.shallowRef, ["toRefs"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRefs, ["vShow"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.vShow, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
1610
+ // EXTERNAL MODULE: ../../node_modules/@babel/runtime/regenerator/index.js
1611
+ var regenerator = __webpack_require__(7162);
1612
+ var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
1613
+ ;// CONCATENATED MODULE: ../../node_modules/tslib/tslib.es6.js
1614
+ /******************************************************************************
1615
+ Copyright (c) Microsoft Corporation.
1616
+
1617
+ Permission to use, copy, modify, and/or distribute this software for any
1618
+ purpose with or without fee is hereby granted.
1619
+
1620
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1621
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1622
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1623
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1624
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1625
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1626
+ PERFORMANCE OF THIS SOFTWARE.
1627
+ ***************************************************************************** */
1628
+ /* global Reflect, Promise */
1629
+
1630
+ var extendStatics = function(d, b) {
1631
+ extendStatics = Object.setPrototypeOf ||
1632
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
1633
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
1634
+ return extendStatics(d, b);
1635
+ };
1636
+
1637
+ function __extends(d, b) {
1638
+ if (typeof b !== "function" && b !== null)
1639
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
1640
+ extendStatics(d, b);
1641
+ function __() { this.constructor = d; }
1642
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1643
+ }
1644
+
1645
+ var __assign = function() {
1646
+ __assign = Object.assign || function __assign(t) {
1647
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
1648
+ s = arguments[i];
1649
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
1650
+ }
1651
+ return t;
1652
+ }
1653
+ return __assign.apply(this, arguments);
1654
+ }
1655
+
1656
+ function __rest(s, e) {
1657
+ var t = {};
1658
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1659
+ t[p] = s[p];
1660
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
1661
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1662
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1663
+ t[p[i]] = s[p[i]];
1664
+ }
1665
+ return t;
1666
+ }
1667
+
1668
+ function __decorate(decorators, target, key, desc) {
1669
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1670
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1671
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1672
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1673
+ }
1674
+
1675
+ function __param(paramIndex, decorator) {
1676
+ return function (target, key) { decorator(target, key, paramIndex); }
1677
+ }
1678
+
1679
+ function __metadata(metadataKey, metadataValue) {
1680
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
1681
+ }
1682
+
1683
+ function __awaiter(thisArg, _arguments, P, generator) {
1684
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1685
+ return new (P || (P = Promise))(function (resolve, reject) {
1686
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1687
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1688
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1689
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
1690
+ });
1691
+ }
1692
+
1693
+ function __generator(thisArg, body) {
1694
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
1695
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
1696
+ function verb(n) { return function (v) { return step([n, v]); }; }
1697
+ function step(op) {
1698
+ if (f) throw new TypeError("Generator is already executing.");
1699
+ while (_) try {
1700
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
1701
+ if (y = 0, t) op = [op[0] & 2, t.value];
1702
+ switch (op[0]) {
1703
+ case 0: case 1: t = op; break;
1704
+ case 4: _.label++; return { value: op[1], done: false };
1705
+ case 5: _.label++; y = op[1]; op = [0]; continue;
1706
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
1707
+ default:
1708
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
1709
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
1710
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
1711
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
1712
+ if (t[2]) _.ops.pop();
1713
+ _.trys.pop(); continue;
1714
+ }
1715
+ op = body.call(thisArg, _);
1716
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
1717
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
1718
+ }
1719
+ }
1720
+
1721
+ var __createBinding = Object.create ? (function(o, m, k, k2) {
1722
+ if (k2 === undefined) k2 = k;
1723
+ var desc = Object.getOwnPropertyDescriptor(m, k);
1724
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1725
+ desc = { enumerable: true, get: function() { return m[k]; } };
1726
+ }
1727
+ Object.defineProperty(o, k2, desc);
1728
+ }) : (function(o, m, k, k2) {
1729
+ if (k2 === undefined) k2 = k;
1730
+ o[k2] = m[k];
1731
+ });
1732
+
1733
+ function __exportStar(m, o) {
1734
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
1735
+ }
1736
+
1737
+ function __values(o) {
1738
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
1739
+ if (m) return m.call(o);
1740
+ if (o && typeof o.length === "number") return {
1741
+ next: function () {
1742
+ if (o && i >= o.length) o = void 0;
1743
+ return { value: o && o[i++], done: !o };
1744
+ }
1745
+ };
1746
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
1747
+ }
1748
+
1749
+ function __read(o, n) {
1750
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
1751
+ if (!m) return o;
1752
+ var i = m.call(o), r, ar = [], e;
1753
+ try {
1754
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
1755
+ }
1756
+ catch (error) { e = { error: error }; }
1757
+ finally {
1758
+ try {
1759
+ if (r && !r.done && (m = i["return"])) m.call(i);
1760
+ }
1761
+ finally { if (e) throw e.error; }
1762
+ }
1763
+ return ar;
1764
+ }
1765
+
1766
+ /** @deprecated */
1767
+ function __spread() {
1768
+ for (var ar = [], i = 0; i < arguments.length; i++)
1769
+ ar = ar.concat(__read(arguments[i]));
1770
+ return ar;
1771
+ }
1772
+
1773
+ /** @deprecated */
1774
+ function __spreadArrays() {
1775
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
1776
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
1777
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
1778
+ r[k] = a[j];
1779
+ return r;
1780
+ }
1781
+
1782
+ function __spreadArray(to, from, pack) {
1783
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
1784
+ if (ar || !(i in from)) {
1785
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
1786
+ ar[i] = from[i];
1787
+ }
1788
+ }
1789
+ return to.concat(ar || Array.prototype.slice.call(from));
1790
+ }
1791
+
1792
+ function __await(v) {
1793
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
1794
+ }
1795
+
1796
+ function __asyncGenerator(thisArg, _arguments, generator) {
1797
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
1798
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
1799
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
1800
+ function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
1801
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
1802
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
1803
+ function fulfill(value) { resume("next", value); }
1804
+ function reject(value) { resume("throw", value); }
1805
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
1806
+ }
1807
+
1808
+ function __asyncDelegator(o) {
1809
+ var i, p;
1810
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
1811
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
1812
+ }
1813
+
1814
+ function __asyncValues(o) {
1815
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
1816
+ var m = o[Symbol.asyncIterator], i;
1817
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
1818
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
1819
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
1820
+ }
1821
+
1822
+ function __makeTemplateObject(cooked, raw) {
1823
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
1824
+ return cooked;
1825
+ };
1826
+
1827
+ var __setModuleDefault = Object.create ? (function(o, v) {
1828
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
1829
+ }) : function(o, v) {
1830
+ o["default"] = v;
1831
+ };
1832
+
1833
+ function __importStar(mod) {
1834
+ if (mod && mod.__esModule) return mod;
1835
+ var result = {};
1836
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1837
+ __setModuleDefault(result, mod);
1838
+ return result;
1839
+ }
1840
+
1841
+ function __importDefault(mod) {
1842
+ return (mod && mod.__esModule) ? mod : { default: mod };
1843
+ }
1844
+
1845
+ function __classPrivateFieldGet(receiver, state, kind, f) {
1846
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
1847
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
1848
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
1849
+ }
1850
+
1851
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
1852
+ if (kind === "m") throw new TypeError("Private method is not writable");
1853
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
1854
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
1855
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
1856
+ }
1857
+
1858
+ function __classPrivateFieldIn(state, receiver) {
1859
+ if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
1860
+ return typeof state === "function" ? receiver === state : state.has(receiver);
1861
+ }
1862
+
1863
+ ;// CONCATENATED MODULE: ../../packages/upload/src/upload.type.ts
1864
+ /*
1865
+ * Tencent is pleased to support the open source community by making
1866
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1867
+ *
1868
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1869
+ *
1870
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1871
+ *
1872
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1873
+ *
1874
+ * ---------------------------------------------------
1875
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1876
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1877
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1878
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1879
+ *
1880
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1881
+ * the Software.
1882
+ *
1883
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1884
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1885
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1886
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1887
+ * IN THE SOFTWARE.
1888
+ */
1889
+ var CLASS_PREFIX = 'bk-upload';
1890
+ var EThemes;
1891
+
1892
+ (function (EThemes) {
1893
+ EThemes["BUTTON"] = "button";
1894
+ EThemes["DRAGGABLE"] = "draggable";
1895
+ EThemes["PICTURE"] = "picture";
1896
+ })(EThemes || (EThemes = {}));
1897
+
1898
+ var EUploadStatus;
1899
+
1900
+ (function (EUploadStatus) {
1901
+ EUploadStatus["NEW"] = "new";
1902
+ EUploadStatus["UPLOADING"] = "uploading";
1903
+ EUploadStatus["SUCCESS"] = "success";
1904
+ EUploadStatus["FAIL"] = "fail";
1905
+ })(EUploadStatus || (EUploadStatus = {}));
1906
+
1907
+ ;
1908
+ ;
1909
+ ;
1910
+ ;// CONCATENATED MODULE: ../../packages/upload/src/props.ts
1911
+ /*
1912
+ * Tencent is pleased to support the open source community by making
1913
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1914
+ *
1915
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1916
+ *
1917
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1918
+ *
1919
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1920
+ *
1921
+ * ---------------------------------------------------
1922
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1923
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1924
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1925
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1926
+ *
1927
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1928
+ * the Software.
1929
+ *
1930
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1931
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1932
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1933
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1934
+ * IN THE SOFTWARE.
1935
+ */
1936
+
1937
+ var themes = [EThemes.BUTTON, EThemes.DRAGGABLE, EThemes.PICTURE];
1938
+ /* harmony default export */ const props = ({
1939
+ theme: {
1940
+ type: String,
1941
+ "default": 'draggable',
1942
+ validator: function validator(val) {
1943
+ if (!val || themes.includes(val)) {
1944
+ return true;
1945
+ }
1946
+
1947
+ console.error("invalid theme, ".concat(val, ", the theme must be one of \u3010").concat(themes.join(' | '), "\u3011"));
1948
+ return false;
1949
+ }
1950
+ },
1951
+ files: {
1952
+ type: Array,
1953
+ "default": function _default() {
1954
+ return [];
1955
+ }
1956
+ },
1957
+ name: {
1958
+ type: String,
1959
+ "default": 'upload_file'
1960
+ },
1961
+ multiple: {
1962
+ type: Boolean,
1963
+ "default": true
1964
+ },
1965
+ disabled: {
1966
+ type: Boolean,
1967
+ "default": false
1968
+ },
1969
+ autoUpload: {
1970
+ type: Boolean,
1971
+ "default": true
1972
+ },
1973
+ accept: {
1974
+ type: String
1975
+ },
1976
+ delayTime: {
1977
+ type: Number,
1978
+ "default": 0
1979
+ },
1980
+ url: {
1981
+ type: String,
1982
+ required: false
1983
+ },
1984
+ method: {
1985
+ type: String,
1986
+ "default": 'post'
1987
+ },
1988
+ size: {
1989
+ type: [Number, Object],
1990
+ "default": function _default() {
1991
+ return {
1992
+ maxFileSize: 5,
1993
+ maxImgSize: 1
1994
+ };
1995
+ }
1996
+ },
1997
+ handleResCode: {
1998
+ type: Function,
1999
+ "default": function _default(res) {
2000
+ if (res && res.code === 0) {
2001
+ return true;
2002
+ }
2003
+
2004
+ return false;
2005
+ }
2006
+ },
2007
+ headers: {
2008
+ type: Object,
2009
+ "default": function _default() {
2010
+ return {};
2011
+ }
2012
+ },
2013
+ header: {
2014
+ type: [Array, Object],
2015
+ "default": function _default() {
2016
+ return [];
2017
+ }
2018
+ },
2019
+ tip: {
2020
+ type: String,
2021
+ "default": ''
2022
+ },
2023
+ validateName: {
2024
+ type: RegExp
2025
+ },
2026
+ withCredentials: {
2027
+ type: Boolean,
2028
+ "default": false
2029
+ },
2030
+ limit: Number,
2031
+ data: {
2032
+ type: [Array, Object],
2033
+ "default": function _default() {
2034
+ return [];
2035
+ }
2036
+ },
2037
+ formDataAttributes: {
2038
+ type: [Array, Object],
2039
+ "default": function _default() {
2040
+ return [];
2041
+ }
2042
+ },
2043
+ extCls: {
2044
+ type: String,
2045
+ "default": ''
2046
+ },
2047
+ customRequest: Function,
2048
+ beforeUpload: {
2049
+ type: Function
2050
+ },
2051
+ beforeRemove: {
2052
+ type: Function
2053
+ },
2054
+ sliceUpload: {
2055
+ type: Boolean,
2056
+ "default": false
2057
+ },
2058
+ sliceUrl: {
2059
+ type: String,
2060
+ "default": ''
2061
+ },
2062
+ mergeUrl: {
2063
+ type: String,
2064
+ "default": ''
2065
+ },
2066
+ chunkSize: {
2067
+ type: Number,
2068
+ "default": 10
2069
+ }
2070
+ });
2071
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
2072
+ function _arrayWithHoles(arr) {
2073
+ if (Array.isArray(arr)) return arr;
2074
+ }
2075
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
2076
+ function _iterableToArrayLimit(arr, i) {
2077
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
2078
+
2079
+ if (_i == null) return;
2080
+ var _arr = [];
2081
+ var _n = true;
2082
+ var _d = false;
2083
+
2084
+ var _s, _e;
2085
+
2086
+ try {
2087
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
2088
+ _arr.push(_s.value);
2089
+
2090
+ if (i && _arr.length === i) break;
2091
+ }
2092
+ } catch (err) {
2093
+ _d = true;
2094
+ _e = err;
2095
+ } finally {
2096
+ try {
2097
+ if (!_n && _i["return"] != null) _i["return"]();
2098
+ } finally {
2099
+ if (_d) throw _e;
2100
+ }
2101
+ }
2102
+
2103
+ return _arr;
2104
+ }
2105
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
2106
+ function _arrayLikeToArray(arr, len) {
2107
+ if (len == null || len > arr.length) len = arr.length;
2108
+
2109
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
2110
+ arr2[i] = arr[i];
2111
+ }
2112
+
2113
+ return arr2;
2114
+ }
2115
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
2116
+
2117
+ function _unsupportedIterableToArray(o, minLen) {
2118
+ if (!o) return;
2119
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
2120
+ var n = Object.prototype.toString.call(o).slice(8, -1);
2121
+ if (n === "Object" && o.constructor) n = o.constructor.name;
2122
+ if (n === "Map" || n === "Set") return Array.from(o);
2123
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
2124
+ }
2125
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
2126
+ function _nonIterableRest() {
2127
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2128
+ }
2129
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js
2130
+
2131
+
2132
+
2133
+
2134
+ function _slicedToArray(arr, i) {
2135
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
2136
+ }
2137
+ ;// CONCATENATED MODULE: external "../icon"
2138
+ var external_icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
2139
+ var external_icon_y = x => () => x
2140
+ const external_icon_namespaceObject = external_icon_x({ ["ArchiveFill"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.ArchiveFill, ["AudioFill"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.AudioFill, ["Del"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Del, ["Done"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Done, ["ImageFill"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.ImageFill, ["Plus"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Plus, ["RightTurnLine"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.RightTurnLine, ["TextFill"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.TextFill, ["Upload"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Upload, ["VideoFill"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.VideoFill });
2141
+ ;// CONCATENATED MODULE: external "../progress"
2142
+ var external_progress_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
2143
+ var external_progress_y = x => () => x
2144
+ const external_progress_namespaceObject = external_progress_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__progress_ed4d3a99__["default"] });
2145
+ ;// CONCATENATED MODULE: ../../packages/upload/src/upload-list.tsx
2146
+
2147
+
2148
+
2149
+
2150
+ /*
2151
+ * Tencent is pleased to support the open source community by making
2152
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2153
+ *
2154
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2155
+ *
2156
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2157
+ *
2158
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2159
+ *
2160
+ * ---------------------------------------------------
2161
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2162
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2163
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2164
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2165
+ *
2166
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2167
+ * the Software.
2168
+ *
2169
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2170
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2171
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2172
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2173
+ * IN THE SOFTWARE.
2174
+ */
2175
+
2176
+
2177
+
2178
+
2179
+
2180
+
2181
+
2182
+ function _isSlot(s) {
2183
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0,external_vue_namespaceObject.isVNode)(s);
2184
+ }
2185
+
2186
+ /* harmony default export */ const upload_list = ((0,external_vue_namespaceObject.defineComponent)({
2187
+ name: 'UploadList',
2188
+ props: {
2189
+ theme: props.theme,
2190
+ disabled: props.disabled,
2191
+ files: props.files,
2192
+ multiple: props.multiple
2193
+ },
2194
+ emits: ['remove', 'retry'],
2195
+ setup: function setup(props, _ref) {
2196
+ var slots = _ref.slots,
2197
+ emit = _ref.emit;
2198
+
2199
+ var _toRefs = (0,external_vue_namespaceObject.toRefs)(props),
2200
+ theme = _toRefs.theme,
2201
+ disabled = _toRefs.disabled,
2202
+ multiple = _toRefs.multiple;
2203
+
2204
+ var classBlock = "".concat(CLASS_PREFIX, "-list");
2205
+ var isPhotowall = (0,external_vue_namespaceObject.computed)(function () {
2206
+ return theme.value === EThemes.PICTURE;
2207
+ });
2208
+ var isSinglePhoto = (0,external_vue_namespaceObject.computed)(function () {
2209
+ return isPhotowall.value && !multiple.value;
2210
+ });
2211
+ var classNames = (0,external_vue_namespaceObject.computed)(function () {
2212
+ var _classes;
2213
+
2214
+ return (0,external_shared_namespaceObject.classes)((_classes = {}, _defineProperty(_classes, classBlock, true), _defineProperty(_classes, "".concat(classBlock, "--").concat(theme.value), true), _defineProperty(_classes, "".concat(classBlock, "--disabled"), disabled.value), _classes));
2215
+ });
2216
+
2217
+ function formatSize(value) {
2218
+ var uints = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
2219
+ var index = Math.floor(Math.log(value) / Math.log(1024));
2220
+ var size = value / Math.pow(1024, index);
2221
+ return "".concat(size.toFixed(2)).concat(uints[index]);
2222
+ }
2223
+
2224
+ function handleRemove(file, e) {
2225
+ emit('remove', file, e);
2226
+ }
2227
+
2228
+ function handleRetry(file, e) {
2229
+ emit('retry', file, e);
2230
+ }
2231
+
2232
+ var Photowall = function Photowall() {
2233
+ var _slot;
2234
+
2235
+ return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.TransitionGroup, {
2236
+ "name": "".concat(classBlock, "__item")
2237
+ }, _isSlot(_slot = props.files.map(function (file) {
2238
+ var _classes2;
2239
+
2240
+ var classNames = (0,external_shared_namespaceObject.classes)((_classes2 = {}, _defineProperty(_classes2, "".concat(classBlock, "__item"), true), _defineProperty(_classes2, "".concat(classBlock, "__item-picture"), true), _defineProperty(_classes2, "".concat(classBlock, "__item--").concat(file.status), true), _classes2));
2241
+ return (0,external_vue_namespaceObject.createVNode)("li", {
2242
+ "key": file.uid,
2243
+ "class": classNames
2244
+ }, [(slots === null || slots === void 0 ? void 0 : slots.file) ? slots.file({
2245
+ file: file
2246
+ }) : PhotoItem(file)]);
2247
+ })) ? _slot : {
2248
+ "default": function _default() {
2249
+ return [_slot];
2250
+ }
2251
+ });
2252
+ };
2253
+
2254
+ var PhotoItem = function PhotoItem(file) {
2255
+ return [(0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("img", {
2256
+ "src": file.url,
2257
+ "class": "".concat(classBlock, "__picture-item-thumbnail"),
2258
+ "alt": ""
2259
+ }, null), [[external_vue_namespaceObject.vShow, file.status !== 'uploading']]), (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [file.status === 'uploading' && (0,external_vue_namespaceObject.createVNode)(external_progress_namespaceObject["default"], {
2260
+ "class": "".concat(classBlock, "__picture-item-progress"),
2261
+ "type": "circle",
2262
+ "color": "#3a84ff",
2263
+ "bgColor": "#333",
2264
+ "width": 50,
2265
+ "titleStyle": {
2266
+ color: '#fff'
2267
+ },
2268
+ "percent": file.percentage
2269
+ }, null)]), (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [!disabled.value && (0,external_vue_namespaceObject.createVNode)("div", {
2270
+ "class": "".concat(classBlock, "__picture-item-actions")
2271
+ }, [(0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Del, {
2272
+ "class": "action-icon",
2273
+ "onClick": function onClick(e) {
2274
+ return handleRemove(file, e);
2275
+ }
2276
+ }, null)])])];
2277
+ };
2278
+
2279
+ var Normal = function Normal() {
2280
+ var _slot2;
2281
+
2282
+ return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.TransitionGroup, {
2283
+ "name": "".concat(classBlock, "__item")
2284
+ }, _isSlot(_slot2 = props.files.map(function (file) {
2285
+ var _classes3;
2286
+
2287
+ var classNames = (0,external_shared_namespaceObject.classes)((_classes3 = {}, _defineProperty(_classes3, "".concat(classBlock, "__item"), true), _defineProperty(_classes3, "".concat(classBlock, "__item--").concat(file.status), true), _classes3));
2288
+ return (0,external_vue_namespaceObject.createVNode)("li", {
2289
+ "key": file.uid,
2290
+ "class": classNames
2291
+ }, [(slots === null || slots === void 0 ? void 0 : slots.file) ? slots.file({
2292
+ file: file
2293
+ }) : NormalItem(file)]);
2294
+ })) ? _slot2 : {
2295
+ "default": function _default() {
2296
+ return [_slot2];
2297
+ }
2298
+ });
2299
+ };
2300
+
2301
+ var FileIcon = function FileIcon(file) {
2302
+ var _a;
2303
+
2304
+ var rawType = (_a = file === null || file === void 0 ? void 0 : file.raw) === null || _a === void 0 ? void 0 : _a.type;
2305
+
2306
+ var _ref2 = (rawType === null || rawType === void 0 ? void 0 : rawType.split('/')) || '',
2307
+ _ref3 = _slicedToArray(_ref2, 1),
2308
+ type = _ref3[0];
2309
+
2310
+ var iconMap = {
2311
+ text: external_icon_namespaceObject.TextFill,
2312
+ image: external_icon_namespaceObject.ImageFill,
2313
+ application: external_icon_namespaceObject.TextFill,
2314
+ video: external_icon_namespaceObject.VideoFill,
2315
+ audio: external_icon_namespaceObject.AudioFill
2316
+ };
2317
+ var icon = iconMap[type] || external_icon_namespaceObject.TextFill;
2318
+ var zipType = ['application/zip', 'application/rar', 'application/tar', 'application/gz', 'application/x-gzip'];
2319
+
2320
+ if (zipType.includes(rawType)) {
2321
+ icon = external_icon_namespaceObject.ArchiveFill;
2322
+ }
2323
+
2324
+ return (0,external_vue_namespaceObject.h)(icon, {
2325
+ "class": "".concat(classBlock, "__item-file-icon")
2326
+ });
2327
+ };
2328
+
2329
+ var NormalItem = function NormalItem(file) {
2330
+ return [(0,external_vue_namespaceObject.createVNode)("div", {
2331
+ "class": "".concat(classBlock, "__item-icon")
2332
+ }, [file.isPic ? (0,external_vue_namespaceObject.createVNode)("img", {
2333
+ "src": file.url,
2334
+ "class": "".concat(classBlock, "__item-thumbnail"),
2335
+ "alt": ""
2336
+ }, null) : FileIcon(file)]), (0,external_vue_namespaceObject.createVNode)("div", {
2337
+ "class": "".concat(classBlock, "__item-summary")
2338
+ }, [(0,external_vue_namespaceObject.createVNode)("div", {
2339
+ "class": "".concat(classBlock, "__item-name"),
2340
+ "title": file.name
2341
+ }, [file.name]), file.status !== 'uploading' && (0,external_vue_namespaceObject.createVNode)("div", {
2342
+ "class": "".concat(classBlock, "__item-message"),
2343
+ "title": file.statusText
2344
+ }, [file.status === 'success' && (0,external_vue_namespaceObject.createVNode)("span", null, [(0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Done, {
2345
+ "class": "".concat(classBlock, "__item-message-success-icon")
2346
+ }, null), file.statusText || '上传成功']), file.status === 'fail' && (0,external_vue_namespaceObject.createVNode)("span", null, [file.statusText || '上传失败'])]), file.status === 'uploading' && (0,external_vue_namespaceObject.createVNode)(external_progress_namespaceObject["default"], {
2347
+ "class": "".concat(classBlock, "__item-progress"),
2348
+ "showText": false,
2349
+ "percent": file.percentage,
2350
+ "size": "small"
2351
+ }, null), file.status !== 'fail' && (0,external_vue_namespaceObject.createVNode)("div", {
2352
+ "class": "".concat(classBlock, "__item-speed")
2353
+ }, [(0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("span", {
2354
+ "class": "".concat(classBlock, "__item-speed-size")
2355
+ }, [formatSize(file.size)]), [[external_vue_namespaceObject.vShow, file.size]]), (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("span", {
2356
+ "class": "".concat(classBlock, "__item-speed-percentage")
2357
+ }, [file.percentage, (0,external_vue_namespaceObject.createTextVNode)("%")]), [[external_vue_namespaceObject.vShow, file.status === 'uploading']])]), !disabled.value && (0,external_vue_namespaceObject.createVNode)("div", {
2358
+ "class": "".concat(classBlock, "__item-actions")
2359
+ }, [file.status === 'fail' && (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.RightTurnLine, {
2360
+ "class": "".concat(classBlock, "__item-retry-icon"),
2361
+ "onClick": function onClick(e) {
2362
+ return handleRetry(file, e);
2363
+ }
2364
+ }, null), (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Del, {
2365
+ "class": "".concat(classBlock, "__item-del-icon"),
2366
+ "onClick": function onClick(e) {
2367
+ return handleRemove(file, e);
2368
+ }
2369
+ }, null)])])];
2370
+ };
2371
+
2372
+ return function () {
2373
+ var _a;
2374
+
2375
+ return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [isSinglePhoto.value ? (slots === null || slots === void 0 ? void 0 : slots.innerTrigger) && (slots === null || slots === void 0 ? void 0 : slots.innerTrigger((_a = props.files) === null || _a === void 0 ? void 0 : _a[0])) : (0,external_vue_namespaceObject.createVNode)("ul", {
2376
+ "class": classNames.value
2377
+ }, [isPhotowall.value ? Photowall() : Normal(), (slots === null || slots === void 0 ? void 0 : slots.innerTrigger) && (slots === null || slots === void 0 ? void 0 : slots.innerTrigger())])]);
2378
+ };
2379
+ }
2380
+ }));
2381
+ ;// CONCATENATED MODULE: external "../button"
2382
+ var external_button_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
2383
+ var external_button_y = x => () => x
2384
+ const external_button_namespaceObject = external_button_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__button_59c00871__["default"] });
2385
+ ;// CONCATENATED MODULE: ../../packages/upload/src/upload-trigger.tsx
2386
+
2387
+
2388
+
2389
+ /*
2390
+ * Tencent is pleased to support the open source community by making
2391
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2392
+ *
2393
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2394
+ *
2395
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2396
+ *
2397
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2398
+ *
2399
+ * ---------------------------------------------------
2400
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2401
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2402
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2403
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2404
+ *
2405
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2406
+ * the Software.
2407
+ *
2408
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2409
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2410
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2411
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2412
+ * IN THE SOFTWARE.
2413
+ */
2414
+
2415
+
2416
+
2417
+
2418
+
2419
+
2420
+
2421
+ /* harmony default export */ const upload_trigger = ((0,external_vue_namespaceObject.defineComponent)({
2422
+ name: 'UploadTrigger',
2423
+ props: {
2424
+ theme: props.theme,
2425
+ disabled: props.disabled,
2426
+ multiple: props.multiple,
2427
+ accept: props.accept,
2428
+ file: {
2429
+ type: Object
2430
+ }
2431
+ },
2432
+ emits: ['change', 'remove'],
2433
+ setup: function setup(props, _ref) {
2434
+ var slots = _ref.slots,
2435
+ emit = _ref.emit;
2436
+
2437
+ var _toRefs = (0,external_vue_namespaceObject.toRefs)(props),
2438
+ theme = _toRefs.theme,
2439
+ disabled = _toRefs.disabled,
2440
+ file = _toRefs.file,
2441
+ multiple = _toRefs.multiple,
2442
+ accept = _toRefs.accept;
2443
+
2444
+ var classBlock = "".concat(CLASS_PREFIX, "-trigger");
2445
+ var isButton = (0,external_vue_namespaceObject.computed)(function () {
2446
+ return theme.value === EThemes.BUTTON;
2447
+ });
2448
+ var isDrag = (0,external_vue_namespaceObject.computed)(function () {
2449
+ return theme.value === EThemes.DRAGGABLE;
2450
+ });
2451
+ var isPicture = (0,external_vue_namespaceObject.computed)(function () {
2452
+ return theme.value === EThemes.PICTURE;
2453
+ });
2454
+ var isSinglePicture = (0,external_vue_namespaceObject.computed)(function () {
2455
+ return isPicture.value && !multiple.value;
2456
+ });
2457
+ var acceptTypes = (0,external_vue_namespaceObject.computed)(function () {
2458
+ return isPicture.value && !accept.value ? 'image/png,image/jpeg,image/jpg' : accept.value;
2459
+ });
2460
+ var inputEl = (0,external_vue_namespaceObject.ref)(null);
2461
+ var classNames = (0,external_vue_namespaceObject.computed)(function () {
2462
+ var _classes;
2463
+
2464
+ var _a, _b, _c;
2465
+
2466
+ return (0,external_shared_namespaceObject.classes)((_classes = {}, _defineProperty(_classes, classBlock, true), _defineProperty(_classes, "".concat(classBlock, "--").concat(theme.value), true), _defineProperty(_classes, "".concat(classBlock, "--single-picture"), isSinglePicture.value), _defineProperty(_classes, "".concat(classBlock, "--has-file"), (_a = file.value) !== null && _a !== void 0 ? _a : false), _defineProperty(_classes, "".concat(classBlock, "--").concat((_b = file.value) === null || _b === void 0 ? void 0 : _b.status), (_c = file.value) !== null && _c !== void 0 ? _c : false), _defineProperty(_classes, "".concat(classBlock, "--dragover"), dragover.value), _defineProperty(_classes, "".concat(classBlock, "--disabled"), disabled.value), _classes));
2467
+ });
2468
+
2469
+ var invoke = function invoke() {
2470
+ inputEl.value.value = null;
2471
+ inputEl.value.click();
2472
+ };
2473
+
2474
+ var handleFileChange = function handleFileChange(e) {
2475
+ var files = e.target.files;
2476
+ emit('change', Array.from(files));
2477
+ };
2478
+
2479
+ var handleClick = function handleClick() {
2480
+ if (props.disabled) {
2481
+ return;
2482
+ }
2483
+
2484
+ invoke();
2485
+ };
2486
+
2487
+ var handleKeydown = function handleKeydown(e) {
2488
+ if (e.defaultPrevented || e.target !== e.currentTarget) {
2489
+ return;
2490
+ }
2491
+
2492
+ if (e.code === 'Enter' || e.code === 'Space') {
2493
+ invoke();
2494
+ }
2495
+
2496
+ e.preventDefault();
2497
+ };
2498
+
2499
+ function handleRemove(file, e) {
2500
+ emit('remove', file, e);
2501
+ e.stopPropagation();
2502
+ e.preventDefault();
2503
+ }
2504
+
2505
+ var dragover = (0,external_vue_namespaceObject.ref)(false);
2506
+
2507
+ var Dragger = function Dragger() {
2508
+ var handleDrop = function handleDrop(e) {
2509
+ if (disabled.value) {
2510
+ return;
2511
+ }
2512
+
2513
+ e.preventDefault();
2514
+ dragover.value = false;
2515
+ var files = Array.from(e.dataTransfer.files);
2516
+
2517
+ if (!acceptTypes.value) {
2518
+ emit('change', files);
2519
+ return;
2520
+ }
2521
+
2522
+ var filesFiltered = files.filter(function (file) {
2523
+ var type = file.type,
2524
+ name = file.name;
2525
+ var extension = name.includes('.') ? ".".concat(name.split('.').pop()) : '';
2526
+ var baseType = type.replace(/\/.*$/, '');
2527
+ return acceptTypes.value.split(',').map(function (type) {
2528
+ return type.trim();
2529
+ }).filter(function (type) {
2530
+ return type;
2531
+ }).some(function (acceptedType) {
2532
+ if (acceptedType.startsWith('.')) {
2533
+ return extension === acceptedType;
2534
+ }
2535
+
2536
+ if (/\/\*$/.test(acceptedType)) {
2537
+ return baseType === acceptedType.replace(/\/\*$/, '');
2538
+ }
2539
+
2540
+ if (/^[^/]+\/[^/]+$/.test(acceptedType)) {
2541
+ return type === acceptedType;
2542
+ }
2543
+
2544
+ return false;
2545
+ });
2546
+ });
2547
+ emit('change', filesFiltered);
2548
+ };
2549
+
2550
+ var handleDragover = function handleDragover(e) {
2551
+ e.preventDefault();
2552
+ dragover.value = true;
2553
+ };
2554
+
2555
+ var handleDragleave = function handleDragleave() {
2556
+ dragover.value = false;
2557
+ };
2558
+
2559
+ var classNames = (0,external_shared_namespaceObject.classes)(_defineProperty({}, "".concat(classBlock, "__draggable"), true));
2560
+ return (0,external_vue_namespaceObject.createVNode)("div", {
2561
+ "class": classNames,
2562
+ "onDrop": handleDrop,
2563
+ "onDragover": handleDragover,
2564
+ "onDragleave": handleDragleave
2565
+ }, [slots["default"] ? slots["default"]() : (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [(0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Upload, {
2566
+ "class": "".concat(classBlock, "__draggable-icon")
2567
+ }, null), (0,external_vue_namespaceObject.createVNode)("div", {
2568
+ "class": "".concat(classBlock, "__draggable-text")
2569
+ }, [(0,external_vue_namespaceObject.createTextVNode)("\u5C06\u6587\u4EF6\u62D6\u5230\u6B64\u5904\u6216"), (0,external_vue_namespaceObject.createVNode)("span", {
2570
+ "class": "".concat(classBlock, "__draggable-upload-link")
2571
+ }, [(0,external_vue_namespaceObject.createTextVNode)("\u70B9\u51FB\u4E0A\u4F20")])])])]);
2572
+ };
2573
+
2574
+ var Picture = function Picture() {
2575
+ return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [isSinglePicture.value && props.file ? SinglePicture(props.file) : DefaultPicture()]);
2576
+ };
2577
+
2578
+ var DefaultPicture = function DefaultPicture() {
2579
+ return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [slots["default"] ? slots["default"]() : (0,external_vue_namespaceObject.createVNode)("div", {
2580
+ "class": "".concat(classBlock, "__picture-inner")
2581
+ }, [(0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Plus, {
2582
+ "class": "".concat(classBlock, "__picture-icon")
2583
+ }, null), (0,external_vue_namespaceObject.createVNode)("div", {
2584
+ "class": "".concat(classBlock, "__picture-text")
2585
+ }, [(0,external_vue_namespaceObject.createTextVNode)("\u70B9\u51FB\u4E0A\u4F20")])])]);
2586
+ };
2587
+
2588
+ var SinglePicture = function SinglePicture(file) {
2589
+ return [(0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("img", {
2590
+ "src": file.url,
2591
+ "class": "".concat(classBlock, "__picture-thumbnail"),
2592
+ "alt": ""
2593
+ }, null), [[external_vue_namespaceObject.vShow, file.status !== 'uploading']]), (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [file.status === 'uploading' && (0,external_vue_namespaceObject.createVNode)(external_progress_namespaceObject["default"], {
2594
+ "class": "".concat(classBlock, "__picture-progress"),
2595
+ "type": "circle",
2596
+ "color": "#3a84ff",
2597
+ "bgColor": "#333",
2598
+ "width": 50,
2599
+ "titleStyle": {
2600
+ color: '#fff'
2601
+ },
2602
+ "percent": file.percentage
2603
+ }, null)]), (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [!props.disabled && (0,external_vue_namespaceObject.createVNode)("div", {
2604
+ "class": "".concat(classBlock, "__picture-actions")
2605
+ }, [(0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Del, {
2606
+ "class": "action-icon",
2607
+ "onClick": function onClick(e) {
2608
+ return handleRemove(file, e);
2609
+ }
2610
+ }, null)])])];
2611
+ };
2612
+
2613
+ var Button = function Button() {
2614
+ return (0,external_vue_namespaceObject.createVNode)(external_button_namespaceObject["default"], {
2615
+ "disabled": disabled.value
2616
+ }, {
2617
+ "default": function _default() {
2618
+ return [(0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Upload, {
2619
+ "class": "".concat(classBlock, "__button-icon")
2620
+ }, null), (0,external_vue_namespaceObject.createVNode)("span", {
2621
+ "class": "".concat(classBlock, "__button-text")
2622
+ }, [(0,external_vue_namespaceObject.createTextVNode)("\u4E0A\u4F20\u6587\u4EF6")])];
2623
+ }
2624
+ });
2625
+ };
2626
+
2627
+ var Trigger = function Trigger() {
2628
+ if (isButton.value) return Button();
2629
+ if (isDrag.value) return Dragger();
2630
+ if (isPicture.value) return Picture();
2631
+ };
2632
+
2633
+ return function () {
2634
+ var _a;
2635
+
2636
+ return (0,external_vue_namespaceObject.createVNode)("div", {
2637
+ "class": classNames.value,
2638
+ "tabindex": "0",
2639
+ "onClick": handleClick,
2640
+ "onKeydown": handleKeydown
2641
+ }, [slots.trigger ? [slots.trigger(), (_a = slots === null || slots === void 0 ? void 0 : slots["default"]) === null || _a === void 0 ? void 0 : _a.call(slots)] : Trigger(), (0,external_vue_namespaceObject.createVNode)("input", {
2642
+ "ref": inputEl,
2643
+ "class": "".concat(classBlock, "__input-file"),
2644
+ "tabindex": "-1",
2645
+ "onChange": handleFileChange,
2646
+ "accept": acceptTypes.value,
2647
+ "multiple": multiple.value,
2648
+ "disabled": disabled.value,
2649
+ "type": "file"
2650
+ }, null)]);
2651
+ };
2652
+ }
2653
+ }));
2654
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
2655
+
2656
+ function _arrayWithoutHoles(arr) {
2657
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
2658
+ }
2659
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
2660
+ function _iterableToArray(iter) {
2661
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
2662
+ }
2663
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
2664
+ function _nonIterableSpread() {
2665
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2666
+ }
2667
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
2668
+
2669
+
2670
+
2671
+
2672
+ function _toConsumableArray(arr) {
2673
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
2674
+ }
2675
+ // EXTERNAL MODULE: ../../node_modules/spark-md5/spark-md5.js
2676
+ var spark_md5 = __webpack_require__(4791);
2677
+ var spark_md5_default = /*#__PURE__*/__webpack_require__.n(spark_md5);
2678
+ ;// CONCATENATED MODULE: ../../packages/upload/src/use-ajax-upload.ts
2679
+
2680
+
2681
+
2682
+
2683
+ /*
2684
+ * Tencent is pleased to support the open source community by making
2685
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2686
+ *
2687
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2688
+ *
2689
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2690
+ *
2691
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2692
+ *
2693
+ * ---------------------------------------------------
2694
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2695
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2696
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2697
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2698
+ *
2699
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2700
+ * the Software.
2701
+ *
2702
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2703
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2704
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2705
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2706
+ * IN THE SOFTWARE.
2707
+ */
2708
+
2709
+
2710
+
2711
+ ;
2712
+
2713
+ function getRes(xhr) {
2714
+ var res = xhr.responseText || xhr.response;
2715
+
2716
+ if (!res) {
2717
+ return res;
2718
+ }
2719
+
2720
+ try {
2721
+ return JSON.parse(res);
2722
+ } catch (_a) {
2723
+ return res;
2724
+ }
2725
+ }
2726
+
2727
+ var ajaxUpload = function ajaxUpload(option) {
2728
+ if (typeof XMLHttpRequest === 'undefined') {
2729
+ throw new Error('XMLHttpRequest is undefined');
2730
+ }
2731
+
2732
+ var xhr = new XMLHttpRequest();
2733
+ var action = option.action;
2734
+
2735
+ if (xhr.upload) {
2736
+ xhr.upload.addEventListener('progress', function (event) {
2737
+ var progressEvent = event;
2738
+ progressEvent.percent = event.total > 0 ? event.loaded / event.total * 100 : 0;
2739
+ option.onProgress(progressEvent);
2740
+ });
2741
+ }
2742
+
2743
+ var formData = new FormData();
2744
+
2745
+ if (option.data) {
2746
+ var appendData = option.data;
2747
+
2748
+ if (!Array.isArray(appendData)) {
2749
+ appendData = [appendData];
2750
+ }
2751
+
2752
+ appendData.forEach(function (data) {
2753
+ for (var _i = 0, _Object$entries = Object.entries(data); _i < _Object$entries.length; _i++) {
2754
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
2755
+ key = _Object$entries$_i[0],
2756
+ value = _Object$entries$_i[1];
2757
+
2758
+ if (Array.isArray(value)) formData.append.apply(formData, [key].concat(_toConsumableArray(value)));else formData.append(key, value);
2759
+ }
2760
+ });
2761
+ }
2762
+
2763
+ if (option.formDataAttributes) {
2764
+ var _appendData = option.formDataAttributes;
2765
+
2766
+ if (!Array.isArray(_appendData)) {
2767
+ _appendData = [_appendData];
2768
+ }
2769
+
2770
+ _appendData.forEach(function (item) {
2771
+ if (Array.isArray(item.value)) formData.append.apply(formData, [item.name].concat(_toConsumableArray(item.value)));else formData.append(item.name, item.value);
2772
+ });
2773
+ }
2774
+
2775
+ formData.append(option.filename, option.file, option.file.name);
2776
+ xhr.addEventListener('error', function () {
2777
+ option.onError(new Error('An error occurred during upload'));
2778
+ });
2779
+ xhr.addEventListener('load', function () {
2780
+ if (xhr.status < 200 || xhr.status >= 300) {
2781
+ return option.onError(new Error('An error occurred during upload'));
2782
+ }
2783
+
2784
+ option.onSuccess(getRes(xhr));
2785
+ });
2786
+ xhr.addEventListener('loadend', function () {
2787
+ option.onComplete();
2788
+ });
2789
+ xhr.open(option.method, action, true);
2790
+
2791
+ if (option.withCredentials && 'withCredentials' in xhr) {
2792
+ xhr.withCredentials = true;
2793
+ }
2794
+
2795
+ if (option.header) {
2796
+ if (Array.isArray(option.header)) {
2797
+ option.header.forEach(function (head) {
2798
+ var headerKey = head.name;
2799
+ var headerVal = head.value;
2800
+ xhr.setRequestHeader(headerKey, headerVal);
2801
+ });
2802
+ } else {
2803
+ var headerKey = option.header.name;
2804
+ var headerVal = option.header.value;
2805
+ xhr.setRequestHeader(headerKey, headerVal);
2806
+ }
2807
+ }
2808
+
2809
+ var headers = option.headers || {};
2810
+
2811
+ if (headers instanceof Headers) {
2812
+ headers.forEach(function (value, key) {
2813
+ return xhr.setRequestHeader(key, value);
2814
+ });
2815
+ } else {
2816
+ for (var _i2 = 0, _Object$entries2 = Object.entries(headers); _i2 < _Object$entries2.length; _i2++) {
2817
+ var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
2818
+ key = _Object$entries2$_i[0],
2819
+ value = _Object$entries2$_i[1];
2820
+
2821
+ if ((0,external_shared_namespaceObject.isNullOrUndef)(value)) continue;
2822
+ xhr.setRequestHeader(key, String(value));
2823
+ }
2824
+ }
2825
+
2826
+ xhr.send(formData);
2827
+ return xhr;
2828
+ }; // 该方法用于在不同的浏览器使用不同的方式
2829
+
2830
+ var blobSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice;
2831
+ var ajaxSliceUpload = function ajaxSliceUpload(option) {
2832
+ return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator_default().mark(function _callee() {
2833
+ var chunkSize, file, blockCount, hash, progressList;
2834
+ return regenerator_default().wrap(function _callee$(_context) {
2835
+ while (1) {
2836
+ switch (_context.prev = _context.next) {
2837
+ case 0:
2838
+ chunkSize = option.chunkSize * 1024 * 1024;
2839
+ file = option.file;
2840
+
2841
+ if (file) {
2842
+ _context.next = 4;
2843
+ break;
2844
+ }
2845
+
2846
+ throw new Error('File not found');
2847
+
2848
+ case 4:
2849
+ blockCount = Math.ceil(file.size / chunkSize);
2850
+ _context.next = 7;
2851
+ return hashFile(file, chunkSize);
2852
+
2853
+ case 7:
2854
+ hash = _context.sent;
2855
+ progressList = [];
2856
+ sliceSend(option, file, blockCount, hash, progressList, chunkSize); // 所有分片上传后,请求合并分片文件
2857
+
2858
+ _context.next = 12;
2859
+ return Promise.all(progressList).then(function () {
2860
+ // 合并chunks
2861
+ var data = {
2862
+ size: file.size,
2863
+ name: file.name,
2864
+ total: blockCount,
2865
+ hash: hash
2866
+ };
2867
+ var req = new XMLHttpRequest();
2868
+ req.open(option.method, option.mergeUrl, true);
2869
+
2870
+ req.onreadystatechange = function () {
2871
+ if (req.readyState === 4) {
2872
+ if (req.status < 200 || req.status >= 300) {
2873
+ return option.onError(new Error('An error occurred during upload'));
2874
+ }
2875
+
2876
+ option.onSuccess(getRes(req));
2877
+ }
2878
+ };
2879
+
2880
+ req.onloadend = function () {
2881
+ option.onComplete();
2882
+ };
2883
+
2884
+ req.setRequestHeader('Content-type', 'application/JSON');
2885
+ req.send(JSON.stringify(data));
2886
+ });
2887
+
2888
+ case 12:
2889
+ case "end":
2890
+ return _context.stop();
2891
+ }
2892
+ }
2893
+ }, _callee);
2894
+ }));
2895
+ }; // 请求分片上传,保存在progressList中
2896
+
2897
+ var sliceSend = function sliceSend(option, file, blockCount, hash, progressList, chunkSize) {
2898
+ var _loop = function _loop(i) {
2899
+ // eslint-disable-next-line no-loop-func
2900
+ var pooltask = new Promise(function (resolve, reject) {
2901
+ var start = i * chunkSize;
2902
+ var end = Math.min(file.size, start + chunkSize); // 构建表单
2903
+
2904
+ var formData = new FormData();
2905
+
2906
+ if (option.data) {
2907
+ var appendData = option.data;
2908
+
2909
+ if (!Array.isArray(appendData)) {
2910
+ appendData = [appendData];
2911
+ }
2912
+
2913
+ appendData.forEach(function (data) {
2914
+ for (var _i3 = 0, _Object$entries3 = Object.entries(data); _i3 < _Object$entries3.length; _i3++) {
2915
+ var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2),
2916
+ key = _Object$entries3$_i[0],
2917
+ value = _Object$entries3$_i[1];
2918
+
2919
+ if (Array.isArray(value)) formData.append.apply(formData, [key].concat(_toConsumableArray(value)));else formData.append(key, value);
2920
+ }
2921
+ });
2922
+ }
2923
+
2924
+ if (option.formDataAttributes) {
2925
+ var _appendData2 = option.formDataAttributes;
2926
+
2927
+ if (!Array.isArray(_appendData2)) {
2928
+ _appendData2 = [_appendData2];
2929
+ }
2930
+
2931
+ _appendData2.forEach(function (item) {
2932
+ if (Array.isArray(item.value)) formData.append.apply(formData, [item.name].concat(_toConsumableArray(item.value)));else formData.append(item.name, item.value);
2933
+ });
2934
+ }
2935
+
2936
+ formData.append('file', blobSlice.call(file, start, end));
2937
+ formData.append('name', file.name);
2938
+ formData.append('total', blockCount.toString());
2939
+ formData.append('index', i.toString());
2940
+ formData.append('size', file.size.toString());
2941
+ formData.append('hash', hash.toString());
2942
+ var xhr = new XMLHttpRequest();
2943
+
2944
+ xhr.onreadystatechange = function () {
2945
+ if (xhr.readyState === 4) {
2946
+ var res = getRes(xhr);
2947
+
2948
+ if (xhr.status < 200 || xhr.status >= 300) {
2949
+ reject(res);
2950
+ option.onError(new Error('An error occurred during upload'));
2951
+ } else {
2952
+ resolve('reponseText');
2953
+ }
2954
+ }
2955
+ };
2956
+
2957
+ xhr.upload.addEventListener('progress', function (event) {
2958
+ var progressEvent = event;
2959
+ option.onProgress(progressEvent, i);
2960
+ }, false);
2961
+
2962
+ if (option.withCredentials && 'withCredentials' in xhr) {
2963
+ xhr.withCredentials = true;
2964
+ }
2965
+
2966
+ xhr.open(option.method, option.sliceUrl, true);
2967
+
2968
+ if (option.header) {
2969
+ if (Array.isArray(option.header)) {
2970
+ option.header.forEach(function (head) {
2971
+ var headerKey = head.name;
2972
+ var headerVal = head.value;
2973
+ xhr.setRequestHeader(headerKey, headerVal);
2974
+ });
2975
+ } else {
2976
+ var headerKey = option.header.name;
2977
+ var headerVal = option.header.value;
2978
+ xhr.setRequestHeader(headerKey, headerVal);
2979
+ }
2980
+ }
2981
+
2982
+ var headers = option.headers || {};
2983
+
2984
+ if (headers instanceof Headers) {
2985
+ headers.forEach(function (value, key) {
2986
+ return xhr.setRequestHeader(key, value);
2987
+ });
2988
+ } else {
2989
+ for (var _i4 = 0, _Object$entries4 = Object.entries(headers); _i4 < _Object$entries4.length; _i4++) {
2990
+ var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i4], 2),
2991
+ key = _Object$entries4$_i[0],
2992
+ value = _Object$entries4$_i[1];
2993
+
2994
+ if ((0,external_shared_namespaceObject.isNullOrUndef)(value)) continue;
2995
+ xhr.setRequestHeader(key, String(value));
2996
+ }
2997
+ }
2998
+
2999
+ xhr.send(formData);
3000
+ });
3001
+ progressList.push(pooltask);
3002
+ };
3003
+
3004
+ for (var i = 0; i < blockCount; i++) {
3005
+ _loop(i);
3006
+ }
3007
+ }; // SparkMD5分片文件
3008
+
3009
+
3010
+ var hashFile = function hashFile(file, chunkSize) {
3011
+ return new Promise(function (resolve, reject) {
3012
+ var chunks = Math.ceil(file.size / chunkSize);
3013
+ var currentChunk = 0;
3014
+ var spark = new (spark_md5_default()).ArrayBuffer();
3015
+ var fileReader = new FileReader();
3016
+
3017
+ function loadNext() {
3018
+ var start = currentChunk * chunkSize;
3019
+ var end = start + chunkSize >= file.size ? file.size : start + chunkSize;
3020
+ fileReader.readAsArrayBuffer(blobSlice.call(file, start, end));
3021
+ }
3022
+
3023
+ fileReader.onload = function (e) {
3024
+ spark.append(e.target.result); // Append array buffer
3025
+
3026
+ currentChunk += 1;
3027
+
3028
+ if (currentChunk < chunks) {
3029
+ loadNext();
3030
+ } else {
3031
+ var result = spark.end(); // 如果单纯的使用result 作为hash值的时候, 如果文件内容相同,而名称不同的时候
3032
+ // 想保留两个文件无法保留。所以把文件名称加上。
3033
+
3034
+ var sparkMd5 = new (spark_md5_default())();
3035
+ sparkMd5.append(result);
3036
+ sparkMd5.append(file.name);
3037
+ var hexHash = sparkMd5.end();
3038
+ resolve(hexHash);
3039
+ }
3040
+ };
3041
+
3042
+ fileReader.onerror = function () {
3043
+ reject(new Error('File slcie failed'));
3044
+ };
3045
+
3046
+ loadNext();
3047
+ })["catch"](function (err) {
3048
+ console.log(err);
3049
+ });
3050
+ };
3051
+ ;// CONCATENATED MODULE: ../../packages/upload/src/use-file-handler.ts
3052
+
3053
+
3054
+ /*
3055
+ * Tencent is pleased to support the open source community by making
3056
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
3057
+ *
3058
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
3059
+ *
3060
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
3061
+ *
3062
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
3063
+ *
3064
+ * ---------------------------------------------------
3065
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
3066
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
3067
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
3068
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3069
+ *
3070
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
3071
+ * the Software.
3072
+ *
3073
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
3074
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3075
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
3076
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
3077
+ * IN THE SOFTWARE.
3078
+ */
3079
+
3080
+
3081
+
3082
+
3083
+ function buildFileId(index) {
3084
+ return Date.now() + index;
3085
+ }
3086
+
3087
+ /* harmony default export */ const use_file_handler = (function (props, hooks) {
3088
+ var maxImgSize = (0,external_vue_namespaceObject.computed)(function () {
3089
+ var _a;
3090
+
3091
+ if (typeof props.size === 'number') {
3092
+ return props.size;
3093
+ }
3094
+
3095
+ return (_a = props === null || props === void 0 ? void 0 : props.size) === null || _a === void 0 ? void 0 : _a.maxImgSize;
3096
+ });
3097
+ var maxFileSize = (0,external_vue_namespaceObject.computed)(function () {
3098
+ var _a;
3099
+
3100
+ if (typeof props.size === 'number') {
3101
+ return props.size;
3102
+ }
3103
+
3104
+ return (_a = props === null || props === void 0 ? void 0 : props.size) === null || _a === void 0 ? void 0 : _a.maxImgSize;
3105
+ }); // 文件列表,包括选择的和已上传
3106
+
3107
+ var fileList = (0,external_vue_namespaceObject.ref)([]);
3108
+
3109
+ function findFile(rawFile) {
3110
+ return fileList.value.find(function (item) {
3111
+ return item.uid === rawFile.uid;
3112
+ });
3113
+ }
3114
+
3115
+ var activeIndex = 0;
3116
+
3117
+ function handlePreprocess(file) {
3118
+ var _a;
3119
+
3120
+ activeIndex += 1;
3121
+ file.uid = buildFileId(activeIndex);
3122
+ var uploadFile = {
3123
+ uid: file.uid,
3124
+ name: file.name,
3125
+ status: EUploadStatus.NEW,
3126
+ size: file.size,
3127
+ raw: file
3128
+ };
3129
+ var isImage = file.type.startsWith('image/');
3130
+ var error = null; // 图片缩略图处理
3131
+
3132
+ if (isImage) {
3133
+ try {
3134
+ uploadFile.url = window.URL.createObjectURL(file);
3135
+ } catch (err) {
3136
+ console.error(err);
3137
+ }
3138
+
3139
+ uploadFile.isPic = true;
3140
+ } // 文件名称校验
3141
+
3142
+
3143
+ if (props.validateName && !((_a = props.validateName) === null || _a === void 0 ? void 0 : _a.test(uploadFile.name))) {
3144
+ uploadFile.status = EUploadStatus.FAIL;
3145
+ uploadFile.statusText = 'invalid filename';
3146
+ error = new Error(uploadFile.statusText);
3147
+ }
3148
+
3149
+ if (isImage && file.size > maxImgSize.value * Math.pow(1024, 2)) {
3150
+ uploadFile.status = EUploadStatus.FAIL;
3151
+ uploadFile.statusText = 'invalid file size';
3152
+ error = new Error(uploadFile.statusText);
3153
+ }
3154
+
3155
+ if (!isImage && file.size > maxFileSize.value * Math.pow(1024, 2)) {
3156
+ uploadFile.status = EUploadStatus.FAIL;
3157
+ uploadFile.statusText = 'invalid file size';
3158
+ error = new Error(uploadFile.statusText);
3159
+ }
3160
+
3161
+ fileList.value.push(uploadFile);
3162
+ return error;
3163
+ }
3164
+
3165
+ function handleRemove(file) {
3166
+ var _a;
3167
+
3168
+ return __awaiter(this, void 0, void 0, /*#__PURE__*/regenerator_default().mark(function _callee() {
3169
+ var uploadFile, remove, before;
3170
+ return regenerator_default().wrap(function _callee$(_context) {
3171
+ while (1) {
3172
+ switch (_context.prev = _context.next) {
3173
+ case 0:
3174
+ uploadFile = file instanceof File ? findFile(file) : file;
3175
+
3176
+ remove = function remove(file) {
3177
+ var _a;
3178
+
3179
+ hooks.onRemove(file, fileList.value);
3180
+ fileList.value.splice(fileList.value.indexOf(uploadFile), 1);
3181
+
3182
+ if ((_a = file.url) === null || _a === void 0 ? void 0 : _a.startsWith('blob:')) {
3183
+ URL.revokeObjectURL(file.url);
3184
+ }
3185
+ };
3186
+
3187
+ if (!props.beforeRemove) {
3188
+ _context.next = 9;
3189
+ break;
3190
+ }
3191
+
3192
+ _context.next = 5;
3193
+ return (_a = props.beforeRemove) === null || _a === void 0 ? void 0 : _a.call(props, uploadFile, fileList.value);
3194
+
3195
+ case 5:
3196
+ before = _context.sent;
3197
+
3198
+ if (before !== false) {
3199
+ remove(uploadFile);
3200
+ }
3201
+
3202
+ _context.next = 10;
3203
+ break;
3204
+
3205
+ case 9:
3206
+ remove(uploadFile);
3207
+
3208
+ case 10:
3209
+ case "end":
3210
+ return _context.stop();
3211
+ }
3212
+ }
3213
+ }, _callee);
3214
+ }));
3215
+ }
3216
+
3217
+ function handleError(err, rawFile, res) {
3218
+ return __awaiter(this, void 0, void 0, /*#__PURE__*/regenerator_default().mark(function _callee2() {
3219
+ var file;
3220
+ return regenerator_default().wrap(function _callee2$(_context2) {
3221
+ while (1) {
3222
+ switch (_context2.prev = _context2.next) {
3223
+ case 0:
3224
+ file = findFile(rawFile);
3225
+
3226
+ if (file) {
3227
+ _context2.next = 3;
3228
+ break;
3229
+ }
3230
+
3231
+ return _context2.abrupt("return");
3232
+
3233
+ case 3:
3234
+ file.status = 'fail';
3235
+ file.statusText = err.message;
3236
+ file.response = res;
3237
+
3238
+ case 6:
3239
+ case "end":
3240
+ return _context2.stop();
3241
+ }
3242
+ }
3243
+ }, _callee2);
3244
+ }));
3245
+ }
3246
+
3247
+ function handleSuccess(res, rawFile) {
3248
+ return __awaiter(this, void 0, void 0, /*#__PURE__*/regenerator_default().mark(function _callee3() {
3249
+ var file;
3250
+ return regenerator_default().wrap(function _callee3$(_context3) {
3251
+ while (1) {
3252
+ switch (_context3.prev = _context3.next) {
3253
+ case 0:
3254
+ file = findFile(rawFile);
3255
+
3256
+ if (file) {
3257
+ _context3.next = 3;
3258
+ break;
3259
+ }
3260
+
3261
+ return _context3.abrupt("return");
3262
+
3263
+ case 3:
3264
+ file.status = 'success';
3265
+ file.response = res;
3266
+
3267
+ case 5:
3268
+ case "end":
3269
+ return _context3.stop();
3270
+ }
3271
+ }
3272
+ }, _callee3);
3273
+ }));
3274
+ }
3275
+
3276
+ function handleProgress(event, rawFile) {
3277
+ return __awaiter(this, void 0, void 0, /*#__PURE__*/regenerator_default().mark(function _callee4() {
3278
+ var file;
3279
+ return regenerator_default().wrap(function _callee4$(_context4) {
3280
+ while (1) {
3281
+ switch (_context4.prev = _context4.next) {
3282
+ case 0:
3283
+ // TODO slideUpload progress
3284
+ file = findFile(rawFile);
3285
+
3286
+ if (file) {
3287
+ _context4.next = 3;
3288
+ break;
3289
+ }
3290
+
3291
+ return _context4.abrupt("return");
3292
+
3293
+ case 3:
3294
+ file.status = 'uploading';
3295
+ file.percentage = Math.round(event.percent);
3296
+
3297
+ case 5:
3298
+ case "end":
3299
+ return _context4.stop();
3300
+ }
3301
+ }
3302
+ }, _callee4);
3303
+ }));
3304
+ }
3305
+
3306
+ (0,external_vue_namespaceObject.watch)(function () {
3307
+ return props.files;
3308
+ }, function (files) {
3309
+ fileList.value = files.map(function (file) {
3310
+ var _a, _b;
3311
+
3312
+ activeIndex += 1;
3313
+ return Object.assign(Object.assign({}, file), {
3314
+ uid: (_a = file.uid) !== null && _a !== void 0 ? _a : buildFileId(activeIndex),
3315
+ status: (_b = file.status) !== null && _b !== void 0 ? _b : EUploadStatus.SUCCESS
3316
+ });
3317
+ });
3318
+ }, {
3319
+ immediate: true,
3320
+ deep: true
3321
+ });
3322
+ return {
3323
+ fileList: fileList,
3324
+ handlePreprocess: handlePreprocess,
3325
+ handleRemove: handleRemove,
3326
+ handleError: handleError,
3327
+ handleSuccess: handleSuccess,
3328
+ handleProgress: handleProgress
3329
+ };
3330
+ });
3331
+ ;// CONCATENATED MODULE: ../../packages/upload/src/upload.tsx
3332
+
3333
+
3334
+
3335
+
3336
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = upload_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
3337
+
3338
+ function upload_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return upload_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return upload_arrayLikeToArray(o, minLen); }
3339
+
3340
+ function upload_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
3341
+
3342
+ /*
3343
+ * Tencent is pleased to support the open source community by making
3344
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
3345
+ *
3346
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
3347
+ *
3348
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
3349
+ *
3350
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
3351
+ *
3352
+ * ---------------------------------------------------
3353
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
3354
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
3355
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
3356
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3357
+ *
3358
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
3359
+ * the Software.
3360
+ *
3361
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
3362
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3363
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
3364
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
3365
+ * IN THE SOFTWARE.
3366
+ */
3367
+
3368
+
3369
+
3370
+
3371
+
3372
+
3373
+
3374
+
3375
+
3376
+ /* harmony default export */ const upload = ((0,external_vue_namespaceObject.defineComponent)({
3377
+ name: 'Upload',
3378
+ props: props,
3379
+ emits: ['exceed', 'progress', 'success', 'error', 'delete', 'done'],
3380
+ setup: function setup(props, _ref) {
3381
+ var slots = _ref.slots,
3382
+ emit = _ref.emit,
3383
+ expose = _ref.expose;
3384
+ var requests = (0,external_vue_namespaceObject.shallowRef)({});
3385
+ var isPhotowall = (0,external_vue_namespaceObject.computed)(function () {
3386
+ return props.theme === EThemes.PICTURE;
3387
+ });
3388
+ var isSinglePhoto = (0,external_vue_namespaceObject.computed)(function () {
3389
+ return isPhotowall.value && !props.multiple;
3390
+ });
3391
+ var classNames = (0,external_vue_namespaceObject.computed)(function () {
3392
+ var _classes;
3393
+
3394
+ var _a;
3395
+
3396
+ return (0,external_shared_namespaceObject.classes)((_classes = {}, _defineProperty(_classes, CLASS_PREFIX, true), _defineProperty(_classes, "".concat(CLASS_PREFIX, "--").concat(props.theme), true), _defineProperty(_classes, "".concat(CLASS_PREFIX, "--disabled"), props.disabled), _defineProperty(_classes, "".concat(CLASS_PREFIX, "--single-picture"), isSinglePhoto.value), _defineProperty(_classes, props.extCls, (_a = props.extCls) !== null && _a !== void 0 ? _a : false), _classes));
3397
+ });
3398
+ var triggerProps = (0,external_vue_namespaceObject.computed)(function () {
3399
+ return {
3400
+ theme: props.theme,
3401
+ multiple: props.multiple,
3402
+ disabled: props.disabled,
3403
+ accept: props.accept
3404
+ };
3405
+ });
3406
+
3407
+ function onRemove(file, fileList) {
3408
+ abort(file);
3409
+ emit('delete', file, fileList);
3410
+ }
3411
+
3412
+ var _useFileHandler = use_file_handler(props, {
3413
+ onRemove: onRemove
3414
+ }),
3415
+ fileList = _useFileHandler.fileList,
3416
+ handlePreprocess = _useFileHandler.handlePreprocess,
3417
+ handleRemove = _useFileHandler.handleRemove,
3418
+ handleProgress = _useFileHandler.handleProgress,
3419
+ handleSuccess = _useFileHandler.handleSuccess,
3420
+ handleError = _useFileHandler.handleError;
3421
+
3422
+ function handleFiles(files) {
3423
+ if (!files.length) {
3424
+ return;
3425
+ } // limit检查
3426
+
3427
+
3428
+ if (props.limit && fileList.value.length + files.length > props.limit) {
3429
+ emit('exceed', files, fileList.value);
3430
+ return;
3431
+ }
3432
+
3433
+ var sendFiles = files;
3434
+
3435
+ if (!props.multiple || props.limit === 1) {
3436
+ sendFiles = files.slice(0, 1);
3437
+ }
3438
+
3439
+ var _iterator = _createForOfIteratorHelper(sendFiles),
3440
+ _step;
3441
+
3442
+ try {
3443
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
3444
+ var file = _step.value;
3445
+ var rawFile = file;
3446
+ var error = handlePreprocess(rawFile);
3447
+
3448
+ if (error) {
3449
+ emit('error', rawFile, fileList.value, error);
3450
+ return;
3451
+ }
3452
+
3453
+ if (props.autoUpload) {
3454
+ upload(rawFile, sendFiles);
3455
+ }
3456
+ }
3457
+ } catch (err) {
3458
+ _iterator.e(err);
3459
+ } finally {
3460
+ _iterator.f();
3461
+ }
3462
+ }
3463
+
3464
+ ;
3465
+
3466
+ function handleRetry(file) {
3467
+ send(file.raw);
3468
+ }
3469
+
3470
+ function upload(file, sendFiles) {
3471
+ var _a;
3472
+
3473
+ return __awaiter(this, void 0, void 0, /*#__PURE__*/regenerator_default().mark(function _callee() {
3474
+ var beforeResult;
3475
+ return regenerator_default().wrap(function _callee$(_context) {
3476
+ while (1) {
3477
+ switch (_context.prev = _context.next) {
3478
+ case 0:
3479
+ if (props.beforeUpload) {
3480
+ _context.next = 2;
3481
+ break;
3482
+ }
3483
+
3484
+ return _context.abrupt("return", send(file, sendFiles));
3485
+
3486
+ case 2:
3487
+ _context.prev = 2;
3488
+ _context.next = 5;
3489
+ return (_a = props.beforeUpload) === null || _a === void 0 ? void 0 : _a.call(props, file);
3490
+
3491
+ case 5:
3492
+ beforeResult = _context.sent;
3493
+ _context.next = 11;
3494
+ break;
3495
+
3496
+ case 8:
3497
+ _context.prev = 8;
3498
+ _context.t0 = _context["catch"](2);
3499
+ beforeResult = false;
3500
+
3501
+ case 11:
3502
+ if (!(beforeResult === false)) {
3503
+ _context.next = 14;
3504
+ break;
3505
+ }
3506
+
3507
+ handleRemove(file);
3508
+ return _context.abrupt("return");
3509
+
3510
+ case 14:
3511
+ send(file, sendFiles);
3512
+
3513
+ case 15:
3514
+ case "end":
3515
+ return _context.stop();
3516
+ }
3517
+ }
3518
+ }, _callee, null, [[2, 8]]);
3519
+ }));
3520
+ }
3521
+
3522
+ function send(file, sendFiles) {
3523
+ var headers = props.headers,
3524
+ header = props.header,
3525
+ data = props.data,
3526
+ formDataAttributes = props.formDataAttributes,
3527
+ method = props.method,
3528
+ withCredentials = props.withCredentials,
3529
+ filename = props.name,
3530
+ url = props.url,
3531
+ sliceUrl = props.sliceUrl,
3532
+ mergeUrl = props.mergeUrl,
3533
+ chunkSize = props.chunkSize,
3534
+ customRequest = props.customRequest;
3535
+ var uid = file.uid;
3536
+ var options = {
3537
+ headers: headers,
3538
+ header: header,
3539
+ withCredentials: withCredentials,
3540
+ file: file,
3541
+ data: data,
3542
+ formDataAttributes: formDataAttributes,
3543
+ method: method,
3544
+ filename: filename,
3545
+ action: url,
3546
+ sliceUrl: sliceUrl,
3547
+ mergeUrl: mergeUrl,
3548
+ chunkSize: chunkSize,
3549
+ onProgress: function onProgress(event) {
3550
+ handleProgress(event, file);
3551
+ emit('progress', event, file, fileList.value);
3552
+ },
3553
+ onSuccess: function onSuccess(res) {
3554
+ var _a;
3555
+
3556
+ var result = res;
3557
+
3558
+ if ((_a = props === null || props === void 0 ? void 0 : props.handleResCode) === null || _a === void 0 ? void 0 : _a.call(props, result)) {
3559
+ handleSuccess(res, file);
3560
+ emit('success', res, file, fileList.value);
3561
+ } else {
3562
+ var err = new Error((result === null || result === void 0 ? void 0 : result.message) || 'unknow error');
3563
+ handleError(err, file, res);
3564
+ emit('error', file, fileList.value, err);
3565
+ }
3566
+
3567
+ delete requests.value[uid];
3568
+ },
3569
+ onError: function onError(err) {
3570
+ handleError(err, file);
3571
+ emit('error', file, fileList.value, err);
3572
+ delete requests.value[uid];
3573
+ },
3574
+ onComplete: function onComplete() {
3575
+ if (sendFiles && sendFiles.indexOf(file) === sendFiles.length - 1) {
3576
+ emit('done', fileList.value);
3577
+ }
3578
+ }
3579
+ };
3580
+ var uploadFn = props.sliceUpload ? ajaxSliceUpload : ajaxUpload;
3581
+
3582
+ if (customRequest) {
3583
+ uploadFn = customRequest;
3584
+ }
3585
+
3586
+ var request = uploadFn(options);
3587
+ requests.value[uid] = request;
3588
+
3589
+ if (request instanceof Promise) {
3590
+ request.then(options.onSuccess, options.onError);
3591
+ }
3592
+ }
3593
+
3594
+ function abort(file) {
3595
+ var reqs = requests.value;
3596
+
3597
+ if (file) {
3598
+ reqs = _defineProperty({}, file.uid, requests.value[file.uid]);
3599
+ }
3600
+
3601
+ Object.keys(reqs).forEach(function (uid) {
3602
+ if (reqs[uid] instanceof XMLHttpRequest) {
3603
+ var xhr = reqs[uid];
3604
+ xhr === null || xhr === void 0 ? void 0 : xhr.abort();
3605
+ }
3606
+
3607
+ delete requests.value[uid];
3608
+ });
3609
+ }
3610
+
3611
+ (0,external_vue_namespaceObject.onBeforeUnmount)(function () {
3612
+ fileList.value.forEach(function (_ref2) {
3613
+ var url = _ref2.url;
3614
+ if (url === null || url === void 0 ? void 0 : url.startsWith('blob:')) URL.revokeObjectURL(url);
3615
+ });
3616
+ });
3617
+ expose({
3618
+ handleRemove: handleRemove,
3619
+ handleRetry: handleRetry
3620
+ });
3621
+ return function () {
3622
+ return (0,external_vue_namespaceObject.createVNode)("div", {
3623
+ "class": classNames.value
3624
+ }, [!isPhotowall.value && (0,external_vue_namespaceObject.createVNode)(upload_trigger, (0,external_vue_namespaceObject.mergeProps)(triggerProps.value, {
3625
+ "onChange": handleFiles
3626
+ }), slots), slots.tip ? slots.tip() : props.tip && (0,external_vue_namespaceObject.createVNode)("div", {
3627
+ "class": "".concat(CLASS_PREFIX, "__tip")
3628
+ }, [props.tip]), (0,external_vue_namespaceObject.createVNode)(upload_list, {
3629
+ "files": fileList.value,
3630
+ "theme": props.theme,
3631
+ "disabled": props.disabled,
3632
+ "multiple": props.multiple,
3633
+ "onRemove": handleRemove,
3634
+ "onRetry": handleRetry
3635
+ }, {
3636
+ innerTrigger: function innerTrigger(file) {
3637
+ return isPhotowall.value && (0,external_vue_namespaceObject.createVNode)(upload_trigger, (0,external_vue_namespaceObject.mergeProps)(triggerProps.value, {
3638
+ "file": file,
3639
+ "onChange": handleFiles,
3640
+ "onRemove": handleRemove
3641
+ }), slots);
3642
+ },
3643
+ file: slots.file
3644
+ })]);
3645
+ };
3646
+ }
3647
+ }));
3648
+ ;// CONCATENATED MODULE: ../../packages/upload/src/index.ts
3649
+ /*
3650
+ * Tencent is pleased to support the open source community by making
3651
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
3652
+ *
3653
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
3654
+ *
3655
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
3656
+ *
3657
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
3658
+ *
3659
+ * ---------------------------------------------------
3660
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
3661
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
3662
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
3663
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3664
+ *
3665
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
3666
+ * the Software.
3667
+ *
3668
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
3669
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3670
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
3671
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
3672
+ * IN THE SOFTWARE.
3673
+ */
3674
+
3675
+
3676
+ var Upload = (0,external_shared_namespaceObject.withInstall)(upload);
3677
+ /* harmony default export */ const src = (Upload);
3678
+ })();
3679
+
3680
+ var __webpack_exports__default = __webpack_exports__.Z;
3681
+ export { __webpack_exports__default as default };