@tabler/core 1.0.0-beta10 → 1.0.0-beta12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (428) hide show
  1. package/README.md +66 -21
  2. package/dist/css/demo.css +251 -379
  3. package/dist/css/demo.min.css +3 -3
  4. package/dist/css/demo.rtl.css +251 -379
  5. package/dist/css/demo.rtl.min.css +3 -3
  6. package/dist/css/tabler-flags.css +266 -529
  7. package/dist/css/tabler-flags.min.css +3 -3
  8. package/dist/css/tabler-flags.rtl.css +266 -529
  9. package/dist/css/tabler-flags.rtl.min.css +3 -3
  10. package/dist/css/tabler-payments.css +127 -252
  11. package/dist/css/tabler-payments.min.css +2 -2
  12. package/dist/css/tabler-payments.rtl.css +127 -252
  13. package/dist/css/tabler-payments.rtl.min.css +2 -2
  14. package/dist/css/tabler-vendors.css +526 -611
  15. package/dist/css/tabler-vendors.min.css +3 -3
  16. package/dist/css/tabler-vendors.rtl.css +526 -611
  17. package/dist/css/tabler-vendors.rtl.min.css +3 -3
  18. package/dist/css/tabler.css +11259 -13083
  19. package/dist/css/tabler.min.css +4 -4
  20. package/dist/css/tabler.rtl.css +11251 -13090
  21. package/dist/css/tabler.rtl.min.css +4 -4
  22. package/dist/js/demo-theme.js +32 -0
  23. package/dist/js/demo-theme.min.js +9 -0
  24. package/dist/js/demo.js +2 -12
  25. package/dist/js/demo.min.js +3 -3
  26. package/dist/js/tabler.esm.js +1692 -1541
  27. package/dist/js/tabler.esm.min.js +9 -3
  28. package/dist/js/tabler.js +1687 -1514
  29. package/dist/js/tabler.min.js +9 -3
  30. package/dist/libs/apexcharts/dist/apexcharts.amd.js +2 -0
  31. package/dist/libs/apexcharts/dist/apexcharts.common.js +14 -0
  32. package/dist/libs/apexcharts/dist/apexcharts.css +691 -0
  33. package/dist/libs/apexcharts/dist/apexcharts.esm.js +14 -0
  34. package/dist/libs/apexcharts/dist/apexcharts.js +31979 -0
  35. package/dist/libs/apexcharts/dist/apexcharts.min.js +4 -4
  36. package/dist/libs/apexcharts/dist/locales/ar.json +63 -0
  37. package/dist/libs/apexcharts/dist/locales/ca.json +55 -0
  38. package/dist/libs/apexcharts/dist/locales/cs.json +55 -0
  39. package/dist/libs/apexcharts/dist/locales/de.json +55 -0
  40. package/dist/libs/apexcharts/dist/locales/el.json +55 -0
  41. package/dist/libs/apexcharts/dist/locales/en.json +55 -0
  42. package/dist/libs/apexcharts/dist/locales/es.json +55 -0
  43. package/dist/libs/apexcharts/dist/locales/et.json +63 -0
  44. package/dist/libs/apexcharts/dist/locales/fa.json +55 -0
  45. package/dist/libs/apexcharts/dist/locales/fi.json +55 -0
  46. package/dist/libs/apexcharts/dist/locales/fr.json +55 -0
  47. package/dist/libs/apexcharts/dist/locales/he.json +55 -0
  48. package/dist/libs/apexcharts/dist/locales/hi.json +55 -0
  49. package/dist/libs/apexcharts/dist/locales/hr.json +55 -0
  50. package/dist/libs/apexcharts/dist/locales/hu.json +64 -0
  51. package/dist/libs/apexcharts/dist/locales/hy.json +55 -0
  52. package/dist/libs/apexcharts/dist/locales/id.json +47 -0
  53. package/dist/libs/apexcharts/dist/locales/it.json +55 -0
  54. package/dist/libs/apexcharts/dist/locales/ja.json +55 -0
  55. package/dist/libs/apexcharts/dist/locales/ka.json +55 -0
  56. package/dist/libs/apexcharts/dist/locales/ko.json +55 -0
  57. package/dist/libs/apexcharts/dist/locales/lt.json +55 -0
  58. package/dist/libs/apexcharts/dist/locales/lv.json +64 -0
  59. package/dist/libs/apexcharts/dist/locales/nb.json +55 -0
  60. package/dist/libs/apexcharts/dist/locales/nl.json +55 -0
  61. package/dist/libs/apexcharts/dist/locales/pl.json +55 -0
  62. package/dist/libs/apexcharts/dist/locales/pt-br.json +55 -0
  63. package/dist/libs/apexcharts/dist/locales/pt.json +55 -0
  64. package/dist/libs/apexcharts/dist/locales/rs.json +55 -0
  65. package/dist/libs/apexcharts/dist/locales/ru.json +55 -0
  66. package/dist/libs/apexcharts/dist/locales/se.json +55 -0
  67. package/dist/libs/apexcharts/dist/locales/sk.json +55 -0
  68. package/dist/libs/apexcharts/dist/locales/sl.json +55 -0
  69. package/dist/libs/apexcharts/dist/locales/sq.json +55 -0
  70. package/dist/libs/apexcharts/dist/locales/th.json +55 -0
  71. package/dist/libs/apexcharts/dist/locales/tr.json +55 -0
  72. package/dist/libs/apexcharts/dist/locales/ua.json +55 -0
  73. package/dist/libs/apexcharts/dist/locales/zh-cn.json +55 -0
  74. package/dist/libs/apexcharts/dist/locales/zh-tw.json +55 -0
  75. package/dist/libs/bootstrap/dist/js/bootstrap.bundle.js +7090 -0
  76. package/dist/libs/bootstrap/dist/js/bootstrap.bundle.js.map +1 -0
  77. package/dist/libs/bootstrap/dist/js/bootstrap.bundle.min.js +3 -3
  78. package/dist/libs/bootstrap/dist/js/bootstrap.bundle.min.js.map +1 -0
  79. package/dist/libs/bootstrap/dist/js/bootstrap.esm.js +5217 -0
  80. package/dist/libs/bootstrap/dist/js/bootstrap.esm.js.map +1 -0
  81. package/dist/libs/bootstrap/dist/js/bootstrap.esm.min.js +7 -0
  82. package/dist/libs/bootstrap/dist/js/bootstrap.esm.min.js.map +1 -0
  83. package/dist/libs/bootstrap/dist/js/bootstrap.js +5264 -0
  84. package/dist/libs/bootstrap/dist/js/bootstrap.js.map +1 -0
  85. package/dist/libs/bootstrap/dist/js/bootstrap.min.js +7 -0
  86. package/dist/libs/bootstrap/dist/js/bootstrap.min.js.map +1 -0
  87. package/dist/libs/countup.js/dist/countUp.d.ts +61 -0
  88. package/dist/libs/countup.js/dist/countUp.js +25 -22
  89. package/dist/libs/countup.js/dist/countUp.min.js +1 -0
  90. package/dist/libs/countup.js/dist/countUp.umd.js +293 -0
  91. package/dist/libs/countup.js/dist/countUp.withPolyfill.min.js +1 -0
  92. package/dist/libs/dropzone/dist/basic.css +1 -0
  93. package/dist/libs/dropzone/dist/basic.css.map +1 -0
  94. package/dist/libs/dropzone/dist/dropzone-min.js +2 -0
  95. package/dist/libs/dropzone/dist/dropzone-min.js.map +1 -0
  96. package/dist/libs/dropzone/dist/dropzone.css +1 -0
  97. package/dist/libs/dropzone/dist/dropzone.css.map +1 -0
  98. package/dist/libs/dropzone/dist/dropzone.js +3068 -0
  99. package/dist/libs/dropzone/dist/dropzone.js.map +1 -0
  100. package/dist/libs/dropzone/dist/dropzone.mjs +2111 -0
  101. package/dist/libs/dropzone/dist/dropzone.mjs.map +1 -0
  102. package/dist/libs/fslightbox/LICENSE +21 -0
  103. package/dist/libs/fslightbox/README.md +62 -0
  104. package/dist/libs/fslightbox/index.js +1 -0
  105. package/dist/libs/fslightbox/jest-setup.js +1 -0
  106. package/dist/libs/fslightbox/package.json +72 -0
  107. package/dist/libs/jsvectormap/dist/js/jsvectormap.js +2658 -0
  108. package/dist/libs/jsvectormap/dist/js/jsvectormap.min.js +1 -1
  109. package/dist/libs/jsvectormap/dist/maps/world-merc.js +1 -1
  110. package/dist/libs/jsvectormap/dist/maps/world.js +1 -1
  111. package/dist/libs/list.js/dist/list.js +2020 -0
  112. package/dist/libs/list.js/dist/list.js.map +1 -0
  113. package/dist/libs/list.js/dist/list.min.js.map +1 -0
  114. package/dist/libs/litepicker/dist/bundle.js +52 -0
  115. package/dist/libs/litepicker/dist/css/litepicker.css +13 -0
  116. package/dist/libs/litepicker/dist/css/plugins/keyboardnav.js.css +12 -0
  117. package/dist/libs/litepicker/dist/css/plugins/mobilefriendly.js.css +133 -0
  118. package/dist/libs/litepicker/dist/css/plugins/multiselect.js.css +54 -0
  119. package/dist/libs/litepicker/dist/css/plugins/ranges.js.css +81 -0
  120. package/dist/libs/litepicker/dist/js/main.js +13 -0
  121. package/dist/libs/litepicker/dist/litepicker.amd.js +12 -0
  122. package/dist/libs/litepicker/dist/litepicker.commonjs2.js +12 -0
  123. package/dist/libs/litepicker/dist/litepicker.umd.js +12 -0
  124. package/dist/libs/litepicker/dist/nocss/litepicker.amd.js +12 -0
  125. package/dist/libs/litepicker/dist/nocss/litepicker.commonjs2.js +12 -0
  126. package/dist/libs/litepicker/dist/nocss/litepicker.js +12 -0
  127. package/dist/libs/litepicker/dist/nocss/litepicker.umd.js +12 -0
  128. package/dist/libs/litepicker/dist/nocss/plugins/keyboardnav.js +11 -0
  129. package/dist/libs/litepicker/dist/nocss/plugins/mobilefriendly.js +11 -0
  130. package/dist/libs/litepicker/dist/nocss/plugins/multiselect.js +11 -0
  131. package/dist/libs/litepicker/dist/nocss/plugins/ranges.js +11 -0
  132. package/dist/libs/litepicker/dist/plugins/keyboardnav.js +11 -0
  133. package/dist/libs/litepicker/dist/plugins/mobilefriendly.js +11 -0
  134. package/dist/libs/litepicker/dist/plugins/multiselect.js +11 -0
  135. package/dist/libs/litepicker/dist/plugins/ranges.js +11 -0
  136. package/dist/libs/litepicker/dist/types/calendar.d.ts +14 -0
  137. package/dist/libs/litepicker/dist/types/core.d.ts +23 -0
  138. package/dist/libs/litepicker/dist/types/datetime.d.ts +41 -0
  139. package/dist/libs/litepicker/dist/types/index.d.ts +4 -0
  140. package/dist/libs/litepicker/dist/types/interfaces.d.ts +80 -0
  141. package/dist/libs/litepicker/dist/types/litepicker.d.ts +25 -0
  142. package/dist/libs/litepicker/dist/types/methods.d.ts +20 -0
  143. package/dist/libs/litepicker/dist/types/utils.d.ts +4 -0
  144. package/dist/libs/litepicker/dist/types/window.d.ts +6 -0
  145. package/dist/libs/nouislider/dist/nouislider.css +304 -0
  146. package/dist/libs/nouislider/dist/nouislider.d.ts +198 -0
  147. package/dist/libs/nouislider/dist/nouislider.js +2254 -0
  148. package/dist/libs/nouislider/dist/nouislider.min.css +1 -0
  149. package/dist/libs/nouislider/dist/nouislider.min.js +1 -1
  150. package/dist/libs/nouislider/dist/nouislider.min.mjs +1 -0
  151. package/dist/libs/nouislider/dist/nouislider.mjs +2243 -0
  152. package/dist/libs/plyr/dist/plyr.css +1 -0
  153. package/dist/libs/plyr/dist/plyr.js +8764 -0
  154. package/dist/libs/plyr/dist/plyr.min.js +2 -0
  155. package/dist/libs/plyr/dist/plyr.min.js.map +1 -0
  156. package/dist/libs/plyr/dist/plyr.min.mjs +1 -0
  157. package/dist/libs/plyr/dist/plyr.min.mjs.map +1 -0
  158. package/dist/libs/plyr/dist/plyr.mjs +8756 -0
  159. package/dist/libs/plyr/dist/plyr.polyfilled.js +9301 -0
  160. package/dist/libs/plyr/dist/plyr.polyfilled.min.js +2 -0
  161. package/dist/libs/plyr/dist/plyr.polyfilled.min.js.map +1 -0
  162. package/dist/libs/plyr/dist/plyr.polyfilled.min.mjs +1 -0
  163. package/dist/libs/plyr/dist/plyr.polyfilled.min.mjs.map +1 -0
  164. package/dist/libs/plyr/dist/plyr.polyfilled.mjs +9293 -0
  165. package/dist/libs/plyr/dist/plyr.svg +1 -0
  166. package/dist/libs/tinymce/CHANGELOG.md +2957 -0
  167. package/dist/libs/tinymce/README.md +71 -0
  168. package/dist/libs/tinymce/bower.json +27 -0
  169. package/dist/libs/tinymce/composer.json +52 -0
  170. package/dist/libs/tinymce/icons/default/icons.js +182 -0
  171. package/dist/libs/tinymce/icons/default/icons.min.js +1 -0
  172. package/dist/libs/tinymce/icons/default/index.js +7 -0
  173. package/dist/libs/tinymce/license.txt +21 -0
  174. package/dist/libs/tinymce/models/dom/index.js +7 -0
  175. package/dist/libs/tinymce/models/dom/model.js +7975 -0
  176. package/dist/libs/tinymce/models/dom/model.min.js +4 -0
  177. package/dist/libs/tinymce/package.json +32 -0
  178. package/dist/libs/tinymce/plugins/advlist/index.js +7 -0
  179. package/dist/libs/tinymce/plugins/advlist/plugin.js +246 -0
  180. package/dist/libs/tinymce/plugins/advlist/plugin.min.js +4 -0
  181. package/dist/libs/tinymce/plugins/anchor/index.js +7 -0
  182. package/dist/libs/tinymce/plugins/anchor/plugin.js +195 -0
  183. package/dist/libs/tinymce/plugins/anchor/plugin.min.js +4 -0
  184. package/dist/libs/tinymce/plugins/autolink/index.js +7 -0
  185. package/dist/libs/tinymce/plugins/autolink/plugin.js +232 -0
  186. package/dist/libs/tinymce/plugins/autolink/plugin.min.js +4 -0
  187. package/dist/libs/tinymce/plugins/autoresize/index.js +7 -0
  188. package/dist/libs/tinymce/plugins/autoresize/plugin.js +156 -0
  189. package/dist/libs/tinymce/plugins/autoresize/plugin.min.js +4 -0
  190. package/dist/libs/tinymce/plugins/autosave/index.js +7 -0
  191. package/dist/libs/tinymce/plugins/autosave/plugin.js +232 -0
  192. package/dist/libs/tinymce/plugins/autosave/plugin.min.js +4 -0
  193. package/dist/libs/tinymce/plugins/charmap/index.js +7 -0
  194. package/dist/libs/tinymce/plugins/charmap/plugin.js +1636 -0
  195. package/dist/libs/tinymce/plugins/charmap/plugin.min.js +4 -0
  196. package/dist/libs/tinymce/plugins/code/index.js +7 -0
  197. package/dist/libs/tinymce/plugins/code/plugin.js +85 -0
  198. package/dist/libs/tinymce/plugins/code/plugin.min.js +4 -0
  199. package/dist/libs/tinymce/plugins/codesample/index.js +7 -0
  200. package/dist/libs/tinymce/plugins/codesample/plugin.js +2451 -0
  201. package/dist/libs/tinymce/plugins/codesample/plugin.min.js +4 -0
  202. package/dist/libs/tinymce/plugins/directionality/index.js +7 -0
  203. package/dist/libs/tinymce/plugins/directionality/plugin.js +384 -0
  204. package/dist/libs/tinymce/plugins/directionality/plugin.min.js +4 -0
  205. package/dist/libs/tinymce/plugins/emoticons/index.js +7 -0
  206. package/dist/libs/tinymce/plugins/emoticons/js/emojiimages.js +1 -0
  207. package/dist/libs/tinymce/plugins/emoticons/js/emojiimages.min.js +3 -0
  208. package/dist/libs/tinymce/plugins/emoticons/js/emojis.js +1 -0
  209. package/dist/libs/tinymce/plugins/emoticons/js/emojis.min.js +2 -0
  210. package/dist/libs/tinymce/plugins/emoticons/plugin.js +577 -0
  211. package/dist/libs/tinymce/plugins/emoticons/plugin.min.js +4 -0
  212. package/dist/libs/tinymce/plugins/fullscreen/index.js +7 -0
  213. package/dist/libs/tinymce/plugins/fullscreen/plugin.js +1190 -0
  214. package/dist/libs/tinymce/plugins/fullscreen/plugin.min.js +4 -0
  215. package/dist/libs/tinymce/plugins/help/index.js +7 -0
  216. package/dist/libs/tinymce/plugins/help/plugin.js +848 -0
  217. package/dist/libs/tinymce/plugins/help/plugin.min.js +4 -0
  218. package/dist/libs/tinymce/plugins/image/index.js +7 -0
  219. package/dist/libs/tinymce/plugins/image/plugin.js +1475 -0
  220. package/dist/libs/tinymce/plugins/image/plugin.min.js +4 -0
  221. package/dist/libs/tinymce/plugins/importcss/index.js +7 -0
  222. package/dist/libs/tinymce/plugins/importcss/plugin.js +342 -0
  223. package/dist/libs/tinymce/plugins/importcss/plugin.min.js +4 -0
  224. package/dist/libs/tinymce/plugins/insertdatetime/index.js +7 -0
  225. package/dist/libs/tinymce/plugins/insertdatetime/plugin.js +176 -0
  226. package/dist/libs/tinymce/plugins/insertdatetime/plugin.min.js +4 -0
  227. package/dist/libs/tinymce/plugins/link/index.js +7 -0
  228. package/dist/libs/tinymce/plugins/link/plugin.js +1190 -0
  229. package/dist/libs/tinymce/plugins/link/plugin.min.js +4 -0
  230. package/dist/libs/tinymce/plugins/lists/index.js +7 -0
  231. package/dist/libs/tinymce/plugins/lists/plugin.js +1820 -0
  232. package/dist/libs/tinymce/plugins/lists/plugin.min.js +4 -0
  233. package/dist/libs/tinymce/plugins/media/index.js +7 -0
  234. package/dist/libs/tinymce/plugins/media/plugin.js +1157 -0
  235. package/dist/libs/tinymce/plugins/media/plugin.min.js +4 -0
  236. package/dist/libs/tinymce/plugins/nonbreaking/index.js +7 -0
  237. package/dist/libs/tinymce/plugins/nonbreaking/plugin.js +111 -0
  238. package/dist/libs/tinymce/plugins/nonbreaking/plugin.min.js +4 -0
  239. package/dist/libs/tinymce/plugins/pagebreak/index.js +7 -0
  240. package/dist/libs/tinymce/plugins/pagebreak/plugin.js +105 -0
  241. package/dist/libs/tinymce/plugins/pagebreak/plugin.min.js +4 -0
  242. package/dist/libs/tinymce/plugins/preview/index.js +7 -0
  243. package/dist/libs/tinymce/plugins/preview/plugin.js +97 -0
  244. package/dist/libs/tinymce/plugins/preview/plugin.min.js +4 -0
  245. package/dist/libs/tinymce/plugins/quickbars/index.js +7 -0
  246. package/dist/libs/tinymce/plugins/quickbars/plugin.js +421 -0
  247. package/dist/libs/tinymce/plugins/quickbars/plugin.min.js +4 -0
  248. package/dist/libs/tinymce/plugins/save/index.js +7 -0
  249. package/dist/libs/tinymce/plugins/save/plugin.js +118 -0
  250. package/dist/libs/tinymce/plugins/save/plugin.min.js +4 -0
  251. package/dist/libs/tinymce/plugins/searchreplace/index.js +7 -0
  252. package/dist/libs/tinymce/plugins/searchreplace/plugin.js +1079 -0
  253. package/dist/libs/tinymce/plugins/searchreplace/plugin.min.js +4 -0
  254. package/dist/libs/tinymce/plugins/table/index.js +7 -0
  255. package/dist/libs/tinymce/plugins/table/plugin.js +3393 -0
  256. package/dist/libs/tinymce/plugins/table/plugin.min.js +4 -0
  257. package/dist/libs/tinymce/plugins/template/index.js +7 -0
  258. package/dist/libs/tinymce/plugins/template/plugin.js +548 -0
  259. package/dist/libs/tinymce/plugins/template/plugin.min.js +4 -0
  260. package/dist/libs/tinymce/plugins/visualblocks/index.js +7 -0
  261. package/dist/libs/tinymce/plugins/visualblocks/plugin.js +98 -0
  262. package/dist/libs/tinymce/plugins/visualblocks/plugin.min.js +4 -0
  263. package/dist/libs/tinymce/plugins/visualchars/index.js +7 -0
  264. package/dist/libs/tinymce/plugins/visualchars/plugin.js +506 -0
  265. package/dist/libs/tinymce/plugins/visualchars/plugin.min.js +4 -0
  266. package/dist/libs/tinymce/plugins/wordcount/index.js +7 -0
  267. package/dist/libs/tinymce/plugins/wordcount/plugin.js +404 -0
  268. package/dist/libs/tinymce/plugins/wordcount/plugin.min.js +4 -0
  269. package/dist/libs/tinymce/skins/content/dark/content.css +66 -0
  270. package/dist/libs/tinymce/skins/content/dark/content.min.css +1 -0
  271. package/dist/libs/tinymce/skins/content/default/content.css +61 -0
  272. package/dist/libs/tinymce/skins/content/default/content.min.css +1 -0
  273. package/dist/libs/tinymce/skins/content/document/content.css +66 -0
  274. package/dist/libs/tinymce/skins/content/document/content.min.css +1 -0
  275. package/dist/libs/tinymce/skins/content/tinymce-5/content.css +61 -0
  276. package/dist/libs/tinymce/skins/content/tinymce-5/content.min.css +1 -0
  277. package/dist/libs/tinymce/skins/content/tinymce-5-dark/content.css +66 -0
  278. package/dist/libs/tinymce/skins/content/tinymce-5-dark/content.min.css +1 -0
  279. package/dist/libs/tinymce/skins/content/writer/content.css +62 -0
  280. package/dist/libs/tinymce/skins/content/writer/content.min.css +1 -0
  281. package/dist/libs/tinymce/skins/ui/oxide/content.css +747 -0
  282. package/dist/libs/tinymce/skins/ui/oxide/content.inline.css +741 -0
  283. package/dist/libs/tinymce/skins/ui/oxide/content.inline.min.css +1 -0
  284. package/dist/libs/tinymce/skins/ui/oxide/content.min.css +1 -0
  285. package/dist/libs/tinymce/skins/ui/oxide/skin.css +3074 -0
  286. package/dist/libs/tinymce/skins/ui/oxide/skin.min.css +1 -0
  287. package/dist/libs/tinymce/skins/ui/oxide/skin.shadowdom.css +30 -0
  288. package/dist/libs/tinymce/skins/ui/oxide/skin.shadowdom.min.css +1 -0
  289. package/dist/libs/tinymce/skins/ui/oxide-dark/content.css +728 -0
  290. package/dist/libs/tinymce/skins/ui/oxide-dark/content.inline.css +741 -0
  291. package/dist/libs/tinymce/skins/ui/oxide-dark/content.inline.min.css +1 -0
  292. package/dist/libs/tinymce/skins/ui/oxide-dark/content.min.css +1 -0
  293. package/dist/libs/tinymce/skins/ui/oxide-dark/skin.css +3077 -0
  294. package/dist/libs/tinymce/skins/ui/oxide-dark/skin.min.css +1 -0
  295. package/dist/libs/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +30 -0
  296. package/dist/libs/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -0
  297. package/dist/libs/tinymce/skins/ui/tinymce-5/content.css +747 -0
  298. package/dist/libs/tinymce/skins/ui/tinymce-5/content.inline.css +741 -0
  299. package/dist/libs/tinymce/skins/ui/tinymce-5/content.inline.min.css +1 -0
  300. package/dist/libs/tinymce/skins/ui/tinymce-5/content.min.css +1 -0
  301. package/dist/libs/tinymce/skins/ui/tinymce-5/skin.css +3158 -0
  302. package/dist/libs/tinymce/skins/ui/tinymce-5/skin.min.css +1 -0
  303. package/dist/libs/tinymce/skins/ui/tinymce-5/skin.shadowdom.css +30 -0
  304. package/dist/libs/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.css +1 -0
  305. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.css +728 -0
  306. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.inline.css +741 -0
  307. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +1 -0
  308. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.min.css +1 -0
  309. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.css +3158 -0
  310. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.min.css +1 -0
  311. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.css +30 -0
  312. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.css +1 -0
  313. package/dist/libs/tinymce/themes/silver/index.js +7 -0
  314. package/dist/libs/tinymce/themes/silver/theme.js +26184 -0
  315. package/dist/libs/tinymce/themes/silver/theme.min.js +4 -0
  316. package/dist/libs/tinymce/tinymce.d.ts +2895 -0
  317. package/dist/libs/tinymce/tinymce.js +29400 -0
  318. package/dist/libs/tinymce/tinymce.min.js +4 -0
  319. package/dist/libs/tom-select/dist/js/plugins/caret_position.js +170 -0
  320. package/dist/libs/tom-select/dist/js/plugins/caret_position.js.map +1 -0
  321. package/dist/libs/tom-select/dist/js/plugins/change_listener.js +58 -0
  322. package/dist/libs/tom-select/dist/js/plugins/change_listener.js.map +1 -0
  323. package/dist/libs/tom-select/dist/js/plugins/checkbox_options.js +182 -0
  324. package/dist/libs/tom-select/dist/js/plugins/checkbox_options.js.map +1 -0
  325. package/dist/libs/tom-select/dist/js/plugins/clear_button.js +99 -0
  326. package/dist/libs/tom-select/dist/js/plugins/clear_button.js.map +1 -0
  327. package/dist/libs/tom-select/dist/js/plugins/drag_drop.js +70 -0
  328. package/dist/libs/tom-select/dist/js/plugins/drag_drop.js.map +1 -0
  329. package/dist/libs/tom-select/dist/js/plugins/dropdown_header.js +126 -0
  330. package/dist/libs/tom-select/dist/js/plugins/dropdown_header.js.map +1 -0
  331. package/dist/libs/tom-select/dist/js/plugins/dropdown_input.js +240 -0
  332. package/dist/libs/tom-select/dist/js/plugins/dropdown_input.js.map +1 -0
  333. package/dist/libs/tom-select/dist/js/plugins/input_autogrow.js +84 -0
  334. package/dist/libs/tom-select/dist/js/plugins/input_autogrow.js.map +1 -0
  335. package/dist/libs/tom-select/dist/js/plugins/no_active_items.js +33 -0
  336. package/dist/libs/tom-select/dist/js/plugins/no_active_items.js.map +1 -0
  337. package/dist/libs/tom-select/dist/js/plugins/no_backspace_delete.js +40 -0
  338. package/dist/libs/tom-select/dist/js/plugins/no_backspace_delete.js.map +1 -0
  339. package/dist/libs/tom-select/dist/js/plugins/optgroup_columns.js +117 -0
  340. package/dist/libs/tom-select/dist/js/plugins/optgroup_columns.js.map +1 -0
  341. package/dist/libs/tom-select/dist/js/plugins/remove_button.js +154 -0
  342. package/dist/libs/tom-select/dist/js/plugins/remove_button.js.map +1 -0
  343. package/dist/libs/tom-select/dist/js/plugins/restore_on_backspace.js +51 -0
  344. package/dist/libs/tom-select/dist/js/plugins/restore_on_backspace.js.map +1 -0
  345. package/dist/libs/tom-select/dist/js/plugins/virtual_scroll.js +279 -0
  346. package/dist/libs/tom-select/dist/js/plugins/virtual_scroll.js.map +1 -0
  347. package/dist/libs/tom-select/dist/js/tom-select.base.js +4165 -0
  348. package/dist/libs/tom-select/dist/js/tom-select.base.js.map +1 -0
  349. package/dist/libs/tom-select/dist/js/tom-select.base.min.js +144 -144
  350. package/dist/libs/tom-select/dist/js/tom-select.base.min.js.map +1 -0
  351. package/dist/libs/tom-select/dist/js/tom-select.complete.js +4978 -0
  352. package/dist/libs/tom-select/dist/js/tom-select.complete.js.map +1 -0
  353. package/dist/libs/tom-select/dist/js/tom-select.complete.min.js +363 -0
  354. package/dist/libs/tom-select/dist/js/tom-select.complete.min.js.map +1 -0
  355. package/dist/libs/tom-select/dist/js/tom-select.popular.js +4419 -0
  356. package/dist/libs/tom-select/dist/js/tom-select.popular.js.map +1 -0
  357. package/dist/libs/tom-select/dist/js/tom-select.popular.min.js +323 -0
  358. package/dist/libs/tom-select/dist/js/tom-select.popular.min.js.map +1 -0
  359. package/package.json +100 -33
  360. package/src/js/demo-theme.js +25 -0
  361. package/src/js/demo.js +0 -17
  362. package/src/js/src/tabler.js +17 -0
  363. package/src/js/tabler.js +2 -0
  364. package/src/scss/_bootstrap-components.scss +1 -1
  365. package/src/scss/_bootstrap-config.scss +1 -0
  366. package/src/scss/_core.scss +2 -0
  367. package/src/scss/_utilities.scss +2 -2
  368. package/src/scss/_variables.scss +218 -92
  369. package/src/scss/demo/_examples.scss +2 -2
  370. package/src/scss/demo/_highlight.scss +3 -3
  371. package/src/scss/demo.scss +5 -5
  372. package/src/scss/fonts/_webfonts.scss +0 -50
  373. package/src/scss/layout/_core.scss +10 -23
  374. package/src/scss/layout/_dark.scss +22 -16
  375. package/src/scss/layout/_footer.scss +2 -2
  376. package/src/scss/layout/_navbar.scss +18 -15
  377. package/src/scss/layout/_page.scss +8 -6
  378. package/src/scss/layout/_root.scss +37 -0
  379. package/src/scss/mixins/_functions.scss +2 -16
  380. package/src/scss/mixins/_mixins.scss +32 -5
  381. package/src/scss/tabler-vendors.scss +4 -0
  382. package/src/scss/ui/_accordion.scss +5 -1
  383. package/src/scss/ui/_alerts.scss +8 -8
  384. package/src/scss/ui/_avatars.scss +14 -14
  385. package/src/scss/ui/_badges.scss +2 -2
  386. package/src/scss/ui/_breadcrumbs.scss +1 -1
  387. package/src/scss/ui/_buttons.scss +100 -108
  388. package/src/scss/ui/_calendars.scss +8 -8
  389. package/src/scss/ui/_cards.scss +46 -52
  390. package/src/scss/ui/_carousel.scss +2 -2
  391. package/src/scss/ui/_chips.scss +0 -0
  392. package/src/scss/ui/_datagrid.scss +17 -0
  393. package/src/scss/ui/_empty.scss +3 -3
  394. package/src/scss/ui/_flags.scss +2 -2
  395. package/src/scss/ui/_forms.scss +12 -11
  396. package/src/scss/ui/_grid.scss +13 -14
  397. package/src/scss/ui/_icons.scss +64 -4
  398. package/src/scss/ui/_legend.scss +8 -4
  399. package/src/scss/ui/_lists.scss +17 -14
  400. package/src/scss/ui/_markdown.scss +2 -3
  401. package/src/scss/ui/_modals.scss +1 -1
  402. package/src/scss/ui/_nav.scss +7 -7
  403. package/src/scss/ui/_offcanvas.scss +3 -3
  404. package/src/scss/ui/_pagination.scss +10 -6
  405. package/src/scss/ui/_placeholder.scss +1 -1
  406. package/src/scss/ui/_progress.scss +45 -6
  407. package/src/scss/ui/_ribbons.scss +5 -5
  408. package/src/scss/ui/_status.scss +28 -27
  409. package/src/scss/ui/_steps.scss +2 -2
  410. package/src/scss/ui/_tables.scss +26 -5
  411. package/src/scss/ui/_toasts.scss +1 -2
  412. package/src/scss/ui/_type.scss +45 -30
  413. package/src/scss/ui/forms/_form-check.scss +26 -1
  414. package/src/scss/ui/forms/_form-colorinput.scss +2 -2
  415. package/src/scss/ui/forms/_form-custom.scss +2 -2
  416. package/src/scss/ui/forms/_form-icon.scss +1 -1
  417. package/src/scss/ui/forms/_form-imagecheck.scss +4 -4
  418. package/src/scss/ui/forms/_form-selectgroup.scss +7 -7
  419. package/src/scss/ui/forms/_validation.scss +1 -1
  420. package/src/scss/ui/typo/_hr.scss +2 -3
  421. package/src/scss/utils/_colors.scss +19 -8
  422. package/src/scss/vendor/_dropzone.scss +27 -0
  423. package/src/scss/vendor/_fslightbox.scss +13 -0
  424. package/src/scss/vendor/_jsvectormap.scss +8 -8
  425. package/src/scss/vendor/_litepicker.scss +14 -14
  426. package/src/scss/vendor/_plyr.scss +3 -0
  427. package/src/scss/vendor/_tinymce.scss +25 -0
  428. package/src/scss/vendor/_tom-select.scss +2 -0
@@ -0,0 +1,2254 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
+ typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.noUiSlider = {}));
5
+ })(this, (function (exports) { 'use strict';
6
+
7
+ exports.PipsMode = void 0;
8
+ (function (PipsMode) {
9
+ PipsMode["Range"] = "range";
10
+ PipsMode["Steps"] = "steps";
11
+ PipsMode["Positions"] = "positions";
12
+ PipsMode["Count"] = "count";
13
+ PipsMode["Values"] = "values";
14
+ })(exports.PipsMode || (exports.PipsMode = {}));
15
+ exports.PipsType = void 0;
16
+ (function (PipsType) {
17
+ PipsType[PipsType["None"] = -1] = "None";
18
+ PipsType[PipsType["NoValue"] = 0] = "NoValue";
19
+ PipsType[PipsType["LargeValue"] = 1] = "LargeValue";
20
+ PipsType[PipsType["SmallValue"] = 2] = "SmallValue";
21
+ })(exports.PipsType || (exports.PipsType = {}));
22
+ //region Helper Methods
23
+ function isValidFormatter(entry) {
24
+ return isValidPartialFormatter(entry) && typeof entry.from === "function";
25
+ }
26
+ function isValidPartialFormatter(entry) {
27
+ // partial formatters only need a to function and not a from function
28
+ return typeof entry === "object" && typeof entry.to === "function";
29
+ }
30
+ function removeElement(el) {
31
+ el.parentElement.removeChild(el);
32
+ }
33
+ function isSet(value) {
34
+ return value !== null && value !== undefined;
35
+ }
36
+ // Bindable version
37
+ function preventDefault(e) {
38
+ e.preventDefault();
39
+ }
40
+ // Removes duplicates from an array.
41
+ function unique(array) {
42
+ return array.filter(function (a) {
43
+ return !this[a] ? (this[a] = true) : false;
44
+ }, {});
45
+ }
46
+ // Round a value to the closest 'to'.
47
+ function closest(value, to) {
48
+ return Math.round(value / to) * to;
49
+ }
50
+ // Current position of an element relative to the document.
51
+ function offset(elem, orientation) {
52
+ var rect = elem.getBoundingClientRect();
53
+ var doc = elem.ownerDocument;
54
+ var docElem = doc.documentElement;
55
+ var pageOffset = getPageOffset(doc);
56
+ // getBoundingClientRect contains left scroll in Chrome on Android.
57
+ // I haven't found a feature detection that proves this. Worst case
58
+ // scenario on mis-match: the 'tap' feature on horizontal sliders breaks.
59
+ if (/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)) {
60
+ pageOffset.x = 0;
61
+ }
62
+ return orientation ? rect.top + pageOffset.y - docElem.clientTop : rect.left + pageOffset.x - docElem.clientLeft;
63
+ }
64
+ // Checks whether a value is numerical.
65
+ function isNumeric(a) {
66
+ return typeof a === "number" && !isNaN(a) && isFinite(a);
67
+ }
68
+ // Sets a class and removes it after [duration] ms.
69
+ function addClassFor(element, className, duration) {
70
+ if (duration > 0) {
71
+ addClass(element, className);
72
+ setTimeout(function () {
73
+ removeClass(element, className);
74
+ }, duration);
75
+ }
76
+ }
77
+ // Limits a value to 0 - 100
78
+ function limit(a) {
79
+ return Math.max(Math.min(a, 100), 0);
80
+ }
81
+ // Wraps a variable as an array, if it isn't one yet.
82
+ // Note that an input array is returned by reference!
83
+ function asArray(a) {
84
+ return Array.isArray(a) ? a : [a];
85
+ }
86
+ // Counts decimals
87
+ function countDecimals(numStr) {
88
+ numStr = String(numStr);
89
+ var pieces = numStr.split(".");
90
+ return pieces.length > 1 ? pieces[1].length : 0;
91
+ }
92
+ // http://youmightnotneedjquery.com/#add_class
93
+ function addClass(el, className) {
94
+ if (el.classList && !/\s/.test(className)) {
95
+ el.classList.add(className);
96
+ }
97
+ else {
98
+ el.className += " " + className;
99
+ }
100
+ }
101
+ // http://youmightnotneedjquery.com/#remove_class
102
+ function removeClass(el, className) {
103
+ if (el.classList && !/\s/.test(className)) {
104
+ el.classList.remove(className);
105
+ }
106
+ else {
107
+ el.className = el.className.replace(new RegExp("(^|\\b)" + className.split(" ").join("|") + "(\\b|$)", "gi"), " ");
108
+ }
109
+ }
110
+ // https://plainjs.com/javascript/attributes/adding-removing-and-testing-for-classes-9/
111
+ function hasClass(el, className) {
112
+ return el.classList ? el.classList.contains(className) : new RegExp("\\b" + className + "\\b").test(el.className);
113
+ }
114
+ // https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY#Notes
115
+ function getPageOffset(doc) {
116
+ var supportPageOffset = window.pageXOffset !== undefined;
117
+ var isCSS1Compat = (doc.compatMode || "") === "CSS1Compat";
118
+ var x = supportPageOffset
119
+ ? window.pageXOffset
120
+ : isCSS1Compat
121
+ ? doc.documentElement.scrollLeft
122
+ : doc.body.scrollLeft;
123
+ var y = supportPageOffset
124
+ ? window.pageYOffset
125
+ : isCSS1Compat
126
+ ? doc.documentElement.scrollTop
127
+ : doc.body.scrollTop;
128
+ return {
129
+ x: x,
130
+ y: y,
131
+ };
132
+ }
133
+ // we provide a function to compute constants instead
134
+ // of accessing window.* as soon as the module needs it
135
+ // so that we do not compute anything if not needed
136
+ function getActions() {
137
+ // Determine the events to bind. IE11 implements pointerEvents without
138
+ // a prefix, which breaks compatibility with the IE10 implementation.
139
+ return window.navigator.pointerEnabled
140
+ ? {
141
+ start: "pointerdown",
142
+ move: "pointermove",
143
+ end: "pointerup",
144
+ }
145
+ : window.navigator.msPointerEnabled
146
+ ? {
147
+ start: "MSPointerDown",
148
+ move: "MSPointerMove",
149
+ end: "MSPointerUp",
150
+ }
151
+ : {
152
+ start: "mousedown touchstart",
153
+ move: "mousemove touchmove",
154
+ end: "mouseup touchend",
155
+ };
156
+ }
157
+ // https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md
158
+ // Issue #785
159
+ function getSupportsPassive() {
160
+ var supportsPassive = false;
161
+ /* eslint-disable */
162
+ try {
163
+ var opts = Object.defineProperty({}, "passive", {
164
+ get: function () {
165
+ supportsPassive = true;
166
+ },
167
+ });
168
+ // @ts-ignore
169
+ window.addEventListener("test", null, opts);
170
+ }
171
+ catch (e) { }
172
+ /* eslint-enable */
173
+ return supportsPassive;
174
+ }
175
+ function getSupportsTouchActionNone() {
176
+ return window.CSS && CSS.supports && CSS.supports("touch-action", "none");
177
+ }
178
+ //endregion
179
+ //region Range Calculation
180
+ // Determine the size of a sub-range in relation to a full range.
181
+ function subRangeRatio(pa, pb) {
182
+ return 100 / (pb - pa);
183
+ }
184
+ // (percentage) How many percent is this value of this range?
185
+ function fromPercentage(range, value, startRange) {
186
+ return (value * 100) / (range[startRange + 1] - range[startRange]);
187
+ }
188
+ // (percentage) Where is this value on this range?
189
+ function toPercentage(range, value) {
190
+ return fromPercentage(range, range[0] < 0 ? value + Math.abs(range[0]) : value - range[0], 0);
191
+ }
192
+ // (value) How much is this percentage on this range?
193
+ function isPercentage(range, value) {
194
+ return (value * (range[1] - range[0])) / 100 + range[0];
195
+ }
196
+ function getJ(value, arr) {
197
+ var j = 1;
198
+ while (value >= arr[j]) {
199
+ j += 1;
200
+ }
201
+ return j;
202
+ }
203
+ // (percentage) Input a value, find where, on a scale of 0-100, it applies.
204
+ function toStepping(xVal, xPct, value) {
205
+ if (value >= xVal.slice(-1)[0]) {
206
+ return 100;
207
+ }
208
+ var j = getJ(value, xVal);
209
+ var va = xVal[j - 1];
210
+ var vb = xVal[j];
211
+ var pa = xPct[j - 1];
212
+ var pb = xPct[j];
213
+ return pa + toPercentage([va, vb], value) / subRangeRatio(pa, pb);
214
+ }
215
+ // (value) Input a percentage, find where it is on the specified range.
216
+ function fromStepping(xVal, xPct, value) {
217
+ // There is no range group that fits 100
218
+ if (value >= 100) {
219
+ return xVal.slice(-1)[0];
220
+ }
221
+ var j = getJ(value, xPct);
222
+ var va = xVal[j - 1];
223
+ var vb = xVal[j];
224
+ var pa = xPct[j - 1];
225
+ var pb = xPct[j];
226
+ return isPercentage([va, vb], (value - pa) * subRangeRatio(pa, pb));
227
+ }
228
+ // (percentage) Get the step that applies at a certain value.
229
+ function getStep(xPct, xSteps, snap, value) {
230
+ if (value === 100) {
231
+ return value;
232
+ }
233
+ var j = getJ(value, xPct);
234
+ var a = xPct[j - 1];
235
+ var b = xPct[j];
236
+ // If 'snap' is set, steps are used as fixed points on the slider.
237
+ if (snap) {
238
+ // Find the closest position, a or b.
239
+ if (value - a > (b - a) / 2) {
240
+ return b;
241
+ }
242
+ return a;
243
+ }
244
+ if (!xSteps[j - 1]) {
245
+ return value;
246
+ }
247
+ return xPct[j - 1] + closest(value - xPct[j - 1], xSteps[j - 1]);
248
+ }
249
+ //endregion
250
+ //region Spectrum
251
+ var Spectrum = /** @class */ (function () {
252
+ function Spectrum(entry, snap, singleStep) {
253
+ this.xPct = [];
254
+ this.xVal = [];
255
+ this.xSteps = [];
256
+ this.xNumSteps = [];
257
+ this.xHighestCompleteStep = [];
258
+ this.xSteps = [singleStep || false];
259
+ this.xNumSteps = [false];
260
+ this.snap = snap;
261
+ var index;
262
+ var ordered = [];
263
+ // Map the object keys to an array.
264
+ Object.keys(entry).forEach(function (index) {
265
+ ordered.push([asArray(entry[index]), index]);
266
+ });
267
+ // Sort all entries by value (numeric sort).
268
+ ordered.sort(function (a, b) {
269
+ return a[0][0] - b[0][0];
270
+ });
271
+ // Convert all entries to subranges.
272
+ for (index = 0; index < ordered.length; index++) {
273
+ this.handleEntryPoint(ordered[index][1], ordered[index][0]);
274
+ }
275
+ // Store the actual step values.
276
+ // xSteps is sorted in the same order as xPct and xVal.
277
+ this.xNumSteps = this.xSteps.slice(0);
278
+ // Convert all numeric steps to the percentage of the subrange they represent.
279
+ for (index = 0; index < this.xNumSteps.length; index++) {
280
+ this.handleStepPoint(index, this.xNumSteps[index]);
281
+ }
282
+ }
283
+ Spectrum.prototype.getDistance = function (value) {
284
+ var distances = [];
285
+ for (var index = 0; index < this.xNumSteps.length - 1; index++) {
286
+ distances[index] = fromPercentage(this.xVal, value, index);
287
+ }
288
+ return distances;
289
+ };
290
+ // Calculate the percentual distance over the whole scale of ranges.
291
+ // direction: 0 = backwards / 1 = forwards
292
+ Spectrum.prototype.getAbsoluteDistance = function (value, distances, direction) {
293
+ var xPct_index = 0;
294
+ // Calculate range where to start calculation
295
+ if (value < this.xPct[this.xPct.length - 1]) {
296
+ while (value > this.xPct[xPct_index + 1]) {
297
+ xPct_index++;
298
+ }
299
+ }
300
+ else if (value === this.xPct[this.xPct.length - 1]) {
301
+ xPct_index = this.xPct.length - 2;
302
+ }
303
+ // If looking backwards and the value is exactly at a range separator then look one range further
304
+ if (!direction && value === this.xPct[xPct_index + 1]) {
305
+ xPct_index++;
306
+ }
307
+ if (distances === null) {
308
+ distances = [];
309
+ }
310
+ var start_factor;
311
+ var rest_factor = 1;
312
+ var rest_rel_distance = distances[xPct_index];
313
+ var range_pct = 0;
314
+ var rel_range_distance = 0;
315
+ var abs_distance_counter = 0;
316
+ var range_counter = 0;
317
+ // Calculate what part of the start range the value is
318
+ if (direction) {
319
+ start_factor = (value - this.xPct[xPct_index]) / (this.xPct[xPct_index + 1] - this.xPct[xPct_index]);
320
+ }
321
+ else {
322
+ start_factor = (this.xPct[xPct_index + 1] - value) / (this.xPct[xPct_index + 1] - this.xPct[xPct_index]);
323
+ }
324
+ // Do until the complete distance across ranges is calculated
325
+ while (rest_rel_distance > 0) {
326
+ // Calculate the percentage of total range
327
+ range_pct = this.xPct[xPct_index + 1 + range_counter] - this.xPct[xPct_index + range_counter];
328
+ // Detect if the margin, padding or limit is larger then the current range and calculate
329
+ if (distances[xPct_index + range_counter] * rest_factor + 100 - start_factor * 100 > 100) {
330
+ // If larger then take the percentual distance of the whole range
331
+ rel_range_distance = range_pct * start_factor;
332
+ // Rest factor of relative percentual distance still to be calculated
333
+ rest_factor = (rest_rel_distance - 100 * start_factor) / distances[xPct_index + range_counter];
334
+ // Set start factor to 1 as for next range it does not apply.
335
+ start_factor = 1;
336
+ }
337
+ else {
338
+ // If smaller or equal then take the percentual distance of the calculate percentual part of that range
339
+ rel_range_distance = ((distances[xPct_index + range_counter] * range_pct) / 100) * rest_factor;
340
+ // No rest left as the rest fits in current range
341
+ rest_factor = 0;
342
+ }
343
+ if (direction) {
344
+ abs_distance_counter = abs_distance_counter - rel_range_distance;
345
+ // Limit range to first range when distance becomes outside of minimum range
346
+ if (this.xPct.length + range_counter >= 1) {
347
+ range_counter--;
348
+ }
349
+ }
350
+ else {
351
+ abs_distance_counter = abs_distance_counter + rel_range_distance;
352
+ // Limit range to last range when distance becomes outside of maximum range
353
+ if (this.xPct.length - range_counter >= 1) {
354
+ range_counter++;
355
+ }
356
+ }
357
+ // Rest of relative percentual distance still to be calculated
358
+ rest_rel_distance = distances[xPct_index + range_counter] * rest_factor;
359
+ }
360
+ return value + abs_distance_counter;
361
+ };
362
+ Spectrum.prototype.toStepping = function (value) {
363
+ value = toStepping(this.xVal, this.xPct, value);
364
+ return value;
365
+ };
366
+ Spectrum.prototype.fromStepping = function (value) {
367
+ return fromStepping(this.xVal, this.xPct, value);
368
+ };
369
+ Spectrum.prototype.getStep = function (value) {
370
+ value = getStep(this.xPct, this.xSteps, this.snap, value);
371
+ return value;
372
+ };
373
+ Spectrum.prototype.getDefaultStep = function (value, isDown, size) {
374
+ var j = getJ(value, this.xPct);
375
+ // When at the top or stepping down, look at the previous sub-range
376
+ if (value === 100 || (isDown && value === this.xPct[j - 1])) {
377
+ j = Math.max(j - 1, 1);
378
+ }
379
+ return (this.xVal[j] - this.xVal[j - 1]) / size;
380
+ };
381
+ Spectrum.prototype.getNearbySteps = function (value) {
382
+ var j = getJ(value, this.xPct);
383
+ return {
384
+ stepBefore: {
385
+ startValue: this.xVal[j - 2],
386
+ step: this.xNumSteps[j - 2],
387
+ highestStep: this.xHighestCompleteStep[j - 2],
388
+ },
389
+ thisStep: {
390
+ startValue: this.xVal[j - 1],
391
+ step: this.xNumSteps[j - 1],
392
+ highestStep: this.xHighestCompleteStep[j - 1],
393
+ },
394
+ stepAfter: {
395
+ startValue: this.xVal[j],
396
+ step: this.xNumSteps[j],
397
+ highestStep: this.xHighestCompleteStep[j],
398
+ },
399
+ };
400
+ };
401
+ Spectrum.prototype.countStepDecimals = function () {
402
+ var stepDecimals = this.xNumSteps.map(countDecimals);
403
+ return Math.max.apply(null, stepDecimals);
404
+ };
405
+ Spectrum.prototype.hasNoSize = function () {
406
+ return this.xVal[0] === this.xVal[this.xVal.length - 1];
407
+ };
408
+ // Outside testing
409
+ Spectrum.prototype.convert = function (value) {
410
+ return this.getStep(this.toStepping(value));
411
+ };
412
+ Spectrum.prototype.handleEntryPoint = function (index, value) {
413
+ var percentage;
414
+ // Covert min/max syntax to 0 and 100.
415
+ if (index === "min") {
416
+ percentage = 0;
417
+ }
418
+ else if (index === "max") {
419
+ percentage = 100;
420
+ }
421
+ else {
422
+ percentage = parseFloat(index);
423
+ }
424
+ // Check for correct input.
425
+ if (!isNumeric(percentage) || !isNumeric(value[0])) {
426
+ throw new Error("noUiSlider: 'range' value isn't numeric.");
427
+ }
428
+ // Store values.
429
+ this.xPct.push(percentage);
430
+ this.xVal.push(value[0]);
431
+ var value1 = Number(value[1]);
432
+ // NaN will evaluate to false too, but to keep
433
+ // logging clear, set step explicitly. Make sure
434
+ // not to override the 'step' setting with false.
435
+ if (!percentage) {
436
+ if (!isNaN(value1)) {
437
+ this.xSteps[0] = value1;
438
+ }
439
+ }
440
+ else {
441
+ this.xSteps.push(isNaN(value1) ? false : value1);
442
+ }
443
+ this.xHighestCompleteStep.push(0);
444
+ };
445
+ Spectrum.prototype.handleStepPoint = function (i, n) {
446
+ // Ignore 'false' stepping.
447
+ if (!n) {
448
+ return;
449
+ }
450
+ // Step over zero-length ranges (#948);
451
+ if (this.xVal[i] === this.xVal[i + 1]) {
452
+ this.xSteps[i] = this.xHighestCompleteStep[i] = this.xVal[i];
453
+ return;
454
+ }
455
+ // Factor to range ratio
456
+ this.xSteps[i] =
457
+ fromPercentage([this.xVal[i], this.xVal[i + 1]], n, 0) / subRangeRatio(this.xPct[i], this.xPct[i + 1]);
458
+ var totalSteps = (this.xVal[i + 1] - this.xVal[i]) / this.xNumSteps[i];
459
+ var highestStep = Math.ceil(Number(totalSteps.toFixed(3)) - 1);
460
+ var step = this.xVal[i] + this.xNumSteps[i] * highestStep;
461
+ this.xHighestCompleteStep[i] = step;
462
+ };
463
+ return Spectrum;
464
+ }());
465
+ //endregion
466
+ //region Options
467
+ /* Every input option is tested and parsed. This will prevent
468
+ endless validation in internal methods. These tests are
469
+ structured with an item for every option available. An
470
+ option can be marked as required by setting the 'r' flag.
471
+ The testing function is provided with three arguments:
472
+ - The provided value for the option;
473
+ - A reference to the options object;
474
+ - The name for the option;
475
+
476
+ The testing function returns false when an error is detected,
477
+ or true when everything is OK. It can also modify the option
478
+ object, to make sure all values can be correctly looped elsewhere. */
479
+ //region Defaults
480
+ var defaultFormatter = {
481
+ to: function (value) {
482
+ return value === undefined ? "" : value.toFixed(2);
483
+ },
484
+ from: Number,
485
+ };
486
+ var cssClasses = {
487
+ target: "target",
488
+ base: "base",
489
+ origin: "origin",
490
+ handle: "handle",
491
+ handleLower: "handle-lower",
492
+ handleUpper: "handle-upper",
493
+ touchArea: "touch-area",
494
+ horizontal: "horizontal",
495
+ vertical: "vertical",
496
+ background: "background",
497
+ connect: "connect",
498
+ connects: "connects",
499
+ ltr: "ltr",
500
+ rtl: "rtl",
501
+ textDirectionLtr: "txt-dir-ltr",
502
+ textDirectionRtl: "txt-dir-rtl",
503
+ draggable: "draggable",
504
+ drag: "state-drag",
505
+ tap: "state-tap",
506
+ active: "active",
507
+ tooltip: "tooltip",
508
+ pips: "pips",
509
+ pipsHorizontal: "pips-horizontal",
510
+ pipsVertical: "pips-vertical",
511
+ marker: "marker",
512
+ markerHorizontal: "marker-horizontal",
513
+ markerVertical: "marker-vertical",
514
+ markerNormal: "marker-normal",
515
+ markerLarge: "marker-large",
516
+ markerSub: "marker-sub",
517
+ value: "value",
518
+ valueHorizontal: "value-horizontal",
519
+ valueVertical: "value-vertical",
520
+ valueNormal: "value-normal",
521
+ valueLarge: "value-large",
522
+ valueSub: "value-sub",
523
+ };
524
+ // Namespaces of internal event listeners
525
+ var INTERNAL_EVENT_NS = {
526
+ tooltips: ".__tooltips",
527
+ aria: ".__aria",
528
+ };
529
+ //endregion
530
+ function testStep(parsed, entry) {
531
+ if (!isNumeric(entry)) {
532
+ throw new Error("noUiSlider: 'step' is not numeric.");
533
+ }
534
+ // The step option can still be used to set stepping
535
+ // for linear sliders. Overwritten if set in 'range'.
536
+ parsed.singleStep = entry;
537
+ }
538
+ function testKeyboardPageMultiplier(parsed, entry) {
539
+ if (!isNumeric(entry)) {
540
+ throw new Error("noUiSlider: 'keyboardPageMultiplier' is not numeric.");
541
+ }
542
+ parsed.keyboardPageMultiplier = entry;
543
+ }
544
+ function testKeyboardMultiplier(parsed, entry) {
545
+ if (!isNumeric(entry)) {
546
+ throw new Error("noUiSlider: 'keyboardMultiplier' is not numeric.");
547
+ }
548
+ parsed.keyboardMultiplier = entry;
549
+ }
550
+ function testKeyboardDefaultStep(parsed, entry) {
551
+ if (!isNumeric(entry)) {
552
+ throw new Error("noUiSlider: 'keyboardDefaultStep' is not numeric.");
553
+ }
554
+ parsed.keyboardDefaultStep = entry;
555
+ }
556
+ function testRange(parsed, entry) {
557
+ // Filter incorrect input.
558
+ if (typeof entry !== "object" || Array.isArray(entry)) {
559
+ throw new Error("noUiSlider: 'range' is not an object.");
560
+ }
561
+ // Catch missing start or end.
562
+ if (entry.min === undefined || entry.max === undefined) {
563
+ throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");
564
+ }
565
+ parsed.spectrum = new Spectrum(entry, parsed.snap || false, parsed.singleStep);
566
+ }
567
+ function testStart(parsed, entry) {
568
+ entry = asArray(entry);
569
+ // Validate input. Values aren't tested, as the public .val method
570
+ // will always provide a valid location.
571
+ if (!Array.isArray(entry) || !entry.length) {
572
+ throw new Error("noUiSlider: 'start' option is incorrect.");
573
+ }
574
+ // Store the number of handles.
575
+ parsed.handles = entry.length;
576
+ // When the slider is initialized, the .val method will
577
+ // be called with the start options.
578
+ parsed.start = entry;
579
+ }
580
+ function testSnap(parsed, entry) {
581
+ if (typeof entry !== "boolean") {
582
+ throw new Error("noUiSlider: 'snap' option must be a boolean.");
583
+ }
584
+ // Enforce 100% stepping within subranges.
585
+ parsed.snap = entry;
586
+ }
587
+ function testAnimate(parsed, entry) {
588
+ if (typeof entry !== "boolean") {
589
+ throw new Error("noUiSlider: 'animate' option must be a boolean.");
590
+ }
591
+ // Enforce 100% stepping within subranges.
592
+ parsed.animate = entry;
593
+ }
594
+ function testAnimationDuration(parsed, entry) {
595
+ if (typeof entry !== "number") {
596
+ throw new Error("noUiSlider: 'animationDuration' option must be a number.");
597
+ }
598
+ parsed.animationDuration = entry;
599
+ }
600
+ function testConnect(parsed, entry) {
601
+ var connect = [false];
602
+ var i;
603
+ // Map legacy options
604
+ if (entry === "lower") {
605
+ entry = [true, false];
606
+ }
607
+ else if (entry === "upper") {
608
+ entry = [false, true];
609
+ }
610
+ // Handle boolean options
611
+ if (entry === true || entry === false) {
612
+ for (i = 1; i < parsed.handles; i++) {
613
+ connect.push(entry);
614
+ }
615
+ connect.push(false);
616
+ }
617
+ // Reject invalid input
618
+ else if (!Array.isArray(entry) || !entry.length || entry.length !== parsed.handles + 1) {
619
+ throw new Error("noUiSlider: 'connect' option doesn't match handle count.");
620
+ }
621
+ else {
622
+ connect = entry;
623
+ }
624
+ parsed.connect = connect;
625
+ }
626
+ function testOrientation(parsed, entry) {
627
+ // Set orientation to an a numerical value for easy
628
+ // array selection.
629
+ switch (entry) {
630
+ case "horizontal":
631
+ parsed.ort = 0;
632
+ break;
633
+ case "vertical":
634
+ parsed.ort = 1;
635
+ break;
636
+ default:
637
+ throw new Error("noUiSlider: 'orientation' option is invalid.");
638
+ }
639
+ }
640
+ function testMargin(parsed, entry) {
641
+ if (!isNumeric(entry)) {
642
+ throw new Error("noUiSlider: 'margin' option must be numeric.");
643
+ }
644
+ // Issue #582
645
+ if (entry === 0) {
646
+ return;
647
+ }
648
+ parsed.margin = parsed.spectrum.getDistance(entry);
649
+ }
650
+ function testLimit(parsed, entry) {
651
+ if (!isNumeric(entry)) {
652
+ throw new Error("noUiSlider: 'limit' option must be numeric.");
653
+ }
654
+ parsed.limit = parsed.spectrum.getDistance(entry);
655
+ if (!parsed.limit || parsed.handles < 2) {
656
+ throw new Error("noUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.");
657
+ }
658
+ }
659
+ function testPadding(parsed, entry) {
660
+ var index;
661
+ if (!isNumeric(entry) && !Array.isArray(entry)) {
662
+ throw new Error("noUiSlider: 'padding' option must be numeric or array of exactly 2 numbers.");
663
+ }
664
+ if (Array.isArray(entry) && !(entry.length === 2 || isNumeric(entry[0]) || isNumeric(entry[1]))) {
665
+ throw new Error("noUiSlider: 'padding' option must be numeric or array of exactly 2 numbers.");
666
+ }
667
+ if (entry === 0) {
668
+ return;
669
+ }
670
+ if (!Array.isArray(entry)) {
671
+ entry = [entry, entry];
672
+ }
673
+ // 'getDistance' returns false for invalid values.
674
+ parsed.padding = [parsed.spectrum.getDistance(entry[0]), parsed.spectrum.getDistance(entry[1])];
675
+ for (index = 0; index < parsed.spectrum.xNumSteps.length - 1; index++) {
676
+ // last "range" can't contain step size as it is purely an endpoint.
677
+ if (parsed.padding[0][index] < 0 || parsed.padding[1][index] < 0) {
678
+ throw new Error("noUiSlider: 'padding' option must be a positive number(s).");
679
+ }
680
+ }
681
+ var totalPadding = entry[0] + entry[1];
682
+ var firstValue = parsed.spectrum.xVal[0];
683
+ var lastValue = parsed.spectrum.xVal[parsed.spectrum.xVal.length - 1];
684
+ if (totalPadding / (lastValue - firstValue) > 1) {
685
+ throw new Error("noUiSlider: 'padding' option must not exceed 100% of the range.");
686
+ }
687
+ }
688
+ function testDirection(parsed, entry) {
689
+ // Set direction as a numerical value for easy parsing.
690
+ // Invert connection for RTL sliders, so that the proper
691
+ // handles get the connect/background classes.
692
+ switch (entry) {
693
+ case "ltr":
694
+ parsed.dir = 0;
695
+ break;
696
+ case "rtl":
697
+ parsed.dir = 1;
698
+ break;
699
+ default:
700
+ throw new Error("noUiSlider: 'direction' option was not recognized.");
701
+ }
702
+ }
703
+ function testBehaviour(parsed, entry) {
704
+ // Make sure the input is a string.
705
+ if (typeof entry !== "string") {
706
+ throw new Error("noUiSlider: 'behaviour' must be a string containing options.");
707
+ }
708
+ // Check if the string contains any keywords.
709
+ // None are required.
710
+ var tap = entry.indexOf("tap") >= 0;
711
+ var drag = entry.indexOf("drag") >= 0;
712
+ var fixed = entry.indexOf("fixed") >= 0;
713
+ var snap = entry.indexOf("snap") >= 0;
714
+ var hover = entry.indexOf("hover") >= 0;
715
+ var unconstrained = entry.indexOf("unconstrained") >= 0;
716
+ var dragAll = entry.indexOf("drag-all") >= 0;
717
+ var smoothSteps = entry.indexOf("smooth-steps") >= 0;
718
+ if (fixed) {
719
+ if (parsed.handles !== 2) {
720
+ throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");
721
+ }
722
+ // Use margin to enforce fixed state
723
+ testMargin(parsed, parsed.start[1] - parsed.start[0]);
724
+ }
725
+ if (unconstrained && (parsed.margin || parsed.limit)) {
726
+ throw new Error("noUiSlider: 'unconstrained' behaviour cannot be used with margin or limit");
727
+ }
728
+ parsed.events = {
729
+ tap: tap || snap,
730
+ drag: drag,
731
+ dragAll: dragAll,
732
+ smoothSteps: smoothSteps,
733
+ fixed: fixed,
734
+ snap: snap,
735
+ hover: hover,
736
+ unconstrained: unconstrained,
737
+ };
738
+ }
739
+ function testTooltips(parsed, entry) {
740
+ if (entry === false) {
741
+ return;
742
+ }
743
+ if (entry === true || isValidPartialFormatter(entry)) {
744
+ parsed.tooltips = [];
745
+ for (var i = 0; i < parsed.handles; i++) {
746
+ parsed.tooltips.push(entry);
747
+ }
748
+ }
749
+ else {
750
+ entry = asArray(entry);
751
+ if (entry.length !== parsed.handles) {
752
+ throw new Error("noUiSlider: must pass a formatter for all handles.");
753
+ }
754
+ entry.forEach(function (formatter) {
755
+ if (typeof formatter !== "boolean" && !isValidPartialFormatter(formatter)) {
756
+ throw new Error("noUiSlider: 'tooltips' must be passed a formatter or 'false'.");
757
+ }
758
+ });
759
+ parsed.tooltips = entry;
760
+ }
761
+ }
762
+ function testHandleAttributes(parsed, entry) {
763
+ if (entry.length !== parsed.handles) {
764
+ throw new Error("noUiSlider: must pass a attributes for all handles.");
765
+ }
766
+ parsed.handleAttributes = entry;
767
+ }
768
+ function testAriaFormat(parsed, entry) {
769
+ if (!isValidPartialFormatter(entry)) {
770
+ throw new Error("noUiSlider: 'ariaFormat' requires 'to' method.");
771
+ }
772
+ parsed.ariaFormat = entry;
773
+ }
774
+ function testFormat(parsed, entry) {
775
+ if (!isValidFormatter(entry)) {
776
+ throw new Error("noUiSlider: 'format' requires 'to' and 'from' methods.");
777
+ }
778
+ parsed.format = entry;
779
+ }
780
+ function testKeyboardSupport(parsed, entry) {
781
+ if (typeof entry !== "boolean") {
782
+ throw new Error("noUiSlider: 'keyboardSupport' option must be a boolean.");
783
+ }
784
+ parsed.keyboardSupport = entry;
785
+ }
786
+ function testDocumentElement(parsed, entry) {
787
+ // This is an advanced option. Passed values are used without validation.
788
+ parsed.documentElement = entry;
789
+ }
790
+ function testCssPrefix(parsed, entry) {
791
+ if (typeof entry !== "string" && entry !== false) {
792
+ throw new Error("noUiSlider: 'cssPrefix' must be a string or `false`.");
793
+ }
794
+ parsed.cssPrefix = entry;
795
+ }
796
+ function testCssClasses(parsed, entry) {
797
+ if (typeof entry !== "object") {
798
+ throw new Error("noUiSlider: 'cssClasses' must be an object.");
799
+ }
800
+ if (typeof parsed.cssPrefix === "string") {
801
+ parsed.cssClasses = {};
802
+ Object.keys(entry).forEach(function (key) {
803
+ parsed.cssClasses[key] = parsed.cssPrefix + entry[key];
804
+ });
805
+ }
806
+ else {
807
+ parsed.cssClasses = entry;
808
+ }
809
+ }
810
+ // Test all developer settings and parse to assumption-safe values.
811
+ function testOptions(options) {
812
+ // To prove a fix for #537, freeze options here.
813
+ // If the object is modified, an error will be thrown.
814
+ // Object.freeze(options);
815
+ var parsed = {
816
+ margin: null,
817
+ limit: null,
818
+ padding: null,
819
+ animate: true,
820
+ animationDuration: 300,
821
+ ariaFormat: defaultFormatter,
822
+ format: defaultFormatter,
823
+ };
824
+ // Tests are executed in the order they are presented here.
825
+ var tests = {
826
+ step: { r: false, t: testStep },
827
+ keyboardPageMultiplier: { r: false, t: testKeyboardPageMultiplier },
828
+ keyboardMultiplier: { r: false, t: testKeyboardMultiplier },
829
+ keyboardDefaultStep: { r: false, t: testKeyboardDefaultStep },
830
+ start: { r: true, t: testStart },
831
+ connect: { r: true, t: testConnect },
832
+ direction: { r: true, t: testDirection },
833
+ snap: { r: false, t: testSnap },
834
+ animate: { r: false, t: testAnimate },
835
+ animationDuration: { r: false, t: testAnimationDuration },
836
+ range: { r: true, t: testRange },
837
+ orientation: { r: false, t: testOrientation },
838
+ margin: { r: false, t: testMargin },
839
+ limit: { r: false, t: testLimit },
840
+ padding: { r: false, t: testPadding },
841
+ behaviour: { r: true, t: testBehaviour },
842
+ ariaFormat: { r: false, t: testAriaFormat },
843
+ format: { r: false, t: testFormat },
844
+ tooltips: { r: false, t: testTooltips },
845
+ keyboardSupport: { r: true, t: testKeyboardSupport },
846
+ documentElement: { r: false, t: testDocumentElement },
847
+ cssPrefix: { r: true, t: testCssPrefix },
848
+ cssClasses: { r: true, t: testCssClasses },
849
+ handleAttributes: { r: false, t: testHandleAttributes },
850
+ };
851
+ var defaults = {
852
+ connect: false,
853
+ direction: "ltr",
854
+ behaviour: "tap",
855
+ orientation: "horizontal",
856
+ keyboardSupport: true,
857
+ cssPrefix: "noUi-",
858
+ cssClasses: cssClasses,
859
+ keyboardPageMultiplier: 5,
860
+ keyboardMultiplier: 1,
861
+ keyboardDefaultStep: 10,
862
+ };
863
+ // AriaFormat defaults to regular format, if any.
864
+ if (options.format && !options.ariaFormat) {
865
+ options.ariaFormat = options.format;
866
+ }
867
+ // Run all options through a testing mechanism to ensure correct
868
+ // input. It should be noted that options might get modified to
869
+ // be handled properly. E.g. wrapping integers in arrays.
870
+ Object.keys(tests).forEach(function (name) {
871
+ // If the option isn't set, but it is required, throw an error.
872
+ if (!isSet(options[name]) && defaults[name] === undefined) {
873
+ if (tests[name].r) {
874
+ throw new Error("noUiSlider: '" + name + "' is required.");
875
+ }
876
+ return;
877
+ }
878
+ tests[name].t(parsed, !isSet(options[name]) ? defaults[name] : options[name]);
879
+ });
880
+ // Forward pips options
881
+ parsed.pips = options.pips;
882
+ // All recent browsers accept unprefixed transform.
883
+ // We need -ms- for IE9 and -webkit- for older Android;
884
+ // Assume use of -webkit- if unprefixed and -ms- are not supported.
885
+ // https://caniuse.com/#feat=transforms2d
886
+ var d = document.createElement("div");
887
+ var msPrefix = d.style.msTransform !== undefined;
888
+ var noPrefix = d.style.transform !== undefined;
889
+ parsed.transformRule = noPrefix ? "transform" : msPrefix ? "msTransform" : "webkitTransform";
890
+ // Pips don't move, so we can place them using left/top.
891
+ var styles = [
892
+ ["left", "top"],
893
+ ["right", "bottom"],
894
+ ];
895
+ parsed.style = styles[parsed.dir][parsed.ort];
896
+ return parsed;
897
+ }
898
+ //endregion
899
+ function scope(target, options, originalOptions) {
900
+ var actions = getActions();
901
+ var supportsTouchActionNone = getSupportsTouchActionNone();
902
+ var supportsPassive = supportsTouchActionNone && getSupportsPassive();
903
+ // All variables local to 'scope' are prefixed with 'scope_'
904
+ // Slider DOM Nodes
905
+ var scope_Target = target;
906
+ var scope_Base;
907
+ var scope_Handles;
908
+ var scope_Connects;
909
+ var scope_Pips;
910
+ var scope_Tooltips;
911
+ // Slider state values
912
+ var scope_Spectrum = options.spectrum;
913
+ var scope_Values = [];
914
+ var scope_Locations = [];
915
+ var scope_HandleNumbers = [];
916
+ var scope_ActiveHandlesCount = 0;
917
+ var scope_Events = {};
918
+ // Document Nodes
919
+ var scope_Document = target.ownerDocument;
920
+ var scope_DocumentElement = options.documentElement || scope_Document.documentElement;
921
+ var scope_Body = scope_Document.body;
922
+ // For horizontal sliders in standard ltr documents,
923
+ // make .noUi-origin overflow to the left so the document doesn't scroll.
924
+ var scope_DirOffset = scope_Document.dir === "rtl" || options.ort === 1 ? 0 : 100;
925
+ // Creates a node, adds it to target, returns the new node.
926
+ function addNodeTo(addTarget, className) {
927
+ var div = scope_Document.createElement("div");
928
+ if (className) {
929
+ addClass(div, className);
930
+ }
931
+ addTarget.appendChild(div);
932
+ return div;
933
+ }
934
+ // Append a origin to the base
935
+ function addOrigin(base, handleNumber) {
936
+ var origin = addNodeTo(base, options.cssClasses.origin);
937
+ var handle = addNodeTo(origin, options.cssClasses.handle);
938
+ addNodeTo(handle, options.cssClasses.touchArea);
939
+ handle.setAttribute("data-handle", String(handleNumber));
940
+ if (options.keyboardSupport) {
941
+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex
942
+ // 0 = focusable and reachable
943
+ handle.setAttribute("tabindex", "0");
944
+ handle.addEventListener("keydown", function (event) {
945
+ return eventKeydown(event, handleNumber);
946
+ });
947
+ }
948
+ if (options.handleAttributes !== undefined) {
949
+ var attributes_1 = options.handleAttributes[handleNumber];
950
+ Object.keys(attributes_1).forEach(function (attribute) {
951
+ handle.setAttribute(attribute, attributes_1[attribute]);
952
+ });
953
+ }
954
+ handle.setAttribute("role", "slider");
955
+ handle.setAttribute("aria-orientation", options.ort ? "vertical" : "horizontal");
956
+ if (handleNumber === 0) {
957
+ addClass(handle, options.cssClasses.handleLower);
958
+ }
959
+ else if (handleNumber === options.handles - 1) {
960
+ addClass(handle, options.cssClasses.handleUpper);
961
+ }
962
+ return origin;
963
+ }
964
+ // Insert nodes for connect elements
965
+ function addConnect(base, add) {
966
+ if (!add) {
967
+ return false;
968
+ }
969
+ return addNodeTo(base, options.cssClasses.connect);
970
+ }
971
+ // Add handles to the slider base.
972
+ function addElements(connectOptions, base) {
973
+ var connectBase = addNodeTo(base, options.cssClasses.connects);
974
+ scope_Handles = [];
975
+ scope_Connects = [];
976
+ scope_Connects.push(addConnect(connectBase, connectOptions[0]));
977
+ // [::::O====O====O====]
978
+ // connectOptions = [0, 1, 1, 1]
979
+ for (var i = 0; i < options.handles; i++) {
980
+ // Keep a list of all added handles.
981
+ scope_Handles.push(addOrigin(base, i));
982
+ scope_HandleNumbers[i] = i;
983
+ scope_Connects.push(addConnect(connectBase, connectOptions[i + 1]));
984
+ }
985
+ }
986
+ // Initialize a single slider.
987
+ function addSlider(addTarget) {
988
+ // Apply classes and data to the target.
989
+ addClass(addTarget, options.cssClasses.target);
990
+ if (options.dir === 0) {
991
+ addClass(addTarget, options.cssClasses.ltr);
992
+ }
993
+ else {
994
+ addClass(addTarget, options.cssClasses.rtl);
995
+ }
996
+ if (options.ort === 0) {
997
+ addClass(addTarget, options.cssClasses.horizontal);
998
+ }
999
+ else {
1000
+ addClass(addTarget, options.cssClasses.vertical);
1001
+ }
1002
+ var textDirection = getComputedStyle(addTarget).direction;
1003
+ if (textDirection === "rtl") {
1004
+ addClass(addTarget, options.cssClasses.textDirectionRtl);
1005
+ }
1006
+ else {
1007
+ addClass(addTarget, options.cssClasses.textDirectionLtr);
1008
+ }
1009
+ return addNodeTo(addTarget, options.cssClasses.base);
1010
+ }
1011
+ function addTooltip(handle, handleNumber) {
1012
+ if (!options.tooltips || !options.tooltips[handleNumber]) {
1013
+ return false;
1014
+ }
1015
+ return addNodeTo(handle.firstChild, options.cssClasses.tooltip);
1016
+ }
1017
+ function isSliderDisabled() {
1018
+ return scope_Target.hasAttribute("disabled");
1019
+ }
1020
+ // Disable the slider dragging if any handle is disabled
1021
+ function isHandleDisabled(handleNumber) {
1022
+ var handleOrigin = scope_Handles[handleNumber];
1023
+ return handleOrigin.hasAttribute("disabled");
1024
+ }
1025
+ function removeTooltips() {
1026
+ if (scope_Tooltips) {
1027
+ removeEvent("update" + INTERNAL_EVENT_NS.tooltips);
1028
+ scope_Tooltips.forEach(function (tooltip) {
1029
+ if (tooltip) {
1030
+ removeElement(tooltip);
1031
+ }
1032
+ });
1033
+ scope_Tooltips = null;
1034
+ }
1035
+ }
1036
+ // The tooltips option is a shorthand for using the 'update' event.
1037
+ function tooltips() {
1038
+ removeTooltips();
1039
+ // Tooltips are added with options.tooltips in original order.
1040
+ scope_Tooltips = scope_Handles.map(addTooltip);
1041
+ bindEvent("update" + INTERNAL_EVENT_NS.tooltips, function (values, handleNumber, unencoded) {
1042
+ if (!scope_Tooltips || !options.tooltips) {
1043
+ return;
1044
+ }
1045
+ if (scope_Tooltips[handleNumber] === false) {
1046
+ return;
1047
+ }
1048
+ var formattedValue = values[handleNumber];
1049
+ if (options.tooltips[handleNumber] !== true) {
1050
+ formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);
1051
+ }
1052
+ scope_Tooltips[handleNumber].innerHTML = formattedValue;
1053
+ });
1054
+ }
1055
+ function aria() {
1056
+ removeEvent("update" + INTERNAL_EVENT_NS.aria);
1057
+ bindEvent("update" + INTERNAL_EVENT_NS.aria, function (values, handleNumber, unencoded, tap, positions) {
1058
+ // Update Aria Values for all handles, as a change in one changes min and max values for the next.
1059
+ scope_HandleNumbers.forEach(function (index) {
1060
+ var handle = scope_Handles[index];
1061
+ var min = checkHandlePosition(scope_Locations, index, 0, true, true, true);
1062
+ var max = checkHandlePosition(scope_Locations, index, 100, true, true, true);
1063
+ var now = positions[index];
1064
+ // Formatted value for display
1065
+ var text = String(options.ariaFormat.to(unencoded[index]));
1066
+ // Map to slider range values
1067
+ min = scope_Spectrum.fromStepping(min).toFixed(1);
1068
+ max = scope_Spectrum.fromStepping(max).toFixed(1);
1069
+ now = scope_Spectrum.fromStepping(now).toFixed(1);
1070
+ handle.children[0].setAttribute("aria-valuemin", min);
1071
+ handle.children[0].setAttribute("aria-valuemax", max);
1072
+ handle.children[0].setAttribute("aria-valuenow", now);
1073
+ handle.children[0].setAttribute("aria-valuetext", text);
1074
+ });
1075
+ });
1076
+ }
1077
+ function getGroup(pips) {
1078
+ // Use the range.
1079
+ if (pips.mode === exports.PipsMode.Range || pips.mode === exports.PipsMode.Steps) {
1080
+ return scope_Spectrum.xVal;
1081
+ }
1082
+ if (pips.mode === exports.PipsMode.Count) {
1083
+ if (pips.values < 2) {
1084
+ throw new Error("noUiSlider: 'values' (>= 2) required for mode 'count'.");
1085
+ }
1086
+ // Divide 0 - 100 in 'count' parts.
1087
+ var interval = pips.values - 1;
1088
+ var spread = 100 / interval;
1089
+ var values = [];
1090
+ // List these parts and have them handled as 'positions'.
1091
+ while (interval--) {
1092
+ values[interval] = interval * spread;
1093
+ }
1094
+ values.push(100);
1095
+ return mapToRange(values, pips.stepped);
1096
+ }
1097
+ if (pips.mode === exports.PipsMode.Positions) {
1098
+ // Map all percentages to on-range values.
1099
+ return mapToRange(pips.values, pips.stepped);
1100
+ }
1101
+ if (pips.mode === exports.PipsMode.Values) {
1102
+ // If the value must be stepped, it needs to be converted to a percentage first.
1103
+ if (pips.stepped) {
1104
+ return pips.values.map(function (value) {
1105
+ // Convert to percentage, apply step, return to value.
1106
+ return scope_Spectrum.fromStepping(scope_Spectrum.getStep(scope_Spectrum.toStepping(value)));
1107
+ });
1108
+ }
1109
+ // Otherwise, we can simply use the values.
1110
+ return pips.values;
1111
+ }
1112
+ return []; // pips.mode = never
1113
+ }
1114
+ function mapToRange(values, stepped) {
1115
+ return values.map(function (value) {
1116
+ return scope_Spectrum.fromStepping(stepped ? scope_Spectrum.getStep(value) : value);
1117
+ });
1118
+ }
1119
+ function generateSpread(pips) {
1120
+ function safeIncrement(value, increment) {
1121
+ // Avoid floating point variance by dropping the smallest decimal places.
1122
+ return Number((value + increment).toFixed(7));
1123
+ }
1124
+ var group = getGroup(pips);
1125
+ var indexes = {};
1126
+ var firstInRange = scope_Spectrum.xVal[0];
1127
+ var lastInRange = scope_Spectrum.xVal[scope_Spectrum.xVal.length - 1];
1128
+ var ignoreFirst = false;
1129
+ var ignoreLast = false;
1130
+ var prevPct = 0;
1131
+ // Create a copy of the group, sort it and filter away all duplicates.
1132
+ group = unique(group.slice().sort(function (a, b) {
1133
+ return a - b;
1134
+ }));
1135
+ // Make sure the range starts with the first element.
1136
+ if (group[0] !== firstInRange) {
1137
+ group.unshift(firstInRange);
1138
+ ignoreFirst = true;
1139
+ }
1140
+ // Likewise for the last one.
1141
+ if (group[group.length - 1] !== lastInRange) {
1142
+ group.push(lastInRange);
1143
+ ignoreLast = true;
1144
+ }
1145
+ group.forEach(function (current, index) {
1146
+ // Get the current step and the lower + upper positions.
1147
+ var step;
1148
+ var i;
1149
+ var q;
1150
+ var low = current;
1151
+ var high = group[index + 1];
1152
+ var newPct;
1153
+ var pctDifference;
1154
+ var pctPos;
1155
+ var type;
1156
+ var steps;
1157
+ var realSteps;
1158
+ var stepSize;
1159
+ var isSteps = pips.mode === exports.PipsMode.Steps;
1160
+ // When using 'steps' mode, use the provided steps.
1161
+ // Otherwise, we'll step on to the next subrange.
1162
+ if (isSteps) {
1163
+ step = scope_Spectrum.xNumSteps[index];
1164
+ }
1165
+ // Default to a 'full' step.
1166
+ if (!step) {
1167
+ step = high - low;
1168
+ }
1169
+ // If high is undefined we are at the last subrange. Make sure it iterates once (#1088)
1170
+ if (high === undefined) {
1171
+ high = low;
1172
+ }
1173
+ // Make sure step isn't 0, which would cause an infinite loop (#654)
1174
+ step = Math.max(step, 0.0000001);
1175
+ // Find all steps in the subrange.
1176
+ for (i = low; i <= high; i = safeIncrement(i, step)) {
1177
+ // Get the percentage value for the current step,
1178
+ // calculate the size for the subrange.
1179
+ newPct = scope_Spectrum.toStepping(i);
1180
+ pctDifference = newPct - prevPct;
1181
+ steps = pctDifference / (pips.density || 1);
1182
+ realSteps = Math.round(steps);
1183
+ // This ratio represents the amount of percentage-space a point indicates.
1184
+ // For a density 1 the points/percentage = 1. For density 2, that percentage needs to be re-divided.
1185
+ // Round the percentage offset to an even number, then divide by two
1186
+ // to spread the offset on both sides of the range.
1187
+ stepSize = pctDifference / realSteps;
1188
+ // Divide all points evenly, adding the correct number to this subrange.
1189
+ // Run up to <= so that 100% gets a point, event if ignoreLast is set.
1190
+ for (q = 1; q <= realSteps; q += 1) {
1191
+ // The ratio between the rounded value and the actual size might be ~1% off.
1192
+ // Correct the percentage offset by the number of points
1193
+ // per subrange. density = 1 will result in 100 points on the
1194
+ // full range, 2 for 50, 4 for 25, etc.
1195
+ pctPos = prevPct + q * stepSize;
1196
+ indexes[pctPos.toFixed(5)] = [scope_Spectrum.fromStepping(pctPos), 0];
1197
+ }
1198
+ // Determine the point type.
1199
+ type = group.indexOf(i) > -1 ? exports.PipsType.LargeValue : isSteps ? exports.PipsType.SmallValue : exports.PipsType.NoValue;
1200
+ // Enforce the 'ignoreFirst' option by overwriting the type for 0.
1201
+ if (!index && ignoreFirst && i !== high) {
1202
+ type = 0;
1203
+ }
1204
+ if (!(i === high && ignoreLast)) {
1205
+ // Mark the 'type' of this point. 0 = plain, 1 = real value, 2 = step value.
1206
+ indexes[newPct.toFixed(5)] = [i, type];
1207
+ }
1208
+ // Update the percentage count.
1209
+ prevPct = newPct;
1210
+ }
1211
+ });
1212
+ return indexes;
1213
+ }
1214
+ function addMarking(spread, filterFunc, formatter) {
1215
+ var _a, _b;
1216
+ var element = scope_Document.createElement("div");
1217
+ var valueSizeClasses = (_a = {},
1218
+ _a[exports.PipsType.None] = "",
1219
+ _a[exports.PipsType.NoValue] = options.cssClasses.valueNormal,
1220
+ _a[exports.PipsType.LargeValue] = options.cssClasses.valueLarge,
1221
+ _a[exports.PipsType.SmallValue] = options.cssClasses.valueSub,
1222
+ _a);
1223
+ var markerSizeClasses = (_b = {},
1224
+ _b[exports.PipsType.None] = "",
1225
+ _b[exports.PipsType.NoValue] = options.cssClasses.markerNormal,
1226
+ _b[exports.PipsType.LargeValue] = options.cssClasses.markerLarge,
1227
+ _b[exports.PipsType.SmallValue] = options.cssClasses.markerSub,
1228
+ _b);
1229
+ var valueOrientationClasses = [options.cssClasses.valueHorizontal, options.cssClasses.valueVertical];
1230
+ var markerOrientationClasses = [options.cssClasses.markerHorizontal, options.cssClasses.markerVertical];
1231
+ addClass(element, options.cssClasses.pips);
1232
+ addClass(element, options.ort === 0 ? options.cssClasses.pipsHorizontal : options.cssClasses.pipsVertical);
1233
+ function getClasses(type, source) {
1234
+ var a = source === options.cssClasses.value;
1235
+ var orientationClasses = a ? valueOrientationClasses : markerOrientationClasses;
1236
+ var sizeClasses = a ? valueSizeClasses : markerSizeClasses;
1237
+ return source + " " + orientationClasses[options.ort] + " " + sizeClasses[type];
1238
+ }
1239
+ function addSpread(offset, value, type) {
1240
+ // Apply the filter function, if it is set.
1241
+ type = filterFunc ? filterFunc(value, type) : type;
1242
+ if (type === exports.PipsType.None) {
1243
+ return;
1244
+ }
1245
+ // Add a marker for every point
1246
+ var node = addNodeTo(element, false);
1247
+ node.className = getClasses(type, options.cssClasses.marker);
1248
+ node.style[options.style] = offset + "%";
1249
+ // Values are only appended for points marked '1' or '2'.
1250
+ if (type > exports.PipsType.NoValue) {
1251
+ node = addNodeTo(element, false);
1252
+ node.className = getClasses(type, options.cssClasses.value);
1253
+ node.setAttribute("data-value", String(value));
1254
+ node.style[options.style] = offset + "%";
1255
+ node.innerHTML = String(formatter.to(value));
1256
+ }
1257
+ }
1258
+ // Append all points.
1259
+ Object.keys(spread).forEach(function (offset) {
1260
+ addSpread(offset, spread[offset][0], spread[offset][1]);
1261
+ });
1262
+ return element;
1263
+ }
1264
+ function removePips() {
1265
+ if (scope_Pips) {
1266
+ removeElement(scope_Pips);
1267
+ scope_Pips = null;
1268
+ }
1269
+ }
1270
+ function pips(pips) {
1271
+ // Fix #669
1272
+ removePips();
1273
+ var spread = generateSpread(pips);
1274
+ var filter = pips.filter;
1275
+ var format = pips.format || {
1276
+ to: function (value) {
1277
+ return String(Math.round(value));
1278
+ },
1279
+ };
1280
+ scope_Pips = scope_Target.appendChild(addMarking(spread, filter, format));
1281
+ return scope_Pips;
1282
+ }
1283
+ // Shorthand for base dimensions.
1284
+ function baseSize() {
1285
+ var rect = scope_Base.getBoundingClientRect();
1286
+ var alt = ("offset" + ["Width", "Height"][options.ort]);
1287
+ return options.ort === 0 ? rect.width || scope_Base[alt] : rect.height || scope_Base[alt];
1288
+ }
1289
+ // Handler for attaching events trough a proxy.
1290
+ function attachEvent(events, element, callback, data) {
1291
+ // This function can be used to 'filter' events to the slider.
1292
+ // element is a node, not a nodeList
1293
+ var method = function (event) {
1294
+ var e = fixEvent(event, data.pageOffset, data.target || element);
1295
+ // fixEvent returns false if this event has a different target
1296
+ // when handling (multi-) touch events;
1297
+ if (!e) {
1298
+ return false;
1299
+ }
1300
+ // doNotReject is passed by all end events to make sure released touches
1301
+ // are not rejected, leaving the slider "stuck" to the cursor;
1302
+ if (isSliderDisabled() && !data.doNotReject) {
1303
+ return false;
1304
+ }
1305
+ // Stop if an active 'tap' transition is taking place.
1306
+ if (hasClass(scope_Target, options.cssClasses.tap) && !data.doNotReject) {
1307
+ return false;
1308
+ }
1309
+ // Ignore right or middle clicks on start #454
1310
+ if (events === actions.start && e.buttons !== undefined && e.buttons > 1) {
1311
+ return false;
1312
+ }
1313
+ // Ignore right or middle clicks on start #454
1314
+ if (data.hover && e.buttons) {
1315
+ return false;
1316
+ }
1317
+ // 'supportsPassive' is only true if a browser also supports touch-action: none in CSS.
1318
+ // iOS safari does not, so it doesn't get to benefit from passive scrolling. iOS does support
1319
+ // touch-action: manipulation, but that allows panning, which breaks
1320
+ // sliders after zooming/on non-responsive pages.
1321
+ // See: https://bugs.webkit.org/show_bug.cgi?id=133112
1322
+ if (!supportsPassive) {
1323
+ e.preventDefault();
1324
+ }
1325
+ e.calcPoint = e.points[options.ort];
1326
+ // Call the event handler with the event [ and additional data ].
1327
+ callback(e, data);
1328
+ return;
1329
+ };
1330
+ var methods = [];
1331
+ // Bind a closure on the target for every event type.
1332
+ events.split(" ").forEach(function (eventName) {
1333
+ element.addEventListener(eventName, method, supportsPassive ? { passive: true } : false);
1334
+ methods.push([eventName, method]);
1335
+ });
1336
+ return methods;
1337
+ }
1338
+ // Provide a clean event with standardized offset values.
1339
+ function fixEvent(e, pageOffset, eventTarget) {
1340
+ // Filter the event to register the type, which can be
1341
+ // touch, mouse or pointer. Offset changes need to be
1342
+ // made on an event specific basis.
1343
+ var touch = e.type.indexOf("touch") === 0;
1344
+ var mouse = e.type.indexOf("mouse") === 0;
1345
+ var pointer = e.type.indexOf("pointer") === 0;
1346
+ var x = 0;
1347
+ var y = 0;
1348
+ // IE10 implemented pointer events with a prefix;
1349
+ if (e.type.indexOf("MSPointer") === 0) {
1350
+ pointer = true;
1351
+ }
1352
+ // Erroneous events seem to be passed in occasionally on iOS/iPadOS after user finishes interacting with
1353
+ // the slider. They appear to be of type MouseEvent, yet they don't have usual properties set. Ignore
1354
+ // events that have no touches or buttons associated with them. (#1057, #1079, #1095)
1355
+ if (e.type === "mousedown" && !e.buttons && !e.touches) {
1356
+ return false;
1357
+ }
1358
+ // The only thing one handle should be concerned about is the touches that originated on top of it.
1359
+ if (touch) {
1360
+ // Returns true if a touch originated on the target.
1361
+ var isTouchOnTarget = function (checkTouch) {
1362
+ var target = checkTouch.target;
1363
+ return (target === eventTarget ||
1364
+ eventTarget.contains(target) ||
1365
+ (e.composed && e.composedPath().shift() === eventTarget));
1366
+ };
1367
+ // In the case of touchstart events, we need to make sure there is still no more than one
1368
+ // touch on the target so we look amongst all touches.
1369
+ if (e.type === "touchstart") {
1370
+ var targetTouches = Array.prototype.filter.call(e.touches, isTouchOnTarget);
1371
+ // Do not support more than one touch per handle.
1372
+ if (targetTouches.length > 1) {
1373
+ return false;
1374
+ }
1375
+ x = targetTouches[0].pageX;
1376
+ y = targetTouches[0].pageY;
1377
+ }
1378
+ else {
1379
+ // In the other cases, find on changedTouches is enough.
1380
+ var targetTouch = Array.prototype.find.call(e.changedTouches, isTouchOnTarget);
1381
+ // Cancel if the target touch has not moved.
1382
+ if (!targetTouch) {
1383
+ return false;
1384
+ }
1385
+ x = targetTouch.pageX;
1386
+ y = targetTouch.pageY;
1387
+ }
1388
+ }
1389
+ pageOffset = pageOffset || getPageOffset(scope_Document);
1390
+ if (mouse || pointer) {
1391
+ x = e.clientX + pageOffset.x;
1392
+ y = e.clientY + pageOffset.y;
1393
+ }
1394
+ e.pageOffset = pageOffset;
1395
+ e.points = [x, y];
1396
+ e.cursor = mouse || pointer; // Fix #435
1397
+ return e;
1398
+ }
1399
+ // Translate a coordinate in the document to a percentage on the slider
1400
+ function calcPointToPercentage(calcPoint) {
1401
+ var location = calcPoint - offset(scope_Base, options.ort);
1402
+ var proposal = (location * 100) / baseSize();
1403
+ // Clamp proposal between 0% and 100%
1404
+ // Out-of-bound coordinates may occur when .noUi-base pseudo-elements
1405
+ // are used (e.g. contained handles feature)
1406
+ proposal = limit(proposal);
1407
+ return options.dir ? 100 - proposal : proposal;
1408
+ }
1409
+ // Find handle closest to a certain percentage on the slider
1410
+ function getClosestHandle(clickedPosition) {
1411
+ var smallestDifference = 100;
1412
+ var handleNumber = false;
1413
+ scope_Handles.forEach(function (handle, index) {
1414
+ // Disabled handles are ignored
1415
+ if (isHandleDisabled(index)) {
1416
+ return;
1417
+ }
1418
+ var handlePosition = scope_Locations[index];
1419
+ var differenceWithThisHandle = Math.abs(handlePosition - clickedPosition);
1420
+ // Initial state
1421
+ var clickAtEdge = differenceWithThisHandle === 100 && smallestDifference === 100;
1422
+ // Difference with this handle is smaller than the previously checked handle
1423
+ var isCloser = differenceWithThisHandle < smallestDifference;
1424
+ var isCloserAfter = differenceWithThisHandle <= smallestDifference && clickedPosition > handlePosition;
1425
+ if (isCloser || isCloserAfter || clickAtEdge) {
1426
+ handleNumber = index;
1427
+ smallestDifference = differenceWithThisHandle;
1428
+ }
1429
+ });
1430
+ return handleNumber;
1431
+ }
1432
+ // Fire 'end' when a mouse or pen leaves the document.
1433
+ function documentLeave(event, data) {
1434
+ if (event.type === "mouseout" &&
1435
+ event.target.nodeName === "HTML" &&
1436
+ event.relatedTarget === null) {
1437
+ eventEnd(event, data);
1438
+ }
1439
+ }
1440
+ // Handle movement on document for handle and range drag.
1441
+ function eventMove(event, data) {
1442
+ // Fix #498
1443
+ // Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).
1444
+ // https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero
1445
+ // IE9 has .buttons and .which zero on mousemove.
1446
+ // Firefox breaks the spec MDN defines.
1447
+ if (navigator.appVersion.indexOf("MSIE 9") === -1 && event.buttons === 0 && data.buttonsProperty !== 0) {
1448
+ return eventEnd(event, data);
1449
+ }
1450
+ // Check if we are moving up or down
1451
+ var movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint);
1452
+ // Convert the movement into a percentage of the slider width/height
1453
+ var proposal = (movement * 100) / data.baseSize;
1454
+ moveHandles(movement > 0, proposal, data.locations, data.handleNumbers, data.connect);
1455
+ }
1456
+ // Unbind move events on document, call callbacks.
1457
+ function eventEnd(event, data) {
1458
+ // The handle is no longer active, so remove the class.
1459
+ if (data.handle) {
1460
+ removeClass(data.handle, options.cssClasses.active);
1461
+ scope_ActiveHandlesCount -= 1;
1462
+ }
1463
+ // Unbind the move and end events, which are added on 'start'.
1464
+ data.listeners.forEach(function (c) {
1465
+ scope_DocumentElement.removeEventListener(c[0], c[1]);
1466
+ });
1467
+ if (scope_ActiveHandlesCount === 0) {
1468
+ // Remove dragging class.
1469
+ removeClass(scope_Target, options.cssClasses.drag);
1470
+ setZindex();
1471
+ // Remove cursor styles and text-selection events bound to the body.
1472
+ if (event.cursor) {
1473
+ scope_Body.style.cursor = "";
1474
+ scope_Body.removeEventListener("selectstart", preventDefault);
1475
+ }
1476
+ }
1477
+ if (options.events.smoothSteps) {
1478
+ data.handleNumbers.forEach(function (handleNumber) {
1479
+ setHandle(handleNumber, scope_Locations[handleNumber], true, true, false, false);
1480
+ });
1481
+ data.handleNumbers.forEach(function (handleNumber) {
1482
+ fireEvent("update", handleNumber);
1483
+ });
1484
+ }
1485
+ data.handleNumbers.forEach(function (handleNumber) {
1486
+ fireEvent("change", handleNumber);
1487
+ fireEvent("set", handleNumber);
1488
+ fireEvent("end", handleNumber);
1489
+ });
1490
+ }
1491
+ // Bind move events on document.
1492
+ function eventStart(event, data) {
1493
+ // Ignore event if any handle is disabled
1494
+ if (data.handleNumbers.some(isHandleDisabled)) {
1495
+ return;
1496
+ }
1497
+ var handle;
1498
+ if (data.handleNumbers.length === 1) {
1499
+ var handleOrigin = scope_Handles[data.handleNumbers[0]];
1500
+ handle = handleOrigin.children[0];
1501
+ scope_ActiveHandlesCount += 1;
1502
+ // Mark the handle as 'active' so it can be styled.
1503
+ addClass(handle, options.cssClasses.active);
1504
+ }
1505
+ // A drag should never propagate up to the 'tap' event.
1506
+ event.stopPropagation();
1507
+ // Record the event listeners.
1508
+ var listeners = [];
1509
+ // Attach the move and end events.
1510
+ var moveEvent = attachEvent(actions.move, scope_DocumentElement, eventMove, {
1511
+ // The event target has changed so we need to propagate the original one so that we keep
1512
+ // relying on it to extract target touches.
1513
+ target: event.target,
1514
+ handle: handle,
1515
+ connect: data.connect,
1516
+ listeners: listeners,
1517
+ startCalcPoint: event.calcPoint,
1518
+ baseSize: baseSize(),
1519
+ pageOffset: event.pageOffset,
1520
+ handleNumbers: data.handleNumbers,
1521
+ buttonsProperty: event.buttons,
1522
+ locations: scope_Locations.slice(),
1523
+ });
1524
+ var endEvent = attachEvent(actions.end, scope_DocumentElement, eventEnd, {
1525
+ target: event.target,
1526
+ handle: handle,
1527
+ listeners: listeners,
1528
+ doNotReject: true,
1529
+ handleNumbers: data.handleNumbers,
1530
+ });
1531
+ var outEvent = attachEvent("mouseout", scope_DocumentElement, documentLeave, {
1532
+ target: event.target,
1533
+ handle: handle,
1534
+ listeners: listeners,
1535
+ doNotReject: true,
1536
+ handleNumbers: data.handleNumbers,
1537
+ });
1538
+ // We want to make sure we pushed the listeners in the listener list rather than creating
1539
+ // a new one as it has already been passed to the event handlers.
1540
+ listeners.push.apply(listeners, moveEvent.concat(endEvent, outEvent));
1541
+ // Text selection isn't an issue on touch devices,
1542
+ // so adding cursor styles can be skipped.
1543
+ if (event.cursor) {
1544
+ // Prevent the 'I' cursor and extend the range-drag cursor.
1545
+ scope_Body.style.cursor = getComputedStyle(event.target).cursor;
1546
+ // Mark the target with a dragging state.
1547
+ if (scope_Handles.length > 1) {
1548
+ addClass(scope_Target, options.cssClasses.drag);
1549
+ }
1550
+ // Prevent text selection when dragging the handles.
1551
+ // In noUiSlider <= 9.2.0, this was handled by calling preventDefault on mouse/touch start/move,
1552
+ // which is scroll blocking. The selectstart event is supported by FireFox starting from version 52,
1553
+ // meaning the only holdout is iOS Safari. This doesn't matter: text selection isn't triggered there.
1554
+ // The 'cursor' flag is false.
1555
+ // See: http://caniuse.com/#search=selectstart
1556
+ scope_Body.addEventListener("selectstart", preventDefault, false);
1557
+ }
1558
+ data.handleNumbers.forEach(function (handleNumber) {
1559
+ fireEvent("start", handleNumber);
1560
+ });
1561
+ }
1562
+ // Move closest handle to tapped location.
1563
+ function eventTap(event) {
1564
+ // The tap event shouldn't propagate up
1565
+ event.stopPropagation();
1566
+ var proposal = calcPointToPercentage(event.calcPoint);
1567
+ var handleNumber = getClosestHandle(proposal);
1568
+ // Tackle the case that all handles are 'disabled'.
1569
+ if (handleNumber === false) {
1570
+ return;
1571
+ }
1572
+ // Flag the slider as it is now in a transitional state.
1573
+ // Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.
1574
+ if (!options.events.snap) {
1575
+ addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);
1576
+ }
1577
+ setHandle(handleNumber, proposal, true, true);
1578
+ setZindex();
1579
+ fireEvent("slide", handleNumber, true);
1580
+ fireEvent("update", handleNumber, true);
1581
+ if (!options.events.snap) {
1582
+ fireEvent("change", handleNumber, true);
1583
+ fireEvent("set", handleNumber, true);
1584
+ }
1585
+ else {
1586
+ eventStart(event, { handleNumbers: [handleNumber] });
1587
+ }
1588
+ }
1589
+ // Fires a 'hover' event for a hovered mouse/pen position.
1590
+ function eventHover(event) {
1591
+ var proposal = calcPointToPercentage(event.calcPoint);
1592
+ var to = scope_Spectrum.getStep(proposal);
1593
+ var value = scope_Spectrum.fromStepping(to);
1594
+ Object.keys(scope_Events).forEach(function (targetEvent) {
1595
+ if ("hover" === targetEvent.split(".")[0]) {
1596
+ scope_Events[targetEvent].forEach(function (callback) {
1597
+ callback.call(scope_Self, value);
1598
+ });
1599
+ }
1600
+ });
1601
+ }
1602
+ // Handles keydown on focused handles
1603
+ // Don't move the document when pressing arrow keys on focused handles
1604
+ function eventKeydown(event, handleNumber) {
1605
+ if (isSliderDisabled() || isHandleDisabled(handleNumber)) {
1606
+ return false;
1607
+ }
1608
+ var horizontalKeys = ["Left", "Right"];
1609
+ var verticalKeys = ["Down", "Up"];
1610
+ var largeStepKeys = ["PageDown", "PageUp"];
1611
+ var edgeKeys = ["Home", "End"];
1612
+ if (options.dir && !options.ort) {
1613
+ // On an right-to-left slider, the left and right keys act inverted
1614
+ horizontalKeys.reverse();
1615
+ }
1616
+ else if (options.ort && !options.dir) {
1617
+ // On a top-to-bottom slider, the up and down keys act inverted
1618
+ verticalKeys.reverse();
1619
+ largeStepKeys.reverse();
1620
+ }
1621
+ // Strip "Arrow" for IE compatibility. https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key
1622
+ var key = event.key.replace("Arrow", "");
1623
+ var isLargeDown = key === largeStepKeys[0];
1624
+ var isLargeUp = key === largeStepKeys[1];
1625
+ var isDown = key === verticalKeys[0] || key === horizontalKeys[0] || isLargeDown;
1626
+ var isUp = key === verticalKeys[1] || key === horizontalKeys[1] || isLargeUp;
1627
+ var isMin = key === edgeKeys[0];
1628
+ var isMax = key === edgeKeys[1];
1629
+ if (!isDown && !isUp && !isMin && !isMax) {
1630
+ return true;
1631
+ }
1632
+ event.preventDefault();
1633
+ var to;
1634
+ if (isUp || isDown) {
1635
+ var direction = isDown ? 0 : 1;
1636
+ var steps = getNextStepsForHandle(handleNumber);
1637
+ var step = steps[direction];
1638
+ // At the edge of a slider, do nothing
1639
+ if (step === null) {
1640
+ return false;
1641
+ }
1642
+ // No step set, use the default of 10% of the sub-range
1643
+ if (step === false) {
1644
+ step = scope_Spectrum.getDefaultStep(scope_Locations[handleNumber], isDown, options.keyboardDefaultStep);
1645
+ }
1646
+ if (isLargeUp || isLargeDown) {
1647
+ step *= options.keyboardPageMultiplier;
1648
+ }
1649
+ else {
1650
+ step *= options.keyboardMultiplier;
1651
+ }
1652
+ // Step over zero-length ranges (#948);
1653
+ step = Math.max(step, 0.0000001);
1654
+ // Decrement for down steps
1655
+ step = (isDown ? -1 : 1) * step;
1656
+ to = scope_Values[handleNumber] + step;
1657
+ }
1658
+ else if (isMax) {
1659
+ // End key
1660
+ to = options.spectrum.xVal[options.spectrum.xVal.length - 1];
1661
+ }
1662
+ else {
1663
+ // Home key
1664
+ to = options.spectrum.xVal[0];
1665
+ }
1666
+ setHandle(handleNumber, scope_Spectrum.toStepping(to), true, true);
1667
+ fireEvent("slide", handleNumber);
1668
+ fireEvent("update", handleNumber);
1669
+ fireEvent("change", handleNumber);
1670
+ fireEvent("set", handleNumber);
1671
+ return false;
1672
+ }
1673
+ // Attach events to several slider parts.
1674
+ function bindSliderEvents(behaviour) {
1675
+ // Attach the standard drag event to the handles.
1676
+ if (!behaviour.fixed) {
1677
+ scope_Handles.forEach(function (handle, index) {
1678
+ // These events are only bound to the visual handle
1679
+ // element, not the 'real' origin element.
1680
+ attachEvent(actions.start, handle.children[0], eventStart, {
1681
+ handleNumbers: [index],
1682
+ });
1683
+ });
1684
+ }
1685
+ // Attach the tap event to the slider base.
1686
+ if (behaviour.tap) {
1687
+ attachEvent(actions.start, scope_Base, eventTap, {});
1688
+ }
1689
+ // Fire hover events
1690
+ if (behaviour.hover) {
1691
+ attachEvent(actions.move, scope_Base, eventHover, {
1692
+ hover: true,
1693
+ });
1694
+ }
1695
+ // Make the range draggable.
1696
+ if (behaviour.drag) {
1697
+ scope_Connects.forEach(function (connect, index) {
1698
+ if (connect === false || index === 0 || index === scope_Connects.length - 1) {
1699
+ return;
1700
+ }
1701
+ var handleBefore = scope_Handles[index - 1];
1702
+ var handleAfter = scope_Handles[index];
1703
+ var eventHolders = [connect];
1704
+ var handlesToDrag = [handleBefore, handleAfter];
1705
+ var handleNumbersToDrag = [index - 1, index];
1706
+ addClass(connect, options.cssClasses.draggable);
1707
+ // When the range is fixed, the entire range can
1708
+ // be dragged by the handles. The handle in the first
1709
+ // origin will propagate the start event upward,
1710
+ // but it needs to be bound manually on the other.
1711
+ if (behaviour.fixed) {
1712
+ eventHolders.push(handleBefore.children[0]);
1713
+ eventHolders.push(handleAfter.children[0]);
1714
+ }
1715
+ if (behaviour.dragAll) {
1716
+ handlesToDrag = scope_Handles;
1717
+ handleNumbersToDrag = scope_HandleNumbers;
1718
+ }
1719
+ eventHolders.forEach(function (eventHolder) {
1720
+ attachEvent(actions.start, eventHolder, eventStart, {
1721
+ handles: handlesToDrag,
1722
+ handleNumbers: handleNumbersToDrag,
1723
+ connect: connect,
1724
+ });
1725
+ });
1726
+ });
1727
+ }
1728
+ }
1729
+ // Attach an event to this slider, possibly including a namespace
1730
+ function bindEvent(namespacedEvent, callback) {
1731
+ scope_Events[namespacedEvent] = scope_Events[namespacedEvent] || [];
1732
+ scope_Events[namespacedEvent].push(callback);
1733
+ // If the event bound is 'update,' fire it immediately for all handles.
1734
+ if (namespacedEvent.split(".")[0] === "update") {
1735
+ scope_Handles.forEach(function (a, index) {
1736
+ fireEvent("update", index);
1737
+ });
1738
+ }
1739
+ }
1740
+ function isInternalNamespace(namespace) {
1741
+ return namespace === INTERNAL_EVENT_NS.aria || namespace === INTERNAL_EVENT_NS.tooltips;
1742
+ }
1743
+ // Undo attachment of event
1744
+ function removeEvent(namespacedEvent) {
1745
+ var event = namespacedEvent && namespacedEvent.split(".")[0];
1746
+ var namespace = event ? namespacedEvent.substring(event.length) : namespacedEvent;
1747
+ Object.keys(scope_Events).forEach(function (bind) {
1748
+ var tEvent = bind.split(".")[0];
1749
+ var tNamespace = bind.substring(tEvent.length);
1750
+ if ((!event || event === tEvent) && (!namespace || namespace === tNamespace)) {
1751
+ // only delete protected internal event if intentional
1752
+ if (!isInternalNamespace(tNamespace) || namespace === tNamespace) {
1753
+ delete scope_Events[bind];
1754
+ }
1755
+ }
1756
+ });
1757
+ }
1758
+ // External event handling
1759
+ function fireEvent(eventName, handleNumber, tap) {
1760
+ Object.keys(scope_Events).forEach(function (targetEvent) {
1761
+ var eventType = targetEvent.split(".")[0];
1762
+ if (eventName === eventType) {
1763
+ scope_Events[targetEvent].forEach(function (callback) {
1764
+ callback.call(
1765
+ // Use the slider public API as the scope ('this')
1766
+ scope_Self,
1767
+ // Return values as array, so arg_1[arg_2] is always valid.
1768
+ scope_Values.map(options.format.to),
1769
+ // Handle index, 0 or 1
1770
+ handleNumber,
1771
+ // Un-formatted slider values
1772
+ scope_Values.slice(),
1773
+ // Event is fired by tap, true or false
1774
+ tap || false,
1775
+ // Left offset of the handle, in relation to the slider
1776
+ scope_Locations.slice(),
1777
+ // add the slider public API to an accessible parameter when this is unavailable
1778
+ scope_Self);
1779
+ });
1780
+ }
1781
+ });
1782
+ }
1783
+ // Split out the handle positioning logic so the Move event can use it, too
1784
+ function checkHandlePosition(reference, handleNumber, to, lookBackward, lookForward, getValue, smoothSteps) {
1785
+ var distance;
1786
+ // For sliders with multiple handles, limit movement to the other handle.
1787
+ // Apply the margin option by adding it to the handle positions.
1788
+ if (scope_Handles.length > 1 && !options.events.unconstrained) {
1789
+ if (lookBackward && handleNumber > 0) {
1790
+ distance = scope_Spectrum.getAbsoluteDistance(reference[handleNumber - 1], options.margin, false);
1791
+ to = Math.max(to, distance);
1792
+ }
1793
+ if (lookForward && handleNumber < scope_Handles.length - 1) {
1794
+ distance = scope_Spectrum.getAbsoluteDistance(reference[handleNumber + 1], options.margin, true);
1795
+ to = Math.min(to, distance);
1796
+ }
1797
+ }
1798
+ // The limit option has the opposite effect, limiting handles to a
1799
+ // maximum distance from another. Limit must be > 0, as otherwise
1800
+ // handles would be unmovable.
1801
+ if (scope_Handles.length > 1 && options.limit) {
1802
+ if (lookBackward && handleNumber > 0) {
1803
+ distance = scope_Spectrum.getAbsoluteDistance(reference[handleNumber - 1], options.limit, false);
1804
+ to = Math.min(to, distance);
1805
+ }
1806
+ if (lookForward && handleNumber < scope_Handles.length - 1) {
1807
+ distance = scope_Spectrum.getAbsoluteDistance(reference[handleNumber + 1], options.limit, true);
1808
+ to = Math.max(to, distance);
1809
+ }
1810
+ }
1811
+ // The padding option keeps the handles a certain distance from the
1812
+ // edges of the slider. Padding must be > 0.
1813
+ if (options.padding) {
1814
+ if (handleNumber === 0) {
1815
+ distance = scope_Spectrum.getAbsoluteDistance(0, options.padding[0], false);
1816
+ to = Math.max(to, distance);
1817
+ }
1818
+ if (handleNumber === scope_Handles.length - 1) {
1819
+ distance = scope_Spectrum.getAbsoluteDistance(100, options.padding[1], true);
1820
+ to = Math.min(to, distance);
1821
+ }
1822
+ }
1823
+ if (!smoothSteps) {
1824
+ to = scope_Spectrum.getStep(to);
1825
+ }
1826
+ // Limit percentage to the 0 - 100 range
1827
+ to = limit(to);
1828
+ // Return false if handle can't move
1829
+ if (to === reference[handleNumber] && !getValue) {
1830
+ return false;
1831
+ }
1832
+ return to;
1833
+ }
1834
+ // Uses slider orientation to create CSS rules. a = base value;
1835
+ function inRuleOrder(v, a) {
1836
+ var o = options.ort;
1837
+ return (o ? a : v) + ", " + (o ? v : a);
1838
+ }
1839
+ // Moves handle(s) by a percentage
1840
+ // (bool, % to move, [% where handle started, ...], [index in scope_Handles, ...])
1841
+ function moveHandles(upward, proposal, locations, handleNumbers, connect) {
1842
+ var proposals = locations.slice();
1843
+ // Store first handle now, so we still have it in case handleNumbers is reversed
1844
+ var firstHandle = handleNumbers[0];
1845
+ var smoothSteps = options.events.smoothSteps;
1846
+ var b = [!upward, upward];
1847
+ var f = [upward, !upward];
1848
+ // Copy handleNumbers so we don't change the dataset
1849
+ handleNumbers = handleNumbers.slice();
1850
+ // Check to see which handle is 'leading'.
1851
+ // If that one can't move the second can't either.
1852
+ if (upward) {
1853
+ handleNumbers.reverse();
1854
+ }
1855
+ // Step 1: get the maximum percentage that any of the handles can move
1856
+ if (handleNumbers.length > 1) {
1857
+ handleNumbers.forEach(function (handleNumber, o) {
1858
+ var to = checkHandlePosition(proposals, handleNumber, proposals[handleNumber] + proposal, b[o], f[o], false, smoothSteps);
1859
+ // Stop if one of the handles can't move.
1860
+ if (to === false) {
1861
+ proposal = 0;
1862
+ }
1863
+ else {
1864
+ proposal = to - proposals[handleNumber];
1865
+ proposals[handleNumber] = to;
1866
+ }
1867
+ });
1868
+ }
1869
+ // If using one handle, check backward AND forward
1870
+ else {
1871
+ b = f = [true];
1872
+ }
1873
+ var state = false;
1874
+ // Step 2: Try to set the handles with the found percentage
1875
+ handleNumbers.forEach(function (handleNumber, o) {
1876
+ state =
1877
+ setHandle(handleNumber, locations[handleNumber] + proposal, b[o], f[o], false, smoothSteps) || state;
1878
+ });
1879
+ // Step 3: If a handle moved, fire events
1880
+ if (state) {
1881
+ handleNumbers.forEach(function (handleNumber) {
1882
+ fireEvent("update", handleNumber);
1883
+ fireEvent("slide", handleNumber);
1884
+ });
1885
+ // If target is a connect, then fire drag event
1886
+ if (connect != undefined) {
1887
+ fireEvent("drag", firstHandle);
1888
+ }
1889
+ }
1890
+ }
1891
+ // Takes a base value and an offset. This offset is used for the connect bar size.
1892
+ // In the initial design for this feature, the origin element was 1% wide.
1893
+ // Unfortunately, a rounding bug in Chrome makes it impossible to implement this feature
1894
+ // in this manner: https://bugs.chromium.org/p/chromium/issues/detail?id=798223
1895
+ function transformDirection(a, b) {
1896
+ return options.dir ? 100 - a - b : a;
1897
+ }
1898
+ // Updates scope_Locations and scope_Values, updates visual state
1899
+ function updateHandlePosition(handleNumber, to) {
1900
+ // Update locations.
1901
+ scope_Locations[handleNumber] = to;
1902
+ // Convert the value to the slider stepping/range.
1903
+ scope_Values[handleNumber] = scope_Spectrum.fromStepping(to);
1904
+ var translation = transformDirection(to, 0) - scope_DirOffset;
1905
+ var translateRule = "translate(" + inRuleOrder(translation + "%", "0") + ")";
1906
+ scope_Handles[handleNumber].style[options.transformRule] = translateRule;
1907
+ updateConnect(handleNumber);
1908
+ updateConnect(handleNumber + 1);
1909
+ }
1910
+ // Handles before the slider middle are stacked later = higher,
1911
+ // Handles after the middle later is lower
1912
+ // [[7] [8] .......... | .......... [5] [4]
1913
+ function setZindex() {
1914
+ scope_HandleNumbers.forEach(function (handleNumber) {
1915
+ var dir = scope_Locations[handleNumber] > 50 ? -1 : 1;
1916
+ var zIndex = 3 + (scope_Handles.length + dir * handleNumber);
1917
+ scope_Handles[handleNumber].style.zIndex = String(zIndex);
1918
+ });
1919
+ }
1920
+ // Test suggested values and apply margin, step.
1921
+ // if exactInput is true, don't run checkHandlePosition, then the handle can be placed in between steps (#436)
1922
+ function setHandle(handleNumber, to, lookBackward, lookForward, exactInput, smoothSteps) {
1923
+ if (!exactInput) {
1924
+ to = checkHandlePosition(scope_Locations, handleNumber, to, lookBackward, lookForward, false, smoothSteps);
1925
+ }
1926
+ if (to === false) {
1927
+ return false;
1928
+ }
1929
+ updateHandlePosition(handleNumber, to);
1930
+ return true;
1931
+ }
1932
+ // Updates style attribute for connect nodes
1933
+ function updateConnect(index) {
1934
+ // Skip connects set to false
1935
+ if (!scope_Connects[index]) {
1936
+ return;
1937
+ }
1938
+ var l = 0;
1939
+ var h = 100;
1940
+ if (index !== 0) {
1941
+ l = scope_Locations[index - 1];
1942
+ }
1943
+ if (index !== scope_Connects.length - 1) {
1944
+ h = scope_Locations[index];
1945
+ }
1946
+ // We use two rules:
1947
+ // 'translate' to change the left/top offset;
1948
+ // 'scale' to change the width of the element;
1949
+ // As the element has a width of 100%, a translation of 100% is equal to 100% of the parent (.noUi-base)
1950
+ var connectWidth = h - l;
1951
+ var translateRule = "translate(" + inRuleOrder(transformDirection(l, connectWidth) + "%", "0") + ")";
1952
+ var scaleRule = "scale(" + inRuleOrder(connectWidth / 100, "1") + ")";
1953
+ scope_Connects[index].style[options.transformRule] =
1954
+ translateRule + " " + scaleRule;
1955
+ }
1956
+ // Parses value passed to .set method. Returns current value if not parse-able.
1957
+ function resolveToValue(to, handleNumber) {
1958
+ // Setting with null indicates an 'ignore'.
1959
+ // Inputting 'false' is invalid.
1960
+ if (to === null || to === false || to === undefined) {
1961
+ return scope_Locations[handleNumber];
1962
+ }
1963
+ // If a formatted number was passed, attempt to decode it.
1964
+ if (typeof to === "number") {
1965
+ to = String(to);
1966
+ }
1967
+ to = options.format.from(to);
1968
+ if (to !== false) {
1969
+ to = scope_Spectrum.toStepping(to);
1970
+ }
1971
+ // If parsing the number failed, use the current value.
1972
+ if (to === false || isNaN(to)) {
1973
+ return scope_Locations[handleNumber];
1974
+ }
1975
+ return to;
1976
+ }
1977
+ // Set the slider value.
1978
+ function valueSet(input, fireSetEvent, exactInput) {
1979
+ var values = asArray(input);
1980
+ var isInit = scope_Locations[0] === undefined;
1981
+ // Event fires by default
1982
+ fireSetEvent = fireSetEvent === undefined ? true : fireSetEvent;
1983
+ // Animation is optional.
1984
+ // Make sure the initial values were set before using animated placement.
1985
+ if (options.animate && !isInit) {
1986
+ addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);
1987
+ }
1988
+ // First pass, without lookAhead but with lookBackward. Values are set from left to right.
1989
+ scope_HandleNumbers.forEach(function (handleNumber) {
1990
+ setHandle(handleNumber, resolveToValue(values[handleNumber], handleNumber), true, false, exactInput);
1991
+ });
1992
+ var i = scope_HandleNumbers.length === 1 ? 0 : 1;
1993
+ // Spread handles evenly across the slider if the range has no size (min=max)
1994
+ if (isInit && scope_Spectrum.hasNoSize()) {
1995
+ exactInput = true;
1996
+ scope_Locations[0] = 0;
1997
+ if (scope_HandleNumbers.length > 1) {
1998
+ var space_1 = 100 / (scope_HandleNumbers.length - 1);
1999
+ scope_HandleNumbers.forEach(function (handleNumber) {
2000
+ scope_Locations[handleNumber] = handleNumber * space_1;
2001
+ });
2002
+ }
2003
+ }
2004
+ // Secondary passes. Now that all base values are set, apply constraints.
2005
+ // Iterate all handles to ensure constraints are applied for the entire slider (Issue #1009)
2006
+ for (; i < scope_HandleNumbers.length; ++i) {
2007
+ scope_HandleNumbers.forEach(function (handleNumber) {
2008
+ setHandle(handleNumber, scope_Locations[handleNumber], true, true, exactInput);
2009
+ });
2010
+ }
2011
+ setZindex();
2012
+ scope_HandleNumbers.forEach(function (handleNumber) {
2013
+ fireEvent("update", handleNumber);
2014
+ // Fire the event only for handles that received a new value, as per #579
2015
+ if (values[handleNumber] !== null && fireSetEvent) {
2016
+ fireEvent("set", handleNumber);
2017
+ }
2018
+ });
2019
+ }
2020
+ // Reset slider to initial values
2021
+ function valueReset(fireSetEvent) {
2022
+ valueSet(options.start, fireSetEvent);
2023
+ }
2024
+ // Set value for a single handle
2025
+ function valueSetHandle(handleNumber, value, fireSetEvent, exactInput) {
2026
+ // Ensure numeric input
2027
+ handleNumber = Number(handleNumber);
2028
+ if (!(handleNumber >= 0 && handleNumber < scope_HandleNumbers.length)) {
2029
+ throw new Error("noUiSlider: invalid handle number, got: " + handleNumber);
2030
+ }
2031
+ // Look both backward and forward, since we don't want this handle to "push" other handles (#960);
2032
+ // The exactInput argument can be used to ignore slider stepping (#436)
2033
+ setHandle(handleNumber, resolveToValue(value, handleNumber), true, true, exactInput);
2034
+ fireEvent("update", handleNumber);
2035
+ if (fireSetEvent) {
2036
+ fireEvent("set", handleNumber);
2037
+ }
2038
+ }
2039
+ // Get the slider value.
2040
+ function valueGet(unencoded) {
2041
+ if (unencoded === void 0) { unencoded = false; }
2042
+ if (unencoded) {
2043
+ // return a copy of the raw values
2044
+ return scope_Values.length === 1 ? scope_Values[0] : scope_Values.slice(0);
2045
+ }
2046
+ var values = scope_Values.map(options.format.to);
2047
+ // If only one handle is used, return a single value.
2048
+ if (values.length === 1) {
2049
+ return values[0];
2050
+ }
2051
+ return values;
2052
+ }
2053
+ // Removes classes from the root and empties it.
2054
+ function destroy() {
2055
+ // remove protected internal listeners
2056
+ removeEvent(INTERNAL_EVENT_NS.aria);
2057
+ removeEvent(INTERNAL_EVENT_NS.tooltips);
2058
+ Object.keys(options.cssClasses).forEach(function (key) {
2059
+ removeClass(scope_Target, options.cssClasses[key]);
2060
+ });
2061
+ while (scope_Target.firstChild) {
2062
+ scope_Target.removeChild(scope_Target.firstChild);
2063
+ }
2064
+ delete scope_Target.noUiSlider;
2065
+ }
2066
+ function getNextStepsForHandle(handleNumber) {
2067
+ var location = scope_Locations[handleNumber];
2068
+ var nearbySteps = scope_Spectrum.getNearbySteps(location);
2069
+ var value = scope_Values[handleNumber];
2070
+ var increment = nearbySteps.thisStep.step;
2071
+ var decrement = null;
2072
+ // If snapped, directly use defined step value
2073
+ if (options.snap) {
2074
+ return [
2075
+ value - nearbySteps.stepBefore.startValue || null,
2076
+ nearbySteps.stepAfter.startValue - value || null,
2077
+ ];
2078
+ }
2079
+ // If the next value in this step moves into the next step,
2080
+ // the increment is the start of the next step - the current value
2081
+ if (increment !== false) {
2082
+ if (value + increment > nearbySteps.stepAfter.startValue) {
2083
+ increment = nearbySteps.stepAfter.startValue - value;
2084
+ }
2085
+ }
2086
+ // If the value is beyond the starting point
2087
+ if (value > nearbySteps.thisStep.startValue) {
2088
+ decrement = nearbySteps.thisStep.step;
2089
+ }
2090
+ else if (nearbySteps.stepBefore.step === false) {
2091
+ decrement = false;
2092
+ }
2093
+ // If a handle is at the start of a step, it always steps back into the previous step first
2094
+ else {
2095
+ decrement = value - nearbySteps.stepBefore.highestStep;
2096
+ }
2097
+ // Now, if at the slider edges, there is no in/decrement
2098
+ if (location === 100) {
2099
+ increment = null;
2100
+ }
2101
+ else if (location === 0) {
2102
+ decrement = null;
2103
+ }
2104
+ // As per #391, the comparison for the decrement step can have some rounding issues.
2105
+ var stepDecimals = scope_Spectrum.countStepDecimals();
2106
+ // Round per #391
2107
+ if (increment !== null && increment !== false) {
2108
+ increment = Number(increment.toFixed(stepDecimals));
2109
+ }
2110
+ if (decrement !== null && decrement !== false) {
2111
+ decrement = Number(decrement.toFixed(stepDecimals));
2112
+ }
2113
+ return [decrement, increment];
2114
+ }
2115
+ // Get the current step size for the slider.
2116
+ function getNextSteps() {
2117
+ return scope_HandleNumbers.map(getNextStepsForHandle);
2118
+ }
2119
+ // Updatable: margin, limit, padding, step, range, animate, snap
2120
+ function updateOptions(optionsToUpdate, fireSetEvent) {
2121
+ // Spectrum is created using the range, snap, direction and step options.
2122
+ // 'snap' and 'step' can be updated.
2123
+ // If 'snap' and 'step' are not passed, they should remain unchanged.
2124
+ var v = valueGet();
2125
+ var updateAble = [
2126
+ "margin",
2127
+ "limit",
2128
+ "padding",
2129
+ "range",
2130
+ "animate",
2131
+ "snap",
2132
+ "step",
2133
+ "format",
2134
+ "pips",
2135
+ "tooltips",
2136
+ ];
2137
+ // Only change options that we're actually passed to update.
2138
+ updateAble.forEach(function (name) {
2139
+ // Check for undefined. null removes the value.
2140
+ if (optionsToUpdate[name] !== undefined) {
2141
+ originalOptions[name] = optionsToUpdate[name];
2142
+ }
2143
+ });
2144
+ var newOptions = testOptions(originalOptions);
2145
+ // Load new options into the slider state
2146
+ updateAble.forEach(function (name) {
2147
+ if (optionsToUpdate[name] !== undefined) {
2148
+ options[name] = newOptions[name];
2149
+ }
2150
+ });
2151
+ scope_Spectrum = newOptions.spectrum;
2152
+ // Limit, margin and padding depend on the spectrum but are stored outside of it. (#677)
2153
+ options.margin = newOptions.margin;
2154
+ options.limit = newOptions.limit;
2155
+ options.padding = newOptions.padding;
2156
+ // Update pips, removes existing.
2157
+ if (options.pips) {
2158
+ pips(options.pips);
2159
+ }
2160
+ else {
2161
+ removePips();
2162
+ }
2163
+ // Update tooltips, removes existing.
2164
+ if (options.tooltips) {
2165
+ tooltips();
2166
+ }
2167
+ else {
2168
+ removeTooltips();
2169
+ }
2170
+ // Invalidate the current positioning so valueSet forces an update.
2171
+ scope_Locations = [];
2172
+ valueSet(isSet(optionsToUpdate.start) ? optionsToUpdate.start : v, fireSetEvent);
2173
+ }
2174
+ // Initialization steps
2175
+ function setupSlider() {
2176
+ // Create the base element, initialize HTML and set classes.
2177
+ // Add handles and connect elements.
2178
+ scope_Base = addSlider(scope_Target);
2179
+ addElements(options.connect, scope_Base);
2180
+ // Attach user events.
2181
+ bindSliderEvents(options.events);
2182
+ // Use the public value method to set the start values.
2183
+ valueSet(options.start);
2184
+ if (options.pips) {
2185
+ pips(options.pips);
2186
+ }
2187
+ if (options.tooltips) {
2188
+ tooltips();
2189
+ }
2190
+ aria();
2191
+ }
2192
+ setupSlider();
2193
+ var scope_Self = {
2194
+ destroy: destroy,
2195
+ steps: getNextSteps,
2196
+ on: bindEvent,
2197
+ off: removeEvent,
2198
+ get: valueGet,
2199
+ set: valueSet,
2200
+ setHandle: valueSetHandle,
2201
+ reset: valueReset,
2202
+ // Exposed for unit testing, don't use this in your application.
2203
+ __moveHandles: function (upward, proposal, handleNumbers) {
2204
+ moveHandles(upward, proposal, scope_Locations, handleNumbers);
2205
+ },
2206
+ options: originalOptions,
2207
+ updateOptions: updateOptions,
2208
+ target: scope_Target,
2209
+ removePips: removePips,
2210
+ removeTooltips: removeTooltips,
2211
+ getPositions: function () {
2212
+ return scope_Locations.slice();
2213
+ },
2214
+ getTooltips: function () {
2215
+ return scope_Tooltips;
2216
+ },
2217
+ getOrigins: function () {
2218
+ return scope_Handles;
2219
+ },
2220
+ pips: pips, // Issue #594
2221
+ };
2222
+ return scope_Self;
2223
+ }
2224
+ // Run the standard initializer
2225
+ function initialize(target, originalOptions) {
2226
+ if (!target || !target.nodeName) {
2227
+ throw new Error("noUiSlider: create requires a single element, got: " + target);
2228
+ }
2229
+ // Throw an error if the slider was already initialized.
2230
+ if (target.noUiSlider) {
2231
+ throw new Error("noUiSlider: Slider was already initialized.");
2232
+ }
2233
+ // Test the options and create the slider environment;
2234
+ var options = testOptions(originalOptions);
2235
+ var api = scope(target, options, originalOptions);
2236
+ target.noUiSlider = api;
2237
+ return api;
2238
+ }
2239
+ var nouislider = {
2240
+ // Exposed for unit testing, don't use this in your application.
2241
+ __spectrum: Spectrum,
2242
+ // A reference to the default classes, allows global changes.
2243
+ // Use the cssClasses option for changes to one slider.
2244
+ cssClasses: cssClasses,
2245
+ create: initialize,
2246
+ };
2247
+
2248
+ exports.create = initialize;
2249
+ exports.cssClasses = cssClasses;
2250
+ exports["default"] = nouislider;
2251
+
2252
+ Object.defineProperty(exports, '__esModule', { value: true });
2253
+
2254
+ }));