j1-template 2020.0.22 → 2020.0.24

Sign up to get free protection for your applications and to get access to all the features.
Files changed (266) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/layouts/content_generator_page.html +1 -1
  3. data/_includes/themes/j1/layouts/content_generator_post.html +63 -161
  4. data/_includes/themes/j1/modules/connectors/ad/google-adsense.html +14 -0
  5. data/_includes/themes/j1/modules/connectors/analytic/google-analytics.html +1 -3
  6. data/_includes/themes/j1/modules/connectors/comment/disqus.html +37 -24
  7. data/_includes/themes/j1/modules/navigator/generator.html +8 -3
  8. data/_includes/themes/j1/modules/navigator/procedures/topsearch.proc +36 -26
  9. data/_includes/themes/j1/procedures/layouts/module_writer.proc +1 -1
  10. data/_includes/themes/j1/procedures/posts/create_series_header.proc +9 -5
  11. data/assets/data/banner.html +1 -1
  12. data/assets/data/fam.html +124 -0
  13. data/assets/data/mmenu_sidebar.html +3 -3
  14. data/assets/data/panel.html +9 -9
  15. data/assets/data/quicklinks.html +13 -13
  16. data/assets/error_pages/HTTP204.html +1 -0
  17. data/assets/error_pages/HTTP400.html +3 -2
  18. data/assets/error_pages/HTTP401.html +3 -2
  19. data/assets/error_pages/HTTP403.html +3 -2
  20. data/assets/error_pages/HTTP404.html +3 -2
  21. data/assets/error_pages/HTTP500.html +3 -2
  22. data/assets/error_pages/HTTP501.html +3 -2
  23. data/assets/error_pages/HTTP502.html +3 -2
  24. data/assets/error_pages/HTTP503.html +3 -2
  25. data/assets/error_pages/HTTP520.html +3 -2
  26. data/assets/error_pages/HTTP521.html +3 -2
  27. data/assets/error_pages/HTTP533.html +3 -2
  28. data/assets/themes/j1/adapter/js/{ssm.js → fam.js} +248 -138
  29. data/assets/themes/j1/adapter/js/framer.js +72 -56
  30. data/assets/themes/j1/adapter/js/gallery_customizer.js +2 -1
  31. data/assets/themes/j1/adapter/js/j1.js +8 -2
  32. data/assets/themes/j1/adapter/js/{searcher.js → lunr_search.js} +68 -65
  33. data/assets/themes/j1/adapter/js/toccer.js +62 -30
  34. data/assets/themes/j1/core/css/bootstrap.css +7154 -0
  35. data/assets/themes/j1/core/css/bootstrap.min.css +6 -0
  36. data/assets/themes/j1/core/css/custom.scss +28 -0
  37. data/assets/themes/j1/core/css/globals.css +14523 -0
  38. data/assets/themes/j1/core/css/globals.min.css +1 -0
  39. data/assets/themes/j1/core/css/globals.scss +28 -0
  40. data/assets/themes/j1/core/css/theme_extensions.css +11558 -0
  41. data/assets/themes/j1/core/css/theme_extensions.min.css +1 -0
  42. data/assets/themes/j1/core/css/themes/bootstrap/bootstrap.css +7 -4
  43. data/assets/themes/j1/core/css/themes/bootstrap/bootstrap.min.css +2 -2
  44. data/assets/themes/j1/core/css/themes/uno-dark/bootstrap.css +7 -4
  45. data/assets/themes/j1/core/css/themes/uno-dark/bootstrap.min.css +2 -2
  46. data/assets/themes/j1/core/css/themes/uno-light/bootstrap.css +514 -417
  47. data/assets/themes/j1/core/css/themes/uno-light/bootstrap.min.css +2 -2
  48. data/assets/themes/j1/core/css/uno.css +11823 -0
  49. data/assets/themes/j1/core/css/uno.min.css +1 -0
  50. data/assets/themes/j1/core/css/uno.scss +28 -0
  51. data/assets/themes/j1/core/css/vendor.css +5 -4
  52. data/assets/themes/j1/core/css/vendor.min.css +1 -1
  53. data/assets/themes/j1/core/css/vendor.scss +28 -0
  54. data/assets/themes/j1/core/js/template.js +6 -11
  55. data/assets/themes/j1/core/js/template.js.map +1 -1
  56. data/assets/themes/j1/core/js/template.min.js +1 -1
  57. data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.js +6 -0
  58. data/assets/themes/j1/modules/cash/js/cash.js +1374 -0
  59. data/assets/themes/j1/modules/cash/js/cash.min.js +42 -0
  60. data/assets/themes/j1/modules/fam/css/uno/fam.css +369 -0
  61. data/assets/themes/j1/modules/fam/js/fam.js +477 -0
  62. data/assets/themes/j1/modules/iframeResizer/examples/frame.nested.html +1 -1
  63. data/assets/themes/j1/modules/iframeResizer/js/{iframeResizer.js → resizer.js} +0 -0
  64. data/assets/themes/j1/modules/iframeResizer/js/{iframeResizer.map → resizer.map} +0 -0
  65. data/assets/themes/j1/modules/iframeResizer/js/{iframeResizer.min.js → resizer.min.js} +0 -0
  66. data/assets/themes/j1/modules/jquery/js/require.js +2145 -0
  67. data/assets/themes/j1/modules/jquery/js/require.min.js +5 -0
  68. data/assets/themes/j1/modules/lunrSearch/css/lunr_search.css +32 -0
  69. data/assets/themes/j1/modules/lunrSearch/css/lunr_search.min.css +25 -0
  70. data/assets/themes/j1/modules/lunrSearch/js/dateformat.js +125 -0
  71. data/assets/themes/j1/modules/lunrSearch/js/dateformat.min.js +14 -0
  72. data/assets/themes/j1/modules/lunrSearch/js/lunr.js +3475 -0
  73. data/assets/themes/j1/modules/lunrSearch/js/lunr.min.js +51 -0
  74. data/assets/themes/j1/modules/lunrSearch/js/lunr_search.js +184 -0
  75. data/assets/themes/j1/modules/lunrSearch/js/lunr_search.min.js +17 -0
  76. data/assets/themes/j1/modules/lunrSearch/js/mustache.js +772 -0
  77. data/assets/themes/j1/modules/lunrSearch/js/mustache.min.js +772 -0
  78. data/assets/themes/j1/modules/lunrSearch/js/uri.js +2340 -0
  79. data/assets/themes/j1/modules/lunrSearch/js/uri.min.js +93 -0
  80. data/assets/themes/j1/modules/materialize/js/anime.js +1283 -0
  81. data/assets/themes/j1/modules/materialize/js/anime.min.js +34 -0
  82. data/assets/themes/j1/modules/materialize/js/autocomplete.js +450 -0
  83. data/assets/themes/j1/modules/materialize/js/buttons.js +409 -0
  84. data/assets/themes/j1/modules/materialize/js/cards.js +40 -0
  85. data/assets/themes/j1/modules/materialize/js/carousel.js +717 -0
  86. data/assets/themes/j1/modules/materialize/js/cash-dom.js +1044 -0
  87. data/assets/themes/j1/modules/materialize/js/cash.js +960 -0
  88. data/assets/themes/j1/modules/materialize/js/characterCounter.js +136 -0
  89. data/assets/themes/j1/modules/materialize/js/chips.js +481 -0
  90. data/assets/themes/j1/modules/materialize/js/collapsible.js +275 -0
  91. data/assets/themes/j1/modules/materialize/js/component.js +44 -0
  92. data/assets/themes/j1/modules/materialize/js/datepicker.js +975 -0
  93. data/assets/themes/j1/modules/materialize/js/dropdown.js +617 -0
  94. data/assets/themes/j1/modules/materialize/js/forms.js +275 -0
  95. data/assets/themes/j1/modules/materialize/js/global.js +427 -0
  96. data/assets/themes/j1/modules/materialize/js/materialbox.js +453 -0
  97. data/assets/themes/j1/modules/materialize/js/modal.js +382 -0
  98. data/assets/themes/j1/modules/materialize/js/parallax.js +138 -0
  99. data/assets/themes/j1/modules/materialize/js/pushpin.js +145 -0
  100. data/assets/themes/j1/modules/materialize/js/range.js +263 -0
  101. data/assets/themes/j1/modules/materialize/js/ripple.js +335 -0
  102. data/assets/themes/j1/modules/materialize/js/scrollspy.js +295 -0
  103. data/assets/themes/j1/modules/materialize/js/select.js +432 -0
  104. data/assets/themes/j1/modules/materialize/js/sidenav.js +580 -0
  105. data/assets/themes/j1/modules/materialize/js/slider.js +359 -0
  106. data/assets/themes/j1/modules/materialize/js/tabs.js +402 -0
  107. data/assets/themes/j1/modules/materialize/js/tapTarget.js +314 -0
  108. data/assets/themes/j1/modules/materialize/js/timepicker.js +647 -0
  109. data/assets/themes/j1/modules/materialize/js/toasts.js +310 -0
  110. data/assets/themes/j1/modules/materialize/js/tooltip.js +303 -0
  111. data/assets/themes/j1/modules/materialize/js/waves.js +335 -0
  112. data/assets/themes/j1/modules/materialize/scss/components/_badges.scss +55 -0
  113. data/assets/themes/j1/modules/materialize/scss/components/_buttons.scss +322 -0
  114. data/assets/themes/j1/modules/materialize/scss/components/_cards.scss +195 -0
  115. data/assets/themes/j1/modules/materialize/scss/components/_carousel.scss +90 -0
  116. data/assets/themes/j1/modules/materialize/scss/components/_chips.scss +90 -0
  117. data/assets/themes/j1/modules/materialize/scss/components/_collapsible.scss +91 -0
  118. data/assets/themes/j1/modules/materialize/scss/components/_color-classes.scss +32 -0
  119. data/assets/themes/j1/modules/materialize/scss/components/_color-variables.scss +370 -0
  120. data/assets/themes/j1/modules/materialize/scss/components/_datepicker.scss +191 -0
  121. data/assets/themes/j1/modules/materialize/scss/components/_dropdown.scss +85 -0
  122. data/assets/themes/j1/modules/materialize/scss/components/_global.scss +769 -0
  123. data/assets/themes/j1/modules/materialize/scss/components/_grid.scss +156 -0
  124. data/assets/themes/j1/modules/materialize/scss/components/_icons-material-design.scss +5 -0
  125. data/assets/themes/j1/modules/materialize/scss/components/_materialbox.scss +43 -0
  126. data/assets/themes/j1/modules/materialize/scss/components/_modal.scss +94 -0
  127. data/assets/themes/j1/modules/materialize/scss/components/_navbar.scss +208 -0
  128. data/assets/themes/j1/modules/materialize/scss/components/_normalize.scss +447 -0
  129. data/assets/themes/j1/modules/materialize/scss/components/_preloader.scss +334 -0
  130. data/assets/themes/j1/modules/materialize/scss/components/_pulse.scss +34 -0
  131. data/assets/themes/j1/modules/materialize/scss/components/_sidenav.scss +216 -0
  132. data/assets/themes/j1/modules/materialize/scss/components/_slider.scss +92 -0
  133. data/assets/themes/j1/modules/materialize/scss/components/_table_of_contents.scss +33 -0
  134. data/assets/themes/j1/modules/materialize/scss/components/_tabs.scss +99 -0
  135. data/assets/themes/j1/modules/materialize/scss/components/_tapTarget.scss +103 -0
  136. data/assets/themes/j1/modules/materialize/scss/components/_timepicker.scss +183 -0
  137. data/assets/themes/j1/modules/materialize/scss/components/_toast.scss +58 -0
  138. data/assets/themes/j1/modules/materialize/scss/components/_tooltip.scss +32 -0
  139. data/assets/themes/j1/modules/materialize/scss/components/_transitions.scss +13 -0
  140. data/assets/themes/j1/modules/materialize/scss/components/_typography.scss +60 -0
  141. data/assets/themes/j1/modules/materialize/scss/components/_variables.scss +349 -0
  142. data/assets/themes/j1/modules/materialize/scss/components/_waves.scss +114 -0
  143. data/assets/themes/j1/modules/materialize/scss/components/forms/_checkboxes.scss +200 -0
  144. data/assets/themes/j1/modules/materialize/scss/components/forms/_file-input.scss +44 -0
  145. data/assets/themes/j1/modules/materialize/scss/components/forms/_forms.scss +22 -0
  146. data/assets/themes/j1/modules/materialize/scss/components/forms/_input-fields.scss +354 -0
  147. data/assets/themes/j1/modules/materialize/scss/components/forms/_radio-buttons.scss +115 -0
  148. data/assets/themes/j1/modules/materialize/scss/components/forms/_range.scss +161 -0
  149. data/assets/themes/j1/modules/materialize/scss/components/forms/_select.scss +180 -0
  150. data/assets/themes/j1/modules/materialize/scss/components/forms/_switches.scss +89 -0
  151. data/assets/themes/j1/modules/materialize/scss/materialize.scss +41 -0
  152. data/assets/themes/j1/modules/{bsThemeSwitcher → themeSwitcher}/js/switcher.js +0 -0
  153. data/assets/themes/j1/modules/{bsThemeSwitcher → themeSwitcher}/js/switcher.min.js +0 -0
  154. data/lib/j1/version.rb +1 -1
  155. data/lib/starter_web/Gemfile +12 -16
  156. data/lib/starter_web/_config.yml +95 -21
  157. data/lib/starter_web/_data/blocks/banner.yml +1 -1
  158. data/lib/starter_web/_data/blocks/panel.yml +6 -6
  159. data/lib/starter_web/_data/j1_config.yml +7 -6
  160. data/lib/starter_web/_data/layouts/home.yml +13 -3
  161. data/lib/starter_web/_data/layouts/page.yml +10 -0
  162. data/lib/starter_web/_data/layouts/post.yml +10 -0
  163. data/lib/starter_web/_data/modules/defaults/{ssm.yml → fam.yml} +12 -15
  164. data/lib/starter_web/_data/modules/defaults/lunr_search.yml +171 -0
  165. data/lib/starter_web/_data/modules/defaults/navigator.yml +4 -4
  166. data/lib/starter_web/_data/modules/defaults/toccer.yml +4 -2
  167. data/lib/starter_web/_data/modules/fam.yml +158 -0
  168. data/lib/starter_web/_data/modules/{back2top.yml → lunr_search.yml} +15 -9
  169. data/lib/starter_web/_data/modules/navigator.yml +2 -2
  170. data/lib/starter_web/_data/modules/navigator_menu.yml +57 -6
  171. data/lib/starter_web/_data/modules/toccer.yml +0 -73
  172. data/lib/starter_web/_data/resources.yml +151 -104
  173. data/lib/starter_web/_includes/attributes.asciidoc +2 -2
  174. data/lib/starter_web/_includes/breadcrumbs.html +11 -0
  175. data/lib/starter_web/_plugins/debug.rb +0 -1
  176. data/lib/starter_web/_plugins/filters.rb +0 -1
  177. data/lib/starter_web/_plugins/{lorem-inline.rb → lorem_inline.rb} +1 -2
  178. data/lib/starter_web/_plugins/lunr_index.rb +313 -0
  179. data/lib/starter_web/_plugins/prettify.rb +0 -3
  180. data/lib/starter_web/_plugins/simple_search_filter.rb +0 -1
  181. data/lib/starter_web/_plugins/symlink_watcher.rb +2 -3
  182. data/lib/starter_web/assets/images/modules/attics/banner/lunr-banner-1280x800.jpg +0 -0
  183. data/lib/starter_web/assets/images/pages/winlogbeat/coordinate-map.png +0 -0
  184. data/lib/starter_web/assets/images/pages/winlogbeat/kibana-powershell.jpg +0 -0
  185. data/lib/starter_web/assets/images/pages/winlogbeat/option_ignore_outgoing.png +0 -0
  186. data/lib/starter_web/assets/images/pages/winlogbeat/winlogbeat-dashboard.png +0 -0
  187. data/lib/starter_web/collections/posts/public/featured/_posts/2018-05-01-confusion-about-base-url.adoc +2 -4
  188. data/lib/starter_web/collections/posts/public/featured/_posts/2019-05-01-top-open-source-static-site-generators.adoc +4 -2
  189. data/lib/starter_web/collections/posts/public/featured/_posts/2019-06-01-about-cookies.adoc +3 -2
  190. data/lib/starter_web/collections/posts/public/series/_posts/2018-11-01-docker-using-shared-folders.adoc +5 -4
  191. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-01-post-test-series.adoc +144 -0
  192. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-02-post-test-series.adoc +146 -0
  193. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-03-post-test-series.adoc +146 -0
  194. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-04-post-test-series.adoc +146 -0
  195. data/lib/starter_web/collections/posts/public/test_posts/_posts/2020-09-11-test_post.adoc +2 -4
  196. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-20-minneapolis.adoc +2 -3
  197. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-24-narcisse-snake-dens.adoc +2 -7
  198. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-26-columbia-river.adoc +2 -6
  199. data/lib/starter_web/index.html +16 -10
  200. data/lib/starter_web/package.json +5 -2
  201. data/lib/starter_web/pages/public/about/about_site.adoc +0 -2
  202. data/lib/starter_web/pages/public/about/become_a_patron.adoc +1 -3
  203. data/lib/starter_web/pages/public/blog/navigator/archive.html +8 -1
  204. data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +7 -3
  205. data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +8 -1
  206. data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +7 -2
  207. data/lib/starter_web/pages/public/blog/navigator/index.html +6 -2
  208. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/100_meet_and_greet_jekyll.adoc +3 -4
  209. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/200_preparations.adoc +3 -4
  210. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/300_first_awesome_web.adoc +3 -4
  211. data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.adoc +25 -20
  212. data/lib/starter_web/pages/public/learn/roundtrip/100_present_videos.adoc +14 -12
  213. data/lib/starter_web/pages/public/learn/roundtrip/200_typography.adoc +20 -20
  214. data/lib/starter_web/pages/public/learn/roundtrip/300_icon_fonts.adoc +13 -8
  215. data/lib/starter_web/pages/public/learn/roundtrip/400_asciidoc_extensions.adoc +14 -9
  216. data/lib/starter_web/pages/public/learn/roundtrip/410_bs_modals_extentions.adoc +9 -6
  217. data/lib/starter_web/pages/public/learn/roundtrip/420_responsive_tables_extensions.adoc +62 -8
  218. data/lib/starter_web/pages/public/learn/roundtrip/500_themes.adoc +9 -7
  219. data/lib/starter_web/pages/public/learn/roundtrip/600_lunr.adoc +237 -0
  220. data/lib/starter_web/pages/public/learn/roundtrip/610_fam.adoc +302 -0
  221. data/lib/starter_web/pages/public/learn/where_to_go.adoc +3 -7
  222. data/lib/starter_web/pages/public/legal/de/100_impress.adoc +3 -2
  223. data/lib/starter_web/pages/public/legal/de/200_terms_of_use.adoc +2 -1
  224. data/lib/starter_web/pages/public/legal/de/300_privacy.adoc +2 -1
  225. data/lib/starter_web/pages/public/legal/de/400_license_agreement.adoc +2 -1
  226. data/lib/starter_web/pages/public/legal/de/500_support.adoc +2 -1
  227. data/lib/starter_web/pages/public/legal/en/000_copyright.adoc +30 -27
  228. data/lib/starter_web/pages/public/legal/en/100_impress.adoc +8 -5
  229. data/lib/starter_web/pages/public/legal/en/200_terms_of_use.adoc +12 -8
  230. data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +7 -0
  231. data/lib/starter_web/pages/public/legal/en/400_license_agreement.adoc +8 -1
  232. data/lib/starter_web/pages/public/legal/en/500_support.adoc +8 -1
  233. data/lib/starter_web/pages/public/previewer/bootstrap_theme.adoc +3 -1
  234. data/lib/starter_web/pages/public/previewer/iframer.adoc +36 -28
  235. data/lib/starter_web/pages/public/previewer/justified_gallery.html +2 -1
  236. data/lib/starter_web/pages/public/previewer/mdi_icons_preview.adoc +2 -1
  237. data/lib/starter_web/pages/public/previewer/rouge.adoc +4 -2
  238. data/lib/starter_web/pages/public/previewer/twitter_emoji_preview.adoc +2 -1
  239. data/lib/starter_web/pages/public/test_pages/breadcrumbs_tester.adoc +62 -0
  240. data/lib/starter_web/pages/public/test_pages/deck_of_posts.adoc +3 -0
  241. data/lib/starter_web/pages/public/test_pages/floating_actions_button.adoc +523 -0
  242. data/lib/starter_web/pages/public/test_pages/floating_ad.adoc +1 -0
  243. data/lib/starter_web/pages/public/test_pages/floating_div.adoc +1 -0
  244. data/lib/starter_web/pages/public/test_pages/lunr_tester.adoc +89 -0
  245. data/lib/starter_web/pages/public/test_pages/nav_pagination_tester.adoc +1 -0
  246. data/lib/starter_web/pages/public/test_pages/page_attribute_tester.adoc +1 -0
  247. data/lib/starter_web/pages/public/test_pages/responsive_images.adoc +3 -2
  248. data/lib/starter_web/pages/public/test_pages/responsive_tables.adoc +1 -0
  249. data/lib/starter_web/pages/public/test_pages/toccer_tester.adoc +2245 -0
  250. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  251. data/lib/starter_web/utilsrv/package.json +1 -1
  252. metadata +137 -29
  253. data/assets/data/search.json +0 -165
  254. data/assets/data/ssm.html +0 -242
  255. data/assets/themes/j1/adapter/js/back2top.js +0 -231
  256. data/assets/themes/j1/modules/jekyllSearch/js/simple-jekyll-search.js +0 -468
  257. data/assets/themes/j1/modules/jekyllSearch/js/simple-jekyll-search.min.js +0 -6
  258. data/assets/themes/j1/modules/tocbot/css/theme/uno.css +0 -95
  259. data/assets/themes/j1/modules/tocbot/css/theme/uno.min.css +0 -15
  260. data/assets/themes/j1/modules/tocbot/css/tocbot.css +0 -75
  261. data/assets/themes/j1/modules/tocbot/css/tocbot.min.css +0 -19
  262. data/assets/themes/j1/modules/tocbot/js/tocbot.js +0 -19
  263. data/assets/themes/j1/modules/tocbot/js/tocbot.min.js +0 -19
  264. data/lib/starter_web/_data/modules/defaults/back2top.yml +0 -146
  265. data/lib/starter_web/_data/modules/defaults/stickybits.yml +0 -36
  266. data/lib/starter_web/_data/modules/ssm.yml +0 -142
@@ -0,0 +1,93 @@
1
+ /*! URI.js v1.19.2 http://medialize.github.io/URI.js/ */
2
+ /* build contains: IPv6.js, punycode.js, SecondLevelDomains.js, URI.js, URITemplate.js */
3
+ (function(f,n){"object"===typeof module&&module.exports?module.exports=n():"function"===typeof define&&define.amd?define(n):f.IPv6=n(f)})(this,function(f){var n=f&&f.IPv6;return{best:function(h){h=h.toLowerCase().split(":");var k=h.length,b=8;""===h[0]&&""===h[1]&&""===h[2]?(h.shift(),h.shift()):""===h[0]&&""===h[1]?h.shift():""===h[k-1]&&""===h[k-2]&&h.pop();k=h.length;-1!==h[k-1].indexOf(".")&&(b=7);var q;for(q=0;q<k&&""!==h[q];q++);if(q<b)for(h.splice(q,1,"0000");h.length<b;)h.splice(q,0,"0000");
4
+ for(q=0;q<b;q++){k=h[q].split("");for(var f=0;3>f;f++)if("0"===k[0]&&1<k.length)k.splice(0,1);else break;h[q]=k.join("")}k=-1;var n=f=0,g=-1,p=!1;for(q=0;q<b;q++)p?"0"===h[q]?n+=1:(p=!1,n>f&&(k=g,f=n)):"0"===h[q]&&(p=!0,g=q,n=1);n>f&&(k=g,f=n);1<f&&h.splice(k,f,"");k=h.length;b="";""===h[0]&&(b=":");for(q=0;q<k;q++){b+=h[q];if(q===k-1)break;b+=":"}""===h[k-1]&&(b+=":");return b},noConflict:function(){f.IPv6===this&&(f.IPv6=n);return this}}});
5
+ (function(f){function n(b){throw new RangeError(w[b]);}function h(b,e){for(var g=b.length,h=[];g--;)h[g]=e(b[g]);return h}function k(b,e){var g=b.split("@"),f="";1<g.length&&(f=g[0]+"@",b=g[1]);b=b.replace(C,".");g=b.split(".");g=h(g,e).join(".");return f+g}function b(b){for(var e=[],g=0,h=b.length,f,a;g<h;)f=b.charCodeAt(g++),55296<=f&&56319>=f&&g<h?(a=b.charCodeAt(g++),56320==(a&64512)?e.push(((f&1023)<<10)+(a&1023)+65536):(e.push(f),g--)):e.push(f);return e}function q(b){return h(b,function(b){var e=
6
+ "";65535<b&&(b-=65536,e+=t(b>>>10&1023|55296),b=56320|b&1023);return e+=t(b)}).join("")}function z(b,e){return b+22+75*(26>b)-((0!=e)<<5)}function u(b,g,h){var f=0;b=h?e(b/700):b>>1;for(b+=e(b/g);455<b;f+=36)b=e(b/35);return e(f+36*b/(b+38))}function g(b){var g=[],h=b.length,f=0,k=128,a=72,c,d;var l=b.lastIndexOf("-");0>l&&(l=0);for(c=0;c<l;++c)128<=b.charCodeAt(c)&&n("not-basic"),g.push(b.charCodeAt(c));for(l=0<l?l+1:0;l<h;){c=f;var m=1;for(d=36;;d+=36){l>=h&&n("invalid-input");var x=b.charCodeAt(l++);
7
+ x=10>x-48?x-22:26>x-65?x-65:26>x-97?x-97:36;(36<=x||x>e((2147483647-f)/m))&&n("overflow");f+=x*m;var p=d<=a?1:d>=a+26?26:d-a;if(x<p)break;x=36-p;m>e(2147483647/x)&&n("overflow");m*=x}m=g.length+1;a=u(f-c,m,0==c);e(f/m)>2147483647-k&&n("overflow");k+=e(f/m);f%=m;g.splice(f++,0,k)}return q(g)}function p(g){var h,f,k,p=[];g=b(g);var a=g.length;var c=128;var d=0;var l=72;for(k=0;k<a;++k){var m=g[k];128>m&&p.push(t(m))}for((h=f=p.length)&&p.push("-");h<a;){var x=2147483647;for(k=0;k<a;++k)m=g[k],m>=c&&
8
+ m<x&&(x=m);var q=h+1;x-c>e((2147483647-d)/q)&&n("overflow");d+=(x-c)*q;c=x;for(k=0;k<a;++k)if(m=g[k],m<c&&2147483647<++d&&n("overflow"),m==c){var r=d;for(x=36;;x+=36){m=x<=l?1:x>=l+26?26:x-l;if(r<m)break;var A=r-m;r=36-m;p.push(t(z(m+A%r,0)));r=e(A/r)}p.push(t(z(r,0)));l=u(d,q,h==f);d=0;++h}++d;++c}return p.join("")}var D="object"==typeof exports&&exports&&!exports.nodeType&&exports,A="object"==typeof module&&module&&!module.nodeType&&module,B="object"==typeof global&&global;if(B.global===B||B.window===
9
+ B||B.self===B)f=B;var E=/^xn--/,r=/[^\x20-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},e=Math.floor,t=String.fromCharCode,y;var v={version:"1.3.2",ucs2:{decode:b,encode:q},decode:g,encode:p,toASCII:function(b){return k(b,function(b){return r.test(b)?"xn--"+p(b):b})},toUnicode:function(b){return k(b,function(b){return E.test(b)?g(b.slice(4).toLowerCase()):
10
+ b})}};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return v});else if(D&&A)if(module.exports==D)A.exports=v;else for(y in v)v.hasOwnProperty(y)&&(D[y]=v[y]);else f.punycode=v})(this);
11
+ (function(f,n){"object"===typeof module&&module.exports?module.exports=n():"function"===typeof define&&define.amd?define(n):f.SecondLevelDomains=n(f)})(this,function(f){var n=f&&f.SecondLevelDomains,h={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",
12
+ bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",
13
+ ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ","do":" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",
14
+ es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",
15
+ id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ","in":" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",
16
+ kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",
17
+ mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",
18
+ ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",
19
+ ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",
20
+ tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",
21
+ rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",
22
+ tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",
23
+ us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",
24
+ org:"ae",de:"com "},has:function(f){var b=f.lastIndexOf(".");if(0>=b||b>=f.length-1)return!1;var k=f.lastIndexOf(".",b-1);if(0>=k||k>=b-1)return!1;var n=h.list[f.slice(b+1)];return n?0<=n.indexOf(" "+f.slice(k+1,b)+" "):!1},is:function(f){var b=f.lastIndexOf(".");if(0>=b||b>=f.length-1||0<=f.lastIndexOf(".",b-1))return!1;var k=h.list[f.slice(b+1)];return k?0<=k.indexOf(" "+f.slice(0,b)+" "):!1},get:function(f){var b=f.lastIndexOf(".");if(0>=b||b>=f.length-1)return null;var k=f.lastIndexOf(".",b-1);
25
+ if(0>=k||k>=b-1)return null;var n=h.list[f.slice(b+1)];return!n||0>n.indexOf(" "+f.slice(k+1,b)+" ")?null:f.slice(k+1)},noConflict:function(){f.SecondLevelDomains===this&&(f.SecondLevelDomains=n);return this}};return h});
26
+ (function(f,n){"object"===typeof module&&module.exports?module.exports=n(require("./punycode"),require("./IPv6"),require("./SecondLevelDomains")):"function"===typeof define&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],n):f.URI=n(f.punycode,f.IPv6,f.SecondLevelDomains,f)})(this,function(f,n,h,k){function b(a,c){var d=1<=arguments.length,l=2<=arguments.length;if(!(this instanceof b))return d?l?new b(a,c):new b(a):new b;if(void 0===a){if(d)throw new TypeError("undefined is not a valid argument for URI");
27
+ a="undefined"!==typeof location?location.href+"":""}if(null===a&&d)throw new TypeError("null is not a valid argument for URI");this.href(a);return void 0!==c?this.absoluteTo(c):this}function q(a){return a.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function z(a){return void 0===a?"Undefined":String(Object.prototype.toString.call(a)).slice(8,-1)}function u(a){return"Array"===z(a)}function g(a,c){var d={},b;if("RegExp"===z(c))d=null;else if(u(c)){var m=0;for(b=c.length;m<b;m++)d[c[m]]=!0}else d[c]=
28
+ !0;m=0;for(b=a.length;m<b;m++)if(d&&void 0!==d[a[m]]||!d&&c.test(a[m]))a.splice(m,1),b--,m--;return a}function p(a,c){var d;if(u(c)){var b=0;for(d=c.length;b<d;b++)if(!p(a,c[b]))return!1;return!0}var m=z(c);b=0;for(d=a.length;b<d;b++)if("RegExp"===m){if("string"===typeof a[b]&&a[b].match(c))return!0}else if(a[b]===c)return!0;return!1}function D(a,c){if(!u(a)||!u(c)||a.length!==c.length)return!1;a.sort();c.sort();for(var d=0,b=a.length;d<b;d++)if(a[d]!==c[d])return!1;return!0}function A(a){return a.replace(/^\/+|\/+$/g,
29
+ "")}function B(a){return escape(a)}function E(a){return encodeURIComponent(a).replace(/[!'()*]/g,B).replace(/\*/g,"%2A")}function r(a){return function(c,d){if(void 0===c)return this._parts[a]||"";this._parts[a]=c||null;this.build(!d);return this}}function C(a,c){return function(d,b){if(void 0===d)return this._parts[a]||"";null!==d&&(d+="",d.charAt(0)===c&&(d=d.substring(1)));this._parts[a]=d;this.build(!b);return this}}var w=k&&k.URI;b.version="1.19.2";var e=b.prototype,t=Object.prototype.hasOwnProperty;
30
+ b._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:b.preventInvalidHostname,duplicateQueryParameters:b.duplicateQueryParameters,escapeQuerySpace:b.escapeQuerySpace}};b.preventInvalidHostname=!1;b.duplicateQueryParameters=!1;b.escapeQuerySpace=!0;b.protocol_expression=/^[a-z][a-z0-9.+-]*$/i;b.idn_expression=/[^a-z0-9\._-]/i;b.punycode_expression=/(xn--)/i;b.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
31
+ b.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;
32
+ b.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u2018\u2019]))/ig;b.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u201e\u2018\u2019]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g};b.defaultPorts={http:"80",https:"443",ftp:"21",
33
+ gopher:"70",ws:"80",wss:"443"};b.hostProtocols=["http","https"];b.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/;b.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"};b.getDomAttribute=function(a){if(a&&a.nodeName){var c=a.nodeName.toLowerCase();if("input"!==c||"image"===a.type)return b.domAttributes[c]}};b.encode=E;b.decode=decodeURIComponent;b.iso8859=
34
+ function(){b.encode=escape;b.decode=unescape};b.unicode=function(){b.encode=E;b.decode=decodeURIComponent};b.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@",
35
+ "%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}};b.encodeQuery=function(a,c){var d=b.encode(a+"");void 0===c&&(c=b.escapeQuerySpace);return c?d.replace(/%20/g,"+"):d};b.decodeQuery=
36
+ function(a,c){a+="";void 0===c&&(c=b.escapeQuerySpace);try{return b.decode(c?a.replace(/\+/g,"%20"):a)}catch(d){return a}};var y={encode:"encode",decode:"decode"},v,F=function(a,c){return function(d){try{return b[c](d+"").replace(b.characters[a][c].expression,function(d){return b.characters[a][c].map[d]})}catch(l){return d}}};for(v in y)b[v+"PathSegment"]=F("pathname",y[v]),b[v+"UrnPathSegment"]=F("urnpath",y[v]);y=function(a,c,d){return function(l){var m=d?function(a){return b[c](b[d](a))}:b[c];
37
+ l=(l+"").split(a);for(var e=0,g=l.length;e<g;e++)l[e]=m(l[e]);return l.join(a)}};b.decodePath=y("/","decodePathSegment");b.decodeUrnPath=y(":","decodeUrnPathSegment");b.recodePath=y("/","encodePathSegment","decode");b.recodeUrnPath=y(":","encodeUrnPathSegment","decode");b.encodeReserved=F("reserved","encode");b.parse=function(a,c){c||(c={preventInvalidHostname:b.preventInvalidHostname});var d=a.indexOf("#");-1<d&&(c.fragment=a.substring(d+1)||null,a=a.substring(0,d));d=a.indexOf("?");-1<d&&(c.query=
38
+ a.substring(d+1)||null,a=a.substring(0,d));"//"===a.substring(0,2)?(c.protocol=null,a=a.substring(2),a=b.parseAuthority(a,c)):(d=a.indexOf(":"),-1<d&&(c.protocol=a.substring(0,d)||null,c.protocol&&!c.protocol.match(b.protocol_expression)?c.protocol=void 0:"//"===a.substring(d+1,d+3)?(a=a.substring(d+3),a=b.parseAuthority(a,c)):(a=a.substring(d+1),c.urn=!0)));c.path=a;return c};b.parseHost=function(a,c){a||(a="");a=a.replace(/\\/g,"/");var d=a.indexOf("/");-1===d&&(d=a.length);if("["===a.charAt(0)){var l=
39
+ a.indexOf("]");c.hostname=a.substring(1,l)||null;c.port=a.substring(l+2,d)||null;"/"===c.port&&(c.port=null)}else{var m=a.indexOf(":");l=a.indexOf("/");m=a.indexOf(":",m+1);-1!==m&&(-1===l||m<l)?(c.hostname=a.substring(0,d)||null,c.port=null):(l=a.substring(0,d).split(":"),c.hostname=l[0]||null,c.port=l[1]||null)}c.hostname&&"/"!==a.substring(d).charAt(0)&&(d++,a="/"+a);c.preventInvalidHostname&&b.ensureValidHostname(c.hostname,c.protocol);c.port&&b.ensureValidPort(c.port);return a.substring(d)||
40
+ "/"};b.parseAuthority=function(a,c){a=b.parseUserinfo(a,c);return b.parseHost(a,c)};b.parseUserinfo=function(a,c){var d=a.indexOf("/"),l=a.lastIndexOf("@",-1<d?d:a.length-1);-1<l&&(-1===d||l<d)?(d=a.substring(0,l).split(":"),c.username=d[0]?b.decode(d[0]):null,d.shift(),c.password=d[0]?b.decode(d.join(":")):null,a=a.substring(l+1)):(c.username=null,c.password=null);return a};b.parseQuery=function(a,c){if(!a)return{};a=a.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"");if(!a)return{};for(var d={},l=a.split("&"),
41
+ m=l.length,e,g,f=0;f<m;f++)if(e=l[f].split("="),g=b.decodeQuery(e.shift(),c),e=e.length?b.decodeQuery(e.join("="),c):null,t.call(d,g)){if("string"===typeof d[g]||null===d[g])d[g]=[d[g]];d[g].push(e)}else d[g]=e;return d};b.build=function(a){var c="",d=!1;a.protocol&&(c+=a.protocol+":");a.urn||!c&&!a.hostname||(c+="//",d=!0);c+=b.buildAuthority(a)||"";"string"===typeof a.path&&("/"!==a.path.charAt(0)&&d&&(c+="/"),c+=a.path);"string"===typeof a.query&&a.query&&(c+="?"+a.query);"string"===typeof a.fragment&&
42
+ a.fragment&&(c+="#"+a.fragment);return c};b.buildHost=function(a){var c="";if(a.hostname)c=b.ip6_expression.test(a.hostname)?c+("["+a.hostname+"]"):c+a.hostname;else return"";a.port&&(c+=":"+a.port);return c};b.buildAuthority=function(a){return b.buildUserinfo(a)+b.buildHost(a)};b.buildUserinfo=function(a){var c="";a.username&&(c+=b.encode(a.username));a.password&&(c+=":"+b.encode(a.password));c&&(c+="@");return c};b.buildQuery=function(a,c,d){var l="",m,e;for(m in a)if(t.call(a,m))if(u(a[m])){var g=
43
+ {};var f=0;for(e=a[m].length;f<e;f++)void 0!==a[m][f]&&void 0===g[a[m][f]+""]&&(l+="&"+b.buildQueryParameter(m,a[m][f],d),!0!==c&&(g[a[m][f]+""]=!0))}else void 0!==a[m]&&(l+="&"+b.buildQueryParameter(m,a[m],d));return l.substring(1)};b.buildQueryParameter=function(a,c,d){return b.encodeQuery(a,d)+(null!==c?"="+b.encodeQuery(c,d):"")};b.addQuery=function(a,c,d){if("object"===typeof c)for(var l in c)t.call(c,l)&&b.addQuery(a,l,c[l]);else if("string"===typeof c)void 0===a[c]?a[c]=d:("string"===typeof a[c]&&
44
+ (a[c]=[a[c]]),u(d)||(d=[d]),a[c]=(a[c]||[]).concat(d));else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");};b.setQuery=function(a,c,d){if("object"===typeof c)for(var l in c)t.call(c,l)&&b.setQuery(a,l,c[l]);else if("string"===typeof c)a[c]=void 0===d?null:d;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");};b.removeQuery=function(a,c,d){var l;if(u(c))for(d=0,l=c.length;d<l;d++)a[c[d]]=void 0;else if("RegExp"===z(c))for(l in a)c.test(l)&&
45
+ (a[l]=void 0);else if("object"===typeof c)for(l in c)t.call(c,l)&&b.removeQuery(a,l,c[l]);else if("string"===typeof c)void 0!==d?"RegExp"===z(d)?!u(a[c])&&d.test(a[c])?a[c]=void 0:a[c]=g(a[c],d):a[c]!==String(d)||u(d)&&1!==d.length?u(a[c])&&(a[c]=g(a[c],d)):a[c]=void 0:a[c]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");};b.hasQuery=function(a,c,d,l){switch(z(c)){case "String":break;case "RegExp":for(var m in a)if(t.call(a,m)&&c.test(m)&&
46
+ (void 0===d||b.hasQuery(a,m,d)))return!0;return!1;case "Object":for(var e in c)if(t.call(c,e)&&!b.hasQuery(a,e,c[e]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter");}switch(z(d)){case "Undefined":return c in a;case "Boolean":return a=!(u(a[c])?!a[c].length:!a[c]),d===a;case "Function":return!!d(a[c],c,a);case "Array":return u(a[c])?(l?p:D)(a[c],d):!1;case "RegExp":return u(a[c])?l?p(a[c],d):!1:!(!a[c]||!a[c].match(d));
47
+ case "Number":d=String(d);case "String":return u(a[c])?l?p(a[c],d):!1:a[c]===d;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter");}};b.joinPaths=function(){for(var a=[],c=[],d=0,l=0;l<arguments.length;l++){var m=new b(arguments[l]);a.push(m);m=m.segment();for(var e=0;e<m.length;e++)"string"===typeof m[e]&&c.push(m[e]),m[e]&&d++}if(!c.length||!d)return new b("");c=(new b("")).segment(c);""!==a[0].path()&&"/"!==a[0].path().slice(0,
48
+ 1)||c.path("/"+c.path());return c.normalize()};b.commonPath=function(a,c){var d=Math.min(a.length,c.length),b;for(b=0;b<d;b++)if(a.charAt(b)!==c.charAt(b)){b--;break}if(1>b)return a.charAt(0)===c.charAt(0)&&"/"===a.charAt(0)?"/":"";if("/"!==a.charAt(b)||"/"!==c.charAt(b))b=a.substring(0,b).lastIndexOf("/");return a.substring(0,b+1)};b.withinString=function(a,c,d){d||(d={});var l=d.start||b.findUri.start,e=d.end||b.findUri.end,g=d.trim||b.findUri.trim,f=d.parens||b.findUri.parens,h=/[a-z0-9-]=["']?$/i;
49
+ for(l.lastIndex=0;;){var k=l.exec(a);if(!k)break;var p=k.index;if(d.ignoreHtml){var n=a.slice(Math.max(p-3,0),p);if(n&&h.test(n))continue}var r=p+a.slice(p).search(e);n=a.slice(p,r);for(r=-1;;){var q=f.exec(n);if(!q)break;r=Math.max(r,q.index+q[0].length)}n=-1<r?n.slice(0,r)+n.slice(r).replace(g,""):n.replace(g,"");n.length<=k[0].length||d.ignore&&d.ignore.test(n)||(r=p+n.length,k=c(n,p,r,a),void 0===k?l.lastIndex=r:(k=String(k),a=a.slice(0,p)+k+a.slice(r),l.lastIndex=p+k.length))}l.lastIndex=0;return a};
50
+ b.ensureValidHostname=function(a,c){var d=!!a,l=!1;c&&(l=p(b.hostProtocols,c));if(l&&!d)throw new TypeError("Hostname cannot be empty, if protocol is "+c);if(a&&a.match(b.invalid_hostname_characters)){if(!f)throw new TypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(f.toASCII(a).match(b.invalid_hostname_characters))throw new TypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-:_]');}};b.ensureValidPort=function(a){if(a){var c=
51
+ Number(a);if(!(/^[0-9]+$/.test(c)&&0<c&&65536>c))throw new TypeError('Port "'+a+'" is not a valid port');}};b.noConflict=function(a){if(a)return a={URI:this.noConflict()},k.URITemplate&&"function"===typeof k.URITemplate.noConflict&&(a.URITemplate=k.URITemplate.noConflict()),k.IPv6&&"function"===typeof k.IPv6.noConflict&&(a.IPv6=k.IPv6.noConflict()),k.SecondLevelDomains&&"function"===typeof k.SecondLevelDomains.noConflict&&(a.SecondLevelDomains=k.SecondLevelDomains.noConflict()),a;k.URI===this&&(k.URI=
52
+ w);return this};e.build=function(a){if(!0===a)this._deferred_build=!0;else if(void 0===a||this._deferred_build)this._string=b.build(this._parts),this._deferred_build=!1;return this};e.clone=function(){return new b(this)};e.valueOf=e.toString=function(){return this.build(!1)._string};e.protocol=r("protocol");e.username=r("username");e.password=r("password");e.hostname=r("hostname");e.port=r("port");e.query=C("query","?");e.fragment=C("fragment","#");e.search=function(a,c){var b=this.query(a,c);return"string"===
53
+ typeof b&&b.length?"?"+b:b};e.hash=function(a,c){var b=this.fragment(a,c);return"string"===typeof b&&b.length?"#"+b:b};e.pathname=function(a,c){if(void 0===a||!0===a){var d=this._parts.path||(this._parts.hostname?"/":"");return a?(this._parts.urn?b.decodeUrnPath:b.decodePath)(d):d}this._parts.path=this._parts.urn?a?b.recodeUrnPath(a):"":a?b.recodePath(a):"/";this.build(!c);return this};e.path=e.pathname;e.href=function(a,c){var d;if(void 0===a)return this.toString();this._string="";this._parts=b._parts();
54
+ var l=a instanceof b,e="object"===typeof a&&(a.hostname||a.path||a.pathname);a.nodeName&&(e=b.getDomAttribute(a),a=a[e]||"",e=!1);!l&&e&&void 0!==a.pathname&&(a=a.toString());if("string"===typeof a||a instanceof String)this._parts=b.parse(String(a),this._parts);else if(l||e){l=l?a._parts:a;for(d in l)"query"!==d&&t.call(this._parts,d)&&(this._parts[d]=l[d]);l.query&&this.query(l.query,!1)}else throw new TypeError("invalid input");this.build(!c);return this};e.is=function(a){var c=!1,d=!1,e=!1,m=!1,
55
+ g=!1,f=!1,k=!1,p=!this._parts.urn;this._parts.hostname&&(p=!1,d=b.ip4_expression.test(this._parts.hostname),e=b.ip6_expression.test(this._parts.hostname),c=d||e,g=(m=!c)&&h&&h.has(this._parts.hostname),f=m&&b.idn_expression.test(this._parts.hostname),k=m&&b.punycode_expression.test(this._parts.hostname));switch(a.toLowerCase()){case "relative":return p;case "absolute":return!p;case "domain":case "name":return m;case "sld":return g;case "ip":return c;case "ip4":case "ipv4":case "inet4":return d;case "ip6":case "ipv6":case "inet6":return e;
56
+ case "idn":return f;case "url":return!this._parts.urn;case "urn":return!!this._parts.urn;case "punycode":return k}return null};var G=e.protocol,H=e.port,I=e.hostname;e.protocol=function(a,c){if(a&&(a=a.replace(/:(\/\/)?$/,""),!a.match(b.protocol_expression)))throw new TypeError('Protocol "'+a+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return G.call(this,a,c)};e.scheme=e.protocol;e.port=function(a,c){if(this._parts.urn)return void 0===a?"":this;void 0!==a&&(0===a&&
57
+ (a=null),a&&(a+="",":"===a.charAt(0)&&(a=a.substring(1)),b.ensureValidPort(a)));return H.call(this,a,c)};e.hostname=function(a,c){if(this._parts.urn)return void 0===a?"":this;if(void 0!==a){var d={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==b.parseHost(a,d))throw new TypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-]');a=d.hostname;this._parts.preventInvalidHostname&&b.ensureValidHostname(a,this._parts.protocol)}return I.call(this,a,c)};e.origin=function(a,
58
+ c){if(this._parts.urn)return void 0===a?"":this;if(void 0===a){var d=this.protocol();return this.authority()?(d?d+"://":"")+this.authority():""}d=b(a);this.protocol(d.protocol()).authority(d.authority()).build(!c);return this};e.host=function(a,c){if(this._parts.urn)return void 0===a?"":this;if(void 0===a)return this._parts.hostname?b.buildHost(this._parts):"";if("/"!==b.parseHost(a,this._parts))throw new TypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-]');this.build(!c);return this};
59
+ e.authority=function(a,c){if(this._parts.urn)return void 0===a?"":this;if(void 0===a)return this._parts.hostname?b.buildAuthority(this._parts):"";if("/"!==b.parseAuthority(a,this._parts))throw new TypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-]');this.build(!c);return this};e.userinfo=function(a,c){if(this._parts.urn)return void 0===a?"":this;if(void 0===a){var d=b.buildUserinfo(this._parts);return d?d.substring(0,d.length-1):d}"@"!==a[a.length-1]&&(a+="@");b.parseUserinfo(a,
60
+ this._parts);this.build(!c);return this};e.resource=function(a,c){if(void 0===a)return this.path()+this.search()+this.hash();var d=b.parse(a);this._parts.path=d.path;this._parts.query=d.query;this._parts.fragment=d.fragment;this.build(!c);return this};e.subdomain=function(a,c){if(this._parts.urn)return void 0===a?"":this;if(void 0===a){if(!this._parts.hostname||this.is("IP"))return"";var d=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,d)||""}d=this._parts.hostname.length-
61
+ this.domain().length;d=this._parts.hostname.substring(0,d);d=new RegExp("^"+q(d));a&&"."!==a.charAt(a.length-1)&&(a+=".");if(-1!==a.indexOf(":"))throw new TypeError("Domains cannot contain colons");a&&b.ensureValidHostname(a,this._parts.protocol);this._parts.hostname=this._parts.hostname.replace(d,a);this.build(!c);return this};e.domain=function(a,c){if(this._parts.urn)return void 0===a?"":this;"boolean"===typeof a&&(c=a,a=void 0);if(void 0===a){if(!this._parts.hostname||this.is("IP"))return"";var d=
62
+ this._parts.hostname.match(/\./g);if(d&&2>d.length)return this._parts.hostname;d=this._parts.hostname.length-this.tld(c).length-1;d=this._parts.hostname.lastIndexOf(".",d-1)+1;return this._parts.hostname.substring(d)||""}if(!a)throw new TypeError("cannot set domain empty");if(-1!==a.indexOf(":"))throw new TypeError("Domains cannot contain colons");b.ensureValidHostname(a,this._parts.protocol);!this._parts.hostname||this.is("IP")?this._parts.hostname=a:(d=new RegExp(q(this.domain())+"$"),this._parts.hostname=
63
+ this._parts.hostname.replace(d,a));this.build(!c);return this};e.tld=function(a,c){if(this._parts.urn)return void 0===a?"":this;"boolean"===typeof a&&(c=a,a=void 0);if(void 0===a){if(!this._parts.hostname||this.is("IP"))return"";var b=this._parts.hostname.lastIndexOf(".");b=this._parts.hostname.substring(b+1);return!0!==c&&h&&h.list[b.toLowerCase()]?h.get(this._parts.hostname)||b:b}if(a)if(a.match(/[^a-zA-Z0-9-]/))if(h&&h.is(a))b=new RegExp(q(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(b,
64
+ a);else throw new TypeError('TLD "'+a+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");b=new RegExp(q(this.tld())+"$");this._parts.hostname=this._parts.hostname.replace(b,a)}else throw new TypeError("cannot set TLD empty");this.build(!c);return this};e.directory=function(a,c){if(this._parts.urn)return void 0===a?"":this;if(void 0===a||!0===a){if(!this._parts.path&&!this._parts.hostname)return"";
65
+ if("/"===this._parts.path)return"/";var d=this._parts.path.length-this.filename().length-1;d=this._parts.path.substring(0,d)||(this._parts.hostname?"/":"");return a?b.decodePath(d):d}d=this._parts.path.length-this.filename().length;d=this._parts.path.substring(0,d);d=new RegExp("^"+q(d));this.is("relative")||(a||(a="/"),"/"!==a.charAt(0)&&(a="/"+a));a&&"/"!==a.charAt(a.length-1)&&(a+="/");a=b.recodePath(a);this._parts.path=this._parts.path.replace(d,a);this.build(!c);return this};e.filename=function(a,
66
+ c){if(this._parts.urn)return void 0===a?"":this;if("string"!==typeof a){if(!this._parts.path||"/"===this._parts.path)return"";var d=this._parts.path.lastIndexOf("/");d=this._parts.path.substring(d+1);return a?b.decodePathSegment(d):d}d=!1;"/"===a.charAt(0)&&(a=a.substring(1));a.match(/\.?\//)&&(d=!0);var e=new RegExp(q(this.filename())+"$");a=b.recodePath(a);this._parts.path=this._parts.path.replace(e,a);d?this.normalizePath(c):this.build(!c);return this};e.suffix=function(a,c){if(this._parts.urn)return void 0===
67
+ a?"":this;if(void 0===a||!0===a){if(!this._parts.path||"/"===this._parts.path)return"";var d=this.filename(),e=d.lastIndexOf(".");if(-1===e)return"";d=d.substring(e+1);d=/^[a-z0-9%]+$/i.test(d)?d:"";return a?b.decodePathSegment(d):d}"."===a.charAt(0)&&(a=a.substring(1));if(d=this.suffix())e=a?new RegExp(q(d)+"$"):new RegExp(q("."+d)+"$");else{if(!a)return this;this._parts.path+="."+b.recodePath(a)}e&&(a=b.recodePath(a),this._parts.path=this._parts.path.replace(e,a));this.build(!c);return this};e.segment=
68
+ function(a,c,b){var d=this._parts.urn?":":"/",e=this.path(),g="/"===e.substring(0,1);e=e.split(d);void 0!==a&&"number"!==typeof a&&(b=c,c=a,a=void 0);if(void 0!==a&&"number"!==typeof a)throw Error('Bad segment "'+a+'", must be 0-based integer');g&&e.shift();0>a&&(a=Math.max(e.length+a,0));if(void 0===c)return void 0===a?e:e[a];if(null===a||void 0===e[a])if(u(c)){e=[];a=0;for(var f=c.length;a<f;a++)if(c[a].length||e.length&&e[e.length-1].length)e.length&&!e[e.length-1].length&&e.pop(),e.push(A(c[a]))}else{if(c||
69
+ "string"===typeof c)c=A(c),""===e[e.length-1]?e[e.length-1]=c:e.push(c)}else c?e[a]=A(c):e.splice(a,1);g&&e.unshift("");return this.path(e.join(d),b)};e.segmentCoded=function(a,c,d){var e;"number"!==typeof a&&(d=c,c=a,a=void 0);if(void 0===c){a=this.segment(a,c,d);if(u(a)){var g=0;for(e=a.length;g<e;g++)a[g]=b.decode(a[g])}else a=void 0!==a?b.decode(a):void 0;return a}if(u(c))for(g=0,e=c.length;g<e;g++)c[g]=b.encode(c[g]);else c="string"===typeof c||c instanceof String?b.encode(c):c;return this.segment(a,
70
+ c,d)};var J=e.query;e.query=function(a,c){if(!0===a)return b.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"===typeof a){var d=b.parseQuery(this._parts.query,this._parts.escapeQuerySpace),e=a.call(this,d);this._parts.query=b.buildQuery(e||d,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);this.build(!c);return this}return void 0!==a&&"string"!==typeof a?(this._parts.query=b.buildQuery(a,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!c),
71
+ this):J.call(this,a,c)};e.setQuery=function(a,c,d){var e=b.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"===typeof a||a instanceof String)e[a]=void 0!==c?c:null;else if("object"===typeof a)for(var g in a)t.call(a,g)&&(e[g]=a[g]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");this._parts.query=b.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);"string"!==typeof a&&(d=c);this.build(!d);return this};e.addQuery=
72
+ function(a,c,d){var e=b.parseQuery(this._parts.query,this._parts.escapeQuerySpace);b.addQuery(e,a,void 0===c?null:c);this._parts.query=b.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);"string"!==typeof a&&(d=c);this.build(!d);return this};e.removeQuery=function(a,c,d){var e=b.parseQuery(this._parts.query,this._parts.escapeQuerySpace);b.removeQuery(e,a,c);this._parts.query=b.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);"string"!==
73
+ typeof a&&(d=c);this.build(!d);return this};e.hasQuery=function(a,c,d){var e=b.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return b.hasQuery(e,a,c,d)};e.setSearch=e.setQuery;e.addSearch=e.addQuery;e.removeSearch=e.removeQuery;e.hasSearch=e.hasQuery;e.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()};
74
+ e.normalizeProtocol=function(a){"string"===typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!a));return this};e.normalizeHostname=function(a){this._parts.hostname&&(this.is("IDN")&&f?this._parts.hostname=f.toASCII(this._parts.hostname):this.is("IPv6")&&n&&(this._parts.hostname=n.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!a));return this};e.normalizePort=function(a){"string"===typeof this._parts.protocol&&
75
+ this._parts.port===b.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!a));return this};e.normalizePath=function(a){var c=this._parts.path;if(!c)return this;if(this._parts.urn)return this._parts.path=b.recodeUrnPath(this._parts.path),this.build(!a),this;if("/"===this._parts.path)return this;c=b.recodePath(c);var d="";if("/"!==c.charAt(0)){var e=!0;c="/"+c}if("/.."===c.slice(-3)||"/."===c.slice(-2))c+="/";c=c.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/");e&&(d=c.substring(1).match(/^(\.\.\/)+/)||
76
+ "")&&(d=d[0]);for(;;){var g=c.search(/\/\.\.(\/|$)/);if(-1===g)break;else if(0===g){c=c.substring(3);continue}var f=c.substring(0,g).lastIndexOf("/");-1===f&&(f=g);c=c.substring(0,f)+c.substring(g+3)}e&&this.is("relative")&&(c=d+c.substring(1));this._parts.path=c;this.build(!a);return this};e.normalizePathname=e.normalizePath;e.normalizeQuery=function(a){"string"===typeof this._parts.query&&(this._parts.query.length?this.query(b.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=
77
+ null,this.build(!a));return this};e.normalizeFragment=function(a){this._parts.fragment||(this._parts.fragment=null,this.build(!a));return this};e.normalizeSearch=e.normalizeQuery;e.normalizeHash=e.normalizeFragment;e.iso8859=function(){var a=b.encode,c=b.decode;b.encode=escape;b.decode=decodeURIComponent;try{this.normalize()}finally{b.encode=a,b.decode=c}return this};e.unicode=function(){var a=b.encode,c=b.decode;b.encode=E;b.decode=unescape;try{this.normalize()}finally{b.encode=a,b.decode=c}return this};
78
+ e.readable=function(){var a=this.clone();a.username("").password("").normalize();var c="";a._parts.protocol&&(c+=a._parts.protocol+"://");a._parts.hostname&&(a.is("punycode")&&f?(c+=f.toUnicode(a._parts.hostname),a._parts.port&&(c+=":"+a._parts.port)):c+=a.host());a._parts.hostname&&a._parts.path&&"/"!==a._parts.path.charAt(0)&&(c+="/");c+=a.path(!0);if(a._parts.query){for(var d="",e=0,g=a._parts.query.split("&"),h=g.length;e<h;e++){var k=(g[e]||"").split("=");d+="&"+b.decodeQuery(k[0],this._parts.escapeQuerySpace).replace(/&/g,
79
+ "%26");void 0!==k[1]&&(d+="="+b.decodeQuery(k[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}c+="?"+d.substring(1)}return c+=b.decodeQuery(a.hash(),!0)};e.absoluteTo=function(a){var c=this.clone(),d=["protocol","username","password","hostname","port"],e,g;if(this._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");a instanceof b||(a=new b(a));if(c._parts.protocol)return c;c._parts.protocol=a._parts.protocol;if(this._parts.hostname)return c;for(e=0;g=d[e];e++)c._parts[g]=
80
+ a._parts[g];c._parts.path?(".."===c._parts.path.substring(-2)&&(c._parts.path+="/"),"/"!==c.path().charAt(0)&&(d=(d=a.directory())?d:0===a.path().indexOf("/")?"/":"",c._parts.path=(d?d+"/":"")+c._parts.path,c.normalizePath())):(c._parts.path=a._parts.path,c._parts.query||(c._parts.query=a._parts.query));c.build();return c};e.relativeTo=function(a){var c=this.clone().normalize();if(c._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");a=(new b(a)).normalize();var d=
81
+ c._parts;var e=a._parts;var g=c.path();a=a.path();if("/"!==g.charAt(0))throw Error("URI is already relative");if("/"!==a.charAt(0))throw Error("Cannot calculate a URI relative to another relative URI");d.protocol===e.protocol&&(d.protocol=null);if(d.username===e.username&&d.password===e.password&&null===d.protocol&&null===d.username&&null===d.password&&d.hostname===e.hostname&&d.port===e.port)d.hostname=null,d.port=null;else return c.build();if(g===a)return d.path="",c.build();g=b.commonPath(g,a);
82
+ if(!g)return c.build();e=e.path.substring(g.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");d.path=e+d.path.substring(g.length)||"./";return c.build()};e.equals=function(a){var c=this.clone(),d=new b(a);a={};var e;c.normalize();d.normalize();if(c.toString()===d.toString())return!0;var g=c.query();var f=d.query();c.query("");d.query("");if(c.toString()!==d.toString()||g.length!==f.length)return!1;c=b.parseQuery(g,this._parts.escapeQuerySpace);f=b.parseQuery(f,this._parts.escapeQuerySpace);for(e in c)if(t.call(c,
83
+ e)){if(!u(c[e])){if(c[e]!==f[e])return!1}else if(!D(c[e],f[e]))return!1;a[e]=!0}for(e in f)if(t.call(f,e)&&!a[e])return!1;return!0};e.preventInvalidHostname=function(a){this._parts.preventInvalidHostname=!!a;return this};e.duplicateQueryParameters=function(a){this._parts.duplicateQueryParameters=!!a;return this};e.escapeQuerySpace=function(a){this._parts.escapeQuerySpace=!!a;return this};return b});
84
+ (function(f,n){"object"===typeof module&&module.exports?module.exports=n(require("./URI")):"function"===typeof define&&define.amd?define(["./URI"],n):f.URITemplate=n(f.URI,f)})(this,function(f,n){function h(b){if(h._cache[b])return h._cache[b];if(!(this instanceof h))return new h(b);this.expression=b;h._cache[b]=this;return this}function k(b){this.data=b;this.cache={}}var b=n&&n.URITemplate,q=Object.prototype.hasOwnProperty,z=h.prototype,u={"":{prefix:"",separator:",",named:!1,empty_name_separator:!1,
85
+ encode:"encode"},"+":{prefix:"",separator:",",named:!1,empty_name_separator:!1,encode:"encodeReserved"},"#":{prefix:"#",separator:",",named:!1,empty_name_separator:!1,encode:"encodeReserved"},".":{prefix:".",separator:".",named:!1,empty_name_separator:!1,encode:"encode"},"/":{prefix:"/",separator:"/",named:!1,empty_name_separator:!1,encode:"encode"},";":{prefix:";",separator:";",named:!0,empty_name_separator:!1,encode:"encode"},"?":{prefix:"?",separator:"&",named:!0,empty_name_separator:!0,encode:"encode"},
86
+ "&":{prefix:"&",separator:"&",named:!0,empty_name_separator:!0,encode:"encode"}};h._cache={};h.EXPRESSION_PATTERN=/\{([^a-zA-Z0-9%_]?)([^\}]+)(\}|$)/g;h.VARIABLE_PATTERN=/^([^*:.](?:\.?[^*:.])*)((\*)|:(\d+))?$/;h.VARIABLE_NAME_PATTERN=/[^a-zA-Z0-9%_.]/;h.LITERAL_PATTERN=/[<>{}"`^| \\]/;h.expand=function(b,f,k){var g=u[b.operator],p=g.named?"Named":"Unnamed";b=b.variables;var n=[],r,q;for(q=0;r=b[q];q++){var w=f.get(r.name);if(0===w.type&&k&&k.strict)throw Error('Missing expansion value for variable "'+
87
+ r.name+'"');if(w.val.length){if(1<w.type&&r.maxlength)throw Error('Invalid expression: Prefix modifier not applicable to variable "'+r.name+'"');n.push(h["expand"+p](w,g,r.explode,r.explode&&g.separator||",",r.maxlength,r.name))}else w.type&&n.push("")}return n.length?g.prefix+n.join(g.separator):""};h.expandNamed=function(b,h,k,n,q,u){var g="",p=h.encode;h=h.empty_name_separator;var A=!b[p].length,e=2===b.type?"":f[p](u),t;var y=0;for(t=b.val.length;y<t;y++){if(q){var v=f[p](b.val[y][1].substring(0,
88
+ q));2===b.type&&(e=f[p](b.val[y][0].substring(0,q)))}else A?(v=f[p](b.val[y][1]),2===b.type?(e=f[p](b.val[y][0]),b[p].push([e,v])):b[p].push([void 0,v])):(v=b[p][y][1],2===b.type&&(e=b[p][y][0]));g&&(g+=n);k?g+=e+(h||v?"=":"")+v:(y||(g+=f[p](u)+(h||v?"=":"")),2===b.type&&(g+=e+","),g+=v)}return g};h.expandUnnamed=function(b,h,k,n,q){var g="",p=h.encode;h=h.empty_name_separator;var A=!b[p].length,w;var e=0;for(w=b.val.length;e<w;e++){if(q)var t=f[p](b.val[e][1].substring(0,q));else A?(t=f[p](b.val[e][1]),
89
+ b[p].push([2===b.type?f[p](b.val[e][0]):void 0,t])):t=b[p][e][1];g&&(g+=n);if(2===b.type){var u=q?f[p](b.val[e][0].substring(0,q)):b[p][e][0];g+=u;g=k?g+(h||t?"=":""):g+","}g+=t}return g};h.noConflict=function(){n.URITemplate===h&&(n.URITemplate=b);return h};z.expand=function(b,f){var g="";this.parts&&this.parts.length||this.parse();b instanceof k||(b=new k(b));for(var p=0,n=this.parts.length;p<n;p++)g+="string"===typeof this.parts[p]?this.parts[p]:h.expand(this.parts[p],b,f);return g};z.parse=function(){var b=
90
+ this.expression,f=h.EXPRESSION_PATTERN,k=h.VARIABLE_PATTERN,n=h.VARIABLE_NAME_PATTERN,q=h.LITERAL_PATTERN,z=[],r=0,C=function(b){if(b.match(q))throw Error('Invalid Literal "'+b+'"');return b};for(f.lastIndex=0;;){var w=f.exec(b);if(null===w){z.push(C(b.substring(r)));break}else z.push(C(b.substring(r,w.index))),r=w.index+w[0].length;if(!u[w[1]])throw Error('Unknown Operator "'+w[1]+'" in "'+w[0]+'"');if(!w[3])throw Error('Unclosed Expression "'+w[0]+'"');var e=w[2].split(",");for(var t=0,y=e.length;t<
91
+ y;t++){var v=e[t].match(k);if(null===v)throw Error('Invalid Variable "'+e[t]+'" in "'+w[0]+'"');if(v[1].match(n))throw Error('Invalid Variable Name "'+v[1]+'" in "'+w[0]+'"');e[t]={name:v[1],explode:!!v[3],maxlength:v[4]&&parseInt(v[4],10)}}if(!e.length)throw Error('Expression Missing Variable(s) "'+w[0]+'"');z.push({expression:w[0],operator:w[1],variables:e})}z.length||z.push(C(b));this.parts=z;return this};k.prototype.get=function(b){var f=this.data,g={type:0,val:[],encode:[],encodeReserved:[]};
92
+ if(void 0!==this.cache[b])return this.cache[b];this.cache[b]=g;f="[object Function]"===String(Object.prototype.toString.call(f))?f(b):"[object Function]"===String(Object.prototype.toString.call(f[b]))?f[b](b):f[b];if(void 0!==f&&null!==f)if("[object Array]"===String(Object.prototype.toString.call(f))){var h=0;for(b=f.length;h<b;h++)void 0!==f[h]&&null!==f[h]&&g.val.push([void 0,String(f[h])]);g.val.length&&(g.type=3)}else if("[object Object]"===String(Object.prototype.toString.call(f))){for(h in f)q.call(f,
93
+ h)&&void 0!==f[h]&&null!==f[h]&&g.val.push([h,String(f[h])]);g.val.length&&(g.type=2)}else g.type=1,g.val.push([void 0,String(f)]);return g};f.expand=function(b,k){var g=(new h(b)).expand(k);return new f(g)};return h});
@@ -0,0 +1,1283 @@
1
+ /*
2
+ * anime.js v3.2.0
3
+ * (c) 2020 Julian Garnier
4
+ * Released under the MIT license
5
+ * animejs.com
6
+ */
7
+
8
+ 'use strict';
9
+
10
+ // Defaults
11
+
12
+ var defaultInstanceSettings = {
13
+ update: null,
14
+ begin: null,
15
+ loopBegin: null,
16
+ changeBegin: null,
17
+ change: null,
18
+ changeComplete: null,
19
+ loopComplete: null,
20
+ complete: null,
21
+ loop: 1,
22
+ direction: 'normal',
23
+ autoplay: true,
24
+ timelineOffset: 0
25
+ };
26
+
27
+ var defaultTweenSettings = {
28
+ duration: 1000,
29
+ delay: 0,
30
+ endDelay: 0,
31
+ easing: 'easeOutElastic(1, .5)',
32
+ round: 0
33
+ };
34
+
35
+ var validTransforms = ['translateX', 'translateY', 'translateZ', 'rotate', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'perspective', 'matrix', 'matrix3d'];
36
+
37
+ // Caching
38
+
39
+ var cache = {
40
+ CSS: {},
41
+ springs: {}
42
+ };
43
+
44
+ // Utils
45
+
46
+ function minMax(val, min, max) {
47
+ return Math.min(Math.max(val, min), max);
48
+ }
49
+
50
+ function stringContains(str, text) {
51
+ return str.indexOf(text) > -1;
52
+ }
53
+
54
+ function applyArguments(func, args) {
55
+ return func.apply(null, args);
56
+ }
57
+
58
+ var is = {
59
+ arr: function (a) { return Array.isArray(a); },
60
+ obj: function (a) { return stringContains(Object.prototype.toString.call(a), 'Object'); },
61
+ pth: function (a) { return is.obj(a) && a.hasOwnProperty('totalLength'); },
62
+ svg: function (a) { return a instanceof SVGElement; },
63
+ inp: function (a) { return a instanceof HTMLInputElement; },
64
+ dom: function (a) { return a.nodeType || is.svg(a); },
65
+ str: function (a) { return typeof a === 'string'; },
66
+ fnc: function (a) { return typeof a === 'function'; },
67
+ und: function (a) { return typeof a === 'undefined'; },
68
+ hex: function (a) { return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(a); },
69
+ rgb: function (a) { return /^rgb/.test(a); },
70
+ hsl: function (a) { return /^hsl/.test(a); },
71
+ col: function (a) { return (is.hex(a) || is.rgb(a) || is.hsl(a)); },
72
+ key: function (a) { return !defaultInstanceSettings.hasOwnProperty(a) && !defaultTweenSettings.hasOwnProperty(a) && a !== 'targets' && a !== 'keyframes'; }
73
+ };
74
+
75
+ // Easings
76
+
77
+ function parseEasingParameters(string) {
78
+ var match = /\(([^)]+)\)/.exec(string);
79
+ return match ? match[1].split(',').map(function (p) { return parseFloat(p); }) : [];
80
+ }
81
+
82
+ // Spring solver inspired by Webkit Copyright © 2016 Apple Inc. All rights reserved. https://webkit.org/demos/spring/spring.js
83
+
84
+ function spring(string, duration) {
85
+
86
+ var params = parseEasingParameters(string);
87
+ var mass = minMax(is.und(params[0]) ? 1 : params[0], .1, 100);
88
+ var stiffness = minMax(is.und(params[1]) ? 100 : params[1], .1, 100);
89
+ var damping = minMax(is.und(params[2]) ? 10 : params[2], .1, 100);
90
+ var velocity = minMax(is.und(params[3]) ? 0 : params[3], .1, 100);
91
+ var w0 = Math.sqrt(stiffness / mass);
92
+ var zeta = damping / (2 * Math.sqrt(stiffness * mass));
93
+ var wd = zeta < 1 ? w0 * Math.sqrt(1 - zeta * zeta) : 0;
94
+ var a = 1;
95
+ var b = zeta < 1 ? (zeta * w0 + -velocity) / wd : -velocity + w0;
96
+
97
+ function solver(t) {
98
+ var progress = duration ? (duration * t) / 1000 : t;
99
+ if (zeta < 1) {
100
+ progress = Math.exp(-progress * zeta * w0) * (a * Math.cos(wd * progress) + b * Math.sin(wd * progress));
101
+ } else {
102
+ progress = (a + b * progress) * Math.exp(-progress * w0);
103
+ }
104
+ if (t === 0 || t === 1) { return t; }
105
+ return 1 - progress;
106
+ }
107
+
108
+ function getDuration() {
109
+ var cached = cache.springs[string];
110
+ if (cached) { return cached; }
111
+ var frame = 1/6;
112
+ var elapsed = 0;
113
+ var rest = 0;
114
+ while(true) {
115
+ elapsed += frame;
116
+ if (solver(elapsed) === 1) {
117
+ rest++;
118
+ if (rest >= 16) { break; }
119
+ } else {
120
+ rest = 0;
121
+ }
122
+ }
123
+ var duration = elapsed * frame * 1000;
124
+ cache.springs[string] = duration;
125
+ return duration;
126
+ }
127
+
128
+ return duration ? solver : getDuration;
129
+
130
+ }
131
+
132
+ // Basic steps easing implementation https://developer.mozilla.org/fr/docs/Web/CSS/transition-timing-function
133
+
134
+ function steps(steps) {
135
+ if ( steps === void 0 ) steps = 10;
136
+
137
+ return function (t) { return Math.ceil((minMax(t, 0.000001, 1)) * steps) * (1 / steps); };
138
+ }
139
+
140
+ // BezierEasing https://github.com/gre/bezier-easing
141
+
142
+ var bezier = (function () {
143
+
144
+ var kSplineTableSize = 11;
145
+ var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
146
+
147
+ function A(aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1 }
148
+ function B(aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1 }
149
+ function C(aA1) { return 3.0 * aA1 }
150
+
151
+ function calcBezier(aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT }
152
+ function getSlope(aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1) }
153
+
154
+ function binarySubdivide(aX, aA, aB, mX1, mX2) {
155
+ var currentX, currentT, i = 0;
156
+ do {
157
+ currentT = aA + (aB - aA) / 2.0;
158
+ currentX = calcBezier(currentT, mX1, mX2) - aX;
159
+ if (currentX > 0.0) { aB = currentT; } else { aA = currentT; }
160
+ } while (Math.abs(currentX) > 0.0000001 && ++i < 10);
161
+ return currentT;
162
+ }
163
+
164
+ function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {
165
+ for (var i = 0; i < 4; ++i) {
166
+ var currentSlope = getSlope(aGuessT, mX1, mX2);
167
+ if (currentSlope === 0.0) { return aGuessT; }
168
+ var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
169
+ aGuessT -= currentX / currentSlope;
170
+ }
171
+ return aGuessT;
172
+ }
173
+
174
+ function bezier(mX1, mY1, mX2, mY2) {
175
+
176
+ if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) { return; }
177
+ var sampleValues = new Float32Array(kSplineTableSize);
178
+
179
+ if (mX1 !== mY1 || mX2 !== mY2) {
180
+ for (var i = 0; i < kSplineTableSize; ++i) {
181
+ sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
182
+ }
183
+ }
184
+
185
+ function getTForX(aX) {
186
+
187
+ var intervalStart = 0;
188
+ var currentSample = 1;
189
+ var lastSample = kSplineTableSize - 1;
190
+
191
+ for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
192
+ intervalStart += kSampleStepSize;
193
+ }
194
+
195
+ --currentSample;
196
+
197
+ var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);
198
+ var guessForT = intervalStart + dist * kSampleStepSize;
199
+ var initialSlope = getSlope(guessForT, mX1, mX2);
200
+
201
+ if (initialSlope >= 0.001) {
202
+ return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
203
+ } else if (initialSlope === 0.0) {
204
+ return guessForT;
205
+ } else {
206
+ return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
207
+ }
208
+
209
+ }
210
+
211
+ return function (x) {
212
+ if (mX1 === mY1 && mX2 === mY2) { return x; }
213
+ if (x === 0 || x === 1) { return x; }
214
+ return calcBezier(getTForX(x), mY1, mY2);
215
+ }
216
+
217
+ }
218
+
219
+ return bezier;
220
+
221
+ })();
222
+
223
+ var penner = (function () {
224
+
225
+ // Based on jQuery UI's implemenation of easing equations from Robert Penner (http://www.robertpenner.com/easing)
226
+
227
+ var eases = { linear: function () { return function (t) { return t; }; } };
228
+
229
+ var functionEasings = {
230
+ Sine: function () { return function (t) { return 1 - Math.cos(t * Math.PI / 2); }; },
231
+ Circ: function () { return function (t) { return 1 - Math.sqrt(1 - t * t); }; },
232
+ Back: function () { return function (t) { return t * t * (3 * t - 2); }; },
233
+ Bounce: function () { return function (t) {
234
+ var pow2, b = 4;
235
+ while (t < (( pow2 = Math.pow(2, --b)) - 1) / 11) {}
236
+ return 1 / Math.pow(4, 3 - b) - 7.5625 * Math.pow(( pow2 * 3 - 2 ) / 22 - t, 2)
237
+ }; },
238
+ Elastic: function (amplitude, period) {
239
+ if ( amplitude === void 0 ) amplitude = 1;
240
+ if ( period === void 0 ) period = .5;
241
+
242
+ var a = minMax(amplitude, 1, 10);
243
+ var p = minMax(period, .1, 2);
244
+ return function (t) {
245
+ return (t === 0 || t === 1) ? t :
246
+ -a * Math.pow(2, 10 * (t - 1)) * Math.sin((((t - 1) - (p / (Math.PI * 2) * Math.asin(1 / a))) * (Math.PI * 2)) / p);
247
+ }
248
+ }
249
+ };
250
+
251
+ var baseEasings = ['Quad', 'Cubic', 'Quart', 'Quint', 'Expo'];
252
+
253
+ baseEasings.forEach(function (name, i) {
254
+ functionEasings[name] = function () { return function (t) { return Math.pow(t, i + 2); }; };
255
+ });
256
+
257
+ Object.keys(functionEasings).forEach(function (name) {
258
+ var easeIn = functionEasings[name];
259
+ eases['easeIn' + name] = easeIn;
260
+ eases['easeOut' + name] = function (a, b) { return function (t) { return 1 - easeIn(a, b)(1 - t); }; };
261
+ eases['easeInOut' + name] = function (a, b) { return function (t) { return t < 0.5 ? easeIn(a, b)(t * 2) / 2 :
262
+ 1 - easeIn(a, b)(t * -2 + 2) / 2; }; };
263
+ });
264
+
265
+ return eases;
266
+
267
+ })();
268
+
269
+ function parseEasings(easing, duration) {
270
+ if (is.fnc(easing)) { return easing; }
271
+ var name = easing.split('(')[0];
272
+ var ease = penner[name];
273
+ var args = parseEasingParameters(easing);
274
+ switch (name) {
275
+ case 'spring' : return spring(easing, duration);
276
+ case 'cubicBezier' : return applyArguments(bezier, args);
277
+ case 'steps' : return applyArguments(steps, args);
278
+ default : return applyArguments(ease, args);
279
+ }
280
+ }
281
+
282
+ // Strings
283
+
284
+ function selectString(str) {
285
+ try {
286
+ var nodes = document.querySelectorAll(str);
287
+ return nodes;
288
+ } catch(e) {
289
+ return;
290
+ }
291
+ }
292
+
293
+ // Arrays
294
+
295
+ function filterArray(arr, callback) {
296
+ var len = arr.length;
297
+ var thisArg = arguments.length >= 2 ? arguments[1] : void 0;
298
+ var result = [];
299
+ for (var i = 0; i < len; i++) {
300
+ if (i in arr) {
301
+ var val = arr[i];
302
+ if (callback.call(thisArg, val, i, arr)) {
303
+ result.push(val);
304
+ }
305
+ }
306
+ }
307
+ return result;
308
+ }
309
+
310
+ function flattenArray(arr) {
311
+ return arr.reduce(function (a, b) { return a.concat(is.arr(b) ? flattenArray(b) : b); }, []);
312
+ }
313
+
314
+ function toArray(o) {
315
+ if (is.arr(o)) { return o; }
316
+ if (is.str(o)) { o = selectString(o) || o; }
317
+ if (o instanceof NodeList || o instanceof HTMLCollection) { return [].slice.call(o); }
318
+ return [o];
319
+ }
320
+
321
+ function arrayContains(arr, val) {
322
+ return arr.some(function (a) { return a === val; });
323
+ }
324
+
325
+ // Objects
326
+
327
+ function cloneObject(o) {
328
+ var clone = {};
329
+ for (var p in o) { clone[p] = o[p]; }
330
+ return clone;
331
+ }
332
+
333
+ function replaceObjectProps(o1, o2) {
334
+ var o = cloneObject(o1);
335
+ for (var p in o1) { o[p] = o2.hasOwnProperty(p) ? o2[p] : o1[p]; }
336
+ return o;
337
+ }
338
+
339
+ function mergeObjects(o1, o2) {
340
+ var o = cloneObject(o1);
341
+ for (var p in o2) { o[p] = is.und(o1[p]) ? o2[p] : o1[p]; }
342
+ return o;
343
+ }
344
+
345
+ // Colors
346
+
347
+ function rgbToRgba(rgbValue) {
348
+ var rgb = /rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(rgbValue);
349
+ return rgb ? ("rgba(" + (rgb[1]) + ",1)") : rgbValue;
350
+ }
351
+
352
+ function hexToRgba(hexValue) {
353
+ var rgx = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
354
+ var hex = hexValue.replace(rgx, function (m, r, g, b) { return r + r + g + g + b + b; } );
355
+ var rgb = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
356
+ var r = parseInt(rgb[1], 16);
357
+ var g = parseInt(rgb[2], 16);
358
+ var b = parseInt(rgb[3], 16);
359
+ return ("rgba(" + r + "," + g + "," + b + ",1)");
360
+ }
361
+
362
+ function hslToRgba(hslValue) {
363
+ var hsl = /hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(hslValue) || /hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(hslValue);
364
+ var h = parseInt(hsl[1], 10) / 360;
365
+ var s = parseInt(hsl[2], 10) / 100;
366
+ var l = parseInt(hsl[3], 10) / 100;
367
+ var a = hsl[4] || 1;
368
+ function hue2rgb(p, q, t) {
369
+ if (t < 0) { t += 1; }
370
+ if (t > 1) { t -= 1; }
371
+ if (t < 1/6) { return p + (q - p) * 6 * t; }
372
+ if (t < 1/2) { return q; }
373
+ if (t < 2/3) { return p + (q - p) * (2/3 - t) * 6; }
374
+ return p;
375
+ }
376
+ var r, g, b;
377
+ if (s == 0) {
378
+ r = g = b = l;
379
+ } else {
380
+ var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
381
+ var p = 2 * l - q;
382
+ r = hue2rgb(p, q, h + 1/3);
383
+ g = hue2rgb(p, q, h);
384
+ b = hue2rgb(p, q, h - 1/3);
385
+ }
386
+ return ("rgba(" + (r * 255) + "," + (g * 255) + "," + (b * 255) + "," + a + ")");
387
+ }
388
+
389
+ function colorToRgb(val) {
390
+ if (is.rgb(val)) { return rgbToRgba(val); }
391
+ if (is.hex(val)) { return hexToRgba(val); }
392
+ if (is.hsl(val)) { return hslToRgba(val); }
393
+ }
394
+
395
+ // Units
396
+
397
+ function getUnit(val) {
398
+ var split = /[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(val);
399
+ if (split) { return split[1]; }
400
+ }
401
+
402
+ function getTransformUnit(propName) {
403
+ if (stringContains(propName, 'translate') || propName === 'perspective') { return 'px'; }
404
+ if (stringContains(propName, 'rotate') || stringContains(propName, 'skew')) { return 'deg'; }
405
+ }
406
+
407
+ // Values
408
+
409
+ function getFunctionValue(val, animatable) {
410
+ if (!is.fnc(val)) { return val; }
411
+ return val(animatable.target, animatable.id, animatable.total);
412
+ }
413
+
414
+ function getAttribute(el, prop) {
415
+ return el.getAttribute(prop);
416
+ }
417
+
418
+ function convertPxToUnit(el, value, unit) {
419
+ var valueUnit = getUnit(value);
420
+ if (arrayContains([unit, 'deg', 'rad', 'turn'], valueUnit)) { return value; }
421
+ var cached = cache.CSS[value + unit];
422
+ if (!is.und(cached)) { return cached; }
423
+ var baseline = 100;
424
+ var tempEl = document.createElement(el.tagName);
425
+ var parentEl = (el.parentNode && (el.parentNode !== document)) ? el.parentNode : document.body;
426
+ parentEl.appendChild(tempEl);
427
+ tempEl.style.position = 'absolute';
428
+ tempEl.style.width = baseline + unit;
429
+ var factor = baseline / tempEl.offsetWidth;
430
+ parentEl.removeChild(tempEl);
431
+ var convertedUnit = factor * parseFloat(value);
432
+ cache.CSS[value + unit] = convertedUnit;
433
+ return convertedUnit;
434
+ }
435
+
436
+ function getCSSValue(el, prop, unit) {
437
+ if (prop in el.style) {
438
+ var uppercasePropName = prop.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
439
+ var value = el.style[prop] || getComputedStyle(el).getPropertyValue(uppercasePropName) || '0';
440
+ return unit ? convertPxToUnit(el, value, unit) : value;
441
+ }
442
+ }
443
+
444
+ function getAnimationType(el, prop) {
445
+ if (is.dom(el) && !is.inp(el) && (getAttribute(el, prop) || (is.svg(el) && el[prop]))) { return 'attribute'; }
446
+ if (is.dom(el) && arrayContains(validTransforms, prop)) { return 'transform'; }
447
+ if (is.dom(el) && (prop !== 'transform' && getCSSValue(el, prop))) { return 'css'; }
448
+ if (el[prop] != null) { return 'object'; }
449
+ }
450
+
451
+ function getElementTransforms(el) {
452
+ if (!is.dom(el)) { return; }
453
+ var str = el.style.transform || '';
454
+ var reg = /(\w+)\(([^)]*)\)/g;
455
+ var transforms = new Map();
456
+ var m; while (m = reg.exec(str)) { transforms.set(m[1], m[2]); }
457
+ return transforms;
458
+ }
459
+
460
+ function getTransformValue(el, propName, animatable, unit) {
461
+ var defaultVal = stringContains(propName, 'scale') ? 1 : 0 + getTransformUnit(propName);
462
+ var value = getElementTransforms(el).get(propName) || defaultVal;
463
+ if (animatable) {
464
+ animatable.transforms.list.set(propName, value);
465
+ animatable.transforms['last'] = propName;
466
+ }
467
+ return unit ? convertPxToUnit(el, value, unit) : value;
468
+ }
469
+
470
+ function getOriginalTargetValue(target, propName, unit, animatable) {
471
+ switch (getAnimationType(target, propName)) {
472
+ case 'transform': return getTransformValue(target, propName, animatable, unit);
473
+ case 'css': return getCSSValue(target, propName, unit);
474
+ case 'attribute': return getAttribute(target, propName);
475
+ default: return target[propName] || 0;
476
+ }
477
+ }
478
+
479
+ function getRelativeValue(to, from) {
480
+ var operator = /^(\*=|\+=|-=)/.exec(to);
481
+ if (!operator) { return to; }
482
+ var u = getUnit(to) || 0;
483
+ var x = parseFloat(from);
484
+ var y = parseFloat(to.replace(operator[0], ''));
485
+ switch (operator[0][0]) {
486
+ case '+': return x + y + u;
487
+ case '-': return x - y + u;
488
+ case '*': return x * y + u;
489
+ }
490
+ }
491
+
492
+ function validateValue(val, unit) {
493
+ if (is.col(val)) { return colorToRgb(val); }
494
+ if (/\s/g.test(val)) { return val; }
495
+ var originalUnit = getUnit(val);
496
+ var unitLess = originalUnit ? val.substr(0, val.length - originalUnit.length) : val;
497
+ if (unit) { return unitLess + unit; }
498
+ return unitLess;
499
+ }
500
+
501
+ // getTotalLength() equivalent for circle, rect, polyline, polygon and line shapes
502
+ // adapted from https://gist.github.com/SebLambla/3e0550c496c236709744
503
+
504
+ function getDistance(p1, p2) {
505
+ return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));
506
+ }
507
+
508
+ function getCircleLength(el) {
509
+ return Math.PI * 2 * getAttribute(el, 'r');
510
+ }
511
+
512
+ function getRectLength(el) {
513
+ return (getAttribute(el, 'width') * 2) + (getAttribute(el, 'height') * 2);
514
+ }
515
+
516
+ function getLineLength(el) {
517
+ return getDistance(
518
+ {x: getAttribute(el, 'x1'), y: getAttribute(el, 'y1')},
519
+ {x: getAttribute(el, 'x2'), y: getAttribute(el, 'y2')}
520
+ );
521
+ }
522
+
523
+ function getPolylineLength(el) {
524
+ var points = el.points;
525
+ var totalLength = 0;
526
+ var previousPos;
527
+ for (var i = 0 ; i < points.numberOfItems; i++) {
528
+ var currentPos = points.getItem(i);
529
+ if (i > 0) { totalLength += getDistance(previousPos, currentPos); }
530
+ previousPos = currentPos;
531
+ }
532
+ return totalLength;
533
+ }
534
+
535
+ function getPolygonLength(el) {
536
+ var points = el.points;
537
+ return getPolylineLength(el) + getDistance(points.getItem(points.numberOfItems - 1), points.getItem(0));
538
+ }
539
+
540
+ // Path animation
541
+
542
+ function getTotalLength(el) {
543
+ if (el.getTotalLength) { return el.getTotalLength(); }
544
+ switch(el.tagName.toLowerCase()) {
545
+ case 'circle': return getCircleLength(el);
546
+ case 'rect': return getRectLength(el);
547
+ case 'line': return getLineLength(el);
548
+ case 'polyline': return getPolylineLength(el);
549
+ case 'polygon': return getPolygonLength(el);
550
+ }
551
+ }
552
+
553
+ function setDashoffset(el) {
554
+ var pathLength = getTotalLength(el);
555
+ el.setAttribute('stroke-dasharray', pathLength);
556
+ return pathLength;
557
+ }
558
+
559
+ // Motion path
560
+
561
+ function getParentSvgEl(el) {
562
+ var parentEl = el.parentNode;
563
+ while (is.svg(parentEl)) {
564
+ if (!is.svg(parentEl.parentNode)) { break; }
565
+ parentEl = parentEl.parentNode;
566
+ }
567
+ return parentEl;
568
+ }
569
+
570
+ function getParentSvg(pathEl, svgData) {
571
+ var svg = svgData || {};
572
+ var parentSvgEl = svg.el || getParentSvgEl(pathEl);
573
+ var rect = parentSvgEl.getBoundingClientRect();
574
+ var viewBoxAttr = getAttribute(parentSvgEl, 'viewBox');
575
+ var width = rect.width;
576
+ var height = rect.height;
577
+ var viewBox = svg.viewBox || (viewBoxAttr ? viewBoxAttr.split(' ') : [0, 0, width, height]);
578
+ return {
579
+ el: parentSvgEl,
580
+ viewBox: viewBox,
581
+ x: viewBox[0] / 1,
582
+ y: viewBox[1] / 1,
583
+ w: width / viewBox[2],
584
+ h: height / viewBox[3]
585
+ }
586
+ }
587
+
588
+ function getPath(path, percent) {
589
+ var pathEl = is.str(path) ? selectString(path)[0] : path;
590
+ var p = percent || 100;
591
+ return function(property) {
592
+ return {
593
+ property: property,
594
+ el: pathEl,
595
+ svg: getParentSvg(pathEl),
596
+ totalLength: getTotalLength(pathEl) * (p / 100)
597
+ }
598
+ }
599
+ }
600
+
601
+ function getPathProgress(path, progress) {
602
+ function point(offset) {
603
+ if ( offset === void 0 ) offset = 0;
604
+
605
+ var l = progress + offset >= 1 ? progress + offset : 0;
606
+ return path.el.getPointAtLength(l);
607
+ }
608
+ var svg = getParentSvg(path.el, path.svg);
609
+ var p = point();
610
+ var p0 = point(-1);
611
+ var p1 = point(+1);
612
+ switch (path.property) {
613
+ case 'x': return (p.x - svg.x) * svg.w;
614
+ case 'y': return (p.y - svg.y) * svg.h;
615
+ case 'angle': return Math.atan2(p1.y - p0.y, p1.x - p0.x) * 180 / Math.PI;
616
+ }
617
+ }
618
+
619
+ // Decompose value
620
+
621
+ function decomposeValue(val, unit) {
622
+ // const rgx = /-?\d*\.?\d+/g; // handles basic numbers
623
+ // const rgx = /[+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g; // handles exponents notation
624
+ var rgx = /[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g; // handles exponents notation
625
+ var value = validateValue((is.pth(val) ? val.totalLength : val), unit) + '';
626
+ return {
627
+ original: value,
628
+ numbers: value.match(rgx) ? value.match(rgx).map(Number) : [0],
629
+ strings: (is.str(val) || unit) ? value.split(rgx) : []
630
+ }
631
+ }
632
+
633
+ // Animatables
634
+
635
+ function parseTargets(targets) {
636
+ var targetsArray = targets ? (flattenArray(is.arr(targets) ? targets.map(toArray) : toArray(targets))) : [];
637
+ return filterArray(targetsArray, function (item, pos, self) { return self.indexOf(item) === pos; });
638
+ }
639
+
640
+ function getAnimatables(targets) {
641
+ var parsed = parseTargets(targets);
642
+ return parsed.map(function (t, i) {
643
+ return {target: t, id: i, total: parsed.length, transforms: { list: getElementTransforms(t) } };
644
+ });
645
+ }
646
+
647
+ // Properties
648
+
649
+ function normalizePropertyTweens(prop, tweenSettings) {
650
+ var settings = cloneObject(tweenSettings);
651
+ // Override duration if easing is a spring
652
+ if (/^spring/.test(settings.easing)) { settings.duration = spring(settings.easing); }
653
+ if (is.arr(prop)) {
654
+ var l = prop.length;
655
+ var isFromTo = (l === 2 && !is.obj(prop[0]));
656
+ if (!isFromTo) {
657
+ // Duration divided by the number of tweens
658
+ if (!is.fnc(tweenSettings.duration)) { settings.duration = tweenSettings.duration / l; }
659
+ } else {
660
+ // Transform [from, to] values shorthand to a valid tween value
661
+ prop = {value: prop};
662
+ }
663
+ }
664
+ var propArray = is.arr(prop) ? prop : [prop];
665
+ return propArray.map(function (v, i) {
666
+ var obj = (is.obj(v) && !is.pth(v)) ? v : {value: v};
667
+ // Default delay value should only be applied to the first tween
668
+ if (is.und(obj.delay)) { obj.delay = !i ? tweenSettings.delay : 0; }
669
+ // Default endDelay value should only be applied to the last tween
670
+ if (is.und(obj.endDelay)) { obj.endDelay = i === propArray.length - 1 ? tweenSettings.endDelay : 0; }
671
+ return obj;
672
+ }).map(function (k) { return mergeObjects(k, settings); });
673
+ }
674
+
675
+
676
+ function flattenKeyframes(keyframes) {
677
+ var propertyNames = filterArray(flattenArray(keyframes.map(function (key) { return Object.keys(key); })), function (p) { return is.key(p); })
678
+ .reduce(function (a,b) { if (a.indexOf(b) < 0) { a.push(b); } return a; }, []);
679
+ var properties = {};
680
+ var loop = function ( i ) {
681
+ var propName = propertyNames[i];
682
+ properties[propName] = keyframes.map(function (key) {
683
+ var newKey = {};
684
+ for (var p in key) {
685
+ if (is.key(p)) {
686
+ if (p == propName) { newKey.value = key[p]; }
687
+ } else {
688
+ newKey[p] = key[p];
689
+ }
690
+ }
691
+ return newKey;
692
+ });
693
+ };
694
+
695
+ for (var i = 0; i < propertyNames.length; i++) loop( i );
696
+ return properties;
697
+ }
698
+
699
+ function getProperties(tweenSettings, params) {
700
+ var properties = [];
701
+ var keyframes = params.keyframes;
702
+ if (keyframes) { params = mergeObjects(flattenKeyframes(keyframes), params); }
703
+ for (var p in params) {
704
+ if (is.key(p)) {
705
+ properties.push({
706
+ name: p,
707
+ tweens: normalizePropertyTweens(params[p], tweenSettings)
708
+ });
709
+ }
710
+ }
711
+ return properties;
712
+ }
713
+
714
+ // Tweens
715
+
716
+ function normalizeTweenValues(tween, animatable) {
717
+ var t = {};
718
+ for (var p in tween) {
719
+ var value = getFunctionValue(tween[p], animatable);
720
+ if (is.arr(value)) {
721
+ value = value.map(function (v) { return getFunctionValue(v, animatable); });
722
+ if (value.length === 1) { value = value[0]; }
723
+ }
724
+ t[p] = value;
725
+ }
726
+ t.duration = parseFloat(t.duration);
727
+ t.delay = parseFloat(t.delay);
728
+ return t;
729
+ }
730
+
731
+ function normalizeTweens(prop, animatable) {
732
+ var previousTween;
733
+ return prop.tweens.map(function (t) {
734
+ var tween = normalizeTweenValues(t, animatable);
735
+ var tweenValue = tween.value;
736
+ var to = is.arr(tweenValue) ? tweenValue[1] : tweenValue;
737
+ var toUnit = getUnit(to);
738
+ var originalValue = getOriginalTargetValue(animatable.target, prop.name, toUnit, animatable);
739
+ var previousValue = previousTween ? previousTween.to.original : originalValue;
740
+ var from = is.arr(tweenValue) ? tweenValue[0] : previousValue;
741
+ var fromUnit = getUnit(from) || getUnit(originalValue);
742
+ var unit = toUnit || fromUnit;
743
+ if (is.und(to)) { to = previousValue; }
744
+ tween.from = decomposeValue(from, unit);
745
+ tween.to = decomposeValue(getRelativeValue(to, from), unit);
746
+ tween.start = previousTween ? previousTween.end : 0;
747
+ tween.end = tween.start + tween.delay + tween.duration + tween.endDelay;
748
+ tween.easing = parseEasings(tween.easing, tween.duration);
749
+ tween.isPath = is.pth(tweenValue);
750
+ tween.isColor = is.col(tween.from.original);
751
+ if (tween.isColor) { tween.round = 1; }
752
+ previousTween = tween;
753
+ return tween;
754
+ });
755
+ }
756
+
757
+ // Tween progress
758
+
759
+ var setProgressValue = {
760
+ css: function (t, p, v) { return t.style[p] = v; },
761
+ attribute: function (t, p, v) { return t.setAttribute(p, v); },
762
+ object: function (t, p, v) { return t[p] = v; },
763
+ transform: function (t, p, v, transforms, manual) {
764
+ transforms.list.set(p, v);
765
+ if (p === transforms.last || manual) {
766
+ var str = '';
767
+ transforms.list.forEach(function (value, prop) { str += prop + "(" + value + ") "; });
768
+ t.style.transform = str;
769
+ }
770
+ }
771
+ };
772
+
773
+ // Set Value helper
774
+
775
+ function setTargetsValue(targets, properties) {
776
+ var animatables = getAnimatables(targets);
777
+ animatables.forEach(function (animatable) {
778
+ for (var property in properties) {
779
+ var value = getFunctionValue(properties[property], animatable);
780
+ var target = animatable.target;
781
+ var valueUnit = getUnit(value);
782
+ var originalValue = getOriginalTargetValue(target, property, valueUnit, animatable);
783
+ var unit = valueUnit || getUnit(originalValue);
784
+ var to = getRelativeValue(validateValue(value, unit), originalValue);
785
+ var animType = getAnimationType(target, property);
786
+ setProgressValue[animType](target, property, to, animatable.transforms, true);
787
+ }
788
+ });
789
+ }
790
+
791
+ // Animations
792
+
793
+ function createAnimation(animatable, prop) {
794
+ var animType = getAnimationType(animatable.target, prop.name);
795
+ if (animType) {
796
+ var tweens = normalizeTweens(prop, animatable);
797
+ var lastTween = tweens[tweens.length - 1];
798
+ return {
799
+ type: animType,
800
+ property: prop.name,
801
+ animatable: animatable,
802
+ tweens: tweens,
803
+ duration: lastTween.end,
804
+ delay: tweens[0].delay,
805
+ endDelay: lastTween.endDelay
806
+ }
807
+ }
808
+ }
809
+
810
+ function getAnimations(animatables, properties) {
811
+ return filterArray(flattenArray(animatables.map(function (animatable) {
812
+ return properties.map(function (prop) {
813
+ return createAnimation(animatable, prop);
814
+ });
815
+ })), function (a) { return !is.und(a); });
816
+ }
817
+
818
+ // Create Instance
819
+
820
+ function getInstanceTimings(animations, tweenSettings) {
821
+ var animLength = animations.length;
822
+ var getTlOffset = function (anim) { return anim.timelineOffset ? anim.timelineOffset : 0; };
823
+ var timings = {};
824
+ timings.duration = animLength ? Math.max.apply(Math, animations.map(function (anim) { return getTlOffset(anim) + anim.duration; })) : tweenSettings.duration;
825
+ timings.delay = animLength ? Math.min.apply(Math, animations.map(function (anim) { return getTlOffset(anim) + anim.delay; })) : tweenSettings.delay;
826
+ timings.endDelay = animLength ? timings.duration - Math.max.apply(Math, animations.map(function (anim) { return getTlOffset(anim) + anim.duration - anim.endDelay; })) : tweenSettings.endDelay;
827
+ return timings;
828
+ }
829
+
830
+ var instanceID = 0;
831
+
832
+ function createNewInstance(params) {
833
+ var instanceSettings = replaceObjectProps(defaultInstanceSettings, params);
834
+ var tweenSettings = replaceObjectProps(defaultTweenSettings, params);
835
+ var properties = getProperties(tweenSettings, params);
836
+ var animatables = getAnimatables(params.targets);
837
+ var animations = getAnimations(animatables, properties);
838
+ var timings = getInstanceTimings(animations, tweenSettings);
839
+ var id = instanceID;
840
+ instanceID++;
841
+ return mergeObjects(instanceSettings, {
842
+ id: id,
843
+ children: [],
844
+ animatables: animatables,
845
+ animations: animations,
846
+ duration: timings.duration,
847
+ delay: timings.delay,
848
+ endDelay: timings.endDelay
849
+ });
850
+ }
851
+
852
+ // Core
853
+
854
+ var activeInstances = [];
855
+ var pausedInstances = [];
856
+ var raf;
857
+
858
+ var engine = (function () {
859
+ function play() {
860
+ raf = requestAnimationFrame(step);
861
+ }
862
+ function step(t) {
863
+ var activeInstancesLength = activeInstances.length;
864
+ if (activeInstancesLength) {
865
+ var i = 0;
866
+ while (i < activeInstancesLength) {
867
+ var activeInstance = activeInstances[i];
868
+ if (!activeInstance.paused) {
869
+ activeInstance.tick(t);
870
+ } else {
871
+ var instanceIndex = activeInstances.indexOf(activeInstance);
872
+ if (instanceIndex > -1) {
873
+ activeInstances.splice(instanceIndex, 1);
874
+ activeInstancesLength = activeInstances.length;
875
+ }
876
+ }
877
+ i++;
878
+ }
879
+ play();
880
+ } else {
881
+ raf = cancelAnimationFrame(raf);
882
+ }
883
+ }
884
+ return play;
885
+ })();
886
+
887
+ function handleVisibilityChange() {
888
+ if (document.hidden) {
889
+ activeInstances.forEach(function (ins) { return ins.pause(); });
890
+ pausedInstances = activeInstances.slice(0);
891
+ anime.running = activeInstances = [];
892
+ } else {
893
+ pausedInstances.forEach(function (ins) { return ins.play(); });
894
+ }
895
+ }
896
+
897
+ if (typeof document !== 'undefined') {
898
+ document.addEventListener('visibilitychange', handleVisibilityChange);
899
+ }
900
+
901
+ // Public Instance
902
+
903
+ function anime(params) {
904
+ if ( params === void 0 ) params = {};
905
+
906
+
907
+ var startTime = 0, lastTime = 0, now = 0;
908
+ var children, childrenLength = 0;
909
+ var resolve = null;
910
+
911
+ function makePromise(instance) {
912
+ var promise = window.Promise && new Promise(function (_resolve) { return resolve = _resolve; });
913
+ instance.finished = promise;
914
+ return promise;
915
+ }
916
+
917
+ var instance = createNewInstance(params);
918
+ var promise = makePromise(instance);
919
+
920
+ function toggleInstanceDirection() {
921
+ var direction = instance.direction;
922
+ if (direction !== 'alternate') {
923
+ instance.direction = direction !== 'normal' ? 'normal' : 'reverse';
924
+ }
925
+ instance.reversed = !instance.reversed;
926
+ children.forEach(function (child) { return child.reversed = instance.reversed; });
927
+ }
928
+
929
+ function adjustTime(time) {
930
+ return instance.reversed ? instance.duration - time : time;
931
+ }
932
+
933
+ function resetTime() {
934
+ startTime = 0;
935
+ lastTime = adjustTime(instance.currentTime) * (1 / anime.speed);
936
+ }
937
+
938
+ function seekChild(time, child) {
939
+ if (child) { child.seek(time - child.timelineOffset); }
940
+ }
941
+
942
+ function syncInstanceChildren(time) {
943
+ if (!instance.reversePlayback) {
944
+ for (var i = 0; i < childrenLength; i++) { seekChild(time, children[i]); }
945
+ } else {
946
+ for (var i$1 = childrenLength; i$1--;) { seekChild(time, children[i$1]); }
947
+ }
948
+ }
949
+
950
+ function setAnimationsProgress(insTime) {
951
+ var i = 0;
952
+ var animations = instance.animations;
953
+ var animationsLength = animations.length;
954
+ while (i < animationsLength) {
955
+ var anim = animations[i];
956
+ var animatable = anim.animatable;
957
+ var tweens = anim.tweens;
958
+ var tweenLength = tweens.length - 1;
959
+ var tween = tweens[tweenLength];
960
+ // Only check for keyframes if there is more than one tween
961
+ if (tweenLength) { tween = filterArray(tweens, function (t) { return (insTime < t.end); })[0] || tween; }
962
+ var elapsed = minMax(insTime - tween.start - tween.delay, 0, tween.duration) / tween.duration;
963
+ var eased = isNaN(elapsed) ? 1 : tween.easing(elapsed);
964
+ var strings = tween.to.strings;
965
+ var round = tween.round;
966
+ var numbers = [];
967
+ var toNumbersLength = tween.to.numbers.length;
968
+ var progress = (void 0);
969
+ for (var n = 0; n < toNumbersLength; n++) {
970
+ var value = (void 0);
971
+ var toNumber = tween.to.numbers[n];
972
+ var fromNumber = tween.from.numbers[n] || 0;
973
+ if (!tween.isPath) {
974
+ value = fromNumber + (eased * (toNumber - fromNumber));
975
+ } else {
976
+ value = getPathProgress(tween.value, eased * toNumber);
977
+ }
978
+ if (round) {
979
+ if (!(tween.isColor && n > 2)) {
980
+ value = Math.round(value * round) / round;
981
+ }
982
+ }
983
+ numbers.push(value);
984
+ }
985
+ // Manual Array.reduce for better performances
986
+ var stringsLength = strings.length;
987
+ if (!stringsLength) {
988
+ progress = numbers[0];
989
+ } else {
990
+ progress = strings[0];
991
+ for (var s = 0; s < stringsLength; s++) {
992
+ var a = strings[s];
993
+ var b = strings[s + 1];
994
+ var n$1 = numbers[s];
995
+ if (!isNaN(n$1)) {
996
+ if (!b) {
997
+ progress += n$1 + ' ';
998
+ } else {
999
+ progress += n$1 + b;
1000
+ }
1001
+ }
1002
+ }
1003
+ }
1004
+ setProgressValue[anim.type](animatable.target, anim.property, progress, animatable.transforms);
1005
+ anim.currentValue = progress;
1006
+ i++;
1007
+ }
1008
+ }
1009
+
1010
+ function setCallback(cb) {
1011
+ if (instance[cb] && !instance.passThrough) { instance[cb](instance); }
1012
+ }
1013
+
1014
+ function countIteration() {
1015
+ if (instance.remaining && instance.remaining !== true) {
1016
+ instance.remaining--;
1017
+ }
1018
+ }
1019
+
1020
+ function setInstanceProgress(engineTime) {
1021
+ var insDuration = instance.duration;
1022
+ var insDelay = instance.delay;
1023
+ var insEndDelay = insDuration - instance.endDelay;
1024
+ var insTime = adjustTime(engineTime);
1025
+ instance.progress = minMax((insTime / insDuration) * 100, 0, 100);
1026
+ instance.reversePlayback = insTime < instance.currentTime;
1027
+ if (children) { syncInstanceChildren(insTime); }
1028
+ if (!instance.began && instance.currentTime > 0) {
1029
+ instance.began = true;
1030
+ setCallback('begin');
1031
+ }
1032
+ if (!instance.loopBegan && instance.currentTime > 0) {
1033
+ instance.loopBegan = true;
1034
+ setCallback('loopBegin');
1035
+ }
1036
+ if (insTime <= insDelay && instance.currentTime !== 0) {
1037
+ setAnimationsProgress(0);
1038
+ }
1039
+ if ((insTime >= insEndDelay && instance.currentTime !== insDuration) || !insDuration) {
1040
+ setAnimationsProgress(insDuration);
1041
+ }
1042
+ if (insTime > insDelay && insTime < insEndDelay) {
1043
+ if (!instance.changeBegan) {
1044
+ instance.changeBegan = true;
1045
+ instance.changeCompleted = false;
1046
+ setCallback('changeBegin');
1047
+ }
1048
+ setCallback('change');
1049
+ setAnimationsProgress(insTime);
1050
+ } else {
1051
+ if (instance.changeBegan) {
1052
+ instance.changeCompleted = true;
1053
+ instance.changeBegan = false;
1054
+ setCallback('changeComplete');
1055
+ }
1056
+ }
1057
+ instance.currentTime = minMax(insTime, 0, insDuration);
1058
+ if (instance.began) { setCallback('update'); }
1059
+ if (engineTime >= insDuration) {
1060
+ lastTime = 0;
1061
+ countIteration();
1062
+ if (!instance.remaining) {
1063
+ instance.paused = true;
1064
+ if (!instance.completed) {
1065
+ instance.completed = true;
1066
+ setCallback('loopComplete');
1067
+ setCallback('complete');
1068
+ if (!instance.passThrough && 'Promise' in window) {
1069
+ resolve();
1070
+ promise = makePromise(instance);
1071
+ }
1072
+ }
1073
+ } else {
1074
+ startTime = now;
1075
+ setCallback('loopComplete');
1076
+ instance.loopBegan = false;
1077
+ if (instance.direction === 'alternate') {
1078
+ toggleInstanceDirection();
1079
+ }
1080
+ }
1081
+ }
1082
+ }
1083
+
1084
+ instance.reset = function() {
1085
+ var direction = instance.direction;
1086
+ instance.passThrough = false;
1087
+ instance.currentTime = 0;
1088
+ instance.progress = 0;
1089
+ instance.paused = true;
1090
+ instance.began = false;
1091
+ instance.loopBegan = false;
1092
+ instance.changeBegan = false;
1093
+ instance.completed = false;
1094
+ instance.changeCompleted = false;
1095
+ instance.reversePlayback = false;
1096
+ instance.reversed = direction === 'reverse';
1097
+ instance.remaining = instance.loop;
1098
+ children = instance.children;
1099
+ childrenLength = children.length;
1100
+ for (var i = childrenLength; i--;) { instance.children[i].reset(); }
1101
+ if (instance.reversed && instance.loop !== true || (direction === 'alternate' && instance.loop === 1)) { instance.remaining++; }
1102
+ setAnimationsProgress(instance.reversed ? instance.duration : 0);
1103
+ };
1104
+
1105
+ // Set Value helper
1106
+
1107
+ instance.set = function(targets, properties) {
1108
+ setTargetsValue(targets, properties);
1109
+ return instance;
1110
+ };
1111
+
1112
+ instance.tick = function(t) {
1113
+ now = t;
1114
+ if (!startTime) { startTime = now; }
1115
+ setInstanceProgress((now + (lastTime - startTime)) * anime.speed);
1116
+ };
1117
+
1118
+ instance.seek = function(time) {
1119
+ setInstanceProgress(adjustTime(time));
1120
+ };
1121
+
1122
+ instance.pause = function() {
1123
+ instance.paused = true;
1124
+ resetTime();
1125
+ };
1126
+
1127
+ instance.play = function() {
1128
+ if (!instance.paused) { return; }
1129
+ if (instance.completed) { instance.reset(); }
1130
+ instance.paused = false;
1131
+ activeInstances.push(instance);
1132
+ resetTime();
1133
+ if (!raf) { engine(); }
1134
+ };
1135
+
1136
+ instance.reverse = function() {
1137
+ toggleInstanceDirection();
1138
+ instance.completed = instance.reversed ? false : true;
1139
+ resetTime();
1140
+ };
1141
+
1142
+ instance.restart = function() {
1143
+ instance.reset();
1144
+ instance.play();
1145
+ };
1146
+
1147
+ instance.reset();
1148
+
1149
+ if (instance.autoplay) { instance.play(); }
1150
+
1151
+ return instance;
1152
+
1153
+ }
1154
+
1155
+ // Remove targets from animation
1156
+
1157
+ function removeTargetsFromAnimations(targetsArray, animations) {
1158
+ for (var a = animations.length; a--;) {
1159
+ if (arrayContains(targetsArray, animations[a].animatable.target)) {
1160
+ animations.splice(a, 1);
1161
+ }
1162
+ }
1163
+ }
1164
+
1165
+ function removeTargets(targets) {
1166
+ var targetsArray = parseTargets(targets);
1167
+ for (var i = activeInstances.length; i--;) {
1168
+ var instance = activeInstances[i];
1169
+ var animations = instance.animations;
1170
+ var children = instance.children;
1171
+ removeTargetsFromAnimations(targetsArray, animations);
1172
+ for (var c = children.length; c--;) {
1173
+ var child = children[c];
1174
+ var childAnimations = child.animations;
1175
+ removeTargetsFromAnimations(targetsArray, childAnimations);
1176
+ if (!childAnimations.length && !child.children.length) { children.splice(c, 1); }
1177
+ }
1178
+ if (!animations.length && !children.length) { instance.pause(); }
1179
+ }
1180
+ }
1181
+
1182
+ // Stagger helpers
1183
+
1184
+ function stagger(val, params) {
1185
+ if ( params === void 0 ) params = {};
1186
+
1187
+ var direction = params.direction || 'normal';
1188
+ var easing = params.easing ? parseEasings(params.easing) : null;
1189
+ var grid = params.grid;
1190
+ var axis = params.axis;
1191
+ var fromIndex = params.from || 0;
1192
+ var fromFirst = fromIndex === 'first';
1193
+ var fromCenter = fromIndex === 'center';
1194
+ var fromLast = fromIndex === 'last';
1195
+ var isRange = is.arr(val);
1196
+ var val1 = isRange ? parseFloat(val[0]) : parseFloat(val);
1197
+ var val2 = isRange ? parseFloat(val[1]) : 0;
1198
+ var unit = getUnit(isRange ? val[1] : val) || 0;
1199
+ var start = params.start || 0 + (isRange ? val1 : 0);
1200
+ var values = [];
1201
+ var maxValue = 0;
1202
+ return function (el, i, t) {
1203
+ if (fromFirst) { fromIndex = 0; }
1204
+ if (fromCenter) { fromIndex = (t - 1) / 2; }
1205
+ if (fromLast) { fromIndex = t - 1; }
1206
+ if (!values.length) {
1207
+ for (var index = 0; index < t; index++) {
1208
+ if (!grid) {
1209
+ values.push(Math.abs(fromIndex - index));
1210
+ } else {
1211
+ var fromX = !fromCenter ? fromIndex%grid[0] : (grid[0]-1)/2;
1212
+ var fromY = !fromCenter ? Math.floor(fromIndex/grid[0]) : (grid[1]-1)/2;
1213
+ var toX = index%grid[0];
1214
+ var toY = Math.floor(index/grid[0]);
1215
+ var distanceX = fromX - toX;
1216
+ var distanceY = fromY - toY;
1217
+ var value = Math.sqrt(distanceX * distanceX + distanceY * distanceY);
1218
+ if (axis === 'x') { value = -distanceX; }
1219
+ if (axis === 'y') { value = -distanceY; }
1220
+ values.push(value);
1221
+ }
1222
+ maxValue = Math.max.apply(Math, values);
1223
+ }
1224
+ if (easing) { values = values.map(function (val) { return easing(val / maxValue) * maxValue; }); }
1225
+ if (direction === 'reverse') { values = values.map(function (val) { return axis ? (val < 0) ? val * -1 : -val : Math.abs(maxValue - val); }); }
1226
+ }
1227
+ var spacing = isRange ? (val2 - val1) / maxValue : val1;
1228
+ return start + (spacing * (Math.round(values[i] * 100) / 100)) + unit;
1229
+ }
1230
+ }
1231
+
1232
+ // Timeline
1233
+
1234
+ function timeline(params) {
1235
+ if ( params === void 0 ) params = {};
1236
+
1237
+ var tl = anime(params);
1238
+ tl.duration = 0;
1239
+ tl.add = function(instanceParams, timelineOffset) {
1240
+ var tlIndex = activeInstances.indexOf(tl);
1241
+ var children = tl.children;
1242
+ if (tlIndex > -1) { activeInstances.splice(tlIndex, 1); }
1243
+ function passThrough(ins) { ins.passThrough = true; }
1244
+ for (var i = 0; i < children.length; i++) { passThrough(children[i]); }
1245
+ var insParams = mergeObjects(instanceParams, replaceObjectProps(defaultTweenSettings, params));
1246
+ insParams.targets = insParams.targets || params.targets;
1247
+ var tlDuration = tl.duration;
1248
+ insParams.autoplay = false;
1249
+ insParams.direction = tl.direction;
1250
+ insParams.timelineOffset = is.und(timelineOffset) ? tlDuration : getRelativeValue(timelineOffset, tlDuration);
1251
+ passThrough(tl);
1252
+ tl.seek(insParams.timelineOffset);
1253
+ var ins = anime(insParams);
1254
+ passThrough(ins);
1255
+ children.push(ins);
1256
+ var timings = getInstanceTimings(children, params);
1257
+ tl.delay = timings.delay;
1258
+ tl.endDelay = timings.endDelay;
1259
+ tl.duration = timings.duration;
1260
+ tl.seek(0);
1261
+ tl.reset();
1262
+ if (tl.autoplay) { tl.play(); }
1263
+ return tl;
1264
+ };
1265
+ return tl;
1266
+ }
1267
+
1268
+ anime.version = '3.2.0';
1269
+ anime.speed = 1;
1270
+ anime.running = activeInstances;
1271
+ anime.remove = removeTargets;
1272
+ anime.get = getOriginalTargetValue;
1273
+ anime.set = setTargetsValue;
1274
+ anime.convertPx = convertPxToUnit;
1275
+ anime.path = getPath;
1276
+ anime.setDashoffset = setDashoffset;
1277
+ anime.stagger = stagger;
1278
+ anime.timeline = timeline;
1279
+ anime.easing = parseEasings;
1280
+ anime.penner = penner;
1281
+ anime.random = function (min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; };
1282
+
1283
+ module.exports = anime;