@tabler/core 1.0.0-beta20 → 1.0.0-beta21

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 (378) hide show
  1. package/README.md +7 -6
  2. package/dist/css/demo.css +8 -8
  3. package/dist/css/demo.min.css +5 -5
  4. package/dist/css/demo.rtl.css +8 -8
  5. package/dist/css/demo.rtl.min.css +5 -5
  6. package/dist/css/tabler-flags.css +10 -10
  7. package/dist/css/tabler-flags.min.css +5 -5
  8. package/dist/css/tabler-flags.rtl.css +10 -10
  9. package/dist/css/tabler-flags.rtl.min.css +5 -5
  10. package/dist/css/tabler-payments.css +4 -4
  11. package/dist/css/tabler-payments.min.css +4 -4
  12. package/dist/css/tabler-payments.rtl.css +4 -4
  13. package/dist/css/tabler-payments.rtl.min.css +4 -4
  14. package/dist/css/tabler-social.css +4 -4
  15. package/dist/css/tabler-social.min.css +4 -4
  16. package/dist/css/tabler-social.rtl.css +4 -4
  17. package/dist/css/tabler-social.rtl.min.css +4 -4
  18. package/dist/css/tabler-vendors.css +246 -253
  19. package/dist/css/tabler-vendors.min.css +5 -5
  20. package/dist/css/tabler-vendors.rtl.css +246 -253
  21. package/dist/css/tabler-vendors.rtl.min.css +5 -5
  22. package/dist/css/tabler.css +643 -426
  23. package/dist/css/tabler.min.css +8 -8
  24. package/dist/css/tabler.rtl.css +667 -441
  25. package/dist/css/tabler.rtl.min.css +8 -8
  26. package/dist/js/demo-theme.js +4 -4
  27. package/dist/js/demo-theme.min.js +4 -4
  28. package/dist/js/demo.js +41 -42
  29. package/dist/js/demo.min.js +5 -5
  30. package/dist/js/tabler.esm.js +1949 -1248
  31. package/dist/js/tabler.esm.min.js +8 -8
  32. package/dist/js/tabler.js +1949 -1248
  33. package/dist/js/tabler.min.js +8 -8
  34. package/dist/libs/apexcharts/dist/apexcharts.amd.js +1 -1
  35. package/dist/libs/apexcharts/dist/apexcharts.common.js +5 -5
  36. package/dist/libs/apexcharts/dist/apexcharts.css +166 -65
  37. package/dist/libs/apexcharts/dist/apexcharts.esm.js +5 -5
  38. package/dist/libs/apexcharts/dist/apexcharts.js +7964 -8527
  39. package/dist/libs/apexcharts/dist/apexcharts.min.js +5 -5
  40. package/dist/libs/apexcharts/dist/locales/be-cyrl.json +55 -0
  41. package/dist/libs/apexcharts/dist/locales/be-latn.json +55 -0
  42. package/dist/libs/apexcharts/dist/locales/da.json +55 -0
  43. package/dist/libs/apexcharts/dist/locales/ms.json +63 -0
  44. package/dist/libs/apexcharts/dist/locales/pt.json +3 -3
  45. package/dist/libs/apexcharts/dist/locales/vi.json +63 -0
  46. package/dist/libs/apexcharts/dist/locales/zh-tw.json +1 -1
  47. package/dist/libs/bootstrap/dist/js/bootstrap.bundle.js +8 -8
  48. package/dist/libs/bootstrap/dist/js/bootstrap.bundle.js.map +1 -1
  49. package/dist/libs/bootstrap/dist/js/bootstrap.bundle.min.js +3 -3
  50. package/dist/libs/bootstrap/dist/js/bootstrap.bundle.min.js.map +1 -1
  51. package/dist/libs/bootstrap/dist/js/bootstrap.esm.js +8 -8
  52. package/dist/libs/bootstrap/dist/js/bootstrap.esm.js.map +1 -1
  53. package/dist/libs/bootstrap/dist/js/bootstrap.esm.min.js +3 -3
  54. package/dist/libs/bootstrap/dist/js/bootstrap.esm.min.js.map +1 -1
  55. package/dist/libs/bootstrap/dist/js/bootstrap.js +8 -8
  56. package/dist/libs/bootstrap/dist/js/bootstrap.js.map +1 -1
  57. package/dist/libs/bootstrap/dist/js/bootstrap.min.js +3 -3
  58. package/dist/libs/bootstrap/dist/js/bootstrap.min.js.map +1 -1
  59. package/dist/libs/countup.js/dist/countUp.d.ts +1 -0
  60. package/dist/libs/countup.js/dist/countUp.js +4 -1
  61. package/dist/libs/countup.js/dist/countUp.min.js +1 -1
  62. package/dist/libs/countup.js/dist/countUp.umd.js +1 -1
  63. package/dist/libs/jsvectormap/dist/jsvectormap.cjs +2279 -0
  64. package/dist/libs/jsvectormap/dist/jsvectormap.css +121 -0
  65. package/dist/libs/jsvectormap/dist/jsvectormap.esm.js +2277 -0
  66. package/dist/libs/jsvectormap/dist/jsvectormap.js +2285 -0
  67. package/dist/libs/jsvectormap/dist/jsvectormap.min.css +1 -0
  68. package/dist/libs/jsvectormap/dist/jsvectormap.min.js +1 -0
  69. package/dist/libs/jsvectormap/dist/maps/world-merc.js +1 -1
  70. package/dist/libs/jsvectormap/dist/maps/world.js +1 -1
  71. package/dist/libs/nouislider/dist/nouislider.d.ts +8 -10
  72. package/dist/libs/nouislider/dist/nouislider.js +64 -5
  73. package/dist/libs/nouislider/dist/nouislider.min.js +1 -1
  74. package/dist/libs/nouislider/dist/nouislider.min.mjs +1 -1
  75. package/dist/libs/nouislider/dist/nouislider.mjs +64 -5
  76. package/dist/libs/star-rating.js/dist/star-rating.cjs.js +5 -2
  77. package/dist/libs/star-rating.js/dist/star-rating.css +23 -20
  78. package/dist/libs/star-rating.js/dist/star-rating.esm.js +5 -2
  79. package/dist/libs/star-rating.js/dist/star-rating.js +5 -9
  80. package/dist/libs/star-rating.js/dist/star-rating.min.css +1 -8
  81. package/dist/libs/star-rating.js/dist/star-rating.min.js +1 -8
  82. package/dist/libs/tinymce/CHANGELOG.md +471 -12
  83. package/dist/libs/tinymce/README.md +16 -10
  84. package/dist/libs/tinymce/bower.json +1 -1
  85. package/dist/libs/tinymce/composer.json +2 -2
  86. package/dist/libs/tinymce/icons/default/icons.js +13 -2
  87. package/dist/libs/tinymce/icons/default/icons.min.js +1 -1
  88. package/dist/libs/tinymce/license.md +6 -0
  89. package/dist/libs/tinymce/models/dom/model.js +237 -213
  90. package/dist/libs/tinymce/models/dom/model.min.js +2 -2
  91. package/dist/libs/tinymce/package.json +2 -2
  92. package/dist/libs/tinymce/plugins/accordion/index.js +7 -0
  93. package/dist/libs/tinymce/plugins/accordion/plugin.js +1055 -0
  94. package/dist/libs/tinymce/plugins/accordion/plugin.min.js +4 -0
  95. package/dist/libs/tinymce/plugins/advlist/plugin.js +4 -4
  96. package/dist/libs/tinymce/plugins/advlist/plugin.min.js +2 -2
  97. package/dist/libs/tinymce/plugins/anchor/plugin.js +21 -3
  98. package/dist/libs/tinymce/plugins/anchor/plugin.min.js +2 -2
  99. package/dist/libs/tinymce/plugins/autolink/plugin.js +1 -1
  100. package/dist/libs/tinymce/plugins/autolink/plugin.min.js +2 -2
  101. package/dist/libs/tinymce/plugins/autoresize/plugin.js +20 -33
  102. package/dist/libs/tinymce/plugins/autoresize/plugin.min.js +2 -2
  103. package/dist/libs/tinymce/plugins/autosave/plugin.js +1 -1
  104. package/dist/libs/tinymce/plugins/autosave/plugin.min.js +1 -1
  105. package/dist/libs/tinymce/plugins/charmap/plugin.js +15 -3
  106. package/dist/libs/tinymce/plugins/charmap/plugin.min.js +2 -2
  107. package/dist/libs/tinymce/plugins/code/plugin.js +1 -1
  108. package/dist/libs/tinymce/plugins/code/plugin.min.js +1 -1
  109. package/dist/libs/tinymce/plugins/codesample/plugin.js +27 -13
  110. package/dist/libs/tinymce/plugins/codesample/plugin.min.js +2 -2
  111. package/dist/libs/tinymce/plugins/directionality/plugin.js +33 -27
  112. package/dist/libs/tinymce/plugins/directionality/plugin.min.js +2 -2
  113. package/dist/libs/tinymce/plugins/emoticons/plugin.js +17 -4
  114. package/dist/libs/tinymce/plugins/emoticons/plugin.min.js +2 -2
  115. package/dist/libs/tinymce/plugins/fullscreen/plugin.js +168 -105
  116. package/dist/libs/tinymce/plugins/fullscreen/plugin.min.js +2 -2
  117. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/ar.js +93 -0
  118. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/bg_BG.js +93 -0
  119. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/ca.js +93 -0
  120. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/cs.js +93 -0
  121. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/da.js +93 -0
  122. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/de.js +93 -0
  123. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/el.js +93 -0
  124. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/en.js +93 -0
  125. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/es.js +93 -0
  126. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/eu.js +93 -0
  127. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/fa.js +93 -0
  128. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/fi.js +93 -0
  129. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/fr_FR.js +93 -0
  130. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/he_IL.js +93 -0
  131. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/hi.js +93 -0
  132. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/hr.js +93 -0
  133. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/hu_HU.js +93 -0
  134. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/id.js +93 -0
  135. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/it.js +93 -0
  136. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/ja.js +93 -0
  137. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/kk.js +93 -0
  138. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/ko_KR.js +93 -0
  139. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/ms.js +93 -0
  140. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/nb_NO.js +93 -0
  141. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/nl.js +93 -0
  142. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/pl.js +93 -0
  143. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/pt_BR.js +93 -0
  144. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/pt_PT.js +93 -0
  145. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/ro.js +93 -0
  146. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/ru.js +93 -0
  147. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/sk.js +93 -0
  148. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/sl_SI.js +93 -0
  149. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/sv_SE.js +93 -0
  150. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/th_TH.js +93 -0
  151. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/tr.js +93 -0
  152. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/uk.js +93 -0
  153. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/vi.js +93 -0
  154. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/zh_CN.js +87 -0
  155. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/zh_TW.js +93 -0
  156. package/dist/libs/tinymce/plugins/help/plugin.js +115 -135
  157. package/dist/libs/tinymce/plugins/help/plugin.min.js +2 -2
  158. package/dist/libs/tinymce/plugins/image/plugin.js +23 -5
  159. package/dist/libs/tinymce/plugins/image/plugin.min.js +2 -2
  160. package/dist/libs/tinymce/plugins/importcss/plugin.js +4 -3
  161. package/dist/libs/tinymce/plugins/importcss/plugin.min.js +2 -2
  162. package/dist/libs/tinymce/plugins/insertdatetime/plugin.js +15 -3
  163. package/dist/libs/tinymce/plugins/insertdatetime/plugin.min.js +2 -2
  164. package/dist/libs/tinymce/plugins/link/plugin.js +193 -114
  165. package/dist/libs/tinymce/plugins/link/plugin.min.js +2 -2
  166. package/dist/libs/tinymce/plugins/lists/plugin.js +290 -66
  167. package/dist/libs/tinymce/plugins/lists/plugin.min.js +2 -2
  168. package/dist/libs/tinymce/plugins/media/plugin.js +80 -33
  169. package/dist/libs/tinymce/plugins/media/plugin.min.js +2 -2
  170. package/dist/libs/tinymce/plugins/nonbreaking/plugin.js +15 -3
  171. package/dist/libs/tinymce/plugins/nonbreaking/plugin.min.js +2 -2
  172. package/dist/libs/tinymce/plugins/pagebreak/plugin.js +15 -3
  173. package/dist/libs/tinymce/plugins/pagebreak/plugin.min.js +2 -2
  174. package/dist/libs/tinymce/plugins/preview/plugin.js +1 -1
  175. package/dist/libs/tinymce/plugins/preview/plugin.min.js +1 -1
  176. package/dist/libs/tinymce/plugins/quickbars/plugin.js +19 -7
  177. package/dist/libs/tinymce/plugins/quickbars/plugin.min.js +2 -2
  178. package/dist/libs/tinymce/plugins/save/plugin.js +3 -2
  179. package/dist/libs/tinymce/plugins/save/plugin.min.js +2 -2
  180. package/dist/libs/tinymce/plugins/searchreplace/plugin.js +42 -36
  181. package/dist/libs/tinymce/plugins/searchreplace/plugin.min.js +2 -2
  182. package/dist/libs/tinymce/plugins/table/plugin.js +121 -76
  183. package/dist/libs/tinymce/plugins/table/plugin.min.js +2 -2
  184. package/dist/libs/tinymce/plugins/visualblocks/plugin.js +1 -1
  185. package/dist/libs/tinymce/plugins/visualblocks/plugin.min.js +1 -1
  186. package/dist/libs/tinymce/plugins/visualchars/plugin.js +1 -1
  187. package/dist/libs/tinymce/plugins/visualchars/plugin.min.js +1 -1
  188. package/dist/libs/tinymce/plugins/wordcount/plugin.js +27 -19
  189. package/dist/libs/tinymce/plugins/wordcount/plugin.min.js +2 -2
  190. package/dist/libs/tinymce/skins/content/dark/content.js +1 -0
  191. package/dist/libs/tinymce/skins/content/default/content.js +1 -0
  192. package/dist/libs/tinymce/skins/content/document/content.js +1 -0
  193. package/dist/libs/tinymce/skins/content/tinymce-5/content.js +1 -0
  194. package/dist/libs/tinymce/skins/content/tinymce-5-dark/content.js +1 -0
  195. package/dist/libs/tinymce/skins/content/writer/content.js +1 -0
  196. package/dist/libs/tinymce/skins/ui/oxide/content.css +32 -29
  197. package/dist/libs/tinymce/skins/ui/oxide/content.inline.css +32 -29
  198. package/dist/libs/tinymce/skins/ui/oxide/content.inline.js +1 -0
  199. package/dist/libs/tinymce/skins/ui/oxide/content.inline.min.css +1 -1
  200. package/dist/libs/tinymce/skins/ui/oxide/content.js +1 -0
  201. package/dist/libs/tinymce/skins/ui/oxide/content.min.css +1 -1
  202. package/dist/libs/tinymce/skins/ui/oxide/skin.css +1003 -105
  203. package/dist/libs/tinymce/skins/ui/oxide/skin.js +1 -0
  204. package/dist/libs/tinymce/skins/ui/oxide/skin.min.css +1 -1
  205. package/dist/libs/tinymce/skins/ui/oxide/skin.shadowdom.js +1 -0
  206. package/dist/libs/tinymce/skins/ui/oxide-dark/content.css +32 -22
  207. package/dist/libs/tinymce/skins/ui/oxide-dark/content.inline.css +32 -29
  208. package/dist/libs/tinymce/skins/ui/oxide-dark/content.inline.js +1 -0
  209. package/dist/libs/tinymce/skins/ui/oxide-dark/content.inline.min.css +1 -1
  210. package/dist/libs/tinymce/skins/ui/oxide-dark/content.js +1 -0
  211. package/dist/libs/tinymce/skins/ui/oxide-dark/content.min.css +1 -1
  212. package/dist/libs/tinymce/skins/ui/oxide-dark/skin.css +1008 -110
  213. package/dist/libs/tinymce/skins/ui/oxide-dark/skin.js +1 -0
  214. package/dist/libs/tinymce/skins/ui/oxide-dark/skin.min.css +1 -1
  215. package/dist/libs/tinymce/skins/ui/oxide-dark/skin.shadowdom.js +1 -0
  216. package/dist/libs/tinymce/skins/ui/tinymce-5/content.css +32 -29
  217. package/dist/libs/tinymce/skins/ui/tinymce-5/content.inline.css +32 -29
  218. package/dist/libs/tinymce/skins/ui/tinymce-5/content.inline.js +1 -0
  219. package/dist/libs/tinymce/skins/ui/tinymce-5/content.inline.min.css +1 -1
  220. package/dist/libs/tinymce/skins/ui/tinymce-5/content.js +1 -0
  221. package/dist/libs/tinymce/skins/ui/tinymce-5/content.min.css +1 -1
  222. package/dist/libs/tinymce/skins/ui/tinymce-5/skin.css +1003 -86
  223. package/dist/libs/tinymce/skins/ui/tinymce-5/skin.js +1 -0
  224. package/dist/libs/tinymce/skins/ui/tinymce-5/skin.min.css +1 -1
  225. package/dist/libs/tinymce/skins/ui/tinymce-5/skin.shadowdom.js +1 -0
  226. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.css +32 -22
  227. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.inline.css +32 -29
  228. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.inline.js +1 -0
  229. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +1 -1
  230. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.js +1 -0
  231. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.min.css +1 -1
  232. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.css +1009 -92
  233. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.js +1 -0
  234. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.min.css +1 -1
  235. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.js +1 -0
  236. package/dist/libs/tinymce/themes/silver/theme.js +26361 -24936
  237. package/dist/libs/tinymce/themes/silver/theme.min.js +2 -2
  238. package/dist/libs/tinymce/tinymce.d.ts +205 -136
  239. package/dist/libs/tinymce/tinymce.js +4400 -2838
  240. package/dist/libs/tinymce/tinymce.min.js +2 -2
  241. package/dist/libs/tom-select/dist/js/plugins/caret_position.js +11 -16
  242. package/dist/libs/tom-select/dist/js/plugins/caret_position.js.map +1 -1
  243. package/dist/libs/tom-select/dist/js/plugins/change_listener.js +3 -2
  244. package/dist/libs/tom-select/dist/js/plugins/change_listener.js.map +1 -1
  245. package/dist/libs/tom-select/dist/js/plugins/checkbox_options.js +47 -34
  246. package/dist/libs/tom-select/dist/js/plugins/checkbox_options.js.map +1 -1
  247. package/dist/libs/tom-select/dist/js/plugins/clear_button.js +3 -13
  248. package/dist/libs/tom-select/dist/js/plugins/clear_button.js.map +1 -1
  249. package/dist/libs/tom-select/dist/js/plugins/drag_drop.js +249 -29
  250. package/dist/libs/tom-select/dist/js/plugins/drag_drop.js.map +1 -1
  251. package/dist/libs/tom-select/dist/js/plugins/dropdown_header.js +3 -11
  252. package/dist/libs/tom-select/dist/js/plugins/dropdown_header.js.map +1 -1
  253. package/dist/libs/tom-select/dist/js/plugins/dropdown_input.js +15 -24
  254. package/dist/libs/tom-select/dist/js/plugins/dropdown_input.js.map +1 -1
  255. package/dist/libs/tom-select/dist/js/plugins/input_autogrow.js +4 -6
  256. package/dist/libs/tom-select/dist/js/plugins/input_autogrow.js.map +1 -1
  257. package/dist/libs/tom-select/dist/js/plugins/no_active_items.js +2 -1
  258. package/dist/libs/tom-select/dist/js/plugins/no_active_items.js.map +1 -1
  259. package/dist/libs/tom-select/dist/js/plugins/no_backspace_delete.js +2 -2
  260. package/dist/libs/tom-select/dist/js/plugins/no_backspace_delete.js.map +1 -1
  261. package/dist/libs/tom-select/dist/js/plugins/optgroup_columns.js +3 -15
  262. package/dist/libs/tom-select/dist/js/plugins/optgroup_columns.js.map +1 -1
  263. package/dist/libs/tom-select/dist/js/plugins/remove_button.js +11 -15
  264. package/dist/libs/tom-select/dist/js/plugins/remove_button.js.map +1 -1
  265. package/dist/libs/tom-select/dist/js/plugins/restore_on_backspace.js +2 -3
  266. package/dist/libs/tom-select/dist/js/plugins/restore_on_backspace.js.map +1 -1
  267. package/dist/libs/tom-select/dist/js/plugins/virtual_scroll.js +41 -50
  268. package/dist/libs/tom-select/dist/js/plugins/virtual_scroll.js.map +1 -1
  269. package/dist/libs/tom-select/dist/js/tom-select.base.js +411 -685
  270. package/dist/libs/tom-select/dist/js/tom-select.base.js.map +1 -1
  271. package/dist/libs/tom-select/dist/js/tom-select.base.min.js +87 -78
  272. package/dist/libs/tom-select/dist/js/tom-select.base.min.js.map +1 -1
  273. package/dist/libs/tom-select/dist/js/tom-select.complete.js +614 -820
  274. package/dist/libs/tom-select/dist/js/tom-select.complete.js.map +1 -1
  275. package/dist/libs/tom-select/dist/js/tom-select.complete.min.js +195 -176
  276. package/dist/libs/tom-select/dist/js/tom-select.complete.min.js.map +1 -1
  277. package/dist/libs/tom-select/dist/js/tom-select.popular.js +436 -705
  278. package/dist/libs/tom-select/dist/js/tom-select.popular.js.map +1 -1
  279. package/dist/libs/tom-select/dist/js/tom-select.popular.min.js +87 -78
  280. package/dist/libs/tom-select/dist/js/tom-select.popular.min.js.map +1 -1
  281. package/docs/base/colors.mdx +25 -0
  282. package/docs/base/typography.mdx +296 -0
  283. package/docs/components/alerts.mdx +430 -0
  284. package/docs/components/autosize.mdx +16 -0
  285. package/docs/components/avatars.mdx +172 -0
  286. package/docs/components/badges.mdx +127 -0
  287. package/docs/components/breadcrumb.mdx +107 -0
  288. package/docs/components/buttons.mdx +863 -0
  289. package/docs/components/cards.mdx +343 -0
  290. package/docs/components/carousel.mdx +235 -0
  291. package/docs/components/charts.mdx +526 -0
  292. package/docs/components/countup.mdx +136 -0
  293. package/docs/components/datagrid.mdx +90 -0
  294. package/docs/components/divider.mdx +63 -0
  295. package/docs/components/dropdowns.mdx +245 -0
  296. package/docs/components/dropzone.mdx +63 -0
  297. package/docs/components/empty.mdx +103 -0
  298. package/docs/components/icons.mdx +120 -0
  299. package/docs/components/inline-player.mdx +31 -0
  300. package/docs/components/modals.mdx +222 -0
  301. package/docs/components/placeholder.mdx +270 -0
  302. package/docs/components/popover.mdx +55 -0
  303. package/docs/components/progress.mdx +92 -0
  304. package/docs/components/progressbg.mdx +16 -0
  305. package/docs/components/range-slider.mdx +17 -0
  306. package/docs/components/ribbons.mdx +151 -0
  307. package/docs/components/spinners.mdx +119 -0
  308. package/docs/components/statuses.mdx +285 -0
  309. package/docs/components/steps.mdx +111 -0
  310. package/docs/components/switch-icon.mdx +155 -0
  311. package/docs/components/tables.mdx +410 -0
  312. package/docs/components/tabs.mdx +243 -0
  313. package/docs/components/timelines.mdx +506 -0
  314. package/docs/components/tinymce.mdx +44 -0
  315. package/docs/components/toasts.mdx +73 -0
  316. package/docs/components/tooltips.mdx +34 -0
  317. package/docs/components/tracking.mdx +162 -0
  318. package/docs/forms/form-color-check.mdx +179 -0
  319. package/docs/forms/form-elements.mdx +498 -0
  320. package/docs/forms/form-fieldset.mdx +44 -0
  321. package/docs/forms/form-helpers.mdx +12 -0
  322. package/docs/forms/form-image-check.mdx +162 -0
  323. package/docs/forms/form-input-mask.mdx +18 -0
  324. package/docs/forms/form-selectboxes.mdx +205 -0
  325. package/docs/forms/form-validation.mdx +25 -0
  326. package/docs/getting-started/browser-support.mdx +20 -0
  327. package/docs/getting-started/customize.mdx +24 -0
  328. package/docs/getting-started/download.mdx +42 -0
  329. package/docs/getting-started/faq.mdx +28 -0
  330. package/docs/getting-started/index.mdx +40 -0
  331. package/docs/icons/eps.mdx +13 -0
  332. package/docs/icons/figma.mdx +7 -0
  333. package/docs/icons/index.mdx +103 -0
  334. package/docs/icons/pdf.mdx +13 -0
  335. package/docs/icons/png.mdx +19 -0
  336. package/docs/icons/preact.mdx +40 -0
  337. package/docs/icons/react.mdx +40 -0
  338. package/docs/icons/solidjs.mdx +39 -0
  339. package/docs/icons/svelte.mdx +40 -0
  340. package/docs/icons/svg.mdx +74 -0
  341. package/docs/icons/vue.mdx +45 -0
  342. package/docs/icons/webfont.mdx +52 -0
  343. package/docs/layout/page-headers.mdx +226 -0
  344. package/docs/layout/page-layouts.mdx +204 -0
  345. package/docs/menu.json +317 -0
  346. package/docs/plugins/flags.mdx +52 -0
  347. package/docs/plugins/payments.mdx +43 -0
  348. package/docs/utilities/borders.mdx +114 -0
  349. package/docs/utilities/cursors.mdx +92 -0
  350. package/docs/utilities/interactions.mdx +23 -0
  351. package/package.json +37 -37
  352. package/src/js/src/toast.js +9 -1
  353. package/src/scss/_variables-dark.scss +3 -3
  354. package/src/scss/_variables.scss +38 -33
  355. package/src/scss/layout/_dark.scss +10 -2
  356. package/src/scss/layout/_navbar.scss +22 -13
  357. package/src/scss/layout/_page.scss +4 -4
  358. package/src/scss/layout/_root.scss +1 -1
  359. package/src/scss/mixins/_mixins.scss +4 -4
  360. package/src/scss/ui/_alerts.scss +2 -2
  361. package/src/scss/ui/_buttons.scss +4 -4
  362. package/src/scss/ui/_dropdowns.scss +1 -0
  363. package/src/scss/ui/_empty.scss +0 -5
  364. package/src/scss/ui/_flags.scss +2 -2
  365. package/src/scss/ui/_forms.scss +5 -4
  366. package/src/scss/ui/_modals.scss +3 -3
  367. package/src/scss/ui/_ribbons.scss +1 -0
  368. package/src/scss/ui/_toasts.scss +0 -1
  369. package/src/scss/ui/_type.scss +4 -2
  370. package/src/scss/vendor/_apexcharts.scss +2 -2
  371. package/src/scss/vendor/_jsvectormap.scss +1 -1
  372. package/src/scss/vendor/_litepicker.scss +1 -1
  373. package/dist/libs/jsvectormap/dist/js/jsvectormap.js +0 -2318
  374. package/dist/libs/jsvectormap/dist/js/jsvectormap.min.js +0 -1
  375. package/dist/libs/tinymce/license.txt +0 -21
  376. package/dist/libs/tinymce/plugins/template/index.js +0 -7
  377. package/dist/libs/tinymce/plugins/template/plugin.js +0 -554
  378. package/dist/libs/tinymce/plugins/template/plugin.min.js +0 -4
@@ -0,0 +1,2279 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * By https://github.com/TehShrike/deepmerge
5
+ */
6
+
7
+ var isMergeableObject = function isMergeableObject(value) {
8
+ return isNonNullObject(value) && !isSpecial(value);
9
+ };
10
+ function isNonNullObject(value) {
11
+ return !!value && typeof value === 'object';
12
+ }
13
+ function isSpecial(value) {
14
+ var stringValue = Object.prototype.toString.call(value);
15
+ return stringValue === '[object RegExp]' || stringValue === '[object Date]' || isNode(value) || isReactElement(value);
16
+ }
17
+
18
+ // see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
19
+ var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
20
+ var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;
21
+ function isReactElement(value) {
22
+ return value.$$typeof === REACT_ELEMENT_TYPE;
23
+ }
24
+ function isNode(value) {
25
+ return value instanceof Node;
26
+ }
27
+ function emptyTarget(val) {
28
+ return Array.isArray(val) ? [] : {};
29
+ }
30
+ function cloneUnlessOtherwiseSpecified(value, options) {
31
+ return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
32
+ }
33
+ function defaultArrayMerge(target, source, options) {
34
+ return target.concat(source).map(function (element) {
35
+ return cloneUnlessOtherwiseSpecified(element, options);
36
+ });
37
+ }
38
+ function getMergeFunction(key, options) {
39
+ if (!options.customMerge) {
40
+ return deepmerge;
41
+ }
42
+ var customMerge = options.customMerge(key);
43
+ return typeof customMerge === 'function' ? customMerge : deepmerge;
44
+ }
45
+ function getEnumerableOwnPropertySymbols(target) {
46
+ return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function (symbol) {
47
+ return target.propertyIsEnumerable(symbol);
48
+ }) : [];
49
+ }
50
+ function getKeys(target) {
51
+ return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
52
+ }
53
+ function propertyIsOnObject(object, property) {
54
+ try {
55
+ return property in object;
56
+ } catch (_) {
57
+ return false;
58
+ }
59
+ }
60
+
61
+ // Protects from prototype poisoning and unexpected merging up the prototype chain.
62
+ function propertyIsUnsafe(target, key) {
63
+ return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
64
+ && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
65
+ && Object.propertyIsEnumerable.call(target, key)); // and also unsafe if they're nonenumerable.
66
+ }
67
+ function mergeObject(target, source, options) {
68
+ var destination = {};
69
+ if (options.isMergeableObject(target)) {
70
+ getKeys(target).forEach(function (key) {
71
+ destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
72
+ });
73
+ }
74
+ getKeys(source).forEach(function (key) {
75
+ if (propertyIsUnsafe(target, key)) {
76
+ return;
77
+ }
78
+ if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
79
+ destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
80
+ } else {
81
+ destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
82
+ }
83
+ });
84
+ return destination;
85
+ }
86
+ var deepmerge = function deepmerge(target, source, options) {
87
+ options = options || {};
88
+ options.arrayMerge = options.arrayMerge || defaultArrayMerge;
89
+ options.isMergeableObject = options.isMergeableObject || isMergeableObject;
90
+ // cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
91
+ // implementations can use it. The caller may not replace it.
92
+ options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
93
+ var sourceIsArray = Array.isArray(source);
94
+ var targetIsArray = Array.isArray(target);
95
+ var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
96
+ if (!sourceAndTargetTypesMatch) {
97
+ return cloneUnlessOtherwiseSpecified(source, options);
98
+ } else if (sourceIsArray) {
99
+ return options.arrayMerge(target, source, options);
100
+ } else {
101
+ return mergeObject(target, source, options);
102
+ }
103
+ };
104
+
105
+ /**
106
+ * --------------------------------------------------------------------------
107
+ * Public Util Api
108
+ * --------------------------------------------------------------------------
109
+ */
110
+ var getElement = function getElement(selector) {
111
+ if (typeof selector === 'object' && typeof selector.nodeType !== 'undefined') {
112
+ return selector;
113
+ }
114
+ if (typeof selector === 'string') {
115
+ return document.querySelector(selector);
116
+ }
117
+ return null;
118
+ };
119
+ var createElement = function createElement(type, classes, content, html) {
120
+ if (html === void 0) {
121
+ html = false;
122
+ }
123
+ var el = document.createElement(type);
124
+ if (content) {
125
+ el[!html ? 'textContent' : 'innerHTML'] = content;
126
+ }
127
+ if (classes) {
128
+ el.className = classes;
129
+ }
130
+ return el;
131
+ };
132
+ var findElement = function findElement(parentElement, selector) {
133
+ return Element.prototype.querySelector.call(parentElement, selector);
134
+ };
135
+ var removeElement = function removeElement(target) {
136
+ target.parentNode.removeChild(target);
137
+ };
138
+ var isImageUrl = function isImageUrl(url) {
139
+ return /\.(jpg|gif|png)$/.test(url);
140
+ };
141
+ var hyphenate = function hyphenate(string) {
142
+ return string.replace(/[\w]([A-Z])/g, function (m) {
143
+ return m[0] + "-" + m[1];
144
+ }).toLowerCase();
145
+ };
146
+ var merge = function merge(target, source, deep) {
147
+ if (deep === void 0) {
148
+ deep = false;
149
+ }
150
+ if (deep) {
151
+ return deepmerge(target, source);
152
+ }
153
+ return Object.assign(target, source);
154
+ };
155
+ var getLineUid = function getLineUid(from, to) {
156
+ return from.toLowerCase() + ":to:" + to.toLowerCase();
157
+ };
158
+ var inherit = function inherit(target, source) {
159
+ Object.assign(target.prototype, source);
160
+ };
161
+
162
+ var eventRegistry = {};
163
+ var eventUid = 1;
164
+
165
+ /**
166
+ * ------------------------------------------------------------------------
167
+ * Event Handler
168
+ * ------------------------------------------------------------------------
169
+ */
170
+ var EventHandler = {
171
+ on: function on(element, event, handler, options) {
172
+ if (options === void 0) {
173
+ options = {};
174
+ }
175
+ var uid = "jvm:" + event + "::" + eventUid++;
176
+ eventRegistry[uid] = {
177
+ selector: element,
178
+ handler: handler
179
+ };
180
+ handler._uid = uid;
181
+ element.addEventListener(event, handler, options);
182
+ },
183
+ delegate: function delegate(element, event, selector, handler) {
184
+ event = event.split(' ');
185
+ event.forEach(function (eventName) {
186
+ EventHandler.on(element, eventName, function (e) {
187
+ var target = e.target;
188
+ if (target.matches(selector)) {
189
+ handler.call(target, e);
190
+ }
191
+ });
192
+ });
193
+ },
194
+ off: function off(element, event, handler) {
195
+ var eventType = event.split(':')[1];
196
+ element.removeEventListener(eventType, handler);
197
+ delete eventRegistry[handler._uid];
198
+ },
199
+ flush: function flush() {
200
+ Object.keys(eventRegistry).forEach(function (event) {
201
+ EventHandler.off(eventRegistry[event].selector, event, eventRegistry[event].handler);
202
+ });
203
+ },
204
+ getEventRegistry: function getEventRegistry() {
205
+ return eventRegistry;
206
+ }
207
+ };
208
+
209
+ function setupContainerEvents() {
210
+ var _this = this;
211
+ var map = this;
212
+ var mouseDown = false;
213
+ var oldPageX;
214
+ var oldPageY;
215
+ if (this.params.draggable) {
216
+ EventHandler.on(this.container, 'mousemove', function (e) {
217
+ if (!mouseDown) {
218
+ return false;
219
+ }
220
+ map.transX -= (oldPageX - e.pageX) / map.scale;
221
+ map.transY -= (oldPageY - e.pageY) / map.scale;
222
+ map._applyTransform();
223
+ oldPageX = e.pageX;
224
+ oldPageY = e.pageY;
225
+ });
226
+ EventHandler.on(this.container, 'mousedown', function (e) {
227
+ mouseDown = true;
228
+ oldPageX = e.pageX;
229
+ oldPageY = e.pageY;
230
+ return false;
231
+ });
232
+ EventHandler.on(document.body, 'mouseup', function () {
233
+ mouseDown = false;
234
+ });
235
+ }
236
+ if (this.params.zoomOnScroll) {
237
+ EventHandler.on(this.container, 'wheel', function (event) {
238
+ var deltaY = ((event.deltaY || -event.wheelDelta || event.detail) >> 10 || 1) * 75;
239
+ var rect = _this.container.getBoundingClientRect();
240
+ var offsetX = event.pageX - rect.left - window.pageXOffset;
241
+ var offsetY = event.pageY - rect.top - window.pageYOffset;
242
+ var zoomStep = Math.pow(1 + map.params.zoomOnScrollSpeed / 1000, -1.5 * deltaY);
243
+ if (map.tooltip) {
244
+ map._tooltip.hide();
245
+ }
246
+ map._setScale(map.scale * zoomStep, offsetX, offsetY);
247
+ event.preventDefault();
248
+ });
249
+ }
250
+ }
251
+
252
+ var Events = {
253
+ onLoaded: 'map:loaded',
254
+ onViewportChange: 'viewport:changed',
255
+ onRegionClick: 'region:clicked',
256
+ onMarkerClick: 'marker:clicked',
257
+ onRegionSelected: 'region:selected',
258
+ onMarkerSelected: 'marker:selected',
259
+ onRegionTooltipShow: 'region.tooltip:show',
260
+ onMarkerTooltipShow: 'marker.tooltip:show',
261
+ onDestroyed: 'map:destroyed'
262
+ };
263
+
264
+ var parseEvent = function parseEvent(map, selector, isTooltip) {
265
+ var element = getElement(selector);
266
+ var type = element.getAttribute('class').indexOf('jvm-region') === -1 ? 'marker' : 'region';
267
+ var isRegion = type === 'region';
268
+ var code = isRegion ? element.getAttribute('data-code') : element.getAttribute('data-index');
269
+ var event = isRegion ? Events.onRegionSelected : Events.onMarkerSelected;
270
+
271
+ // Init tooltip event
272
+ if (isTooltip) {
273
+ event = isRegion ? Events.onRegionTooltipShow : Events.onMarkerTooltipShow;
274
+ }
275
+ return {
276
+ type: type,
277
+ code: code,
278
+ event: event,
279
+ element: isRegion ? map.regions[code].element : map._markers[code].element,
280
+ tooltipText: isRegion ? map._mapData.paths[code].name || '' : map._markers[code].config.name || ''
281
+ };
282
+ };
283
+ function setupElementEvents() {
284
+ var map = this;
285
+ var container = this.container;
286
+ var pageX, pageY, mouseMoved;
287
+ EventHandler.on(container, 'mousemove', function (event) {
288
+ if (Math.abs(pageX - event.pageX) + Math.abs(pageY - event.pageY) > 2) {
289
+ mouseMoved = true;
290
+ }
291
+ });
292
+
293
+ // When the mouse is pressed
294
+ EventHandler.delegate(container, 'mousedown', '.jvm-element', function (event) {
295
+ pageX = event.pageX;
296
+ pageY = event.pageY;
297
+ mouseMoved = false;
298
+ });
299
+
300
+ // When the mouse is over the region/marker | When the mouse is out the region/marker
301
+ EventHandler.delegate(container, 'mouseover mouseout', '.jvm-element', function (event) {
302
+ var data = parseEvent(map, this, true);
303
+ var showTooltip = map.params.showTooltip;
304
+ if (event.type === 'mouseover') {
305
+ data.element.hover(true);
306
+ if (showTooltip) {
307
+ map._tooltip.text(data.tooltipText);
308
+ map._tooltip.show();
309
+ map._emit(data.event, [event, map._tooltip, data.code]);
310
+ }
311
+ } else {
312
+ data.element.hover(false);
313
+ if (showTooltip) {
314
+ map._tooltip.hide();
315
+ }
316
+ }
317
+ });
318
+
319
+ // When the click is released
320
+ EventHandler.delegate(container, 'mouseup', '.jvm-element', function (event) {
321
+ var data = parseEvent(map, this);
322
+ if (mouseMoved) {
323
+ return;
324
+ }
325
+ if (data.type === 'region' && map.params.regionsSelectable || data.type === 'marker' && map.params.markersSelectable) {
326
+ var element = data.element;
327
+
328
+ // We're checking if regions/markers|SelectableOne option is presented
329
+ if (map.params[data.type + "sSelectableOne"]) {
330
+ map._clearSelected(data.type + "s");
331
+ }
332
+ if (data.element.isSelected) {
333
+ element.select(false);
334
+ } else {
335
+ element.select(true);
336
+ }
337
+ map._emit(data.event, [data.code, element.isSelected, map._getSelected(data.type + "s")]);
338
+ }
339
+ });
340
+
341
+ // When region/marker is clicked
342
+ EventHandler.delegate(container, 'click', '.jvm-element', function (event) {
343
+ var _parseEvent = parseEvent(map, this),
344
+ type = _parseEvent.type,
345
+ code = _parseEvent.code;
346
+ map._emit(type === 'region' ? Events.onRegionClick : Events.onMarkerClick, [event, code]);
347
+ });
348
+ }
349
+
350
+ function setupZoomButtons() {
351
+ var _this = this;
352
+ var zoomin = createElement('div', 'jvm-zoom-btn jvm-zoomin', '+', true);
353
+ var zoomout = createElement('div', 'jvm-zoom-btn jvm-zoomout', '&#x2212', true);
354
+ this.container.appendChild(zoomin);
355
+ this.container.appendChild(zoomout);
356
+ var handler = function handler(zoomin) {
357
+ if (zoomin === void 0) {
358
+ zoomin = true;
359
+ }
360
+ return function () {
361
+ return _this._setScale(zoomin ? _this.scale * _this.params.zoomStep : _this.scale / _this.params.zoomStep, _this._width / 2, _this._height / 2, false, _this.params.zoomAnimate);
362
+ };
363
+ };
364
+ EventHandler.on(zoomin, 'click', handler());
365
+ EventHandler.on(zoomout, 'click', handler(false));
366
+ }
367
+
368
+ function setupContainerTouchEvents() {
369
+ var map = this,
370
+ touchStartScale,
371
+ touchStartDistance,
372
+ touchX,
373
+ touchY,
374
+ centerTouchX,
375
+ centerTouchY,
376
+ lastTouchesLength;
377
+ var handleTouchEvent = function handleTouchEvent(e) {
378
+ var touches = e.touches;
379
+ var offset, scale, transXOld, transYOld;
380
+ if (e.type == 'touchstart') {
381
+ lastTouchesLength = 0;
382
+ }
383
+ if (touches.length == 1) {
384
+ if (lastTouchesLength == 1) {
385
+ transXOld = map.transX;
386
+ transYOld = map.transY;
387
+ map.transX -= (touchX - touches[0].pageX) / map.scale;
388
+ map.transY -= (touchY - touches[0].pageY) / map.scale;
389
+ map._tooltip.hide();
390
+ map._applyTransform();
391
+ if (transXOld != map.transX || transYOld != map.transY) {
392
+ e.preventDefault();
393
+ }
394
+ }
395
+ touchX = touches[0].pageX;
396
+ touchY = touches[0].pageY;
397
+ } else if (touches.length == 2) {
398
+ if (lastTouchesLength == 2) {
399
+ scale = Math.sqrt(Math.pow(touches[0].pageX - touches[1].pageX, 2) + Math.pow(touches[0].pageY - touches[1].pageY, 2)) / touchStartDistance;
400
+ map._setScale(touchStartScale * scale, centerTouchX, centerTouchY);
401
+ map._tooltip.hide();
402
+ e.preventDefault();
403
+ } else {
404
+ var rect = map.container.getBoundingClientRect();
405
+ offset = {
406
+ top: rect.top + window.scrollY,
407
+ left: rect.left + window.scrollX
408
+ };
409
+ if (touches[0].pageX > touches[1].pageX) {
410
+ centerTouchX = touches[1].pageX + (touches[0].pageX - touches[1].pageX) / 2;
411
+ } else {
412
+ centerTouchX = touches[0].pageX + (touches[1].pageX - touches[0].pageX) / 2;
413
+ }
414
+ if (touches[0].pageY > touches[1].pageY) {
415
+ centerTouchY = touches[1].pageY + (touches[0].pageY - touches[1].pageY) / 2;
416
+ } else {
417
+ centerTouchY = touches[0].pageY + (touches[1].pageY - touches[0].pageY) / 2;
418
+ }
419
+ centerTouchX -= offset.left;
420
+ centerTouchY -= offset.top;
421
+ touchStartScale = map.scale;
422
+ touchStartDistance = Math.sqrt(Math.pow(touches[0].pageX - touches[1].pageX, 2) + Math.pow(touches[0].pageY - touches[1].pageY, 2));
423
+ }
424
+ }
425
+ lastTouchesLength = touches.length;
426
+ };
427
+ EventHandler.on(map.container, 'touchstart', handleTouchEvent);
428
+ EventHandler.on(map.container, 'touchmove', handleTouchEvent);
429
+ }
430
+
431
+ function _arrayLikeToArray(r, a) {
432
+ (null == a || a > r.length) && (a = r.length);
433
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
434
+ return n;
435
+ }
436
+ function _assertThisInitialized(e) {
437
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
438
+ return e;
439
+ }
440
+ function _createForOfIteratorHelperLoose(r, e) {
441
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
442
+ if (t) return (t = t.call(r)).next.bind(t);
443
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
444
+ t && (r = t);
445
+ var o = 0;
446
+ return function () {
447
+ return o >= r.length ? {
448
+ done: !0
449
+ } : {
450
+ done: !1,
451
+ value: r[o++]
452
+ };
453
+ };
454
+ }
455
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
456
+ }
457
+ function _extends() {
458
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
459
+ for (var e = 1; e < arguments.length; e++) {
460
+ var t = arguments[e];
461
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
462
+ }
463
+ return n;
464
+ }, _extends.apply(null, arguments);
465
+ }
466
+ function _inheritsLoose(t, o) {
467
+ t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
468
+ }
469
+ function _setPrototypeOf(t, e) {
470
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
471
+ return t.__proto__ = e, t;
472
+ }, _setPrototypeOf(t, e);
473
+ }
474
+ function _unsupportedIterableToArray(r, a) {
475
+ if (r) {
476
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
477
+ var t = {}.toString.call(r).slice(8, -1);
478
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
479
+ }
480
+ }
481
+
482
+ /**
483
+ * ------------------------------------------------------------------------
484
+ * Class Definition
485
+ * ------------------------------------------------------------------------
486
+ */
487
+ var BaseComponent = /*#__PURE__*/function () {
488
+ function BaseComponent() {}
489
+ var _proto = BaseComponent.prototype;
490
+ _proto.dispose = function dispose() {
491
+ if (this._tooltip) {
492
+ removeElement(this._tooltip);
493
+ } else {
494
+ // @todo: move shape in base component in v2
495
+ this.shape.remove();
496
+ }
497
+ for (var _iterator = _createForOfIteratorHelperLoose(Object.getOwnPropertyNames(this)), _step; !(_step = _iterator()).done;) {
498
+ var propertyName = _step.value;
499
+ this[propertyName] = null;
500
+ }
501
+ };
502
+ return BaseComponent;
503
+ }();
504
+
505
+ /**
506
+ * ------------------------------------------------------------------------
507
+ * Interactable
508
+ * ------------------------------------------------------------------------
509
+ */
510
+ var Interactable = {
511
+ getLabelText: function getLabelText(key, label) {
512
+ if (!label) {
513
+ return;
514
+ }
515
+ if (typeof label.render === 'function') {
516
+ var params = [];
517
+
518
+ // Pass additional paramater (Marker config object) in case it's a Marker.
519
+ if (this.config && this.config.marker) {
520
+ params.push(this.config.marker);
521
+ }
522
+
523
+ // Becuase we need to add the key always at the end
524
+ params.push(key);
525
+ return label.render.apply(this, params);
526
+ }
527
+ return key;
528
+ },
529
+ getLabelOffsets: function getLabelOffsets(key, label) {
530
+ if (typeof label.offsets === 'function') {
531
+ return label.offsets(key);
532
+ }
533
+
534
+ // If offsets are an array of offsets e.g offsets: [ [0, 25], [10, 15] ]
535
+ if (Array.isArray(label.offsets)) {
536
+ return label.offsets[key];
537
+ }
538
+ return [0, 0];
539
+ },
540
+ setStyle: function setStyle(property, value) {
541
+ this.shape.setStyle(property, value);
542
+ },
543
+ remove: function remove() {
544
+ this.shape.remove();
545
+ if (this.label) this.label.remove();
546
+ },
547
+ hover: function hover(state) {
548
+ this._setStatus('isHovered', state);
549
+ },
550
+ select: function select(state) {
551
+ this._setStatus('isSelected', state);
552
+ },
553
+ // Private
554
+ _setStatus: function _setStatus(property, state) {
555
+ this.shape[property] = state;
556
+ this.shape.updateStyle();
557
+ this[property] = state;
558
+ if (this.label) {
559
+ this.label[property] = state;
560
+ this.label.updateStyle();
561
+ }
562
+ }
563
+ };
564
+
565
+ /**
566
+ * ------------------------------------------------------------------------
567
+ * Class Definition
568
+ * ------------------------------------------------------------------------
569
+ */
570
+ var Region = /*#__PURE__*/function (_BaseComponent) {
571
+ function Region(_ref) {
572
+ var _this;
573
+ var map = _ref.map,
574
+ code = _ref.code,
575
+ path = _ref.path,
576
+ style = _ref.style,
577
+ label = _ref.label,
578
+ labelStyle = _ref.labelStyle,
579
+ labelsGroup = _ref.labelsGroup;
580
+ _this = _BaseComponent.call(this) || this;
581
+ _this._map = map;
582
+ _this.shape = _this._createRegion(path, code, style);
583
+ var text = _this.getLabelText(code, label);
584
+
585
+ // If label is passed and render function returns something
586
+ if (label && text) {
587
+ var bbox = _this.shape.getBBox();
588
+ var offsets = _this.getLabelOffsets(code, label);
589
+ _this.labelX = bbox.x + bbox.width / 2 + offsets[0];
590
+ _this.labelY = bbox.y + bbox.height / 2 + offsets[1];
591
+ _this.label = _this._map.canvas.createText({
592
+ text: text,
593
+ textAnchor: 'middle',
594
+ alignmentBaseline: 'central',
595
+ dataCode: code,
596
+ x: _this.labelX,
597
+ y: _this.labelY
598
+ }, labelStyle, labelsGroup);
599
+ _this.label.addClass('jvm-region jvm-element');
600
+ }
601
+ return _this;
602
+ }
603
+ _inheritsLoose(Region, _BaseComponent);
604
+ var _proto = Region.prototype;
605
+ _proto._createRegion = function _createRegion(path, code, style) {
606
+ path = this._map.canvas.createPath({
607
+ d: path,
608
+ dataCode: code
609
+ }, style);
610
+ path.addClass('jvm-region jvm-element');
611
+ return path;
612
+ };
613
+ _proto.updateLabelPosition = function updateLabelPosition() {
614
+ if (this.label) {
615
+ this.label.set({
616
+ x: this.labelX * this._map.scale + this._map.transX * this._map.scale,
617
+ y: this.labelY * this._map.scale + this._map.transY * this._map.scale
618
+ });
619
+ }
620
+ };
621
+ return Region;
622
+ }(BaseComponent);
623
+ inherit(Region, Interactable);
624
+
625
+ function createRegions() {
626
+ this._regionLabelsGroup = this._regionLabelsGroup || this.canvas.createGroup('jvm-regions-labels-group');
627
+ for (var code in this._mapData.paths) {
628
+ var region = new Region({
629
+ map: this,
630
+ code: code,
631
+ path: this._mapData.paths[code].path,
632
+ style: merge({}, this.params.regionStyle),
633
+ labelStyle: this.params.regionLabelStyle,
634
+ labelsGroup: this._regionLabelsGroup,
635
+ label: this.params.labels && this.params.labels.regions
636
+ });
637
+ this.regions[code] = {
638
+ config: this._mapData.paths[code],
639
+ element: region
640
+ };
641
+ }
642
+ }
643
+
644
+ /**
645
+ * ------------------------------------------------------------------------
646
+ * Class Definition
647
+ * ------------------------------------------------------------------------
648
+ */
649
+ var Line = /*#__PURE__*/function (_BaseComponent) {
650
+ function Line(_ref) {
651
+ var _this;
652
+ var index = _ref.index,
653
+ map = _ref.map,
654
+ style = _ref.style,
655
+ x1 = _ref.x1,
656
+ y1 = _ref.y1,
657
+ x2 = _ref.x2,
658
+ y2 = _ref.y2,
659
+ group = _ref.group,
660
+ config = _ref.config;
661
+ _this = _BaseComponent.call(this) || this;
662
+ _this.config = config;
663
+ _this.shape = map.canvas.createLine({
664
+ x1: x1,
665
+ y1: y1,
666
+ x2: x2,
667
+ y2: y2,
668
+ dataIndex: index
669
+ }, style, group);
670
+ _this.shape.addClass('jvm-line');
671
+ return _this;
672
+ }
673
+ _inheritsLoose(Line, _BaseComponent);
674
+ var _proto = Line.prototype;
675
+ _proto.setStyle = function setStyle(property, value) {
676
+ this.shape.setStyle(property, value);
677
+ };
678
+ return Line;
679
+ }(BaseComponent);
680
+
681
+ function createLines(lines, markers, isRecentlyCreated) {
682
+ if (isRecentlyCreated === void 0) {
683
+ isRecentlyCreated = false;
684
+ }
685
+ var point1 = false,
686
+ point2 = false;
687
+
688
+ // Create group for holding lines
689
+ // we're checking if `linesGroup` exists or not becuase we may add lines
690
+ // after the map has loaded so we will append the futured lines to this group as well.
691
+ this.linesGroup = this.linesGroup || this.canvas.createGroup('jvm-lines-group');
692
+ for (var index in lines) {
693
+ var config = lines[index];
694
+ for (var mindex in markers) {
695
+ var markerConfig = isRecentlyCreated ? markers[mindex].config : markers[mindex];
696
+ if (markerConfig.name === config.from) {
697
+ point1 = this.getMarkerPosition(markerConfig);
698
+ }
699
+ if (markerConfig.name === config.to) {
700
+ point2 = this.getMarkerPosition(markerConfig);
701
+ }
702
+ }
703
+ if (point1 !== false && point2 !== false) {
704
+ // Register lines with unique keys
705
+ this._lines[getLineUid(config.from, config.to)] = new Line({
706
+ index: index,
707
+ map: this,
708
+ // Merge the default `lineStyle` object with the custom `line` config style
709
+ style: merge({
710
+ initial: this.params.lineStyle
711
+ }, {
712
+ initial: config.style || {}
713
+ }, true),
714
+ x1: point1.x,
715
+ y1: point1.y,
716
+ x2: point2.x,
717
+ y2: point2.y,
718
+ group: this.linesGroup,
719
+ config: config
720
+ });
721
+ }
722
+ }
723
+ }
724
+
725
+ /**
726
+ * ------------------------------------------------------------------------
727
+ * Class Definition
728
+ * ------------------------------------------------------------------------
729
+ */
730
+ var Marker = /*#__PURE__*/function (_BaseComponent) {
731
+ function Marker(_ref) {
732
+ var _this;
733
+ var index = _ref.index,
734
+ style = _ref.style,
735
+ label = _ref.label,
736
+ cx = _ref.cx,
737
+ cy = _ref.cy,
738
+ map = _ref.map,
739
+ group = _ref.group;
740
+ _this = _BaseComponent.call(this) || this;
741
+
742
+ // Private
743
+ _this._map = map;
744
+ _this._isImage = !!style.initial.image;
745
+
746
+ // Protected
747
+ _this.config = arguments[0];
748
+ _this.shape = map.canvas[_this._isImage ? 'createImage' : 'createCircle']({
749
+ dataIndex: index,
750
+ cx: cx,
751
+ cy: cy
752
+ }, style, group);
753
+ _this.shape.addClass('jvm-marker jvm-element');
754
+ if (_this._isImage) {
755
+ _this.updateLabelPosition();
756
+ }
757
+ if (label) {
758
+ _this._createLabel(_this.config);
759
+ }
760
+ return _this;
761
+ }
762
+ _inheritsLoose(Marker, _BaseComponent);
763
+ var _proto = Marker.prototype;
764
+ _proto.updateLabelPosition = function updateLabelPosition() {
765
+ if (this.label) {
766
+ this.label.set({
767
+ x: this._labelX * this._map.scale + this._offsets[0] + this._map.transX * this._map.scale + 5 + (this._isImage ? (this.shape.width || 0) / 2 : this.shape.node.r.baseVal.value),
768
+ y: this._labelY * this._map.scale + this._map.transY * this._map.scale + this._offsets[1]
769
+ });
770
+ }
771
+ };
772
+ _proto._createLabel = function _createLabel(_ref2) {
773
+ var index = _ref2.index,
774
+ map = _ref2.map,
775
+ label = _ref2.label,
776
+ labelsGroup = _ref2.labelsGroup,
777
+ cx = _ref2.cx,
778
+ cy = _ref2.cy,
779
+ marker = _ref2.marker,
780
+ isRecentlyCreated = _ref2.isRecentlyCreated;
781
+ var labelText = this.getLabelText(index, label);
782
+ this._labelX = cx / map.scale - map.transX;
783
+ this._labelY = cy / map.scale - map.transY;
784
+ this._offsets = isRecentlyCreated && marker.offsets ? marker.offsets : this.getLabelOffsets(index, label);
785
+ this.label = map.canvas.createText({
786
+ text: labelText,
787
+ dataIndex: index,
788
+ x: this._labelX,
789
+ y: this._labelY,
790
+ dy: '0.6ex'
791
+ }, map.params.markerLabelStyle, labelsGroup);
792
+ this.label.addClass('jvm-marker jvm-element');
793
+ if (isRecentlyCreated) {
794
+ this.updateLabelPosition();
795
+ }
796
+ };
797
+ return Marker;
798
+ }(BaseComponent);
799
+ inherit(Marker, Interactable);
800
+
801
+ function createMarkers(markers, isRecentlyCreated) {
802
+ var _this = this;
803
+ if (markers === void 0) {
804
+ markers = {};
805
+ }
806
+ if (isRecentlyCreated === void 0) {
807
+ isRecentlyCreated = false;
808
+ }
809
+ // Create groups for holding markers and markers labels
810
+ // We're checking if `markersGroup` exists or not becuase we may add markers after the map has loaded
811
+ // So we will append the futured markers to this group as well.
812
+ this._markersGroup = this._markersGroup || this.canvas.createGroup('jvm-markers-group');
813
+ this._markerLabelsGroup = this._markerLabelsGroup || this.canvas.createGroup('jvm-markers-labels-group');
814
+ var _loop = function _loop() {
815
+ var config = markers[index];
816
+ var point = _this.getMarkerPosition(config);
817
+ var uid = config.coords.join(':');
818
+ if (!point) {
819
+ return 0; // continue
820
+ }
821
+
822
+ // We're checking if recently created marker does already exist
823
+ // If it does we don't need to create it again, so we'll continue
824
+ // Becuase we may have more than one marker submitted via `addMarkers` method.
825
+ if (isRecentlyCreated) {
826
+ if (Object.keys(_this._markers).filter(function (i) {
827
+ return _this._markers[i]._uid === uid;
828
+ }).length) {
829
+ return 0; // continue
830
+ }
831
+ index = Object.keys(_this._markers).length;
832
+ }
833
+ var marker = new Marker({
834
+ index: index,
835
+ map: _this,
836
+ // Merge the `markerStyle` object with the marker config `style` if presented.
837
+ style: merge(_this.params.markerStyle, _extends({}, config.style || {}), true),
838
+ label: _this.params.labels && _this.params.labels.markers,
839
+ labelsGroup: _this._markerLabelsGroup,
840
+ cx: point.x,
841
+ cy: point.y,
842
+ group: _this._markersGroup,
843
+ marker: config,
844
+ isRecentlyCreated: isRecentlyCreated
845
+ });
846
+
847
+ // Check for marker duplication
848
+ // this is useful when for example: a user clicks a button for creating marker two times
849
+ // so it will remove the old one and the new one will take its place.
850
+ if (_this._markers[index]) {
851
+ _this.removeMarkers([index]);
852
+ }
853
+ _this._markers[index] = {
854
+ _uid: uid,
855
+ config: config,
856
+ element: marker
857
+ };
858
+ },
859
+ _ret;
860
+ for (var index in markers) {
861
+ _ret = _loop();
862
+ if (_ret === 0) continue;
863
+ }
864
+ }
865
+
866
+ /**
867
+ * ------------------------------------------------------------------------
868
+ * Class Definition
869
+ * ------------------------------------------------------------------------
870
+ */
871
+ var Legend = /*#__PURE__*/function () {
872
+ function Legend(options) {
873
+ if (options === void 0) {
874
+ options = {};
875
+ }
876
+ this._options = options;
877
+ this._map = this._options.map;
878
+ this._series = this._options.series;
879
+ this._body = createElement('div', 'jvm-legend');
880
+ if (this._options.cssClass) {
881
+ this._body.setAttribute('class', this._options.cssClass);
882
+ }
883
+ if (options.vertical) {
884
+ this._map.legendVertical.appendChild(this._body);
885
+ } else {
886
+ this._map.legendHorizontal.appendChild(this._body);
887
+ }
888
+ this.render();
889
+ }
890
+ var _proto = Legend.prototype;
891
+ _proto.render = function render() {
892
+ var ticks = this._series.scale.getTicks();
893
+ var inner = createElement('div', 'jvm-legend-inner');
894
+ this._body.innderHTML = '';
895
+ if (this._options.title) {
896
+ var legendTitle = createElement('div', 'jvm-legend-title', this._options.title);
897
+ this._body.appendChild(legendTitle);
898
+ }
899
+ this._body.appendChild(inner);
900
+ for (var i = 0; i < ticks.length; i++) {
901
+ var tick = createElement('div', 'jvm-legend-tick');
902
+ var sample = createElement('div', 'jvm-legend-tick-sample');
903
+ switch (this._series.config.attribute) {
904
+ case 'fill':
905
+ if (isImageUrl(ticks[i].value)) {
906
+ sample.style.background = "url(" + ticks[i].value + ")";
907
+ } else {
908
+ sample.style.background = ticks[i].value;
909
+ }
910
+ break;
911
+ case 'stroke':
912
+ sample.style.background = ticks[i].value;
913
+ break;
914
+ case 'image':
915
+ sample.style.background = "url(" + (typeof ticks[i].value === 'object' ? ticks[i].value.url : ticks[i].value) + ") no-repeat center center";
916
+ sample.style.backgroundSize = 'cover';
917
+ break;
918
+ }
919
+ tick.appendChild(sample);
920
+ var label = ticks[i].label;
921
+ if (this._options.labelRender) {
922
+ label = this._options.labelRender(label);
923
+ }
924
+ var tickText = createElement('div', 'jvm-legend-tick-text', label);
925
+ tick.appendChild(tickText);
926
+ inner.appendChild(tick);
927
+ }
928
+ };
929
+ return Legend;
930
+ }();
931
+
932
+ /**
933
+ * ------------------------------------------------------------------------
934
+ * Class Definition
935
+ * ------------------------------------------------------------------------
936
+ */
937
+ var OrdinalScale = /*#__PURE__*/function () {
938
+ function OrdinalScale(scale) {
939
+ this._scale = scale;
940
+ }
941
+ var _proto = OrdinalScale.prototype;
942
+ _proto.getValue = function getValue(value) {
943
+ return this._scale[value];
944
+ };
945
+ _proto.getTicks = function getTicks() {
946
+ var ticks = [];
947
+ for (var key in this._scale) {
948
+ ticks.push({
949
+ label: key,
950
+ value: this._scale[key]
951
+ });
952
+ }
953
+ return ticks;
954
+ };
955
+ return OrdinalScale;
956
+ }();
957
+
958
+ /**
959
+ * ------------------------------------------------------------------------
960
+ * Class Definition
961
+ * ------------------------------------------------------------------------
962
+ */
963
+ var Series = /*#__PURE__*/function () {
964
+ function Series(config, elements, map) {
965
+ if (config === void 0) {
966
+ config = {};
967
+ }
968
+ // Private
969
+ this._map = map;
970
+ this._elements = elements; // Could be markers or regions
971
+ this._values = config.values || {};
972
+
973
+ // Protected
974
+ this.config = config;
975
+ this.config.attribute = config.attribute || 'fill';
976
+
977
+ // Set initial attributes
978
+ if (config.attributes) {
979
+ this.setAttributes(config.attributes);
980
+ }
981
+ if (typeof config.scale === 'object') {
982
+ this.scale = new OrdinalScale(config.scale);
983
+ }
984
+ if (this.config.legend) {
985
+ this.legend = new Legend(merge({
986
+ map: this._map,
987
+ series: this
988
+ }, this.config.legend));
989
+ }
990
+ this.setValues(this._values);
991
+ }
992
+ var _proto = Series.prototype;
993
+ _proto.setValues = function setValues(values) {
994
+ var attrs = {};
995
+ for (var key in values) {
996
+ if (values[key]) {
997
+ attrs[key] = this.scale.getValue(values[key]);
998
+ }
999
+ }
1000
+ this.setAttributes(attrs);
1001
+ };
1002
+ _proto.setAttributes = function setAttributes(attrs) {
1003
+ for (var code in attrs) {
1004
+ if (this._elements[code]) {
1005
+ this._elements[code].element.setStyle(this.config.attribute, attrs[code]);
1006
+ }
1007
+ }
1008
+ };
1009
+ _proto.clear = function clear() {
1010
+ var key,
1011
+ attrs = {};
1012
+ for (key in this._values) {
1013
+ if (this._elements[key]) {
1014
+ attrs[key] = this._elements[key].element.shape.style.initial[this.config.attribute];
1015
+ }
1016
+ }
1017
+ this.setAttributes(attrs);
1018
+ this._values = {};
1019
+ };
1020
+ return Series;
1021
+ }();
1022
+
1023
+ function createSeries() {
1024
+ this.series = {
1025
+ markers: [],
1026
+ regions: []
1027
+ };
1028
+ for (var key in this.params.series) {
1029
+ for (var i = 0; i < this.params.series[key].length; i++) {
1030
+ this.series[key][i] = new Series(this.params.series[key][i], key === 'markers' ? this._markers : this.regions, this);
1031
+ }
1032
+ }
1033
+ }
1034
+
1035
+ function applyTransform() {
1036
+ var maxTransX, maxTransY, minTransX, minTransY;
1037
+ if (this._defaultWidth * this.scale <= this._width) {
1038
+ maxTransX = (this._width - this._defaultWidth * this.scale) / (2 * this.scale);
1039
+ minTransX = (this._width - this._defaultWidth * this.scale) / (2 * this.scale);
1040
+ } else {
1041
+ maxTransX = 0;
1042
+ minTransX = (this._width - this._defaultWidth * this.scale) / this.scale;
1043
+ }
1044
+ if (this._defaultHeight * this.scale <= this._height) {
1045
+ maxTransY = (this._height - this._defaultHeight * this.scale) / (2 * this.scale);
1046
+ minTransY = (this._height - this._defaultHeight * this.scale) / (2 * this.scale);
1047
+ } else {
1048
+ maxTransY = 0;
1049
+ minTransY = (this._height - this._defaultHeight * this.scale) / this.scale;
1050
+ }
1051
+ if (this.transY > maxTransY) {
1052
+ this.transY = maxTransY;
1053
+ } else if (this.transY < minTransY) {
1054
+ this.transY = minTransY;
1055
+ }
1056
+ if (this.transX > maxTransX) {
1057
+ this.transX = maxTransX;
1058
+ } else if (this.transX < minTransX) {
1059
+ this.transX = minTransX;
1060
+ }
1061
+ this.canvas.applyTransformParams(this.scale, this.transX, this.transY);
1062
+ if (this._markers) {
1063
+ this._repositionMarkers();
1064
+ }
1065
+ if (this._lines) {
1066
+ this._repositionLines();
1067
+ }
1068
+ this._repositionLabels();
1069
+ }
1070
+
1071
+ function resize() {
1072
+ var curBaseScale = this._baseScale;
1073
+ if (this._width / this._height > this._defaultWidth / this._defaultHeight) {
1074
+ this._baseScale = this._height / this._defaultHeight;
1075
+ this._baseTransX = Math.abs(this._width - this._defaultWidth * this._baseScale) / (2 * this._baseScale);
1076
+ } else {
1077
+ this._baseScale = this._width / this._defaultWidth;
1078
+ this._baseTransY = Math.abs(this._height - this._defaultHeight * this._baseScale) / (2 * this._baseScale);
1079
+ }
1080
+ this.scale *= this._baseScale / curBaseScale;
1081
+ this.transX *= this._baseScale / curBaseScale;
1082
+ this.transY *= this._baseScale / curBaseScale;
1083
+ }
1084
+
1085
+ function setScale(scale, anchorX, anchorY, isCentered, animate) {
1086
+ var _this = this;
1087
+ var zoomStep,
1088
+ interval,
1089
+ i = 0,
1090
+ count = Math.abs(Math.round((scale - this.scale) * 60 / Math.max(scale, this.scale))),
1091
+ scaleStart,
1092
+ scaleDiff,
1093
+ transXStart,
1094
+ transXDiff,
1095
+ transYStart,
1096
+ transYDiff,
1097
+ transX,
1098
+ transY;
1099
+ if (scale > this.params.zoomMax * this._baseScale) {
1100
+ scale = this.params.zoomMax * this._baseScale;
1101
+ } else if (scale < this.params.zoomMin * this._baseScale) {
1102
+ scale = this.params.zoomMin * this._baseScale;
1103
+ }
1104
+ if (typeof anchorX != 'undefined' && typeof anchorY != 'undefined') {
1105
+ zoomStep = scale / this.scale;
1106
+ if (isCentered) {
1107
+ transX = anchorX + this._defaultWidth * (this._width / (this._defaultWidth * scale)) / 2;
1108
+ transY = anchorY + this._defaultHeight * (this._height / (this._defaultHeight * scale)) / 2;
1109
+ } else {
1110
+ transX = this.transX - (zoomStep - 1) / scale * anchorX;
1111
+ transY = this.transY - (zoomStep - 1) / scale * anchorY;
1112
+ }
1113
+ }
1114
+ if (animate && count > 0) {
1115
+ scaleStart = this.scale;
1116
+ scaleDiff = (scale - scaleStart) / count;
1117
+ transXStart = this.transX * this.scale;
1118
+ transYStart = this.transY * this.scale;
1119
+ transXDiff = (transX * scale - transXStart) / count;
1120
+ transYDiff = (transY * scale - transYStart) / count;
1121
+ interval = setInterval(function () {
1122
+ i += 1;
1123
+ _this.scale = scaleStart + scaleDiff * i;
1124
+ _this.transX = (transXStart + transXDiff * i) / _this.scale;
1125
+ _this.transY = (transYStart + transYDiff * i) / _this.scale;
1126
+ _this._applyTransform();
1127
+ if (i == count) {
1128
+ clearInterval(interval);
1129
+ _this._emit(Events.onViewportChange, [_this.scale, _this.transX, _this.transY]);
1130
+ }
1131
+ }, 10);
1132
+ } else {
1133
+ this.transX = transX;
1134
+ this.transY = transY;
1135
+ this.scale = scale;
1136
+ this._applyTransform();
1137
+ this._emit(Events.onViewportChange, [this.scale, this.transX, this.transY]);
1138
+ }
1139
+ }
1140
+
1141
+ function setFocus(config) {
1142
+ var _this = this;
1143
+ if (config === void 0) {
1144
+ config = {};
1145
+ }
1146
+ var bbox,
1147
+ codes = [];
1148
+ if (config.region) {
1149
+ codes.push(config.region);
1150
+ } else if (config.regions) {
1151
+ codes = config.regions;
1152
+ }
1153
+ if (codes.length) {
1154
+ codes.forEach(function (code) {
1155
+ if (_this.regions[code]) {
1156
+ var itemBbox = _this.regions[code].element.shape.getBBox();
1157
+ if (itemBbox) {
1158
+ // Handle the first loop
1159
+ if (typeof bbox == 'undefined') {
1160
+ bbox = itemBbox;
1161
+ } else {
1162
+ // get the old bbox properties plus the current
1163
+ // this kinda incrementing the old values and the new values
1164
+ bbox = {
1165
+ x: Math.min(bbox.x, itemBbox.x),
1166
+ y: Math.min(bbox.y, itemBbox.y),
1167
+ width: Math.max(bbox.x + bbox.width, itemBbox.x + itemBbox.width) - Math.min(bbox.x, itemBbox.x),
1168
+ height: Math.max(bbox.y + bbox.height, itemBbox.y + itemBbox.height) - Math.min(bbox.y, itemBbox.y)
1169
+ };
1170
+ }
1171
+ }
1172
+ }
1173
+ });
1174
+ return this._setScale(Math.min(this._width / bbox.width, this._height / bbox.height), -(bbox.x + bbox.width / 2), -(bbox.y + bbox.height / 2), true, config.animate);
1175
+ } else if (config.coords) {
1176
+ var point = this.coordsToPoint(config.coords[0], config.coords[1]);
1177
+ var x = this.transX - point.x / this.scale;
1178
+ var y = this.transY - point.y / this.scale;
1179
+ return this._setScale(config.scale * this._baseScale, x, y, true, config.animate);
1180
+ }
1181
+ }
1182
+
1183
+ function updateSize() {
1184
+ this._width = this.container.offsetWidth;
1185
+ this._height = this.container.offsetHeight;
1186
+ this._resize();
1187
+ this.canvas.setSize(this._width, this._height);
1188
+ this._applyTransform();
1189
+ }
1190
+
1191
+ /**
1192
+ * ------------------------------------------------------------------------
1193
+ * Object
1194
+ * ------------------------------------------------------------------------
1195
+ */
1196
+ var Proj = {
1197
+ /* sgn(n){
1198
+ if (n > 0) {
1199
+ return 1;
1200
+ } else if (n < 0) {
1201
+ return -1;
1202
+ } else {
1203
+ return n;
1204
+ }
1205
+ }, */
1206
+ mill: function mill(lat, lng, c) {
1207
+ return {
1208
+ x: this.radius * (lng - c) * this.radDeg,
1209
+ y: -this.radius * Math.log(Math.tan((45 + 0.4 * lat) * this.radDeg)) / 0.8
1210
+ };
1211
+ },
1212
+ /* mill_inv(x, y, c) {
1213
+ return {
1214
+ lat: (2.5 * Math.atan(Math.exp(0.8 * y / this.radius)) - 5 * Math.PI / 8) * this.degRad,
1215
+ lng: (c * this.radDeg + x / this.radius) * this.degRad
1216
+ };
1217
+ }, */
1218
+ merc: function merc(lat, lng, c) {
1219
+ return {
1220
+ x: this.radius * (lng - c) * this.radDeg,
1221
+ y: -this.radius * Math.log(Math.tan(Math.PI / 4 + lat * Math.PI / 360))
1222
+ };
1223
+ },
1224
+ /* merc_inv(x, y, c) {
1225
+ return {
1226
+ lat: (2 * Math.atan(Math.exp(y / this.radius)) - Math.PI / 2) * this.degRad,
1227
+ lng: (c * this.radDeg + x / this.radius) * this.degRad
1228
+ };
1229
+ }, */
1230
+ aea: function aea(lat, lng, c) {
1231
+ var fi0 = 0,
1232
+ lambda0 = c * this.radDeg,
1233
+ fi1 = 29.5 * this.radDeg,
1234
+ fi2 = 45.5 * this.radDeg,
1235
+ fi = lat * this.radDeg,
1236
+ lambda = lng * this.radDeg,
1237
+ n = (Math.sin(fi1) + Math.sin(fi2)) / 2,
1238
+ C = Math.cos(fi1) * Math.cos(fi1) + 2 * n * Math.sin(fi1),
1239
+ theta = n * (lambda - lambda0),
1240
+ ro = Math.sqrt(C - 2 * n * Math.sin(fi)) / n,
1241
+ ro0 = Math.sqrt(C - 2 * n * Math.sin(fi0)) / n;
1242
+ return {
1243
+ x: ro * Math.sin(theta) * this.radius,
1244
+ y: -(ro0 - ro * Math.cos(theta)) * this.radius
1245
+ };
1246
+ },
1247
+ /* aea_inv(xCoord, yCoord, c) {
1248
+ var x = xCoord / this.radius,
1249
+ y = yCoord / this.radius,
1250
+ fi0 = 0,
1251
+ lambda0 = c * this.radDeg,
1252
+ fi1 = 29.5 * this.radDeg,
1253
+ fi2 = 45.5 * this.radDeg,
1254
+ n = (Math.sin(fi1)+Math.sin(fi2)) / 2,
1255
+ C = Math.cos(fi1)*Math.cos(fi1)+2*n*Math.sin(fi1),
1256
+ ro0 = Math.sqrt(C-2*n*Math.sin(fi0))/n,
1257
+ ro = Math.sqrt(x*x+(ro0-y)*(ro0-y)),
1258
+ theta = Math.atan( x / (ro0 - y) );
1259
+ return {
1260
+ lat: (Math.asin((C - ro * ro * n * n) / (2 * n))) * this.degRad,
1261
+ lng: (lambda0 + theta / n) * this.degRad
1262
+ };
1263
+ }, */
1264
+ lcc: function lcc(lat, lng, c) {
1265
+ var fi0 = 0,
1266
+ lambda0 = c * this.radDeg,
1267
+ lambda = lng * this.radDeg,
1268
+ fi1 = 33 * this.radDeg,
1269
+ fi2 = 45 * this.radDeg,
1270
+ fi = lat * this.radDeg,
1271
+ n = Math.log(Math.cos(fi1) * (1 / Math.cos(fi2))) / Math.log(Math.tan(Math.PI / 4 + fi2 / 2) * (1 / Math.tan(Math.PI / 4 + fi1 / 2))),
1272
+ F = Math.cos(fi1) * Math.pow(Math.tan(Math.PI / 4 + fi1 / 2), n) / n,
1273
+ ro = F * Math.pow(1 / Math.tan(Math.PI / 4 + fi / 2), n),
1274
+ ro0 = F * Math.pow(1 / Math.tan(Math.PI / 4 + fi0 / 2), n);
1275
+ return {
1276
+ x: ro * Math.sin(n * (lambda - lambda0)) * this.radius,
1277
+ y: -(ro0 - ro * Math.cos(n * (lambda - lambda0))) * this.radius
1278
+ };
1279
+ }
1280
+ /* lcc_inv(xCoord, yCoord, c) {
1281
+ var x = xCoord / this.radius,
1282
+ y = yCoord / this.radius,
1283
+ fi0 = 0,
1284
+ lambda0 = c * this.radDeg,
1285
+ fi1 = 33 * this.radDeg,
1286
+ fi2 = 45 * this.radDeg,
1287
+ n = Math.log( Math.cos(fi1) * (1 / Math.cos(fi2)) ) / Math.log( Math.tan( Math.PI / 4 + fi2 / 2) * (1 / Math.tan( Math.PI / 4 + fi1 / 2) ) ),
1288
+ F = ( Math.cos(fi1) * Math.pow( Math.tan( Math.PI / 4 + fi1 / 2 ), n ) ) / n,
1289
+ ro0 = F * Math.pow( 1 / Math.tan( Math.PI / 4 + fi0 / 2 ), n ),
1290
+ ro = this.sgn(n) * Math.sqrt(x*x+(ro0-y)*(ro0-y)),
1291
+ theta = Math.atan( x / (ro0 - y) );
1292
+ return {
1293
+ lat: (2 * Math.atan(Math.pow(F/ro, 1/n)) - Math.PI / 2) * this.degRad,
1294
+ lng: (lambda0 + theta / n) * this.degRad
1295
+ };
1296
+ } */
1297
+ };
1298
+ Proj.degRad = 180 / Math.PI;
1299
+ Proj.radDeg = Math.PI / 180;
1300
+ Proj.radius = 6381372;
1301
+
1302
+ function coordsToPoint(lat, lng) {
1303
+ var projection = Map.maps[this.params.map].projection;
1304
+ var _Proj$projection$type = Proj[projection.type](lat, lng, projection.centralMeridian),
1305
+ x = _Proj$projection$type.x,
1306
+ y = _Proj$projection$type.y;
1307
+ var inset = this.getInsetForPoint(x, y);
1308
+ if (!inset) {
1309
+ return false;
1310
+ }
1311
+ var bbox = inset.bbox;
1312
+ x = (x - bbox[0].x) / (bbox[1].x - bbox[0].x) * inset.width * this.scale;
1313
+ y = (y - bbox[0].y) / (bbox[1].y - bbox[0].y) * inset.height * this.scale;
1314
+ return {
1315
+ x: x + this.transX * this.scale + inset.left * this.scale,
1316
+ y: y + this.transY * this.scale + inset.top * this.scale
1317
+ };
1318
+ }
1319
+
1320
+ function getInsetForPoint(x, y) {
1321
+ var insets = Map.maps[this.params.map].insets;
1322
+ for (var index = 0; index < insets.length; index++) {
1323
+ var _insets$index$bbox = insets[index].bbox,
1324
+ start = _insets$index$bbox[0],
1325
+ end = _insets$index$bbox[1];
1326
+ if (x > start.x && x < end.x && y > start.y && y < end.y) {
1327
+ return insets[index];
1328
+ }
1329
+ }
1330
+ }
1331
+
1332
+ function getMarkerPosition(_ref) {
1333
+ var coords = _ref.coords;
1334
+ if (Map.maps[this.params.map].projection) {
1335
+ return this.coordsToPoint.apply(this, coords);
1336
+ }
1337
+ return {
1338
+ x: coords[0] * this.scale + this.transX * this.scale,
1339
+ y: coords[1] * this.scale + this.transY * this.scale
1340
+ };
1341
+ }
1342
+
1343
+ function repositionLines() {
1344
+ var point1 = false,
1345
+ point2 = false;
1346
+ for (var index in this._lines) {
1347
+ for (var mindex in this._markers) {
1348
+ var marker = this._markers[mindex];
1349
+ if (marker.config.name === this._lines[index].config.from) {
1350
+ point1 = this.getMarkerPosition(marker.config);
1351
+ }
1352
+ if (marker.config.name === this._lines[index].config.to) {
1353
+ point2 = this.getMarkerPosition(marker.config);
1354
+ }
1355
+ }
1356
+ if (point1 !== false && point2 !== false) {
1357
+ this._lines[index].setStyle({
1358
+ x1: point1.x,
1359
+ y1: point1.y,
1360
+ x2: point2.x,
1361
+ y2: point2.y
1362
+ });
1363
+ }
1364
+ }
1365
+ }
1366
+
1367
+ function repositionMarkers() {
1368
+ for (var index in this._markers) {
1369
+ var point = this.getMarkerPosition(this._markers[index].config);
1370
+ if (point !== false) {
1371
+ this._markers[index].element.setStyle({
1372
+ cx: point.x,
1373
+ cy: point.y
1374
+ });
1375
+ }
1376
+ }
1377
+ }
1378
+
1379
+ function repositionLabels() {
1380
+ var labels = this.params.labels;
1381
+ if (!labels) {
1382
+ return;
1383
+ }
1384
+
1385
+ // Regions labels
1386
+ if (labels.regions) {
1387
+ for (var key in this.regions) {
1388
+ this.regions[key].element.updateLabelPosition();
1389
+ }
1390
+ }
1391
+
1392
+ // Markers labels
1393
+ if (labels.markers) {
1394
+ for (var _key in this._markers) {
1395
+ this._markers[_key].element.updateLabelPosition();
1396
+ }
1397
+ }
1398
+ }
1399
+
1400
+ var core = {
1401
+ _setupContainerEvents: setupContainerEvents,
1402
+ _setupElementEvents: setupElementEvents,
1403
+ _setupZoomButtons: setupZoomButtons,
1404
+ _setupContainerTouchEvents: setupContainerTouchEvents,
1405
+ _createRegions: createRegions,
1406
+ _createLines: createLines,
1407
+ _createMarkers: createMarkers,
1408
+ _createSeries: createSeries,
1409
+ _applyTransform: applyTransform,
1410
+ _resize: resize,
1411
+ _setScale: setScale,
1412
+ setFocus: setFocus,
1413
+ updateSize: updateSize,
1414
+ coordsToPoint: coordsToPoint,
1415
+ getInsetForPoint: getInsetForPoint,
1416
+ getMarkerPosition: getMarkerPosition,
1417
+ _repositionLines: repositionLines,
1418
+ _repositionMarkers: repositionMarkers,
1419
+ _repositionLabels: repositionLabels
1420
+ };
1421
+
1422
+ var Defaults = {
1423
+ map: 'world',
1424
+ backgroundColor: 'transparent',
1425
+ draggable: true,
1426
+ zoomButtons: true,
1427
+ zoomOnScroll: true,
1428
+ zoomOnScrollSpeed: 3,
1429
+ zoomMax: 12,
1430
+ zoomMin: 1,
1431
+ zoomAnimate: true,
1432
+ showTooltip: true,
1433
+ zoomStep: 1.5,
1434
+ bindTouchEvents: true,
1435
+ // Line options
1436
+ lineStyle: {
1437
+ stroke: '#808080',
1438
+ strokeWidth: 1,
1439
+ strokeLinecap: 'round'
1440
+ },
1441
+ // Marker options
1442
+ markersSelectable: false,
1443
+ markersSelectableOne: false,
1444
+ markerStyle: {
1445
+ initial: {
1446
+ r: 7,
1447
+ fill: '#374151',
1448
+ fillOpacity: 1,
1449
+ stroke: '#FFF',
1450
+ strokeWidth: 5,
1451
+ strokeOpacity: .5
1452
+ },
1453
+ hover: {
1454
+ fill: '#3cc0ff',
1455
+ cursor: 'pointer'
1456
+ },
1457
+ selected: {
1458
+ fill: 'blue'
1459
+ },
1460
+ selectedHover: {}
1461
+ },
1462
+ markerLabelStyle: {
1463
+ initial: {
1464
+ fontFamily: 'Verdana',
1465
+ fontSize: 12,
1466
+ fontWeight: 500,
1467
+ cursor: 'default',
1468
+ fill: '#374151'
1469
+ },
1470
+ hover: {
1471
+ cursor: 'pointer'
1472
+ },
1473
+ selected: {},
1474
+ selectedHover: {}
1475
+ },
1476
+ // Region options
1477
+ regionsSelectable: false,
1478
+ regionsSelectableOne: false,
1479
+ regionStyle: {
1480
+ initial: {
1481
+ fill: '#dee2e8',
1482
+ fillOpacity: 1,
1483
+ stroke: 'none',
1484
+ strokeWidth: 0
1485
+ },
1486
+ hover: {
1487
+ fillOpacity: .7,
1488
+ cursor: 'pointer'
1489
+ },
1490
+ selected: {
1491
+ fill: '#9ca3af'
1492
+ },
1493
+ selectedHover: {}
1494
+ },
1495
+ regionLabelStyle: {
1496
+ initial: {
1497
+ fontFamily: 'Verdana',
1498
+ fontSize: '12',
1499
+ fontWeight: 'bold',
1500
+ cursor: 'default',
1501
+ fill: '#35373e'
1502
+ },
1503
+ hover: {
1504
+ cursor: 'pointer'
1505
+ }
1506
+ }
1507
+ };
1508
+
1509
+ /**
1510
+ * ------------------------------------------------------------------------
1511
+ * Class Definition
1512
+ * ------------------------------------------------------------------------
1513
+ */
1514
+ var SVGElement = /*#__PURE__*/function () {
1515
+ function SVGElement(name, config) {
1516
+ this.node = this._createElement(name);
1517
+ if (config) {
1518
+ this.set(config);
1519
+ }
1520
+ }
1521
+
1522
+ // Create new SVG element `svg`, `g`, `path`, `line`, `circle`, `image`, etc.
1523
+ // https://developer.mozilla.org/en-US/docs/Web/API/Document/createElementNS#important_namespace_uris
1524
+ var _proto = SVGElement.prototype;
1525
+ _proto._createElement = function _createElement(tagName) {
1526
+ return document.createElementNS('http://www.w3.org/2000/svg', tagName);
1527
+ };
1528
+ _proto.addClass = function addClass(className) {
1529
+ this.node.setAttribute('class', className);
1530
+ };
1531
+ _proto.getBBox = function getBBox() {
1532
+ return this.node.getBBox();
1533
+ }
1534
+
1535
+ // Apply attributes on the current node element
1536
+ ;
1537
+ _proto.set = function set(property, value) {
1538
+ if (typeof property === 'object') {
1539
+ for (var attr in property) {
1540
+ this.applyAttr(attr, property[attr]);
1541
+ }
1542
+ } else {
1543
+ this.applyAttr(property, value);
1544
+ }
1545
+ };
1546
+ _proto.get = function get(property) {
1547
+ return this.style.initial[property];
1548
+ };
1549
+ _proto.applyAttr = function applyAttr(property, value) {
1550
+ this.node.setAttribute(hyphenate(property), value);
1551
+ };
1552
+ _proto.remove = function remove() {
1553
+ removeElement(this.node);
1554
+ };
1555
+ return SVGElement;
1556
+ }();
1557
+
1558
+ /**
1559
+ * ------------------------------------------------------------------------
1560
+ * Class Definition
1561
+ * ------------------------------------------------------------------------
1562
+ */
1563
+ var SVGShapeElement = /*#__PURE__*/function (_SVGElement) {
1564
+ function SVGShapeElement(name, config, style) {
1565
+ var _this;
1566
+ if (style === void 0) {
1567
+ style = {};
1568
+ }
1569
+ _this = _SVGElement.call(this, name, config) || this;
1570
+ _this.isHovered = false;
1571
+ _this.isSelected = false;
1572
+ _this.style = style;
1573
+ _this.style.current = {};
1574
+ _this.updateStyle();
1575
+ return _this;
1576
+ }
1577
+ _inheritsLoose(SVGShapeElement, _SVGElement);
1578
+ var _proto = SVGShapeElement.prototype;
1579
+ _proto.setStyle = function setStyle(property, value) {
1580
+ if (typeof property === 'object') {
1581
+ merge(this.style.current, property);
1582
+ } else {
1583
+ var _merge;
1584
+ merge(this.style.current, (_merge = {}, _merge[property] = value, _merge));
1585
+ }
1586
+ this.updateStyle();
1587
+ };
1588
+ _proto.updateStyle = function updateStyle() {
1589
+ var attrs = {};
1590
+ merge(attrs, this.style.initial);
1591
+ merge(attrs, this.style.current);
1592
+ if (this.isHovered) {
1593
+ merge(attrs, this.style.hover);
1594
+ }
1595
+ if (this.isSelected) {
1596
+ merge(attrs, this.style.selected);
1597
+ if (this.isHovered) {
1598
+ merge(attrs, this.style.selectedHover);
1599
+ }
1600
+ }
1601
+ this.set(attrs);
1602
+ };
1603
+ return SVGShapeElement;
1604
+ }(SVGElement);
1605
+
1606
+ /**
1607
+ * ------------------------------------------------------------------------
1608
+ * Class Definition
1609
+ * ------------------------------------------------------------------------
1610
+ */
1611
+ var SVGTextElement = /*#__PURE__*/function (_SVGShapeElement) {
1612
+ function SVGTextElement(config, style) {
1613
+ return _SVGShapeElement.call(this, 'text', config, style) || this;
1614
+ }
1615
+ _inheritsLoose(SVGTextElement, _SVGShapeElement);
1616
+ var _proto = SVGTextElement.prototype;
1617
+ _proto.applyAttr = function applyAttr(attr, value) {
1618
+ attr === 'text' ? this.node.textContent = value : _SVGShapeElement.prototype.applyAttr.call(this, attr, value);
1619
+ };
1620
+ return SVGTextElement;
1621
+ }(SVGShapeElement);
1622
+
1623
+ /**
1624
+ * ------------------------------------------------------------------------
1625
+ * Class Definition
1626
+ * ------------------------------------------------------------------------
1627
+ */
1628
+ var SVGImageElement = /*#__PURE__*/function (_SVGShapeElement) {
1629
+ function SVGImageElement(config, style) {
1630
+ return _SVGShapeElement.call(this, 'image', config, style) || this;
1631
+ }
1632
+ _inheritsLoose(SVGImageElement, _SVGShapeElement);
1633
+ var _proto = SVGImageElement.prototype;
1634
+ _proto.applyAttr = function applyAttr(attr, value) {
1635
+ var imageUrl;
1636
+ if (attr === 'image') {
1637
+ // This get executed when we have url in series.markers[0].scale.someScale.url
1638
+ if (typeof value === 'object') {
1639
+ imageUrl = value.url;
1640
+ this.offset = value.offset || [0, 0];
1641
+ } else {
1642
+ imageUrl = value;
1643
+ this.offset = [0, 0];
1644
+ }
1645
+ this.node.setAttributeNS('http://www.w3.org/1999/xlink', 'href', imageUrl);
1646
+
1647
+ // Set width and height then call this `applyAttr` again
1648
+ this.width = 23;
1649
+ this.height = 23;
1650
+ this.applyAttr('width', this.width);
1651
+ this.applyAttr('height', this.height);
1652
+ this.applyAttr('x', this.cx - this.width / 2 + this.offset[0]);
1653
+ this.applyAttr('y', this.cy - this.height / 2 + this.offset[1]);
1654
+ } else if (attr == 'cx') {
1655
+ this.cx = value;
1656
+ if (this.width) {
1657
+ this.applyAttr('x', value - this.width / 2 + this.offset[0]);
1658
+ }
1659
+ } else if (attr == 'cy') {
1660
+ this.cy = value;
1661
+ if (this.height) {
1662
+ this.applyAttr('y', value - this.height / 2 + this.offset[1]);
1663
+ }
1664
+ } else {
1665
+ // This time Call SVGElement
1666
+ _SVGShapeElement.prototype.applyAttr.apply(this, arguments);
1667
+ }
1668
+ };
1669
+ return SVGImageElement;
1670
+ }(SVGShapeElement);
1671
+
1672
+ /**
1673
+ * ------------------------------------------------------------------------
1674
+ * Class Definition
1675
+ * ------------------------------------------------------------------------
1676
+ */
1677
+ var SVGCanvasElement = /*#__PURE__*/function (_SVGElement) {
1678
+ function SVGCanvasElement(container) {
1679
+ var _this;
1680
+ _this = _SVGElement.call(this, 'svg') || this; // Create svg element for holding the whole map
1681
+
1682
+ _this._container = container;
1683
+
1684
+ // Create the defs element
1685
+ _this._defsElement = new SVGElement('defs');
1686
+
1687
+ // Create group element which will hold the paths (regions)
1688
+ _this._rootElement = new SVGElement('g', {
1689
+ id: 'jvm-regions-group'
1690
+ });
1691
+
1692
+ // Append the defs element to the this.node (SVG tag)
1693
+ _this.node.appendChild(_this._defsElement.node);
1694
+
1695
+ // Append the group to this.node (SVG tag)
1696
+ _this.node.appendChild(_this._rootElement.node);
1697
+
1698
+ // Append this.node (SVG tag) to the container
1699
+ _this._container.appendChild(_this.node);
1700
+ return _this;
1701
+ }
1702
+ _inheritsLoose(SVGCanvasElement, _SVGElement);
1703
+ var _proto = SVGCanvasElement.prototype;
1704
+ _proto.setSize = function setSize(width, height) {
1705
+ this.node.setAttribute('width', width);
1706
+ this.node.setAttribute('height', height);
1707
+ };
1708
+ _proto.applyTransformParams = function applyTransformParams(scale, transX, transY) {
1709
+ this._rootElement.node.setAttribute('transform', "scale(" + scale + ") translate(" + transX + ", " + transY + ")");
1710
+ }
1711
+
1712
+ // Create `path` element
1713
+ ;
1714
+ _proto.createPath = function createPath(config, style) {
1715
+ var path = new SVGShapeElement('path', config, style);
1716
+ path.node.setAttribute('fill-rule', 'evenodd');
1717
+ return this._add(path);
1718
+ }
1719
+
1720
+ // Create `circle` element
1721
+ ;
1722
+ _proto.createCircle = function createCircle(config, style, group) {
1723
+ var circle = new SVGShapeElement('circle', config, style);
1724
+ return this._add(circle, group);
1725
+ }
1726
+
1727
+ // Create `line` element
1728
+ ;
1729
+ _proto.createLine = function createLine(config, style, group) {
1730
+ var line = new SVGShapeElement('line', config, style);
1731
+ return this._add(line, group);
1732
+ }
1733
+
1734
+ // Create `text` element
1735
+ ;
1736
+ _proto.createText = function createText(config, style, group) {
1737
+ var text = new SVGTextElement(config, style);
1738
+ return this._add(text, group);
1739
+ }
1740
+
1741
+ // Create `image` element
1742
+ ;
1743
+ _proto.createImage = function createImage(config, style, group) {
1744
+ var image = new SVGImageElement(config, style);
1745
+ return this._add(image, group);
1746
+ }
1747
+
1748
+ // Create `g` element
1749
+ ;
1750
+ _proto.createGroup = function createGroup(id) {
1751
+ var group = new SVGElement('g');
1752
+ this.node.appendChild(group.node);
1753
+ if (id) {
1754
+ group.node.id = id;
1755
+ }
1756
+ group.canvas = this;
1757
+ return group;
1758
+ }
1759
+
1760
+ // Add some element to a spcific group or the root element if the group isn't given
1761
+ ;
1762
+ _proto._add = function _add(element, group) {
1763
+ group = group || this._rootElement;
1764
+ group.node.appendChild(element.node);
1765
+ return element;
1766
+ };
1767
+ return SVGCanvasElement;
1768
+ }(SVGElement);
1769
+
1770
+ /**
1771
+ * ------------------------------------------------------------------------
1772
+ * Class Definition
1773
+ * ------------------------------------------------------------------------
1774
+ */
1775
+ var Tooltip = /*#__PURE__*/function (_BaseComponent) {
1776
+ function Tooltip(map) {
1777
+ var _this;
1778
+ _this = _BaseComponent.call(this) || this;
1779
+ var tooltip = createElement('div', 'jvm-tooltip');
1780
+ _this._map = map;
1781
+ _this._tooltip = document.body.appendChild(tooltip);
1782
+ _this._bindEventListeners();
1783
+ return _this || _assertThisInitialized(_this);
1784
+ }
1785
+ _inheritsLoose(Tooltip, _BaseComponent);
1786
+ var _proto = Tooltip.prototype;
1787
+ _proto._bindEventListeners = function _bindEventListeners() {
1788
+ var _this2 = this;
1789
+ EventHandler.on(this._map.container, 'mousemove', function (event) {
1790
+ if (!_this2._tooltip.classList.contains('active')) {
1791
+ return;
1792
+ }
1793
+ var container = findElement(_this2._map.container, '#jvm-regions-group').getBoundingClientRect();
1794
+ var space = 5; // Space between the cursor and tooltip element
1795
+
1796
+ // Tooltip
1797
+ var _this2$_tooltip$getBo = _this2._tooltip.getBoundingClientRect(),
1798
+ height = _this2$_tooltip$getBo.height,
1799
+ width = _this2$_tooltip$getBo.width;
1800
+ var topIsPassed = event.clientY <= container.top + height + space;
1801
+ var top = event.pageY - height - space;
1802
+ var left = event.pageX - width - space;
1803
+
1804
+ // Ensure the tooltip will never cross outside the canvas area(map)
1805
+ if (topIsPassed) {
1806
+ // Top:
1807
+ top += height + space;
1808
+
1809
+ // The cursor is a bit larger from left side
1810
+ left -= space * 2;
1811
+ }
1812
+ if (event.clientX < container.left + width + space) {
1813
+ // Left:
1814
+ left = event.pageX + space + 2;
1815
+ if (topIsPassed) {
1816
+ left += space * 2;
1817
+ }
1818
+ }
1819
+ _this2.css({
1820
+ top: top + "px",
1821
+ left: left + "px"
1822
+ });
1823
+ });
1824
+ };
1825
+ _proto.getElement = function getElement() {
1826
+ return this._tooltip;
1827
+ };
1828
+ _proto.show = function show() {
1829
+ this._tooltip.classList.add('active');
1830
+ };
1831
+ _proto.hide = function hide() {
1832
+ this._tooltip.classList.remove('active');
1833
+ };
1834
+ _proto.text = function text(string, html) {
1835
+ if (html === void 0) {
1836
+ html = false;
1837
+ }
1838
+ var property = html ? 'innerHTML' : 'textContent';
1839
+ if (!string) {
1840
+ return this._tooltip[property];
1841
+ }
1842
+ this._tooltip[property] = string;
1843
+ };
1844
+ _proto.css = function css(_css) {
1845
+ for (var style in _css) {
1846
+ this._tooltip.style[style] = _css[style];
1847
+ }
1848
+ return this;
1849
+ };
1850
+ return Tooltip;
1851
+ }(BaseComponent);
1852
+
1853
+ var DataVisualization = /*#__PURE__*/function () {
1854
+ function DataVisualization(_ref, map) {
1855
+ var scale = _ref.scale,
1856
+ values = _ref.values;
1857
+ this._scale = scale;
1858
+ this._values = values;
1859
+ this._fromColor = this.hexToRgb(scale[0]);
1860
+ this._toColor = this.hexToRgb(scale[1]);
1861
+ this._map = map;
1862
+ this.setMinMaxValues(values);
1863
+ this.visualize();
1864
+ }
1865
+ var _proto = DataVisualization.prototype;
1866
+ _proto.setMinMaxValues = function setMinMaxValues(values) {
1867
+ this.min = Number.MAX_VALUE;
1868
+ this.max = 0;
1869
+ for (var value in values) {
1870
+ value = parseFloat(values[value]);
1871
+ if (value > this.max) {
1872
+ this.max = value;
1873
+ }
1874
+ if (value < this.min) {
1875
+ this.min = value;
1876
+ }
1877
+ }
1878
+ };
1879
+ _proto.visualize = function visualize() {
1880
+ var attrs = {},
1881
+ value;
1882
+ for (var regionCode in this._values) {
1883
+ value = parseFloat(this._values[regionCode]);
1884
+ if (!isNaN(value)) {
1885
+ attrs[regionCode] = this.getValue(value);
1886
+ }
1887
+ }
1888
+ this.setAttributes(attrs);
1889
+ };
1890
+ _proto.setAttributes = function setAttributes(attrs) {
1891
+ for (var code in attrs) {
1892
+ if (this._map.regions[code]) {
1893
+ this._map.regions[code].element.setStyle('fill', attrs[code]);
1894
+ }
1895
+ }
1896
+ };
1897
+ _proto.getValue = function getValue(value) {
1898
+ if (this.min === this.max) {
1899
+ return "#" + this._toColor.join('');
1900
+ }
1901
+ var hex,
1902
+ color = '#';
1903
+ for (var i = 0; i < 3; i++) {
1904
+ hex = Math.round(this._fromColor[i] + (this._toColor[i] - this._fromColor[i]) * ((value - this.min) / (this.max - this.min))).toString(16);
1905
+ color += (hex.length === 1 ? '0' : '') + hex;
1906
+ }
1907
+ return color;
1908
+ };
1909
+ _proto.hexToRgb = function hexToRgb(h) {
1910
+ var r = 0,
1911
+ g = 0,
1912
+ b = 0;
1913
+ if (h.length == 4) {
1914
+ r = '0x' + h[1] + h[1];
1915
+ g = '0x' + h[2] + h[2];
1916
+ b = '0x' + h[3] + h[3];
1917
+ } else if (h.length == 7) {
1918
+ r = '0x' + h[1] + h[2];
1919
+ g = '0x' + h[3] + h[4];
1920
+ b = '0x' + h[5] + h[6];
1921
+ }
1922
+ return [parseInt(r), parseInt(g), parseInt(b)];
1923
+ };
1924
+ return DataVisualization;
1925
+ }();
1926
+
1927
+ /**
1928
+ * ------------------------------------------------------------------------
1929
+ * Class Definition
1930
+ * ------------------------------------------------------------------------
1931
+ */
1932
+ var Map = /*#__PURE__*/function () {
1933
+ function Map(options) {
1934
+ var _this = this;
1935
+ if (options === void 0) {
1936
+ options = {};
1937
+ }
1938
+ // Merge the given options with the default options
1939
+ this.params = merge(Map.defaults, options, true);
1940
+
1941
+ // Throw an error if the given map name doesn't match
1942
+ // the map that was set in map file
1943
+ if (!Map.maps[this.params.map]) {
1944
+ throw new Error("Attempt to use map which was not loaded: " + options.map);
1945
+ }
1946
+ this.regions = {};
1947
+ this.scale = 1;
1948
+ this.transX = 0;
1949
+ this.transY = 0;
1950
+ this._mapData = Map.maps[this.params.map];
1951
+ this._markers = {};
1952
+ this._lines = {};
1953
+ this._defaultWidth = this._mapData.width;
1954
+ this._defaultHeight = this._mapData.height;
1955
+ this._height = 0;
1956
+ this._width = 0;
1957
+ this._baseScale = 1;
1958
+ this._baseTransX = 0;
1959
+ this._baseTransY = 0;
1960
+
1961
+ // `document` is already ready, just initialise now
1962
+ if (document.readyState !== 'loading') {
1963
+ this._init();
1964
+ } else {
1965
+ // Wait until `document` is ready
1966
+ window.addEventListener('DOMContentLoaded', function () {
1967
+ return _this._init();
1968
+ });
1969
+ }
1970
+ }
1971
+ var _proto = Map.prototype;
1972
+ _proto._init = function _init() {
1973
+ var options = this.params;
1974
+ this.container = getElement(options.selector);
1975
+ this.container.classList.add('jvm-container');
1976
+
1977
+ // The map canvas element
1978
+ this.canvas = new SVGCanvasElement(this.container);
1979
+
1980
+ // Set the map's background color
1981
+ this.setBackgroundColor(options.backgroundColor);
1982
+
1983
+ // Create regions
1984
+ this._createRegions();
1985
+
1986
+ // Update size
1987
+ this.updateSize();
1988
+
1989
+ // Create lines
1990
+ this._createLines(options.lines || {}, options.markers || {});
1991
+
1992
+ // Create markers
1993
+ this._createMarkers(options.markers);
1994
+
1995
+ // Position labels
1996
+ this._repositionLabels();
1997
+
1998
+ // Setup the container events
1999
+ this._setupContainerEvents();
2000
+
2001
+ // Setup regions/markers events
2002
+ this._setupElementEvents();
2003
+
2004
+ // Create zoom buttons if `zoomButtons` is presented
2005
+ if (options.zoomButtons) {
2006
+ this._setupZoomButtons();
2007
+ }
2008
+
2009
+ // Create toolip
2010
+ if (options.showTooltip) {
2011
+ this._tooltip = new Tooltip(this);
2012
+ }
2013
+
2014
+ // Set selected regions if any
2015
+ if (options.selectedRegions) {
2016
+ this._setSelected('regions', options.selectedRegions);
2017
+ }
2018
+
2019
+ // Set selected regions if any
2020
+ if (options.selectedMarkers) {
2021
+ this._setSelected('_markers', options.selectedMarkers);
2022
+ }
2023
+
2024
+ // Set focus on a spcific region
2025
+ if (options.focusOn) {
2026
+ this.setFocus(options.focusOn);
2027
+ }
2028
+
2029
+ // Data visualization
2030
+ if (options.visualizeData) {
2031
+ this.dataVisualization = new DataVisualization(options.visualizeData, this);
2032
+ }
2033
+
2034
+ // Bind touch events if true
2035
+ if (options.bindTouchEvents) {
2036
+ if ('ontouchstart' in window || window.DocumentTouch && document instanceof DocumentTouch) {
2037
+ this._setupContainerTouchEvents();
2038
+ }
2039
+ }
2040
+
2041
+ // Create series if any
2042
+ if (options.series) {
2043
+ this.container.appendChild(this.legendHorizontal = createElement('div', 'jvm-series-container jvm-series-h'));
2044
+ this.container.appendChild(this.legendVertical = createElement('div', 'jvm-series-container jvm-series-v'));
2045
+ this._createSeries();
2046
+ }
2047
+
2048
+ // Fire loaded event
2049
+ this._emit(Events.onLoaded, [this]);
2050
+ }
2051
+
2052
+ // Public
2053
+ ;
2054
+ _proto.setBackgroundColor = function setBackgroundColor(color) {
2055
+ this.container.style.backgroundColor = color;
2056
+ }
2057
+
2058
+ // Region methods
2059
+ ;
2060
+ _proto.getSelectedRegions = function getSelectedRegions() {
2061
+ return this._getSelected('regions');
2062
+ };
2063
+ _proto.clearSelectedRegions = function clearSelectedRegions(regions) {
2064
+ var _this2 = this;
2065
+ if (regions === void 0) {
2066
+ regions = undefined;
2067
+ }
2068
+ regions = this._normalizeRegions(regions) || this._getSelected('regions');
2069
+ regions.forEach(function (key) {
2070
+ _this2.regions[key].element.select(false);
2071
+ });
2072
+ };
2073
+ _proto.setSelectedRegions = function setSelectedRegions(regions) {
2074
+ this.clearSelectedRegions();
2075
+ this._setSelected('regions', this._normalizeRegions(regions));
2076
+ }
2077
+
2078
+ // Markers methods
2079
+ ;
2080
+ _proto.getSelectedMarkers = function getSelectedMarkers() {
2081
+ return this._getSelected('_markers');
2082
+ };
2083
+ _proto.clearSelectedMarkers = function clearSelectedMarkers() {
2084
+ this._clearSelected('_markers');
2085
+ };
2086
+ _proto.addMarkers = function addMarkers(config) {
2087
+ config = Array.isArray(config) ? config : [config];
2088
+ this._createMarkers(config, true);
2089
+ };
2090
+ _proto.removeMarkers = function removeMarkers(markers) {
2091
+ var _this3 = this;
2092
+ if (!markers) {
2093
+ markers = Object.keys(this._markers);
2094
+ }
2095
+ markers.forEach(function (index) {
2096
+ // Remove the element from the DOM
2097
+ _this3._markers[index].element.remove();
2098
+ // Remove the element from markers object
2099
+ delete _this3._markers[index];
2100
+ });
2101
+ };
2102
+ _proto.addLine = function addLine(from, to, style) {
2103
+ if (style === void 0) {
2104
+ style = {};
2105
+ }
2106
+ console.warn('`addLine` method is deprecated, please use `addLines` instead.');
2107
+ this._createLines([{
2108
+ from: from,
2109
+ to: to,
2110
+ style: style
2111
+ }], this._markers, true);
2112
+ };
2113
+ _proto.addLines = function addLines(config) {
2114
+ var uids = this._getLinesAsUids();
2115
+ if (!Array.isArray(config)) {
2116
+ config = [config];
2117
+ }
2118
+ this._createLines(config.filter(function (line) {
2119
+ return !(uids.indexOf(getLineUid(line.from, line.to)) > -1);
2120
+ }), this._markers, true);
2121
+ };
2122
+ _proto.removeLines = function removeLines(lines) {
2123
+ var _this4 = this;
2124
+ if (Array.isArray(lines)) {
2125
+ lines = lines.map(function (line) {
2126
+ return getLineUid(line.from, line.to);
2127
+ });
2128
+ } else {
2129
+ lines = this._getLinesAsUids();
2130
+ }
2131
+ lines.forEach(function (uid) {
2132
+ _this4._lines[uid].dispose();
2133
+ delete _this4._lines[uid];
2134
+ });
2135
+ };
2136
+ _proto.removeLine = function removeLine(from, to) {
2137
+ console.warn('`removeLine` method is deprecated, please use `removeLines` instead.');
2138
+ var uid = getLineUid(from, to);
2139
+ if (this._lines.hasOwnProperty(uid)) {
2140
+ this._lines[uid].element.remove();
2141
+ delete this._lines[uid];
2142
+ }
2143
+ }
2144
+
2145
+ // Reset map
2146
+ ;
2147
+ _proto.reset = function reset() {
2148
+ for (var key in this.series) {
2149
+ for (var i = 0; i < this.series[key].length; i++) {
2150
+ this.series[key][i].clear();
2151
+ }
2152
+ }
2153
+ if (this.legendHorizontal) {
2154
+ removeElement(this.legendHorizontal);
2155
+ this.legendHorizontal = null;
2156
+ }
2157
+ if (this.legendVertical) {
2158
+ removeElement(this.legendVertical);
2159
+ this.legendVertical = null;
2160
+ }
2161
+ this.scale = this._baseScale;
2162
+ this.transX = this._baseTransX;
2163
+ this.transY = this._baseTransY;
2164
+ this._applyTransform();
2165
+ this.clearSelectedMarkers();
2166
+ this.clearSelectedRegions();
2167
+ this.removeMarkers();
2168
+ }
2169
+
2170
+ // Destroy the map
2171
+ ;
2172
+ _proto.destroy = function destroy(destroyInstance) {
2173
+ var _this5 = this;
2174
+ if (destroyInstance === void 0) {
2175
+ destroyInstance = true;
2176
+ }
2177
+ // Remove event registry
2178
+ EventHandler.flush();
2179
+
2180
+ // Remove tooltip from DOM and memory
2181
+ this._tooltip.dispose();
2182
+
2183
+ // Fire destroyed event
2184
+ this._emit(Events.onDestroyed);
2185
+
2186
+ // Remove references
2187
+ if (destroyInstance) {
2188
+ Object.keys(this).forEach(function (key) {
2189
+ try {
2190
+ delete _this5[key];
2191
+ } catch (e) {}
2192
+ });
2193
+ }
2194
+ };
2195
+ _proto.extend = function extend(name, callback) {
2196
+ if (typeof this[name] === 'function') {
2197
+ throw new Error("The method [" + name + "] does already exist, please use another name.");
2198
+ }
2199
+ Map.prototype[name] = callback;
2200
+ }
2201
+
2202
+ // Private
2203
+ ;
2204
+ _proto._emit = function _emit(eventName, args) {
2205
+ for (var event in Events) {
2206
+ if (Events[event] === eventName && typeof this.params[event] === 'function') {
2207
+ this.params[event].apply(this, args);
2208
+ }
2209
+ }
2210
+ }
2211
+
2212
+ // Get selected markers/regions
2213
+ ;
2214
+ _proto._getSelected = function _getSelected(type) {
2215
+ var selected = [];
2216
+ for (var key in this[type]) {
2217
+ if (this[type][key].element.isSelected) {
2218
+ selected.push(key);
2219
+ }
2220
+ }
2221
+ return selected;
2222
+ };
2223
+ _proto._setSelected = function _setSelected(type, keys) {
2224
+ var _this6 = this;
2225
+ keys.forEach(function (key) {
2226
+ if (_this6[type][key]) {
2227
+ _this6[type][key].element.select(true);
2228
+ }
2229
+ });
2230
+ };
2231
+ _proto._clearSelected = function _clearSelected(type) {
2232
+ var _this7 = this;
2233
+ this._getSelected(type).forEach(function (key) {
2234
+ _this7[type][key].element.select(false);
2235
+ });
2236
+ };
2237
+ _proto._getLinesAsUids = function _getLinesAsUids() {
2238
+ return Object.keys(this._lines);
2239
+ };
2240
+ _proto._normalizeRegions = function _normalizeRegions(regions) {
2241
+ return typeof regions === 'string' ? [regions] : regions;
2242
+ };
2243
+ return Map;
2244
+ }();
2245
+ Map.maps = {};
2246
+ Map.defaults = Defaults;
2247
+ Object.assign(Map.prototype, core);
2248
+
2249
+ /**
2250
+ * jsVectorMap
2251
+ * Copyrights (c) Mustafa Omar https://github.com/themustafaomar
2252
+ * Released under the MIT License.
2253
+ */
2254
+
2255
+ /**
2256
+ * ------------------------------------------------------------------------
2257
+ * Class Definition
2258
+ * ------------------------------------------------------------------------
2259
+ */
2260
+ var jsVectorMap = /*#__PURE__*/function () {
2261
+ function jsVectorMap(options) {
2262
+ if (options === void 0) {
2263
+ options = {};
2264
+ }
2265
+ if (!options.selector) {
2266
+ throw new Error('Selector is not given.');
2267
+ }
2268
+ return new Map(options);
2269
+ }
2270
+
2271
+ // Public
2272
+ jsVectorMap.addMap = function addMap(name, map) {
2273
+ Map.maps[name] = map;
2274
+ };
2275
+ return jsVectorMap;
2276
+ }();
2277
+ var index = window.jsVectorMap = jsVectorMap;
2278
+
2279
+ module.exports = index;