@wener/utils 1.0.0-alpha.8 → 1.1.0

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 (360) hide show
  1. package/LICENSE.md +7 -0
  2. package/README.md +28 -0
  3. package/dist/utils.cjs +497 -0
  4. package/dist/utils.cjs.map +7 -0
  5. package/dist/utils.js +445 -0
  6. package/dist/utils.js.map +7 -0
  7. package/dist/utils.mjs +475 -0
  8. package/dist/utils.mjs.map +7 -0
  9. package/jest.config.js +8 -6
  10. package/lib/{arrays → cjs/arrays}/MaybeArray.d.ts +1 -0
  11. package/lib/{arrays → cjs/arrays}/MaybeArray.js +8 -0
  12. package/lib/cjs/arrays/MaybeArray.js.map +1 -0
  13. package/lib/{arrays → cjs/arrays}/index.d.ts +0 -0
  14. package/lib/cjs/arrays/index.js +5 -0
  15. package/lib/cjs/arrays/index.js.map +1 -0
  16. package/lib/{asyncs → cjs/asyncs}/AsyncInterval.d.ts +0 -0
  17. package/lib/{asyncs → cjs/asyncs}/AsyncInterval.js +2 -1
  18. package/lib/cjs/asyncs/AsyncInterval.js.map +1 -0
  19. package/lib/{asyncs → cjs/asyncs}/LazyPromise.d.ts +0 -0
  20. package/lib/cjs/asyncs/LazyPromise.js +26 -0
  21. package/lib/cjs/asyncs/LazyPromise.js.map +1 -0
  22. package/lib/cjs/asyncs/MaybePromise.d.ts +1 -0
  23. package/lib/cjs/asyncs/MaybePromise.js +3 -0
  24. package/lib/cjs/asyncs/MaybePromise.js.map +1 -0
  25. package/lib/cjs/asyncs/generatorOfStream.d.ts +1 -0
  26. package/lib/cjs/asyncs/generatorOfStream.js +18 -0
  27. package/lib/cjs/asyncs/generatorOfStream.js.map +1 -0
  28. package/lib/cjs/asyncs/index.d.ts +7 -0
  29. package/lib/cjs/asyncs/index.js +11 -0
  30. package/lib/cjs/asyncs/index.js.map +1 -0
  31. package/lib/cjs/asyncs/isPromise.d.ts +1 -0
  32. package/lib/cjs/asyncs/isPromise.js +8 -0
  33. package/lib/cjs/asyncs/isPromise.js.map +1 -0
  34. package/lib/cjs/asyncs/promiseOfCallback.d.ts +1 -0
  35. package/lib/cjs/asyncs/promiseOfCallback.js +22 -0
  36. package/lib/cjs/asyncs/promiseOfCallback.js.map +1 -0
  37. package/lib/{asyncs → cjs/asyncs}/sleep.d.ts +0 -0
  38. package/lib/cjs/asyncs/sleep.js +6 -0
  39. package/lib/cjs/asyncs/sleep.js.map +1 -0
  40. package/lib/cjs/asyncs/timeout.d.ts +4 -0
  41. package/lib/cjs/asyncs/timeout.js +27 -0
  42. package/lib/cjs/asyncs/timeout.js.map +1 -0
  43. package/lib/{browsers/clipboard.d.ts → cjs/browsers/copy.d.ts} +0 -0
  44. package/lib/{browsers/clipboard.js → cjs/browsers/copy.js} +3 -3
  45. package/lib/cjs/browsers/copy.js.map +1 -0
  46. package/lib/{browsers → cjs/browsers}/download.d.ts +0 -0
  47. package/lib/{browsers → cjs/browsers}/download.js +1 -0
  48. package/lib/cjs/browsers/download.js.map +1 -0
  49. package/lib/cjs/browsers/getFileFromDataTransfer.d.ts +4 -0
  50. package/lib/{browsers/transfers.js → cjs/browsers/getFileFromDataTransfer.js} +15 -11
  51. package/lib/cjs/browsers/getFileFromDataTransfer.js.map +1 -0
  52. package/lib/cjs/browsers/index.d.ts +4 -0
  53. package/lib/cjs/browsers/index.js +8 -0
  54. package/lib/cjs/browsers/index.js.map +1 -0
  55. package/lib/{browsers → cjs/browsers}/loaders.d.ts +0 -0
  56. package/lib/{browsers → cjs/browsers}/loaders.js +2 -1
  57. package/lib/cjs/browsers/loaders.js.map +1 -0
  58. package/lib/cjs/formats/formatBytes.d.ts +11 -0
  59. package/lib/cjs/formats/formatBytes.js +31 -0
  60. package/lib/cjs/formats/formatBytes.js.map +1 -0
  61. package/lib/cjs/index.d.ts +9 -0
  62. package/lib/cjs/index.js +15 -0
  63. package/lib/cjs/index.js.map +1 -0
  64. package/lib/{io → cjs/io}/index.d.ts +0 -0
  65. package/lib/cjs/io/index.js +5 -0
  66. package/lib/{io → cjs/io}/index.js.map +1 -1
  67. package/lib/{io → cjs/io}/isBuffer.d.ts +0 -0
  68. package/lib/{io → cjs/io}/isBuffer.js +1 -0
  69. package/lib/cjs/io/isBuffer.js.map +1 -0
  70. package/lib/{isomorphics → cjs/isomorphics}/getGlobalThis.d.ts +1 -1
  71. package/lib/{isomorphics → cjs/isomorphics}/getGlobalThis.js +5 -6
  72. package/lib/cjs/isomorphics/getGlobalThis.js.map +1 -0
  73. package/lib/{isomorphics → cjs/isomorphics}/index.d.ts +0 -0
  74. package/lib/cjs/isomorphics/index.js +5 -0
  75. package/lib/cjs/isomorphics/index.js.map +1 -0
  76. package/lib/{maths → cjs/maths}/index.d.ts +0 -0
  77. package/lib/cjs/maths/index.js +5 -0
  78. package/lib/{arrays → cjs/maths}/index.js.map +1 -1
  79. package/lib/cjs/maths/random.d.ts +3 -0
  80. package/lib/{maths → cjs/maths}/random.js +6 -5
  81. package/lib/cjs/maths/random.js.map +1 -0
  82. package/lib/{strings → cjs/strings}/camelCase.d.ts +0 -0
  83. package/lib/{strings → cjs/strings}/camelCase.js +2 -1
  84. package/lib/cjs/strings/camelCase.js.map +1 -0
  85. package/lib/{strings → cjs/strings}/index.d.ts +1 -0
  86. package/lib/cjs/strings/index.js +7 -0
  87. package/lib/cjs/strings/index.js.map +1 -0
  88. package/lib/{strings → cjs/strings}/templates.d.ts +1 -1
  89. package/lib/{strings → cjs/strings}/templates.js +3 -3
  90. package/lib/cjs/strings/templates.js.map +1 -0
  91. package/lib/cjs/strings/urljoin.d.ts +2 -0
  92. package/lib/cjs/strings/urljoin.js +69 -0
  93. package/lib/cjs/strings/urljoin.js.map +1 -0
  94. package/lib/cjs/strings/urljoin.test.d.ts +1 -0
  95. package/lib/cjs/strings/urljoin.test.js +7 -0
  96. package/lib/cjs/strings/urljoin.test.js.map +1 -0
  97. package/lib/{validations → cjs/validations}/asserts.d.ts +0 -0
  98. package/lib/{validations → cjs/validations}/asserts.js +1 -0
  99. package/lib/cjs/validations/asserts.js.map +1 -0
  100. package/lib/cjs/validations/index.d.ts +4 -0
  101. package/lib/cjs/validations/index.js +8 -0
  102. package/lib/cjs/validations/index.js.map +1 -0
  103. package/lib/cjs/validations/isClass.d.ts +1 -0
  104. package/lib/cjs/validations/isClass.js +8 -0
  105. package/lib/cjs/validations/isClass.js.map +1 -0
  106. package/lib/cjs/validations/isDefined.d.ts +1 -0
  107. package/lib/cjs/validations/isDefined.js +8 -0
  108. package/lib/cjs/validations/isDefined.js.map +1 -0
  109. package/lib/cjs/validations/isEmptyObject.d.ts +1 -0
  110. package/lib/cjs/validations/isEmptyObject.js +11 -0
  111. package/lib/cjs/validations/isEmptyObject.js.map +1 -0
  112. package/lib/esm/arrays/MaybeArray.d.ts +5 -0
  113. package/lib/esm/arrays/MaybeArray.js +33 -0
  114. package/lib/esm/arrays/index.d.ts +1 -0
  115. package/lib/esm/arrays/index.js +1 -0
  116. package/lib/esm/asyncs/AsyncInterval.d.ts +3 -0
  117. package/lib/esm/asyncs/AsyncInterval.js +16 -0
  118. package/lib/esm/asyncs/LazyPromise.d.ts +5 -0
  119. package/lib/esm/asyncs/LazyPromise.js +24 -0
  120. package/lib/esm/asyncs/MaybePromise.d.ts +1 -0
  121. package/lib/esm/asyncs/MaybePromise.js +0 -0
  122. package/lib/esm/asyncs/generatorOfStream.d.ts +1 -0
  123. package/lib/esm/asyncs/generatorOfStream.js +16 -0
  124. package/lib/esm/asyncs/index.d.ts +7 -0
  125. package/lib/esm/asyncs/index.js +7 -0
  126. package/lib/esm/asyncs/isPromise.d.ts +1 -0
  127. package/lib/esm/asyncs/isPromise.js +6 -0
  128. package/lib/esm/asyncs/promiseOfCallback.d.ts +1 -0
  129. package/lib/esm/asyncs/promiseOfCallback.js +18 -0
  130. package/lib/esm/asyncs/sleep.d.ts +1 -0
  131. package/lib/esm/asyncs/sleep.js +4 -0
  132. package/lib/esm/asyncs/timeout.d.ts +4 -0
  133. package/lib/esm/asyncs/timeout.js +25 -0
  134. package/lib/esm/browsers/copy.d.ts +1 -0
  135. package/lib/esm/browsers/copy.js +52 -0
  136. package/lib/esm/browsers/download.d.ts +4 -0
  137. package/lib/esm/browsers/download.js +28 -0
  138. package/lib/esm/browsers/getFileFromDataTransfer.d.ts +4 -0
  139. package/lib/esm/browsers/getFileFromDataTransfer.js +29 -0
  140. package/lib/esm/browsers/index.d.ts +4 -0
  141. package/lib/esm/browsers/index.js +4 -0
  142. package/lib/esm/browsers/loaders.d.ts +6 -0
  143. package/lib/esm/browsers/loaders.js +35 -0
  144. package/lib/esm/formats/formatBytes.d.ts +11 -0
  145. package/lib/esm/formats/formatBytes.js +17 -0
  146. package/lib/esm/index.d.ts +9 -0
  147. package/lib/esm/index.js +12 -0
  148. package/lib/esm/io/index.d.ts +1 -0
  149. package/lib/esm/io/index.js +1 -0
  150. package/lib/esm/io/isBuffer.d.ts +2 -0
  151. package/lib/esm/io/isBuffer.js +6 -0
  152. package/lib/esm/isomorphics/getGlobalThis.d.ts +9 -0
  153. package/lib/esm/isomorphics/getGlobalThis.js +14 -0
  154. package/lib/esm/isomorphics/index.d.ts +1 -0
  155. package/lib/esm/isomorphics/index.js +1 -0
  156. package/lib/esm/maths/index.d.ts +1 -0
  157. package/lib/esm/maths/index.js +1 -0
  158. package/lib/esm/maths/random.d.ts +3 -0
  159. package/lib/esm/maths/random.js +17 -0
  160. package/lib/esm/strings/camelCase.d.ts +4 -0
  161. package/lib/esm/strings/camelCase.js +57 -0
  162. package/lib/esm/strings/index.d.ts +3 -0
  163. package/lib/esm/strings/index.js +3 -0
  164. package/lib/esm/strings/templates.d.ts +7 -0
  165. package/lib/esm/strings/templates.js +8 -0
  166. package/lib/esm/strings/urljoin.d.ts +2 -0
  167. package/lib/esm/strings/urljoin.js +53 -0
  168. package/lib/esm/strings/urljoin.test.d.ts +1 -0
  169. package/lib/esm/strings/urljoin.test.js +4 -0
  170. package/lib/esm/validations/asserts.d.ts +2 -0
  171. package/lib/esm/validations/asserts.js +10 -0
  172. package/lib/esm/validations/index.d.ts +4 -0
  173. package/lib/esm/validations/index.js +4 -0
  174. package/lib/esm/validations/isClass.d.ts +1 -0
  175. package/lib/esm/validations/isClass.js +6 -0
  176. package/lib/esm/validations/isDefined.d.ts +1 -0
  177. package/lib/esm/validations/isDefined.js +6 -0
  178. package/lib/esm/validations/isEmptyObject.d.ts +1 -0
  179. package/lib/esm/validations/isEmptyObject.js +9 -0
  180. package/lib/esnext/arrays/MaybeArray.d.ts +5 -0
  181. package/lib/esnext/arrays/MaybeArray.js +28 -0
  182. package/lib/esnext/arrays/MaybeArray.js.map +1 -0
  183. package/lib/esnext/arrays/index.d.ts +1 -0
  184. package/lib/esnext/arrays/index.js +2 -0
  185. package/lib/esnext/arrays/index.js.map +1 -0
  186. package/lib/esnext/asyncs/AsyncInterval.d.ts +3 -0
  187. package/lib/esnext/asyncs/AsyncInterval.js +13 -0
  188. package/lib/esnext/asyncs/AsyncInterval.js.map +1 -0
  189. package/lib/esnext/asyncs/LazyPromise.d.ts +5 -0
  190. package/lib/esnext/asyncs/LazyPromise.js +22 -0
  191. package/lib/esnext/asyncs/LazyPromise.js.map +1 -0
  192. package/lib/esnext/asyncs/MaybePromise.d.ts +1 -0
  193. package/lib/esnext/asyncs/MaybePromise.js +2 -0
  194. package/lib/esnext/asyncs/MaybePromise.js.map +1 -0
  195. package/lib/esnext/asyncs/generatorOfStream.d.ts +1 -0
  196. package/lib/esnext/asyncs/generatorOfStream.js +14 -0
  197. package/lib/esnext/asyncs/generatorOfStream.js.map +1 -0
  198. package/lib/esnext/asyncs/index.d.ts +7 -0
  199. package/lib/esnext/asyncs/index.js +8 -0
  200. package/lib/esnext/asyncs/index.js.map +1 -0
  201. package/lib/esnext/asyncs/isPromise.d.ts +1 -0
  202. package/lib/esnext/asyncs/isPromise.js +4 -0
  203. package/lib/esnext/asyncs/isPromise.js.map +1 -0
  204. package/lib/esnext/asyncs/promiseOfCallback.d.ts +1 -0
  205. package/lib/esnext/asyncs/promiseOfCallback.js +18 -0
  206. package/lib/esnext/asyncs/promiseOfCallback.js.map +1 -0
  207. package/lib/esnext/asyncs/sleep.d.ts +1 -0
  208. package/lib/esnext/asyncs/sleep.js +2 -0
  209. package/lib/esnext/asyncs/sleep.js.map +1 -0
  210. package/lib/esnext/asyncs/timeout.d.ts +4 -0
  211. package/lib/esnext/asyncs/timeout.js +22 -0
  212. package/lib/esnext/asyncs/timeout.js.map +1 -0
  213. package/lib/esnext/browsers/copy.d.ts +1 -0
  214. package/lib/esnext/browsers/copy.js +51 -0
  215. package/lib/esnext/browsers/copy.js.map +1 -0
  216. package/lib/esnext/browsers/download.d.ts +4 -0
  217. package/lib/esnext/browsers/download.js +31 -0
  218. package/lib/esnext/browsers/download.js.map +1 -0
  219. package/lib/esnext/browsers/getFileFromDataTransfer.d.ts +4 -0
  220. package/lib/esnext/browsers/getFileFromDataTransfer.js +37 -0
  221. package/lib/esnext/browsers/getFileFromDataTransfer.js.map +1 -0
  222. package/lib/esnext/browsers/index.d.ts +4 -0
  223. package/lib/esnext/browsers/index.js +5 -0
  224. package/lib/esnext/browsers/index.js.map +1 -0
  225. package/lib/esnext/browsers/loaders.d.ts +6 -0
  226. package/lib/esnext/browsers/loaders.js +33 -0
  227. package/lib/esnext/browsers/loaders.js.map +1 -0
  228. package/lib/esnext/formats/formatBytes.d.ts +11 -0
  229. package/lib/esnext/formats/formatBytes.js +27 -0
  230. package/lib/esnext/formats/formatBytes.js.map +1 -0
  231. package/lib/esnext/index.d.ts +9 -0
  232. package/lib/esnext/index.js +10 -0
  233. package/lib/esnext/index.js.map +1 -0
  234. package/lib/esnext/io/index.d.ts +1 -0
  235. package/lib/esnext/io/index.js +2 -0
  236. package/lib/esnext/io/index.js.map +1 -0
  237. package/lib/esnext/io/isBuffer.d.ts +2 -0
  238. package/lib/esnext/io/isBuffer.js +8 -0
  239. package/lib/esnext/io/isBuffer.js.map +1 -0
  240. package/lib/esnext/isomorphics/getGlobalThis.d.ts +9 -0
  241. package/lib/esnext/isomorphics/getGlobalThis.js +21 -0
  242. package/lib/esnext/isomorphics/getGlobalThis.js.map +1 -0
  243. package/lib/esnext/isomorphics/index.d.ts +1 -0
  244. package/lib/esnext/isomorphics/index.js +2 -0
  245. package/lib/esnext/isomorphics/index.js.map +1 -0
  246. package/lib/esnext/maths/index.d.ts +1 -0
  247. package/lib/esnext/maths/index.js +2 -0
  248. package/lib/esnext/maths/index.js.map +1 -0
  249. package/lib/esnext/maths/random.d.ts +3 -0
  250. package/lib/esnext/maths/random.js +16 -0
  251. package/lib/esnext/maths/random.js.map +1 -0
  252. package/lib/esnext/strings/camelCase.d.ts +4 -0
  253. package/lib/esnext/strings/camelCase.js +68 -0
  254. package/lib/esnext/strings/camelCase.js.map +1 -0
  255. package/lib/esnext/strings/index.d.ts +3 -0
  256. package/lib/esnext/strings/index.js +4 -0
  257. package/lib/esnext/strings/index.js.map +1 -0
  258. package/lib/esnext/strings/templates.d.ts +7 -0
  259. package/lib/esnext/strings/templates.js +14 -0
  260. package/lib/esnext/strings/templates.js.map +1 -0
  261. package/lib/esnext/strings/urljoin.d.ts +2 -0
  262. package/lib/esnext/strings/urljoin.js +65 -0
  263. package/lib/esnext/strings/urljoin.js.map +1 -0
  264. package/lib/esnext/strings/urljoin.test.d.ts +1 -0
  265. package/lib/esnext/strings/urljoin.test.js +5 -0
  266. package/lib/esnext/strings/urljoin.test.js.map +1 -0
  267. package/lib/esnext/validations/asserts.d.ts +2 -0
  268. package/lib/esnext/validations/asserts.js +13 -0
  269. package/lib/esnext/validations/asserts.js.map +1 -0
  270. package/lib/esnext/validations/index.d.ts +4 -0
  271. package/lib/esnext/validations/index.js +5 -0
  272. package/lib/esnext/validations/index.js.map +1 -0
  273. package/lib/esnext/validations/isClass.d.ts +1 -0
  274. package/lib/esnext/validations/isClass.js +4 -0
  275. package/lib/esnext/validations/isClass.js.map +1 -0
  276. package/lib/esnext/validations/isDefined.d.ts +1 -0
  277. package/lib/esnext/validations/isDefined.js +4 -0
  278. package/lib/esnext/validations/isDefined.js.map +1 -0
  279. package/lib/esnext/validations/isEmptyObject.d.ts +1 -0
  280. package/lib/esnext/validations/isEmptyObject.js +7 -0
  281. package/lib/esnext/validations/isEmptyObject.js.map +1 -0
  282. package/package.json +36 -32
  283. package/src/arrays/MaybeArray.ts +13 -0
  284. package/src/asyncs/LazyPromise.ts +16 -9
  285. package/src/asyncs/MaybePromise.ts +1 -0
  286. package/src/asyncs/generatorOfStream.ts +13 -0
  287. package/src/asyncs/index.ts +8 -3
  288. package/src/asyncs/isPromise.ts +3 -0
  289. package/src/asyncs/promiseOfCallback.ts +15 -0
  290. package/src/asyncs/timeout.ts +25 -0
  291. package/src/browsers/{clipboard.ts → copy.ts} +0 -0
  292. package/src/browsers/{transfers.ts → getFileFromDataTransfer.ts} +13 -8
  293. package/src/browsers/index.ts +4 -4
  294. package/src/browsers/loaders.ts +7 -2
  295. package/src/formats/formatBytes.ts +30 -0
  296. package/src/index.ts +5 -3
  297. package/src/isomorphics/getGlobalThis.ts +2 -4
  298. package/src/maths/random.ts +5 -5
  299. package/src/strings/camelCase.ts +2 -2
  300. package/src/strings/index.ts +1 -0
  301. package/src/strings/templates.ts +2 -4
  302. package/src/strings/urljoin.test.ts +5 -0
  303. package/src/strings/urljoin.ts +79 -0
  304. package/src/validations/index.ts +3 -0
  305. package/src/validations/isClass.ts +3 -0
  306. package/src/validations/isDefined.ts +3 -0
  307. package/src/validations/isEmptyObject.ts +6 -0
  308. package/tsconfig.json +26 -6
  309. package/dist/utils.es5.js +0 -1759
  310. package/dist/utils.es5.js.map +0 -1
  311. package/dist/utils.umd.js +0 -1769
  312. package/dist/utils.umd.js.map +0 -1
  313. package/lib/arrays/MaybeArray.js.map +0 -1
  314. package/lib/arrays/index.js +0 -7
  315. package/lib/asyncs/AsyncInterval.js.map +0 -1
  316. package/lib/asyncs/LazyPromise.js +0 -18
  317. package/lib/asyncs/LazyPromise.js.map +0 -1
  318. package/lib/asyncs/index.d.ts +0 -3
  319. package/lib/asyncs/index.js +0 -9
  320. package/lib/asyncs/index.js.map +0 -1
  321. package/lib/asyncs/sleep.js +0 -4
  322. package/lib/asyncs/sleep.js.map +0 -1
  323. package/lib/browsers/clipboard.js.map +0 -1
  324. package/lib/browsers/download.js.map +0 -1
  325. package/lib/browsers/index.d.ts +0 -4
  326. package/lib/browsers/index.js +0 -10
  327. package/lib/browsers/index.js.map +0 -1
  328. package/lib/browsers/loaders.js.map +0 -1
  329. package/lib/browsers/transfers.d.ts +0 -4
  330. package/lib/browsers/transfers.js.map +0 -1
  331. package/lib/envs/index.d.ts +0 -1
  332. package/lib/envs/index.js +0 -7
  333. package/lib/envs/index.js.map +0 -1
  334. package/lib/envs/isDev.d.ts +0 -1
  335. package/lib/envs/isDev.js +0 -4
  336. package/lib/envs/isDev.js.map +0 -1
  337. package/lib/index.d.ts +0 -8
  338. package/lib/index.js +0 -14
  339. package/lib/index.js.map +0 -1
  340. package/lib/io/index.js +0 -7
  341. package/lib/io/isBuffer.js.map +0 -1
  342. package/lib/isomorphics/getGlobalThis.js.map +0 -1
  343. package/lib/isomorphics/index.js +0 -7
  344. package/lib/isomorphics/index.js.map +0 -1
  345. package/lib/maths/index.js +0 -7
  346. package/lib/maths/index.js.map +0 -1
  347. package/lib/maths/random.d.ts +0 -3
  348. package/lib/maths/random.js.map +0 -1
  349. package/lib/strings/camelCase.js.map +0 -1
  350. package/lib/strings/index.js +0 -8
  351. package/lib/strings/index.js.map +0 -1
  352. package/lib/strings/templates.js.map +0 -1
  353. package/lib/validations/asserts.js.map +0 -1
  354. package/lib/validations/index.d.ts +0 -1
  355. package/lib/validations/index.js +0 -7
  356. package/lib/validations/index.js.map +0 -1
  357. package/rollup.config.ts +0 -34
  358. package/src/envs/index.ts +0 -1
  359. package/src/envs/isDev.ts +0 -1
  360. package/tsconfig.rollup.json +0 -9
package/dist/utils.es5.js DELETED
@@ -1,1759 +0,0 @@
1
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2
-
3
- function unwrapExports (x) {
4
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
5
- }
6
-
7
- function createCommonjsModule(fn, module) {
8
- return module = { exports: {} }, fn(module, module.exports), module.exports;
9
- }
10
-
11
- var MaybeArray = createCommonjsModule(function (module, exports) {
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- function firstOfMaybeArray(v) {
14
- if (Array.isArray(v)) {
15
- return v[0];
16
- }
17
- return v;
18
- }
19
- exports.firstOfMaybeArray = firstOfMaybeArray;
20
- function lastOfMaybeArray(v) {
21
- if (Array.isArray(v)) {
22
- return v[v.length - 1];
23
- }
24
- return v;
25
- }
26
- exports.lastOfMaybeArray = lastOfMaybeArray;
27
- function arrayOfMaybeArray(v) {
28
- if (Array.isArray(v)) {
29
- return v;
30
- }
31
- if (v === null || v === undefined) {
32
- return [];
33
- }
34
- return [v];
35
- }
36
- exports.arrayOfMaybeArray = arrayOfMaybeArray;
37
-
38
- });
39
-
40
- unwrapExports(MaybeArray);
41
- var MaybeArray_1 = MaybeArray.firstOfMaybeArray;
42
- var MaybeArray_2 = MaybeArray.lastOfMaybeArray;
43
- var MaybeArray_3 = MaybeArray.arrayOfMaybeArray;
44
-
45
- var arrays = createCommonjsModule(function (module, exports) {
46
- function __export(m) {
47
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
48
- }
49
- Object.defineProperty(exports, "__esModule", { value: true });
50
- __export(MaybeArray);
51
-
52
- });
53
-
54
- unwrapExports(arrays);
55
-
56
- var LazyPromise = createCommonjsModule(function (module, exports) {
57
- Object.defineProperty(exports, "__esModule", { value: true });
58
- function createLazyPromise() {
59
- const promise = Object.assign(new Promise((resolve, reject) => {
60
- promise.reject = reject;
61
- promise.resolve = resolve;
62
- }), {
63
- resolve() {
64
- throw new Error('pending resolve');
65
- },
66
- reject() {
67
- throw new Error('pending reject');
68
- },
69
- });
70
- return promise;
71
- }
72
- exports.createLazyPromise = createLazyPromise;
73
-
74
- });
75
-
76
- unwrapExports(LazyPromise);
77
- var LazyPromise_1 = LazyPromise.createLazyPromise;
78
-
79
- var AsyncInterval = createCommonjsModule(function (module, exports) {
80
- Object.defineProperty(exports, "__esModule", { value: true });
81
- function setAsyncInterval(cb, interval, initial = interval) {
82
- let id;
83
- const handler = async () => {
84
- await cb();
85
- id = setTimeout(handler, interval);
86
- };
87
- id = setTimeout(handler, initial);
88
- return () => id;
89
- }
90
- exports.setAsyncInterval = setAsyncInterval;
91
- function clearAsyncInterval(v) {
92
- clearTimeout(v === null || v === void 0 ? void 0 : v());
93
- }
94
- exports.clearAsyncInterval = clearAsyncInterval;
95
-
96
- });
97
-
98
- unwrapExports(AsyncInterval);
99
- var AsyncInterval_1 = AsyncInterval.setAsyncInterval;
100
- var AsyncInterval_2 = AsyncInterval.clearAsyncInterval;
101
-
102
- var sleep = createCommonjsModule(function (module, exports) {
103
- Object.defineProperty(exports, "__esModule", { value: true });
104
- exports.sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
105
-
106
- });
107
-
108
- unwrapExports(sleep);
109
- var sleep_1 = sleep.sleep;
110
-
111
- var asyncs = createCommonjsModule(function (module, exports) {
112
- function __export(m) {
113
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
114
- }
115
- Object.defineProperty(exports, "__esModule", { value: true });
116
- __export(LazyPromise);
117
- __export(AsyncInterval);
118
- __export(sleep);
119
-
120
- });
121
-
122
- unwrapExports(asyncs);
123
-
124
- var asserts = createCommonjsModule(function (module, exports) {
125
- Object.defineProperty(exports, "__esModule", { value: true });
126
- function assert(condition, msg) {
127
- // if (!condition) {
128
- // throw new AssertionError(msg);
129
- // }
130
- console.assert(!condition, msg);
131
- }
132
- exports.assert = assert;
133
- function assertIsDefined(val) {
134
- // if (val === undefined || val === null) {
135
- // throw new AssertionError(`Expected 'val' to be defined, but received ${val}`);
136
- // }
137
- console.assert(val === undefined || val === null, 'Expected defined');
138
- }
139
- exports.assertIsDefined = assertIsDefined;
140
-
141
- });
142
-
143
- unwrapExports(asserts);
144
- var asserts_1 = asserts.assert;
145
- var asserts_2 = asserts.assertIsDefined;
146
-
147
- var validations = createCommonjsModule(function (module, exports) {
148
- function __export(m) {
149
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
150
- }
151
- Object.defineProperty(exports, "__esModule", { value: true });
152
- __export(asserts);
153
-
154
- });
155
-
156
- unwrapExports(validations);
157
-
158
- var camelCase_1 = createCommonjsModule(function (module, exports) {
159
- // https://github.com/sindresorhus/camelcase/blob/master/index.js
160
- Object.defineProperty(exports, "__esModule", { value: true });
161
- function preserveCamelCase(string) {
162
- let isLastCharLower = false;
163
- let isLastCharUpper = false;
164
- let isLastLastCharUpper = false;
165
- for (let i = 0; i < string.length; i++) {
166
- const character = string[i];
167
- if (isLastCharLower && /[a-zA-Z]/.test(character) && character.toUpperCase() === character) {
168
- string = string.slice(0, i) + '-' + string.slice(i);
169
- isLastCharLower = false;
170
- isLastLastCharUpper = isLastCharUpper;
171
- isLastCharUpper = true;
172
- i++;
173
- }
174
- else if (isLastCharUpper &&
175
- isLastLastCharUpper &&
176
- /[a-zA-Z]/.test(character) &&
177
- character.toLowerCase() === character) {
178
- string = string.slice(0, i - 1) + '-' + string.slice(i - 1);
179
- isLastLastCharUpper = isLastCharUpper;
180
- isLastCharUpper = false;
181
- isLastCharLower = true;
182
- }
183
- else {
184
- isLastCharLower = character.toLowerCase() === character && character.toUpperCase() !== character;
185
- isLastLastCharUpper = isLastCharUpper;
186
- isLastCharUpper = character.toUpperCase() === character && character.toLowerCase() !== character;
187
- }
188
- }
189
- return string;
190
- }
191
- function pascalCase(input) {
192
- return camelCase(input, { pascalCase: true });
193
- }
194
- exports.pascalCase = pascalCase;
195
- function camelCase(input, options = {
196
- pascalCase: false
197
- }) {
198
- if (!(typeof input === 'string' || Array.isArray(input))) {
199
- throw new TypeError('Expected the input to be `string | string[]`');
200
- }
201
- const postProcess = (x) => (options.pascalCase ? x.charAt(0).toUpperCase() + x.slice(1) : x);
202
- if (Array.isArray(input)) {
203
- input = input
204
- .map((x) => x.trim())
205
- .filter((x) => x.length)
206
- .join('-');
207
- }
208
- else {
209
- input = input.trim();
210
- }
211
- if (input.length === 0) {
212
- return '';
213
- }
214
- if (input.length === 1) {
215
- return options.pascalCase ? input.toUpperCase() : input.toLowerCase();
216
- }
217
- const hasUpperCase = input !== input.toLowerCase();
218
- if (hasUpperCase) {
219
- input = preserveCamelCase(input);
220
- }
221
- input = input
222
- .replace(/^[_.\- ]+/, '')
223
- .toLowerCase()
224
- .replace(/[_.\- ]+(\w|$)/g, (_, p1) => p1.toUpperCase())
225
- .replace(/\d+(\w|$)/g, (m) => m.toUpperCase());
226
- return postProcess(input);
227
- }
228
- exports.camelCase = camelCase;
229
-
230
- });
231
-
232
- unwrapExports(camelCase_1);
233
- var camelCase_2 = camelCase_1.pascalCase;
234
- var camelCase_3 = camelCase_1.camelCase;
235
-
236
- /**
237
- * Checks if `value` is classified as an `Array` object.
238
- *
239
- * @static
240
- * @memberOf _
241
- * @since 0.1.0
242
- * @category Lang
243
- * @param {*} value The value to check.
244
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
245
- * @example
246
- *
247
- * _.isArray([1, 2, 3]);
248
- * // => true
249
- *
250
- * _.isArray(document.body.children);
251
- * // => false
252
- *
253
- * _.isArray('abc');
254
- * // => false
255
- *
256
- * _.isArray(_.noop);
257
- * // => false
258
- */
259
- var isArray = Array.isArray;
260
-
261
- var isArray_1 = isArray;
262
-
263
- /** Detect free variable `global` from Node.js. */
264
- var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
265
-
266
- var _freeGlobal = freeGlobal;
267
-
268
- /** Detect free variable `self`. */
269
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
270
-
271
- /** Used as a reference to the global object. */
272
- var root = _freeGlobal || freeSelf || Function('return this')();
273
-
274
- var _root = root;
275
-
276
- /** Built-in value references. */
277
- var Symbol = _root.Symbol;
278
-
279
- var _Symbol = Symbol;
280
-
281
- /** Used for built-in method references. */
282
- var objectProto = Object.prototype;
283
-
284
- /** Used to check objects for own properties. */
285
- var hasOwnProperty = objectProto.hasOwnProperty;
286
-
287
- /**
288
- * Used to resolve the
289
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
290
- * of values.
291
- */
292
- var nativeObjectToString = objectProto.toString;
293
-
294
- /** Built-in value references. */
295
- var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
296
-
297
- /**
298
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
299
- *
300
- * @private
301
- * @param {*} value The value to query.
302
- * @returns {string} Returns the raw `toStringTag`.
303
- */
304
- function getRawTag(value) {
305
- var isOwn = hasOwnProperty.call(value, symToStringTag),
306
- tag = value[symToStringTag];
307
-
308
- try {
309
- value[symToStringTag] = undefined;
310
- var unmasked = true;
311
- } catch (e) {}
312
-
313
- var result = nativeObjectToString.call(value);
314
- if (unmasked) {
315
- if (isOwn) {
316
- value[symToStringTag] = tag;
317
- } else {
318
- delete value[symToStringTag];
319
- }
320
- }
321
- return result;
322
- }
323
-
324
- var _getRawTag = getRawTag;
325
-
326
- /** Used for built-in method references. */
327
- var objectProto$1 = Object.prototype;
328
-
329
- /**
330
- * Used to resolve the
331
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
332
- * of values.
333
- */
334
- var nativeObjectToString$1 = objectProto$1.toString;
335
-
336
- /**
337
- * Converts `value` to a string using `Object.prototype.toString`.
338
- *
339
- * @private
340
- * @param {*} value The value to convert.
341
- * @returns {string} Returns the converted string.
342
- */
343
- function objectToString(value) {
344
- return nativeObjectToString$1.call(value);
345
- }
346
-
347
- var _objectToString = objectToString;
348
-
349
- /** `Object#toString` result references. */
350
- var nullTag = '[object Null]',
351
- undefinedTag = '[object Undefined]';
352
-
353
- /** Built-in value references. */
354
- var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
355
-
356
- /**
357
- * The base implementation of `getTag` without fallbacks for buggy environments.
358
- *
359
- * @private
360
- * @param {*} value The value to query.
361
- * @returns {string} Returns the `toStringTag`.
362
- */
363
- function baseGetTag(value) {
364
- if (value == null) {
365
- return value === undefined ? undefinedTag : nullTag;
366
- }
367
- return (symToStringTag$1 && symToStringTag$1 in Object(value))
368
- ? _getRawTag(value)
369
- : _objectToString(value);
370
- }
371
-
372
- var _baseGetTag = baseGetTag;
373
-
374
- /**
375
- * Checks if `value` is object-like. A value is object-like if it's not `null`
376
- * and has a `typeof` result of "object".
377
- *
378
- * @static
379
- * @memberOf _
380
- * @since 4.0.0
381
- * @category Lang
382
- * @param {*} value The value to check.
383
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
384
- * @example
385
- *
386
- * _.isObjectLike({});
387
- * // => true
388
- *
389
- * _.isObjectLike([1, 2, 3]);
390
- * // => true
391
- *
392
- * _.isObjectLike(_.noop);
393
- * // => false
394
- *
395
- * _.isObjectLike(null);
396
- * // => false
397
- */
398
- function isObjectLike(value) {
399
- return value != null && typeof value == 'object';
400
- }
401
-
402
- var isObjectLike_1 = isObjectLike;
403
-
404
- /** `Object#toString` result references. */
405
- var symbolTag = '[object Symbol]';
406
-
407
- /**
408
- * Checks if `value` is classified as a `Symbol` primitive or object.
409
- *
410
- * @static
411
- * @memberOf _
412
- * @since 4.0.0
413
- * @category Lang
414
- * @param {*} value The value to check.
415
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
416
- * @example
417
- *
418
- * _.isSymbol(Symbol.iterator);
419
- * // => true
420
- *
421
- * _.isSymbol('abc');
422
- * // => false
423
- */
424
- function isSymbol(value) {
425
- return typeof value == 'symbol' ||
426
- (isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
427
- }
428
-
429
- var isSymbol_1 = isSymbol;
430
-
431
- /** Used to match property names within property paths. */
432
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
433
- reIsPlainProp = /^\w*$/;
434
-
435
- /**
436
- * Checks if `value` is a property name and not a property path.
437
- *
438
- * @private
439
- * @param {*} value The value to check.
440
- * @param {Object} [object] The object to query keys on.
441
- * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
442
- */
443
- function isKey(value, object) {
444
- if (isArray_1(value)) {
445
- return false;
446
- }
447
- var type = typeof value;
448
- if (type == 'number' || type == 'symbol' || type == 'boolean' ||
449
- value == null || isSymbol_1(value)) {
450
- return true;
451
- }
452
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
453
- (object != null && value in Object(object));
454
- }
455
-
456
- var _isKey = isKey;
457
-
458
- /**
459
- * Checks if `value` is the
460
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
461
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
462
- *
463
- * @static
464
- * @memberOf _
465
- * @since 0.1.0
466
- * @category Lang
467
- * @param {*} value The value to check.
468
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
469
- * @example
470
- *
471
- * _.isObject({});
472
- * // => true
473
- *
474
- * _.isObject([1, 2, 3]);
475
- * // => true
476
- *
477
- * _.isObject(_.noop);
478
- * // => true
479
- *
480
- * _.isObject(null);
481
- * // => false
482
- */
483
- function isObject(value) {
484
- var type = typeof value;
485
- return value != null && (type == 'object' || type == 'function');
486
- }
487
-
488
- var isObject_1 = isObject;
489
-
490
- /** `Object#toString` result references. */
491
- var asyncTag = '[object AsyncFunction]',
492
- funcTag = '[object Function]',
493
- genTag = '[object GeneratorFunction]',
494
- proxyTag = '[object Proxy]';
495
-
496
- /**
497
- * Checks if `value` is classified as a `Function` object.
498
- *
499
- * @static
500
- * @memberOf _
501
- * @since 0.1.0
502
- * @category Lang
503
- * @param {*} value The value to check.
504
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
505
- * @example
506
- *
507
- * _.isFunction(_);
508
- * // => true
509
- *
510
- * _.isFunction(/abc/);
511
- * // => false
512
- */
513
- function isFunction(value) {
514
- if (!isObject_1(value)) {
515
- return false;
516
- }
517
- // The use of `Object#toString` avoids issues with the `typeof` operator
518
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
519
- var tag = _baseGetTag(value);
520
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
521
- }
522
-
523
- var isFunction_1 = isFunction;
524
-
525
- /** Used to detect overreaching core-js shims. */
526
- var coreJsData = _root['__core-js_shared__'];
527
-
528
- var _coreJsData = coreJsData;
529
-
530
- /** Used to detect methods masquerading as native. */
531
- var maskSrcKey = (function() {
532
- var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
533
- return uid ? ('Symbol(src)_1.' + uid) : '';
534
- }());
535
-
536
- /**
537
- * Checks if `func` has its source masked.
538
- *
539
- * @private
540
- * @param {Function} func The function to check.
541
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
542
- */
543
- function isMasked(func) {
544
- return !!maskSrcKey && (maskSrcKey in func);
545
- }
546
-
547
- var _isMasked = isMasked;
548
-
549
- /** Used for built-in method references. */
550
- var funcProto = Function.prototype;
551
-
552
- /** Used to resolve the decompiled source of functions. */
553
- var funcToString = funcProto.toString;
554
-
555
- /**
556
- * Converts `func` to its source code.
557
- *
558
- * @private
559
- * @param {Function} func The function to convert.
560
- * @returns {string} Returns the source code.
561
- */
562
- function toSource(func) {
563
- if (func != null) {
564
- try {
565
- return funcToString.call(func);
566
- } catch (e) {}
567
- try {
568
- return (func + '');
569
- } catch (e) {}
570
- }
571
- return '';
572
- }
573
-
574
- var _toSource = toSource;
575
-
576
- /**
577
- * Used to match `RegExp`
578
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
579
- */
580
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
581
-
582
- /** Used to detect host constructors (Safari). */
583
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
584
-
585
- /** Used for built-in method references. */
586
- var funcProto$1 = Function.prototype,
587
- objectProto$2 = Object.prototype;
588
-
589
- /** Used to resolve the decompiled source of functions. */
590
- var funcToString$1 = funcProto$1.toString;
591
-
592
- /** Used to check objects for own properties. */
593
- var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
594
-
595
- /** Used to detect if a method is native. */
596
- var reIsNative = RegExp('^' +
597
- funcToString$1.call(hasOwnProperty$1).replace(reRegExpChar, '\\$&')
598
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
599
- );
600
-
601
- /**
602
- * The base implementation of `_.isNative` without bad shim checks.
603
- *
604
- * @private
605
- * @param {*} value The value to check.
606
- * @returns {boolean} Returns `true` if `value` is a native function,
607
- * else `false`.
608
- */
609
- function baseIsNative(value) {
610
- if (!isObject_1(value) || _isMasked(value)) {
611
- return false;
612
- }
613
- var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
614
- return pattern.test(_toSource(value));
615
- }
616
-
617
- var _baseIsNative = baseIsNative;
618
-
619
- /**
620
- * Gets the value at `key` of `object`.
621
- *
622
- * @private
623
- * @param {Object} [object] The object to query.
624
- * @param {string} key The key of the property to get.
625
- * @returns {*} Returns the property value.
626
- */
627
- function getValue(object, key) {
628
- return object == null ? undefined : object[key];
629
- }
630
-
631
- var _getValue = getValue;
632
-
633
- /**
634
- * Gets the native function at `key` of `object`.
635
- *
636
- * @private
637
- * @param {Object} object The object to query.
638
- * @param {string} key The key of the method to get.
639
- * @returns {*} Returns the function if it's native, else `undefined`.
640
- */
641
- function getNative(object, key) {
642
- var value = _getValue(object, key);
643
- return _baseIsNative(value) ? value : undefined;
644
- }
645
-
646
- var _getNative = getNative;
647
-
648
- /* Built-in method references that are verified to be native. */
649
- var nativeCreate = _getNative(Object, 'create');
650
-
651
- var _nativeCreate = nativeCreate;
652
-
653
- /**
654
- * Removes all key-value entries from the hash.
655
- *
656
- * @private
657
- * @name clear
658
- * @memberOf Hash
659
- */
660
- function hashClear() {
661
- this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
662
- this.size = 0;
663
- }
664
-
665
- var _hashClear = hashClear;
666
-
667
- /**
668
- * Removes `key` and its value from the hash.
669
- *
670
- * @private
671
- * @name delete
672
- * @memberOf Hash
673
- * @param {Object} hash The hash to modify.
674
- * @param {string} key The key of the value to remove.
675
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
676
- */
677
- function hashDelete(key) {
678
- var result = this.has(key) && delete this.__data__[key];
679
- this.size -= result ? 1 : 0;
680
- return result;
681
- }
682
-
683
- var _hashDelete = hashDelete;
684
-
685
- /** Used to stand-in for `undefined` hash values. */
686
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
687
-
688
- /** Used for built-in method references. */
689
- var objectProto$3 = Object.prototype;
690
-
691
- /** Used to check objects for own properties. */
692
- var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
693
-
694
- /**
695
- * Gets the hash value for `key`.
696
- *
697
- * @private
698
- * @name get
699
- * @memberOf Hash
700
- * @param {string} key The key of the value to get.
701
- * @returns {*} Returns the entry value.
702
- */
703
- function hashGet(key) {
704
- var data = this.__data__;
705
- if (_nativeCreate) {
706
- var result = data[key];
707
- return result === HASH_UNDEFINED ? undefined : result;
708
- }
709
- return hasOwnProperty$2.call(data, key) ? data[key] : undefined;
710
- }
711
-
712
- var _hashGet = hashGet;
713
-
714
- /** Used for built-in method references. */
715
- var objectProto$4 = Object.prototype;
716
-
717
- /** Used to check objects for own properties. */
718
- var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
719
-
720
- /**
721
- * Checks if a hash value for `key` exists.
722
- *
723
- * @private
724
- * @name has
725
- * @memberOf Hash
726
- * @param {string} key The key of the entry to check.
727
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
728
- */
729
- function hashHas(key) {
730
- var data = this.__data__;
731
- return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$3.call(data, key);
732
- }
733
-
734
- var _hashHas = hashHas;
735
-
736
- /** Used to stand-in for `undefined` hash values. */
737
- var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
738
-
739
- /**
740
- * Sets the hash `key` to `value`.
741
- *
742
- * @private
743
- * @name set
744
- * @memberOf Hash
745
- * @param {string} key The key of the value to set.
746
- * @param {*} value The value to set.
747
- * @returns {Object} Returns the hash instance.
748
- */
749
- function hashSet(key, value) {
750
- var data = this.__data__;
751
- this.size += this.has(key) ? 0 : 1;
752
- data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED$1 : value;
753
- return this;
754
- }
755
-
756
- var _hashSet = hashSet;
757
-
758
- /**
759
- * Creates a hash object.
760
- *
761
- * @private
762
- * @constructor
763
- * @param {Array} [entries] The key-value pairs to cache.
764
- */
765
- function Hash(entries) {
766
- var index = -1,
767
- length = entries == null ? 0 : entries.length;
768
-
769
- this.clear();
770
- while (++index < length) {
771
- var entry = entries[index];
772
- this.set(entry[0], entry[1]);
773
- }
774
- }
775
-
776
- // Add methods to `Hash`.
777
- Hash.prototype.clear = _hashClear;
778
- Hash.prototype['delete'] = _hashDelete;
779
- Hash.prototype.get = _hashGet;
780
- Hash.prototype.has = _hashHas;
781
- Hash.prototype.set = _hashSet;
782
-
783
- var _Hash = Hash;
784
-
785
- /**
786
- * Removes all key-value entries from the list cache.
787
- *
788
- * @private
789
- * @name clear
790
- * @memberOf ListCache
791
- */
792
- function listCacheClear() {
793
- this.__data__ = [];
794
- this.size = 0;
795
- }
796
-
797
- var _listCacheClear = listCacheClear;
798
-
799
- /**
800
- * Performs a
801
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
802
- * comparison between two values to determine if they are equivalent.
803
- *
804
- * @static
805
- * @memberOf _
806
- * @since 4.0.0
807
- * @category Lang
808
- * @param {*} value The value to compare.
809
- * @param {*} other The other value to compare.
810
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
811
- * @example
812
- *
813
- * var object = { 'a': 1 };
814
- * var other = { 'a': 1 };
815
- *
816
- * _.eq(object, object);
817
- * // => true
818
- *
819
- * _.eq(object, other);
820
- * // => false
821
- *
822
- * _.eq('a', 'a');
823
- * // => true
824
- *
825
- * _.eq('a', Object('a'));
826
- * // => false
827
- *
828
- * _.eq(NaN, NaN);
829
- * // => true
830
- */
831
- function eq(value, other) {
832
- return value === other || (value !== value && other !== other);
833
- }
834
-
835
- var eq_1 = eq;
836
-
837
- /**
838
- * Gets the index at which the `key` is found in `array` of key-value pairs.
839
- *
840
- * @private
841
- * @param {Array} array The array to inspect.
842
- * @param {*} key The key to search for.
843
- * @returns {number} Returns the index of the matched value, else `-1`.
844
- */
845
- function assocIndexOf(array, key) {
846
- var length = array.length;
847
- while (length--) {
848
- if (eq_1(array[length][0], key)) {
849
- return length;
850
- }
851
- }
852
- return -1;
853
- }
854
-
855
- var _assocIndexOf = assocIndexOf;
856
-
857
- /** Used for built-in method references. */
858
- var arrayProto = Array.prototype;
859
-
860
- /** Built-in value references. */
861
- var splice = arrayProto.splice;
862
-
863
- /**
864
- * Removes `key` and its value from the list cache.
865
- *
866
- * @private
867
- * @name delete
868
- * @memberOf ListCache
869
- * @param {string} key The key of the value to remove.
870
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
871
- */
872
- function listCacheDelete(key) {
873
- var data = this.__data__,
874
- index = _assocIndexOf(data, key);
875
-
876
- if (index < 0) {
877
- return false;
878
- }
879
- var lastIndex = data.length - 1;
880
- if (index == lastIndex) {
881
- data.pop();
882
- } else {
883
- splice.call(data, index, 1);
884
- }
885
- --this.size;
886
- return true;
887
- }
888
-
889
- var _listCacheDelete = listCacheDelete;
890
-
891
- /**
892
- * Gets the list cache value for `key`.
893
- *
894
- * @private
895
- * @name get
896
- * @memberOf ListCache
897
- * @param {string} key The key of the value to get.
898
- * @returns {*} Returns the entry value.
899
- */
900
- function listCacheGet(key) {
901
- var data = this.__data__,
902
- index = _assocIndexOf(data, key);
903
-
904
- return index < 0 ? undefined : data[index][1];
905
- }
906
-
907
- var _listCacheGet = listCacheGet;
908
-
909
- /**
910
- * Checks if a list cache value for `key` exists.
911
- *
912
- * @private
913
- * @name has
914
- * @memberOf ListCache
915
- * @param {string} key The key of the entry to check.
916
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
917
- */
918
- function listCacheHas(key) {
919
- return _assocIndexOf(this.__data__, key) > -1;
920
- }
921
-
922
- var _listCacheHas = listCacheHas;
923
-
924
- /**
925
- * Sets the list cache `key` to `value`.
926
- *
927
- * @private
928
- * @name set
929
- * @memberOf ListCache
930
- * @param {string} key The key of the value to set.
931
- * @param {*} value The value to set.
932
- * @returns {Object} Returns the list cache instance.
933
- */
934
- function listCacheSet(key, value) {
935
- var data = this.__data__,
936
- index = _assocIndexOf(data, key);
937
-
938
- if (index < 0) {
939
- ++this.size;
940
- data.push([key, value]);
941
- } else {
942
- data[index][1] = value;
943
- }
944
- return this;
945
- }
946
-
947
- var _listCacheSet = listCacheSet;
948
-
949
- /**
950
- * Creates an list cache object.
951
- *
952
- * @private
953
- * @constructor
954
- * @param {Array} [entries] The key-value pairs to cache.
955
- */
956
- function ListCache(entries) {
957
- var index = -1,
958
- length = entries == null ? 0 : entries.length;
959
-
960
- this.clear();
961
- while (++index < length) {
962
- var entry = entries[index];
963
- this.set(entry[0], entry[1]);
964
- }
965
- }
966
-
967
- // Add methods to `ListCache`.
968
- ListCache.prototype.clear = _listCacheClear;
969
- ListCache.prototype['delete'] = _listCacheDelete;
970
- ListCache.prototype.get = _listCacheGet;
971
- ListCache.prototype.has = _listCacheHas;
972
- ListCache.prototype.set = _listCacheSet;
973
-
974
- var _ListCache = ListCache;
975
-
976
- /* Built-in method references that are verified to be native. */
977
- var Map = _getNative(_root, 'Map');
978
-
979
- var _Map = Map;
980
-
981
- /**
982
- * Removes all key-value entries from the map.
983
- *
984
- * @private
985
- * @name clear
986
- * @memberOf MapCache
987
- */
988
- function mapCacheClear() {
989
- this.size = 0;
990
- this.__data__ = {
991
- 'hash': new _Hash,
992
- 'map': new (_Map || _ListCache),
993
- 'string': new _Hash
994
- };
995
- }
996
-
997
- var _mapCacheClear = mapCacheClear;
998
-
999
- /**
1000
- * Checks if `value` is suitable for use as unique object key.
1001
- *
1002
- * @private
1003
- * @param {*} value The value to check.
1004
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1005
- */
1006
- function isKeyable(value) {
1007
- var type = typeof value;
1008
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1009
- ? (value !== '__proto__')
1010
- : (value === null);
1011
- }
1012
-
1013
- var _isKeyable = isKeyable;
1014
-
1015
- /**
1016
- * Gets the data for `map`.
1017
- *
1018
- * @private
1019
- * @param {Object} map The map to query.
1020
- * @param {string} key The reference key.
1021
- * @returns {*} Returns the map data.
1022
- */
1023
- function getMapData(map, key) {
1024
- var data = map.__data__;
1025
- return _isKeyable(key)
1026
- ? data[typeof key == 'string' ? 'string' : 'hash']
1027
- : data.map;
1028
- }
1029
-
1030
- var _getMapData = getMapData;
1031
-
1032
- /**
1033
- * Removes `key` and its value from the map.
1034
- *
1035
- * @private
1036
- * @name delete
1037
- * @memberOf MapCache
1038
- * @param {string} key The key of the value to remove.
1039
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1040
- */
1041
- function mapCacheDelete(key) {
1042
- var result = _getMapData(this, key)['delete'](key);
1043
- this.size -= result ? 1 : 0;
1044
- return result;
1045
- }
1046
-
1047
- var _mapCacheDelete = mapCacheDelete;
1048
-
1049
- /**
1050
- * Gets the map value for `key`.
1051
- *
1052
- * @private
1053
- * @name get
1054
- * @memberOf MapCache
1055
- * @param {string} key The key of the value to get.
1056
- * @returns {*} Returns the entry value.
1057
- */
1058
- function mapCacheGet(key) {
1059
- return _getMapData(this, key).get(key);
1060
- }
1061
-
1062
- var _mapCacheGet = mapCacheGet;
1063
-
1064
- /**
1065
- * Checks if a map value for `key` exists.
1066
- *
1067
- * @private
1068
- * @name has
1069
- * @memberOf MapCache
1070
- * @param {string} key The key of the entry to check.
1071
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1072
- */
1073
- function mapCacheHas(key) {
1074
- return _getMapData(this, key).has(key);
1075
- }
1076
-
1077
- var _mapCacheHas = mapCacheHas;
1078
-
1079
- /**
1080
- * Sets the map `key` to `value`.
1081
- *
1082
- * @private
1083
- * @name set
1084
- * @memberOf MapCache
1085
- * @param {string} key The key of the value to set.
1086
- * @param {*} value The value to set.
1087
- * @returns {Object} Returns the map cache instance.
1088
- */
1089
- function mapCacheSet(key, value) {
1090
- var data = _getMapData(this, key),
1091
- size = data.size;
1092
-
1093
- data.set(key, value);
1094
- this.size += data.size == size ? 0 : 1;
1095
- return this;
1096
- }
1097
-
1098
- var _mapCacheSet = mapCacheSet;
1099
-
1100
- /**
1101
- * Creates a map cache object to store key-value pairs.
1102
- *
1103
- * @private
1104
- * @constructor
1105
- * @param {Array} [entries] The key-value pairs to cache.
1106
- */
1107
- function MapCache(entries) {
1108
- var index = -1,
1109
- length = entries == null ? 0 : entries.length;
1110
-
1111
- this.clear();
1112
- while (++index < length) {
1113
- var entry = entries[index];
1114
- this.set(entry[0], entry[1]);
1115
- }
1116
- }
1117
-
1118
- // Add methods to `MapCache`.
1119
- MapCache.prototype.clear = _mapCacheClear;
1120
- MapCache.prototype['delete'] = _mapCacheDelete;
1121
- MapCache.prototype.get = _mapCacheGet;
1122
- MapCache.prototype.has = _mapCacheHas;
1123
- MapCache.prototype.set = _mapCacheSet;
1124
-
1125
- var _MapCache = MapCache;
1126
-
1127
- /** Error message constants. */
1128
- var FUNC_ERROR_TEXT = 'Expected a function';
1129
-
1130
- /**
1131
- * Creates a function that memoizes the result of `func`. If `resolver` is
1132
- * provided, it determines the cache key for storing the result based on the
1133
- * arguments provided to the memoized function. By default, the first argument
1134
- * provided to the memoized function is used as the map cache key. The `func`
1135
- * is invoked with the `this` binding of the memoized function.
1136
- *
1137
- * **Note:** The cache is exposed as the `cache` property on the memoized
1138
- * function. Its creation may be customized by replacing the `_.memoize.Cache`
1139
- * constructor with one whose instances implement the
1140
- * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
1141
- * method interface of `clear`, `delete`, `get`, `has`, and `set`.
1142
- *
1143
- * @static
1144
- * @memberOf _
1145
- * @since 0.1.0
1146
- * @category Function
1147
- * @param {Function} func The function to have its output memoized.
1148
- * @param {Function} [resolver] The function to resolve the cache key.
1149
- * @returns {Function} Returns the new memoized function.
1150
- * @example
1151
- *
1152
- * var object = { 'a': 1, 'b': 2 };
1153
- * var other = { 'c': 3, 'd': 4 };
1154
- *
1155
- * var values = _.memoize(_.values);
1156
- * values(object);
1157
- * // => [1, 2]
1158
- *
1159
- * values(other);
1160
- * // => [3, 4]
1161
- *
1162
- * object.a = 2;
1163
- * values(object);
1164
- * // => [1, 2]
1165
- *
1166
- * // Modify the result cache.
1167
- * values.cache.set(object, ['a', 'b']);
1168
- * values(object);
1169
- * // => ['a', 'b']
1170
- *
1171
- * // Replace `_.memoize.Cache`.
1172
- * _.memoize.Cache = WeakMap;
1173
- */
1174
- function memoize(func, resolver) {
1175
- if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
1176
- throw new TypeError(FUNC_ERROR_TEXT);
1177
- }
1178
- var memoized = function() {
1179
- var args = arguments,
1180
- key = resolver ? resolver.apply(this, args) : args[0],
1181
- cache = memoized.cache;
1182
-
1183
- if (cache.has(key)) {
1184
- return cache.get(key);
1185
- }
1186
- var result = func.apply(this, args);
1187
- memoized.cache = cache.set(key, result) || cache;
1188
- return result;
1189
- };
1190
- memoized.cache = new (memoize.Cache || _MapCache);
1191
- return memoized;
1192
- }
1193
-
1194
- // Expose `MapCache`.
1195
- memoize.Cache = _MapCache;
1196
-
1197
- var memoize_1 = memoize;
1198
-
1199
- /** Used as the maximum memoize cache size. */
1200
- var MAX_MEMOIZE_SIZE = 500;
1201
-
1202
- /**
1203
- * A specialized version of `_.memoize` which clears the memoized function's
1204
- * cache when it exceeds `MAX_MEMOIZE_SIZE`.
1205
- *
1206
- * @private
1207
- * @param {Function} func The function to have its output memoized.
1208
- * @returns {Function} Returns the new memoized function.
1209
- */
1210
- function memoizeCapped(func) {
1211
- var result = memoize_1(func, function(key) {
1212
- if (cache.size === MAX_MEMOIZE_SIZE) {
1213
- cache.clear();
1214
- }
1215
- return key;
1216
- });
1217
-
1218
- var cache = result.cache;
1219
- return result;
1220
- }
1221
-
1222
- var _memoizeCapped = memoizeCapped;
1223
-
1224
- /** Used to match property names within property paths. */
1225
- var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
1226
-
1227
- /** Used to match backslashes in property paths. */
1228
- var reEscapeChar = /\\(\\)?/g;
1229
-
1230
- /**
1231
- * Converts `string` to a property path array.
1232
- *
1233
- * @private
1234
- * @param {string} string The string to convert.
1235
- * @returns {Array} Returns the property path array.
1236
- */
1237
- var stringToPath = _memoizeCapped(function(string) {
1238
- var result = [];
1239
- if (string.charCodeAt(0) === 46 /* . */) {
1240
- result.push('');
1241
- }
1242
- string.replace(rePropName, function(match, number, quote, subString) {
1243
- result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
1244
- });
1245
- return result;
1246
- });
1247
-
1248
- var _stringToPath = stringToPath;
1249
-
1250
- /**
1251
- * A specialized version of `_.map` for arrays without support for iteratee
1252
- * shorthands.
1253
- *
1254
- * @private
1255
- * @param {Array} [array] The array to iterate over.
1256
- * @param {Function} iteratee The function invoked per iteration.
1257
- * @returns {Array} Returns the new mapped array.
1258
- */
1259
- function arrayMap(array, iteratee) {
1260
- var index = -1,
1261
- length = array == null ? 0 : array.length,
1262
- result = Array(length);
1263
-
1264
- while (++index < length) {
1265
- result[index] = iteratee(array[index], index, array);
1266
- }
1267
- return result;
1268
- }
1269
-
1270
- var _arrayMap = arrayMap;
1271
-
1272
- /** Used as references for various `Number` constants. */
1273
- var INFINITY = 1 / 0;
1274
-
1275
- /** Used to convert symbols to primitives and strings. */
1276
- var symbolProto = _Symbol ? _Symbol.prototype : undefined,
1277
- symbolToString = symbolProto ? symbolProto.toString : undefined;
1278
-
1279
- /**
1280
- * The base implementation of `_.toString` which doesn't convert nullish
1281
- * values to empty strings.
1282
- *
1283
- * @private
1284
- * @param {*} value The value to process.
1285
- * @returns {string} Returns the string.
1286
- */
1287
- function baseToString(value) {
1288
- // Exit early for strings to avoid a performance hit in some environments.
1289
- if (typeof value == 'string') {
1290
- return value;
1291
- }
1292
- if (isArray_1(value)) {
1293
- // Recursively convert values (susceptible to call stack limits).
1294
- return _arrayMap(value, baseToString) + '';
1295
- }
1296
- if (isSymbol_1(value)) {
1297
- return symbolToString ? symbolToString.call(value) : '';
1298
- }
1299
- var result = (value + '');
1300
- return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
1301
- }
1302
-
1303
- var _baseToString = baseToString;
1304
-
1305
- /**
1306
- * Converts `value` to a string. An empty string is returned for `null`
1307
- * and `undefined` values. The sign of `-0` is preserved.
1308
- *
1309
- * @static
1310
- * @memberOf _
1311
- * @since 4.0.0
1312
- * @category Lang
1313
- * @param {*} value The value to convert.
1314
- * @returns {string} Returns the converted string.
1315
- * @example
1316
- *
1317
- * _.toString(null);
1318
- * // => ''
1319
- *
1320
- * _.toString(-0);
1321
- * // => '-0'
1322
- *
1323
- * _.toString([1, 2, 3]);
1324
- * // => '1,2,3'
1325
- */
1326
- function toString(value) {
1327
- return value == null ? '' : _baseToString(value);
1328
- }
1329
-
1330
- var toString_1 = toString;
1331
-
1332
- /**
1333
- * Casts `value` to a path array if it's not one.
1334
- *
1335
- * @private
1336
- * @param {*} value The value to inspect.
1337
- * @param {Object} [object] The object to query keys on.
1338
- * @returns {Array} Returns the cast property path array.
1339
- */
1340
- function castPath(value, object) {
1341
- if (isArray_1(value)) {
1342
- return value;
1343
- }
1344
- return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
1345
- }
1346
-
1347
- var _castPath = castPath;
1348
-
1349
- /** Used as references for various `Number` constants. */
1350
- var INFINITY$1 = 1 / 0;
1351
-
1352
- /**
1353
- * Converts `value` to a string key if it's not a string or symbol.
1354
- *
1355
- * @private
1356
- * @param {*} value The value to inspect.
1357
- * @returns {string|symbol} Returns the key.
1358
- */
1359
- function toKey(value) {
1360
- if (typeof value == 'string' || isSymbol_1(value)) {
1361
- return value;
1362
- }
1363
- var result = (value + '');
1364
- return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
1365
- }
1366
-
1367
- var _toKey = toKey;
1368
-
1369
- /**
1370
- * The base implementation of `_.get` without support for default values.
1371
- *
1372
- * @private
1373
- * @param {Object} object The object to query.
1374
- * @param {Array|string} path The path of the property to get.
1375
- * @returns {*} Returns the resolved value.
1376
- */
1377
- function baseGet(object, path) {
1378
- path = _castPath(path, object);
1379
-
1380
- var index = 0,
1381
- length = path.length;
1382
-
1383
- while (object != null && index < length) {
1384
- object = object[_toKey(path[index++])];
1385
- }
1386
- return (index && index == length) ? object : undefined;
1387
- }
1388
-
1389
- var _baseGet = baseGet;
1390
-
1391
- /**
1392
- * Gets the value at `path` of `object`. If the resolved value is
1393
- * `undefined`, the `defaultValue` is returned in its place.
1394
- *
1395
- * @static
1396
- * @memberOf _
1397
- * @since 3.7.0
1398
- * @category Object
1399
- * @param {Object} object The object to query.
1400
- * @param {Array|string} path The path of the property to get.
1401
- * @param {*} [defaultValue] The value returned for `undefined` resolved values.
1402
- * @returns {*} Returns the resolved value.
1403
- * @example
1404
- *
1405
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
1406
- *
1407
- * _.get(object, 'a[0].b.c');
1408
- * // => 3
1409
- *
1410
- * _.get(object, ['a', '0', 'b', 'c']);
1411
- * // => 3
1412
- *
1413
- * _.get(object, 'a.b.c', 'default');
1414
- * // => 'default'
1415
- */
1416
- function get(object, path, defaultValue) {
1417
- var result = object == null ? undefined : _baseGet(object, path);
1418
- return result === undefined ? defaultValue : result;
1419
- }
1420
-
1421
- var get_1 = get;
1422
-
1423
- var templates = createCommonjsModule(function (module, exports) {
1424
- Object.defineProperty(exports, "__esModule", { value: true });
1425
-
1426
- /**
1427
- * 替换类似于 JS 的模板字符串
1428
- *
1429
- * @example
1430
- * templateString('My name is ${name}',{name:'wener'})
1431
- */
1432
- function templateString(template, variables) {
1433
- return template.replace(/\${(.*?)}/g, (_, g) => {
1434
- // variables[g.trim()]
1435
- // 支持路径 - 例如 a.b[0]
1436
- return get_1.default(variables, g.trim());
1437
- });
1438
- }
1439
- exports.templateString = templateString;
1440
-
1441
- });
1442
-
1443
- unwrapExports(templates);
1444
- var templates_1 = templates.templateString;
1445
-
1446
- var strings = createCommonjsModule(function (module, exports) {
1447
- function __export(m) {
1448
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
1449
- }
1450
- Object.defineProperty(exports, "__esModule", { value: true });
1451
- __export(camelCase_1);
1452
- __export(templates);
1453
-
1454
- });
1455
-
1456
- unwrapExports(strings);
1457
-
1458
- var random = createCommonjsModule(function (module, exports) {
1459
- Object.defineProperty(exports, "__esModule", { value: true });
1460
- /// javascript pseudo random
1461
- function createRandom({ seed = 0 } = {}) {
1462
- if (typeof seed === 'string') {
1463
- const s = seed;
1464
- let sum = 0;
1465
- for (let i = 0; i < s.length; i++) {
1466
- sum += s.charCodeAt(i);
1467
- }
1468
- seed = sum;
1469
- }
1470
- return () => {
1471
- const x = Math.sin(seed++) * 10000;
1472
- return x - Math.floor(x);
1473
- };
1474
- }
1475
- exports.createRandom = createRandom;
1476
-
1477
- });
1478
-
1479
- unwrapExports(random);
1480
- var random_1 = random.createRandom;
1481
-
1482
- var maths = createCommonjsModule(function (module, exports) {
1483
- function __export(m) {
1484
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
1485
- }
1486
- Object.defineProperty(exports, "__esModule", { value: true });
1487
- __export(random);
1488
-
1489
- });
1490
-
1491
- unwrapExports(maths);
1492
-
1493
- var isBuffer_1 = createCommonjsModule(function (module, exports) {
1494
- Object.defineProperty(exports, "__esModule", { value: true });
1495
- // https://github.com/feross/is-buffer/blob/master/index.js
1496
- function isBuffer(obj) {
1497
- return (obj != null &&
1498
- obj.constructor != null &&
1499
- typeof obj.constructor.isBuffer === 'function' &&
1500
- obj.constructor.isBuffer(obj));
1501
- }
1502
- exports.isBuffer = isBuffer;
1503
-
1504
- });
1505
-
1506
- unwrapExports(isBuffer_1);
1507
- var isBuffer_2 = isBuffer_1.isBuffer;
1508
-
1509
- var io = createCommonjsModule(function (module, exports) {
1510
- function __export(m) {
1511
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
1512
- }
1513
- Object.defineProperty(exports, "__esModule", { value: true });
1514
- __export(isBuffer_1);
1515
-
1516
- });
1517
-
1518
- unwrapExports(io);
1519
-
1520
- var isDev = createCommonjsModule(function (module, exports) {
1521
- Object.defineProperty(exports, "__esModule", { value: true });
1522
- exports.isDev = () => { var _a; return (((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.NODE_ENV) || '').startsWith('dev'); };
1523
-
1524
- });
1525
-
1526
- unwrapExports(isDev);
1527
- var isDev_1 = isDev.isDev;
1528
-
1529
- var envs = createCommonjsModule(function (module, exports) {
1530
- function __export(m) {
1531
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
1532
- }
1533
- Object.defineProperty(exports, "__esModule", { value: true });
1534
- __export(isDev);
1535
-
1536
- });
1537
-
1538
- unwrapExports(envs);
1539
-
1540
- var clipboard = createCommonjsModule(function (module, exports) {
1541
- Object.defineProperty(exports, "__esModule", { value: true });
1542
- // https://gist.github.com/rproenca/64781c6a1329b48a455b645d361a9aa3
1543
- let _copy;
1544
- function initCopy() {
1545
- let textArea;
1546
- function isIOS() {
1547
- return navigator.userAgent.match(/ipad|iphone/i);
1548
- }
1549
- function createTextArea(text) {
1550
- textArea = document.createElement('textArea');
1551
- textArea.value = text;
1552
- document.body.appendChild(textArea);
1553
- }
1554
- function selectText() {
1555
- let range, selection;
1556
- if (isIOS()) {
1557
- range = document.createRange();
1558
- range.selectNodeContents(textArea);
1559
- selection = window.getSelection();
1560
- if (selection === null) {
1561
- console.error(`no selection`);
1562
- return;
1563
- }
1564
- selection.removeAllRanges();
1565
- selection.addRange(range);
1566
- textArea.setSelectionRange(0, 999999);
1567
- }
1568
- else {
1569
- textArea.select();
1570
- }
1571
- }
1572
- function copyToClipboard() {
1573
- document.execCommand('copy');
1574
- document.body.removeChild(textArea);
1575
- }
1576
- _copy = (text) => {
1577
- createTextArea(text);
1578
- selectText();
1579
- copyToClipboard();
1580
- };
1581
- }
1582
- function copy(text) {
1583
- var _a, _b;
1584
- if ((_b = (_a = window.navigator) === null || _a === void 0 ? void 0 : _a.clipboard) === null || _b === void 0 ? void 0 : _b.writeText) {
1585
- window.navigator.clipboard.writeText(text);
1586
- return;
1587
- }
1588
- if (!_copy) {
1589
- initCopy();
1590
- }
1591
- _copy(text);
1592
- }
1593
- exports.copy = copy;
1594
-
1595
- });
1596
-
1597
- unwrapExports(clipboard);
1598
- var clipboard_1 = clipboard.copy;
1599
-
1600
- var download_1 = createCommonjsModule(function (module, exports) {
1601
- Object.defineProperty(exports, "__esModule", { value: true });
1602
- function download(filename, data, { type = 'application/octet-stream', raw = false } = {}) {
1603
- const a = document.createElement('a');
1604
- let closer = () => null;
1605
- try {
1606
- a.download = filename;
1607
- // console.info(`downloading ${name}`, data);
1608
- // url or data url
1609
- if (typeof data === 'string' && /^(https?:|data:)/.test(data) && !raw) {
1610
- a.href = data;
1611
- }
1612
- else if (typeof data === 'string') {
1613
- data = new TextEncoder().encode(data);
1614
- }
1615
- if (data instanceof Uint8Array) {
1616
- data = new Blob([data], { type });
1617
- }
1618
- if (data instanceof File || data instanceof Blob || data instanceof MediaSource) {
1619
- a.href = URL.createObjectURL(data);
1620
- closer = () => URL.revokeObjectURL(a.href);
1621
- }
1622
- else {
1623
- console.error(`invalid download data`, data);
1624
- throw new Error(`can not download ${Object.getPrototypeOf(data)}`);
1625
- }
1626
- a.click();
1627
- }
1628
- finally {
1629
- closer();
1630
- }
1631
- }
1632
- exports.download = download;
1633
-
1634
- });
1635
-
1636
- unwrapExports(download_1);
1637
- var download_2 = download_1.download;
1638
-
1639
- var loaders = createCommonjsModule(function (module, exports) {
1640
- Object.defineProperty(exports, "__esModule", { value: true });
1641
- function load(el, resolve, reject, options) {
1642
- el.onload = resolve;
1643
- el.onerror = (e) => {
1644
- el.remove();
1645
- reject(e);
1646
- };
1647
- const { attributes = {} } = options || {};
1648
- Object.entries(attributes).forEach(([k, v]) => el.setAttribute(k, v));
1649
- document.head.appendChild(el);
1650
- }
1651
- function loadScripts(src, options) {
1652
- // todo quote ?
1653
- if (document.querySelector(`script[src="${src}"]`)) {
1654
- return Promise.resolve();
1655
- }
1656
- return new Promise((resolve, reject) => {
1657
- const el = document.createElement('script');
1658
- el.src = src;
1659
- load(el, resolve, reject, options);
1660
- });
1661
- }
1662
- exports.loadScripts = loadScripts;
1663
- function loadStyles(href, options) {
1664
- if (document.querySelector(`link[link="${href}"]`)) {
1665
- return Promise.resolve();
1666
- }
1667
- return new Promise((resolve, reject) => {
1668
- const el = document.createElement('link');
1669
- el.rel = 'stylesheet';
1670
- el.href = href;
1671
- load(el, resolve, reject, options);
1672
- });
1673
- }
1674
- exports.loadStyles = loadStyles;
1675
-
1676
- });
1677
-
1678
- unwrapExports(loaders);
1679
- var loaders_1 = loaders.loadScripts;
1680
- var loaders_2 = loaders.loadStyles;
1681
-
1682
- var transfers = createCommonjsModule(function (module, exports) {
1683
- Object.defineProperty(exports, "__esModule", { value: true });
1684
- function getFile(dataTransfer) {
1685
- var _a, _b, _c;
1686
- const items = (_a = dataTransfer === null || dataTransfer === void 0 ? void 0 : dataTransfer.items) !== null && _a !== void 0 ? _a : [];
1687
- if (items.length >= 2 && items[0].kind === 'string' && items[1].kind === 'file') {
1688
- const text = dataTransfer.getData('text');
1689
- const file = (_b = items[1].getAsFile()) !== null && _b !== void 0 ? _b : (_c = dataTransfer.files) === null || _c === void 0 ? void 0 : _c.item(0);
1690
- if (!file) {
1691
- console.error(`no file ${text}`, items[1]);
1692
- return null;
1693
- }
1694
- // let type = file.type;
1695
- // // fix type
1696
- // type = type;
1697
- // // NOTE paste file can not parse by libs
1698
- // if (type !== file.type) {
1699
- // const blob = file.slice(0, file.size);
1700
- // file = new File([blob], text, {type});
1701
- // }
1702
- return { file, filename: text };
1703
- }
1704
- else if (items[0].kind === 'file') {
1705
- const file = items[0].getAsFile();
1706
- if (!file) {
1707
- console.error(`no file`, items[0]);
1708
- return null;
1709
- }
1710
- return { file, filename: file.name };
1711
- }
1712
- else {
1713
- console.debug(`file item not match`, Array.from(items).map((v) => ({ type: v.type, kind: v.kind })));
1714
- }
1715
- return null;
1716
- }
1717
- exports.getFile = getFile;
1718
-
1719
- });
1720
-
1721
- unwrapExports(transfers);
1722
- var transfers_1 = transfers.getFile;
1723
-
1724
- var browsers = createCommonjsModule(function (module, exports) {
1725
- function __export(m) {
1726
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
1727
- }
1728
- Object.defineProperty(exports, "__esModule", { value: true });
1729
- __export(clipboard);
1730
- __export(download_1);
1731
- __export(loaders);
1732
- __export(transfers);
1733
-
1734
- });
1735
-
1736
- unwrapExports(browsers);
1737
-
1738
- var lib = createCommonjsModule(function (module, exports) {
1739
- function __export(m) {
1740
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
1741
- }
1742
- Object.defineProperty(exports, "__esModule", { value: true });
1743
- __export(arrays);
1744
- __export(asyncs);
1745
- __export(validations);
1746
- __export(strings);
1747
- __export(maths);
1748
- __export(io);
1749
- __export(envs);
1750
- exports.Browsers = browsers;
1751
-
1752
- });
1753
-
1754
- var index = unwrapExports(lib);
1755
- var lib_1 = lib.Browsers;
1756
-
1757
- export default index;
1758
- export { lib_1 as Browsers };
1759
- //# sourceMappingURL=utils.es5.js.map