@tabler/core 1.0.0-beta10 → 1.0.0-beta12

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 (428) hide show
  1. package/README.md +66 -21
  2. package/dist/css/demo.css +251 -379
  3. package/dist/css/demo.min.css +3 -3
  4. package/dist/css/demo.rtl.css +251 -379
  5. package/dist/css/demo.rtl.min.css +3 -3
  6. package/dist/css/tabler-flags.css +266 -529
  7. package/dist/css/tabler-flags.min.css +3 -3
  8. package/dist/css/tabler-flags.rtl.css +266 -529
  9. package/dist/css/tabler-flags.rtl.min.css +3 -3
  10. package/dist/css/tabler-payments.css +127 -252
  11. package/dist/css/tabler-payments.min.css +2 -2
  12. package/dist/css/tabler-payments.rtl.css +127 -252
  13. package/dist/css/tabler-payments.rtl.min.css +2 -2
  14. package/dist/css/tabler-vendors.css +526 -611
  15. package/dist/css/tabler-vendors.min.css +3 -3
  16. package/dist/css/tabler-vendors.rtl.css +526 -611
  17. package/dist/css/tabler-vendors.rtl.min.css +3 -3
  18. package/dist/css/tabler.css +11259 -13083
  19. package/dist/css/tabler.min.css +4 -4
  20. package/dist/css/tabler.rtl.css +11251 -13090
  21. package/dist/css/tabler.rtl.min.css +4 -4
  22. package/dist/js/demo-theme.js +32 -0
  23. package/dist/js/demo-theme.min.js +9 -0
  24. package/dist/js/demo.js +2 -12
  25. package/dist/js/demo.min.js +3 -3
  26. package/dist/js/tabler.esm.js +1692 -1541
  27. package/dist/js/tabler.esm.min.js +9 -3
  28. package/dist/js/tabler.js +1687 -1514
  29. package/dist/js/tabler.min.js +9 -3
  30. package/dist/libs/apexcharts/dist/apexcharts.amd.js +2 -0
  31. package/dist/libs/apexcharts/dist/apexcharts.common.js +14 -0
  32. package/dist/libs/apexcharts/dist/apexcharts.css +691 -0
  33. package/dist/libs/apexcharts/dist/apexcharts.esm.js +14 -0
  34. package/dist/libs/apexcharts/dist/apexcharts.js +31979 -0
  35. package/dist/libs/apexcharts/dist/apexcharts.min.js +4 -4
  36. package/dist/libs/apexcharts/dist/locales/ar.json +63 -0
  37. package/dist/libs/apexcharts/dist/locales/ca.json +55 -0
  38. package/dist/libs/apexcharts/dist/locales/cs.json +55 -0
  39. package/dist/libs/apexcharts/dist/locales/de.json +55 -0
  40. package/dist/libs/apexcharts/dist/locales/el.json +55 -0
  41. package/dist/libs/apexcharts/dist/locales/en.json +55 -0
  42. package/dist/libs/apexcharts/dist/locales/es.json +55 -0
  43. package/dist/libs/apexcharts/dist/locales/et.json +63 -0
  44. package/dist/libs/apexcharts/dist/locales/fa.json +55 -0
  45. package/dist/libs/apexcharts/dist/locales/fi.json +55 -0
  46. package/dist/libs/apexcharts/dist/locales/fr.json +55 -0
  47. package/dist/libs/apexcharts/dist/locales/he.json +55 -0
  48. package/dist/libs/apexcharts/dist/locales/hi.json +55 -0
  49. package/dist/libs/apexcharts/dist/locales/hr.json +55 -0
  50. package/dist/libs/apexcharts/dist/locales/hu.json +64 -0
  51. package/dist/libs/apexcharts/dist/locales/hy.json +55 -0
  52. package/dist/libs/apexcharts/dist/locales/id.json +47 -0
  53. package/dist/libs/apexcharts/dist/locales/it.json +55 -0
  54. package/dist/libs/apexcharts/dist/locales/ja.json +55 -0
  55. package/dist/libs/apexcharts/dist/locales/ka.json +55 -0
  56. package/dist/libs/apexcharts/dist/locales/ko.json +55 -0
  57. package/dist/libs/apexcharts/dist/locales/lt.json +55 -0
  58. package/dist/libs/apexcharts/dist/locales/lv.json +64 -0
  59. package/dist/libs/apexcharts/dist/locales/nb.json +55 -0
  60. package/dist/libs/apexcharts/dist/locales/nl.json +55 -0
  61. package/dist/libs/apexcharts/dist/locales/pl.json +55 -0
  62. package/dist/libs/apexcharts/dist/locales/pt-br.json +55 -0
  63. package/dist/libs/apexcharts/dist/locales/pt.json +55 -0
  64. package/dist/libs/apexcharts/dist/locales/rs.json +55 -0
  65. package/dist/libs/apexcharts/dist/locales/ru.json +55 -0
  66. package/dist/libs/apexcharts/dist/locales/se.json +55 -0
  67. package/dist/libs/apexcharts/dist/locales/sk.json +55 -0
  68. package/dist/libs/apexcharts/dist/locales/sl.json +55 -0
  69. package/dist/libs/apexcharts/dist/locales/sq.json +55 -0
  70. package/dist/libs/apexcharts/dist/locales/th.json +55 -0
  71. package/dist/libs/apexcharts/dist/locales/tr.json +55 -0
  72. package/dist/libs/apexcharts/dist/locales/ua.json +55 -0
  73. package/dist/libs/apexcharts/dist/locales/zh-cn.json +55 -0
  74. package/dist/libs/apexcharts/dist/locales/zh-tw.json +55 -0
  75. package/dist/libs/bootstrap/dist/js/bootstrap.bundle.js +7090 -0
  76. package/dist/libs/bootstrap/dist/js/bootstrap.bundle.js.map +1 -0
  77. package/dist/libs/bootstrap/dist/js/bootstrap.bundle.min.js +3 -3
  78. package/dist/libs/bootstrap/dist/js/bootstrap.bundle.min.js.map +1 -0
  79. package/dist/libs/bootstrap/dist/js/bootstrap.esm.js +5217 -0
  80. package/dist/libs/bootstrap/dist/js/bootstrap.esm.js.map +1 -0
  81. package/dist/libs/bootstrap/dist/js/bootstrap.esm.min.js +7 -0
  82. package/dist/libs/bootstrap/dist/js/bootstrap.esm.min.js.map +1 -0
  83. package/dist/libs/bootstrap/dist/js/bootstrap.js +5264 -0
  84. package/dist/libs/bootstrap/dist/js/bootstrap.js.map +1 -0
  85. package/dist/libs/bootstrap/dist/js/bootstrap.min.js +7 -0
  86. package/dist/libs/bootstrap/dist/js/bootstrap.min.js.map +1 -0
  87. package/dist/libs/countup.js/dist/countUp.d.ts +61 -0
  88. package/dist/libs/countup.js/dist/countUp.js +25 -22
  89. package/dist/libs/countup.js/dist/countUp.min.js +1 -0
  90. package/dist/libs/countup.js/dist/countUp.umd.js +293 -0
  91. package/dist/libs/countup.js/dist/countUp.withPolyfill.min.js +1 -0
  92. package/dist/libs/dropzone/dist/basic.css +1 -0
  93. package/dist/libs/dropzone/dist/basic.css.map +1 -0
  94. package/dist/libs/dropzone/dist/dropzone-min.js +2 -0
  95. package/dist/libs/dropzone/dist/dropzone-min.js.map +1 -0
  96. package/dist/libs/dropzone/dist/dropzone.css +1 -0
  97. package/dist/libs/dropzone/dist/dropzone.css.map +1 -0
  98. package/dist/libs/dropzone/dist/dropzone.js +3068 -0
  99. package/dist/libs/dropzone/dist/dropzone.js.map +1 -0
  100. package/dist/libs/dropzone/dist/dropzone.mjs +2111 -0
  101. package/dist/libs/dropzone/dist/dropzone.mjs.map +1 -0
  102. package/dist/libs/fslightbox/LICENSE +21 -0
  103. package/dist/libs/fslightbox/README.md +62 -0
  104. package/dist/libs/fslightbox/index.js +1 -0
  105. package/dist/libs/fslightbox/jest-setup.js +1 -0
  106. package/dist/libs/fslightbox/package.json +72 -0
  107. package/dist/libs/jsvectormap/dist/js/jsvectormap.js +2658 -0
  108. package/dist/libs/jsvectormap/dist/js/jsvectormap.min.js +1 -1
  109. package/dist/libs/jsvectormap/dist/maps/world-merc.js +1 -1
  110. package/dist/libs/jsvectormap/dist/maps/world.js +1 -1
  111. package/dist/libs/list.js/dist/list.js +2020 -0
  112. package/dist/libs/list.js/dist/list.js.map +1 -0
  113. package/dist/libs/list.js/dist/list.min.js.map +1 -0
  114. package/dist/libs/litepicker/dist/bundle.js +52 -0
  115. package/dist/libs/litepicker/dist/css/litepicker.css +13 -0
  116. package/dist/libs/litepicker/dist/css/plugins/keyboardnav.js.css +12 -0
  117. package/dist/libs/litepicker/dist/css/plugins/mobilefriendly.js.css +133 -0
  118. package/dist/libs/litepicker/dist/css/plugins/multiselect.js.css +54 -0
  119. package/dist/libs/litepicker/dist/css/plugins/ranges.js.css +81 -0
  120. package/dist/libs/litepicker/dist/js/main.js +13 -0
  121. package/dist/libs/litepicker/dist/litepicker.amd.js +12 -0
  122. package/dist/libs/litepicker/dist/litepicker.commonjs2.js +12 -0
  123. package/dist/libs/litepicker/dist/litepicker.umd.js +12 -0
  124. package/dist/libs/litepicker/dist/nocss/litepicker.amd.js +12 -0
  125. package/dist/libs/litepicker/dist/nocss/litepicker.commonjs2.js +12 -0
  126. package/dist/libs/litepicker/dist/nocss/litepicker.js +12 -0
  127. package/dist/libs/litepicker/dist/nocss/litepicker.umd.js +12 -0
  128. package/dist/libs/litepicker/dist/nocss/plugins/keyboardnav.js +11 -0
  129. package/dist/libs/litepicker/dist/nocss/plugins/mobilefriendly.js +11 -0
  130. package/dist/libs/litepicker/dist/nocss/plugins/multiselect.js +11 -0
  131. package/dist/libs/litepicker/dist/nocss/plugins/ranges.js +11 -0
  132. package/dist/libs/litepicker/dist/plugins/keyboardnav.js +11 -0
  133. package/dist/libs/litepicker/dist/plugins/mobilefriendly.js +11 -0
  134. package/dist/libs/litepicker/dist/plugins/multiselect.js +11 -0
  135. package/dist/libs/litepicker/dist/plugins/ranges.js +11 -0
  136. package/dist/libs/litepicker/dist/types/calendar.d.ts +14 -0
  137. package/dist/libs/litepicker/dist/types/core.d.ts +23 -0
  138. package/dist/libs/litepicker/dist/types/datetime.d.ts +41 -0
  139. package/dist/libs/litepicker/dist/types/index.d.ts +4 -0
  140. package/dist/libs/litepicker/dist/types/interfaces.d.ts +80 -0
  141. package/dist/libs/litepicker/dist/types/litepicker.d.ts +25 -0
  142. package/dist/libs/litepicker/dist/types/methods.d.ts +20 -0
  143. package/dist/libs/litepicker/dist/types/utils.d.ts +4 -0
  144. package/dist/libs/litepicker/dist/types/window.d.ts +6 -0
  145. package/dist/libs/nouislider/dist/nouislider.css +304 -0
  146. package/dist/libs/nouislider/dist/nouislider.d.ts +198 -0
  147. package/dist/libs/nouislider/dist/nouislider.js +2254 -0
  148. package/dist/libs/nouislider/dist/nouislider.min.css +1 -0
  149. package/dist/libs/nouislider/dist/nouislider.min.js +1 -1
  150. package/dist/libs/nouislider/dist/nouislider.min.mjs +1 -0
  151. package/dist/libs/nouislider/dist/nouislider.mjs +2243 -0
  152. package/dist/libs/plyr/dist/plyr.css +1 -0
  153. package/dist/libs/plyr/dist/plyr.js +8764 -0
  154. package/dist/libs/plyr/dist/plyr.min.js +2 -0
  155. package/dist/libs/plyr/dist/plyr.min.js.map +1 -0
  156. package/dist/libs/plyr/dist/plyr.min.mjs +1 -0
  157. package/dist/libs/plyr/dist/plyr.min.mjs.map +1 -0
  158. package/dist/libs/plyr/dist/plyr.mjs +8756 -0
  159. package/dist/libs/plyr/dist/plyr.polyfilled.js +9301 -0
  160. package/dist/libs/plyr/dist/plyr.polyfilled.min.js +2 -0
  161. package/dist/libs/plyr/dist/plyr.polyfilled.min.js.map +1 -0
  162. package/dist/libs/plyr/dist/plyr.polyfilled.min.mjs +1 -0
  163. package/dist/libs/plyr/dist/plyr.polyfilled.min.mjs.map +1 -0
  164. package/dist/libs/plyr/dist/plyr.polyfilled.mjs +9293 -0
  165. package/dist/libs/plyr/dist/plyr.svg +1 -0
  166. package/dist/libs/tinymce/CHANGELOG.md +2957 -0
  167. package/dist/libs/tinymce/README.md +71 -0
  168. package/dist/libs/tinymce/bower.json +27 -0
  169. package/dist/libs/tinymce/composer.json +52 -0
  170. package/dist/libs/tinymce/icons/default/icons.js +182 -0
  171. package/dist/libs/tinymce/icons/default/icons.min.js +1 -0
  172. package/dist/libs/tinymce/icons/default/index.js +7 -0
  173. package/dist/libs/tinymce/license.txt +21 -0
  174. package/dist/libs/tinymce/models/dom/index.js +7 -0
  175. package/dist/libs/tinymce/models/dom/model.js +7975 -0
  176. package/dist/libs/tinymce/models/dom/model.min.js +4 -0
  177. package/dist/libs/tinymce/package.json +32 -0
  178. package/dist/libs/tinymce/plugins/advlist/index.js +7 -0
  179. package/dist/libs/tinymce/plugins/advlist/plugin.js +246 -0
  180. package/dist/libs/tinymce/plugins/advlist/plugin.min.js +4 -0
  181. package/dist/libs/tinymce/plugins/anchor/index.js +7 -0
  182. package/dist/libs/tinymce/plugins/anchor/plugin.js +195 -0
  183. package/dist/libs/tinymce/plugins/anchor/plugin.min.js +4 -0
  184. package/dist/libs/tinymce/plugins/autolink/index.js +7 -0
  185. package/dist/libs/tinymce/plugins/autolink/plugin.js +232 -0
  186. package/dist/libs/tinymce/plugins/autolink/plugin.min.js +4 -0
  187. package/dist/libs/tinymce/plugins/autoresize/index.js +7 -0
  188. package/dist/libs/tinymce/plugins/autoresize/plugin.js +156 -0
  189. package/dist/libs/tinymce/plugins/autoresize/plugin.min.js +4 -0
  190. package/dist/libs/tinymce/plugins/autosave/index.js +7 -0
  191. package/dist/libs/tinymce/plugins/autosave/plugin.js +232 -0
  192. package/dist/libs/tinymce/plugins/autosave/plugin.min.js +4 -0
  193. package/dist/libs/tinymce/plugins/charmap/index.js +7 -0
  194. package/dist/libs/tinymce/plugins/charmap/plugin.js +1636 -0
  195. package/dist/libs/tinymce/plugins/charmap/plugin.min.js +4 -0
  196. package/dist/libs/tinymce/plugins/code/index.js +7 -0
  197. package/dist/libs/tinymce/plugins/code/plugin.js +85 -0
  198. package/dist/libs/tinymce/plugins/code/plugin.min.js +4 -0
  199. package/dist/libs/tinymce/plugins/codesample/index.js +7 -0
  200. package/dist/libs/tinymce/plugins/codesample/plugin.js +2451 -0
  201. package/dist/libs/tinymce/plugins/codesample/plugin.min.js +4 -0
  202. package/dist/libs/tinymce/plugins/directionality/index.js +7 -0
  203. package/dist/libs/tinymce/plugins/directionality/plugin.js +384 -0
  204. package/dist/libs/tinymce/plugins/directionality/plugin.min.js +4 -0
  205. package/dist/libs/tinymce/plugins/emoticons/index.js +7 -0
  206. package/dist/libs/tinymce/plugins/emoticons/js/emojiimages.js +1 -0
  207. package/dist/libs/tinymce/plugins/emoticons/js/emojiimages.min.js +3 -0
  208. package/dist/libs/tinymce/plugins/emoticons/js/emojis.js +1 -0
  209. package/dist/libs/tinymce/plugins/emoticons/js/emojis.min.js +2 -0
  210. package/dist/libs/tinymce/plugins/emoticons/plugin.js +577 -0
  211. package/dist/libs/tinymce/plugins/emoticons/plugin.min.js +4 -0
  212. package/dist/libs/tinymce/plugins/fullscreen/index.js +7 -0
  213. package/dist/libs/tinymce/plugins/fullscreen/plugin.js +1190 -0
  214. package/dist/libs/tinymce/plugins/fullscreen/plugin.min.js +4 -0
  215. package/dist/libs/tinymce/plugins/help/index.js +7 -0
  216. package/dist/libs/tinymce/plugins/help/plugin.js +848 -0
  217. package/dist/libs/tinymce/plugins/help/plugin.min.js +4 -0
  218. package/dist/libs/tinymce/plugins/image/index.js +7 -0
  219. package/dist/libs/tinymce/plugins/image/plugin.js +1475 -0
  220. package/dist/libs/tinymce/plugins/image/plugin.min.js +4 -0
  221. package/dist/libs/tinymce/plugins/importcss/index.js +7 -0
  222. package/dist/libs/tinymce/plugins/importcss/plugin.js +342 -0
  223. package/dist/libs/tinymce/plugins/importcss/plugin.min.js +4 -0
  224. package/dist/libs/tinymce/plugins/insertdatetime/index.js +7 -0
  225. package/dist/libs/tinymce/plugins/insertdatetime/plugin.js +176 -0
  226. package/dist/libs/tinymce/plugins/insertdatetime/plugin.min.js +4 -0
  227. package/dist/libs/tinymce/plugins/link/index.js +7 -0
  228. package/dist/libs/tinymce/plugins/link/plugin.js +1190 -0
  229. package/dist/libs/tinymce/plugins/link/plugin.min.js +4 -0
  230. package/dist/libs/tinymce/plugins/lists/index.js +7 -0
  231. package/dist/libs/tinymce/plugins/lists/plugin.js +1820 -0
  232. package/dist/libs/tinymce/plugins/lists/plugin.min.js +4 -0
  233. package/dist/libs/tinymce/plugins/media/index.js +7 -0
  234. package/dist/libs/tinymce/plugins/media/plugin.js +1157 -0
  235. package/dist/libs/tinymce/plugins/media/plugin.min.js +4 -0
  236. package/dist/libs/tinymce/plugins/nonbreaking/index.js +7 -0
  237. package/dist/libs/tinymce/plugins/nonbreaking/plugin.js +111 -0
  238. package/dist/libs/tinymce/plugins/nonbreaking/plugin.min.js +4 -0
  239. package/dist/libs/tinymce/plugins/pagebreak/index.js +7 -0
  240. package/dist/libs/tinymce/plugins/pagebreak/plugin.js +105 -0
  241. package/dist/libs/tinymce/plugins/pagebreak/plugin.min.js +4 -0
  242. package/dist/libs/tinymce/plugins/preview/index.js +7 -0
  243. package/dist/libs/tinymce/plugins/preview/plugin.js +97 -0
  244. package/dist/libs/tinymce/plugins/preview/plugin.min.js +4 -0
  245. package/dist/libs/tinymce/plugins/quickbars/index.js +7 -0
  246. package/dist/libs/tinymce/plugins/quickbars/plugin.js +421 -0
  247. package/dist/libs/tinymce/plugins/quickbars/plugin.min.js +4 -0
  248. package/dist/libs/tinymce/plugins/save/index.js +7 -0
  249. package/dist/libs/tinymce/plugins/save/plugin.js +118 -0
  250. package/dist/libs/tinymce/plugins/save/plugin.min.js +4 -0
  251. package/dist/libs/tinymce/plugins/searchreplace/index.js +7 -0
  252. package/dist/libs/tinymce/plugins/searchreplace/plugin.js +1079 -0
  253. package/dist/libs/tinymce/plugins/searchreplace/plugin.min.js +4 -0
  254. package/dist/libs/tinymce/plugins/table/index.js +7 -0
  255. package/dist/libs/tinymce/plugins/table/plugin.js +3393 -0
  256. package/dist/libs/tinymce/plugins/table/plugin.min.js +4 -0
  257. package/dist/libs/tinymce/plugins/template/index.js +7 -0
  258. package/dist/libs/tinymce/plugins/template/plugin.js +548 -0
  259. package/dist/libs/tinymce/plugins/template/plugin.min.js +4 -0
  260. package/dist/libs/tinymce/plugins/visualblocks/index.js +7 -0
  261. package/dist/libs/tinymce/plugins/visualblocks/plugin.js +98 -0
  262. package/dist/libs/tinymce/plugins/visualblocks/plugin.min.js +4 -0
  263. package/dist/libs/tinymce/plugins/visualchars/index.js +7 -0
  264. package/dist/libs/tinymce/plugins/visualchars/plugin.js +506 -0
  265. package/dist/libs/tinymce/plugins/visualchars/plugin.min.js +4 -0
  266. package/dist/libs/tinymce/plugins/wordcount/index.js +7 -0
  267. package/dist/libs/tinymce/plugins/wordcount/plugin.js +404 -0
  268. package/dist/libs/tinymce/plugins/wordcount/plugin.min.js +4 -0
  269. package/dist/libs/tinymce/skins/content/dark/content.css +66 -0
  270. package/dist/libs/tinymce/skins/content/dark/content.min.css +1 -0
  271. package/dist/libs/tinymce/skins/content/default/content.css +61 -0
  272. package/dist/libs/tinymce/skins/content/default/content.min.css +1 -0
  273. package/dist/libs/tinymce/skins/content/document/content.css +66 -0
  274. package/dist/libs/tinymce/skins/content/document/content.min.css +1 -0
  275. package/dist/libs/tinymce/skins/content/tinymce-5/content.css +61 -0
  276. package/dist/libs/tinymce/skins/content/tinymce-5/content.min.css +1 -0
  277. package/dist/libs/tinymce/skins/content/tinymce-5-dark/content.css +66 -0
  278. package/dist/libs/tinymce/skins/content/tinymce-5-dark/content.min.css +1 -0
  279. package/dist/libs/tinymce/skins/content/writer/content.css +62 -0
  280. package/dist/libs/tinymce/skins/content/writer/content.min.css +1 -0
  281. package/dist/libs/tinymce/skins/ui/oxide/content.css +747 -0
  282. package/dist/libs/tinymce/skins/ui/oxide/content.inline.css +741 -0
  283. package/dist/libs/tinymce/skins/ui/oxide/content.inline.min.css +1 -0
  284. package/dist/libs/tinymce/skins/ui/oxide/content.min.css +1 -0
  285. package/dist/libs/tinymce/skins/ui/oxide/skin.css +3074 -0
  286. package/dist/libs/tinymce/skins/ui/oxide/skin.min.css +1 -0
  287. package/dist/libs/tinymce/skins/ui/oxide/skin.shadowdom.css +30 -0
  288. package/dist/libs/tinymce/skins/ui/oxide/skin.shadowdom.min.css +1 -0
  289. package/dist/libs/tinymce/skins/ui/oxide-dark/content.css +728 -0
  290. package/dist/libs/tinymce/skins/ui/oxide-dark/content.inline.css +741 -0
  291. package/dist/libs/tinymce/skins/ui/oxide-dark/content.inline.min.css +1 -0
  292. package/dist/libs/tinymce/skins/ui/oxide-dark/content.min.css +1 -0
  293. package/dist/libs/tinymce/skins/ui/oxide-dark/skin.css +3077 -0
  294. package/dist/libs/tinymce/skins/ui/oxide-dark/skin.min.css +1 -0
  295. package/dist/libs/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +30 -0
  296. package/dist/libs/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -0
  297. package/dist/libs/tinymce/skins/ui/tinymce-5/content.css +747 -0
  298. package/dist/libs/tinymce/skins/ui/tinymce-5/content.inline.css +741 -0
  299. package/dist/libs/tinymce/skins/ui/tinymce-5/content.inline.min.css +1 -0
  300. package/dist/libs/tinymce/skins/ui/tinymce-5/content.min.css +1 -0
  301. package/dist/libs/tinymce/skins/ui/tinymce-5/skin.css +3158 -0
  302. package/dist/libs/tinymce/skins/ui/tinymce-5/skin.min.css +1 -0
  303. package/dist/libs/tinymce/skins/ui/tinymce-5/skin.shadowdom.css +30 -0
  304. package/dist/libs/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.css +1 -0
  305. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.css +728 -0
  306. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.inline.css +741 -0
  307. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +1 -0
  308. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.min.css +1 -0
  309. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.css +3158 -0
  310. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.min.css +1 -0
  311. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.css +30 -0
  312. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.css +1 -0
  313. package/dist/libs/tinymce/themes/silver/index.js +7 -0
  314. package/dist/libs/tinymce/themes/silver/theme.js +26184 -0
  315. package/dist/libs/tinymce/themes/silver/theme.min.js +4 -0
  316. package/dist/libs/tinymce/tinymce.d.ts +2895 -0
  317. package/dist/libs/tinymce/tinymce.js +29400 -0
  318. package/dist/libs/tinymce/tinymce.min.js +4 -0
  319. package/dist/libs/tom-select/dist/js/plugins/caret_position.js +170 -0
  320. package/dist/libs/tom-select/dist/js/plugins/caret_position.js.map +1 -0
  321. package/dist/libs/tom-select/dist/js/plugins/change_listener.js +58 -0
  322. package/dist/libs/tom-select/dist/js/plugins/change_listener.js.map +1 -0
  323. package/dist/libs/tom-select/dist/js/plugins/checkbox_options.js +182 -0
  324. package/dist/libs/tom-select/dist/js/plugins/checkbox_options.js.map +1 -0
  325. package/dist/libs/tom-select/dist/js/plugins/clear_button.js +99 -0
  326. package/dist/libs/tom-select/dist/js/plugins/clear_button.js.map +1 -0
  327. package/dist/libs/tom-select/dist/js/plugins/drag_drop.js +70 -0
  328. package/dist/libs/tom-select/dist/js/plugins/drag_drop.js.map +1 -0
  329. package/dist/libs/tom-select/dist/js/plugins/dropdown_header.js +126 -0
  330. package/dist/libs/tom-select/dist/js/plugins/dropdown_header.js.map +1 -0
  331. package/dist/libs/tom-select/dist/js/plugins/dropdown_input.js +240 -0
  332. package/dist/libs/tom-select/dist/js/plugins/dropdown_input.js.map +1 -0
  333. package/dist/libs/tom-select/dist/js/plugins/input_autogrow.js +84 -0
  334. package/dist/libs/tom-select/dist/js/plugins/input_autogrow.js.map +1 -0
  335. package/dist/libs/tom-select/dist/js/plugins/no_active_items.js +33 -0
  336. package/dist/libs/tom-select/dist/js/plugins/no_active_items.js.map +1 -0
  337. package/dist/libs/tom-select/dist/js/plugins/no_backspace_delete.js +40 -0
  338. package/dist/libs/tom-select/dist/js/plugins/no_backspace_delete.js.map +1 -0
  339. package/dist/libs/tom-select/dist/js/plugins/optgroup_columns.js +117 -0
  340. package/dist/libs/tom-select/dist/js/plugins/optgroup_columns.js.map +1 -0
  341. package/dist/libs/tom-select/dist/js/plugins/remove_button.js +154 -0
  342. package/dist/libs/tom-select/dist/js/plugins/remove_button.js.map +1 -0
  343. package/dist/libs/tom-select/dist/js/plugins/restore_on_backspace.js +51 -0
  344. package/dist/libs/tom-select/dist/js/plugins/restore_on_backspace.js.map +1 -0
  345. package/dist/libs/tom-select/dist/js/plugins/virtual_scroll.js +279 -0
  346. package/dist/libs/tom-select/dist/js/plugins/virtual_scroll.js.map +1 -0
  347. package/dist/libs/tom-select/dist/js/tom-select.base.js +4165 -0
  348. package/dist/libs/tom-select/dist/js/tom-select.base.js.map +1 -0
  349. package/dist/libs/tom-select/dist/js/tom-select.base.min.js +144 -144
  350. package/dist/libs/tom-select/dist/js/tom-select.base.min.js.map +1 -0
  351. package/dist/libs/tom-select/dist/js/tom-select.complete.js +4978 -0
  352. package/dist/libs/tom-select/dist/js/tom-select.complete.js.map +1 -0
  353. package/dist/libs/tom-select/dist/js/tom-select.complete.min.js +363 -0
  354. package/dist/libs/tom-select/dist/js/tom-select.complete.min.js.map +1 -0
  355. package/dist/libs/tom-select/dist/js/tom-select.popular.js +4419 -0
  356. package/dist/libs/tom-select/dist/js/tom-select.popular.js.map +1 -0
  357. package/dist/libs/tom-select/dist/js/tom-select.popular.min.js +323 -0
  358. package/dist/libs/tom-select/dist/js/tom-select.popular.min.js.map +1 -0
  359. package/package.json +100 -33
  360. package/src/js/demo-theme.js +25 -0
  361. package/src/js/demo.js +0 -17
  362. package/src/js/src/tabler.js +17 -0
  363. package/src/js/tabler.js +2 -0
  364. package/src/scss/_bootstrap-components.scss +1 -1
  365. package/src/scss/_bootstrap-config.scss +1 -0
  366. package/src/scss/_core.scss +2 -0
  367. package/src/scss/_utilities.scss +2 -2
  368. package/src/scss/_variables.scss +218 -92
  369. package/src/scss/demo/_examples.scss +2 -2
  370. package/src/scss/demo/_highlight.scss +3 -3
  371. package/src/scss/demo.scss +5 -5
  372. package/src/scss/fonts/_webfonts.scss +0 -50
  373. package/src/scss/layout/_core.scss +10 -23
  374. package/src/scss/layout/_dark.scss +22 -16
  375. package/src/scss/layout/_footer.scss +2 -2
  376. package/src/scss/layout/_navbar.scss +18 -15
  377. package/src/scss/layout/_page.scss +8 -6
  378. package/src/scss/layout/_root.scss +37 -0
  379. package/src/scss/mixins/_functions.scss +2 -16
  380. package/src/scss/mixins/_mixins.scss +32 -5
  381. package/src/scss/tabler-vendors.scss +4 -0
  382. package/src/scss/ui/_accordion.scss +5 -1
  383. package/src/scss/ui/_alerts.scss +8 -8
  384. package/src/scss/ui/_avatars.scss +14 -14
  385. package/src/scss/ui/_badges.scss +2 -2
  386. package/src/scss/ui/_breadcrumbs.scss +1 -1
  387. package/src/scss/ui/_buttons.scss +100 -108
  388. package/src/scss/ui/_calendars.scss +8 -8
  389. package/src/scss/ui/_cards.scss +46 -52
  390. package/src/scss/ui/_carousel.scss +2 -2
  391. package/src/scss/ui/_chips.scss +0 -0
  392. package/src/scss/ui/_datagrid.scss +17 -0
  393. package/src/scss/ui/_empty.scss +3 -3
  394. package/src/scss/ui/_flags.scss +2 -2
  395. package/src/scss/ui/_forms.scss +12 -11
  396. package/src/scss/ui/_grid.scss +13 -14
  397. package/src/scss/ui/_icons.scss +64 -4
  398. package/src/scss/ui/_legend.scss +8 -4
  399. package/src/scss/ui/_lists.scss +17 -14
  400. package/src/scss/ui/_markdown.scss +2 -3
  401. package/src/scss/ui/_modals.scss +1 -1
  402. package/src/scss/ui/_nav.scss +7 -7
  403. package/src/scss/ui/_offcanvas.scss +3 -3
  404. package/src/scss/ui/_pagination.scss +10 -6
  405. package/src/scss/ui/_placeholder.scss +1 -1
  406. package/src/scss/ui/_progress.scss +45 -6
  407. package/src/scss/ui/_ribbons.scss +5 -5
  408. package/src/scss/ui/_status.scss +28 -27
  409. package/src/scss/ui/_steps.scss +2 -2
  410. package/src/scss/ui/_tables.scss +26 -5
  411. package/src/scss/ui/_toasts.scss +1 -2
  412. package/src/scss/ui/_type.scss +45 -30
  413. package/src/scss/ui/forms/_form-check.scss +26 -1
  414. package/src/scss/ui/forms/_form-colorinput.scss +2 -2
  415. package/src/scss/ui/forms/_form-custom.scss +2 -2
  416. package/src/scss/ui/forms/_form-icon.scss +1 -1
  417. package/src/scss/ui/forms/_form-imagecheck.scss +4 -4
  418. package/src/scss/ui/forms/_form-selectgroup.scss +7 -7
  419. package/src/scss/ui/forms/_validation.scss +1 -1
  420. package/src/scss/ui/typo/_hr.scss +2 -3
  421. package/src/scss/utils/_colors.scss +19 -8
  422. package/src/scss/vendor/_dropzone.scss +27 -0
  423. package/src/scss/vendor/_fslightbox.scss +13 -0
  424. package/src/scss/vendor/_jsvectormap.scss +8 -8
  425. package/src/scss/vendor/_litepicker.scss +14 -14
  426. package/src/scss/vendor/_plyr.scss +3 -0
  427. package/src/scss/vendor/_tinymce.scss +25 -0
  428. package/src/scss/vendor/_tom-select.scss +2 -0
@@ -0,0 +1,3068 @@
1
+ var $6mU8w$swchelpers = require("@swc/helpers");
2
+ var $6mU8w$justextend = require("just-extend");
3
+
4
+ function $parcel$interopDefault(a) {
5
+ return a && a.__esModule ? a.default : a;
6
+ }
7
+ function $parcel$defineInteropFlag(a) {
8
+ Object.defineProperty(a, '__esModule', {value: true, configurable: true});
9
+ }
10
+ function $parcel$export(e, n, v, s) {
11
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
12
+ }
13
+
14
+ $parcel$defineInteropFlag(module.exports);
15
+
16
+ $parcel$export(module.exports, "default", function () { return $a601ff30f483e917$export$2e2bcd8739ae039; });
17
+ $parcel$export(module.exports, "Dropzone", function () { return $a601ff30f483e917$export$2e2bcd8739ae039; });
18
+
19
+
20
+
21
+ var $b1d17cfb1d15c36a$export$2e2bcd8739ae039 = /*#__PURE__*/ function() {
22
+ "use strict";
23
+ function $b1d17cfb1d15c36a$export$2e2bcd8739ae039() {
24
+ $6mU8w$swchelpers.classCallCheck(this, $b1d17cfb1d15c36a$export$2e2bcd8739ae039);
25
+ }
26
+ $6mU8w$swchelpers.createClass($b1d17cfb1d15c36a$export$2e2bcd8739ae039, [
27
+ {
28
+ // Add an event listener for given event
29
+ key: "on",
30
+ value: function on(event, fn) {
31
+ this._callbacks = this._callbacks || {
32
+ };
33
+ // Create namespace for this event
34
+ if (!this._callbacks[event]) this._callbacks[event] = [];
35
+ this._callbacks[event].push(fn);
36
+ return this;
37
+ }
38
+ },
39
+ {
40
+ key: "emit",
41
+ value: function emit(event) {
42
+ for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
43
+ args[_key - 1] = arguments[_key];
44
+ }
45
+ this._callbacks = this._callbacks || {
46
+ };
47
+ var callbacks = this._callbacks[event];
48
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
49
+ if (callbacks) try {
50
+ for(var _iterator = callbacks[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
51
+ var callback = _step.value;
52
+ callback.apply(this, args);
53
+ }
54
+ } catch (err) {
55
+ _didIteratorError = true;
56
+ _iteratorError = err;
57
+ } finally{
58
+ try {
59
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
60
+ _iterator.return();
61
+ }
62
+ } finally{
63
+ if (_didIteratorError) {
64
+ throw _iteratorError;
65
+ }
66
+ }
67
+ }
68
+ // trigger a corresponding DOM event
69
+ if (this.element) this.element.dispatchEvent(this.makeEvent("dropzone:" + event, {
70
+ args: args
71
+ }));
72
+ return this;
73
+ }
74
+ },
75
+ {
76
+ key: "makeEvent",
77
+ value: function makeEvent(eventName, detail) {
78
+ var params = {
79
+ bubbles: true,
80
+ cancelable: true,
81
+ detail: detail
82
+ };
83
+ if (typeof window.CustomEvent === "function") return new CustomEvent(eventName, params);
84
+ else {
85
+ // IE 11 support
86
+ // https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
87
+ var evt = document.createEvent("CustomEvent");
88
+ evt.initCustomEvent(eventName, params.bubbles, params.cancelable, params.detail);
89
+ return evt;
90
+ }
91
+ }
92
+ },
93
+ {
94
+ // Remove event listener for given event. If fn is not provided, all event
95
+ // listeners for that event will be removed. If neither is provided, all
96
+ // event listeners will be removed.
97
+ key: "off",
98
+ value: function off(event, fn) {
99
+ if (!this._callbacks || arguments.length === 0) {
100
+ this._callbacks = {
101
+ };
102
+ return this;
103
+ }
104
+ // specific event
105
+ var callbacks = this._callbacks[event];
106
+ if (!callbacks) return this;
107
+ // remove all handlers
108
+ if (arguments.length === 1) {
109
+ delete this._callbacks[event];
110
+ return this;
111
+ }
112
+ // remove specific handler
113
+ for(var i = 0; i < callbacks.length; i++){
114
+ var callback = callbacks[i];
115
+ if (callback === fn) {
116
+ callbacks.splice(i, 1);
117
+ break;
118
+ }
119
+ }
120
+ return this;
121
+ }
122
+ }
123
+ ]);
124
+ return $b1d17cfb1d15c36a$export$2e2bcd8739ae039;
125
+ }();
126
+
127
+
128
+
129
+ var $69c61888cc1f4c57$exports = {};
130
+ $69c61888cc1f4c57$exports = "<div class=\"dz-preview dz-file-preview\">\n <div class=\"dz-image\"><img data-dz-thumbnail=\"\"></div>\n <div class=\"dz-details\">\n <div class=\"dz-size\"><span data-dz-size=\"\"></span></div>\n <div class=\"dz-filename\"><span data-dz-name=\"\"></span></div>\n </div>\n <div class=\"dz-progress\">\n <span class=\"dz-upload\" data-dz-uploadprogress=\"\"></span>\n </div>\n <div class=\"dz-error-message\"><span data-dz-errormessage=\"\"></span></div>\n <div class=\"dz-success-mark\">\n <svg width=\"54\" height=\"54\" viewBox=\"0 0 54 54\" fill=\"white\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M10.2071 29.7929L14.2929 25.7071C14.6834 25.3166 15.3166 25.3166 15.7071 25.7071L21.2929 31.2929C21.6834 31.6834 22.3166 31.6834 22.7071 31.2929L38.2929 15.7071C38.6834 15.3166 39.3166 15.3166 39.7071 15.7071L43.7929 19.7929C44.1834 20.1834 44.1834 20.8166 43.7929 21.2071L22.7071 42.2929C22.3166 42.6834 21.6834 42.6834 21.2929 42.2929L10.2071 31.2071C9.81658 30.8166 9.81658 30.1834 10.2071 29.7929Z\"></path>\n </svg>\n </div>\n <div class=\"dz-error-mark\">\n <svg width=\"54\" height=\"54\" viewBox=\"0 0 54 54\" fill=\"white\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M26.2929 20.2929L19.2071 13.2071C18.8166 12.8166 18.1834 12.8166 17.7929 13.2071L13.2071 17.7929C12.8166 18.1834 12.8166 18.8166 13.2071 19.2071L20.2929 26.2929C20.6834 26.6834 20.6834 27.3166 20.2929 27.7071L13.2071 34.7929C12.8166 35.1834 12.8166 35.8166 13.2071 36.2071L17.7929 40.7929C18.1834 41.1834 18.8166 41.1834 19.2071 40.7929L26.2929 33.7071C26.6834 33.3166 27.3166 33.3166 27.7071 33.7071L34.7929 40.7929C35.1834 41.1834 35.8166 41.1834 36.2071 40.7929L40.7929 36.2071C41.1834 35.8166 41.1834 35.1834 40.7929 34.7929L33.7071 27.7071C33.3166 27.3166 33.3166 26.6834 33.7071 26.2929L40.7929 19.2071C41.1834 18.8166 41.1834 18.1834 40.7929 17.7929L36.2071 13.2071C35.8166 12.8166 35.1834 12.8166 34.7929 13.2071L27.7071 20.2929C27.3166 20.6834 26.6834 20.6834 26.2929 20.2929Z\"></path>\n </svg>\n </div>\n</div>\n";
131
+
132
+
133
+ var $b657c03155fc27e2$var$defaultOptions = {
134
+ /**
135
+ * Has to be specified on elements other than form (or when the form doesn't
136
+ * have an `action` attribute).
137
+ *
138
+ * You can also provide a function that will be called with `files` and
139
+ * `dataBlocks` and must return the url as string.
140
+ */ url: null,
141
+ /**
142
+ * Can be changed to `"put"` if necessary. You can also provide a function
143
+ * that will be called with `files` and must return the method (since `v3.12.0`).
144
+ */ method: "post",
145
+ /**
146
+ * Will be set on the XHRequest.
147
+ */ withCredentials: false,
148
+ /**
149
+ * The timeout for the XHR requests in milliseconds (since `v4.4.0`).
150
+ * If set to null or 0, no timeout is going to be set.
151
+ */ timeout: null,
152
+ /**
153
+ * How many file uploads to process in parallel (See the
154
+ * Enqueuing file uploads documentation section for more info)
155
+ */ parallelUploads: 2,
156
+ /**
157
+ * Whether to send multiple files in one request. If
158
+ * this it set to true, then the fallback file input element will
159
+ * have the `multiple` attribute as well. This option will
160
+ * also trigger additional events (like `processingmultiple`). See the events
161
+ * documentation section for more information.
162
+ */ uploadMultiple: false,
163
+ /**
164
+ * Whether you want files to be uploaded in chunks to your server. This can't be
165
+ * used in combination with `uploadMultiple`.
166
+ *
167
+ * See [chunksUploaded](#config-chunksUploaded) for the callback to finalise an upload.
168
+ */ chunking: false,
169
+ /**
170
+ * If `chunking` is enabled, this defines whether **every** file should be chunked,
171
+ * even if the file size is below chunkSize. This means, that the additional chunk
172
+ * form data will be submitted and the `chunksUploaded` callback will be invoked.
173
+ */ forceChunking: false,
174
+ /**
175
+ * If `chunking` is `true`, then this defines the chunk size in bytes.
176
+ */ chunkSize: 2097152,
177
+ /**
178
+ * If `true`, the individual chunks of a file are being uploaded simultaneously.
179
+ */ parallelChunkUploads: false,
180
+ /**
181
+ * Whether a chunk should be retried if it fails.
182
+ */ retryChunks: false,
183
+ /**
184
+ * If `retryChunks` is true, how many times should it be retried.
185
+ */ retryChunksLimit: 3,
186
+ /**
187
+ * The maximum filesize (in MiB) that is allowed to be uploaded.
188
+ */ maxFilesize: 256,
189
+ /**
190
+ * The name of the file param that gets transferred.
191
+ * **NOTE**: If you have the option `uploadMultiple` set to `true`, then
192
+ * Dropzone will append `[]` to the name.
193
+ */ paramName: "file",
194
+ /**
195
+ * Whether thumbnails for images should be generated
196
+ */ createImageThumbnails: true,
197
+ /**
198
+ * In MB. When the filename exceeds this limit, the thumbnail will not be generated.
199
+ */ maxThumbnailFilesize: 10,
200
+ /**
201
+ * If `null`, the ratio of the image will be used to calculate it.
202
+ */ thumbnailWidth: 120,
203
+ /**
204
+ * The same as `thumbnailWidth`. If both are null, images will not be resized.
205
+ */ thumbnailHeight: 120,
206
+ /**
207
+ * How the images should be scaled down in case both, `thumbnailWidth` and `thumbnailHeight` are provided.
208
+ * Can be either `contain` or `crop`.
209
+ */ thumbnailMethod: "crop",
210
+ /**
211
+ * If set, images will be resized to these dimensions before being **uploaded**.
212
+ * If only one, `resizeWidth` **or** `resizeHeight` is provided, the original aspect
213
+ * ratio of the file will be preserved.
214
+ *
215
+ * The `options.transformFile` function uses these options, so if the `transformFile` function
216
+ * is overridden, these options don't do anything.
217
+ */ resizeWidth: null,
218
+ /**
219
+ * See `resizeWidth`.
220
+ */ resizeHeight: null,
221
+ /**
222
+ * The mime type of the resized image (before it gets uploaded to the server).
223
+ * If `null` the original mime type will be used. To force jpeg, for example, use `image/jpeg`.
224
+ * See `resizeWidth` for more information.
225
+ */ resizeMimeType: null,
226
+ /**
227
+ * The quality of the resized images. See `resizeWidth`.
228
+ */ resizeQuality: 0.8,
229
+ /**
230
+ * How the images should be scaled down in case both, `resizeWidth` and `resizeHeight` are provided.
231
+ * Can be either `contain` or `crop`.
232
+ */ resizeMethod: "contain",
233
+ /**
234
+ * The base that is used to calculate the **displayed** filesize. You can
235
+ * change this to 1024 if you would rather display kibibytes, mebibytes,
236
+ * etc... 1024 is technically incorrect, because `1024 bytes` are `1 kibibyte`
237
+ * not `1 kilobyte`. You can change this to `1024` if you don't care about
238
+ * validity.
239
+ */ filesizeBase: 1000,
240
+ /**
241
+ * If not `null` defines how many files this Dropzone handles. If it exceeds,
242
+ * the event `maxfilesexceeded` will be called. The dropzone element gets the
243
+ * class `dz-max-files-reached` accordingly so you can provide visual
244
+ * feedback.
245
+ */ maxFiles: null,
246
+ /**
247
+ * An optional object to send additional headers to the server. Eg:
248
+ * `{ "My-Awesome-Header": "header value" }`
249
+ */ headers: null,
250
+ /**
251
+ * Should the default headers be set or not?
252
+ * Accept: application/json <- for requesting json response
253
+ * Cache-Control: no-cache <- Request shouldnt be cached
254
+ * X-Requested-With: XMLHttpRequest <- We sent the request via XMLHttpRequest
255
+ */ defaultHeaders: true,
256
+ /**
257
+ * If `true`, the dropzone element itself will be clickable, if `false`
258
+ * nothing will be clickable.
259
+ *
260
+ * You can also pass an HTML element, a CSS selector (for multiple elements)
261
+ * or an array of those. In that case, all of those elements will trigger an
262
+ * upload when clicked.
263
+ */ clickable: true,
264
+ /**
265
+ * Whether hidden files in directories should be ignored.
266
+ */ ignoreHiddenFiles: true,
267
+ /**
268
+ * The default implementation of `accept` checks the file's mime type or
269
+ * extension against this list. This is a comma separated list of mime
270
+ * types or file extensions.
271
+ *
272
+ * Eg.: `image/*,application/pdf,.psd`
273
+ *
274
+ * If the Dropzone is `clickable` this option will also be used as
275
+ * [`accept`](https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept)
276
+ * parameter on the hidden file input as well.
277
+ */ acceptedFiles: null,
278
+ /**
279
+ * **Deprecated!**
280
+ * Use acceptedFiles instead.
281
+ */ acceptedMimeTypes: null,
282
+ /**
283
+ * If false, files will be added to the queue but the queue will not be
284
+ * processed automatically.
285
+ * This can be useful if you need some additional user input before sending
286
+ * files (or if you want want all files sent at once).
287
+ * If you're ready to send the file simply call `myDropzone.processQueue()`.
288
+ *
289
+ * See the [enqueuing file uploads](#enqueuing-file-uploads) documentation
290
+ * section for more information.
291
+ */ autoProcessQueue: true,
292
+ /**
293
+ * If false, files added to the dropzone will not be queued by default.
294
+ * You'll have to call `enqueueFile(file)` manually.
295
+ */ autoQueue: true,
296
+ /**
297
+ * If `true`, this will add a link to every file preview to remove or cancel (if
298
+ * already uploading) the file. The `dictCancelUpload`, `dictCancelUploadConfirmation`
299
+ * and `dictRemoveFile` options are used for the wording.
300
+ */ addRemoveLinks: false,
301
+ /**
302
+ * Defines where to display the file previews – if `null` the
303
+ * Dropzone element itself is used. Can be a plain `HTMLElement` or a CSS
304
+ * selector. The element should have the `dropzone-previews` class so
305
+ * the previews are displayed properly.
306
+ */ previewsContainer: null,
307
+ /**
308
+ * Set this to `true` if you don't want previews to be shown.
309
+ */ disablePreviews: false,
310
+ /**
311
+ * This is the element the hidden input field (which is used when clicking on the
312
+ * dropzone to trigger file selection) will be appended to. This might
313
+ * be important in case you use frameworks to switch the content of your page.
314
+ *
315
+ * Can be a selector string, or an element directly.
316
+ */ hiddenInputContainer: "body",
317
+ /**
318
+ * If null, no capture type will be specified
319
+ * If camera, mobile devices will skip the file selection and choose camera
320
+ * If microphone, mobile devices will skip the file selection and choose the microphone
321
+ * If camcorder, mobile devices will skip the file selection and choose the camera in video mode
322
+ * On apple devices multiple must be set to false. AcceptedFiles may need to
323
+ * be set to an appropriate mime type (e.g. "image/*", "audio/*", or "video/*").
324
+ */ capture: null,
325
+ /**
326
+ * **Deprecated**. Use `renameFile` instead.
327
+ */ renameFilename: null,
328
+ /**
329
+ * A function that is invoked before the file is uploaded to the server and renames the file.
330
+ * This function gets the `File` as argument and can use the `file.name`. The actual name of the
331
+ * file that gets used during the upload can be accessed through `file.upload.filename`.
332
+ */ renameFile: null,
333
+ /**
334
+ * If `true` the fallback will be forced. This is very useful to test your server
335
+ * implementations first and make sure that everything works as
336
+ * expected without dropzone if you experience problems, and to test
337
+ * how your fallbacks will look.
338
+ */ forceFallback: false,
339
+ /**
340
+ * The text used before any files are dropped.
341
+ */ dictDefaultMessage: "Drop files here to upload",
342
+ /**
343
+ * The text that replaces the default message text it the browser is not supported.
344
+ */ dictFallbackMessage: "Your browser does not support drag'n'drop file uploads.",
345
+ /**
346
+ * The text that will be added before the fallback form.
347
+ * If you provide a fallback element yourself, or if this option is `null` this will
348
+ * be ignored.
349
+ */ dictFallbackText: "Please use the fallback form below to upload your files like in the olden days.",
350
+ /**
351
+ * If the filesize is too big.
352
+ * `{{filesize}}` and `{{maxFilesize}}` will be replaced with the respective configuration values.
353
+ */ dictFileTooBig: "File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",
354
+ /**
355
+ * If the file doesn't match the file type.
356
+ */ dictInvalidFileType: "You can't upload files of this type.",
357
+ /**
358
+ * If the server response was invalid.
359
+ * `{{statusCode}}` will be replaced with the servers status code.
360
+ */ dictResponseError: "Server responded with {{statusCode}} code.",
361
+ /**
362
+ * If `addRemoveLinks` is true, the text to be used for the cancel upload link.
363
+ */ dictCancelUpload: "Cancel upload",
364
+ /**
365
+ * The text that is displayed if an upload was manually canceled
366
+ */ dictUploadCanceled: "Upload canceled.",
367
+ /**
368
+ * If `addRemoveLinks` is true, the text to be used for confirmation when cancelling upload.
369
+ */ dictCancelUploadConfirmation: "Are you sure you want to cancel this upload?",
370
+ /**
371
+ * If `addRemoveLinks` is true, the text to be used to remove a file.
372
+ */ dictRemoveFile: "Remove file",
373
+ /**
374
+ * If this is not null, then the user will be prompted before removing a file.
375
+ */ dictRemoveFileConfirmation: null,
376
+ /**
377
+ * Displayed if `maxFiles` is st and exceeded.
378
+ * The string `{{maxFiles}}` will be replaced by the configuration value.
379
+ */ dictMaxFilesExceeded: "You can not upload any more files.",
380
+ /**
381
+ * Allows you to translate the different units. Starting with `tb` for terabytes and going down to
382
+ * `b` for bytes.
383
+ */ dictFileSizeUnits: {
384
+ tb: "TB",
385
+ gb: "GB",
386
+ mb: "MB",
387
+ kb: "KB",
388
+ b: "b"
389
+ },
390
+ /**
391
+ * Called when dropzone initialized
392
+ * You can add event listeners here
393
+ */ init: function() {
394
+ },
395
+ /**
396
+ * Can be an **object** of additional parameters to transfer to the server, **or** a `Function`
397
+ * that gets invoked with the `files`, `xhr` and, if it's a chunked upload, `chunk` arguments. In case
398
+ * of a function, this needs to return a map.
399
+ *
400
+ * The default implementation does nothing for normal uploads, but adds relevant information for
401
+ * chunked uploads.
402
+ *
403
+ * This is the same as adding hidden input fields in the form element.
404
+ */ params: function(files, xhr, chunk) {
405
+ if (chunk) return {
406
+ dzuuid: chunk.file.upload.uuid,
407
+ dzchunkindex: chunk.index,
408
+ dztotalfilesize: chunk.file.size,
409
+ dzchunksize: this.options.chunkSize,
410
+ dztotalchunkcount: chunk.file.upload.totalChunkCount,
411
+ dzchunkbyteoffset: chunk.index * this.options.chunkSize
412
+ };
413
+ },
414
+ /**
415
+ * A function that gets a [file](https://developer.mozilla.org/en-US/docs/DOM/File)
416
+ * and a `done` function as parameters.
417
+ *
418
+ * If the done function is invoked without arguments, the file is "accepted" and will
419
+ * be processed. If you pass an error message, the file is rejected, and the error
420
+ * message will be displayed.
421
+ * This function will not be called if the file is too big or doesn't match the mime types.
422
+ */ accept: function(file, done) {
423
+ return done();
424
+ },
425
+ /**
426
+ * The callback that will be invoked when all chunks have been uploaded for a file.
427
+ * It gets the file for which the chunks have been uploaded as the first parameter,
428
+ * and the `done` function as second. `done()` needs to be invoked when everything
429
+ * needed to finish the upload process is done.
430
+ */ chunksUploaded: function chunksUploaded(file, done) {
431
+ done();
432
+ },
433
+ /**
434
+ * Sends the file as binary blob in body instead of form data.
435
+ * If this is set, the `params` option will be ignored.
436
+ * It's an error to set this to `true` along with `uploadMultiple` since
437
+ * multiple files cannot be in a single binary body.
438
+ */ binaryBody: false,
439
+ /**
440
+ * Gets called when the browser is not supported.
441
+ * The default implementation shows the fallback input field and adds
442
+ * a text.
443
+ */ fallback: function() {
444
+ // This code should pass in IE7... :(
445
+ var messageElement;
446
+ this.element.className = "".concat(this.element.className, " dz-browser-not-supported");
447
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
448
+ try {
449
+ for(var _iterator = this.element.getElementsByTagName("div")[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
450
+ var child = _step.value;
451
+ if (/(^| )dz-message($| )/.test(child.className)) {
452
+ messageElement = child;
453
+ child.className = "dz-message"; // Removes the 'dz-default' class
454
+ break;
455
+ }
456
+ }
457
+ } catch (err) {
458
+ _didIteratorError = true;
459
+ _iteratorError = err;
460
+ } finally{
461
+ try {
462
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
463
+ _iterator.return();
464
+ }
465
+ } finally{
466
+ if (_didIteratorError) {
467
+ throw _iteratorError;
468
+ }
469
+ }
470
+ }
471
+ if (!messageElement) {
472
+ messageElement = $a601ff30f483e917$export$2e2bcd8739ae039.createElement('<div class="dz-message"><span></span></div>');
473
+ this.element.appendChild(messageElement);
474
+ }
475
+ var span = messageElement.getElementsByTagName("span")[0];
476
+ if (span) {
477
+ if (span.textContent != null) span.textContent = this.options.dictFallbackMessage;
478
+ else if (span.innerText != null) span.innerText = this.options.dictFallbackMessage;
479
+ }
480
+ return this.element.appendChild(this.getFallbackForm());
481
+ },
482
+ /**
483
+ * Gets called to calculate the thumbnail dimensions.
484
+ *
485
+ * It gets `file`, `width` and `height` (both may be `null`) as parameters and must return an object containing:
486
+ *
487
+ * - `srcWidth` & `srcHeight` (required)
488
+ * - `trgWidth` & `trgHeight` (required)
489
+ * - `srcX` & `srcY` (optional, default `0`)
490
+ * - `trgX` & `trgY` (optional, default `0`)
491
+ *
492
+ * Those values are going to be used by `ctx.drawImage()`.
493
+ */ resize: function(file, width, height, resizeMethod) {
494
+ var info = {
495
+ srcX: 0,
496
+ srcY: 0,
497
+ srcWidth: file.width,
498
+ srcHeight: file.height
499
+ };
500
+ var srcRatio = file.width / file.height;
501
+ // Automatically calculate dimensions if not specified
502
+ if (width == null && height == null) {
503
+ width = info.srcWidth;
504
+ height = info.srcHeight;
505
+ } else if (width == null) width = height * srcRatio;
506
+ else if (height == null) height = width / srcRatio;
507
+ // Make sure images aren't upscaled
508
+ width = Math.min(width, info.srcWidth);
509
+ height = Math.min(height, info.srcHeight);
510
+ var trgRatio = width / height;
511
+ if (info.srcWidth > width || info.srcHeight > height) {
512
+ // Image is bigger and needs rescaling
513
+ if (resizeMethod === "crop") {
514
+ if (srcRatio > trgRatio) {
515
+ info.srcHeight = file.height;
516
+ info.srcWidth = info.srcHeight * trgRatio;
517
+ } else {
518
+ info.srcWidth = file.width;
519
+ info.srcHeight = info.srcWidth / trgRatio;
520
+ }
521
+ } else if (resizeMethod === "contain") {
522
+ // Method 'contain'
523
+ if (srcRatio > trgRatio) height = width / srcRatio;
524
+ else width = height * srcRatio;
525
+ } else throw new Error("Unknown resizeMethod '".concat(resizeMethod, "'"));
526
+ }
527
+ info.srcX = (file.width - info.srcWidth) / 2;
528
+ info.srcY = (file.height - info.srcHeight) / 2;
529
+ info.trgWidth = width;
530
+ info.trgHeight = height;
531
+ return info;
532
+ },
533
+ /**
534
+ * Can be used to transform the file (for example, resize an image if necessary).
535
+ *
536
+ * The default implementation uses `resizeWidth` and `resizeHeight` (if provided) and resizes
537
+ * images according to those dimensions.
538
+ *
539
+ * Gets the `file` as the first parameter, and a `done()` function as the second, that needs
540
+ * to be invoked with the file when the transformation is done.
541
+ */ transformFile: function(file, done) {
542
+ if ((this.options.resizeWidth || this.options.resizeHeight) && file.type.match(/image.*/)) return this.resizeImage(file, this.options.resizeWidth, this.options.resizeHeight, this.options.resizeMethod, done);
543
+ else return done(file);
544
+ },
545
+ /**
546
+ * A string that contains the template used for each dropped
547
+ * file. Change it to fulfill your needs but make sure to properly
548
+ * provide all elements.
549
+ *
550
+ * If you want to use an actual HTML element instead of providing a String
551
+ * as a config option, you could create a div with the id `tpl`,
552
+ * put the template inside it and provide the element like this:
553
+ *
554
+ * document
555
+ * .querySelector('#tpl')
556
+ * .innerHTML
557
+ *
558
+ */ previewTemplate: (/*@__PURE__*/$parcel$interopDefault($69c61888cc1f4c57$exports)),
559
+ /*
560
+ Those functions register themselves to the events on init and handle all
561
+ the user interface specific stuff. Overwriting them won't break the upload
562
+ but can break the way it's displayed.
563
+ You can overwrite them if you don't like the default behavior. If you just
564
+ want to add an additional event handler, register it on the dropzone object
565
+ and don't overwrite those options.
566
+ */ // Those are self explanatory and simply concern the DragnDrop.
567
+ drop: function(e) {
568
+ return this.element.classList.remove("dz-drag-hover");
569
+ },
570
+ dragstart: function(e) {
571
+ },
572
+ dragend: function(e) {
573
+ return this.element.classList.remove("dz-drag-hover");
574
+ },
575
+ dragenter: function(e) {
576
+ return this.element.classList.add("dz-drag-hover");
577
+ },
578
+ dragover: function(e) {
579
+ return this.element.classList.add("dz-drag-hover");
580
+ },
581
+ dragleave: function(e) {
582
+ return this.element.classList.remove("dz-drag-hover");
583
+ },
584
+ paste: function(e) {
585
+ },
586
+ // Called whenever there are no files left in the dropzone anymore, and the
587
+ // dropzone should be displayed as if in the initial state.
588
+ reset: function() {
589
+ return this.element.classList.remove("dz-started");
590
+ },
591
+ // Called when a file is added to the queue
592
+ // Receives `file`
593
+ addedfile: function(file) {
594
+ if (this.element === this.previewsContainer) this.element.classList.add("dz-started");
595
+ if (this.previewsContainer && !this.options.disablePreviews) {
596
+ var _this = this;
597
+ file.previewElement = $a601ff30f483e917$export$2e2bcd8739ae039.createElement(this.options.previewTemplate.trim());
598
+ file.previewTemplate = file.previewElement; // Backwards compatibility
599
+ this.previewsContainer.appendChild(file.previewElement);
600
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
601
+ try {
602
+ for(var _iterator = file.previewElement.querySelectorAll("[data-dz-name]")[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
603
+ var node = _step.value;
604
+ node.textContent = file.name;
605
+ }
606
+ } catch (err) {
607
+ _didIteratorError = true;
608
+ _iteratorError = err;
609
+ } finally{
610
+ try {
611
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
612
+ _iterator.return();
613
+ }
614
+ } finally{
615
+ if (_didIteratorError) {
616
+ throw _iteratorError;
617
+ }
618
+ }
619
+ }
620
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
621
+ try {
622
+ for(var _iterator1 = file.previewElement.querySelectorAll("[data-dz-size]")[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
623
+ node = _step1.value;
624
+ node.innerHTML = this.filesize(file.size);
625
+ }
626
+ } catch (err) {
627
+ _didIteratorError1 = true;
628
+ _iteratorError1 = err;
629
+ } finally{
630
+ try {
631
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
632
+ _iterator1.return();
633
+ }
634
+ } finally{
635
+ if (_didIteratorError1) {
636
+ throw _iteratorError1;
637
+ }
638
+ }
639
+ }
640
+ if (this.options.addRemoveLinks) {
641
+ file._removeLink = $a601ff30f483e917$export$2e2bcd8739ae039.createElement("<a class=\"dz-remove\" href=\"javascript:undefined;\" data-dz-remove>".concat(this.options.dictRemoveFile, "</a>"));
642
+ file.previewElement.appendChild(file._removeLink);
643
+ }
644
+ var removeFileEvent = function(e) {
645
+ var _this1 = _this;
646
+ e.preventDefault();
647
+ e.stopPropagation();
648
+ if (file.status === $a601ff30f483e917$export$2e2bcd8739ae039.UPLOADING) return $a601ff30f483e917$export$2e2bcd8739ae039.confirm(_this.options.dictCancelUploadConfirmation, function() {
649
+ return _this1.removeFile(file);
650
+ });
651
+ else {
652
+ var _this2 = _this;
653
+ if (_this.options.dictRemoveFileConfirmation) return $a601ff30f483e917$export$2e2bcd8739ae039.confirm(_this.options.dictRemoveFileConfirmation, function() {
654
+ return _this2.removeFile(file);
655
+ });
656
+ else return _this.removeFile(file);
657
+ }
658
+ };
659
+ var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = undefined;
660
+ try {
661
+ for(var _iterator2 = file.previewElement.querySelectorAll("[data-dz-remove]")[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true){
662
+ var removeLink = _step2.value;
663
+ removeLink.addEventListener("click", removeFileEvent);
664
+ }
665
+ } catch (err) {
666
+ _didIteratorError2 = true;
667
+ _iteratorError2 = err;
668
+ } finally{
669
+ try {
670
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
671
+ _iterator2.return();
672
+ }
673
+ } finally{
674
+ if (_didIteratorError2) {
675
+ throw _iteratorError2;
676
+ }
677
+ }
678
+ }
679
+ }
680
+ },
681
+ // Called whenever a file is removed.
682
+ removedfile: function(file) {
683
+ if (file.previewElement != null && file.previewElement.parentNode != null) file.previewElement.parentNode.removeChild(file.previewElement);
684
+ return this._updateMaxFilesReachedClass();
685
+ },
686
+ // Called when a thumbnail has been generated
687
+ // Receives `file` and `dataUrl`
688
+ thumbnail: function(file, dataUrl) {
689
+ if (file.previewElement) {
690
+ file.previewElement.classList.remove("dz-file-preview");
691
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
692
+ try {
693
+ for(var _iterator = file.previewElement.querySelectorAll("[data-dz-thumbnail]")[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
694
+ var thumbnailElement = _step.value;
695
+ thumbnailElement.alt = file.name;
696
+ thumbnailElement.src = dataUrl;
697
+ }
698
+ } catch (err) {
699
+ _didIteratorError = true;
700
+ _iteratorError = err;
701
+ } finally{
702
+ try {
703
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
704
+ _iterator.return();
705
+ }
706
+ } finally{
707
+ if (_didIteratorError) {
708
+ throw _iteratorError;
709
+ }
710
+ }
711
+ }
712
+ return setTimeout(function() {
713
+ return file.previewElement.classList.add("dz-image-preview");
714
+ }, 1);
715
+ }
716
+ },
717
+ // Called whenever an error occurs
718
+ // Receives `file` and `message`
719
+ error: function(file, message) {
720
+ if (file.previewElement) {
721
+ file.previewElement.classList.add("dz-error");
722
+ if (typeof message !== "string" && message.error) message = message.error;
723
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
724
+ try {
725
+ for(var _iterator = file.previewElement.querySelectorAll("[data-dz-errormessage]")[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
726
+ var node = _step.value;
727
+ node.textContent = message;
728
+ }
729
+ } catch (err) {
730
+ _didIteratorError = true;
731
+ _iteratorError = err;
732
+ } finally{
733
+ try {
734
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
735
+ _iterator.return();
736
+ }
737
+ } finally{
738
+ if (_didIteratorError) {
739
+ throw _iteratorError;
740
+ }
741
+ }
742
+ }
743
+ }
744
+ },
745
+ errormultiple: function() {
746
+ },
747
+ // Called when a file gets processed. Since there is a cue, not all added
748
+ // files are processed immediately.
749
+ // Receives `file`
750
+ processing: function(file) {
751
+ if (file.previewElement) {
752
+ file.previewElement.classList.add("dz-processing");
753
+ if (file._removeLink) return file._removeLink.innerHTML = this.options.dictCancelUpload;
754
+ }
755
+ },
756
+ processingmultiple: function() {
757
+ },
758
+ // Called whenever the upload progress gets updated.
759
+ // Receives `file`, `progress` (percentage 0-100) and `bytesSent`.
760
+ // To get the total number of bytes of the file, use `file.size`
761
+ uploadprogress: function(file, progress, bytesSent) {
762
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
763
+ if (file.previewElement) try {
764
+ for(var _iterator = file.previewElement.querySelectorAll("[data-dz-uploadprogress]")[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
765
+ var node = _step.value;
766
+ node.nodeName === "PROGRESS" ? node.value = progress : node.style.width = "".concat(progress, "%");
767
+ }
768
+ } catch (err) {
769
+ _didIteratorError = true;
770
+ _iteratorError = err;
771
+ } finally{
772
+ try {
773
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
774
+ _iterator.return();
775
+ }
776
+ } finally{
777
+ if (_didIteratorError) {
778
+ throw _iteratorError;
779
+ }
780
+ }
781
+ }
782
+ },
783
+ // Called whenever the total upload progress gets updated.
784
+ // Called with totalUploadProgress (0-100), totalBytes and totalBytesSent
785
+ totaluploadprogress: function() {
786
+ },
787
+ // Called just before the file is sent. Gets the `xhr` object as second
788
+ // parameter, so you can modify it (for example to add a CSRF token) and a
789
+ // `formData` object to add additional information.
790
+ sending: function() {
791
+ },
792
+ sendingmultiple: function() {
793
+ },
794
+ // When the complete upload is finished and successful
795
+ // Receives `file`
796
+ success: function(file) {
797
+ if (file.previewElement) return file.previewElement.classList.add("dz-success");
798
+ },
799
+ successmultiple: function() {
800
+ },
801
+ // When the upload is canceled.
802
+ canceled: function(file) {
803
+ return this.emit("error", file, this.options.dictUploadCanceled);
804
+ },
805
+ canceledmultiple: function() {
806
+ },
807
+ // When the upload is finished, either with success or an error.
808
+ // Receives `file`
809
+ complete: function(file) {
810
+ if (file._removeLink) file._removeLink.innerHTML = this.options.dictRemoveFile;
811
+ if (file.previewElement) return file.previewElement.classList.add("dz-complete");
812
+ },
813
+ completemultiple: function() {
814
+ },
815
+ maxfilesexceeded: function() {
816
+ },
817
+ maxfilesreached: function() {
818
+ },
819
+ queuecomplete: function() {
820
+ },
821
+ addedfiles: function() {
822
+ }
823
+ };
824
+ var $b657c03155fc27e2$export$2e2bcd8739ae039 = $b657c03155fc27e2$var$defaultOptions;
825
+
826
+
827
+ var $a601ff30f483e917$export$2e2bcd8739ae039 = /*#__PURE__*/ function(Emitter) {
828
+ "use strict";
829
+ $6mU8w$swchelpers.inherits($a601ff30f483e917$export$2e2bcd8739ae039, Emitter);
830
+ function $a601ff30f483e917$export$2e2bcd8739ae039(el, options) {
831
+ $6mU8w$swchelpers.classCallCheck(this, $a601ff30f483e917$export$2e2bcd8739ae039);
832
+ var _this;
833
+ _this = $6mU8w$swchelpers.possibleConstructorReturn(this, $6mU8w$swchelpers.getPrototypeOf($a601ff30f483e917$export$2e2bcd8739ae039).call(this));
834
+ var fallback, left;
835
+ _this.element = el;
836
+ _this.clickableElements = [];
837
+ _this.listeners = [];
838
+ _this.files = []; // All files
839
+ if (typeof _this.element === "string") _this.element = document.querySelector(_this.element);
840
+ // Not checking if instance of HTMLElement or Element since IE9 is extremely weird.
841
+ if (!_this.element || _this.element.nodeType == null) throw new Error("Invalid dropzone element.");
842
+ if (_this.element.dropzone) throw new Error("Dropzone already attached.");
843
+ // Now add this dropzone to the instances.
844
+ $a601ff30f483e917$export$2e2bcd8739ae039.instances.push($6mU8w$swchelpers.assertThisInitialized(_this));
845
+ // Put the dropzone inside the element itself.
846
+ _this.element.dropzone = $6mU8w$swchelpers.assertThisInitialized(_this);
847
+ var elementOptions = (left = $a601ff30f483e917$export$2e2bcd8739ae039.optionsForElement(_this.element)) != null ? left : {
848
+ };
849
+ _this.options = $parcel$interopDefault($6mU8w$justextend)(true, {
850
+ }, $b657c03155fc27e2$export$2e2bcd8739ae039, elementOptions, options != null ? options : {
851
+ });
852
+ _this.options.previewTemplate = _this.options.previewTemplate.replace(/\n*/g, "");
853
+ // If the browser failed, just call the fallback and leave
854
+ if (_this.options.forceFallback || !$a601ff30f483e917$export$2e2bcd8739ae039.isBrowserSupported()) return $6mU8w$swchelpers.possibleConstructorReturn(_this, _this.options.fallback.call($6mU8w$swchelpers.assertThisInitialized(_this)));
855
+ // @options.url = @element.getAttribute "action" unless @options.url?
856
+ if (_this.options.url == null) _this.options.url = _this.element.getAttribute("action");
857
+ if (!_this.options.url) throw new Error("No URL provided.");
858
+ if (_this.options.acceptedFiles && _this.options.acceptedMimeTypes) throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");
859
+ if (_this.options.uploadMultiple && _this.options.chunking) throw new Error("You cannot set both: uploadMultiple and chunking.");
860
+ if (_this.options.binaryBody && _this.options.uploadMultiple) throw new Error("You cannot set both: binaryBody and uploadMultiple.");
861
+ // Backwards compatibility
862
+ if (_this.options.acceptedMimeTypes) {
863
+ _this.options.acceptedFiles = _this.options.acceptedMimeTypes;
864
+ delete _this.options.acceptedMimeTypes;
865
+ }
866
+ // Backwards compatibility
867
+ if (_this.options.renameFilename != null) _this.options.renameFile = function(file) {
868
+ return _this.options.renameFilename.call($6mU8w$swchelpers.assertThisInitialized(_this), file.name, file);
869
+ };
870
+ if (typeof _this.options.method === "string") _this.options.method = _this.options.method.toUpperCase();
871
+ if ((fallback = _this.getExistingFallback()) && fallback.parentNode) // Remove the fallback
872
+ fallback.parentNode.removeChild(fallback);
873
+ // Display previews in the previewsContainer element or the Dropzone element unless explicitly set to false
874
+ if (_this.options.previewsContainer !== false) {
875
+ if (_this.options.previewsContainer) _this.previewsContainer = $a601ff30f483e917$export$2e2bcd8739ae039.getElement(_this.options.previewsContainer, "previewsContainer");
876
+ else _this.previewsContainer = _this.element;
877
+ }
878
+ if (_this.options.clickable) {
879
+ if (_this.options.clickable === true) _this.clickableElements = [
880
+ _this.element
881
+ ];
882
+ else _this.clickableElements = $a601ff30f483e917$export$2e2bcd8739ae039.getElements(_this.options.clickable, "clickable");
883
+ }
884
+ _this.init();
885
+ return _this;
886
+ }
887
+ $6mU8w$swchelpers.createClass($a601ff30f483e917$export$2e2bcd8739ae039, [
888
+ {
889
+ // Returns all files that have been accepted
890
+ key: "getAcceptedFiles",
891
+ value: function getAcceptedFiles() {
892
+ return this.files.filter(function(file) {
893
+ return file.accepted;
894
+ }).map(function(file) {
895
+ return file;
896
+ });
897
+ }
898
+ },
899
+ {
900
+ // Returns all files that have been rejected
901
+ // Not sure when that's going to be useful, but added for completeness.
902
+ key: "getRejectedFiles",
903
+ value: function getRejectedFiles() {
904
+ return this.files.filter(function(file) {
905
+ return !file.accepted;
906
+ }).map(function(file) {
907
+ return file;
908
+ });
909
+ }
910
+ },
911
+ {
912
+ key: "getFilesWithStatus",
913
+ value: function getFilesWithStatus(status) {
914
+ return this.files.filter(function(file) {
915
+ return file.status === status;
916
+ }).map(function(file) {
917
+ return file;
918
+ });
919
+ }
920
+ },
921
+ {
922
+ // Returns all files that are in the queue
923
+ key: "getQueuedFiles",
924
+ value: function getQueuedFiles() {
925
+ return this.getFilesWithStatus($a601ff30f483e917$export$2e2bcd8739ae039.QUEUED);
926
+ }
927
+ },
928
+ {
929
+ key: "getUploadingFiles",
930
+ value: function getUploadingFiles() {
931
+ return this.getFilesWithStatus($a601ff30f483e917$export$2e2bcd8739ae039.UPLOADING);
932
+ }
933
+ },
934
+ {
935
+ key: "getAddedFiles",
936
+ value: function getAddedFiles() {
937
+ return this.getFilesWithStatus($a601ff30f483e917$export$2e2bcd8739ae039.ADDED);
938
+ }
939
+ },
940
+ {
941
+ // Files that are either queued or uploading
942
+ key: "getActiveFiles",
943
+ value: function getActiveFiles() {
944
+ return this.files.filter(function(file) {
945
+ return file.status === $a601ff30f483e917$export$2e2bcd8739ae039.UPLOADING || file.status === $a601ff30f483e917$export$2e2bcd8739ae039.QUEUED;
946
+ }).map(function(file) {
947
+ return file;
948
+ });
949
+ }
950
+ },
951
+ {
952
+ // The function that gets called when Dropzone is initialized. You
953
+ // can (and should) setup event listeners inside this function.
954
+ key: "init",
955
+ value: function init() {
956
+ var _this12 = this, _this1 = this, _this2 = this, _this3 = this, _this4 = this, _this5 = this, _this6 = this, _this7 = this, _this8 = this, _this9 = this, _this10 = this;
957
+ // In case it isn't set already
958
+ if (this.element.tagName === "form") this.element.setAttribute("enctype", "multipart/form-data");
959
+ if (this.element.classList.contains("dropzone") && !this.element.querySelector(".dz-message")) this.element.appendChild($a601ff30f483e917$export$2e2bcd8739ae039.createElement("<div class=\"dz-default dz-message\"><button class=\"dz-button\" type=\"button\">".concat(this.options.dictDefaultMessage, "</button></div>")));
960
+ if (this.clickableElements.length) {
961
+ var _this = this;
962
+ var setupHiddenFileInput = function() {
963
+ var _this11 = _this;
964
+ if (_this.hiddenFileInput) _this.hiddenFileInput.parentNode.removeChild(_this.hiddenFileInput);
965
+ _this.hiddenFileInput = document.createElement("input");
966
+ _this.hiddenFileInput.setAttribute("type", "file");
967
+ if (_this.options.maxFiles === null || _this.options.maxFiles > 1) _this.hiddenFileInput.setAttribute("multiple", "multiple");
968
+ _this.hiddenFileInput.className = "dz-hidden-input";
969
+ if (_this.options.acceptedFiles !== null) _this.hiddenFileInput.setAttribute("accept", _this.options.acceptedFiles);
970
+ if (_this.options.capture !== null) _this.hiddenFileInput.setAttribute("capture", _this.options.capture);
971
+ // Making sure that no one can "tab" into this field.
972
+ _this.hiddenFileInput.setAttribute("tabindex", "-1");
973
+ // Not setting `display="none"` because some browsers don't accept clicks
974
+ // on elements that aren't displayed.
975
+ _this.hiddenFileInput.style.visibility = "hidden";
976
+ _this.hiddenFileInput.style.position = "absolute";
977
+ _this.hiddenFileInput.style.top = "0";
978
+ _this.hiddenFileInput.style.left = "0";
979
+ _this.hiddenFileInput.style.height = "0";
980
+ _this.hiddenFileInput.style.width = "0";
981
+ $a601ff30f483e917$export$2e2bcd8739ae039.getElement(_this.options.hiddenInputContainer, "hiddenInputContainer").appendChild(_this.hiddenFileInput);
982
+ _this.hiddenFileInput.addEventListener("change", function() {
983
+ var _hiddenFileInput = _this11.hiddenFileInput, files = _hiddenFileInput.files;
984
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
985
+ if (files.length) try {
986
+ for(var _iterator = files[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
987
+ var file = _step.value;
988
+ _this11.addFile(file);
989
+ }
990
+ } catch (err) {
991
+ _didIteratorError = true;
992
+ _iteratorError = err;
993
+ } finally{
994
+ try {
995
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
996
+ _iterator.return();
997
+ }
998
+ } finally{
999
+ if (_didIteratorError) {
1000
+ throw _iteratorError;
1001
+ }
1002
+ }
1003
+ }
1004
+ _this11.emit("addedfiles", files);
1005
+ setupHiddenFileInput();
1006
+ });
1007
+ };
1008
+ setupHiddenFileInput();
1009
+ }
1010
+ this.URL = window.URL !== null ? window.URL : window.webkitURL;
1011
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1012
+ try {
1013
+ // Setup all event listeners on the Dropzone object itself.
1014
+ // They're not in @setupEventListeners() because they shouldn't be removed
1015
+ // again when the dropzone gets disabled.
1016
+ for(var _iterator = this.events[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1017
+ var eventName = _step.value;
1018
+ this.on(eventName, this.options[eventName]);
1019
+ }
1020
+ } catch (err) {
1021
+ _didIteratorError = true;
1022
+ _iteratorError = err;
1023
+ } finally{
1024
+ try {
1025
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1026
+ _iterator.return();
1027
+ }
1028
+ } finally{
1029
+ if (_didIteratorError) {
1030
+ throw _iteratorError;
1031
+ }
1032
+ }
1033
+ }
1034
+ this.on("uploadprogress", function() {
1035
+ return _this12.updateTotalUploadProgress();
1036
+ });
1037
+ this.on("removedfile", function() {
1038
+ return _this1.updateTotalUploadProgress();
1039
+ });
1040
+ this.on("canceled", function(file) {
1041
+ return _this2.emit("complete", file);
1042
+ });
1043
+ // Emit a `queuecomplete` event if all files finished uploading.
1044
+ this.on("complete", function(file) {
1045
+ var _this11 = _this3;
1046
+ if (_this3.getAddedFiles().length === 0 && _this3.getUploadingFiles().length === 0 && _this3.getQueuedFiles().length === 0) // This needs to be deferred so that `queuecomplete` really triggers after `complete`
1047
+ return setTimeout(function() {
1048
+ return _this11.emit("queuecomplete");
1049
+ }, 0);
1050
+ });
1051
+ var containsFiles = function containsFiles(e) {
1052
+ if (e.dataTransfer.types) // Because e.dataTransfer.types is an Object in
1053
+ // IE, we need to iterate like this instead of
1054
+ // using e.dataTransfer.types.some()
1055
+ for(var i = 0; i < e.dataTransfer.types.length; i++){
1056
+ if (e.dataTransfer.types[i] === "Files") return true;
1057
+ }
1058
+ return false;
1059
+ };
1060
+ var noPropagation = function noPropagation(e) {
1061
+ // If there are no files, we don't want to stop
1062
+ // propagation so we don't interfere with other
1063
+ // drag and drop behaviour.
1064
+ if (!containsFiles(e)) return;
1065
+ e.stopPropagation();
1066
+ if (e.preventDefault) return e.preventDefault();
1067
+ else return e.returnValue = false;
1068
+ };
1069
+ // Create the listeners
1070
+ this.listeners = [
1071
+ {
1072
+ element: this.element,
1073
+ events: {
1074
+ dragstart: function(e) {
1075
+ return _this4.emit("dragstart", e);
1076
+ },
1077
+ dragenter: function(e) {
1078
+ noPropagation(e);
1079
+ return _this5.emit("dragenter", e);
1080
+ },
1081
+ dragover: function(e) {
1082
+ // Makes it possible to drag files from chrome's download bar
1083
+ // http://stackoverflow.com/questions/19526430/drag-and-drop-file-uploads-from-chrome-downloads-bar
1084
+ // Try is required to prevent bug in Internet Explorer 11 (SCRIPT65535 exception)
1085
+ var efct;
1086
+ try {
1087
+ efct = e.dataTransfer.effectAllowed;
1088
+ } catch (error) {
1089
+ }
1090
+ e.dataTransfer.dropEffect = "move" === efct || "linkMove" === efct ? "move" : "copy";
1091
+ noPropagation(e);
1092
+ return _this6.emit("dragover", e);
1093
+ },
1094
+ dragleave: function(e) {
1095
+ return _this7.emit("dragleave", e);
1096
+ },
1097
+ drop: function(e) {
1098
+ noPropagation(e);
1099
+ return _this8.drop(e);
1100
+ },
1101
+ dragend: function(e) {
1102
+ return _this9.emit("dragend", e);
1103
+ }
1104
+ }
1105
+ },
1106
+ ];
1107
+ this.clickableElements.forEach(function(clickableElement) {
1108
+ var _this11 = _this10;
1109
+ return _this10.listeners.push({
1110
+ element: clickableElement,
1111
+ events: {
1112
+ click: function(evt) {
1113
+ // Only the actual dropzone or the message element should trigger file selection
1114
+ if (clickableElement !== _this11.element || evt.target === _this11.element || $a601ff30f483e917$export$2e2bcd8739ae039.elementInside(evt.target, _this11.element.querySelector(".dz-message"))) _this11.hiddenFileInput.click(); // Forward the click
1115
+ return true;
1116
+ }
1117
+ }
1118
+ });
1119
+ });
1120
+ this.enable();
1121
+ return this.options.init.call(this);
1122
+ }
1123
+ },
1124
+ {
1125
+ // Not fully tested yet
1126
+ key: "destroy",
1127
+ value: function destroy() {
1128
+ this.disable();
1129
+ this.removeAllFiles(true);
1130
+ if (this.hiddenFileInput != null ? this.hiddenFileInput.parentNode : undefined) {
1131
+ this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput);
1132
+ this.hiddenFileInput = null;
1133
+ }
1134
+ delete this.element.dropzone;
1135
+ return $a601ff30f483e917$export$2e2bcd8739ae039.instances.splice($a601ff30f483e917$export$2e2bcd8739ae039.instances.indexOf(this), 1);
1136
+ }
1137
+ },
1138
+ {
1139
+ key: "updateTotalUploadProgress",
1140
+ value: function updateTotalUploadProgress() {
1141
+ var totalUploadProgress;
1142
+ var totalBytesSent = 0;
1143
+ var totalBytes = 0;
1144
+ var activeFiles = this.getActiveFiles();
1145
+ if (activeFiles.length) {
1146
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1147
+ try {
1148
+ for(var _iterator = this.getActiveFiles()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1149
+ var file = _step.value;
1150
+ totalBytesSent += file.upload.bytesSent;
1151
+ totalBytes += file.upload.total;
1152
+ }
1153
+ } catch (err) {
1154
+ _didIteratorError = true;
1155
+ _iteratorError = err;
1156
+ } finally{
1157
+ try {
1158
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1159
+ _iterator.return();
1160
+ }
1161
+ } finally{
1162
+ if (_didIteratorError) {
1163
+ throw _iteratorError;
1164
+ }
1165
+ }
1166
+ }
1167
+ totalUploadProgress = 100 * totalBytesSent / totalBytes;
1168
+ } else totalUploadProgress = 100;
1169
+ return this.emit("totaluploadprogress", totalUploadProgress, totalBytes, totalBytesSent);
1170
+ }
1171
+ },
1172
+ {
1173
+ // @options.paramName can be a function taking one parameter rather than a string.
1174
+ // A parameter name for a file is obtained simply by calling this with an index number.
1175
+ key: "_getParamName",
1176
+ value: function _getParamName(n) {
1177
+ if (typeof this.options.paramName === "function") return this.options.paramName(n);
1178
+ else return "".concat(this.options.paramName).concat(this.options.uploadMultiple ? "[".concat(n, "]") : "");
1179
+ }
1180
+ },
1181
+ {
1182
+ // If @options.renameFile is a function,
1183
+ // the function will be used to rename the file.name before appending it to the formData
1184
+ key: "_renameFile",
1185
+ value: function _renameFile(file) {
1186
+ if (typeof this.options.renameFile !== "function") return file.name;
1187
+ return this.options.renameFile(file);
1188
+ }
1189
+ },
1190
+ {
1191
+ // Returns a form that can be used as fallback if the browser does not support DragnDrop
1192
+ //
1193
+ // If the dropzone is already a form, only the input field and button are returned. Otherwise a complete form element is provided.
1194
+ // This code has to pass in IE7 :(
1195
+ key: "getFallbackForm",
1196
+ value: function getFallbackForm() {
1197
+ var existingFallback, form;
1198
+ if (existingFallback = this.getExistingFallback()) return existingFallback;
1199
+ var fieldsString = '<div class="dz-fallback">';
1200
+ if (this.options.dictFallbackText) fieldsString += "<p>".concat(this.options.dictFallbackText, "</p>");
1201
+ fieldsString += "<input type=\"file\" name=\"".concat(this._getParamName(0), "\" ").concat(this.options.uploadMultiple ? 'multiple="multiple"' : undefined, " /><input type=\"submit\" value=\"Upload!\"></div>");
1202
+ var fields = $a601ff30f483e917$export$2e2bcd8739ae039.createElement(fieldsString);
1203
+ if (this.element.tagName !== "FORM") {
1204
+ form = $a601ff30f483e917$export$2e2bcd8739ae039.createElement("<form action=\"".concat(this.options.url, "\" enctype=\"multipart/form-data\" method=\"").concat(this.options.method, "\"></form>"));
1205
+ form.appendChild(fields);
1206
+ } else {
1207
+ // Make sure that the enctype and method attributes are set properly
1208
+ this.element.setAttribute("enctype", "multipart/form-data");
1209
+ this.element.setAttribute("method", this.options.method);
1210
+ }
1211
+ return form != null ? form : fields;
1212
+ }
1213
+ },
1214
+ {
1215
+ // Returns the fallback elements if they exist already
1216
+ //
1217
+ // This code has to pass in IE7 :(
1218
+ key: "getExistingFallback",
1219
+ value: function getExistingFallback() {
1220
+ var getFallback = function getFallback(elements) {
1221
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1222
+ try {
1223
+ for(var _iterator = elements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1224
+ var el = _step.value;
1225
+ if (/(^| )fallback($| )/.test(el.className)) return el;
1226
+ }
1227
+ } catch (err) {
1228
+ _didIteratorError = true;
1229
+ _iteratorError = err;
1230
+ } finally{
1231
+ try {
1232
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1233
+ _iterator.return();
1234
+ }
1235
+ } finally{
1236
+ if (_didIteratorError) {
1237
+ throw _iteratorError;
1238
+ }
1239
+ }
1240
+ }
1241
+ };
1242
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1243
+ try {
1244
+ for(var _iterator = [
1245
+ "div",
1246
+ "form"
1247
+ ][Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1248
+ var tagName = _step.value;
1249
+ var fallback;
1250
+ if (fallback = getFallback(this.element.getElementsByTagName(tagName))) return fallback;
1251
+ }
1252
+ } catch (err) {
1253
+ _didIteratorError = true;
1254
+ _iteratorError = err;
1255
+ } finally{
1256
+ try {
1257
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1258
+ _iterator.return();
1259
+ }
1260
+ } finally{
1261
+ if (_didIteratorError) {
1262
+ throw _iteratorError;
1263
+ }
1264
+ }
1265
+ }
1266
+ }
1267
+ },
1268
+ {
1269
+ // Activates all listeners stored in @listeners
1270
+ key: "setupEventListeners",
1271
+ value: function setupEventListeners() {
1272
+ return this.listeners.map(function(elementListeners) {
1273
+ return (function() {
1274
+ var result = [];
1275
+ for(var event in elementListeners.events){
1276
+ var listener = elementListeners.events[event];
1277
+ result.push(elementListeners.element.addEventListener(event, listener, false));
1278
+ }
1279
+ return result;
1280
+ })();
1281
+ });
1282
+ }
1283
+ },
1284
+ {
1285
+ // Deactivates all listeners stored in @listeners
1286
+ key: "removeEventListeners",
1287
+ value: function removeEventListeners() {
1288
+ return this.listeners.map(function(elementListeners) {
1289
+ return (function() {
1290
+ var result = [];
1291
+ for(var event in elementListeners.events){
1292
+ var listener = elementListeners.events[event];
1293
+ result.push(elementListeners.element.removeEventListener(event, listener, false));
1294
+ }
1295
+ return result;
1296
+ })();
1297
+ });
1298
+ }
1299
+ },
1300
+ {
1301
+ // Removes all event listeners and cancels all files in the queue or being processed.
1302
+ key: "disable",
1303
+ value: function disable() {
1304
+ var _this = this;
1305
+ this.clickableElements.forEach(function(element) {
1306
+ return element.classList.remove("dz-clickable");
1307
+ });
1308
+ this.removeEventListeners();
1309
+ this.disabled = true;
1310
+ return this.files.map(function(file) {
1311
+ return _this.cancelUpload(file);
1312
+ });
1313
+ }
1314
+ },
1315
+ {
1316
+ key: "enable",
1317
+ value: function enable() {
1318
+ delete this.disabled;
1319
+ this.clickableElements.forEach(function(element) {
1320
+ return element.classList.add("dz-clickable");
1321
+ });
1322
+ return this.setupEventListeners();
1323
+ }
1324
+ },
1325
+ {
1326
+ // Returns a nicely formatted filesize
1327
+ key: "filesize",
1328
+ value: function filesize(size) {
1329
+ var selectedSize = 0;
1330
+ var selectedUnit = "b";
1331
+ if (size > 0) {
1332
+ var units = [
1333
+ "tb",
1334
+ "gb",
1335
+ "mb",
1336
+ "kb",
1337
+ "b"
1338
+ ];
1339
+ for(var i = 0; i < units.length; i++){
1340
+ var unit = units[i];
1341
+ var cutoff = Math.pow(this.options.filesizeBase, 4 - i) / 10;
1342
+ if (size >= cutoff) {
1343
+ selectedSize = size / Math.pow(this.options.filesizeBase, 4 - i);
1344
+ selectedUnit = unit;
1345
+ break;
1346
+ }
1347
+ }
1348
+ selectedSize = Math.round(10 * selectedSize) / 10; // Cutting of digits
1349
+ }
1350
+ return "<strong>".concat(selectedSize, "</strong> ").concat(this.options.dictFileSizeUnits[selectedUnit]);
1351
+ }
1352
+ },
1353
+ {
1354
+ // Adds or removes the `dz-max-files-reached` class from the form.
1355
+ key: "_updateMaxFilesReachedClass",
1356
+ value: function _updateMaxFilesReachedClass() {
1357
+ if (this.options.maxFiles != null && this.getAcceptedFiles().length >= this.options.maxFiles) {
1358
+ if (this.getAcceptedFiles().length === this.options.maxFiles) this.emit("maxfilesreached", this.files);
1359
+ return this.element.classList.add("dz-max-files-reached");
1360
+ } else return this.element.classList.remove("dz-max-files-reached");
1361
+ }
1362
+ },
1363
+ {
1364
+ key: "drop",
1365
+ value: function drop(e) {
1366
+ if (!e.dataTransfer) return;
1367
+ this.emit("drop", e);
1368
+ // Convert the FileList to an Array
1369
+ // This is necessary for IE11
1370
+ var files = [];
1371
+ for(var i = 0; i < e.dataTransfer.files.length; i++)files[i] = e.dataTransfer.files[i];
1372
+ // Even if it's a folder, files.length will contain the folders.
1373
+ if (files.length) {
1374
+ var _dataTransfer = e.dataTransfer, items = _dataTransfer.items;
1375
+ if (items && items.length && items[0].webkitGetAsEntry != null) // The browser supports dropping of folders, so handle items instead of files
1376
+ this._addFilesFromItems(items);
1377
+ else this.handleFiles(files);
1378
+ }
1379
+ this.emit("addedfiles", files);
1380
+ }
1381
+ },
1382
+ {
1383
+ key: "paste",
1384
+ value: function paste(e) {
1385
+ if ($a601ff30f483e917$var$__guard__(e != null ? e.clipboardData : undefined, function(x) {
1386
+ return x.items;
1387
+ }) == null) return;
1388
+ this.emit("paste", e);
1389
+ var _clipboardData = e.clipboardData, items = _clipboardData.items;
1390
+ if (items.length) return this._addFilesFromItems(items);
1391
+ }
1392
+ },
1393
+ {
1394
+ key: "handleFiles",
1395
+ value: function handleFiles(files) {
1396
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1397
+ try {
1398
+ for(var _iterator = files[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1399
+ var file = _step.value;
1400
+ this.addFile(file);
1401
+ }
1402
+ } catch (err) {
1403
+ _didIteratorError = true;
1404
+ _iteratorError = err;
1405
+ } finally{
1406
+ try {
1407
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1408
+ _iterator.return();
1409
+ }
1410
+ } finally{
1411
+ if (_didIteratorError) {
1412
+ throw _iteratorError;
1413
+ }
1414
+ }
1415
+ }
1416
+ }
1417
+ },
1418
+ {
1419
+ // When a folder is dropped (or files are pasted), items must be handled
1420
+ // instead of files.
1421
+ key: "_addFilesFromItems",
1422
+ value: function _addFilesFromItems(items) {
1423
+ var _this = this;
1424
+ return (function() {
1425
+ var result = [];
1426
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1427
+ try {
1428
+ for(var _iterator = items[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1429
+ var item = _step.value;
1430
+ var entry;
1431
+ if (item.webkitGetAsEntry != null && (entry = item.webkitGetAsEntry())) {
1432
+ if (entry.isFile) result.push(_this.addFile(item.getAsFile()));
1433
+ else if (entry.isDirectory) // Append all files from that directory to files
1434
+ result.push(_this._addFilesFromDirectory(entry, entry.name));
1435
+ else result.push(undefined);
1436
+ } else if (item.getAsFile != null) {
1437
+ if (item.kind == null || item.kind === "file") result.push(_this.addFile(item.getAsFile()));
1438
+ else result.push(undefined);
1439
+ } else result.push(undefined);
1440
+ }
1441
+ } catch (err) {
1442
+ _didIteratorError = true;
1443
+ _iteratorError = err;
1444
+ } finally{
1445
+ try {
1446
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1447
+ _iterator.return();
1448
+ }
1449
+ } finally{
1450
+ if (_didIteratorError) {
1451
+ throw _iteratorError;
1452
+ }
1453
+ }
1454
+ }
1455
+ return result;
1456
+ })();
1457
+ }
1458
+ },
1459
+ {
1460
+ // Goes through the directory, and adds each file it finds recursively
1461
+ key: "_addFilesFromDirectory",
1462
+ value: function _addFilesFromDirectory(directory, path) {
1463
+ var _this = this;
1464
+ var dirReader = directory.createReader();
1465
+ var errorHandler = function(error) {
1466
+ return $a601ff30f483e917$var$__guardMethod__(console, "log", function(o) {
1467
+ return o.log(error);
1468
+ });
1469
+ };
1470
+ var readEntries = function() {
1471
+ var _this1 = _this;
1472
+ return dirReader.readEntries(function(entries) {
1473
+ if (entries.length > 0) {
1474
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1475
+ try {
1476
+ for(var _iterator = entries[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1477
+ var entry = _step.value;
1478
+ var _this2 = _this1;
1479
+ if (entry.isFile) entry.file(function(file) {
1480
+ if (_this2.options.ignoreHiddenFiles && file.name.substring(0, 1) === ".") return;
1481
+ file.fullPath = "".concat(path, "/").concat(file.name);
1482
+ return _this2.addFile(file);
1483
+ });
1484
+ else if (entry.isDirectory) _this1._addFilesFromDirectory(entry, "".concat(path, "/").concat(entry.name));
1485
+ }
1486
+ } catch (err) {
1487
+ _didIteratorError = true;
1488
+ _iteratorError = err;
1489
+ } finally{
1490
+ try {
1491
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1492
+ _iterator.return();
1493
+ }
1494
+ } finally{
1495
+ if (_didIteratorError) {
1496
+ throw _iteratorError;
1497
+ }
1498
+ }
1499
+ }
1500
+ // Recursively call readEntries() again, since browser only handle
1501
+ // the first 100 entries.
1502
+ // See: https://developer.mozilla.org/en-US/docs/Web/API/DirectoryReader#readEntries
1503
+ readEntries();
1504
+ }
1505
+ return null;
1506
+ }, errorHandler);
1507
+ };
1508
+ return readEntries();
1509
+ }
1510
+ },
1511
+ {
1512
+ // If `done()` is called without argument the file is accepted
1513
+ // If you call it with an error message, the file is rejected
1514
+ // (This allows for asynchronous validation)
1515
+ //
1516
+ // This function checks the filesize, and if the file.type passes the
1517
+ // `acceptedFiles` check.
1518
+ key: "accept",
1519
+ value: function accept(file, done) {
1520
+ if (this.options.maxFilesize && file.size > this.options.maxFilesize * 1048576) done(this.options.dictFileTooBig.replace("{{filesize}}", Math.round(file.size / 1024 / 10.24) / 100).replace("{{maxFilesize}}", this.options.maxFilesize));
1521
+ else if (!$a601ff30f483e917$export$2e2bcd8739ae039.isValidFile(file, this.options.acceptedFiles)) done(this.options.dictInvalidFileType);
1522
+ else if (this.options.maxFiles != null && this.getAcceptedFiles().length >= this.options.maxFiles) {
1523
+ done(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}", this.options.maxFiles));
1524
+ this.emit("maxfilesexceeded", file);
1525
+ } else this.options.accept.call(this, file, done);
1526
+ }
1527
+ },
1528
+ {
1529
+ key: "addFile",
1530
+ value: function addFile(file) {
1531
+ var _this = this;
1532
+ file.upload = {
1533
+ uuid: $a601ff30f483e917$export$2e2bcd8739ae039.uuidv4(),
1534
+ progress: 0,
1535
+ // Setting the total upload size to file.size for the beginning
1536
+ // It's actual different than the size to be transmitted.
1537
+ total: file.size,
1538
+ bytesSent: 0,
1539
+ filename: this._renameFile(file)
1540
+ };
1541
+ this.files.push(file);
1542
+ file.status = $a601ff30f483e917$export$2e2bcd8739ae039.ADDED;
1543
+ this.emit("addedfile", file);
1544
+ this._enqueueThumbnail(file);
1545
+ this.accept(file, function(error) {
1546
+ if (error) {
1547
+ file.accepted = false;
1548
+ _this._errorProcessing([
1549
+ file
1550
+ ], error); // Will set the file.status
1551
+ } else {
1552
+ file.accepted = true;
1553
+ if (_this.options.autoQueue) _this.enqueueFile(file);
1554
+ // Will set .accepted = true
1555
+ }
1556
+ _this._updateMaxFilesReachedClass();
1557
+ });
1558
+ }
1559
+ },
1560
+ {
1561
+ // Wrapper for enqueueFile
1562
+ key: "enqueueFiles",
1563
+ value: function enqueueFiles(files) {
1564
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1565
+ try {
1566
+ for(var _iterator = files[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1567
+ var file = _step.value;
1568
+ this.enqueueFile(file);
1569
+ }
1570
+ } catch (err) {
1571
+ _didIteratorError = true;
1572
+ _iteratorError = err;
1573
+ } finally{
1574
+ try {
1575
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1576
+ _iterator.return();
1577
+ }
1578
+ } finally{
1579
+ if (_didIteratorError) {
1580
+ throw _iteratorError;
1581
+ }
1582
+ }
1583
+ }
1584
+ return null;
1585
+ }
1586
+ },
1587
+ {
1588
+ key: "enqueueFile",
1589
+ value: function enqueueFile(file) {
1590
+ if (file.status === $a601ff30f483e917$export$2e2bcd8739ae039.ADDED && file.accepted === true) {
1591
+ var _this = this;
1592
+ file.status = $a601ff30f483e917$export$2e2bcd8739ae039.QUEUED;
1593
+ if (this.options.autoProcessQueue) return setTimeout(function() {
1594
+ return _this.processQueue();
1595
+ }, 0); // Deferring the call
1596
+ } else throw new Error("This file can't be queued because it has already been processed or was rejected.");
1597
+ }
1598
+ },
1599
+ {
1600
+ key: "_enqueueThumbnail",
1601
+ value: function _enqueueThumbnail(file) {
1602
+ if (this.options.createImageThumbnails && file.type.match(/image.*/) && file.size <= this.options.maxThumbnailFilesize * 1048576) {
1603
+ var _this = this;
1604
+ this._thumbnailQueue.push(file);
1605
+ return setTimeout(function() {
1606
+ return _this._processThumbnailQueue();
1607
+ }, 0); // Deferring the call
1608
+ }
1609
+ }
1610
+ },
1611
+ {
1612
+ key: "_processThumbnailQueue",
1613
+ value: function _processThumbnailQueue() {
1614
+ var _this = this;
1615
+ if (this._processingThumbnail || this._thumbnailQueue.length === 0) return;
1616
+ this._processingThumbnail = true;
1617
+ var file = this._thumbnailQueue.shift();
1618
+ return this.createThumbnail(file, this.options.thumbnailWidth, this.options.thumbnailHeight, this.options.thumbnailMethod, true, function(dataUrl) {
1619
+ _this.emit("thumbnail", file, dataUrl);
1620
+ _this._processingThumbnail = false;
1621
+ return _this._processThumbnailQueue();
1622
+ });
1623
+ }
1624
+ },
1625
+ {
1626
+ // Can be called by the user to remove a file
1627
+ key: "removeFile",
1628
+ value: function removeFile(file) {
1629
+ if (file.status === $a601ff30f483e917$export$2e2bcd8739ae039.UPLOADING) this.cancelUpload(file);
1630
+ this.files = $a601ff30f483e917$var$without(this.files, file);
1631
+ this.emit("removedfile", file);
1632
+ if (this.files.length === 0) return this.emit("reset");
1633
+ }
1634
+ },
1635
+ {
1636
+ // Removes all files that aren't currently processed from the list
1637
+ key: "removeAllFiles",
1638
+ value: function removeAllFiles(cancelIfNecessary) {
1639
+ // Create a copy of files since removeFile() changes the @files array.
1640
+ if (cancelIfNecessary == null) cancelIfNecessary = false;
1641
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1642
+ try {
1643
+ for(var _iterator = this.files.slice()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1644
+ var file = _step.value;
1645
+ if (file.status !== $a601ff30f483e917$export$2e2bcd8739ae039.UPLOADING || cancelIfNecessary) this.removeFile(file);
1646
+ }
1647
+ } catch (err) {
1648
+ _didIteratorError = true;
1649
+ _iteratorError = err;
1650
+ } finally{
1651
+ try {
1652
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1653
+ _iterator.return();
1654
+ }
1655
+ } finally{
1656
+ if (_didIteratorError) {
1657
+ throw _iteratorError;
1658
+ }
1659
+ }
1660
+ }
1661
+ return null;
1662
+ }
1663
+ },
1664
+ {
1665
+ // Resizes an image before it gets sent to the server. This function is the default behavior of
1666
+ // `options.transformFile` if `resizeWidth` or `resizeHeight` are set. The callback is invoked with
1667
+ // the resized blob.
1668
+ key: "resizeImage",
1669
+ value: function resizeImage(file, width, height, resizeMethod, callback) {
1670
+ var _this = this;
1671
+ return this.createThumbnail(file, width, height, resizeMethod, true, function(dataUrl, canvas) {
1672
+ if (canvas == null) // The image has not been resized
1673
+ return callback(file);
1674
+ else {
1675
+ var _options = _this.options, resizeMimeType = _options.resizeMimeType;
1676
+ if (resizeMimeType == null) resizeMimeType = file.type;
1677
+ var resizedDataURL = canvas.toDataURL(resizeMimeType, _this.options.resizeQuality);
1678
+ if (resizeMimeType === "image/jpeg" || resizeMimeType === "image/jpg") // Now add the original EXIF information
1679
+ resizedDataURL = $a601ff30f483e917$var$ExifRestore.restore(file.dataURL, resizedDataURL);
1680
+ return callback($a601ff30f483e917$export$2e2bcd8739ae039.dataURItoBlob(resizedDataURL));
1681
+ }
1682
+ });
1683
+ }
1684
+ },
1685
+ {
1686
+ key: "createThumbnail",
1687
+ value: function createThumbnail(file, width, height, resizeMethod, fixOrientation, callback) {
1688
+ var _this = this;
1689
+ var fileReader = new FileReader();
1690
+ fileReader.onload = function() {
1691
+ file.dataURL = fileReader.result;
1692
+ // Don't bother creating a thumbnail for SVG images since they're vector
1693
+ if (file.type === "image/svg+xml") {
1694
+ if (callback != null) callback(fileReader.result);
1695
+ return;
1696
+ }
1697
+ _this.createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback);
1698
+ };
1699
+ fileReader.readAsDataURL(file);
1700
+ }
1701
+ },
1702
+ {
1703
+ // `mockFile` needs to have these attributes:
1704
+ //
1705
+ // { name: 'name', size: 12345, imageUrl: '' }
1706
+ //
1707
+ // `callback` will be invoked when the image has been downloaded and displayed.
1708
+ // `crossOrigin` will be added to the `img` tag when accessing the file.
1709
+ key: "displayExistingFile",
1710
+ value: function displayExistingFile(mockFile, imageUrl, callback, crossOrigin, param) {
1711
+ var resizeThumbnail = param === void 0 ? true : param;
1712
+ this.emit("addedfile", mockFile);
1713
+ this.emit("complete", mockFile);
1714
+ if (!resizeThumbnail) {
1715
+ this.emit("thumbnail", mockFile, imageUrl);
1716
+ if (callback) callback();
1717
+ } else {
1718
+ var _this = this;
1719
+ var onDone = function(thumbnail) {
1720
+ _this.emit("thumbnail", mockFile, thumbnail);
1721
+ if (callback) callback();
1722
+ };
1723
+ mockFile.dataURL = imageUrl;
1724
+ this.createThumbnailFromUrl(mockFile, this.options.thumbnailWidth, this.options.thumbnailHeight, this.options.thumbnailMethod, this.options.fixOrientation, onDone, crossOrigin);
1725
+ }
1726
+ }
1727
+ },
1728
+ {
1729
+ key: "createThumbnailFromUrl",
1730
+ value: function createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback, crossOrigin) {
1731
+ var _this = this;
1732
+ // Not using `new Image` here because of a bug in latest Chrome versions.
1733
+ // See https://github.com/enyo/dropzone/pull/226
1734
+ var img = document.createElement("img");
1735
+ if (crossOrigin) img.crossOrigin = crossOrigin;
1736
+ // fixOrientation is not needed anymore with browsers handling imageOrientation
1737
+ fixOrientation = getComputedStyle(document.body)["imageOrientation"] == "from-image" ? false : fixOrientation;
1738
+ img.onload = function() {
1739
+ var _this1 = _this;
1740
+ var loadExif = function(callback) {
1741
+ return callback(1);
1742
+ };
1743
+ if (typeof EXIF !== "undefined" && EXIF !== null && fixOrientation) loadExif = function(callback) {
1744
+ return EXIF.getData(img, function() {
1745
+ return callback(EXIF.getTag(this, "Orientation"));
1746
+ });
1747
+ };
1748
+ return loadExif(function(orientation) {
1749
+ file.width = img.width;
1750
+ file.height = img.height;
1751
+ var resizeInfo = _this1.options.resize.call(_this1, file, width, height, resizeMethod);
1752
+ var canvas = document.createElement("canvas");
1753
+ var ctx = canvas.getContext("2d");
1754
+ canvas.width = resizeInfo.trgWidth;
1755
+ canvas.height = resizeInfo.trgHeight;
1756
+ if (orientation > 4) {
1757
+ canvas.width = resizeInfo.trgHeight;
1758
+ canvas.height = resizeInfo.trgWidth;
1759
+ }
1760
+ switch(orientation){
1761
+ case 2:
1762
+ // horizontal flip
1763
+ ctx.translate(canvas.width, 0);
1764
+ ctx.scale(-1, 1);
1765
+ break;
1766
+ case 3:
1767
+ // 180° rotate left
1768
+ ctx.translate(canvas.width, canvas.height);
1769
+ ctx.rotate(Math.PI);
1770
+ break;
1771
+ case 4:
1772
+ // vertical flip
1773
+ ctx.translate(0, canvas.height);
1774
+ ctx.scale(1, -1);
1775
+ break;
1776
+ case 5:
1777
+ // vertical flip + 90 rotate right
1778
+ ctx.rotate(0.5 * Math.PI);
1779
+ ctx.scale(1, -1);
1780
+ break;
1781
+ case 6:
1782
+ // 90° rotate right
1783
+ ctx.rotate(0.5 * Math.PI);
1784
+ ctx.translate(0, -canvas.width);
1785
+ break;
1786
+ case 7:
1787
+ // horizontal flip + 90 rotate right
1788
+ ctx.rotate(0.5 * Math.PI);
1789
+ ctx.translate(canvas.height, -canvas.width);
1790
+ ctx.scale(-1, 1);
1791
+ break;
1792
+ case 8:
1793
+ // 90° rotate left
1794
+ ctx.rotate(-0.5 * Math.PI);
1795
+ ctx.translate(-canvas.height, 0);
1796
+ break;
1797
+ }
1798
+ // This is a bugfix for iOS' scaling bug.
1799
+ $a601ff30f483e917$var$drawImageIOSFix(ctx, img, resizeInfo.srcX != null ? resizeInfo.srcX : 0, resizeInfo.srcY != null ? resizeInfo.srcY : 0, resizeInfo.srcWidth, resizeInfo.srcHeight, resizeInfo.trgX != null ? resizeInfo.trgX : 0, resizeInfo.trgY != null ? resizeInfo.trgY : 0, resizeInfo.trgWidth, resizeInfo.trgHeight);
1800
+ var thumbnail = canvas.toDataURL("image/png");
1801
+ if (callback != null) return callback(thumbnail, canvas);
1802
+ });
1803
+ };
1804
+ if (callback != null) img.onerror = callback;
1805
+ return img.src = file.dataURL;
1806
+ }
1807
+ },
1808
+ {
1809
+ // Goes through the queue and processes files if there aren't too many already.
1810
+ key: "processQueue",
1811
+ value: function processQueue() {
1812
+ var _options = this.options, parallelUploads = _options.parallelUploads;
1813
+ var processingLength = this.getUploadingFiles().length;
1814
+ var i = processingLength;
1815
+ // There are already at least as many files uploading than should be
1816
+ if (processingLength >= parallelUploads) return;
1817
+ var queuedFiles = this.getQueuedFiles();
1818
+ if (!(queuedFiles.length > 0)) return;
1819
+ if (this.options.uploadMultiple) // The files should be uploaded in one request
1820
+ return this.processFiles(queuedFiles.slice(0, parallelUploads - processingLength));
1821
+ else while(i < parallelUploads){
1822
+ if (!queuedFiles.length) return;
1823
+ // Nothing left to process
1824
+ this.processFile(queuedFiles.shift());
1825
+ i++;
1826
+ }
1827
+ }
1828
+ },
1829
+ {
1830
+ // Wrapper for `processFiles`
1831
+ key: "processFile",
1832
+ value: function processFile(file) {
1833
+ return this.processFiles([
1834
+ file
1835
+ ]);
1836
+ }
1837
+ },
1838
+ {
1839
+ // Loads the file, then calls finishedLoading()
1840
+ key: "processFiles",
1841
+ value: function processFiles(files) {
1842
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1843
+ try {
1844
+ for(var _iterator = files[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1845
+ var file = _step.value;
1846
+ file.processing = true; // Backwards compatibility
1847
+ file.status = $a601ff30f483e917$export$2e2bcd8739ae039.UPLOADING;
1848
+ this.emit("processing", file);
1849
+ }
1850
+ } catch (err) {
1851
+ _didIteratorError = true;
1852
+ _iteratorError = err;
1853
+ } finally{
1854
+ try {
1855
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1856
+ _iterator.return();
1857
+ }
1858
+ } finally{
1859
+ if (_didIteratorError) {
1860
+ throw _iteratorError;
1861
+ }
1862
+ }
1863
+ }
1864
+ if (this.options.uploadMultiple) this.emit("processingmultiple", files);
1865
+ return this.uploadFiles(files);
1866
+ }
1867
+ },
1868
+ {
1869
+ key: "_getFilesWithXhr",
1870
+ value: function _getFilesWithXhr(xhr) {
1871
+ var files;
1872
+ return files = this.files.filter(function(file) {
1873
+ return file.xhr === xhr;
1874
+ }).map(function(file) {
1875
+ return file;
1876
+ });
1877
+ }
1878
+ },
1879
+ {
1880
+ // Cancels the file upload and sets the status to CANCELED
1881
+ // **if** the file is actually being uploaded.
1882
+ // If it's still in the queue, the file is being removed from it and the status
1883
+ // set to CANCELED.
1884
+ key: "cancelUpload",
1885
+ value: function cancelUpload(file) {
1886
+ if (file.status === $a601ff30f483e917$export$2e2bcd8739ae039.UPLOADING) {
1887
+ var groupedFiles = this._getFilesWithXhr(file.xhr);
1888
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1889
+ try {
1890
+ for(var _iterator = groupedFiles[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1891
+ var groupedFile = _step.value;
1892
+ groupedFile.status = $a601ff30f483e917$export$2e2bcd8739ae039.CANCELED;
1893
+ }
1894
+ } catch (err) {
1895
+ _didIteratorError = true;
1896
+ _iteratorError = err;
1897
+ } finally{
1898
+ try {
1899
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1900
+ _iterator.return();
1901
+ }
1902
+ } finally{
1903
+ if (_didIteratorError) {
1904
+ throw _iteratorError;
1905
+ }
1906
+ }
1907
+ }
1908
+ if (typeof file.xhr !== "undefined") file.xhr.abort();
1909
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
1910
+ try {
1911
+ for(var _iterator1 = groupedFiles[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
1912
+ var groupedFile = _step1.value;
1913
+ this.emit("canceled", groupedFile);
1914
+ }
1915
+ } catch (err) {
1916
+ _didIteratorError1 = true;
1917
+ _iteratorError1 = err;
1918
+ } finally{
1919
+ try {
1920
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
1921
+ _iterator1.return();
1922
+ }
1923
+ } finally{
1924
+ if (_didIteratorError1) {
1925
+ throw _iteratorError1;
1926
+ }
1927
+ }
1928
+ }
1929
+ if (this.options.uploadMultiple) this.emit("canceledmultiple", groupedFiles);
1930
+ } else if (file.status === $a601ff30f483e917$export$2e2bcd8739ae039.ADDED || file.status === $a601ff30f483e917$export$2e2bcd8739ae039.QUEUED) {
1931
+ file.status = $a601ff30f483e917$export$2e2bcd8739ae039.CANCELED;
1932
+ this.emit("canceled", file);
1933
+ if (this.options.uploadMultiple) this.emit("canceledmultiple", [
1934
+ file
1935
+ ]);
1936
+ }
1937
+ if (this.options.autoProcessQueue) return this.processQueue();
1938
+ }
1939
+ },
1940
+ {
1941
+ key: "resolveOption",
1942
+ value: function resolveOption(option) {
1943
+ for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
1944
+ args[_key - 1] = arguments[_key];
1945
+ }
1946
+ if (typeof option === "function") return option.apply(this, args);
1947
+ return option;
1948
+ }
1949
+ },
1950
+ {
1951
+ key: "uploadFile",
1952
+ value: function uploadFile(file) {
1953
+ return this.uploadFiles([
1954
+ file
1955
+ ]);
1956
+ }
1957
+ },
1958
+ {
1959
+ key: "uploadFiles",
1960
+ value: function uploadFiles(files) {
1961
+ var _this = this;
1962
+ this._transformFiles(files, function(transformedFiles) {
1963
+ if (_this.options.chunking) {
1964
+ // Chunking is not allowed to be used with `uploadMultiple` so we know
1965
+ // that there is only __one__file.
1966
+ var transformedFile = transformedFiles[0];
1967
+ files[0].upload.chunked = _this.options.chunking && (_this.options.forceChunking || transformedFile.size > _this.options.chunkSize);
1968
+ files[0].upload.totalChunkCount = Math.ceil(transformedFile.size / _this.options.chunkSize);
1969
+ }
1970
+ if (files[0].upload.chunked) {
1971
+ var _this1 = _this, _this4 = _this;
1972
+ // This file should be sent in chunks!
1973
+ // If the chunking option is set, we **know** that there can only be **one** file, since
1974
+ // uploadMultiple is not allowed with this option.
1975
+ var file = files[0];
1976
+ var transformedFile = transformedFiles[0];
1977
+ var startedChunkCount = 0;
1978
+ file.upload.chunks = [];
1979
+ var handleNextChunk = function() {
1980
+ var chunkIndex = 0;
1981
+ // Find the next item in file.upload.chunks that is not defined yet.
1982
+ while(file.upload.chunks[chunkIndex] !== undefined)chunkIndex++;
1983
+ // This means, that all chunks have already been started.
1984
+ if (chunkIndex >= file.upload.totalChunkCount) return;
1985
+ startedChunkCount++;
1986
+ var start = chunkIndex * _this1.options.chunkSize;
1987
+ var end = Math.min(start + _this1.options.chunkSize, transformedFile.size);
1988
+ var dataBlock = {
1989
+ name: _this1._getParamName(0),
1990
+ data: transformedFile.webkitSlice ? transformedFile.webkitSlice(start, end) : transformedFile.slice(start, end),
1991
+ filename: file.upload.filename,
1992
+ chunkIndex: chunkIndex
1993
+ };
1994
+ file.upload.chunks[chunkIndex] = {
1995
+ file: file,
1996
+ index: chunkIndex,
1997
+ dataBlock: dataBlock,
1998
+ status: $a601ff30f483e917$export$2e2bcd8739ae039.UPLOADING,
1999
+ progress: 0,
2000
+ retries: 0
2001
+ };
2002
+ _this1._uploadData(files, [
2003
+ dataBlock
2004
+ ]);
2005
+ };
2006
+ file.upload.finishedChunkUpload = function(chunk, response) {
2007
+ var _this5 = _this4;
2008
+ var allFinished = true;
2009
+ chunk.status = $a601ff30f483e917$export$2e2bcd8739ae039.SUCCESS;
2010
+ // Clear the data from the chunk
2011
+ chunk.dataBlock = null;
2012
+ chunk.response = chunk.xhr.responseText;
2013
+ chunk.responseHeaders = chunk.xhr.getAllResponseHeaders();
2014
+ // Leaving this reference to xhr will cause memory leaks.
2015
+ chunk.xhr = null;
2016
+ for(var i = 0; i < file.upload.totalChunkCount; i++){
2017
+ if (file.upload.chunks[i] === undefined) return handleNextChunk();
2018
+ if (file.upload.chunks[i].status !== $a601ff30f483e917$export$2e2bcd8739ae039.SUCCESS) allFinished = false;
2019
+ }
2020
+ if (allFinished) _this4.options.chunksUploaded(file, function() {
2021
+ _this5._finished(files, response, null);
2022
+ });
2023
+ };
2024
+ if (_this.options.parallelChunkUploads) for(var i = 0; i < file.upload.totalChunkCount; i++)handleNextChunk();
2025
+ else handleNextChunk();
2026
+ } else {
2027
+ var dataBlocks = [];
2028
+ for(var i = 0; i < files.length; i++)dataBlocks[i] = {
2029
+ name: _this._getParamName(i),
2030
+ data: transformedFiles[i],
2031
+ filename: files[i].upload.filename
2032
+ };
2033
+ _this._uploadData(files, dataBlocks);
2034
+ }
2035
+ });
2036
+ }
2037
+ },
2038
+ {
2039
+ /// Returns the right chunk for given file and xhr
2040
+ key: "_getChunk",
2041
+ value: function _getChunk(file, xhr) {
2042
+ for(var i = 0; i < file.upload.totalChunkCount; i++){
2043
+ if (file.upload.chunks[i] !== undefined && file.upload.chunks[i].xhr === xhr) return file.upload.chunks[i];
2044
+ }
2045
+ }
2046
+ },
2047
+ {
2048
+ // This function actually uploads the file(s) to the server.
2049
+ //
2050
+ // If dataBlocks contains the actual data to upload (meaning, that this could
2051
+ // either be transformed files, or individual chunks for chunked upload) then
2052
+ // they will be used for the actual data to upload.
2053
+ key: "_uploadData",
2054
+ value: function _uploadData(files, dataBlocks) {
2055
+ var _this = this, _this7 = this, _this8 = this, _this9 = this;
2056
+ var xhr = new XMLHttpRequest();
2057
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2058
+ try {
2059
+ // Put the xhr object in the file objects to be able to reference it later.
2060
+ for(var _iterator = files[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2061
+ var file = _step.value;
2062
+ file.xhr = xhr;
2063
+ }
2064
+ } catch (err) {
2065
+ _didIteratorError = true;
2066
+ _iteratorError = err;
2067
+ } finally{
2068
+ try {
2069
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
2070
+ _iterator.return();
2071
+ }
2072
+ } finally{
2073
+ if (_didIteratorError) {
2074
+ throw _iteratorError;
2075
+ }
2076
+ }
2077
+ }
2078
+ if (files[0].upload.chunked) // Put the xhr object in the right chunk object, so it can be associated
2079
+ // later, and found with _getChunk.
2080
+ files[0].upload.chunks[dataBlocks[0].chunkIndex].xhr = xhr;
2081
+ var method = this.resolveOption(this.options.method, files, dataBlocks);
2082
+ var url = this.resolveOption(this.options.url, files, dataBlocks);
2083
+ xhr.open(method, url, true);
2084
+ // Setting the timeout after open because of IE11 issue: https://gitlab.com/meno/dropzone/issues/8
2085
+ var timeout = this.resolveOption(this.options.timeout, files);
2086
+ if (timeout) xhr.timeout = this.resolveOption(this.options.timeout, files);
2087
+ // Has to be after `.open()`. See https://github.com/enyo/dropzone/issues/179
2088
+ xhr.withCredentials = !!this.options.withCredentials;
2089
+ xhr.onload = function(e) {
2090
+ _this._finishedUploading(files, xhr, e);
2091
+ };
2092
+ xhr.ontimeout = function() {
2093
+ _this7._handleUploadError(files, xhr, "Request timedout after ".concat(_this7.options.timeout / 1000, " seconds"));
2094
+ };
2095
+ xhr.onerror = function() {
2096
+ _this8._handleUploadError(files, xhr);
2097
+ };
2098
+ // Some browsers do not have the .upload property
2099
+ var progressObj = xhr.upload != null ? xhr.upload : xhr;
2100
+ progressObj.onprogress = function(e) {
2101
+ return _this9._updateFilesUploadProgress(files, xhr, e);
2102
+ };
2103
+ var headers = this.options.defaultHeaders ? {
2104
+ Accept: "application/json",
2105
+ "Cache-Control": "no-cache",
2106
+ "X-Requested-With": "XMLHttpRequest"
2107
+ } : {
2108
+ };
2109
+ if (this.options.binaryBody) headers["Content-Type"] = files[0].type;
2110
+ if (this.options.headers) $parcel$interopDefault($6mU8w$justextend)(headers, this.options.headers);
2111
+ for(var headerName in headers){
2112
+ var headerValue = headers[headerName];
2113
+ if (headerValue) xhr.setRequestHeader(headerName, headerValue);
2114
+ }
2115
+ if (this.options.binaryBody) {
2116
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2117
+ try {
2118
+ // Since the file is going to be sent as binary body, it doesn't make
2119
+ // any sense to generate `FormData` for it.
2120
+ for(var _iterator = files[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2121
+ var file = _step.value;
2122
+ this.emit("sending", file, xhr);
2123
+ }
2124
+ } catch (err) {
2125
+ _didIteratorError = true;
2126
+ _iteratorError = err;
2127
+ } finally{
2128
+ try {
2129
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
2130
+ _iterator.return();
2131
+ }
2132
+ } finally{
2133
+ if (_didIteratorError) {
2134
+ throw _iteratorError;
2135
+ }
2136
+ }
2137
+ }
2138
+ if (this.options.uploadMultiple) this.emit("sendingmultiple", files, xhr);
2139
+ this.submitRequest(xhr, null, files);
2140
+ } else {
2141
+ var formData = new FormData();
2142
+ // Adding all @options parameters
2143
+ if (this.options.params) {
2144
+ var additionalParams = this.options.params;
2145
+ if (typeof additionalParams === "function") additionalParams = additionalParams.call(this, files, xhr, files[0].upload.chunked ? this._getChunk(files[0], xhr) : null);
2146
+ for(var key in additionalParams){
2147
+ var value = additionalParams[key];
2148
+ if (Array.isArray(value)) // The additional parameter contains an array,
2149
+ // so lets iterate over it to attach each value
2150
+ // individually.
2151
+ for(var i = 0; i < value.length; i++)formData.append(key, value[i]);
2152
+ else formData.append(key, value);
2153
+ }
2154
+ }
2155
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2156
+ try {
2157
+ // Let the user add additional data if necessary
2158
+ for(var _iterator = files[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2159
+ var file = _step.value;
2160
+ this.emit("sending", file, xhr, formData);
2161
+ }
2162
+ } catch (err) {
2163
+ _didIteratorError = true;
2164
+ _iteratorError = err;
2165
+ } finally{
2166
+ try {
2167
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
2168
+ _iterator.return();
2169
+ }
2170
+ } finally{
2171
+ if (_didIteratorError) {
2172
+ throw _iteratorError;
2173
+ }
2174
+ }
2175
+ }
2176
+ if (this.options.uploadMultiple) this.emit("sendingmultiple", files, xhr, formData);
2177
+ this._addFormElementData(formData);
2178
+ // Finally add the files
2179
+ // Has to be last because some servers (eg: S3) expect the file to be the last parameter
2180
+ for(var i = 0; i < dataBlocks.length; i++){
2181
+ var dataBlock = dataBlocks[i];
2182
+ formData.append(dataBlock.name, dataBlock.data, dataBlock.filename);
2183
+ }
2184
+ this.submitRequest(xhr, formData, files);
2185
+ }
2186
+ }
2187
+ },
2188
+ {
2189
+ // Transforms all files with this.options.transformFile and invokes done with the transformed files when done.
2190
+ key: "_transformFiles",
2191
+ value: function _transformFiles(files, done) {
2192
+ var _this = this, _loop = function(i) {
2193
+ _this.options.transformFile.call(_this, files[i], function(transformedFile) {
2194
+ transformedFiles[i] = transformedFile;
2195
+ if (++doneCounter === files.length) done(transformedFiles);
2196
+ });
2197
+ };
2198
+ var transformedFiles = [];
2199
+ // Clumsy way of handling asynchronous calls, until I get to add a proper Future library.
2200
+ var doneCounter = 0;
2201
+ for(var i = 0; i < files.length; i++)_loop(i);
2202
+ }
2203
+ },
2204
+ {
2205
+ // Takes care of adding other input elements of the form to the AJAX request
2206
+ key: "_addFormElementData",
2207
+ value: function _addFormElementData(formData) {
2208
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2209
+ // Take care of other input elements
2210
+ if (this.element.tagName === "FORM") try {
2211
+ for(var _iterator = this.element.querySelectorAll("input, textarea, select, button")[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2212
+ var input = _step.value;
2213
+ var inputName = input.getAttribute("name");
2214
+ var inputType = input.getAttribute("type");
2215
+ if (inputType) inputType = inputType.toLowerCase();
2216
+ // If the input doesn't have a name, we can't use it.
2217
+ if (typeof inputName === "undefined" || inputName === null) continue;
2218
+ if (input.tagName === "SELECT" && input.hasAttribute("multiple")) {
2219
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2220
+ try {
2221
+ // Possibly multiple values
2222
+ for(var _iterator = input.options[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2223
+ var option = _step.value;
2224
+ if (option.selected) formData.append(inputName, option.value);
2225
+ }
2226
+ } catch (err) {
2227
+ _didIteratorError = true;
2228
+ _iteratorError = err;
2229
+ } finally{
2230
+ try {
2231
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
2232
+ _iterator.return();
2233
+ }
2234
+ } finally{
2235
+ if (_didIteratorError) {
2236
+ throw _iteratorError;
2237
+ }
2238
+ }
2239
+ }
2240
+ } else if (!inputType || inputType !== "checkbox" && inputType !== "radio" || input.checked) formData.append(inputName, input.value);
2241
+ }
2242
+ } catch (err) {
2243
+ _didIteratorError = true;
2244
+ _iteratorError = err;
2245
+ } finally{
2246
+ try {
2247
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
2248
+ _iterator.return();
2249
+ }
2250
+ } finally{
2251
+ if (_didIteratorError) {
2252
+ throw _iteratorError;
2253
+ }
2254
+ }
2255
+ }
2256
+ }
2257
+ },
2258
+ {
2259
+ // Invoked when there is new progress information about given files.
2260
+ // If e is not provided, it is assumed that the upload is finished.
2261
+ key: "_updateFilesUploadProgress",
2262
+ value: function _updateFilesUploadProgress(files, xhr, e) {
2263
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2264
+ if (!files[0].upload.chunked) try {
2265
+ // Handle file uploads without chunking
2266
+ for(var _iterator = files[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2267
+ var file = _step.value;
2268
+ if (file.upload.total && file.upload.bytesSent && file.upload.bytesSent == file.upload.total) continue;
2269
+ if (e) {
2270
+ file.upload.progress = 100 * e.loaded / e.total;
2271
+ file.upload.total = e.total;
2272
+ file.upload.bytesSent = e.loaded;
2273
+ } else {
2274
+ // No event, so we're at 100%
2275
+ file.upload.progress = 100;
2276
+ file.upload.bytesSent = file.upload.total;
2277
+ }
2278
+ this.emit("uploadprogress", file, file.upload.progress, file.upload.bytesSent);
2279
+ }
2280
+ } catch (err) {
2281
+ _didIteratorError = true;
2282
+ _iteratorError = err;
2283
+ } finally{
2284
+ try {
2285
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
2286
+ _iterator.return();
2287
+ }
2288
+ } finally{
2289
+ if (_didIteratorError) {
2290
+ throw _iteratorError;
2291
+ }
2292
+ }
2293
+ }
2294
+ else {
2295
+ // Handle chunked file uploads
2296
+ // Chunked upload is not compatible with uploading multiple files in one
2297
+ // request, so we know there's only one file.
2298
+ var file = files[0];
2299
+ // Since this is a chunked upload, we need to update the appropriate chunk
2300
+ // progress.
2301
+ var chunk = this._getChunk(file, xhr);
2302
+ if (e) {
2303
+ chunk.progress = 100 * e.loaded / e.total;
2304
+ chunk.total = e.total;
2305
+ chunk.bytesSent = e.loaded;
2306
+ } else {
2307
+ // No event, so we're at 100%
2308
+ chunk.progress = 100;
2309
+ chunk.bytesSent = chunk.total;
2310
+ }
2311
+ // Now tally the *file* upload progress from its individual chunks
2312
+ file.upload.progress = 0;
2313
+ file.upload.total = 0;
2314
+ file.upload.bytesSent = 0;
2315
+ for(var i = 0; i < file.upload.totalChunkCount; i++)if (file.upload.chunks[i] && typeof file.upload.chunks[i].progress !== "undefined") {
2316
+ file.upload.progress += file.upload.chunks[i].progress;
2317
+ file.upload.total += file.upload.chunks[i].total;
2318
+ file.upload.bytesSent += file.upload.chunks[i].bytesSent;
2319
+ }
2320
+ // Since the process is a percentage, we need to divide by the amount of
2321
+ // chunks we've used.
2322
+ file.upload.progress = file.upload.progress / file.upload.totalChunkCount;
2323
+ this.emit("uploadprogress", file, file.upload.progress, file.upload.bytesSent);
2324
+ }
2325
+ }
2326
+ },
2327
+ {
2328
+ key: "_finishedUploading",
2329
+ value: function _finishedUploading(files, xhr, e) {
2330
+ var response;
2331
+ if (files[0].status === $a601ff30f483e917$export$2e2bcd8739ae039.CANCELED) return;
2332
+ if (xhr.readyState !== 4) return;
2333
+ if (xhr.responseType !== "arraybuffer" && xhr.responseType !== "blob") {
2334
+ response = xhr.responseText;
2335
+ if (xhr.getResponseHeader("content-type") && ~xhr.getResponseHeader("content-type").indexOf("application/json")) try {
2336
+ response = JSON.parse(response);
2337
+ } catch (error) {
2338
+ e = error;
2339
+ response = "Invalid JSON response from server.";
2340
+ }
2341
+ }
2342
+ this._updateFilesUploadProgress(files, xhr);
2343
+ if (!(200 <= xhr.status && xhr.status < 300)) this._handleUploadError(files, xhr, response);
2344
+ else if (files[0].upload.chunked) files[0].upload.finishedChunkUpload(this._getChunk(files[0], xhr), response);
2345
+ else this._finished(files, response, e);
2346
+ }
2347
+ },
2348
+ {
2349
+ key: "_handleUploadError",
2350
+ value: function _handleUploadError(files, xhr, response) {
2351
+ if (files[0].status === $a601ff30f483e917$export$2e2bcd8739ae039.CANCELED) return;
2352
+ if (files[0].upload.chunked && this.options.retryChunks) {
2353
+ var chunk = this._getChunk(files[0], xhr);
2354
+ if ((chunk.retries++) < this.options.retryChunksLimit) {
2355
+ this._uploadData(files, [
2356
+ chunk.dataBlock
2357
+ ]);
2358
+ return;
2359
+ } else console.warn("Retried this chunk too often. Giving up.");
2360
+ }
2361
+ this._errorProcessing(files, response || this.options.dictResponseError.replace("{{statusCode}}", xhr.status), xhr);
2362
+ }
2363
+ },
2364
+ {
2365
+ key: "submitRequest",
2366
+ value: function submitRequest(xhr, formData, files) {
2367
+ if (xhr.readyState != 1) {
2368
+ console.warn("Cannot send this request because the XMLHttpRequest.readyState is not OPENED.");
2369
+ return;
2370
+ }
2371
+ if (this.options.binaryBody) {
2372
+ if (files[0].upload.chunked) {
2373
+ var chunk = this._getChunk(files[0], xhr);
2374
+ xhr.send(chunk.dataBlock.data);
2375
+ } else xhr.send(files[0]);
2376
+ } else xhr.send(formData);
2377
+ }
2378
+ },
2379
+ {
2380
+ // Called internally when processing is finished.
2381
+ // Individual callbacks have to be called in the appropriate sections.
2382
+ key: "_finished",
2383
+ value: function _finished(files, responseText, e) {
2384
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2385
+ try {
2386
+ for(var _iterator = files[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2387
+ var file = _step.value;
2388
+ file.status = $a601ff30f483e917$export$2e2bcd8739ae039.SUCCESS;
2389
+ this.emit("success", file, responseText, e);
2390
+ this.emit("complete", file);
2391
+ }
2392
+ } catch (err) {
2393
+ _didIteratorError = true;
2394
+ _iteratorError = err;
2395
+ } finally{
2396
+ try {
2397
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
2398
+ _iterator.return();
2399
+ }
2400
+ } finally{
2401
+ if (_didIteratorError) {
2402
+ throw _iteratorError;
2403
+ }
2404
+ }
2405
+ }
2406
+ if (this.options.uploadMultiple) {
2407
+ this.emit("successmultiple", files, responseText, e);
2408
+ this.emit("completemultiple", files);
2409
+ }
2410
+ if (this.options.autoProcessQueue) return this.processQueue();
2411
+ }
2412
+ },
2413
+ {
2414
+ // Called internally when processing is finished.
2415
+ // Individual callbacks have to be called in the appropriate sections.
2416
+ key: "_errorProcessing",
2417
+ value: function _errorProcessing(files, message, xhr) {
2418
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2419
+ try {
2420
+ for(var _iterator = files[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2421
+ var file = _step.value;
2422
+ file.status = $a601ff30f483e917$export$2e2bcd8739ae039.ERROR;
2423
+ this.emit("error", file, message, xhr);
2424
+ this.emit("complete", file);
2425
+ }
2426
+ } catch (err) {
2427
+ _didIteratorError = true;
2428
+ _iteratorError = err;
2429
+ } finally{
2430
+ try {
2431
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
2432
+ _iterator.return();
2433
+ }
2434
+ } finally{
2435
+ if (_didIteratorError) {
2436
+ throw _iteratorError;
2437
+ }
2438
+ }
2439
+ }
2440
+ if (this.options.uploadMultiple) {
2441
+ this.emit("errormultiple", files, message, xhr);
2442
+ this.emit("completemultiple", files);
2443
+ }
2444
+ if (this.options.autoProcessQueue) return this.processQueue();
2445
+ }
2446
+ }
2447
+ ], [
2448
+ {
2449
+ key: "initClass",
2450
+ value: function initClass() {
2451
+ // Exposing the emitter class, mainly for tests
2452
+ this.prototype.Emitter = $b1d17cfb1d15c36a$export$2e2bcd8739ae039;
2453
+ /*
2454
+ This is a list of all available events you can register on a dropzone object.
2455
+
2456
+ You can register an event handler like this:
2457
+
2458
+ dropzone.on("dragEnter", function() { });
2459
+
2460
+ */ this.prototype.events = [
2461
+ "drop",
2462
+ "dragstart",
2463
+ "dragend",
2464
+ "dragenter",
2465
+ "dragover",
2466
+ "dragleave",
2467
+ "addedfile",
2468
+ "addedfiles",
2469
+ "removedfile",
2470
+ "thumbnail",
2471
+ "error",
2472
+ "errormultiple",
2473
+ "processing",
2474
+ "processingmultiple",
2475
+ "uploadprogress",
2476
+ "totaluploadprogress",
2477
+ "sending",
2478
+ "sendingmultiple",
2479
+ "success",
2480
+ "successmultiple",
2481
+ "canceled",
2482
+ "canceledmultiple",
2483
+ "complete",
2484
+ "completemultiple",
2485
+ "reset",
2486
+ "maxfilesexceeded",
2487
+ "maxfilesreached",
2488
+ "queuecomplete",
2489
+ ];
2490
+ this.prototype._thumbnailQueue = [];
2491
+ this.prototype._processingThumbnail = false;
2492
+ }
2493
+ },
2494
+ {
2495
+ key: "uuidv4",
2496
+ value: function uuidv4() {
2497
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
2498
+ var r = Math.random() * 16 | 0, v = c === "x" ? r : r & 3 | 8;
2499
+ return v.toString(16);
2500
+ });
2501
+ }
2502
+ }
2503
+ ]);
2504
+ return $a601ff30f483e917$export$2e2bcd8739ae039;
2505
+ }($b1d17cfb1d15c36a$export$2e2bcd8739ae039);
2506
+ $a601ff30f483e917$export$2e2bcd8739ae039.initClass();
2507
+ // This is a map of options for your different dropzones. Add configurations
2508
+ // to this object for your different dropzone elemens.
2509
+ //
2510
+ // Example:
2511
+ //
2512
+ // Dropzone.options.myDropzoneElementId = { maxFilesize: 1 };
2513
+ //
2514
+ // And in html:
2515
+ //
2516
+ // <form action="/upload" id="my-dropzone-element-id" class="dropzone"></form>
2517
+ $a601ff30f483e917$export$2e2bcd8739ae039.options = {
2518
+ };
2519
+ // Returns the options for an element or undefined if none available.
2520
+ $a601ff30f483e917$export$2e2bcd8739ae039.optionsForElement = function(element) {
2521
+ // Get the `Dropzone.options.elementId` for this element if it exists
2522
+ if (element.getAttribute("id")) return $a601ff30f483e917$export$2e2bcd8739ae039.options[$a601ff30f483e917$var$camelize(element.getAttribute("id"))];
2523
+ else return undefined;
2524
+ };
2525
+ // Holds a list of all dropzone instances
2526
+ $a601ff30f483e917$export$2e2bcd8739ae039.instances = [];
2527
+ // Returns the dropzone for given element if any
2528
+ $a601ff30f483e917$export$2e2bcd8739ae039.forElement = function(element) {
2529
+ if (typeof element === "string") element = document.querySelector(element);
2530
+ if ((element != null ? element.dropzone : undefined) == null) throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");
2531
+ return element.dropzone;
2532
+ };
2533
+ // Looks for all .dropzone elements and creates a dropzone for them
2534
+ $a601ff30f483e917$export$2e2bcd8739ae039.discover = function() {
2535
+ var dropzones;
2536
+ if (document.querySelectorAll) dropzones = document.querySelectorAll(".dropzone");
2537
+ else {
2538
+ dropzones = [];
2539
+ // IE :(
2540
+ var checkElements = function(elements) {
2541
+ return (function() {
2542
+ var result = [];
2543
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2544
+ try {
2545
+ for(var _iterator = elements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2546
+ var el = _step.value;
2547
+ if (/(^| )dropzone($| )/.test(el.className)) result.push(dropzones.push(el));
2548
+ else result.push(undefined);
2549
+ }
2550
+ } catch (err) {
2551
+ _didIteratorError = true;
2552
+ _iteratorError = err;
2553
+ } finally{
2554
+ try {
2555
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
2556
+ _iterator.return();
2557
+ }
2558
+ } finally{
2559
+ if (_didIteratorError) {
2560
+ throw _iteratorError;
2561
+ }
2562
+ }
2563
+ }
2564
+ return result;
2565
+ })();
2566
+ };
2567
+ checkElements(document.getElementsByTagName("div"));
2568
+ checkElements(document.getElementsByTagName("form"));
2569
+ }
2570
+ return (function() {
2571
+ var result = [];
2572
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2573
+ try {
2574
+ for(var _iterator = dropzones[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2575
+ var dropzone = _step.value;
2576
+ // Create a dropzone unless auto discover has been disabled for specific element
2577
+ if ($a601ff30f483e917$export$2e2bcd8739ae039.optionsForElement(dropzone) !== false) result.push(new $a601ff30f483e917$export$2e2bcd8739ae039(dropzone));
2578
+ else result.push(undefined);
2579
+ }
2580
+ } catch (err) {
2581
+ _didIteratorError = true;
2582
+ _iteratorError = err;
2583
+ } finally{
2584
+ try {
2585
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
2586
+ _iterator.return();
2587
+ }
2588
+ } finally{
2589
+ if (_didIteratorError) {
2590
+ throw _iteratorError;
2591
+ }
2592
+ }
2593
+ }
2594
+ return result;
2595
+ })();
2596
+ };
2597
+ // Some browsers support drag and drog functionality, but not correctly.
2598
+ //
2599
+ // So I created a blocklist of userAgents. Yes, yes. Browser sniffing, I know.
2600
+ // But what to do when browsers *theoretically* support an API, but crash
2601
+ // when using it.
2602
+ //
2603
+ // This is a list of regular expressions tested against navigator.userAgent
2604
+ //
2605
+ // ** It should only be used on browser that *do* support the API, but
2606
+ // incorrectly **
2607
+ $a601ff30f483e917$export$2e2bcd8739ae039.blockedBrowsers = [
2608
+ // The mac os and windows phone version of opera 12 seems to have a problem with the File drag'n'drop API.
2609
+ /opera.*(Macintosh|Windows Phone).*version\/12/i,
2610
+ ];
2611
+ // Checks if the browser is supported
2612
+ $a601ff30f483e917$export$2e2bcd8739ae039.isBrowserSupported = function() {
2613
+ var capableBrowser = true;
2614
+ if (window.File && window.FileReader && window.FileList && window.Blob && window.FormData && document.querySelector) {
2615
+ if (!("classList" in document.createElement("a"))) capableBrowser = false;
2616
+ else {
2617
+ if ($a601ff30f483e917$export$2e2bcd8739ae039.blacklistedBrowsers !== undefined) // Since this has been renamed, this makes sure we don't break older
2618
+ // configuration.
2619
+ $a601ff30f483e917$export$2e2bcd8739ae039.blockedBrowsers = $a601ff30f483e917$export$2e2bcd8739ae039.blacklistedBrowsers;
2620
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2621
+ try {
2622
+ // The browser supports the API, but may be blocked.
2623
+ for(var _iterator = $a601ff30f483e917$export$2e2bcd8739ae039.blockedBrowsers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2624
+ var regex = _step.value;
2625
+ if (regex.test(navigator.userAgent)) {
2626
+ capableBrowser = false;
2627
+ continue;
2628
+ }
2629
+ }
2630
+ } catch (err) {
2631
+ _didIteratorError = true;
2632
+ _iteratorError = err;
2633
+ } finally{
2634
+ try {
2635
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
2636
+ _iterator.return();
2637
+ }
2638
+ } finally{
2639
+ if (_didIteratorError) {
2640
+ throw _iteratorError;
2641
+ }
2642
+ }
2643
+ }
2644
+ }
2645
+ } else capableBrowser = false;
2646
+ return capableBrowser;
2647
+ };
2648
+ $a601ff30f483e917$export$2e2bcd8739ae039.dataURItoBlob = function(dataURI) {
2649
+ // convert base64 to raw binary data held in a string
2650
+ // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this
2651
+ var byteString = atob(dataURI.split(",")[1]);
2652
+ // separate out the mime component
2653
+ var mimeString = dataURI.split(",")[0].split(":")[1].split(";")[0];
2654
+ // write the bytes of the string to an ArrayBuffer
2655
+ var ab = new ArrayBuffer(byteString.length);
2656
+ var ia = new Uint8Array(ab);
2657
+ for(var i = 0, end = byteString.length, asc = 0 <= end; asc ? i <= end : i >= end; asc ? i++ : i--)ia[i] = byteString.charCodeAt(i);
2658
+ // write the ArrayBuffer to a blob
2659
+ return new Blob([
2660
+ ab
2661
+ ], {
2662
+ type: mimeString
2663
+ });
2664
+ };
2665
+ // Returns an array without the rejected item
2666
+ var $a601ff30f483e917$var$without = function(list, rejectedItem) {
2667
+ return list.filter(function(item) {
2668
+ return item !== rejectedItem;
2669
+ }).map(function(item) {
2670
+ return item;
2671
+ });
2672
+ };
2673
+ // abc-def_ghi -> abcDefGhi
2674
+ var $a601ff30f483e917$var$camelize = function(str) {
2675
+ return str.replace(/[\-_](\w)/g, function(match) {
2676
+ return match.charAt(1).toUpperCase();
2677
+ });
2678
+ };
2679
+ // Creates an element from string
2680
+ $a601ff30f483e917$export$2e2bcd8739ae039.createElement = function(string) {
2681
+ var div = document.createElement("div");
2682
+ div.innerHTML = string;
2683
+ return div.childNodes[0];
2684
+ };
2685
+ // Tests if given element is inside (or simply is) the container
2686
+ $a601ff30f483e917$export$2e2bcd8739ae039.elementInside = function(element, container) {
2687
+ if (element === container) return true;
2688
+ // Coffeescript doesn't support do/while loops
2689
+ while(element = element.parentNode){
2690
+ if (element === container) return true;
2691
+ }
2692
+ return false;
2693
+ };
2694
+ $a601ff30f483e917$export$2e2bcd8739ae039.getElement = function(el, name) {
2695
+ var element;
2696
+ if (typeof el === "string") element = document.querySelector(el);
2697
+ else if (el.nodeType != null) element = el;
2698
+ if (element == null) throw new Error("Invalid `".concat(name, "` option provided. Please provide a CSS selector or a plain HTML element."));
2699
+ return element;
2700
+ };
2701
+ $a601ff30f483e917$export$2e2bcd8739ae039.getElements = function(els, name) {
2702
+ var el, elements;
2703
+ if (els instanceof Array) {
2704
+ elements = [];
2705
+ try {
2706
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2707
+ try {
2708
+ for(var _iterator = els[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2709
+ el = _step.value;
2710
+ elements.push(this.getElement(el, name));
2711
+ }
2712
+ } catch (err) {
2713
+ _didIteratorError = true;
2714
+ _iteratorError = err;
2715
+ } finally{
2716
+ try {
2717
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
2718
+ _iterator.return();
2719
+ }
2720
+ } finally{
2721
+ if (_didIteratorError) {
2722
+ throw _iteratorError;
2723
+ }
2724
+ }
2725
+ }
2726
+ } catch (e) {
2727
+ elements = null;
2728
+ }
2729
+ } else if (typeof els === "string") {
2730
+ elements = [];
2731
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2732
+ try {
2733
+ for(var _iterator = document.querySelectorAll(els)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2734
+ el = _step.value;
2735
+ elements.push(el);
2736
+ }
2737
+ } catch (err) {
2738
+ _didIteratorError = true;
2739
+ _iteratorError = err;
2740
+ } finally{
2741
+ try {
2742
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
2743
+ _iterator.return();
2744
+ }
2745
+ } finally{
2746
+ if (_didIteratorError) {
2747
+ throw _iteratorError;
2748
+ }
2749
+ }
2750
+ }
2751
+ } else if (els.nodeType != null) elements = [
2752
+ els
2753
+ ];
2754
+ if (elements == null || !elements.length) throw new Error("Invalid `".concat(name, "` option provided. Please provide a CSS selector, a plain HTML element or a list of those."));
2755
+ return elements;
2756
+ };
2757
+ // Asks the user the question and calls accepted or rejected accordingly
2758
+ //
2759
+ // The default implementation just uses `window.confirm` and then calls the
2760
+ // appropriate callback.
2761
+ $a601ff30f483e917$export$2e2bcd8739ae039.confirm = function(question, accepted, rejected) {
2762
+ if (window.confirm(question)) return accepted();
2763
+ else if (rejected != null) return rejected();
2764
+ };
2765
+ // Validates the mime type like this:
2766
+ //
2767
+ // https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept
2768
+ $a601ff30f483e917$export$2e2bcd8739ae039.isValidFile = function(file, acceptedFiles) {
2769
+ if (!acceptedFiles) return true;
2770
+ // If there are no accepted mime types, it's OK
2771
+ acceptedFiles = acceptedFiles.split(",");
2772
+ var mimeType = file.type;
2773
+ var baseMimeType = mimeType.replace(/\/.*$/, "");
2774
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2775
+ try {
2776
+ for(var _iterator = acceptedFiles[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2777
+ var validType = _step.value;
2778
+ validType = validType.trim();
2779
+ if (validType.charAt(0) === ".") {
2780
+ if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) return true;
2781
+ } else if (/\/\*$/.test(validType)) {
2782
+ // This is something like a image/* mime type
2783
+ if (baseMimeType === validType.replace(/\/.*$/, "")) return true;
2784
+ } else {
2785
+ if (mimeType === validType) return true;
2786
+ }
2787
+ }
2788
+ } catch (err) {
2789
+ _didIteratorError = true;
2790
+ _iteratorError = err;
2791
+ } finally{
2792
+ try {
2793
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
2794
+ _iterator.return();
2795
+ }
2796
+ } finally{
2797
+ if (_didIteratorError) {
2798
+ throw _iteratorError;
2799
+ }
2800
+ }
2801
+ }
2802
+ return false;
2803
+ };
2804
+ // Augment jQuery
2805
+ if (typeof jQuery !== "undefined" && jQuery !== null) jQuery.fn.dropzone = function(options) {
2806
+ return this.each(function() {
2807
+ return new $a601ff30f483e917$export$2e2bcd8739ae039(this, options);
2808
+ });
2809
+ };
2810
+ // Dropzone file status codes
2811
+ $a601ff30f483e917$export$2e2bcd8739ae039.ADDED = "added";
2812
+ $a601ff30f483e917$export$2e2bcd8739ae039.QUEUED = "queued";
2813
+ // For backwards compatibility. Now, if a file is accepted, it's either queued
2814
+ // or uploading.
2815
+ $a601ff30f483e917$export$2e2bcd8739ae039.ACCEPTED = $a601ff30f483e917$export$2e2bcd8739ae039.QUEUED;
2816
+ $a601ff30f483e917$export$2e2bcd8739ae039.UPLOADING = "uploading";
2817
+ $a601ff30f483e917$export$2e2bcd8739ae039.PROCESSING = $a601ff30f483e917$export$2e2bcd8739ae039.UPLOADING; // alias
2818
+ $a601ff30f483e917$export$2e2bcd8739ae039.CANCELED = "canceled";
2819
+ $a601ff30f483e917$export$2e2bcd8739ae039.ERROR = "error";
2820
+ $a601ff30f483e917$export$2e2bcd8739ae039.SUCCESS = "success";
2821
+ /*
2822
+
2823
+ Bugfix for iOS 6 and 7
2824
+ Source: http://stackoverflow.com/questions/11929099/html5-canvas-drawimage-ratio-bug-ios
2825
+ based on the work of https://github.com/stomita/ios-imagefile-megapixel
2826
+
2827
+ */ // Detecting vertical squash in loaded image.
2828
+ // Fixes a bug which squash image vertically while drawing into canvas for some images.
2829
+ // This is a bug in iOS6 devices. This function from https://github.com/stomita/ios-imagefile-megapixel
2830
+ var $a601ff30f483e917$var$detectVerticalSquash = function $a601ff30f483e917$var$detectVerticalSquash(img) {
2831
+ var iw = img.naturalWidth;
2832
+ var ih = img.naturalHeight;
2833
+ var canvas = document.createElement("canvas");
2834
+ canvas.width = 1;
2835
+ canvas.height = ih;
2836
+ var ctx = canvas.getContext("2d");
2837
+ ctx.drawImage(img, 0, 0);
2838
+ var ref = ctx.getImageData(1, 0, 1, ih), data = ref.data;
2839
+ // search image edge pixel position in case it is squashed vertically.
2840
+ var sy = 0;
2841
+ var ey = ih;
2842
+ var py = ih;
2843
+ while(py > sy){
2844
+ var alpha = data[(py - 1) * 4 + 3];
2845
+ if (alpha === 0) ey = py;
2846
+ else sy = py;
2847
+ py = ey + sy >> 1;
2848
+ }
2849
+ var ratio = py / ih;
2850
+ if (ratio === 0) return 1;
2851
+ else return ratio;
2852
+ };
2853
+ // A replacement for context.drawImage
2854
+ // (args are for source and destination).
2855
+ var $a601ff30f483e917$var$drawImageIOSFix = function $a601ff30f483e917$var$drawImageIOSFix(ctx, img, sx, sy, sw, sh, dx, dy, dw, dh) {
2856
+ var vertSquashRatio = $a601ff30f483e917$var$detectVerticalSquash(img);
2857
+ return ctx.drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh / vertSquashRatio);
2858
+ };
2859
+ var $a601ff30f483e917$var$ExifRestore = // Based on MinifyJpeg
2860
+ // Source: http://www.perry.cz/files/ExifRestorer.js
2861
+ // http://elicon.blog57.fc2.com/blog-entry-206.html
2862
+ /*#__PURE__*/ function() {
2863
+ "use strict";
2864
+ function $a601ff30f483e917$var$ExifRestore() {
2865
+ $6mU8w$swchelpers.classCallCheck(this, $a601ff30f483e917$var$ExifRestore);
2866
+ }
2867
+ $6mU8w$swchelpers.createClass($a601ff30f483e917$var$ExifRestore, null, [
2868
+ {
2869
+ key: "initClass",
2870
+ value: function initClass() {
2871
+ this.KEY_STR = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
2872
+ }
2873
+ },
2874
+ {
2875
+ key: "encode64",
2876
+ value: function encode64(input) {
2877
+ var output = "";
2878
+ var chr1 = undefined;
2879
+ var chr2 = undefined;
2880
+ var chr3 = "";
2881
+ var enc1 = undefined;
2882
+ var enc2 = undefined;
2883
+ var enc3 = undefined;
2884
+ var enc4 = "";
2885
+ var i = 0;
2886
+ while(true){
2887
+ chr1 = input[i++];
2888
+ chr2 = input[i++];
2889
+ chr3 = input[i++];
2890
+ enc1 = chr1 >> 2;
2891
+ enc2 = (chr1 & 3) << 4 | chr2 >> 4;
2892
+ enc3 = (chr2 & 15) << 2 | chr3 >> 6;
2893
+ enc4 = chr3 & 63;
2894
+ if (isNaN(chr2)) enc3 = enc4 = 64;
2895
+ else if (isNaN(chr3)) enc4 = 64;
2896
+ output = output + this.KEY_STR.charAt(enc1) + this.KEY_STR.charAt(enc2) + this.KEY_STR.charAt(enc3) + this.KEY_STR.charAt(enc4);
2897
+ chr1 = chr2 = chr3 = "";
2898
+ enc1 = enc2 = enc3 = enc4 = "";
2899
+ if (!(i < input.length)) break;
2900
+ }
2901
+ return output;
2902
+ }
2903
+ },
2904
+ {
2905
+ key: "restore",
2906
+ value: function restore(origFileBase64, resizedFileBase64) {
2907
+ if (!origFileBase64.match("data:image/jpeg;base64,")) return resizedFileBase64;
2908
+ var rawImage = this.decode64(origFileBase64.replace("data:image/jpeg;base64,", ""));
2909
+ var segments = this.slice2Segments(rawImage);
2910
+ var image = this.exifManipulation(resizedFileBase64, segments);
2911
+ return "data:image/jpeg;base64,".concat(this.encode64(image));
2912
+ }
2913
+ },
2914
+ {
2915
+ key: "exifManipulation",
2916
+ value: function exifManipulation(resizedFileBase64, segments) {
2917
+ var exifArray = this.getExifArray(segments);
2918
+ var newImageArray = this.insertExif(resizedFileBase64, exifArray);
2919
+ var aBuffer = new Uint8Array(newImageArray);
2920
+ return aBuffer;
2921
+ }
2922
+ },
2923
+ {
2924
+ key: "getExifArray",
2925
+ value: function getExifArray(segments) {
2926
+ var seg = undefined;
2927
+ var x = 0;
2928
+ while(x < segments.length){
2929
+ seg = segments[x];
2930
+ if (seg[0] === 255 & seg[1] === 225) return seg;
2931
+ x++;
2932
+ }
2933
+ return [];
2934
+ }
2935
+ },
2936
+ {
2937
+ key: "insertExif",
2938
+ value: function insertExif(resizedFileBase64, exifArray) {
2939
+ var imageData = resizedFileBase64.replace("data:image/jpeg;base64,", "");
2940
+ var buf = this.decode64(imageData);
2941
+ var separatePoint = buf.indexOf(255, 3);
2942
+ var mae = buf.slice(0, separatePoint);
2943
+ var ato = buf.slice(separatePoint);
2944
+ var array = mae;
2945
+ array = array.concat(exifArray);
2946
+ array = array.concat(ato);
2947
+ return array;
2948
+ }
2949
+ },
2950
+ {
2951
+ key: "slice2Segments",
2952
+ value: function slice2Segments(rawImageArray) {
2953
+ var head = 0;
2954
+ var segments = [];
2955
+ while(true){
2956
+ var length;
2957
+ if (rawImageArray[head] === 255 & rawImageArray[head + 1] === 218) break;
2958
+ if (rawImageArray[head] === 255 & rawImageArray[head + 1] === 216) head += 2;
2959
+ else {
2960
+ length = rawImageArray[head + 2] * 256 + rawImageArray[head + 3];
2961
+ var endPoint = head + length + 2;
2962
+ var seg = rawImageArray.slice(head, endPoint);
2963
+ segments.push(seg);
2964
+ head = endPoint;
2965
+ }
2966
+ if (head > rawImageArray.length) break;
2967
+ }
2968
+ return segments;
2969
+ }
2970
+ },
2971
+ {
2972
+ key: "decode64",
2973
+ value: function decode64(input) {
2974
+ var output = "";
2975
+ var chr1 = undefined;
2976
+ var chr2 = undefined;
2977
+ var chr3 = "";
2978
+ var enc1 = undefined;
2979
+ var enc2 = undefined;
2980
+ var enc3 = undefined;
2981
+ var enc4 = "";
2982
+ var i = 0;
2983
+ var buf = [];
2984
+ // remove all characters that are not A-Z, a-z, 0-9, +, /, or =
2985
+ var base64test = /[^A-Za-z0-9\+\/\=]/g;
2986
+ if (base64test.exec(input)) console.warn("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding.");
2987
+ input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
2988
+ while(true){
2989
+ enc1 = this.KEY_STR.indexOf(input.charAt(i++));
2990
+ enc2 = this.KEY_STR.indexOf(input.charAt(i++));
2991
+ enc3 = this.KEY_STR.indexOf(input.charAt(i++));
2992
+ enc4 = this.KEY_STR.indexOf(input.charAt(i++));
2993
+ chr1 = enc1 << 2 | enc2 >> 4;
2994
+ chr2 = (enc2 & 15) << 4 | enc3 >> 2;
2995
+ chr3 = (enc3 & 3) << 6 | enc4;
2996
+ buf.push(chr1);
2997
+ if (enc3 !== 64) buf.push(chr2);
2998
+ if (enc4 !== 64) buf.push(chr3);
2999
+ chr1 = chr2 = chr3 = "";
3000
+ enc1 = enc2 = enc3 = enc4 = "";
3001
+ if (!(i < input.length)) break;
3002
+ }
3003
+ return buf;
3004
+ }
3005
+ }
3006
+ ]);
3007
+ return $a601ff30f483e917$var$ExifRestore;
3008
+ }();
3009
+ $a601ff30f483e917$var$ExifRestore.initClass();
3010
+ /*
3011
+ * contentloaded.js
3012
+ *
3013
+ * Author: Diego Perini (diego.perini at gmail.com)
3014
+ * Summary: cross-browser wrapper for DOMContentLoaded
3015
+ * Updated: 20101020
3016
+ * License: MIT
3017
+ * Version: 1.2
3018
+ *
3019
+ * URL:
3020
+ * http://javascript.nwbox.com/ContentLoaded/
3021
+ * http://javascript.nwbox.com/ContentLoaded/MIT-LICENSE
3022
+ */ // @win window reference
3023
+ // @fn function reference
3024
+ var $a601ff30f483e917$var$contentLoaded = function $a601ff30f483e917$var$contentLoaded(win, fn) {
3025
+ var done = false;
3026
+ var top = true;
3027
+ var doc = win.document;
3028
+ var root = doc.documentElement;
3029
+ var add = doc.addEventListener ? "addEventListener" : "attachEvent";
3030
+ var rem = doc.addEventListener ? "removeEventListener" : "detachEvent";
3031
+ var pre = doc.addEventListener ? "" : "on";
3032
+ var init = function(e) {
3033
+ if (e.type === "readystatechange" && doc.readyState !== "complete") return;
3034
+ (e.type === "load" ? win : doc)[rem](pre + e.type, init, false);
3035
+ if (!done && (done = true)) return fn.call(win, e.type || e);
3036
+ };
3037
+ var poll = function() {
3038
+ try {
3039
+ root.doScroll("left");
3040
+ } catch (e) {
3041
+ setTimeout(poll, 50);
3042
+ return;
3043
+ }
3044
+ return init("poll");
3045
+ };
3046
+ if (doc.readyState !== "complete") {
3047
+ if (doc.createEventObject && root.doScroll) {
3048
+ try {
3049
+ top = !win.frameElement;
3050
+ } catch (error) {
3051
+ }
3052
+ if (top) poll();
3053
+ }
3054
+ doc[add](pre + "DOMContentLoaded", init, false);
3055
+ doc[add](pre + "readystatechange", init, false);
3056
+ return win[add](pre + "load", init, false);
3057
+ }
3058
+ };
3059
+ function $a601ff30f483e917$var$__guard__(value, transform) {
3060
+ return typeof value !== "undefined" && value !== null ? transform(value) : undefined;
3061
+ }
3062
+ function $a601ff30f483e917$var$__guardMethod__(obj, methodName, transform) {
3063
+ if (typeof obj !== "undefined" && obj !== null && typeof obj[methodName] === "function") return transform(obj, methodName);
3064
+ else return undefined;
3065
+ }
3066
+
3067
+
3068
+ //# sourceMappingURL=dropzone.js.map