@vunk/form 1.1.77 → 1.1.79

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 (284) hide show
  1. package/components/_plugin-vue_export-helper.mjs +9 -0
  2. package/components/button/{index.js → index.mjs} +33 -29
  3. package/components/button/src/ctx.d.ts +30 -30
  4. package/components/button/src/index.vue.d.ts +69 -69
  5. package/components/cascader/index.css +0 -2
  6. package/components/cascader/{index.js → index.mjs} +22 -22
  7. package/components/cascader/src/ctx.d.ts +37 -45
  8. package/components/cascader/src/index.vue.d.ts +92 -92
  9. package/components/cascader/src/use.d.ts +1 -1
  10. package/components/checkbox/index.css +0 -9
  11. package/components/checkbox/{index.js → index.mjs} +45 -42
  12. package/components/checkbox/src/ctx.d.ts +29 -32
  13. package/components/checkbox/src/index.vue.d.ts +65 -65
  14. package/components/color-picker/{index.js → index.mjs} +23 -22
  15. package/components/color-picker/src/ctx.d.ts +29 -29
  16. package/components/color-picker/src/index.vue.d.ts +67 -67
  17. package/components/date-picker/{index.js → index.mjs} +28 -25
  18. package/components/date-picker/src/ctx.d.ts +49 -49
  19. package/components/date-picker/src/index.vue.d.ts +104 -104
  20. package/components/download-plus/index.css +0 -6
  21. package/components/download-plus/{index.js → index.mjs} +119 -147
  22. package/components/download-plus/src/api.d.ts +1 -1
  23. package/components/download-plus/src/ctx.d.ts +27 -26
  24. package/components/download-plus/src/index.vue.d.ts +59 -59
  25. package/components/esri-input-geojson/index.css +0 -10
  26. package/components/esri-input-geojson/index.mjs +1109 -0
  27. package/components/esri-input-geojson/src/append.vue.d.ts +1 -1
  28. package/components/esri-input-geojson/src/ctx.d.ts +49 -72
  29. package/components/esri-input-geojson/src/index.vue.d.ts +138 -158
  30. package/components/esri-input-geojson/src/types.d.ts +0 -1
  31. package/components/esri-input-geojson/src/viewer.vue.d.ts +18 -19
  32. package/components/form/{index.js → index.mjs} +31 -27
  33. package/components/form/src/ctx.d.ts +13 -297
  34. package/components/form/src/index.vue.d.ts +97 -659
  35. package/components/form-item/index.css +0 -8
  36. package/components/form-item/{index.js → index.mjs} +22 -19
  37. package/components/form-item/src/ctx.d.ts +13 -11
  38. package/components/form-item/src/index.vue.d.ts +20 -20
  39. package/components/form-item-renderer/{index.js → index.mjs} +9 -7
  40. package/components/form-item-renderer/src/index.vue.d.ts +1 -1
  41. package/components/form-item-renderer-template/{index.js → index.mjs} +7 -7
  42. package/components/geoinput/{index.js → index.mjs} +10 -17
  43. package/components/geoinput/src/ctx.d.ts +48 -60
  44. package/components/geoinput/src/index.vue.d.ts +114 -132
  45. package/components/geoinput-read/index.css +0 -2
  46. package/components/geoinput-read/{index.js → index.mjs} +101 -109
  47. package/components/geoinput-read/src/core.vue.d.ts +123 -142
  48. package/components/geoinput-read/src/ctx.d.ts +50 -74
  49. package/components/geoinput-read/src/index.vue.d.ts +102 -120
  50. package/components/geoinput-update/index.css +0 -6
  51. package/components/geoinput-update/index.mjs +399 -0
  52. package/components/geoinput-update/src/ctx.d.ts +49 -69
  53. package/components/geoinput-update/src/index.vue.d.ts +126 -141
  54. package/components/index.mjs +11 -0
  55. package/components/index2.mjs +306 -0
  56. package/components/index3.mjs +484 -0
  57. package/components/input/{index.js → index.mjs} +31 -27
  58. package/components/input/src/ctx.d.ts +47 -66
  59. package/components/input/src/index.vue.d.ts +101 -113
  60. package/components/input-link/index.css +0 -2
  61. package/components/input-link/index.mjs +151 -0
  62. package/components/input-link/src/ctx.d.ts +40 -56
  63. package/components/input-link/src/index.vue.d.ts +89 -101
  64. package/components/input-number/index.css +0 -2
  65. package/components/input-number/{index.js → index.mjs} +25 -25
  66. package/components/input-number/src/ctx.d.ts +31 -37
  67. package/components/input-number/src/index.vue.d.ts +71 -71
  68. package/components/radio/index.css +0 -6
  69. package/components/radio/{index.js → index.mjs} +50 -47
  70. package/components/radio/src/ctx.d.ts +29 -29
  71. package/components/radio/src/index.vue.d.ts +64 -64
  72. package/components/select/index.css +0 -2
  73. package/components/select/{index.js → index.mjs} +49 -48
  74. package/components/select/src/ctx.d.ts +31 -85
  75. package/components/select/src/index.vue.d.ts +121 -230
  76. package/components/slider/{index.js → index.mjs} +28 -24
  77. package/components/slider/src/ctx.d.ts +35 -35
  78. package/components/slider/src/index.vue.d.ts +93 -93
  79. package/components/switch/index.css +0 -2
  80. package/components/switch/{index.js → index.mjs} +29 -24
  81. package/components/switch/src/ctx.d.ts +40 -40
  82. package/components/switch/src/index.vue.d.ts +91 -91
  83. package/components/templates-default/index.mjs +302 -0
  84. package/components/templates-default/src/ctx.d.ts +2 -4
  85. package/components/templates-default/src/index.vue.d.ts +2 -8
  86. package/components/templates-element-plus/index.mjs +106 -0
  87. package/components/templates-esri/index.mjs +59 -0
  88. package/components/templates-layout/index.css +0 -3
  89. package/components/templates-layout/index.mjs +131 -0
  90. package/components/templates-mapbox/index.mjs +59 -0
  91. package/components/upload/index.css +0 -7
  92. package/components/upload/index.mjs +501 -0
  93. package/components/upload/src/ctx.d.ts +36 -38
  94. package/components/upload/src/file.vue.d.ts +22 -21
  95. package/components/upload/src/index.vue.d.ts +78 -78
  96. package/components/upload-plus/index.css +4 -8
  97. package/components/upload-plus/{index.js → index.mjs} +9497 -926
  98. package/components/upload-plus/src/api.d.ts +1 -1
  99. package/components/upload-plus/src/ctx.d.ts +25 -28
  100. package/components/upload-plus/src/index.vue.d.ts +58 -58
  101. package/components/van-cascader/index.css +0 -2
  102. package/components/van-cascader/{index.js → index.mjs} +41 -44
  103. package/components/van-cascader/src/ctx.d.ts +35 -35
  104. package/components/van-cascader/src/index.vue.d.ts +82 -82
  105. package/components/var-datetime-picker/index.css +0 -2
  106. package/components/var-datetime-picker/index.mjs +324 -0
  107. package/components/var-datetime-picker/src/ctx.d.ts +27 -26
  108. package/components/var-datetime-picker/src/index.vue.d.ts +57 -57
  109. package/components/vditor/{index.js → index.mjs} +9 -14
  110. package/components/vditor/src/ctx.d.ts +2 -1
  111. package/components/vditor/src/index.vue.d.ts +2 -3
  112. package/composables/index.mjs +85 -0
  113. package/composables/useSourceManager.d.ts +2 -2
  114. package/defaults.d.ts +1 -1
  115. package/index.css +4 -169
  116. package/index.d.ts +1 -1
  117. package/index.esm.js +44 -1
  118. package/package.json +246 -2
  119. package/shared/const/index.d.ts +1 -1
  120. package/shared/const/index.mjs +56 -0
  121. package/shared/element-plus/ctx.d.ts +26 -94
  122. package/shared/element-plus/index.mjs +285 -0
  123. package/shared/element-plus/instances.d.ts +29 -28
  124. package/shared/form/index.mjs +30 -0
  125. package/shared/helper/index.mjs +9 -0
  126. package/shared/index.mjs +1 -0
  127. package/shared/infer-prop/index.mjs +34 -0
  128. package/shared/progress-it/index.mjs +38 -0
  129. package/shared/rules/index.mjs +53 -0
  130. package/shared/upload/index.mjs +771 -0
  131. package/components/button/src/ctx.js +0 -1
  132. package/components/cascader/src/ctx.js +0 -1
  133. package/components/cascader/src/types.js +0 -1
  134. package/components/cascader/src/use.js +0 -1
  135. package/components/checkbox/src/ctx.js +0 -1
  136. package/components/checkbox/src/index.css +0 -1
  137. package/components/checkbox/src/types.js +0 -1
  138. package/components/color-picker/index.css +0 -1
  139. package/components/color-picker/src/ctx.js +0 -1
  140. package/components/color-picker/src/index.css +0 -1
  141. package/components/color-picker/src/types.js +0 -1
  142. package/components/date-picker/index.css +0 -1
  143. package/components/date-picker/src/ctx.js +0 -1
  144. package/components/date-picker/src/index.css +0 -1
  145. package/components/date-picker/src/types.js +0 -1
  146. package/components/download-plus/src/api.js +0 -1
  147. package/components/download-plus/src/const.js +0 -1
  148. package/components/download-plus/src/ctx.js +0 -1
  149. package/components/download-plus/src/index.css +0 -1
  150. package/components/download-plus/src/types.js +0 -1
  151. package/components/esri-input-geojson/index.js +0 -1563
  152. package/components/esri-input-geojson/src/const.js +0 -1
  153. package/components/esri-input-geojson/src/ctx.js +0 -1
  154. package/components/esri-input-geojson/src/index.css +0 -1
  155. package/components/esri-input-geojson/src/types.js +0 -1
  156. package/components/form/index.css +0 -1
  157. package/components/form/src/ctx.js +0 -1
  158. package/components/form/src/index.css +0 -1
  159. package/components/form/src/types.js +0 -1
  160. package/components/form/src/utils.js +0 -1
  161. package/components/form-item/src/ctx.js +0 -1
  162. package/components/form-item/src/index.css +0 -1
  163. package/components/form-item/src/types.js +0 -1
  164. package/components/form-item-renderer/index.css +0 -1
  165. package/components/form-item-renderer/src/ctx.js +0 -1
  166. package/components/form-item-renderer/src/index.css +0 -1
  167. package/components/form-item-renderer/src/symbols.js +0 -1
  168. package/components/form-item-renderer/src/types.js +0 -1
  169. package/components/form-item-renderer-template/index.css +0 -1
  170. package/components/form-item-renderer-template/src/ctx.js +0 -1
  171. package/components/form-item-renderer-template/src/index.css +0 -1
  172. package/components/form-item-renderer-template/src/types.js +0 -1
  173. package/components/geoinput/index.css +0 -1
  174. package/components/geoinput/src/ctx.js +0 -1
  175. package/components/geoinput/src/index.css +0 -1
  176. package/components/geoinput/src/types.js +0 -1
  177. package/components/geoinput-read/src/ctx.js +0 -1
  178. package/components/geoinput-read/src/index.css +0 -1
  179. package/components/geoinput-read/src/types.js +0 -1
  180. package/components/geoinput-update/index.js +0 -930
  181. package/components/geoinput-update/src/ctx.js +0 -1
  182. package/components/geoinput-update/src/index.css +0 -1
  183. package/components/geoinput-update/src/types.js +0 -1
  184. package/components/input/index.css +0 -1
  185. package/components/input/src/ctx.js +0 -1
  186. package/components/input/src/index.css +0 -1
  187. package/components/input/src/types.js +0 -1
  188. package/components/input-link/index.js +0 -163
  189. package/components/input-link/src/ctx.js +0 -1
  190. package/components/input-link/src/index.css +0 -1
  191. package/components/input-link/src/types.js +0 -1
  192. package/components/input-number/src/ctx.js +0 -1
  193. package/components/input-number/src/index.css +0 -1
  194. package/components/input-number/src/types.js +0 -1
  195. package/components/radio/src/ctx.js +0 -1
  196. package/components/radio/src/index.css +0 -1
  197. package/components/radio/src/types.js +0 -1
  198. package/components/select/src/ctx.js +0 -1
  199. package/components/select/src/index.css +0 -1
  200. package/components/select/src/types.js +0 -1
  201. package/components/slider/index.css +0 -1
  202. package/components/slider/src/ctx.js +0 -1
  203. package/components/slider/src/index.css +0 -1
  204. package/components/slider/src/types.js +0 -1
  205. package/components/switch/src/ctx.js +0 -1
  206. package/components/switch/src/index.css +0 -1
  207. package/components/switch/src/types.js +0 -1
  208. package/components/templates-default/index.css +0 -1
  209. package/components/templates-default/index.js +0 -347
  210. package/components/templates-default/src/ctx.js +0 -1
  211. package/components/templates-default/src/index.css +0 -1
  212. package/components/templates-default/src/types.js +0 -1
  213. package/components/templates-element-plus/index.css +0 -1
  214. package/components/templates-element-plus/index.js +0 -110
  215. package/components/templates-element-plus/src/ctx.js +0 -1
  216. package/components/templates-element-plus/src/index.css +0 -1
  217. package/components/templates-element-plus/src/types.js +0 -1
  218. package/components/templates-esri/index.css +0 -1
  219. package/components/templates-esri/index.js +0 -65
  220. package/components/templates-esri/src/ctx.js +0 -1
  221. package/components/templates-esri/src/index.css +0 -1
  222. package/components/templates-esri/src/types.js +0 -1
  223. package/components/templates-layout/index.js +0 -141
  224. package/components/templates-layout/src/ctx.js +0 -1
  225. package/components/templates-layout/src/index.css +0 -1
  226. package/components/templates-layout/src/types.js +0 -1
  227. package/components/templates-mapbox/index.css +0 -1
  228. package/components/templates-mapbox/index.js +0 -65
  229. package/components/templates-mapbox/src/ctx.js +0 -1
  230. package/components/templates-mapbox/src/index.css +0 -1
  231. package/components/templates-mapbox/src/types.js +0 -1
  232. package/components/upload/index.js +0 -565
  233. package/components/upload/src/ctx.js +0 -1
  234. package/components/upload/src/index.css +0 -1
  235. package/components/upload/src/types.js +0 -1
  236. package/components/upload-plus/src/api.js +0 -28
  237. package/components/upload-plus/src/const.js +0 -1
  238. package/components/upload-plus/src/ctx.js +0 -1
  239. package/components/upload-plus/src/index.css +0 -1
  240. package/components/upload-plus/src/types.js +0 -1
  241. package/components/van-cascader/src/ctx.js +0 -1
  242. package/components/van-cascader/src/index.css +0 -1
  243. package/components/van-cascader/src/types.js +0 -1
  244. package/components/var-datetime-picker/index.js +0 -299
  245. package/components/var-datetime-picker/src/const.js +0 -1
  246. package/components/var-datetime-picker/src/ctx.js +0 -1
  247. package/components/var-datetime-picker/src/index.css +0 -1
  248. package/components/var-datetime-picker/src/types.js +0 -1
  249. package/components/vditor/index.css +0 -1
  250. package/components/vditor/src/ctx.js +0 -1
  251. package/components/vditor/src/index.css +0 -1
  252. package/components/vditor/src/types.js +0 -1
  253. package/composables/index.css +0 -1
  254. package/composables/index.js +0 -1
  255. package/shared/const/index.css +0 -1
  256. package/shared/const/index.js +0 -1
  257. package/shared/element-plus/index.css +0 -1
  258. package/shared/element-plus/index.js +0 -1
  259. package/shared/form/index.css +0 -1
  260. package/shared/form/index.js +0 -1
  261. package/shared/helper/index.css +0 -1
  262. package/shared/helper/index.js +0 -1
  263. package/shared/index.css +0 -1
  264. package/shared/index.js +0 -1
  265. package/shared/infer-prop/index.css +0 -1
  266. package/shared/infer-prop/index.js +0 -1
  267. package/shared/progress-it/index.css +0 -1
  268. package/shared/progress-it/index.js +0 -1
  269. package/shared/rules/index.css +0 -1
  270. package/shared/rules/index.js +0 -1
  271. package/shared/types/form/index.css +0 -1
  272. package/shared/types/form/index.js +0 -1
  273. package/shared/types/index.css +0 -1
  274. package/shared/types/index.js +0 -1
  275. package/shared/types/source/index.css +0 -1
  276. package/shared/types/source/index.js +0 -1
  277. package/shared/types/source-manager/index.css +0 -1
  278. package/shared/types/source-manager/index.js +0 -1
  279. package/shared/upload/index.css +0 -1
  280. package/shared/upload/index.js +0 -1
  281. /package/{components/button/index.css → shared/types/form/index.mjs} +0 -0
  282. /package/{components/button/src/index.css → shared/types/index.mjs} +0 -0
  283. /package/{components/cascader/src/index.css → shared/types/source/index.mjs} +0 -0
  284. /package/{components/button/src/types.js → shared/types/source-manager/index.mjs} +0 -0
@@ -0,0 +1,771 @@
1
+ function getDefaultExportFromCjs (x) {
2
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
3
+ }
4
+
5
+ var sparkMd5 = {exports: {}};
6
+
7
+ (function (module, exports) {
8
+ (function (factory) {
9
+ {
10
+ // Node/CommonJS
11
+ module.exports = factory();
12
+ }
13
+ }(function (undefined$1) {
14
+
15
+ /*
16
+ * Fastest md5 implementation around (JKM md5).
17
+ * Credits: Joseph Myers
18
+ *
19
+ * @see http://www.myersdaily.org/joseph/javascript/md5-text.html
20
+ * @see http://jsperf.com/md5-shootout/7
21
+ */
22
+
23
+ /* this function is much faster,
24
+ so if possible we use it. Some IEs
25
+ are the only ones I know of that
26
+ need the idiotic second function,
27
+ generated by an if clause. */
28
+ var hex_chr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];
29
+
30
+ function md5cycle(x, k) {
31
+ var a = x[0],
32
+ b = x[1],
33
+ c = x[2],
34
+ d = x[3];
35
+
36
+ a += (b & c | ~b & d) + k[0] - 680876936 | 0;
37
+ a = (a << 7 | a >>> 25) + b | 0;
38
+ d += (a & b | ~a & c) + k[1] - 389564586 | 0;
39
+ d = (d << 12 | d >>> 20) + a | 0;
40
+ c += (d & a | ~d & b) + k[2] + 606105819 | 0;
41
+ c = (c << 17 | c >>> 15) + d | 0;
42
+ b += (c & d | ~c & a) + k[3] - 1044525330 | 0;
43
+ b = (b << 22 | b >>> 10) + c | 0;
44
+ a += (b & c | ~b & d) + k[4] - 176418897 | 0;
45
+ a = (a << 7 | a >>> 25) + b | 0;
46
+ d += (a & b | ~a & c) + k[5] + 1200080426 | 0;
47
+ d = (d << 12 | d >>> 20) + a | 0;
48
+ c += (d & a | ~d & b) + k[6] - 1473231341 | 0;
49
+ c = (c << 17 | c >>> 15) + d | 0;
50
+ b += (c & d | ~c & a) + k[7] - 45705983 | 0;
51
+ b = (b << 22 | b >>> 10) + c | 0;
52
+ a += (b & c | ~b & d) + k[8] + 1770035416 | 0;
53
+ a = (a << 7 | a >>> 25) + b | 0;
54
+ d += (a & b | ~a & c) + k[9] - 1958414417 | 0;
55
+ d = (d << 12 | d >>> 20) + a | 0;
56
+ c += (d & a | ~d & b) + k[10] - 42063 | 0;
57
+ c = (c << 17 | c >>> 15) + d | 0;
58
+ b += (c & d | ~c & a) + k[11] - 1990404162 | 0;
59
+ b = (b << 22 | b >>> 10) + c | 0;
60
+ a += (b & c | ~b & d) + k[12] + 1804603682 | 0;
61
+ a = (a << 7 | a >>> 25) + b | 0;
62
+ d += (a & b | ~a & c) + k[13] - 40341101 | 0;
63
+ d = (d << 12 | d >>> 20) + a | 0;
64
+ c += (d & a | ~d & b) + k[14] - 1502002290 | 0;
65
+ c = (c << 17 | c >>> 15) + d | 0;
66
+ b += (c & d | ~c & a) + k[15] + 1236535329 | 0;
67
+ b = (b << 22 | b >>> 10) + c | 0;
68
+
69
+ a += (b & d | c & ~d) + k[1] - 165796510 | 0;
70
+ a = (a << 5 | a >>> 27) + b | 0;
71
+ d += (a & c | b & ~c) + k[6] - 1069501632 | 0;
72
+ d = (d << 9 | d >>> 23) + a | 0;
73
+ c += (d & b | a & ~b) + k[11] + 643717713 | 0;
74
+ c = (c << 14 | c >>> 18) + d | 0;
75
+ b += (c & a | d & ~a) + k[0] - 373897302 | 0;
76
+ b = (b << 20 | b >>> 12) + c | 0;
77
+ a += (b & d | c & ~d) + k[5] - 701558691 | 0;
78
+ a = (a << 5 | a >>> 27) + b | 0;
79
+ d += (a & c | b & ~c) + k[10] + 38016083 | 0;
80
+ d = (d << 9 | d >>> 23) + a | 0;
81
+ c += (d & b | a & ~b) + k[15] - 660478335 | 0;
82
+ c = (c << 14 | c >>> 18) + d | 0;
83
+ b += (c & a | d & ~a) + k[4] - 405537848 | 0;
84
+ b = (b << 20 | b >>> 12) + c | 0;
85
+ a += (b & d | c & ~d) + k[9] + 568446438 | 0;
86
+ a = (a << 5 | a >>> 27) + b | 0;
87
+ d += (a & c | b & ~c) + k[14] - 1019803690 | 0;
88
+ d = (d << 9 | d >>> 23) + a | 0;
89
+ c += (d & b | a & ~b) + k[3] - 187363961 | 0;
90
+ c = (c << 14 | c >>> 18) + d | 0;
91
+ b += (c & a | d & ~a) + k[8] + 1163531501 | 0;
92
+ b = (b << 20 | b >>> 12) + c | 0;
93
+ a += (b & d | c & ~d) + k[13] - 1444681467 | 0;
94
+ a = (a << 5 | a >>> 27) + b | 0;
95
+ d += (a & c | b & ~c) + k[2] - 51403784 | 0;
96
+ d = (d << 9 | d >>> 23) + a | 0;
97
+ c += (d & b | a & ~b) + k[7] + 1735328473 | 0;
98
+ c = (c << 14 | c >>> 18) + d | 0;
99
+ b += (c & a | d & ~a) + k[12] - 1926607734 | 0;
100
+ b = (b << 20 | b >>> 12) + c | 0;
101
+
102
+ a += (b ^ c ^ d) + k[5] - 378558 | 0;
103
+ a = (a << 4 | a >>> 28) + b | 0;
104
+ d += (a ^ b ^ c) + k[8] - 2022574463 | 0;
105
+ d = (d << 11 | d >>> 21) + a | 0;
106
+ c += (d ^ a ^ b) + k[11] + 1839030562 | 0;
107
+ c = (c << 16 | c >>> 16) + d | 0;
108
+ b += (c ^ d ^ a) + k[14] - 35309556 | 0;
109
+ b = (b << 23 | b >>> 9) + c | 0;
110
+ a += (b ^ c ^ d) + k[1] - 1530992060 | 0;
111
+ a = (a << 4 | a >>> 28) + b | 0;
112
+ d += (a ^ b ^ c) + k[4] + 1272893353 | 0;
113
+ d = (d << 11 | d >>> 21) + a | 0;
114
+ c += (d ^ a ^ b) + k[7] - 155497632 | 0;
115
+ c = (c << 16 | c >>> 16) + d | 0;
116
+ b += (c ^ d ^ a) + k[10] - 1094730640 | 0;
117
+ b = (b << 23 | b >>> 9) + c | 0;
118
+ a += (b ^ c ^ d) + k[13] + 681279174 | 0;
119
+ a = (a << 4 | a >>> 28) + b | 0;
120
+ d += (a ^ b ^ c) + k[0] - 358537222 | 0;
121
+ d = (d << 11 | d >>> 21) + a | 0;
122
+ c += (d ^ a ^ b) + k[3] - 722521979 | 0;
123
+ c = (c << 16 | c >>> 16) + d | 0;
124
+ b += (c ^ d ^ a) + k[6] + 76029189 | 0;
125
+ b = (b << 23 | b >>> 9) + c | 0;
126
+ a += (b ^ c ^ d) + k[9] - 640364487 | 0;
127
+ a = (a << 4 | a >>> 28) + b | 0;
128
+ d += (a ^ b ^ c) + k[12] - 421815835 | 0;
129
+ d = (d << 11 | d >>> 21) + a | 0;
130
+ c += (d ^ a ^ b) + k[15] + 530742520 | 0;
131
+ c = (c << 16 | c >>> 16) + d | 0;
132
+ b += (c ^ d ^ a) + k[2] - 995338651 | 0;
133
+ b = (b << 23 | b >>> 9) + c | 0;
134
+
135
+ a += (c ^ (b | ~d)) + k[0] - 198630844 | 0;
136
+ a = (a << 6 | a >>> 26) + b | 0;
137
+ d += (b ^ (a | ~c)) + k[7] + 1126891415 | 0;
138
+ d = (d << 10 | d >>> 22) + a | 0;
139
+ c += (a ^ (d | ~b)) + k[14] - 1416354905 | 0;
140
+ c = (c << 15 | c >>> 17) + d | 0;
141
+ b += (d ^ (c | ~a)) + k[5] - 57434055 | 0;
142
+ b = (b << 21 |b >>> 11) + c | 0;
143
+ a += (c ^ (b | ~d)) + k[12] + 1700485571 | 0;
144
+ a = (a << 6 | a >>> 26) + b | 0;
145
+ d += (b ^ (a | ~c)) + k[3] - 1894986606 | 0;
146
+ d = (d << 10 | d >>> 22) + a | 0;
147
+ c += (a ^ (d | ~b)) + k[10] - 1051523 | 0;
148
+ c = (c << 15 | c >>> 17) + d | 0;
149
+ b += (d ^ (c | ~a)) + k[1] - 2054922799 | 0;
150
+ b = (b << 21 |b >>> 11) + c | 0;
151
+ a += (c ^ (b | ~d)) + k[8] + 1873313359 | 0;
152
+ a = (a << 6 | a >>> 26) + b | 0;
153
+ d += (b ^ (a | ~c)) + k[15] - 30611744 | 0;
154
+ d = (d << 10 | d >>> 22) + a | 0;
155
+ c += (a ^ (d | ~b)) + k[6] - 1560198380 | 0;
156
+ c = (c << 15 | c >>> 17) + d | 0;
157
+ b += (d ^ (c | ~a)) + k[13] + 1309151649 | 0;
158
+ b = (b << 21 |b >>> 11) + c | 0;
159
+ a += (c ^ (b | ~d)) + k[4] - 145523070 | 0;
160
+ a = (a << 6 | a >>> 26) + b | 0;
161
+ d += (b ^ (a | ~c)) + k[11] - 1120210379 | 0;
162
+ d = (d << 10 | d >>> 22) + a | 0;
163
+ c += (a ^ (d | ~b)) + k[2] + 718787259 | 0;
164
+ c = (c << 15 | c >>> 17) + d | 0;
165
+ b += (d ^ (c | ~a)) + k[9] - 343485551 | 0;
166
+ b = (b << 21 | b >>> 11) + c | 0;
167
+
168
+ x[0] = a + x[0] | 0;
169
+ x[1] = b + x[1] | 0;
170
+ x[2] = c + x[2] | 0;
171
+ x[3] = d + x[3] | 0;
172
+ }
173
+
174
+ function md5blk(s) {
175
+ var md5blks = [],
176
+ i; /* Andy King said do it this way. */
177
+
178
+ for (i = 0; i < 64; i += 4) {
179
+ md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);
180
+ }
181
+ return md5blks;
182
+ }
183
+
184
+ function md5blk_array(a) {
185
+ var md5blks = [],
186
+ i; /* Andy King said do it this way. */
187
+
188
+ for (i = 0; i < 64; i += 4) {
189
+ md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24);
190
+ }
191
+ return md5blks;
192
+ }
193
+
194
+ function md51(s) {
195
+ var n = s.length,
196
+ state = [1732584193, -271733879, -1732584194, 271733878],
197
+ i,
198
+ length,
199
+ tail,
200
+ tmp,
201
+ lo,
202
+ hi;
203
+
204
+ for (i = 64; i <= n; i += 64) {
205
+ md5cycle(state, md5blk(s.substring(i - 64, i)));
206
+ }
207
+ s = s.substring(i - 64);
208
+ length = s.length;
209
+ tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
210
+ for (i = 0; i < length; i += 1) {
211
+ tail[i >> 2] |= s.charCodeAt(i) << ((i % 4) << 3);
212
+ }
213
+ tail[i >> 2] |= 0x80 << ((i % 4) << 3);
214
+ if (i > 55) {
215
+ md5cycle(state, tail);
216
+ for (i = 0; i < 16; i += 1) {
217
+ tail[i] = 0;
218
+ }
219
+ }
220
+
221
+ // Beware that the final length might not fit in 32 bits so we take care of that
222
+ tmp = n * 8;
223
+ tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
224
+ lo = parseInt(tmp[2], 16);
225
+ hi = parseInt(tmp[1], 16) || 0;
226
+
227
+ tail[14] = lo;
228
+ tail[15] = hi;
229
+
230
+ md5cycle(state, tail);
231
+ return state;
232
+ }
233
+
234
+ function md51_array(a) {
235
+ var n = a.length,
236
+ state = [1732584193, -271733879, -1732584194, 271733878],
237
+ i,
238
+ length,
239
+ tail,
240
+ tmp,
241
+ lo,
242
+ hi;
243
+
244
+ for (i = 64; i <= n; i += 64) {
245
+ md5cycle(state, md5blk_array(a.subarray(i - 64, i)));
246
+ }
247
+
248
+ // Not sure if it is a bug, however IE10 will always produce a sub array of length 1
249
+ // containing the last element of the parent array if the sub array specified starts
250
+ // beyond the length of the parent array - weird.
251
+ // https://connect.microsoft.com/IE/feedback/details/771452/typed-array-subarray-issue
252
+ a = (i - 64) < n ? a.subarray(i - 64) : new Uint8Array(0);
253
+
254
+ length = a.length;
255
+ tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
256
+ for (i = 0; i < length; i += 1) {
257
+ tail[i >> 2] |= a[i] << ((i % 4) << 3);
258
+ }
259
+
260
+ tail[i >> 2] |= 0x80 << ((i % 4) << 3);
261
+ if (i > 55) {
262
+ md5cycle(state, tail);
263
+ for (i = 0; i < 16; i += 1) {
264
+ tail[i] = 0;
265
+ }
266
+ }
267
+
268
+ // Beware that the final length might not fit in 32 bits so we take care of that
269
+ tmp = n * 8;
270
+ tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
271
+ lo = parseInt(tmp[2], 16);
272
+ hi = parseInt(tmp[1], 16) || 0;
273
+
274
+ tail[14] = lo;
275
+ tail[15] = hi;
276
+
277
+ md5cycle(state, tail);
278
+
279
+ return state;
280
+ }
281
+
282
+ function rhex(n) {
283
+ var s = '',
284
+ j;
285
+ for (j = 0; j < 4; j += 1) {
286
+ s += hex_chr[(n >> (j * 8 + 4)) & 0x0F] + hex_chr[(n >> (j * 8)) & 0x0F];
287
+ }
288
+ return s;
289
+ }
290
+
291
+ function hex(x) {
292
+ var i;
293
+ for (i = 0; i < x.length; i += 1) {
294
+ x[i] = rhex(x[i]);
295
+ }
296
+ return x.join('');
297
+ }
298
+
299
+ // In some cases the fast add32 function cannot be used..
300
+ if (hex(md51('hello')) !== '5d41402abc4b2a76b9719d911017c592') ;
301
+
302
+ // ---------------------------------------------------
303
+
304
+ /**
305
+ * ArrayBuffer slice polyfill.
306
+ *
307
+ * @see https://github.com/ttaubert/node-arraybuffer-slice
308
+ */
309
+
310
+ if (typeof ArrayBuffer !== 'undefined' && !ArrayBuffer.prototype.slice) {
311
+ (function () {
312
+ function clamp(val, length) {
313
+ val = (val | 0) || 0;
314
+
315
+ if (val < 0) {
316
+ return Math.max(val + length, 0);
317
+ }
318
+
319
+ return Math.min(val, length);
320
+ }
321
+
322
+ ArrayBuffer.prototype.slice = function (from, to) {
323
+ var length = this.byteLength,
324
+ begin = clamp(from, length),
325
+ end = length,
326
+ num,
327
+ target,
328
+ targetArray,
329
+ sourceArray;
330
+
331
+ if (to !== undefined$1) {
332
+ end = clamp(to, length);
333
+ }
334
+
335
+ if (begin > end) {
336
+ return new ArrayBuffer(0);
337
+ }
338
+
339
+ num = end - begin;
340
+ target = new ArrayBuffer(num);
341
+ targetArray = new Uint8Array(target);
342
+
343
+ sourceArray = new Uint8Array(this, begin, num);
344
+ targetArray.set(sourceArray);
345
+
346
+ return target;
347
+ };
348
+ })();
349
+ }
350
+
351
+ // ---------------------------------------------------
352
+
353
+ /**
354
+ * Helpers.
355
+ */
356
+
357
+ function toUtf8(str) {
358
+ if (/[\u0080-\uFFFF]/.test(str)) {
359
+ str = unescape(encodeURIComponent(str));
360
+ }
361
+
362
+ return str;
363
+ }
364
+
365
+ function utf8Str2ArrayBuffer(str, returnUInt8Array) {
366
+ var length = str.length,
367
+ buff = new ArrayBuffer(length),
368
+ arr = new Uint8Array(buff),
369
+ i;
370
+
371
+ for (i = 0; i < length; i += 1) {
372
+ arr[i] = str.charCodeAt(i);
373
+ }
374
+
375
+ return returnUInt8Array ? arr : buff;
376
+ }
377
+
378
+ function arrayBuffer2Utf8Str(buff) {
379
+ return String.fromCharCode.apply(null, new Uint8Array(buff));
380
+ }
381
+
382
+ function concatenateArrayBuffers(first, second, returnUInt8Array) {
383
+ var result = new Uint8Array(first.byteLength + second.byteLength);
384
+
385
+ result.set(new Uint8Array(first));
386
+ result.set(new Uint8Array(second), first.byteLength);
387
+
388
+ return result ;
389
+ }
390
+
391
+ function hexToBinaryString(hex) {
392
+ var bytes = [],
393
+ length = hex.length,
394
+ x;
395
+
396
+ for (x = 0; x < length - 1; x += 2) {
397
+ bytes.push(parseInt(hex.substr(x, 2), 16));
398
+ }
399
+
400
+ return String.fromCharCode.apply(String, bytes);
401
+ }
402
+
403
+ // ---------------------------------------------------
404
+
405
+ /**
406
+ * SparkMD5 OOP implementation.
407
+ *
408
+ * Use this class to perform an incremental md5, otherwise use the
409
+ * static methods instead.
410
+ */
411
+
412
+ function SparkMD5() {
413
+ // call reset to init the instance
414
+ this.reset();
415
+ }
416
+
417
+ /**
418
+ * Appends a string.
419
+ * A conversion will be applied if an utf8 string is detected.
420
+ *
421
+ * @param {String} str The string to be appended
422
+ *
423
+ * @return {SparkMD5} The instance itself
424
+ */
425
+ SparkMD5.prototype.append = function (str) {
426
+ // Converts the string to utf8 bytes if necessary
427
+ // Then append as binary
428
+ this.appendBinary(toUtf8(str));
429
+
430
+ return this;
431
+ };
432
+
433
+ /**
434
+ * Appends a binary string.
435
+ *
436
+ * @param {String} contents The binary string to be appended
437
+ *
438
+ * @return {SparkMD5} The instance itself
439
+ */
440
+ SparkMD5.prototype.appendBinary = function (contents) {
441
+ this._buff += contents;
442
+ this._length += contents.length;
443
+
444
+ var length = this._buff.length,
445
+ i;
446
+
447
+ for (i = 64; i <= length; i += 64) {
448
+ md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i)));
449
+ }
450
+
451
+ this._buff = this._buff.substring(i - 64);
452
+
453
+ return this;
454
+ };
455
+
456
+ /**
457
+ * Finishes the incremental computation, reseting the internal state and
458
+ * returning the result.
459
+ *
460
+ * @param {Boolean} raw True to get the raw string, false to get the hex string
461
+ *
462
+ * @return {String} The result
463
+ */
464
+ SparkMD5.prototype.end = function (raw) {
465
+ var buff = this._buff,
466
+ length = buff.length,
467
+ i,
468
+ tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
469
+ ret;
470
+
471
+ for (i = 0; i < length; i += 1) {
472
+ tail[i >> 2] |= buff.charCodeAt(i) << ((i % 4) << 3);
473
+ }
474
+
475
+ this._finish(tail, length);
476
+ ret = hex(this._hash);
477
+
478
+ if (raw) {
479
+ ret = hexToBinaryString(ret);
480
+ }
481
+
482
+ this.reset();
483
+
484
+ return ret;
485
+ };
486
+
487
+ /**
488
+ * Resets the internal state of the computation.
489
+ *
490
+ * @return {SparkMD5} The instance itself
491
+ */
492
+ SparkMD5.prototype.reset = function () {
493
+ this._buff = '';
494
+ this._length = 0;
495
+ this._hash = [1732584193, -271733879, -1732584194, 271733878];
496
+
497
+ return this;
498
+ };
499
+
500
+ /**
501
+ * Gets the internal state of the computation.
502
+ *
503
+ * @return {Object} The state
504
+ */
505
+ SparkMD5.prototype.getState = function () {
506
+ return {
507
+ buff: this._buff,
508
+ length: this._length,
509
+ hash: this._hash.slice()
510
+ };
511
+ };
512
+
513
+ /**
514
+ * Gets the internal state of the computation.
515
+ *
516
+ * @param {Object} state The state
517
+ *
518
+ * @return {SparkMD5} The instance itself
519
+ */
520
+ SparkMD5.prototype.setState = function (state) {
521
+ this._buff = state.buff;
522
+ this._length = state.length;
523
+ this._hash = state.hash;
524
+
525
+ return this;
526
+ };
527
+
528
+ /**
529
+ * Releases memory used by the incremental buffer and other additional
530
+ * resources. If you plan to use the instance again, use reset instead.
531
+ */
532
+ SparkMD5.prototype.destroy = function () {
533
+ delete this._hash;
534
+ delete this._buff;
535
+ delete this._length;
536
+ };
537
+
538
+ /**
539
+ * Finish the final calculation based on the tail.
540
+ *
541
+ * @param {Array} tail The tail (will be modified)
542
+ * @param {Number} length The length of the remaining buffer
543
+ */
544
+ SparkMD5.prototype._finish = function (tail, length) {
545
+ var i = length,
546
+ tmp,
547
+ lo,
548
+ hi;
549
+
550
+ tail[i >> 2] |= 0x80 << ((i % 4) << 3);
551
+ if (i > 55) {
552
+ md5cycle(this._hash, tail);
553
+ for (i = 0; i < 16; i += 1) {
554
+ tail[i] = 0;
555
+ }
556
+ }
557
+
558
+ // Do the final computation based on the tail and length
559
+ // Beware that the final length may not fit in 32 bits so we take care of that
560
+ tmp = this._length * 8;
561
+ tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
562
+ lo = parseInt(tmp[2], 16);
563
+ hi = parseInt(tmp[1], 16) || 0;
564
+
565
+ tail[14] = lo;
566
+ tail[15] = hi;
567
+ md5cycle(this._hash, tail);
568
+ };
569
+
570
+ /**
571
+ * Performs the md5 hash on a string.
572
+ * A conversion will be applied if utf8 string is detected.
573
+ *
574
+ * @param {String} str The string
575
+ * @param {Boolean} [raw] True to get the raw string, false to get the hex string
576
+ *
577
+ * @return {String} The result
578
+ */
579
+ SparkMD5.hash = function (str, raw) {
580
+ // Converts the string to utf8 bytes if necessary
581
+ // Then compute it using the binary function
582
+ return SparkMD5.hashBinary(toUtf8(str), raw);
583
+ };
584
+
585
+ /**
586
+ * Performs the md5 hash on a binary string.
587
+ *
588
+ * @param {String} content The binary string
589
+ * @param {Boolean} [raw] True to get the raw string, false to get the hex string
590
+ *
591
+ * @return {String} The result
592
+ */
593
+ SparkMD5.hashBinary = function (content, raw) {
594
+ var hash = md51(content),
595
+ ret = hex(hash);
596
+
597
+ return raw ? hexToBinaryString(ret) : ret;
598
+ };
599
+
600
+ // ---------------------------------------------------
601
+
602
+ /**
603
+ * SparkMD5 OOP implementation for array buffers.
604
+ *
605
+ * Use this class to perform an incremental md5 ONLY for array buffers.
606
+ */
607
+ SparkMD5.ArrayBuffer = function () {
608
+ // call reset to init the instance
609
+ this.reset();
610
+ };
611
+
612
+ /**
613
+ * Appends an array buffer.
614
+ *
615
+ * @param {ArrayBuffer} arr The array to be appended
616
+ *
617
+ * @return {SparkMD5.ArrayBuffer} The instance itself
618
+ */
619
+ SparkMD5.ArrayBuffer.prototype.append = function (arr) {
620
+ var buff = concatenateArrayBuffers(this._buff.buffer, arr),
621
+ length = buff.length,
622
+ i;
623
+
624
+ this._length += arr.byteLength;
625
+
626
+ for (i = 64; i <= length; i += 64) {
627
+ md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i)));
628
+ }
629
+
630
+ this._buff = (i - 64) < length ? new Uint8Array(buff.buffer.slice(i - 64)) : new Uint8Array(0);
631
+
632
+ return this;
633
+ };
634
+
635
+ /**
636
+ * Finishes the incremental computation, reseting the internal state and
637
+ * returning the result.
638
+ *
639
+ * @param {Boolean} raw True to get the raw string, false to get the hex string
640
+ *
641
+ * @return {String} The result
642
+ */
643
+ SparkMD5.ArrayBuffer.prototype.end = function (raw) {
644
+ var buff = this._buff,
645
+ length = buff.length,
646
+ tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
647
+ i,
648
+ ret;
649
+
650
+ for (i = 0; i < length; i += 1) {
651
+ tail[i >> 2] |= buff[i] << ((i % 4) << 3);
652
+ }
653
+
654
+ this._finish(tail, length);
655
+ ret = hex(this._hash);
656
+
657
+ if (raw) {
658
+ ret = hexToBinaryString(ret);
659
+ }
660
+
661
+ this.reset();
662
+
663
+ return ret;
664
+ };
665
+
666
+ /**
667
+ * Resets the internal state of the computation.
668
+ *
669
+ * @return {SparkMD5.ArrayBuffer} The instance itself
670
+ */
671
+ SparkMD5.ArrayBuffer.prototype.reset = function () {
672
+ this._buff = new Uint8Array(0);
673
+ this._length = 0;
674
+ this._hash = [1732584193, -271733879, -1732584194, 271733878];
675
+
676
+ return this;
677
+ };
678
+
679
+ /**
680
+ * Gets the internal state of the computation.
681
+ *
682
+ * @return {Object} The state
683
+ */
684
+ SparkMD5.ArrayBuffer.prototype.getState = function () {
685
+ var state = SparkMD5.prototype.getState.call(this);
686
+
687
+ // Convert buffer to a string
688
+ state.buff = arrayBuffer2Utf8Str(state.buff);
689
+
690
+ return state;
691
+ };
692
+
693
+ /**
694
+ * Gets the internal state of the computation.
695
+ *
696
+ * @param {Object} state The state
697
+ *
698
+ * @return {SparkMD5.ArrayBuffer} The instance itself
699
+ */
700
+ SparkMD5.ArrayBuffer.prototype.setState = function (state) {
701
+ // Convert string to buffer
702
+ state.buff = utf8Str2ArrayBuffer(state.buff, true);
703
+
704
+ return SparkMD5.prototype.setState.call(this, state);
705
+ };
706
+
707
+ SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;
708
+
709
+ SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;
710
+
711
+ /**
712
+ * Performs the md5 hash on an array buffer.
713
+ *
714
+ * @param {ArrayBuffer} arr The array buffer
715
+ * @param {Boolean} [raw] True to get the raw string, false to get the hex one
716
+ *
717
+ * @return {String} The result
718
+ */
719
+ SparkMD5.ArrayBuffer.hash = function (arr, raw) {
720
+ var hash = md51_array(new Uint8Array(arr)),
721
+ ret = hex(hash);
722
+
723
+ return raw ? hexToBinaryString(ret) : ret;
724
+ };
725
+
726
+ return SparkMD5;
727
+ }));
728
+ } (sparkMd5));
729
+
730
+ var sparkMd5Exports = sparkMd5.exports;
731
+ var SparkMD5 = /*@__PURE__*/getDefaultExportFromCjs(sparkMd5Exports);
732
+
733
+ function createFileChunk(file, size) {
734
+ const chunks = [];
735
+ let cur = 0;
736
+ const intSize = parseInt(size + "");
737
+ while (cur < file.size) {
738
+ chunks.push(file.slice(cur, cur + intSize));
739
+ cur += intSize;
740
+ }
741
+ return chunks;
742
+ }
743
+ function calculateFileHashSample(file) {
744
+ return new Promise((resolve) => {
745
+ const spark = new SparkMD5.ArrayBuffer();
746
+ const reader = new FileReader();
747
+ const size = file.size;
748
+ const offset = 2 * 1024 * 1024;
749
+ const chunks = [file.slice(0, offset)];
750
+ let cur = offset;
751
+ while (cur < size) {
752
+ if (cur + offset >= size) {
753
+ chunks.push(file.slice(cur, cur + offset));
754
+ } else {
755
+ const mid = cur + offset / 2;
756
+ const end = cur + offset;
757
+ chunks.push(file.slice(cur, cur + 2));
758
+ chunks.push(file.slice(mid, mid + 2));
759
+ chunks.push(file.slice(end - 2, end));
760
+ }
761
+ cur += offset;
762
+ }
763
+ reader.readAsArrayBuffer(new Blob(chunks));
764
+ reader.onload = (e) => {
765
+ spark.append(e.target?.result);
766
+ resolve(spark.end());
767
+ };
768
+ });
769
+ }
770
+
771
+ export { calculateFileHashSample, createFileChunk };