@fintatech/fintachart 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/LICENSE.md +63 -0
  3. package/README.md +151 -0
  4. package/THIRD_PARTY_NOTICES.md +38 -0
  5. package/basic-objects.html +165 -0
  6. package/css/FintaChart.min.css +1 -0
  7. package/css/external/jqNumericField.min.css +1 -0
  8. package/css/external/spectrum.min.css +7 -0
  9. package/css/external/toastr.min.css +1 -0
  10. package/custom-indicator.html +209 -0
  11. package/d.ts/FintaChart.d.ts +24313 -0
  12. package/d.ts/frameworks/Intl.d.ts +115 -0
  13. package/d.ts/frameworks/bootstrap.d.ts +128 -0
  14. package/d.ts/frameworks/bootstrap.v3.datetimepicker.d.ts +10 -0
  15. package/d.ts/frameworks/detectizr.d.ts +27 -0
  16. package/d.ts/frameworks/dom-to-image-more.d.ts +17 -0
  17. package/d.ts/frameworks/html2canvas.d.ts +101 -0
  18. package/d.ts/frameworks/i18nextXHRBackend.d.ts +42 -0
  19. package/d.ts/frameworks/jquery-i18next.d.ts +14 -0
  20. package/d.ts/frameworks/jquery-ui.d.ts +1914 -0
  21. package/d.ts/frameworks/jquery.d.ts +3779 -0
  22. package/d.ts/frameworks/jquery.ui.touch-punch.d.ts +12 -0
  23. package/d.ts/frameworks/moment-node.d.ts +485 -0
  24. package/d.ts/frameworks/moment.d.ts +10 -0
  25. package/d.ts/frameworks/tinycolor.d.ts +377 -0
  26. package/d.ts/frameworks-modified/bootstrap-select.d.ts +18 -0
  27. package/d.ts/frameworks-modified/i18next.d.ts +148 -0
  28. package/d.ts/frameworks-modified/jquery.autocolumnlist.d.ts +17 -0
  29. package/d.ts/frameworks-modified/jquery.resizable.d.ts +20 -0
  30. package/d.ts/frameworks-modified/spectrum.d.ts +294 -0
  31. package/d.ts/frameworks-modified/switchery.d.ts +69 -0
  32. package/d.ts/frameworks-modified/toastr.d.ts +224 -0
  33. package/data/offline-market-history/EUR_CAD/Day/1.csv +2001 -0
  34. package/data/offline-market-history/EUR_CAD/Hour/1.csv +1702 -0
  35. package/data/offline-market-history/EUR_CAD/Hour/4.csv +442 -0
  36. package/data/offline-market-history/EUR_CAD/Minute/1.csv +2001 -0
  37. package/data/offline-market-history/EUR_CAD/Minute/15.csv +2001 -0
  38. package/data/offline-market-history/EUR_CAD/Minute/5.csv +2001 -0
  39. package/data/offline-market-history/EUR_CAD/Monthly/1.csv +175 -0
  40. package/data/offline-market-history/EUR_CAD/Weekly/1.csv +752 -0
  41. package/data/offline-market-history/EUR_CAD/Yearly/1.csv +16 -0
  42. package/data/offline-market-history/EUR_GBP/Day/1.csv +2001 -0
  43. package/data/offline-market-history/EUR_GBP/Hour/1.csv +1702 -0
  44. package/data/offline-market-history/EUR_GBP/Hour/4.csv +442 -0
  45. package/data/offline-market-history/EUR_GBP/Minute/1.csv +2001 -0
  46. package/data/offline-market-history/EUR_GBP/Minute/15.csv +2001 -0
  47. package/data/offline-market-history/EUR_GBP/Minute/5.csv +2001 -0
  48. package/data/offline-market-history/EUR_GBP/Monthly/1.csv +199 -0
  49. package/data/offline-market-history/EUR_GBP/Weekly/1.csv +860 -0
  50. package/data/offline-market-history/EUR_GBP/Yearly/1.csv +18 -0
  51. package/data/predefined-templates/EMAAndMACDTemplate.json +100 -0
  52. package/data/predefined-templates/bigTreeTemplate.json +137 -0
  53. package/data/predefined-templates/multiIndicator.json +136 -0
  54. package/data/predefined-templates/renkoTemplate.json +50 -0
  55. package/data/predefined-templates/standartCandleTemplate.json +73 -0
  56. package/fonts/calibri/calibri.svg +3707 -0
  57. package/fonts/calibri/calibri.ttf +0 -0
  58. package/fonts/calibri/calibri.woff +0 -0
  59. package/fonts/courier-new/courier-new.svg +633 -0
  60. package/fonts/courier-new/courier-new.ttf +0 -0
  61. package/fonts/courier-new/courier-new.woff +0 -0
  62. package/fonts/open-sans-cyrillic/open-sans-cyrillic.svg +475 -0
  63. package/fonts/open-sans-cyrillic/open-sans-cyrillic.ttf +0 -0
  64. package/fonts/open-sans-cyrillic/open-sans-cyrillic.woff +0 -0
  65. package/fonts/open-sans-cyrillic-ext/open-sans-cyrillic-ext.svg +567 -0
  66. package/fonts/open-sans-cyrillic-ext/open-sans-cyrillic-ext.ttf +0 -0
  67. package/fonts/open-sans-cyrillic-ext/open-sans-cyrillic-ext.woff +0 -0
  68. package/fonts/open-sans-greek/open-sans-greek.svg +603 -0
  69. package/fonts/open-sans-greek/open-sans-greek.ttf +0 -0
  70. package/fonts/open-sans-greek/open-sans-greek.woff +0 -0
  71. package/fonts/open-sans-greek-ext/open-sans-greek-ext.svg +42 -0
  72. package/fonts/open-sans-greek-ext/open-sans-greek-ext.ttf +0 -0
  73. package/fonts/open-sans-greek-ext/open-sans-greek-ext.woff +0 -0
  74. package/fonts/open-sans-latin/open-sans-latin.svg +1863 -0
  75. package/fonts/open-sans-latin/open-sans-latin.ttf +0 -0
  76. package/fonts/open-sans-latin/open-sans-latin.woff +0 -0
  77. package/fonts/open-sans-latin-ext/open-sans-latin-ext.svg +1686 -0
  78. package/fonts/open-sans-latin-ext/open-sans-latin-ext.ttf +0 -0
  79. package/fonts/open-sans-latin-ext/open-sans-latin-ext.woff +0 -0
  80. package/fonts/open-sans-vietnamese/open-sans-vietnamese.svg +375 -0
  81. package/fonts/open-sans-vietnamese/open-sans-vietnamese.ttf +0 -0
  82. package/fonts/open-sans-vietnamese/open-sans-vietnamese.woff +0 -0
  83. package/fonts/rubik-medium/Rubik-Medium.svg +8831 -0
  84. package/fonts/rubik-medium/Rubik-Medium.ttf +0 -0
  85. package/fonts/rubik-medium/Rubik-Medium.woff +0 -0
  86. package/fonts/rubik-regular/Rubik-Regular.svg +8885 -0
  87. package/fonts/rubik-regular/Rubik-Regular.ttf +0 -0
  88. package/fonts/rubik-regular/Rubik-Regular.woff +0 -0
  89. package/fonts/source-sans-pro-latin/source-sans-pro-latin.svg +2642 -0
  90. package/fonts/source-sans-pro-latin/source-sans-pro-latin.ttf +0 -0
  91. package/fonts/source-sans-pro-latin/source-sans-pro-latin.woff +0 -0
  92. package/fonts/source-sans-pro-latin-ext/source-sans-pro-latin-ext.svg +1572 -0
  93. package/fonts/source-sans-pro-latin-ext/source-sans-pro-latin-ext.ttf +0 -0
  94. package/fonts/source-sans-pro-latin-ext/source-sans-pro-latin-ext.woff +0 -0
  95. package/fonts/source-sans-pro-vietnamese/source-sans-pro-vietnamese.svg +428 -0
  96. package/fonts/source-sans-pro-vietnamese/source-sans-pro-vietnamese.ttf +0 -0
  97. package/fonts/source-sans-pro-vietnamese/source-sans-pro-vietnamese.woff +0 -0
  98. package/htmldialogs/ChartContextMenu.html +3 -0
  99. package/htmldialogs/ChartTypeSettingsDialog.html +231 -0
  100. package/htmldialogs/CheckboxIndicatorParameterControl.html +9 -0
  101. package/htmldialogs/CompareInstrumentSettings.html +61 -0
  102. package/htmldialogs/ComparingContextMenu.html +8 -0
  103. package/htmldialogs/ConfirmDialog.html +28 -0
  104. package/htmldialogs/DemoModePopup.html +24 -0
  105. package/htmldialogs/FillPlotStyleControl.html +28 -0
  106. package/htmldialogs/HotkeysSettings.html +28 -0
  107. package/htmldialogs/IndicatorContextMenu.html +18 -0
  108. package/htmldialogs/IndicatorSettingsDialog.html +38 -0
  109. package/htmldialogs/IndicatorsDialog.html +39 -0
  110. package/htmldialogs/IndicatorsOverview_en.html +1694 -0
  111. package/htmldialogs/IndicatorsOverview_ua.html +9 -0
  112. package/htmldialogs/InstrumentSearchDialog.html +22 -0
  113. package/htmldialogs/LinePlotStyleControl.html +33 -0
  114. package/htmldialogs/MainSettings.html +292 -0
  115. package/htmldialogs/MarketEventPopup.html +27 -0
  116. package/htmldialogs/MarketEventsSettingsDialog.html +22 -0
  117. package/htmldialogs/NumericIndicatorParameter.html +8 -0
  118. package/htmldialogs/OpenChart.html +6 -0
  119. package/htmldialogs/PatternSettingsControl.html +26 -0
  120. package/htmldialogs/PatternsIndicatorSettingsDialog.html +30 -0
  121. package/htmldialogs/PatternsSettingsParameterControl.html +12 -0
  122. package/htmldialogs/PositionShapeContextMenu.html +9 -0
  123. package/htmldialogs/QuantityPopup.html +7 -0
  124. package/htmldialogs/Scrollbar.html +6 -0
  125. package/htmldialogs/SelectableIndicatorParameter.html +9 -0
  126. package/htmldialogs/ShapeContextMenu.html +7 -0
  127. package/htmldialogs/ShapeFibonacciSettingsDialog.html +261 -0
  128. package/htmldialogs/ShapePositionSettingsDialog.html +351 -0
  129. package/htmldialogs/ShapeSettingsDialog.html +521 -0
  130. package/htmldialogs/TimeFrameChangePopup.html +11 -0
  131. package/htmldialogs/TimeIndicatorParameterControl.html +89 -0
  132. package/htmldialogs/Toolbar.html +1710 -0
  133. package/htmldialogs/TooltipView.html +151 -0
  134. package/htmldialogs/TradingContextMenu.html +2 -0
  135. package/img/ContextMenuCheckbox.png +0 -0
  136. package/img/cross-hairs.cur +0 -0
  137. package/img/eu.png +0 -0
  138. package/img/favicon/favicon.ico +0 -0
  139. package/img/fist.cur +0 -0
  140. package/img/point.cur +0 -0
  141. package/img/svg-icons/Illustration-License-b.svg +1 -0
  142. package/img/svg-icons/Illustration-License-w.svg +1 -0
  143. package/img/svg-icons/abcd-label-pattern.svg +1 -0
  144. package/img/svg-icons/abcd-pattern.svg +1 -0
  145. package/img/svg-icons/add.svg +1 -0
  146. package/img/svg-icons/adjust-OHLC.svg +1 -0
  147. package/img/svg-icons/adjust-all.svg +1 -0
  148. package/img/svg-icons/andrews-pitchfork.svg +1 -0
  149. package/img/svg-icons/arrow-down.svg +1 -0
  150. package/img/svg-icons/arrow-left.svg +3 -0
  151. package/img/svg-icons/arrow-right.svg +3 -0
  152. package/img/svg-icons/arrow-type-type.svg +3 -0
  153. package/img/svg-icons/arrow-up.svg +1 -0
  154. package/img/svg-icons/arrow.svg +1 -0
  155. package/img/svg-icons/balloon.svg +1 -0
  156. package/img/svg-icons/brand-x.svg +1 -0
  157. package/img/svg-icons/calculator.svg +15 -0
  158. package/img/svg-icons/chartType-area.svg +1 -0
  159. package/img/svg-icons/chartType-bars.svg +1 -0
  160. package/img/svg-icons/chartType-candles-volume.svg +1 -0
  161. package/img/svg-icons/chartType-candles.svg +1 -0
  162. package/img/svg-icons/chartType-colored-bars.svg +1 -0
  163. package/img/svg-icons/chartType-equi-volume-shadow.svg +1 -0
  164. package/img/svg-icons/chartType-equi-volume.svg +1 -0
  165. package/img/svg-icons/chartType-heikin-ashi.svg +1 -0
  166. package/img/svg-icons/chartType-hollow-candles.svg +1 -0
  167. package/img/svg-icons/chartType-kagi.svg +1 -0
  168. package/img/svg-icons/chartType-line-break.svg +1 -0
  169. package/img/svg-icons/chartType-line.svg +1 -0
  170. package/img/svg-icons/chartType-point-figure.svg +1 -0
  171. package/img/svg-icons/chartType-range-bars.svg +1 -0
  172. package/img/svg-icons/chartType-renko.svg +1 -0
  173. package/img/svg-icons/chevron-right-double.svg +3 -0
  174. package/img/svg-icons/chevron.svg +3 -0
  175. package/img/svg-icons/circle.svg +1 -0
  176. package/img/svg-icons/close-floating-toolbar.svg +1 -0
  177. package/img/svg-icons/close-pane.svg +1 -0
  178. package/img/svg-icons/close-rect.svg +4 -0
  179. package/img/svg-icons/close-windows.svg +1 -0
  180. package/img/svg-icons/close.svg +4 -0
  181. package/img/svg-icons/compare.svg +1 -0
  182. package/img/svg-icons/copy.svg +1 -0
  183. package/img/svg-icons/cursorType-arrow-with-labels.svg +1 -0
  184. package/img/svg-icons/cursorType-arrow.svg +3 -0
  185. package/img/svg-icons/cursorType-crosshairs.svg +1 -0
  186. package/img/svg-icons/cursorType-point.svg +1 -0
  187. package/img/svg-icons/cyclic-lines.svg +1 -0
  188. package/img/svg-icons/default-screen.svg +11 -0
  189. package/img/svg-icons/demo-popup-bg.svg +1 -0
  190. package/img/svg-icons/diamond.svg +1 -0
  191. package/img/svg-icons/dot.svg +1 -0
  192. package/img/svg-icons/drag.svg +1 -0
  193. package/img/svg-icons/elliott-wave-pattern.svg +1 -0
  194. package/img/svg-icons/ellipse.svg +1 -0
  195. package/img/svg-icons/error-channel.svg +1 -0
  196. package/img/svg-icons/export.svg +1 -0
  197. package/img/svg-icons/extended-line.svg +3 -0
  198. package/img/svg-icons/fibonacci-arcs.svg +1 -0
  199. package/img/svg-icons/fibonacci-ellipses.svg +1 -0
  200. package/img/svg-icons/fibonacci-extensions.svg +1 -0
  201. package/img/svg-icons/fibonacci-fan.svg +1 -0
  202. package/img/svg-icons/fibonacci-retracements.svg +1 -0
  203. package/img/svg-icons/fibonacci-time-zones.svg +1 -0
  204. package/img/svg-icons/fintatech.svg +1 -0
  205. package/img/svg-icons/free-hand.svg +1 -0
  206. package/img/svg-icons/full-screen.svg +11 -0
  207. package/img/svg-icons/full-windows.svg +12 -0
  208. package/img/svg-icons/gann-fan.svg +1 -0
  209. package/img/svg-icons/general-delete.svg +3 -0
  210. package/img/svg-icons/head-shoulders-pattern.svg +1 -0
  211. package/img/svg-icons/horizontal-line.svg +1 -0
  212. package/img/svg-icons/horizontal-ray.svg +3 -0
  213. package/img/svg-icons/html-code.svg +1 -0
  214. package/img/svg-icons/image.svg +5 -0
  215. package/img/svg-icons/images.svg +1 -0
  216. package/img/svg-icons/in-shape-mode.svg +1 -0
  217. package/img/svg-icons/insert-indicator.svg +1 -0
  218. package/img/svg-icons/kings-crown-pattern.svg +1 -0
  219. package/img/svg-icons/latest-position.svg +1 -0
  220. package/img/svg-icons/line-segment.svg +1 -0
  221. package/img/svg-icons/link.svg +5 -0
  222. package/img/svg-icons/lock.svg +3 -0
  223. package/img/svg-icons/magnet-mode.svg +1 -0
  224. package/img/svg-icons/measure.svg +1 -0
  225. package/img/svg-icons/multiply-link.svg +5 -0
  226. package/img/svg-icons/note.svg +1 -0
  227. package/img/svg-icons/number-label-pattern.svg +1 -0
  228. package/img/svg-icons/open-OHLC-pane.svg +1 -0
  229. package/img/svg-icons/options.svg +1 -0
  230. package/img/svg-icons/period.svg +1 -0
  231. package/img/svg-icons/polygon.svg +1 -0
  232. package/img/svg-icons/polyline.svg +1 -0
  233. package/img/svg-icons/position-long.svg +90 -0
  234. package/img/svg-icons/position-long_og.svg +81 -0
  235. package/img/svg-icons/position-short.svg +90 -0
  236. package/img/svg-icons/position-short_og.svg +89 -0
  237. package/img/svg-icons/quadrant-lines.svg +1 -0
  238. package/img/svg-icons/raff-regression.svg +1 -0
  239. package/img/svg-icons/ray.svg +3 -0
  240. package/img/svg-icons/rectangle.svg +1 -0
  241. package/img/svg-icons/redo-new.svg +3 -0
  242. package/img/svg-icons/redo.svg +1 -0
  243. package/img/svg-icons/remove-all-indicators.svg +1 -0
  244. package/img/svg-icons/remove-all-shapes.svg +1 -0
  245. package/img/svg-icons/replay-jump.svg +1 -0
  246. package/img/svg-icons/replay-pause.svg +1 -0
  247. package/img/svg-icons/replay-play.svg +1 -0
  248. package/img/svg-icons/replay-skip-end.svg +1 -0
  249. package/img/svg-icons/replay-skip-one.svg +1 -0
  250. package/img/svg-icons/save-as-image.svg +1 -0
  251. package/img/svg-icons/screenshot.svg +5 -0
  252. package/img/svg-icons/scroll-bottom.svg +1 -0
  253. package/img/svg-icons/scroll-left.svg +1 -0
  254. package/img/svg-icons/scroll-right.svg +1 -0
  255. package/img/svg-icons/scroll-top.svg +1 -0
  256. package/img/svg-icons/search.svg +1 -0
  257. package/img/svg-icons/speed-lines.svg +1 -0
  258. package/img/svg-icons/square.svg +1 -0
  259. package/img/svg-icons/star.svg +4 -0
  260. package/img/svg-icons/stash.svg +4 -0
  261. package/img/svg-icons/stick-to-bar.svg +1 -0
  262. package/img/svg-icons/stick-to-close.svg +1 -0
  263. package/img/svg-icons/stick-to-high.svg +1 -0
  264. package/img/svg-icons/stick-to-low.svg +1 -0
  265. package/img/svg-icons/stick-to-open.svg +1 -0
  266. package/img/svg-icons/sticky-mode-off.svg +1 -0
  267. package/img/svg-icons/tcdPane-alert-indicator.svg +1 -0
  268. package/img/svg-icons/tcdPane-close.svg +1 -0
  269. package/img/svg-icons/tcdPane-down.svg +1 -0
  270. package/img/svg-icons/tcdPane-expand-closed.svg +1 -0
  271. package/img/svg-icons/tcdPane-expand.svg +1 -0
  272. package/img/svg-icons/tcdPane-maximize.svg +1 -0
  273. package/img/svg-icons/tcdPane-options.svg +1 -0
  274. package/img/svg-icons/tcdPane-remove-indicator.svg +1 -0
  275. package/img/svg-icons/tcdPane-restore.svg +1 -0
  276. package/img/svg-icons/tcdPane-toggle.svg +1 -0
  277. package/img/svg-icons/tcdPane-up.svg +1 -0
  278. package/img/svg-icons/template-delete.svg +1 -0
  279. package/img/svg-icons/template-edit.svg +1 -0
  280. package/img/svg-icons/template-ok.svg +1 -0
  281. package/img/svg-icons/template.svg +1 -0
  282. package/img/svg-icons/text-editor-b.svg +1 -0
  283. package/img/svg-icons/text-editor-i.svg +1 -0
  284. package/img/svg-icons/text-editor-u.svg +1 -0
  285. package/img/svg-icons/text.svg +1 -0
  286. package/img/svg-icons/tirone-levels.svg +1 -0
  287. package/img/svg-icons/toggle-shapes.svg +1 -0
  288. package/img/svg-icons/trade-manager.svg +1 -0
  289. package/img/svg-icons/trend-angle.svg +1 -0
  290. package/img/svg-icons/trend-channel.svg +1 -0
  291. package/img/svg-icons/triangle-pattern.svg +1 -0
  292. package/img/svg-icons/triangle.svg +1 -0
  293. package/img/svg-icons/undo-new.svg +3 -0
  294. package/img/svg-icons/undo.svg +1 -0
  295. package/img/svg-icons/unlock.svg +3 -0
  296. package/img/svg-icons/vertical-line.svg +1 -0
  297. package/img/svg-icons/visibleProfile.svg +1 -0
  298. package/img/svg-icons/web-link.svg +1 -0
  299. package/img/svg-icons/x.svg +3 -0
  300. package/img/svg-icons/xabcd-pattern.svg +1 -0
  301. package/img/svg-icons/zoom-by-area.svg +1 -0
  302. package/img/svg-icons/zoom.svg +1 -0
  303. package/img/usa.png +0 -0
  304. package/index-dark.html +132 -0
  305. package/index.html +229 -0
  306. package/localization/en.json +1646 -0
  307. package/localization/uk.json +1597 -0
  308. package/multiple-charts.html +162 -0
  309. package/package.json +62 -0
  310. package/scripts/FintaChart.min.js +70 -0
  311. package/scripts/frameworks/Intl.min.js +4 -0
  312. package/scripts/frameworks/bootstrap.v3.datetimepicker.min.js +2605 -0
  313. package/scripts/frameworks/detectizr.min.js +1 -0
  314. package/scripts/frameworks/dom-to-image-more.min.js +3 -0
  315. package/scripts/frameworks/i18nextXHRBackend.min.js +1 -0
  316. package/scripts/frameworks/jquery-i18next.min.js +1 -0
  317. package/scripts/frameworks/jquery-ui.min.js +8 -0
  318. package/scripts/frameworks/jquery.min.js +3 -0
  319. package/scripts/frameworks/jquery.ui.touch-punch.min.js +1 -0
  320. package/scripts/frameworks/moment.min.js +1216 -0
  321. package/scripts/frameworks-modified/bootstrap-select.js +1024 -0
  322. package/scripts/frameworks-modified/i18next.js +2075 -0
  323. package/scripts/frameworks-modified/jquery.autocolumnlist.js +48 -0
  324. package/scripts/frameworks-modified/jquery.resizable.js +229 -0
  325. package/scripts/frameworks-modified/spectrum.js +2279 -0
  326. package/scripts/frameworks-modified/switchery.js +1957 -0
  327. package/scripts/frameworks-modified/toastr.js +414 -0
  328. package/scripts/jsdataadapters/fileDataAdapter.js +129 -0
  329. package/scripts/jsdataadapters/restDataAdapter.js +149 -0
  330. package/scripts/jsdataadapters/webSocketDataAdapter.js +114 -0
  331. package/scripts/miscs/templateFileDataAdapter.js +17 -0
  332. package/scripts/themes/beetTheme.js +2999 -0
  333. package/scripts/themes/darkTheme.js +3004 -0
  334. package/scripts/themes/defaultTheme.js +3095 -0
  335. package/scripts/themes/fintatechDarkTheme.js +3005 -0
  336. package/scripts/themes/grayTheme.js +3004 -0
  337. package/scripts/themes/oliveTheme.js +3004 -0
  338. package/scripts/themes/orangeTheme.js +3004 -0
  339. package/scripts/themes/purpleTheme.js +3004 -0
  340. package/scripts/themes/skyTheme.js +3009 -0
  341. package/scripts/themes/tealTheme.js +3004 -0
@@ -0,0 +1,1957 @@
1
+ 'use strict';
2
+
3
+ var FintaChart;
4
+ (function (FintaChart) {
5
+ var External;
6
+ (function (External) {
7
+ (function(){
8
+ /**
9
+ * Require the module at `name`.
10
+ *
11
+ * @param {String} name
12
+ * @return {Object} exports
13
+ * @api public
14
+ */
15
+ function require(name) {
16
+ var module = require.modules[name];
17
+ if (!module) throw new Error('failed to require "' + name + '"');
18
+
19
+ if (!('exports' in module) && typeof module.definition === 'function') {
20
+ module.client = module.component = true;
21
+ module.definition.call(this, module.exports = {}, module);
22
+ delete module.definition;
23
+ }
24
+
25
+ return module.exports;
26
+ }
27
+
28
+ /**
29
+ * Meta info, accessible in the global scope unless you use AMD option.
30
+ */
31
+ require.loader = 'component';
32
+
33
+ /**
34
+ * Internal helper object, contains a sorting function for semantiv versioning
35
+ */
36
+ require.helper = {};
37
+ require.helper.semVerSort = function(a, b) {
38
+ var aArray = a.version.split('.');
39
+ var bArray = b.version.split('.');
40
+ for (var i=0; i<aArray.length; ++i) {
41
+ var aInt = parseInt(aArray[i], 10);
42
+ var bInt = parseInt(bArray[i], 10);
43
+ if (aInt === bInt) {
44
+ var aLex = aArray[i].substr((""+aInt).length);
45
+ var bLex = bArray[i].substr((""+bInt).length);
46
+ if (aLex === '' && bLex !== '') return 1;
47
+ if (aLex !== '' && bLex === '') return -1;
48
+ if (aLex !== '' && bLex !== '') return aLex > bLex ? 1 : -1;
49
+ continue;
50
+ } else if (aInt > bInt) {
51
+ return 1;
52
+ } else {
53
+ return -1;
54
+ }
55
+ }
56
+ return 0;
57
+ }
58
+
59
+ /**
60
+ * Find and require a module which name starts with the provided name.
61
+ * If multiple modules exists, the highest semver is used.
62
+ * This function can only be used for remote dependencies.
63
+ * @param {String} name - module name: `user~repo`
64
+ * @param {Boolean} returnPath - returns the canonical require path if true,
65
+ * otherwise it returns the epxorted module
66
+ */
67
+ require.latest = function (name, returnPath) {
68
+ function showError(name) {
69
+ throw new Error('failed to find latest module of "' + name + '"');
70
+ }
71
+ // only remotes with semvers, ignore local files conataining a '/'
72
+ var versionRegexp = /(.*)~(.*)@v?(\d+\.\d+\.\d+[^\/]*)$/;
73
+ var remoteRegexp = /(.*)~(.*)/;
74
+ if (!remoteRegexp.test(name)) showError(name);
75
+ var moduleNames = Object.keys(require.modules);
76
+ var semVerCandidates = [];
77
+ var otherCandidates = []; // for instance: name of the git branch
78
+ for (var i=0; i<moduleNames.length; i++) {
79
+ var moduleName = moduleNames[i];
80
+ if (new RegExp(name + '@').test(moduleName)) {
81
+ var version = moduleName.substr(name.length+1);
82
+ var semVerMatch = versionRegexp.exec(moduleName);
83
+ if (semVerMatch != null) {
84
+ semVerCandidates.push({version: version, name: moduleName});
85
+ } else {
86
+ otherCandidates.push({version: version, name: moduleName});
87
+ }
88
+ }
89
+ }
90
+ if (semVerCandidates.concat(otherCandidates).length === 0) {
91
+ showError(name);
92
+ }
93
+ if (semVerCandidates.length > 0) {
94
+ var module = semVerCandidates.sort(require.helper.semVerSort).pop().name;
95
+ if (returnPath === true) {
96
+ return module;
97
+ }
98
+ return require(module);
99
+ }
100
+ // if the build contains more than one branch of the same module
101
+ // you should not use this funciton
102
+ var module = otherCandidates.sort(function(a, b) {return a.name > b.name})[0].name;
103
+ if (returnPath === true) {
104
+ return module;
105
+ }
106
+ return require(module);
107
+ }
108
+
109
+ /**
110
+ * Registered modules.
111
+ */
112
+ require.modules = {};
113
+
114
+ /**
115
+ * Register module at `name` with callback `definition`.
116
+ *
117
+ * @param {String} name
118
+ * @param {Function} definition
119
+ * @api private
120
+ */
121
+ require.register = function (name, definition) {
122
+ require.modules[name] = {
123
+ definition: definition
124
+ };
125
+ };
126
+
127
+ /**
128
+ * Define a module's exports immediately with `exports`.
129
+ *
130
+ * @param {String} name
131
+ * @param {Generic} exports
132
+ * @api private
133
+ */
134
+ require.define = function (name, exports) {
135
+ require.modules[name] = {
136
+ exports: exports
137
+ };
138
+ };
139
+
140
+ require.register("abpetkov~transitionize@0.0.3", function (exports, module) {
141
+
142
+ /**
143
+ * Transitionize 0.0.2
144
+ * https://github.com/abpetkov/transitionize
145
+ *
146
+ * Authored by Alexander Petkov
147
+ * https://github.com/abpetkov
148
+ *
149
+ * Copyright 2013, Alexander Petkov
150
+ * License: The MIT License (MIT)
151
+ * http://opensource.org/licenses/MIT
152
+ *
153
+ */
154
+
155
+ /**
156
+ * Expose `Transitionize`.
157
+ */
158
+
159
+ module.exports = Transitionize;
160
+
161
+ /**
162
+ * Initialize new Transitionize.
163
+ *
164
+ * @param {Object} element
165
+ * @param {Object} props
166
+ * @api public
167
+ */
168
+
169
+ function Transitionize(element, props) {
170
+ if (!(this instanceof Transitionize)) return new Transitionize(element, props);
171
+
172
+ this.element = element;
173
+ this.props = props || {};
174
+ this.init();
175
+ }
176
+
177
+ /**
178
+ * Detect if Safari.
179
+ *
180
+ * @returns {Boolean}
181
+ * @api private
182
+ */
183
+
184
+ Transitionize.prototype.isSafari = function() {
185
+ return (/Safari/).test(navigator.userAgent) && (/Apple Computer/).test(navigator.vendor);
186
+ };
187
+
188
+ /**
189
+ * Loop though the object and push the keys and values in an array.
190
+ * Apply the CSS3 transition to the element and prefix with -webkit- for Safari.
191
+ *
192
+ * @api private
193
+ */
194
+
195
+ Transitionize.prototype.init = function() {
196
+ var transitions = [];
197
+
198
+ for (var key in this.props) {
199
+ transitions.push(key + ' ' + this.props[key]);
200
+ }
201
+
202
+ this.element.style.transition = transitions.join(', ');
203
+ if (this.isSafari()) this.element.style.webkitTransition = transitions.join(', ');
204
+ };
205
+ });
206
+
207
+ require.register("ftlabs~fastclick@v0.6.11", function (exports, module) {
208
+ /**
209
+ * @preserve FastClick: polyfill to remove click delays on browsers with touch UIs.
210
+ *
211
+ * @version 0.6.11
212
+ * @codingstandard ftlabs-jsv2
213
+ * @copyright The Financial Times Limited [All Rights Reserved]
214
+ * @license MIT License (see LICENSE.md)
215
+ */
216
+
217
+ /*jslint browser:true, node:true*/
218
+ /*global define, Event, Node*/
219
+
220
+
221
+ /**
222
+ * Instantiate fast-clicking listeners on the specificed layer.
223
+ *
224
+ * @constructor
225
+ * @param {Element} layer The layer to listen on
226
+ */
227
+ function FastClick(layer) {
228
+ 'use strict';
229
+ var oldOnClick, self = this;
230
+
231
+
232
+ /**
233
+ * Whether a click is currently being tracked.
234
+ *
235
+ * @type boolean
236
+ */
237
+ this.trackingClick = false;
238
+
239
+
240
+ /**
241
+ * Timestamp for when when click tracking started.
242
+ *
243
+ * @type number
244
+ */
245
+ this.trackingClickStart = 0;
246
+
247
+
248
+ /**
249
+ * The element being tracked for a click.
250
+ *
251
+ * @type EventTarget
252
+ */
253
+ this.targetElement = null;
254
+
255
+
256
+ /**
257
+ * X-coordinate of touch start event.
258
+ *
259
+ * @type number
260
+ */
261
+ this.touchStartX = 0;
262
+
263
+
264
+ /**
265
+ * Y-coordinate of touch start event.
266
+ *
267
+ * @type number
268
+ */
269
+ this.touchStartY = 0;
270
+
271
+
272
+ /**
273
+ * ID of the last touch, retrieved from Touch.identifier.
274
+ *
275
+ * @type number
276
+ */
277
+ this.lastTouchIdentifier = 0;
278
+
279
+
280
+ /**
281
+ * Touchmove boundary, beyond which a click will be cancelled.
282
+ *
283
+ * @type number
284
+ */
285
+ this.touchBoundary = 10;
286
+
287
+
288
+ /**
289
+ * The FastClick layer.
290
+ *
291
+ * @type Element
292
+ */
293
+ this.layer = layer;
294
+
295
+ if (!layer || !layer.nodeType) {
296
+ throw new TypeError('Layer must be a document node');
297
+ }
298
+
299
+ /** @type function() */
300
+ this.onClick = function() { return FastClick.prototype.onClick.apply(self, arguments); };
301
+
302
+ /** @type function() */
303
+ this.onMouse = function() { return FastClick.prototype.onMouse.apply(self, arguments); };
304
+
305
+ /** @type function() */
306
+ this.onTouchStart = function() { return FastClick.prototype.onTouchStart.apply(self, arguments); };
307
+
308
+ /** @type function() */
309
+ this.onTouchMove = function() { return FastClick.prototype.onTouchMove.apply(self, arguments); };
310
+
311
+ /** @type function() */
312
+ this.onTouchEnd = function() { return FastClick.prototype.onTouchEnd.apply(self, arguments); };
313
+
314
+ /** @type function() */
315
+ this.onTouchCancel = function() { return FastClick.prototype.onTouchCancel.apply(self, arguments); };
316
+
317
+ if (FastClick.notNeeded(layer)) {
318
+ return;
319
+ }
320
+
321
+ // Set up event handlers as required
322
+ if (this.deviceIsAndroid) {
323
+ layer.addEventListener('mouseover', this.onMouse, true);
324
+ layer.addEventListener('mousedown', this.onMouse, true);
325
+ layer.addEventListener('mouseup', this.onMouse, true);
326
+ }
327
+
328
+ layer.addEventListener('click', this.onClick, true);
329
+ layer.addEventListener('touchstart', this.onTouchStart, false);
330
+ layer.addEventListener('touchmove', this.onTouchMove, false);
331
+ layer.addEventListener('touchend', this.onTouchEnd, false);
332
+ layer.addEventListener('touchcancel', this.onTouchCancel, false);
333
+
334
+ // Hack is required for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
335
+ // which is how FastClick normally stops click events bubbling to callbacks registered on the FastClick
336
+ // layer when they are cancelled.
337
+ if (!Event.prototype.stopImmediatePropagation) {
338
+ layer.removeEventListener = function(type, callback, capture) {
339
+ var rmv = Node.prototype.removeEventListener;
340
+ if (type === 'click') {
341
+ rmv.call(layer, type, callback.hijacked || callback, capture);
342
+ } else {
343
+ rmv.call(layer, type, callback, capture);
344
+ }
345
+ };
346
+
347
+ layer.addEventListener = function(type, callback, capture) {
348
+ var adv = Node.prototype.addEventListener;
349
+ if (type === 'click') {
350
+ adv.call(layer, type, callback.hijacked || (callback.hijacked = function(event) {
351
+ if (!event.propagationStopped) {
352
+ callback(event);
353
+ }
354
+ }), capture);
355
+ } else {
356
+ adv.call(layer, type, callback, capture);
357
+ }
358
+ };
359
+ }
360
+
361
+ // If a handler is already declared in the element's onclick attribute, it will be fired before
362
+ // FastClick's onClick handler. Fix this by pulling out the user-defined handler function and
363
+ // adding it as listener.
364
+ if (typeof layer.onclick === 'function') {
365
+
366
+ // Android browser on at least 3.2 requires a new reference to the function in layer.onclick
367
+ // - the old one won't work if passed to addEventListener directly.
368
+ oldOnClick = layer.onclick;
369
+ layer.addEventListener('click', function(event) {
370
+ oldOnClick(event);
371
+ }, false);
372
+ layer.onclick = null;
373
+ }
374
+ }
375
+
376
+
377
+ /**
378
+ * Android requires exceptions.
379
+ *
380
+ * @type boolean
381
+ */
382
+ FastClick.prototype.deviceIsAndroid = navigator.userAgent.indexOf('Android') > 0;
383
+
384
+
385
+ /**
386
+ * iOS requires exceptions.
387
+ *
388
+ * @type boolean
389
+ */
390
+ FastClick.prototype.deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent);
391
+
392
+
393
+ /**
394
+ * iOS 4 requires an exception for select elements.
395
+ *
396
+ * @type boolean
397
+ */
398
+ FastClick.prototype.deviceIsIOS4 = FastClick.prototype.deviceIsIOS && (/OS 4_\d(_\d)?/).test(navigator.userAgent);
399
+
400
+
401
+ /**
402
+ * iOS 6.0(+?) requires the target element to be manually derived
403
+ *
404
+ * @type boolean
405
+ */
406
+ FastClick.prototype.deviceIsIOSWithBadTarget = FastClick.prototype.deviceIsIOS && (/OS ([6-9]|\d{2})_\d/).test(navigator.userAgent);
407
+
408
+
409
+ /**
410
+ * Determine whether a given element requires a native click.
411
+ *
412
+ * @param {EventTarget|Element} target Target DOM element
413
+ * @returns {boolean} Returns true if the element needs a native click
414
+ */
415
+ FastClick.prototype.needsClick = function(target) {
416
+ 'use strict';
417
+ switch (target.nodeName.toLowerCase()) {
418
+
419
+ // Don't send a synthetic click to disabled inputs (issue #62)
420
+ case 'button':
421
+ case 'select':
422
+ case 'textarea':
423
+ if (target.disabled) {
424
+ return true;
425
+ }
426
+
427
+ break;
428
+ case 'input':
429
+
430
+ // File inputs need real clicks on iOS 6 due to a browser bug (issue #68)
431
+ if ((this.deviceIsIOS && target.type === 'file') || target.disabled) {
432
+ return true;
433
+ }
434
+
435
+ break;
436
+ case 'label':
437
+ case 'video':
438
+ return true;
439
+ }
440
+
441
+ return (/\bneedsclick\b/).test(target.instanceTypeName);
442
+ };
443
+
444
+
445
+ /**
446
+ * Determine whether a given element requires a call to focus to simulate click into element.
447
+ *
448
+ * @param {EventTarget|Element} target Target DOM element
449
+ * @returns {boolean} Returns true if the element requires a call to focus to simulate native click.
450
+ */
451
+ FastClick.prototype.needsFocus = function(target) {
452
+ 'use strict';
453
+ switch (target.nodeName.toLowerCase()) {
454
+ case 'textarea':
455
+ return true;
456
+ case 'select':
457
+ return !this.deviceIsAndroid;
458
+ case 'input':
459
+ switch (target.type) {
460
+ case 'button':
461
+ case 'checkbox':
462
+ case 'file':
463
+ case 'image':
464
+ case 'radio':
465
+ case 'submit':
466
+ return false;
467
+ }
468
+
469
+ // No point in attempting to focus disabled inputs
470
+ return !target.disabled && !target.readOnly;
471
+ default:
472
+ return (/\bneedsfocus\b/).test(target.instanceTypeName);
473
+ }
474
+ };
475
+
476
+
477
+ /**
478
+ * Send a click event to the specified element.
479
+ *
480
+ * @param {EventTarget|Element} targetElement
481
+ * @param {Event} event
482
+ */
483
+ FastClick.prototype.sendClick = function(targetElement, event) {
484
+ 'use strict';
485
+ var clickEvent, touch;
486
+
487
+ // On some Android devices activeElement needs to be blurred otherwise the synthetic click will have no effect (#24)
488
+ if (document.activeElement && document.activeElement !== targetElement) {
489
+ document.activeElement.blur();
490
+ }
491
+
492
+ touch = event.changedTouches[0];
493
+
494
+ // Synthesise a click event, with an extra attribute so it can be tracked
495
+ clickEvent = document.createEvent('MouseEvents');
496
+ clickEvent.initMouseEvent(this.determineEventType(targetElement), true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null);
497
+ clickEvent.forwardedTouchEvent = true;
498
+ targetElement.dispatchEvent(clickEvent);
499
+ };
500
+
501
+ FastClick.prototype.determineEventType = function(targetElement) {
502
+ 'use strict';
503
+
504
+ //Issue #159: Android Chrome Select Box does not open with a synthetic click event
505
+ if (this.deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select') {
506
+ return 'mousedown';
507
+ }
508
+
509
+ return 'click';
510
+ };
511
+
512
+
513
+ /**
514
+ * @param {EventTarget|Element} targetElement
515
+ */
516
+ FastClick.prototype.focus = function(targetElement) {
517
+ 'use strict';
518
+ var length;
519
+
520
+ // Issue #160: on iOS 7, some input elements (e.g. date datetime) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and selectionEnd properties, but unfortunately that can't be used for detection because accessing the properties also throws a TypeError. Just check the type instead. Filed as Apple bug #15122724.
521
+ if (this.deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time') {
522
+ length = targetElement.value.length;
523
+ targetElement.setSelectionRange(length, length);
524
+ } else {
525
+ targetElement.focus();
526
+ }
527
+ };
528
+
529
+
530
+ /**
531
+ * Check whether the given target element is a child of a scrollable layer and if so, set a flag on it.
532
+ *
533
+ * @param {EventTarget|Element} targetElement
534
+ */
535
+ FastClick.prototype.updateScrollParent = function(targetElement) {
536
+ 'use strict';
537
+ var scrollParent, parentElement;
538
+
539
+ scrollParent = targetElement.fastClickScrollParent;
540
+
541
+ // Attempt to discover whether the target element is contained within a scrollable layer. Re-check if the
542
+ // target element was moved to another parent.
543
+ if (!scrollParent || !scrollParent.contains(targetElement)) {
544
+ parentElement = targetElement;
545
+ do {
546
+ if (parentElement.scrollHeight > parentElement.offsetHeight) {
547
+ scrollParent = parentElement;
548
+ targetElement.fastClickScrollParent = parentElement;
549
+ break;
550
+ }
551
+
552
+ parentElement = parentElement.parentElement;
553
+ } while (parentElement);
554
+ }
555
+
556
+ // Always update the scroll top tracker if possible.
557
+ if (scrollParent) {
558
+ scrollParent.fastClickLastScrollTop = scrollParent.scrollTop;
559
+ }
560
+ };
561
+
562
+
563
+ /**
564
+ * @param {EventTarget} targetElement
565
+ * @returns {Element|EventTarget}
566
+ */
567
+ FastClick.prototype.getTargetElementFromEventTarget = function(eventTarget) {
568
+ 'use strict';
569
+
570
+ // On some older browsers (notably Safari on iOS 4.1 - see issue #56) the event target may be a text node.
571
+ if (eventTarget.nodeType === Node.TEXT_NODE) {
572
+ return eventTarget.parentNode;
573
+ }
574
+
575
+ return eventTarget;
576
+ };
577
+
578
+
579
+ /**
580
+ * On touch start, record the position and scroll offset.
581
+ *
582
+ * @param {Event} event
583
+ * @returns {boolean}
584
+ */
585
+ FastClick.prototype.onTouchStart = function(event) {
586
+ 'use strict';
587
+ var targetElement, touch, selection;
588
+
589
+ // Ignore multiple touches, otherwise pinch-to-zoom is prevented if both fingers are on the FastClick element (issue #111).
590
+ if (event.targetTouches.length > 1) {
591
+ return true;
592
+ }
593
+
594
+ targetElement = this.getTargetElementFromEventTarget(event.target);
595
+ touch = event.targetTouches[0];
596
+
597
+ if (this.deviceIsIOS) {
598
+
599
+ // Only trusted events will deselect text on iOS (issue #49)
600
+ selection = window.getSelection();
601
+ if (selection.rangeCount && !selection.isCollapsed) {
602
+ return true;
603
+ }
604
+
605
+ if (!this.deviceIsIOS4) {
606
+
607
+ // Weird things happen on iOS when an alert or confirm dialog is opened from a click event callback (issue #23):
608
+ // when the user next taps anywhere else on the page, new touchstart and touchend events are dispatched
609
+ // with the same identifier as the touch event that previously triggered the click that triggered the alert.
610
+ // Sadly, there is an issue on iOS 4 that causes some normal touch events to have the same identifier as an
611
+ // immediately preceeding touch event (issue #52), so this fix is unavailable on that platform.
612
+ if (touch.identifier === this.lastTouchIdentifier) {
613
+ event.preventDefault();
614
+ return false;
615
+ }
616
+
617
+ this.lastTouchIdentifier = touch.identifier;
618
+
619
+ // If the target element is a child of a scrollable layer (using -webkit-overflow-scrolling: touch) and:
620
+ // 1) the user does a fling scroll on the scrollable layer
621
+ // 2) the user stops the fling scroll with another tap
622
+ // then the event.target of the last 'touchend' event will be the element that was under the user's finger
623
+ // when the fling scroll was started, causing FastClick to send a click event to that layer - unless a check
624
+ // is made to ensure that a parent layer was not scrolled before sending a synthetic click (issue #42).
625
+ this.updateScrollParent(targetElement);
626
+ }
627
+ }
628
+
629
+ this.trackingClick = true;
630
+ this.trackingClickStart = event.timeStamp;
631
+ this.targetElement = targetElement;
632
+
633
+ this.touchStartX = touch.pageX;
634
+ this.touchStartY = touch.pageY;
635
+
636
+ // Prevent phantom clicks on fast double-tap (issue #36)
637
+ if ((event.timeStamp - this.lastClickTime) < 200) {
638
+ event.preventDefault();
639
+ }
640
+
641
+ return true;
642
+ };
643
+
644
+
645
+ /**
646
+ * Based on a touchmove event object, check whether the touch has moved past a boundary since it started.
647
+ *
648
+ * @param {Event} event
649
+ * @returns {boolean}
650
+ */
651
+ FastClick.prototype.touchHasMoved = function(event) {
652
+ 'use strict';
653
+ var touch = event.changedTouches[0], boundary = this.touchBoundary;
654
+
655
+ if (Math.abs(touch.pageX - this.touchStartX) > boundary || Math.abs(touch.pageY - this.touchStartY) > boundary) {
656
+ return true;
657
+ }
658
+
659
+ return false;
660
+ };
661
+
662
+
663
+ /**
664
+ * Update the last position.
665
+ *
666
+ * @param {Event} event
667
+ * @returns {boolean}
668
+ */
669
+ FastClick.prototype.onTouchMove = function(event) {
670
+ 'use strict';
671
+ if (!this.trackingClick) {
672
+ return true;
673
+ }
674
+
675
+ // If the touch has moved, cancel the click tracking
676
+ if (this.targetElement !== this.getTargetElementFromEventTarget(event.target) || this.touchHasMoved(event)) {
677
+ this.trackingClick = false;
678
+ this.targetElement = null;
679
+ }
680
+
681
+ return true;
682
+ };
683
+
684
+
685
+ /**
686
+ * Attempt to find the labelled control for the given label element.
687
+ *
688
+ * @param {EventTarget|HTMLLabelElement} labelElement
689
+ * @returns {Element|null}
690
+ */
691
+ FastClick.prototype.findControl = function(labelElement) {
692
+ 'use strict';
693
+
694
+ // Fast path for newer browsers supporting the HTML5 control attribute
695
+ if (labelElement.control !== undefined) {
696
+ return labelElement.control;
697
+ }
698
+
699
+ // All browsers under test that support touch events also support the HTML5 htmlFor attribute
700
+ if (labelElement.htmlFor) {
701
+ return document.getElementById(labelElement.htmlFor);
702
+ }
703
+
704
+ // If no for attribute exists, attempt to retrieve the first labellable descendant element
705
+ // the list of which is defined here: http://www.w3.org/TR/html5/forms.html#category-label
706
+ return labelElement.querySelector('button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea');
707
+ };
708
+
709
+
710
+ /**
711
+ * On touch end, determine whether to send a click event at once.
712
+ *
713
+ * @param {Event} event
714
+ * @returns {boolean}
715
+ */
716
+ FastClick.prototype.onTouchEnd = function(event) {
717
+ 'use strict';
718
+ var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement;
719
+
720
+ if (!this.trackingClick) {
721
+ return true;
722
+ }
723
+
724
+ // Prevent phantom clicks on fast double-tap (issue #36)
725
+ if ((event.timeStamp - this.lastClickTime) < 200) {
726
+ this.cancelNextClick = true;
727
+ return true;
728
+ }
729
+
730
+ // Reset to prevent wrong click cancel on input (issue #156).
731
+ this.cancelNextClick = false;
732
+
733
+ this.lastClickTime = event.timeStamp;
734
+
735
+ trackingClickStart = this.trackingClickStart;
736
+ this.trackingClick = false;
737
+ this.trackingClickStart = 0;
738
+
739
+ // On some iOS devices, the targetElement supplied with the event is invalid if the layer
740
+ // is performing a transition or scroll, and has to be re-detected manually. Note that
741
+ // for this to function correctly, it must be called *after* the event target is checked!
742
+ // See issue #57; also filed as rdar://13048589 .
743
+ if (this.deviceIsIOSWithBadTarget) {
744
+ touch = event.changedTouches[0];
745
+
746
+ // In certain cases arguments of elementFromPoint can be negative, so prevent setting targetElement to null
747
+ targetElement = document.elementFromPoint(touch.pageX - window.pageXOffset, touch.pageY - window.pageYOffset) || targetElement;
748
+ targetElement.fastClickScrollParent = this.targetElement.fastClickScrollParent;
749
+ }
750
+
751
+ targetTagName = targetElement.tagName.toLowerCase();
752
+ if (targetTagName === 'label') {
753
+ forElement = this.findControl(targetElement);
754
+ if (forElement) {
755
+ this.focus(targetElement);
756
+ if (this.deviceIsAndroid) {
757
+ return false;
758
+ }
759
+
760
+ targetElement = forElement;
761
+ }
762
+ } else if (this.needsFocus(targetElement)) {
763
+
764
+ // Case 1: If the touch started a while ago (best guess is 100ms based on tests for issue #36) then focus will be triggered anyway. Return early and unset the target element reference so that the subsequent click will be allowed through.
765
+ // Case 2: Without this exception for input elements tapped when the document is contained in an iframe, then any inputted text won't be visible even though the value attribute is updated as the user types (issue #37).
766
+ if ((event.timeStamp - trackingClickStart) > 100 || (this.deviceIsIOS && window.top !== window && targetTagName === 'input')) {
767
+ this.targetElement = null;
768
+ return false;
769
+ }
770
+
771
+ this.focus(targetElement);
772
+
773
+ // Select elements need the event to go through on iOS 4, otherwise the selector menu won't open.
774
+ if (!this.deviceIsIOS4 || targetTagName !== 'select') {
775
+ this.targetElement = null;
776
+ event.preventDefault();
777
+ }
778
+
779
+ return false;
780
+ }
781
+
782
+ if (this.deviceIsIOS && !this.deviceIsIOS4) {
783
+
784
+ // Don't send a synthetic click event if the target element is contained within a parent layer that was scrolled
785
+ // and this tap is being used to stop the scrolling (usually initiated by a fling - issue #42).
786
+ scrollParent = targetElement.fastClickScrollParent;
787
+ if (scrollParent && scrollParent.fastClickLastScrollTop !== scrollParent.scrollTop) {
788
+ return true;
789
+ }
790
+ }
791
+
792
+ // Prevent the actual click from going though - unless the target node is marked as requiring
793
+ // real clicks or if it is in the whitelist in which case only non-programmatic clicks are permitted.
794
+ if (!this.needsClick(targetElement)) {
795
+ event.preventDefault();
796
+ this.sendClick(targetElement, event);
797
+ }
798
+
799
+ return false;
800
+ };
801
+
802
+
803
+ /**
804
+ * On touch cancel, stop tracking the click.
805
+ *
806
+ * @returns {void}
807
+ */
808
+ FastClick.prototype.onTouchCancel = function() {
809
+ 'use strict';
810
+ this.trackingClick = false;
811
+ this.targetElement = null;
812
+ };
813
+
814
+
815
+ /**
816
+ * Determine mouse events which should be permitted.
817
+ *
818
+ * @param {Event} event
819
+ * @returns {boolean}
820
+ */
821
+ FastClick.prototype.onMouse = function(event) {
822
+ 'use strict';
823
+
824
+ // If a target element was never set (because a touch event was never fired) allow the event
825
+ if (!this.targetElement) {
826
+ return true;
827
+ }
828
+
829
+ if (event.forwardedTouchEvent) {
830
+ return true;
831
+ }
832
+
833
+ // Programmatically generated events targeting a specific element should be permitted
834
+ if (!event.cancelable) {
835
+ return true;
836
+ }
837
+
838
+ // Derive and check the target element to see whether the mouse event needs to be permitted;
839
+ // unless explicitly enabled, prevent non-touch click events from triggering actions,
840
+ // to prevent ghost/doubleclicks.
841
+ if (!this.needsClick(this.targetElement) || this.cancelNextClick) {
842
+
843
+ // Prevent any user-added listeners declared on FastClick element from being fired.
844
+ if (event.stopImmediatePropagation) {
845
+ event.stopImmediatePropagation();
846
+ } else {
847
+
848
+ // Part of the hack for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
849
+ event.propagationStopped = true;
850
+ }
851
+
852
+ // Cancel the event
853
+ event.stopPropagation();
854
+ event.preventDefault();
855
+
856
+ return false;
857
+ }
858
+
859
+ // If the mouse event is permitted, return true for the action to go through.
860
+ return true;
861
+ };
862
+
863
+
864
+ /**
865
+ * On actual clicks, determine whether this is a touch-generated click, a click action occurring
866
+ * naturally after a delay after a touch (which needs to be cancelled to avoid duplication), or
867
+ * an actual click which should be permitted.
868
+ *
869
+ * @param {Event} event
870
+ * @returns {boolean}
871
+ */
872
+ FastClick.prototype.onClick = function(event) {
873
+ 'use strict';
874
+ var permitted;
875
+
876
+ // It's possible for another FastClick-like library delivered with third-party code to fire a click event before FastClick does (issue #44). In that case, set the click-tracking flag back to false and return early. This will cause onTouchEnd to return early.
877
+ if (this.trackingClick) {
878
+ this.targetElement = null;
879
+ this.trackingClick = false;
880
+ return true;
881
+ }
882
+
883
+ // Very odd behaviour on iOS (issue #18): if a submit element is present inside a form and the user hits enter in the iOS simulator or clicks the Go button on the pop-up OS keyboard the a kind of 'fake' click event will be triggered with the submit-type input element as the target.
884
+ if (event.target.type === 'submit' && event.detail === 0) {
885
+ return true;
886
+ }
887
+
888
+ permitted = this.onMouse(event);
889
+
890
+ // Only unset targetElement if the click is not permitted. This will ensure that the check for !targetElement in onMouse fails and the browser's click doesn't go through.
891
+ if (!permitted) {
892
+ this.targetElement = null;
893
+ }
894
+
895
+ // If clicks are permitted, return true for the action to go through.
896
+ return permitted;
897
+ };
898
+
899
+
900
+ /**
901
+ * Remove all FastClick's event listeners.
902
+ *
903
+ * @returns {void}
904
+ */
905
+ FastClick.prototype.destroy = function() {
906
+ 'use strict';
907
+ var layer = this.layer;
908
+
909
+ if (this.deviceIsAndroid) {
910
+ layer.removeEventListener('mouseover', this.onMouse, true);
911
+ layer.removeEventListener('mousedown', this.onMouse, true);
912
+ layer.removeEventListener('mouseup', this.onMouse, true);
913
+ }
914
+
915
+ layer.removeEventListener('click', this.onClick, true);
916
+ layer.removeEventListener('touchstart', this.onTouchStart, false);
917
+ layer.removeEventListener('touchmove', this.onTouchMove, false);
918
+ layer.removeEventListener('touchend', this.onTouchEnd, false);
919
+ layer.removeEventListener('touchcancel', this.onTouchCancel, false);
920
+ };
921
+
922
+
923
+ /**
924
+ * Check whether FastClick is needed.
925
+ *
926
+ * @param {Element} layer The layer to listen on
927
+ */
928
+ FastClick.notNeeded = function(layer) {
929
+ 'use strict';
930
+ var metaViewport;
931
+ var chromeVersion;
932
+
933
+ // Devices that don't support touch don't need FastClick
934
+ if (typeof window.ontouchstart === 'undefined') {
935
+ return true;
936
+ }
937
+
938
+ // Chrome version - zero for other browsers
939
+ chromeVersion = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1];
940
+
941
+ if (chromeVersion) {
942
+
943
+ if (FastClick.prototype.deviceIsAndroid) {
944
+ metaViewport = document.querySelector('meta[name=viewport]');
945
+
946
+ if (metaViewport) {
947
+ // Chrome on Android with user-scalable="no" doesn't need FastClick (issue #89)
948
+ if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
949
+ return true;
950
+ }
951
+ // Chrome 32 and above with width=device-width or less don't need FastClick
952
+ if (chromeVersion > 31 && window.innerWidth <= window.screen.width) {
953
+ return true;
954
+ }
955
+ }
956
+
957
+ // Chrome desktop doesn't need FastClick (issue #15)
958
+ } else {
959
+ return true;
960
+ }
961
+ }
962
+
963
+ // IE10 with -ms-touch-action: none, which disables double-tap-to-zoom (issue #97)
964
+ if (layer.style.msTouchAction === 'none') {
965
+ return true;
966
+ }
967
+
968
+ return false;
969
+ };
970
+
971
+
972
+ /**
973
+ * Factory method for creating a FastClick object
974
+ *
975
+ * @param {Element} layer The layer to listen on
976
+ */
977
+ FastClick.attach = function(layer) {
978
+ 'use strict';
979
+ return new FastClick(layer);
980
+ };
981
+
982
+
983
+ if (typeof define !== 'undefined' && define.amd) {
984
+
985
+ // AMD. Register as an anonymous module.
986
+ define(function() {
987
+ 'use strict';
988
+ return FastClick;
989
+ });
990
+ } else if (typeof module !== 'undefined' && module.exports) {
991
+ module.exports = FastClick.attach;
992
+ module.exports.FastClick = FastClick;
993
+ } else {
994
+ window.FastClick = FastClick;
995
+ }
996
+
997
+ });
998
+
999
+ require.register("component~indexof@0.0.3", function (exports, module) {
1000
+ module.exports = function(arr, obj){
1001
+ if (arr.indexOf) return arr.indexOf(obj);
1002
+ for (var i = 0; i < arr.length; ++i) {
1003
+ if (arr[i] === obj) return i;
1004
+ }
1005
+ return -1;
1006
+ };
1007
+ });
1008
+
1009
+ require.register("component~classes@1.2.1", function (exports, module) {
1010
+ /**
1011
+ * Module dependencies.
1012
+ */
1013
+
1014
+ var index = require('component~indexof@0.0.3');
1015
+
1016
+ /**
1017
+ * Whitespace regexp.
1018
+ */
1019
+
1020
+ var re = /\s+/;
1021
+
1022
+ /**
1023
+ * toString reference.
1024
+ */
1025
+
1026
+ var toString = Object.prototype.toString;
1027
+
1028
+ /**
1029
+ * Wrap `el` in a `ClassList`.
1030
+ *
1031
+ * @param {Element} el
1032
+ * @return {ClassList}
1033
+ * @api public
1034
+ */
1035
+
1036
+ module.exports = function(el){
1037
+ return new ClassList(el);
1038
+ };
1039
+
1040
+ /**
1041
+ * Initialize a new ClassList for `el`.
1042
+ *
1043
+ * @param {Element} el
1044
+ * @api private
1045
+ */
1046
+
1047
+ function ClassList(el) {
1048
+ if (!el) throw new Error('A DOM element reference is required');
1049
+ this.el = el;
1050
+ this.list = el.classList;
1051
+ }
1052
+
1053
+ /**
1054
+ * Add class `name` if not already present.
1055
+ *
1056
+ * @param {String} kind
1057
+ * @return {ClassList}
1058
+ * @api public
1059
+ */
1060
+
1061
+ ClassList.prototype.add = function(name){
1062
+ // classList
1063
+ if (this.list) {
1064
+ this.list.add(name);
1065
+ return this;
1066
+ }
1067
+
1068
+ // fallback
1069
+ var arr = this.array();
1070
+ var i = index(arr, name);
1071
+ if (!~i) arr.push(name);
1072
+ this.el.className = arr.join(' ');
1073
+ return this;
1074
+ };
1075
+
1076
+ /**
1077
+ * Remove class `name` when present, or
1078
+ * pass a regular expression to remove
1079
+ * any which match.
1080
+ *
1081
+ * @param {String|RegExp} kind
1082
+ * @return {ClassList}
1083
+ * @api public
1084
+ */
1085
+
1086
+ ClassList.prototype.remove = function(name){
1087
+ if ('[object RegExp]' == toString.call(name)) {
1088
+ return this.removeMatching(name);
1089
+ }
1090
+
1091
+ // classList
1092
+ if (this.list) {
1093
+ this.list.remove(name);
1094
+ return this;
1095
+ }
1096
+
1097
+ // fallback
1098
+ var arr = this.array();
1099
+ var i = index(arr, name);
1100
+ if (~i) arr.splice(i, 1);
1101
+ this.el.className = arr.join(' ');
1102
+ return this;
1103
+ };
1104
+
1105
+ /**
1106
+ * Remove all classes matching `re`.
1107
+ *
1108
+ * @param {RegExp} re
1109
+ * @return {ClassList}
1110
+ * @api private
1111
+ */
1112
+
1113
+ ClassList.prototype.removeMatching = function(re){
1114
+ var arr = this.array();
1115
+ for (var i = 0; i < arr.length; i++) {
1116
+ if (re.test(arr[i])) {
1117
+ this.remove(arr[i]);
1118
+ }
1119
+ }
1120
+ return this;
1121
+ };
1122
+
1123
+ /**
1124
+ * Toggle class `name`, can force state via `force`.
1125
+ *
1126
+ * For browsers that support classList, but do not support `force` yet,
1127
+ * the mistake will be detected and corrected.
1128
+ *
1129
+ * @param {String} kind
1130
+ * @param {Boolean} force
1131
+ * @return {ClassList}
1132
+ * @api public
1133
+ */
1134
+
1135
+ ClassList.prototype.toggle = function(name, force){
1136
+ // classList
1137
+ if (this.list) {
1138
+ if ("undefined" !== typeof force) {
1139
+ if (force !== this.list.toggle(name, force)) {
1140
+ this.list.toggle(name); // toggle again to correct
1141
+ }
1142
+ } else {
1143
+ this.list.toggle(name);
1144
+ }
1145
+ return this;
1146
+ }
1147
+
1148
+ // fallback
1149
+ if ("undefined" !== typeof force) {
1150
+ if (!force) {
1151
+ this.remove(name);
1152
+ } else {
1153
+ this.add(name);
1154
+ }
1155
+ } else {
1156
+ if (this.has(name)) {
1157
+ this.remove(name);
1158
+ } else {
1159
+ this.add(name);
1160
+ }
1161
+ }
1162
+
1163
+ return this;
1164
+ };
1165
+
1166
+ /**
1167
+ * Return an array of classes.
1168
+ *
1169
+ * @return {Array}
1170
+ * @api public
1171
+ */
1172
+
1173
+ ClassList.prototype.array = function(){
1174
+ var str = this.el.className.replace(/^\s+|\s+$/g, '');
1175
+ var arr = str.split(re);
1176
+ if ('' === arr[0]) arr.shift();
1177
+ return arr;
1178
+ };
1179
+
1180
+ /**
1181
+ * Check if class `name` is present.
1182
+ *
1183
+ * @param {String} kind
1184
+ * @return {ClassList}
1185
+ * @api public
1186
+ */
1187
+
1188
+ ClassList.prototype.has =
1189
+ ClassList.prototype.contains = function(name){
1190
+ return this.list
1191
+ ? this.list.contains(name)
1192
+ : !! ~index(this.array(), name);
1193
+ };
1194
+
1195
+ });
1196
+
1197
+ require.register("component~event@0.1.4", function (exports, module) {
1198
+ var bind = window.addEventListener ? 'addEventListener' : 'attachEvent',
1199
+ unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent',
1200
+ prefix = bind !== 'addEventListener' ? 'on' : '';
1201
+
1202
+ /**
1203
+ * Bind `el` event `type` to `fn`.
1204
+ *
1205
+ * @param {Element} el
1206
+ * @param {String} type
1207
+ * @param {Function} fn
1208
+ * @param {Boolean} capture
1209
+ * @return {Function}
1210
+ * @api public
1211
+ */
1212
+
1213
+ exports.bind = function(el, type, fn, capture){
1214
+ el[bind](prefix + type, fn, capture || false);
1215
+ return fn;
1216
+ };
1217
+
1218
+ /**
1219
+ * Unbind `el` event `type`'s callback `fn`.
1220
+ *
1221
+ * @param {Element} el
1222
+ * @param {String} type
1223
+ * @param {Function} fn
1224
+ * @param {Boolean} capture
1225
+ * @return {Function}
1226
+ * @api public
1227
+ */
1228
+
1229
+ exports.unbind = function(el, type, fn, capture){
1230
+ el[unbind](prefix + type, fn, capture || false);
1231
+ return fn;
1232
+ };
1233
+ });
1234
+
1235
+ require.register("component~query@0.0.3", function (exports, module) {
1236
+ function one(selector, el) {
1237
+ return el.querySelector(selector);
1238
+ }
1239
+
1240
+ exports = module.exports = function(selector, el){
1241
+ el = el || document;
1242
+ return one(selector, el);
1243
+ };
1244
+
1245
+ exports.all = function(selector, el){
1246
+ el = el || document;
1247
+ return el.querySelectorAll(selector);
1248
+ };
1249
+
1250
+ exports.engine = function(obj){
1251
+ if (!obj.one) throw new Error('.one callback required');
1252
+ if (!obj.all) throw new Error('.all callback required');
1253
+ one = obj.one;
1254
+ exports.all = obj.all;
1255
+ return exports;
1256
+ };
1257
+
1258
+ });
1259
+
1260
+ require.register("component~matches-selector@0.1.5", function (exports, module) {
1261
+ /**
1262
+ * Module dependencies.
1263
+ */
1264
+
1265
+ var query = require('component~query@0.0.3');
1266
+
1267
+ /**
1268
+ * Element prototype.
1269
+ */
1270
+
1271
+ var proto = Element.prototype;
1272
+
1273
+ /**
1274
+ * Vendor function.
1275
+ */
1276
+
1277
+ var vendor = proto.matches
1278
+ || proto.webkitMatchesSelector
1279
+ || proto.mozMatchesSelector
1280
+ || proto.msMatchesSelector
1281
+ || proto.oMatchesSelector;
1282
+
1283
+ /**
1284
+ * Expose `match()`.
1285
+ */
1286
+
1287
+ module.exports = match;
1288
+
1289
+ /**
1290
+ * Match `el` to `selector`.
1291
+ *
1292
+ * @param {Element} el
1293
+ * @param {String} selector
1294
+ * @return {Boolean}
1295
+ * @api public
1296
+ */
1297
+
1298
+ function match(el, selector) {
1299
+ if (!el || el.nodeType !== 1) return false;
1300
+ if (vendor) return vendor.call(el, selector);
1301
+ var nodes = query.all(selector, el.parentNode);
1302
+ for (var i = 0; i < nodes.length; ++i) {
1303
+ if (nodes[i] == el) return true;
1304
+ }
1305
+ return false;
1306
+ }
1307
+
1308
+ });
1309
+
1310
+ require.register("component~closest@0.1.4", function (exports, module) {
1311
+ var matches = require('component~matches-selector@0.1.5')
1312
+
1313
+ module.exports = function (element, selector, checkYoSelf, root) {
1314
+ element = checkYoSelf ? {parentNode: element} : element
1315
+
1316
+ root = root || document
1317
+
1318
+ // Make sure `element !== document` and `element != null`
1319
+ // otherwise we get an illegal invocation
1320
+ while ((element = element.parentNode) && element !== document) {
1321
+ if (matches(element, selector))
1322
+ return element
1323
+ // After `matches` on the edge case that
1324
+ // the selector matches the root
1325
+ // (when the root is not the document)
1326
+ if (element === root)
1327
+ return
1328
+ }
1329
+ }
1330
+
1331
+ });
1332
+
1333
+ require.register("component~delegate@0.2.3", function (exports, module) {
1334
+ /**
1335
+ * Module dependencies.
1336
+ */
1337
+
1338
+ var closest = require('component~closest@0.1.4')
1339
+ , event = require('component~event@0.1.4');
1340
+
1341
+ /**
1342
+ * Delegate event `type` to `selector`
1343
+ * and invoke `fn(e)`. A callback function
1344
+ * is returned which may be passed to `.unbind()`.
1345
+ *
1346
+ * @param {Element} el
1347
+ * @param {String} selector
1348
+ * @param {String} type
1349
+ * @param {Function} fn
1350
+ * @param {Boolean} capture
1351
+ * @return {Function}
1352
+ * @api public
1353
+ */
1354
+
1355
+ exports.bind = function(el, selector, type, fn, capture){
1356
+ return event.bind(el, type, function(e){
1357
+ var target = e.target || e.srcElement;
1358
+ e.delegateTarget = closest(target, selector, true, el);
1359
+ if (e.delegateTarget) fn.call(el, e);
1360
+ }, capture);
1361
+ };
1362
+
1363
+ /**
1364
+ * Unbind event `type`'s callback `fn`.
1365
+ *
1366
+ * @param {Element} el
1367
+ * @param {String} type
1368
+ * @param {Function} fn
1369
+ * @param {Boolean} capture
1370
+ * @api public
1371
+ */
1372
+
1373
+ exports.unbind = function(el, type, fn, capture){
1374
+ event.unbind(el, type, fn, capture);
1375
+ };
1376
+
1377
+ });
1378
+
1379
+ require.register("component~events@1.0.9", function (exports, module) {
1380
+
1381
+ /**
1382
+ * Module dependencies.
1383
+ */
1384
+
1385
+ var events = require('component~event@0.1.4');
1386
+ var delegate = require('component~delegate@0.2.3');
1387
+
1388
+ /**
1389
+ * Expose `Events`.
1390
+ */
1391
+
1392
+ module.exports = Events;
1393
+
1394
+ /**
1395
+ * Initialize an `Events` with the given
1396
+ * `el` object which events will be bound to,
1397
+ * and the `obj` which will receive method calls.
1398
+ *
1399
+ * @param {Object} el
1400
+ * @param {Object} obj
1401
+ * @api public
1402
+ */
1403
+
1404
+ function Events(el, obj) {
1405
+ if (!(this instanceof Events)) return new Events(el, obj);
1406
+ if (!el) throw new Error('element required');
1407
+ if (!obj) throw new Error('object required');
1408
+ this.el = el;
1409
+ this.obj = obj;
1410
+ this._events = {};
1411
+ }
1412
+
1413
+ /**
1414
+ * Subscription helper.
1415
+ */
1416
+
1417
+ Events.prototype.sub = function(event, method, cb){
1418
+ this._events[event] = this._events[event] || {};
1419
+ this._events[event][method] = cb;
1420
+ };
1421
+
1422
+ /**
1423
+ * Bind to `event` with optional `method` name.
1424
+ * When `method` is undefined it becomes `event`
1425
+ * with the "on" prefix.
1426
+ *
1427
+ * Examples:
1428
+ *
1429
+ * Direct event handling:
1430
+ *
1431
+ * events.bind('click') // implies "onclick"
1432
+ * events.bind('click', 'remove')
1433
+ * events.bind('click', 'sort', 'asc')
1434
+ *
1435
+ * Delegated event handling:
1436
+ *
1437
+ * events.bind('click li > a')
1438
+ * events.bind('click li > a', 'remove')
1439
+ * events.bind('click a.sort-ascending', 'sort', 'asc')
1440
+ * events.bind('click a.sort-descending', 'sort', 'desc')
1441
+ *
1442
+ * @param {String} event
1443
+ * @param {String|function} [method]
1444
+ * @return {Function} callback
1445
+ * @api public
1446
+ */
1447
+
1448
+ Events.prototype.bind = function(event, method){
1449
+ var e = parse(event);
1450
+ var el = this.el;
1451
+ var obj = this.obj;
1452
+ var name = e.name;
1453
+ var method = method || 'on' + name;
1454
+ var args = [].slice.call(arguments, 2);
1455
+
1456
+ // callback
1457
+ function cb(){
1458
+ var a = [].slice.call(arguments).concat(args);
1459
+ obj[method].apply(obj, a);
1460
+ }
1461
+
1462
+ // bind
1463
+ if (e.selector) {
1464
+ cb = delegate.bind(el, e.selector, name, cb);
1465
+ } else {
1466
+ events.bind(el, name, cb);
1467
+ }
1468
+
1469
+ // subscription for unbinding
1470
+ this.sub(name, method, cb);
1471
+
1472
+ return cb;
1473
+ };
1474
+
1475
+ /**
1476
+ * Unbind a single binding, all bindings for `event`,
1477
+ * or all bindings within the manager.
1478
+ *
1479
+ * Examples:
1480
+ *
1481
+ * Unbind direct handlers:
1482
+ *
1483
+ * events.unbind('click', 'remove')
1484
+ * events.unbind('click')
1485
+ * events.unbind()
1486
+ *
1487
+ * Unbind delegate handlers:
1488
+ *
1489
+ * events.unbind('click', 'remove')
1490
+ * events.unbind('click')
1491
+ * events.unbind()
1492
+ *
1493
+ * @param {String|Function} [event]
1494
+ * @param {String|Function} [method]
1495
+ * @api public
1496
+ */
1497
+
1498
+ Events.prototype.unbind = function(event, method){
1499
+ if (0 == arguments.length) return this.unbindAll();
1500
+ if (1 == arguments.length) return this.unbindAllOf(event);
1501
+
1502
+ // no bindings for this event
1503
+ var bindings = this._events[event];
1504
+ if (!bindings) return;
1505
+
1506
+ // no bindings for this method
1507
+ var cb = bindings[method];
1508
+ if (!cb) return;
1509
+
1510
+ events.unbind(this.el, event, cb);
1511
+ };
1512
+
1513
+ /**
1514
+ * Unbind all events.
1515
+ *
1516
+ * @api private
1517
+ */
1518
+
1519
+ Events.prototype.unbindAll = function(){
1520
+ for (var event in this._events) {
1521
+ this.unbindAllOf(event);
1522
+ }
1523
+ };
1524
+
1525
+ /**
1526
+ * Unbind all events for `event`.
1527
+ *
1528
+ * @param {String} event
1529
+ * @api private
1530
+ */
1531
+
1532
+ Events.prototype.unbindAllOf = function(event){
1533
+ var bindings = this._events[event];
1534
+ if (!bindings) return;
1535
+
1536
+ for (var method in bindings) {
1537
+ this.unbind(event, method);
1538
+ }
1539
+ };
1540
+
1541
+ /**
1542
+ * Parse `event`.
1543
+ *
1544
+ * @param {String} event
1545
+ * @return {Object}
1546
+ * @api private
1547
+ */
1548
+
1549
+ function parse(event) {
1550
+ var parts = event.split(/ +/);
1551
+ return {
1552
+ name: parts.shift(),
1553
+ selector: parts.join(' ')
1554
+ }
1555
+ }
1556
+
1557
+ });
1558
+
1559
+ require.register("switchery", function (exports, module) {
1560
+ /**
1561
+ * Switchery 0.8.1
1562
+ * http://abpetkov.github.io/switchery/
1563
+ *
1564
+ * Authored by Alexander Petkov
1565
+ * https://github.com/abpetkov
1566
+ *
1567
+ * Copyright 2013-2015, Alexander Petkov
1568
+ * License: The MIT License (MIT)
1569
+ * http://opensource.org/licenses/MIT
1570
+ *
1571
+ */
1572
+
1573
+ /**
1574
+ * External dependencies.
1575
+ */
1576
+
1577
+ var transitionize = require('abpetkov~transitionize@0.0.3')
1578
+ , fastclick = require('ftlabs~fastclick@v0.6.11')
1579
+ , classes = require('component~classes@1.2.1')
1580
+ , events = require('component~events@1.0.9');
1581
+
1582
+ /**
1583
+ * Expose `Switchery`.
1584
+ */
1585
+
1586
+ module.exports = Switchery;
1587
+
1588
+ /**
1589
+ * Set Switchery default values.
1590
+ *
1591
+ * @api public
1592
+ */
1593
+
1594
+ var defaults = {
1595
+ color : '#2f80ed'
1596
+ , secondaryColor : '#dfdfdf'
1597
+ , jackColor : '#fff'
1598
+ , jackSecondaryColor: null
1599
+ , className : 'switchery'
1600
+ , disabled : false
1601
+ , disabledOpacity : 0.5
1602
+ , speed : '0.4s'
1603
+ , size : 'default'
1604
+ };
1605
+
1606
+ /**
1607
+ * Create Switchery object.
1608
+ *
1609
+ * @param {Object} element
1610
+ * @param {Object} options
1611
+ * @api public
1612
+ */
1613
+
1614
+ function Switchery(element, options) {
1615
+ if (!(this instanceof Switchery)) return new Switchery(element, options);
1616
+
1617
+ this.element = element;
1618
+ this.options = options || {};
1619
+
1620
+ for (var i in defaults) {
1621
+ if (this.options[i] == null) {
1622
+ this.options[i] = defaults[i];
1623
+ }
1624
+ }
1625
+
1626
+ if (this.element != null && this.element.type == 'checkbox') this.init();
1627
+ if (this.isDisabled() === true) this.disable();
1628
+ }
1629
+
1630
+ /**
1631
+ * Hide the target element.
1632
+ *
1633
+ * @api private
1634
+ */
1635
+
1636
+ Switchery.prototype.hide = function() {
1637
+ this.element.style.display = 'none';
1638
+ };
1639
+
1640
+ /**
1641
+ * Show custom switch after the target element.
1642
+ *
1643
+ * @api private
1644
+ */
1645
+
1646
+ Switchery.prototype.show = function() {
1647
+ var switcher = this.create();
1648
+ this.insertAfter(this.element, switcher);
1649
+ };
1650
+
1651
+ /**
1652
+ * Create custom switch.
1653
+ *
1654
+ * @returns {Object} this.switcher
1655
+ * @api private
1656
+ */
1657
+
1658
+ Switchery.prototype.create = function() {
1659
+ this.switcher = document.createElement('span');
1660
+ this.jack = document.createElement('small');
1661
+ this.switcher.appendChild(this.jack);
1662
+ this.switcher.className = this.options.className;
1663
+ this.events = events(this.switcher, this);
1664
+
1665
+ return this.switcher;
1666
+ };
1667
+
1668
+ /**
1669
+ * Insert after element after another element.
1670
+ *
1671
+ * @param {Object} reference
1672
+ * @param {Object} target
1673
+ * @api private
1674
+ */
1675
+
1676
+ Switchery.prototype.insertAfter = function(reference, target) {
1677
+ reference.parentNode.insertBefore(target, reference.nextSibling);
1678
+ };
1679
+
1680
+ /**
1681
+ * Set switch jack proper position.
1682
+ *
1683
+ * @param {Boolean} clicked - we need this in order to uncheck the input when the switch is clicked
1684
+ * @api private
1685
+ */
1686
+
1687
+ Switchery.prototype.setPosition = function (clicked) {
1688
+ var checked = this.isChecked()
1689
+ , switcher = this.switcher
1690
+ , jack = this.jack;
1691
+
1692
+ if (clicked && checked) checked = false;
1693
+ else if (clicked && !checked) checked = true;
1694
+
1695
+ if (checked === true) {
1696
+ this.element.checked = true;
1697
+
1698
+ if (window.getComputedStyle) jack.style.left = parseInt(window.getComputedStyle(switcher).width) - parseInt(window.getComputedStyle(jack).width) + 'px';
1699
+ else jack.style.left = parseInt(switcher.currentStyle['width']) - parseInt(jack.currentStyle['width']) + 'px';
1700
+
1701
+ if (this.options.color) this.colorize();
1702
+ this.setSpeed();
1703
+ } else {
1704
+ jack.style.left = 0;
1705
+ this.element.checked = false;
1706
+ this.switcher.style.boxShadow = 'inset 0 0 0 0 ' + this.options.secondaryColor;
1707
+ this.switcher.style.borderColor = this.options.secondaryColor;
1708
+ this.switcher.style.backgroundColor = (this.options.secondaryColor !== defaults.secondaryColor) ? this.options.secondaryColor : '#fff';
1709
+ this.jack.style.backgroundColor = (this.options.jackSecondaryColor !== this.options.jackColor) ? this.options.jackSecondaryColor : this.options.jackColor;
1710
+ this.setSpeed();
1711
+ }
1712
+ };
1713
+
1714
+ /**
1715
+ * Set speed.
1716
+ *
1717
+ * @api private
1718
+ */
1719
+
1720
+ Switchery.prototype.setSpeed = function() {
1721
+ var switcherProp = {}
1722
+ , jackProp = {
1723
+ 'background-color': this.options.speed
1724
+ , 'left': this.options.speed.replace(/[a-z]/, '') / 2 + 's'
1725
+ };
1726
+
1727
+ if (this.isChecked()) {
1728
+ switcherProp = {
1729
+ 'border': this.options.speed
1730
+ , 'box-shadow': this.options.speed
1731
+ , 'background-color': this.options.speed.replace(/[a-z]/, '') * 3 + 's'
1732
+ };
1733
+ } else {
1734
+ switcherProp = {
1735
+ 'border': this.options.speed
1736
+ , 'box-shadow': this.options.speed
1737
+ };
1738
+ }
1739
+
1740
+ transitionize(this.switcher, switcherProp);
1741
+ transitionize(this.jack, jackProp);
1742
+ };
1743
+
1744
+ /**
1745
+ * Set switch size.
1746
+ *
1747
+ * @api private
1748
+ */
1749
+
1750
+ Switchery.prototype.setSize = function() {
1751
+ var small = 'switchery-small'
1752
+ , normal = 'switchery-default'
1753
+ , large = 'switchery-large';
1754
+
1755
+ switch (this.options.size) {
1756
+ case 'small':
1757
+ classes(this.switcher).add(small)
1758
+ break;
1759
+ case 'large':
1760
+ classes(this.switcher).add(large)
1761
+ break;
1762
+ default:
1763
+ classes(this.switcher).add(normal)
1764
+ break;
1765
+ }
1766
+ };
1767
+
1768
+ /**
1769
+ * Set switch color.
1770
+ *
1771
+ * @api private
1772
+ */
1773
+
1774
+ Switchery.prototype.colorize = function() {
1775
+ var switcherHeight = this.switcher.offsetHeight / 2;
1776
+
1777
+ this.switcher.style.backgroundColor = this.options.color;
1778
+ this.switcher.style.borderColor = this.options.color;
1779
+ this.switcher.style.boxShadow = 'inset 0 0 0 ' + switcherHeight + 'px ' + this.options.color;
1780
+ this.jack.style.backgroundColor = this.options.jackColor;
1781
+ };
1782
+
1783
+ /**
1784
+ * Handle the onchange event.
1785
+ *
1786
+ * @param {Boolean} state
1787
+ * @api private
1788
+ */
1789
+
1790
+ Switchery.prototype.handleOnchange = function(state) {
1791
+ if (document.dispatchEvent) {
1792
+ var event = document.createEvent('HTMLEvents');
1793
+ event.initEvent('change', true, true);
1794
+ this.element.dispatchEvent(event);
1795
+ } else {
1796
+ this.element.fireEvent('onchange');
1797
+ }
1798
+ };
1799
+
1800
+ /**
1801
+ * Handle the native input element state change.
1802
+ * A `change` event must be fired in order to detect the change.
1803
+ *
1804
+ * @api private
1805
+ */
1806
+
1807
+ Switchery.prototype.handleChange = function() {
1808
+ var self = this, el = this.element;
1809
+ if (el.addEventListener) {
1810
+ el.addEventListener("change", function () {
1811
+ jQuery('body').trigger('tcdSwitcherChanged',{checked:self.isChecked(),target:self.element});
1812
+ self.setPosition()
1813
+ })
1814
+ } else {
1815
+ el.attachEvent("onchange", function () {
1816
+ self.setPosition()
1817
+ })
1818
+ }
1819
+ };
1820
+
1821
+ /**
1822
+ * Handle the switch click event.
1823
+ *
1824
+ * @api private
1825
+ */
1826
+
1827
+ Switchery.prototype.handleClick = function() {
1828
+ var switcher = this.switcher;
1829
+
1830
+ fastclick(switcher);
1831
+ this.events.bind('click', 'bindClick');
1832
+ };
1833
+
1834
+ /**
1835
+ * Attach all methods that need to happen on switcher click.
1836
+ *
1837
+ * @api private
1838
+ */
1839
+
1840
+ Switchery.prototype.bindClick = function() {
1841
+ var parent = this.element.parentNode.tagName.toLowerCase()
1842
+ , labelParent = (parent === 'label') ? false : true;
1843
+
1844
+ this.setPosition(labelParent);
1845
+ this.handleOnchange(this.element.checked);
1846
+ };
1847
+
1848
+ /**
1849
+ * Mark an individual switch as already handled.
1850
+ *
1851
+ * @api private
1852
+ */
1853
+
1854
+ Switchery.prototype.markAsSwitched = function() {
1855
+ this.element.setAttribute('data-switchery', true);
1856
+ };
1857
+
1858
+ /**
1859
+ * Check if an individual switch is already handled.
1860
+ *
1861
+ * @api private
1862
+ */
1863
+
1864
+ Switchery.prototype.markedAsSwitched = function() {
1865
+ return this.element.getAttribute('data-switchery');
1866
+ };
1867
+
1868
+ /**
1869
+ * Initialize Switchery.
1870
+ *
1871
+ * @api private
1872
+ */
1873
+
1874
+ Switchery.prototype.init = function() {
1875
+ this.hide();
1876
+ this.show();
1877
+ this.setSize();
1878
+ this.setPosition();
1879
+ this.markAsSwitched();
1880
+ this.handleChange();
1881
+ this.handleClick();
1882
+ };
1883
+
1884
+ /**
1885
+ * See if input is checked.
1886
+ *
1887
+ * @returns {Boolean}
1888
+ * @api public
1889
+ */
1890
+
1891
+ Switchery.prototype.isChecked = function() {
1892
+ return this.element.checked;
1893
+ };
1894
+
1895
+ /**
1896
+ * See if switcher should be disabled.
1897
+ *
1898
+ * @returns {Boolean}
1899
+ * @api public
1900
+ */
1901
+
1902
+ Switchery.prototype.isDisabled = function() {
1903
+ return this.options.disabled || this.element.disabled || this.element.readOnly;
1904
+ };
1905
+
1906
+ /**
1907
+ * Destroy all event handlers attached to the switch.
1908
+ *
1909
+ * @api public
1910
+ */
1911
+
1912
+ Switchery.prototype.destroy = function() {
1913
+ this.events.unbind();
1914
+ };
1915
+
1916
+ /**
1917
+ * Enable disabled switch element.
1918
+ *
1919
+ * @api public
1920
+ */
1921
+
1922
+ Switchery.prototype.enable = function() {
1923
+ if (this.options.disabled) this.options.disabled = false;
1924
+ if (this.element.disabled) this.element.disabled = false;
1925
+ if (this.element.readOnly) this.element.readOnly = false;
1926
+ this.switcher.style.opacity = 1;
1927
+ this.events.bind('click', 'bindClick');
1928
+ };
1929
+
1930
+ /**
1931
+ * Disable switch element.
1932
+ *
1933
+ * @api public
1934
+ */
1935
+
1936
+ Switchery.prototype.disable = function() {
1937
+ if (!this.options.disabled) this.options.disabled = true;
1938
+ if (!this.element.disabled) this.element.disabled = true;
1939
+ if (!this.element.readOnly) this.element.readOnly = true;
1940
+ this.switcher.style.opacity = this.options.disabledOpacity;
1941
+ this.destroy();
1942
+ };
1943
+
1944
+ });
1945
+
1946
+ if (typeof exports == "object") {
1947
+ module.exports = require("switchery");
1948
+ } else if (typeof define == "function" && define.amd) {
1949
+ define("Switchery", [], function(){ return require("switchery"); });
1950
+ } else {
1951
+ (this || window)["Switchery"] = require("switchery");
1952
+ }
1953
+ })();
1954
+ })(External = FintaChart.External || (FintaChart.External = {}));
1955
+ })(FintaChart || (FintaChart = {}));
1956
+
1957
+