card 1.92.2 → 1.93.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (965) hide show
  1. checksums.yaml +4 -4
  2. data/README.rdoc +3 -3
  3. data/VERSION +1 -1
  4. data/card.gemspec +1 -1
  5. data/config/initializers/01_core_extensions/array.rb +1 -1
  6. data/config/initializers/01_core_extensions/object.rb +9 -0
  7. data/config/initializers/01_core_extensions/persistent_identifiers.rb +1 -1
  8. data/config/initializers/02_patches/action_dispatch.rb +1 -0
  9. data/config/initializers/02_patches/active_record.rb +42 -0
  10. data/config/initializers/02_patches/active_support.rb +13 -0
  11. data/config/initializers/deck_config.rb +3 -0
  12. data/config/initializers/patches.rb +37 -6
  13. data/config/locales/de.yml +1 -3
  14. data/config/locales/en.yml +1 -3
  15. data/db/migrate_core_cards/20120611203506_rails_inflection_updates.rb +3 -3
  16. data/db/migrate_core_cards/20130823192433_add_style_cards.rb +1 -1
  17. data/db/migrate_core_cards/20130920214038_jsonize_tinymce.rb +1 -1
  18. data/db/migrate_core_cards/20140629222005_add_email_cards.rb +4 -4
  19. data/db/migrate_core_cards/20150202143810_import_bootstrap_layout.rb +1 -1
  20. data/db/migrate_core_cards/20150220134731_following_to_follow_rule.rb +1 -1
  21. data/db/migrate_core_cards/20150317162412_bootstrap_themes.rb +1 -1
  22. data/db/migrate_core_cards/20150429090551_search_card_context.rb +2 -2
  23. data/db/migrate_core_cards/20150501010515_responsive_sidebar.rb +1 -1
  24. data/db/migrate_core_cards/20150610180019_add_recaptcha_key_and_admin_info_cards.rb +2 -2
  25. data/db/migrate_core_cards/20150724123438_update_file_and_image_cards.rb +2 -2
  26. data/db/migrate_core_cards/20160811115836_rename_stats_to_admin.rb +1 -1
  27. data/db/migrate_core_cards/20160914132636_fix_mod_files.rb +3 -3
  28. data/db/migrate_core_cards/20170830210517_correct_signup_success_message.rb +2 -2
  29. data/db/migrate_core_cards/data/cards.yml +2 -2
  30. data/db/migrate_core_cards/data/cards/*header +1 -1
  31. data/lib/card.rb +53 -34
  32. data/lib/card/act_manager.rb +64 -10
  33. data/lib/card/act_manager/stage_director.rb +13 -2
  34. data/lib/card/act_manager/stage_director/phases.rb +6 -4
  35. data/lib/card/auth.rb +3 -1
  36. data/lib/card/cache.rb +8 -2
  37. data/lib/card/cache/persistent.rb +23 -10
  38. data/lib/card/codename.rb +59 -18
  39. data/lib/card/dirty.rb +39 -0
  40. data/lib/card/env/location.rb +1 -1
  41. data/lib/card/env/location_history.rb +1 -1
  42. data/lib/card/env/success.rb +1 -1
  43. data/lib/card/error.rb +3 -0
  44. data/lib/card/format.rb +55 -21
  45. data/lib/card/format/content.rb +1 -1
  46. data/lib/card/format/context_names.rb +2 -2
  47. data/lib/card/format/nest.rb +2 -2
  48. data/lib/card/format/nest/fetch.rb +1 -1
  49. data/lib/card/format/nest/subformat.rb +1 -1
  50. data/lib/card/format/render.rb +4 -18
  51. data/lib/card/migration.rb +1 -1
  52. data/lib/card/migration/import.rb +1 -1
  53. data/lib/card/migration/import/import_data.rb +5 -12
  54. data/lib/card/migration/import/import_data/card_attributes.rb +3 -4
  55. data/lib/card/mod.rb +4 -3
  56. data/lib/card/mod/dirs.rb +21 -10
  57. data/lib/card/mod/loader.rb +1 -1
  58. data/lib/card/model/save_helper.rb +1 -1
  59. data/lib/card/name.rb +8 -6
  60. data/lib/card/name/fields_and_traits.rb +5 -10
  61. data/lib/card/query.rb +1 -1
  62. data/lib/card/reference.rb +1 -1
  63. data/lib/card/set.rb +7 -14
  64. data/lib/card/set/advanced_api.rb +1 -0
  65. data/lib/card/set/event.rb +19 -109
  66. data/lib/card/set/event/delayed_event.rb +104 -0
  67. data/lib/card/set/format.rb +2 -2
  68. data/lib/card/set_pattern.rb +4 -4
  69. data/lib/card/subcards.rb +22 -35
  70. data/lib/card/tasks/card.rake +1 -2
  71. data/lib/card/view.rb +1 -2
  72. data/lib/card/view/cache.rb +1 -1
  73. data/lib/card/view/cache_action.rb +1 -1
  74. data/lib/card/view/options.rb +1 -1
  75. data/lib/card/view/stub.rb +5 -1
  76. data/lib/cardio.rb +50 -22
  77. data/mod/Modfile +1 -0
  78. data/mod/account/set/all/account.rb +2 -2
  79. data/mod/account/set/right/account.rb +4 -2
  80. data/mod/account/set/right/email.rb +1 -1
  81. data/mod/account/set/self/account_links.rb +2 -2
  82. data/mod/account/set/self/signin.rb +3 -3
  83. data/mod/account/spec/set/right/account_spec.rb +2 -2
  84. data/mod/account/spec/set/right/email_spec.rb +1 -1
  85. data/mod/account/spec/set/right/password_spec.rb +1 -1
  86. data/mod/account/spec/set/right/salt_spec.rb +1 -1
  87. data/mod/account/spec/set/type/signup_spec.rb +1 -1
  88. data/mod/basic_formats/format/css_format.rb +1 -2
  89. data/mod/basic_formats/format/csv_format.rb +1 -1
  90. data/mod/basic_formats/format/js_format.rb +4 -0
  91. data/mod/basic_formats/set/all/all_css.rb +3 -3
  92. data/mod/basic_formats/set/all/all_js.rb +1 -1
  93. data/mod/basic_formats/set/all/base.rb +5 -5
  94. data/mod/basic_formats/set/all/json.rb +4 -4
  95. data/mod/basic_formats/set/all/rss.rb +3 -3
  96. data/mod/basic_formats/set/self/head.rb +12 -7
  97. data/mod/bootstrap/db/migrate_cards/20170719163710_update_bootswatch_themes_to_4_beta.rb +115 -0
  98. data/mod/bootstrap/db/migrate_cards/20170726145012_select2.rb +7 -7
  99. data/mod/bootstrap/lib/bootstrap/component/panel.rb +1 -1
  100. data/mod/bootstrap/lib/javascript/script_load_select2.js.coffee +2 -0
  101. data/mod/bootstrap/lib/stylesheets/bootstrap_cards.scss +2 -8
  102. data/mod/bootstrap/lib/stylesheets/style_select2_bootstrap.scss +546 -628
  103. data/mod/bootstrap/set/abstract/bootstrap_code_file.rb +9 -6
  104. data/mod/bootstrap/set/all/bootstrap/accordion.rb +3 -3
  105. data/mod/bootstrap/set/all/bootstrap/helper.rb +58 -15
  106. data/mod/bootstrap/set/all/bootstrap/tabs.rb +2 -2
  107. data/mod/bootstrap/set/all/bootstrap/wrapper.rb +1 -1
  108. data/mod/bootstrap/set/self/bootstrap_js.rb +7 -1
  109. data/mod/bootstrap/set/self/bootswatch_shared.rb +8 -17
  110. data/mod/bootstrap/set/self/script_select2.rb +9 -0
  111. data/mod/bootstrap/set/self/style_select2.rb +1 -1
  112. data/mod/bootstrap/set/self/style_select2_bootstrap.rb +1 -0
  113. data/mod/bootstrap/vendor/bootstrap/.editorconfig +17 -0
  114. data/mod/bootstrap/vendor/bootstrap/.gitattributes +15 -0
  115. data/mod/bootstrap/vendor/bootstrap/.gitignore +41 -0
  116. data/mod/bootstrap/vendor/bootstrap/.hound.yml +12 -0
  117. data/mod/bootstrap/vendor/bootstrap/.travis.yml +45 -0
  118. data/mod/bootstrap/vendor/bootstrap/CHANGELOG.md +5 -0
  119. data/mod/bootstrap/vendor/bootstrap/CNAME +1 -0
  120. data/mod/bootstrap/vendor/bootstrap/CONTRIBUTING.md +270 -0
  121. data/mod/bootstrap/vendor/bootstrap/Gemfile +6 -0
  122. data/mod/bootstrap/vendor/bootstrap/Gemfile.lock +49 -0
  123. data/mod/bootstrap/vendor/bootstrap/Gruntfile.js +511 -0
  124. data/mod/bootstrap/vendor/bootstrap/ISSUE_TEMPLATE.md +22 -0
  125. data/mod/bootstrap/vendor/bootstrap/LICENSE +21 -0
  126. data/mod/bootstrap/vendor/bootstrap/README.md +142 -0
  127. data/mod/bootstrap/vendor/bootstrap/_config.yml +42 -0
  128. data/mod/bootstrap/vendor/bootstrap/bower.json +34 -0
  129. data/mod/bootstrap/vendor/bootstrap/composer.json +37 -0
  130. data/mod/bootstrap/vendor/bootstrap/dist/css/bootstrap-theme.css +587 -0
  131. data/mod/bootstrap/vendor/bootstrap/dist/css/bootstrap-theme.css.map +0 -0
  132. data/mod/bootstrap/vendor/bootstrap/dist/css/bootstrap-theme.min.css +6 -0
  133. data/mod/bootstrap/vendor/bootstrap/dist/css/bootstrap-theme.min.css.map +0 -0
  134. data/mod/bootstrap/vendor/bootstrap/dist/css/bootstrap.css +6757 -0
  135. data/mod/bootstrap/vendor/bootstrap/dist/css/bootstrap.css.map +0 -0
  136. data/mod/bootstrap/vendor/bootstrap/dist/css/bootstrap.min.css +6 -0
  137. data/mod/bootstrap/vendor/bootstrap/dist/css/bootstrap.min.css.map +0 -0
  138. data/mod/bootstrap/vendor/bootstrap/dist/fonts/glyphicons-halflings-regular.eot +0 -0
  139. data/mod/bootstrap/vendor/bootstrap/dist/fonts/glyphicons-halflings-regular.svg +288 -0
  140. data/mod/bootstrap/vendor/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf +0 -0
  141. data/mod/bootstrap/vendor/bootstrap/dist/fonts/glyphicons-halflings-regular.woff +0 -0
  142. data/mod/bootstrap/vendor/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 +0 -0
  143. data/mod/bootstrap/vendor/bootstrap/dist/js/bootstrap.js +2377 -0
  144. data/mod/bootstrap/vendor/bootstrap/dist/js/bootstrap.min.js +7 -0
  145. data/mod/bootstrap/vendor/bootstrap/dist/js/npm.js +13 -0
  146. data/mod/bootstrap/vendor/bootstrap/docs/LICENSE +319 -0
  147. data/mod/bootstrap/vendor/bootstrap/docs/_data/browser-bugs.yml +433 -0
  148. data/mod/bootstrap/vendor/bootstrap/docs/_data/browser-features.yml +109 -0
  149. data/mod/bootstrap/vendor/bootstrap/docs/_data/core-team.yml +27 -0
  150. data/mod/bootstrap/vendor/bootstrap/docs/_data/glyphicons.yml +266 -0
  151. data/mod/bootstrap/vendor/bootstrap/docs/_data/sass-team.yml +7 -0
  152. data/mod/bootstrap/vendor/bootstrap/docs/_data/showcase.yml +19 -0
  153. data/mod/bootstrap/vendor/bootstrap/docs/_data/translations.yml +64 -0
  154. data/mod/bootstrap/vendor/bootstrap/docs/_includes/ads.html +1 -0
  155. data/mod/bootstrap/vendor/bootstrap/docs/_includes/components/alerts.html +89 -0
  156. data/mod/bootstrap/vendor/bootstrap/docs/_includes/components/badges.html +45 -0
  157. data/mod/bootstrap/vendor/bootstrap/docs/_includes/components/breadcrumbs.html +27 -0
  158. data/mod/bootstrap/vendor/bootstrap/docs/_includes/components/button-dropdowns.html +321 -0
  159. data/mod/bootstrap/vendor/bootstrap/docs/_includes/components/button-groups.html +268 -0
  160. data/mod/bootstrap/vendor/bootstrap/docs/_includes/components/dropdowns.html +156 -0
  161. data/mod/bootstrap/vendor/bootstrap/docs/_includes/components/glyphicons.html +91 -0
  162. data/mod/bootstrap/vendor/bootstrap/docs/_includes/components/input-groups.html +365 -0
  163. data/mod/bootstrap/vendor/bootstrap/docs/_includes/components/jumbotron.html +27 -0
  164. data/mod/bootstrap/vendor/bootstrap/docs/_includes/components/labels.html +40 -0
  165. data/mod/bootstrap/vendor/bootstrap/docs/_includes/components/list-group.html +188 -0
  166. data/mod/bootstrap/vendor/bootstrap/docs/_includes/components/media.html +207 -0
  167. data/mod/bootstrap/vendor/bootstrap/docs/_includes/components/navbar.html +461 -0
  168. data/mod/bootstrap/vendor/bootstrap/docs/_includes/components/navs.html +189 -0
  169. data/mod/bootstrap/vendor/bootstrap/docs/_includes/components/page-header.html +15 -0
  170. data/mod/bootstrap/vendor/bootstrap/docs/_includes/components/pagination.html +202 -0
  171. data/mod/bootstrap/vendor/bootstrap/docs/_includes/components/panels.html +279 -0
  172. data/mod/bootstrap/vendor/bootstrap/docs/_includes/components/progress-bars.html +214 -0
  173. data/mod/bootstrap/vendor/bootstrap/docs/_includes/components/responsive-embed.html +23 -0
  174. data/mod/bootstrap/vendor/bootstrap/docs/_includes/components/thumbnails.html +94 -0
  175. data/mod/bootstrap/vendor/bootstrap/docs/_includes/components/wells.html +33 -0
  176. data/mod/bootstrap/vendor/bootstrap/docs/_includes/css/buttons.html +189 -0
  177. data/mod/bootstrap/vendor/bootstrap/docs/_includes/css/code.html +52 -0
  178. data/mod/bootstrap/vendor/bootstrap/docs/_includes/css/forms.html +1029 -0
  179. data/mod/bootstrap/vendor/bootstrap/docs/_includes/css/grid.html +560 -0
  180. data/mod/bootstrap/vendor/bootstrap/docs/_includes/css/helpers.html +207 -0
  181. data/mod/bootstrap/vendor/bootstrap/docs/_includes/css/images.html +31 -0
  182. data/mod/bootstrap/vendor/bootstrap/docs/_includes/css/less.html +499 -0
  183. data/mod/bootstrap/vendor/bootstrap/docs/_includes/css/overview.html +52 -0
  184. data/mod/bootstrap/vendor/bootstrap/docs/_includes/css/responsive-utilities.html +258 -0
  185. data/mod/bootstrap/vendor/bootstrap/docs/_includes/css/sass.html +52 -0
  186. data/mod/bootstrap/vendor/bootstrap/docs/_includes/css/tables.html +467 -0
  187. data/mod/bootstrap/vendor/bootstrap/docs/_includes/css/type.html +461 -0
  188. data/mod/bootstrap/vendor/bootstrap/docs/_includes/customizer-variables.html +1892 -0
  189. data/mod/bootstrap/vendor/bootstrap/docs/_includes/footer.html +67 -0
  190. data/mod/bootstrap/vendor/bootstrap/docs/_includes/getting-started/accessibility.html +37 -0
  191. data/mod/bootstrap/vendor/bootstrap/docs/_includes/getting-started/browser-device-support.html +237 -0
  192. data/mod/bootstrap/vendor/bootstrap/docs/_includes/getting-started/community.html +13 -0
  193. data/mod/bootstrap/vendor/bootstrap/docs/_includes/getting-started/disabling-responsiveness.html +22 -0
  194. data/mod/bootstrap/vendor/bootstrap/docs/_includes/getting-started/download.html +63 -0
  195. data/mod/bootstrap/vendor/bootstrap/docs/_includes/getting-started/examples.html +161 -0
  196. data/mod/bootstrap/vendor/bootstrap/docs/_includes/getting-started/grunt.html +35 -0
  197. data/mod/bootstrap/vendor/bootstrap/docs/_includes/getting-started/license.html +34 -0
  198. data/mod/bootstrap/vendor/bootstrap/docs/_includes/getting-started/template.html +37 -0
  199. data/mod/bootstrap/vendor/bootstrap/docs/_includes/getting-started/third-party-support.html +51 -0
  200. data/mod/bootstrap/vendor/bootstrap/docs/_includes/getting-started/tools.html +6 -0
  201. data/mod/bootstrap/vendor/bootstrap/docs/_includes/getting-started/translations.html +12 -0
  202. data/mod/bootstrap/vendor/bootstrap/docs/_includes/getting-started/whats-included.html +55 -0
  203. data/mod/bootstrap/vendor/bootstrap/docs/_includes/header.html +58 -0
  204. data/mod/bootstrap/vendor/bootstrap/docs/_includes/js/affix.html +129 -0
  205. data/mod/bootstrap/vendor/bootstrap/docs/_includes/js/alerts.html +73 -0
  206. data/mod/bootstrap/vendor/bootstrap/docs/_includes/js/buttons.html +139 -0
  207. data/mod/bootstrap/vendor/bootstrap/docs/_includes/js/carousel.html +260 -0
  208. data/mod/bootstrap/vendor/bootstrap/docs/_includes/js/collapse.html +277 -0
  209. data/mod/bootstrap/vendor/bootstrap/docs/_includes/js/dropdowns.html +201 -0
  210. data/mod/bootstrap/vendor/bootstrap/docs/_includes/js/modal.html +520 -0
  211. data/mod/bootstrap/vendor/bootstrap/docs/_includes/js/overview.html +86 -0
  212. data/mod/bootstrap/vendor/bootstrap/docs/_includes/js/popovers.html +309 -0
  213. data/mod/bootstrap/vendor/bootstrap/docs/_includes/js/scrollspy.html +151 -0
  214. data/mod/bootstrap/vendor/bootstrap/docs/_includes/js/tabs.html +147 -0
  215. data/mod/bootstrap/vendor/bootstrap/docs/_includes/js/tooltips.html +276 -0
  216. data/mod/bootstrap/vendor/bootstrap/docs/_includes/js/transitions.html +15 -0
  217. data/mod/bootstrap/vendor/bootstrap/docs/_includes/nav/about.html +9 -0
  218. data/mod/bootstrap/vendor/bootstrap/docs/_includes/nav/components.html +146 -0
  219. data/mod/bootstrap/vendor/bootstrap/docs/_includes/nav/css.html +136 -0
  220. data/mod/bootstrap/vendor/bootstrap/docs/_includes/nav/customize.html +47 -0
  221. data/mod/bootstrap/vendor/bootstrap/docs/_includes/nav/getting-started.html +76 -0
  222. data/mod/bootstrap/vendor/bootstrap/docs/_includes/nav/javascript.html +124 -0
  223. data/mod/bootstrap/vendor/bootstrap/docs/_includes/nav/main.html +37 -0
  224. data/mod/bootstrap/vendor/bootstrap/docs/_includes/nav/migration.html +12 -0
  225. data/mod/bootstrap/vendor/bootstrap/docs/_layouts/default.html +65 -0
  226. data/mod/bootstrap/vendor/bootstrap/docs/_layouts/home.html +19 -0
  227. data/mod/bootstrap/vendor/bootstrap/docs/_plugins/bridge.rb +9 -0
  228. data/mod/bootstrap/vendor/bootstrap/docs/_plugins/bugify.rb +26 -0
  229. data/mod/bootstrap/vendor/bootstrap/docs/_pug/customizer-nav.pug +17 -0
  230. data/mod/bootstrap/vendor/bootstrap/docs/_pug/customizer-variables.pug +25 -0
  231. data/mod/bootstrap/vendor/bootstrap/docs/about.html +127 -0
  232. data/mod/bootstrap/vendor/bootstrap/docs/apple-touch-icon.png +0 -0
  233. data/mod/bootstrap/vendor/bootstrap/docs/assets/brand/bootstrap-outline.svg +20 -0
  234. data/mod/bootstrap/vendor/bootstrap/docs/assets/brand/bootstrap-punchout.svg +18 -0
  235. data/mod/bootstrap/vendor/bootstrap/docs/assets/brand/bootstrap-solid.svg +17 -0
  236. data/mod/bootstrap/vendor/bootstrap/docs/assets/css/docs.min.css +11 -0
  237. data/mod/bootstrap/vendor/bootstrap/docs/assets/css/docs.min.css.map +0 -0
  238. data/mod/bootstrap/vendor/bootstrap/docs/assets/css/ie10-viewport-bug-workaround.css +13 -0
  239. data/mod/bootstrap/vendor/bootstrap/docs/assets/css/src/docs.css +1632 -0
  240. data/mod/bootstrap/vendor/bootstrap/docs/assets/css/src/pygments-manni.css +66 -0
  241. data/mod/bootstrap/vendor/bootstrap/docs/assets/flash/ZeroClipboard.swf +0 -0
  242. data/mod/bootstrap/vendor/bootstrap/docs/assets/img/components.png +0 -0
  243. data/mod/bootstrap/vendor/bootstrap/docs/assets/img/devices.png +0 -0
  244. data/mod/bootstrap/vendor/bootstrap/docs/assets/img/expo-lyft.jpg +0 -0
  245. data/mod/bootstrap/vendor/bootstrap/docs/assets/img/expo-newsweek.jpg +0 -0
  246. data/mod/bootstrap/vendor/bootstrap/docs/assets/img/expo-riot.jpg +0 -0
  247. data/mod/bootstrap/vendor/bootstrap/docs/assets/img/expo-vogue.jpg +0 -0
  248. data/mod/bootstrap/vendor/bootstrap/docs/assets/img/sass-less.png +0 -0
  249. data/mod/bootstrap/vendor/bootstrap/docs/assets/js/customize.min.js +91 -0
  250. data/mod/bootstrap/vendor/bootstrap/docs/assets/js/docs.min.js +26 -0
  251. data/mod/bootstrap/vendor/bootstrap/docs/assets/js/ie-emulation-modes-warning.js +51 -0
  252. data/mod/bootstrap/vendor/bootstrap/docs/assets/js/ie10-viewport-bug-workaround.js +23 -0
  253. data/mod/bootstrap/vendor/bootstrap/docs/assets/js/ie8-responsive-file-warning.js +13 -0
  254. data/mod/bootstrap/vendor/bootstrap/docs/assets/js/raw-files.min.js +8 -0
  255. data/mod/bootstrap/vendor/bootstrap/docs/assets/js/src/application.js +183 -0
  256. data/mod/bootstrap/vendor/bootstrap/docs/assets/js/src/customizer.js +520 -0
  257. data/mod/bootstrap/vendor/bootstrap/docs/assets/js/vendor/Blob.js +211 -0
  258. data/mod/bootstrap/vendor/bootstrap/docs/assets/js/vendor/FileSaver.js +248 -0
  259. data/mod/bootstrap/vendor/bootstrap/docs/assets/js/vendor/ZeroClipboard.min.js +9 -0
  260. data/mod/bootstrap/vendor/bootstrap/docs/assets/js/vendor/anchor.min.js +6 -0
  261. data/mod/bootstrap/vendor/bootstrap/docs/assets/js/vendor/autoprefixer.js +21114 -0
  262. data/mod/bootstrap/vendor/bootstrap/docs/assets/js/vendor/holder.min.js +12 -0
  263. data/mod/bootstrap/vendor/bootstrap/docs/assets/js/vendor/jquery.min.js +5 -0
  264. data/mod/bootstrap/vendor/bootstrap/docs/assets/js/vendor/jszip.min.js +14 -0
  265. data/mod/bootstrap/vendor/bootstrap/docs/assets/js/vendor/less.min.js +16 -0
  266. data/mod/bootstrap/vendor/bootstrap/docs/assets/js/vendor/uglify.min.js +6 -0
  267. data/mod/bootstrap/vendor/bootstrap/docs/browser-bugs.html +75 -0
  268. data/mod/bootstrap/vendor/bootstrap/docs/components.html +29 -0
  269. data/mod/bootstrap/vendor/bootstrap/docs/css.html +20 -0
  270. data/mod/bootstrap/vendor/bootstrap/docs/customize.html +385 -0
  271. data/mod/bootstrap/vendor/bootstrap/docs/dist/css/bootstrap-theme.css +587 -0
  272. data/mod/bootstrap/vendor/bootstrap/docs/dist/css/bootstrap-theme.css.map +0 -0
  273. data/mod/bootstrap/vendor/bootstrap/docs/dist/css/bootstrap-theme.min.css +6 -0
  274. data/mod/bootstrap/vendor/bootstrap/docs/dist/css/bootstrap-theme.min.css.map +0 -0
  275. data/mod/bootstrap/vendor/bootstrap/docs/dist/css/bootstrap.css +6757 -0
  276. data/mod/bootstrap/vendor/bootstrap/docs/dist/css/bootstrap.css.map +0 -0
  277. data/mod/bootstrap/vendor/bootstrap/docs/dist/css/bootstrap.min.css +6 -0
  278. data/mod/bootstrap/vendor/bootstrap/docs/dist/css/bootstrap.min.css.map +0 -0
  279. data/mod/bootstrap/vendor/bootstrap/docs/dist/fonts/glyphicons-halflings-regular.eot +0 -0
  280. data/mod/bootstrap/vendor/bootstrap/docs/dist/fonts/glyphicons-halflings-regular.svg +288 -0
  281. data/mod/bootstrap/vendor/bootstrap/docs/dist/fonts/glyphicons-halflings-regular.ttf +0 -0
  282. data/mod/bootstrap/vendor/bootstrap/docs/dist/fonts/glyphicons-halflings-regular.woff +0 -0
  283. data/mod/bootstrap/vendor/bootstrap/docs/dist/fonts/glyphicons-halflings-regular.woff2 +0 -0
  284. data/mod/bootstrap/vendor/bootstrap/docs/dist/js/bootstrap.js +2377 -0
  285. data/mod/bootstrap/vendor/bootstrap/docs/dist/js/bootstrap.min.js +7 -0
  286. data/mod/bootstrap/vendor/bootstrap/docs/dist/js/npm.js +13 -0
  287. data/mod/bootstrap/vendor/bootstrap/docs/examples/blog/blog.css +166 -0
  288. data/mod/bootstrap/vendor/bootstrap/docs/examples/blog/index.html +180 -0
  289. data/mod/bootstrap/vendor/bootstrap/docs/examples/carousel/carousel.css +134 -0
  290. data/mod/bootstrap/vendor/bootstrap/docs/examples/carousel/index.html +220 -0
  291. data/mod/bootstrap/vendor/bootstrap/docs/examples/cover/cover.css +163 -0
  292. data/mod/bootstrap/vendor/bootstrap/docs/examples/cover/index.html +84 -0
  293. data/mod/bootstrap/vendor/bootstrap/docs/examples/dashboard/dashboard.css +105 -0
  294. data/mod/bootstrap/vendor/bootstrap/docs/examples/dashboard/index.html +252 -0
  295. data/mod/bootstrap/vendor/bootstrap/docs/examples/grid/grid.css +23 -0
  296. data/mod/bootstrap/vendor/bootstrap/docs/examples/grid/index.html +156 -0
  297. data/mod/bootstrap/vendor/bootstrap/docs/examples/jumbotron-narrow/index.html +88 -0
  298. data/mod/bootstrap/vendor/bootstrap/docs/examples/jumbotron-narrow/jumbotron-narrow.css +79 -0
  299. data/mod/bootstrap/vendor/bootstrap/docs/examples/jumbotron/index.html +107 -0
  300. data/mod/bootstrap/vendor/bootstrap/docs/examples/jumbotron/jumbotron.css +5 -0
  301. data/mod/bootstrap/vendor/bootstrap/docs/examples/justified-nav/index.html +92 -0
  302. data/mod/bootstrap/vendor/bootstrap/docs/examples/justified-nav/justified-nav.css +88 -0
  303. data/mod/bootstrap/vendor/bootstrap/docs/examples/navbar-fixed-top/index.html +99 -0
  304. data/mod/bootstrap/vendor/bootstrap/docs/examples/navbar-fixed-top/navbar-fixed-top.css +4 -0
  305. data/mod/bootstrap/vendor/bootstrap/docs/examples/navbar-static-top/index.html +100 -0
  306. data/mod/bootstrap/vendor/bootstrap/docs/examples/navbar-static-top/navbar-static-top.css +7 -0
  307. data/mod/bootstrap/vendor/bootstrap/docs/examples/navbar/index.html +98 -0
  308. data/mod/bootstrap/vendor/bootstrap/docs/examples/navbar/navbar.css +8 -0
  309. data/mod/bootstrap/vendor/bootstrap/docs/examples/non-responsive/index.html +115 -0
  310. data/mod/bootstrap/vendor/bootstrap/docs/examples/non-responsive/non-responsive.css +262 -0
  311. data/mod/bootstrap/vendor/bootstrap/docs/examples/offcanvas/index.html +137 -0
  312. data/mod/bootstrap/vendor/bootstrap/docs/examples/offcanvas/offcanvas.css +59 -0
  313. data/mod/bootstrap/vendor/bootstrap/docs/examples/offcanvas/offcanvas.js +5 -0
  314. data/mod/bootstrap/vendor/bootstrap/docs/examples/screenshots/blog.jpg +0 -0
  315. data/mod/bootstrap/vendor/bootstrap/docs/examples/screenshots/carousel.jpg +0 -0
  316. data/mod/bootstrap/vendor/bootstrap/docs/examples/screenshots/cover.jpg +0 -0
  317. data/mod/bootstrap/vendor/bootstrap/docs/examples/screenshots/dashboard.jpg +0 -0
  318. data/mod/bootstrap/vendor/bootstrap/docs/examples/screenshots/equal-height-columns.jpg +0 -0
  319. data/mod/bootstrap/vendor/bootstrap/docs/examples/screenshots/grid.jpg +0 -0
  320. data/mod/bootstrap/vendor/bootstrap/docs/examples/screenshots/jumbotron-narrow.jpg +0 -0
  321. data/mod/bootstrap/vendor/bootstrap/docs/examples/screenshots/jumbotron.jpg +0 -0
  322. data/mod/bootstrap/vendor/bootstrap/docs/examples/screenshots/justified-nav.jpg +0 -0
  323. data/mod/bootstrap/vendor/bootstrap/docs/examples/screenshots/navbar-fixed.jpg +0 -0
  324. data/mod/bootstrap/vendor/bootstrap/docs/examples/screenshots/navbar-static.jpg +0 -0
  325. data/mod/bootstrap/vendor/bootstrap/docs/examples/screenshots/navbar.jpg +0 -0
  326. data/mod/bootstrap/vendor/bootstrap/docs/examples/screenshots/non-responsive.jpg +0 -0
  327. data/mod/bootstrap/vendor/bootstrap/docs/examples/screenshots/offcanvas.jpg +0 -0
  328. data/mod/bootstrap/vendor/bootstrap/docs/examples/screenshots/sign-in.jpg +0 -0
  329. data/mod/bootstrap/vendor/bootstrap/docs/examples/screenshots/starter-template.jpg +0 -0
  330. data/mod/bootstrap/vendor/bootstrap/docs/examples/screenshots/sticky-footer-navbar.jpg +0 -0
  331. data/mod/bootstrap/vendor/bootstrap/docs/examples/screenshots/sticky-footer.jpg +0 -0
  332. data/mod/bootstrap/vendor/bootstrap/docs/examples/screenshots/theme.jpg +0 -0
  333. data/mod/bootstrap/vendor/bootstrap/docs/examples/signin/index.html +58 -0
  334. data/mod/bootstrap/vendor/bootstrap/docs/examples/signin/signin.css +40 -0
  335. data/mod/bootstrap/vendor/bootstrap/docs/examples/starter-template/index.html +76 -0
  336. data/mod/bootstrap/vendor/bootstrap/docs/examples/starter-template/starter-template.css +7 -0
  337. data/mod/bootstrap/vendor/bootstrap/docs/examples/sticky-footer-navbar/index.html +95 -0
  338. data/mod/bootstrap/vendor/bootstrap/docs/examples/sticky-footer-navbar/sticky-footer-navbar.css +39 -0
  339. data/mod/bootstrap/vendor/bootstrap/docs/examples/sticky-footer/index.html +55 -0
  340. data/mod/bootstrap/vendor/bootstrap/docs/examples/sticky-footer/sticky-footer.css +32 -0
  341. data/mod/bootstrap/vendor/bootstrap/docs/examples/theme/index.html +644 -0
  342. data/mod/bootstrap/vendor/bootstrap/docs/examples/theme/theme.css +18 -0
  343. data/mod/bootstrap/vendor/bootstrap/docs/examples/tooltip-viewport/index.html +62 -0
  344. data/mod/bootstrap/vendor/bootstrap/docs/examples/tooltip-viewport/tooltip-viewport.css +26 -0
  345. data/mod/bootstrap/vendor/bootstrap/docs/examples/tooltip-viewport/tooltip-viewport.js +18 -0
  346. data/mod/bootstrap/vendor/bootstrap/docs/favicon.ico +0 -0
  347. data/mod/bootstrap/vendor/bootstrap/docs/getting-started.html +28 -0
  348. data/mod/bootstrap/vendor/bootstrap/docs/index.html +73 -0
  349. data/mod/bootstrap/vendor/bootstrap/docs/javascript.html +21 -0
  350. data/mod/bootstrap/vendor/bootstrap/docs/migration.html +445 -0
  351. data/mod/bootstrap/vendor/bootstrap/docs/robots.txt +9 -0
  352. data/mod/bootstrap/vendor/bootstrap/fonts/glyphicons-halflings-regular.eot +0 -0
  353. data/mod/bootstrap/vendor/bootstrap/fonts/glyphicons-halflings-regular.svg +288 -0
  354. data/mod/bootstrap/vendor/bootstrap/fonts/glyphicons-halflings-regular.ttf +0 -0
  355. data/mod/bootstrap/vendor/bootstrap/fonts/glyphicons-halflings-regular.woff +0 -0
  356. data/mod/bootstrap/vendor/bootstrap/fonts/glyphicons-halflings-regular.woff2 +0 -0
  357. data/mod/bootstrap/vendor/bootstrap/grunt/.jshintrc +7 -0
  358. data/mod/bootstrap/vendor/bootstrap/grunt/bs-commonjs-generator.js +30 -0
  359. data/mod/bootstrap/vendor/bootstrap/grunt/bs-glyphicons-data-generator.js +42 -0
  360. data/mod/bootstrap/vendor/bootstrap/grunt/bs-lessdoc-parser.js +237 -0
  361. data/mod/bootstrap/vendor/bootstrap/grunt/bs-raw-files-generator.js +44 -0
  362. data/mod/bootstrap/vendor/bootstrap/grunt/change-version.js +109 -0
  363. data/mod/bootstrap/vendor/bootstrap/grunt/configBridge.json +46 -0
  364. data/mod/bootstrap/vendor/bootstrap/grunt/npm-shrinkwrap.json +2679 -0
  365. data/mod/bootstrap/vendor/bootstrap/grunt/sauce_browsers.yml +82 -0
  366. data/mod/bootstrap/vendor/bootstrap/js/.jscsrc +42 -0
  367. data/mod/bootstrap/vendor/bootstrap/js/.jshintrc +15 -0
  368. data/mod/bootstrap/vendor/bootstrap/js/affix.js +162 -0
  369. data/mod/bootstrap/vendor/bootstrap/js/alert.js +94 -0
  370. data/mod/bootstrap/vendor/bootstrap/js/button.js +125 -0
  371. data/mod/bootstrap/vendor/bootstrap/js/carousel.js +239 -0
  372. data/mod/bootstrap/vendor/bootstrap/js/collapse.js +212 -0
  373. data/mod/bootstrap/vendor/bootstrap/js/dropdown.js +165 -0
  374. data/mod/bootstrap/vendor/bootstrap/js/modal.js +339 -0
  375. data/mod/bootstrap/vendor/bootstrap/js/popover.js +108 -0
  376. data/mod/bootstrap/vendor/bootstrap/js/scrollspy.js +172 -0
  377. data/mod/bootstrap/vendor/bootstrap/js/tab.js +155 -0
  378. data/mod/bootstrap/vendor/bootstrap/js/tests/README.md +62 -0
  379. data/mod/bootstrap/vendor/bootstrap/js/tests/index.html +169 -0
  380. data/mod/bootstrap/vendor/bootstrap/js/tests/unit/.jshintrc +6 -0
  381. data/mod/bootstrap/vendor/bootstrap/js/tests/unit/affix.js +107 -0
  382. data/mod/bootstrap/vendor/bootstrap/js/tests/unit/alert.js +78 -0
  383. data/mod/bootstrap/vendor/bootstrap/js/tests/unit/button.js +168 -0
  384. data/mod/bootstrap/vendor/bootstrap/js/tests/unit/carousel.js +718 -0
  385. data/mod/bootstrap/vendor/bootstrap/js/tests/unit/collapse.js +443 -0
  386. data/mod/bootstrap/vendor/bootstrap/js/tests/unit/dropdown.js +423 -0
  387. data/mod/bootstrap/vendor/bootstrap/js/tests/unit/modal.js +377 -0
  388. data/mod/bootstrap/vendor/bootstrap/js/tests/unit/phantom.js +72 -0
  389. data/mod/bootstrap/vendor/bootstrap/js/tests/unit/popover.js +290 -0
  390. data/mod/bootstrap/vendor/bootstrap/js/tests/unit/scrollspy.js +278 -0
  391. data/mod/bootstrap/vendor/bootstrap/js/tests/unit/tab.js +216 -0
  392. data/mod/bootstrap/vendor/bootstrap/js/tests/unit/tooltip.js +1325 -0
  393. data/mod/bootstrap/vendor/bootstrap/js/tests/vendor/jquery.min.js +5 -0
  394. data/mod/bootstrap/vendor/bootstrap/js/tests/vendor/qunit.css +305 -0
  395. data/mod/bootstrap/vendor/bootstrap/js/tests/vendor/qunit.js +4204 -0
  396. data/mod/bootstrap/vendor/bootstrap/js/tests/visual/affix-with-sticky-footer.html +317 -0
  397. data/mod/bootstrap/vendor/bootstrap/js/tests/visual/affix.html +306 -0
  398. data/mod/bootstrap/vendor/bootstrap/js/tests/visual/alert.html +48 -0
  399. data/mod/bootstrap/vendor/bootstrap/js/tests/visual/button.html +79 -0
  400. data/mod/bootstrap/vendor/bootstrap/js/tests/visual/carousel.html +58 -0
  401. data/mod/bootstrap/vendor/bootstrap/js/tests/visual/collapse.html +78 -0
  402. data/mod/bootstrap/vendor/bootstrap/js/tests/visual/dropdown.html +108 -0
  403. data/mod/bootstrap/vendor/bootstrap/js/tests/visual/modal.html +205 -0
  404. data/mod/bootstrap/vendor/bootstrap/js/tests/visual/popover.html +54 -0
  405. data/mod/bootstrap/vendor/bootstrap/js/tests/visual/scrollspy.html +109 -0
  406. data/mod/bootstrap/vendor/bootstrap/js/tests/visual/tab.html +172 -0
  407. data/mod/bootstrap/vendor/bootstrap/js/tests/visual/tooltip.html +50 -0
  408. data/mod/bootstrap/vendor/bootstrap/js/tooltip.js +520 -0
  409. data/mod/bootstrap/vendor/bootstrap/js/transition.js +59 -0
  410. data/mod/bootstrap/vendor/bootstrap/less/.csscomb.json +304 -0
  411. data/mod/bootstrap/vendor/bootstrap/less/.csslintrc +19 -0
  412. data/mod/bootstrap/vendor/bootstrap/less/alerts.less +73 -0
  413. data/mod/bootstrap/vendor/bootstrap/less/badges.less +66 -0
  414. data/mod/bootstrap/vendor/bootstrap/less/bootstrap.less +56 -0
  415. data/mod/bootstrap/vendor/bootstrap/less/breadcrumbs.less +26 -0
  416. data/mod/bootstrap/{lib/stylesheets/bootstrap/scss/_button-group.scss → vendor/bootstrap/less/button-groups.less} +100 -58
  417. data/mod/bootstrap/vendor/bootstrap/less/buttons.less +166 -0
  418. data/mod/bootstrap/vendor/bootstrap/less/carousel.less +270 -0
  419. data/mod/bootstrap/vendor/bootstrap/less/close.less +34 -0
  420. data/mod/bootstrap/vendor/bootstrap/less/code.less +69 -0
  421. data/mod/bootstrap/vendor/bootstrap/less/component-animations.less +33 -0
  422. data/mod/bootstrap/vendor/bootstrap/less/dropdowns.less +216 -0
  423. data/mod/bootstrap/vendor/bootstrap/less/forms.less +613 -0
  424. data/mod/bootstrap/vendor/bootstrap/less/glyphicons.less +305 -0
  425. data/mod/bootstrap/vendor/bootstrap/less/grid.less +84 -0
  426. data/mod/bootstrap/vendor/bootstrap/less/input-groups.less +171 -0
  427. data/mod/bootstrap/vendor/bootstrap/less/jumbotron.less +54 -0
  428. data/mod/bootstrap/vendor/bootstrap/less/labels.less +64 -0
  429. data/mod/bootstrap/vendor/bootstrap/less/list-group.less +130 -0
  430. data/mod/bootstrap/vendor/bootstrap/less/media.less +66 -0
  431. data/mod/bootstrap/vendor/bootstrap/less/mixins.less +40 -0
  432. data/mod/bootstrap/vendor/bootstrap/less/mixins/alerts.less +14 -0
  433. data/mod/bootstrap/vendor/bootstrap/less/mixins/background-variant.less +9 -0
  434. data/mod/bootstrap/vendor/bootstrap/less/mixins/border-radius.less +18 -0
  435. data/mod/bootstrap/vendor/bootstrap/less/mixins/buttons.less +65 -0
  436. data/mod/bootstrap/vendor/bootstrap/less/mixins/center-block.less +7 -0
  437. data/mod/bootstrap/vendor/bootstrap/less/mixins/clearfix.less +22 -0
  438. data/mod/bootstrap/vendor/bootstrap/less/mixins/forms.less +85 -0
  439. data/mod/bootstrap/vendor/bootstrap/less/mixins/gradients.less +59 -0
  440. data/mod/bootstrap/vendor/bootstrap/less/mixins/grid-framework.less +91 -0
  441. data/mod/bootstrap/vendor/bootstrap/less/mixins/grid.less +122 -0
  442. data/mod/bootstrap/vendor/bootstrap/less/mixins/hide-text.less +21 -0
  443. data/mod/bootstrap/vendor/bootstrap/less/mixins/image.less +33 -0
  444. data/mod/bootstrap/vendor/bootstrap/less/mixins/labels.less +12 -0
  445. data/mod/bootstrap/vendor/bootstrap/less/mixins/list-group.less +30 -0
  446. data/mod/bootstrap/{lib/stylesheets/bootstrap/scss/mixins/_nav-divider.scss → vendor/bootstrap/less/mixins/nav-divider.less} +3 -3
  447. data/mod/bootstrap/{lib/stylesheets/bootstrap/scss/mixins/_navbar-align.scss → vendor/bootstrap/less/mixins/nav-vertical-align.less} +4 -4
  448. data/mod/bootstrap/vendor/bootstrap/less/mixins/opacity.less +8 -0
  449. data/mod/bootstrap/vendor/bootstrap/less/mixins/pagination.less +24 -0
  450. data/mod/bootstrap/vendor/bootstrap/less/mixins/panels.less +24 -0
  451. data/mod/bootstrap/vendor/bootstrap/less/mixins/progress-bar.less +10 -0
  452. data/mod/bootstrap/vendor/bootstrap/less/mixins/reset-filter.less +8 -0
  453. data/mod/bootstrap/{lib/stylesheets/bootstrap/scss/mixins/_reset-text.scss → vendor/bootstrap/less/mixins/reset-text.less} +6 -5
  454. data/mod/bootstrap/{lib/stylesheets/bootstrap/scss/mixins/_resize.scss → vendor/bootstrap/less/mixins/resize.less} +2 -2
  455. data/mod/bootstrap/vendor/bootstrap/less/mixins/responsive-visibility.less +15 -0
  456. data/mod/bootstrap/vendor/bootstrap/less/mixins/size.less +10 -0
  457. data/mod/bootstrap/vendor/bootstrap/less/mixins/tab-focus.less +9 -0
  458. data/mod/bootstrap/vendor/bootstrap/less/mixins/table-row.less +28 -0
  459. data/mod/bootstrap/vendor/bootstrap/less/mixins/text-emphasis.less +9 -0
  460. data/mod/bootstrap/{lib/stylesheets/bootstrap/scss/mixins/_text-truncate.scss → vendor/bootstrap/less/mixins/text-overflow.less} +3 -3
  461. data/mod/bootstrap/vendor/bootstrap/less/mixins/vendor-prefixes.less +227 -0
  462. data/mod/bootstrap/vendor/bootstrap/less/modals.less +150 -0
  463. data/mod/bootstrap/vendor/bootstrap/less/navbar.less +660 -0
  464. data/mod/bootstrap/vendor/bootstrap/less/navs.less +242 -0
  465. data/mod/bootstrap/vendor/bootstrap/less/normalize.less +424 -0
  466. data/mod/bootstrap/vendor/bootstrap/less/pager.less +54 -0
  467. data/mod/bootstrap/vendor/bootstrap/less/pagination.less +89 -0
  468. data/mod/bootstrap/vendor/bootstrap/less/panels.less +271 -0
  469. data/mod/bootstrap/vendor/bootstrap/less/popovers.less +131 -0
  470. data/mod/bootstrap/vendor/bootstrap/less/print.less +101 -0
  471. data/mod/bootstrap/vendor/bootstrap/less/progress-bars.less +87 -0
  472. data/mod/bootstrap/{lib/stylesheets/bootstrap/scss/_responsive-embed.scss → vendor/bootstrap/less/responsive-embed.less} +9 -26
  473. data/mod/bootstrap/vendor/bootstrap/less/responsive-utilities.less +194 -0
  474. data/mod/bootstrap/vendor/bootstrap/less/scaffolding.less +161 -0
  475. data/mod/bootstrap/vendor/bootstrap/less/tables.less +234 -0
  476. data/mod/bootstrap/vendor/bootstrap/less/theme.less +291 -0
  477. data/mod/bootstrap/vendor/bootstrap/less/thumbnails.less +36 -0
  478. data/mod/bootstrap/vendor/bootstrap/less/tooltip.less +101 -0
  479. data/mod/bootstrap/vendor/bootstrap/less/type.less +302 -0
  480. data/mod/bootstrap/vendor/bootstrap/less/utilities.less +55 -0
  481. data/mod/bootstrap/vendor/bootstrap/less/variables.less +869 -0
  482. data/mod/bootstrap/vendor/bootstrap/less/wells.less +29 -0
  483. data/mod/bootstrap/vendor/bootstrap/nuget/MyGet.ps1 +8 -0
  484. data/mod/bootstrap/vendor/bootstrap/nuget/bootstrap.less.nuspec +28 -0
  485. data/mod/bootstrap/vendor/bootstrap/nuget/bootstrap.nuspec +28 -0
  486. data/mod/bootstrap/vendor/bootstrap/package.js +32 -0
  487. data/mod/bootstrap/vendor/bootstrap/package.json +89 -0
  488. data/mod/bootstrap/vendor/bootswatch/README.md +63 -0
  489. data/mod/bootstrap/vendor/bootswatch/swatchmaker/README.md +1 -0
  490. data/mod/bootstrap/vendor/select2/.editorconfig +6 -0
  491. data/mod/bootstrap/vendor/select2/.github/CONTRIBUTING.md +203 -0
  492. data/mod/bootstrap/vendor/select2/.github/ISSUE_TEMPLATE.md +20 -0
  493. data/mod/bootstrap/vendor/select2/.github/PULL_REQUEST_TEMPLATE.md +13 -0
  494. data/mod/bootstrap/vendor/select2/.gitignore +3 -0
  495. data/mod/bootstrap/vendor/select2/.jshintignore +4 -0
  496. data/mod/bootstrap/vendor/select2/.jshintrc +25 -0
  497. data/mod/bootstrap/vendor/select2/.travis.yml +22 -0
  498. data/mod/bootstrap/vendor/select2/CHANGELOG.md +272 -0
  499. data/mod/bootstrap/vendor/select2/Gruntfile.js +380 -0
  500. data/mod/bootstrap/vendor/select2/LICENSE.md +21 -0
  501. data/mod/bootstrap/vendor/select2/README.md +123 -0
  502. data/mod/bootstrap/vendor/select2/bower.json +13 -0
  503. data/mod/bootstrap/vendor/select2/component.json +19 -0
  504. data/mod/bootstrap/vendor/select2/composer.json +25 -0
  505. data/mod/bootstrap/{lib/stylesheets/style_select2.css → vendor/select2/dist/css/select2.css} +0 -0
  506. data/mod/bootstrap/{lib/stylesheets → vendor/select2/dist/css}/select2.min.css +0 -0
  507. data/mod/bootstrap/vendor/select2/dist/js/i18n/af.js +3 -0
  508. data/mod/bootstrap/vendor/select2/dist/js/i18n/ar.js +3 -0
  509. data/mod/bootstrap/vendor/select2/dist/js/i18n/az.js +3 -0
  510. data/mod/bootstrap/vendor/select2/dist/js/i18n/bg.js +3 -0
  511. data/mod/bootstrap/vendor/select2/dist/js/i18n/bs.js +3 -0
  512. data/mod/bootstrap/vendor/select2/dist/js/i18n/ca.js +3 -0
  513. data/mod/bootstrap/vendor/select2/dist/js/i18n/cs.js +3 -0
  514. data/mod/bootstrap/vendor/select2/dist/js/i18n/da.js +3 -0
  515. data/mod/bootstrap/vendor/select2/dist/js/i18n/de.js +3 -0
  516. data/mod/bootstrap/vendor/select2/dist/js/i18n/dsb.js +3 -0
  517. data/mod/bootstrap/vendor/select2/dist/js/i18n/el.js +3 -0
  518. data/mod/bootstrap/vendor/select2/dist/js/i18n/en.js +3 -0
  519. data/mod/bootstrap/vendor/select2/dist/js/i18n/es.js +3 -0
  520. data/mod/bootstrap/vendor/select2/dist/js/i18n/et.js +3 -0
  521. data/mod/bootstrap/vendor/select2/dist/js/i18n/eu.js +3 -0
  522. data/mod/bootstrap/vendor/select2/dist/js/i18n/fa.js +3 -0
  523. data/mod/bootstrap/vendor/select2/dist/js/i18n/fi.js +3 -0
  524. data/mod/bootstrap/vendor/select2/dist/js/i18n/fr.js +3 -0
  525. data/mod/bootstrap/vendor/select2/dist/js/i18n/gl.js +3 -0
  526. data/mod/bootstrap/vendor/select2/dist/js/i18n/he.js +3 -0
  527. data/mod/bootstrap/vendor/select2/dist/js/i18n/hi.js +3 -0
  528. data/mod/bootstrap/vendor/select2/dist/js/i18n/hr.js +3 -0
  529. data/mod/bootstrap/vendor/select2/dist/js/i18n/hsb.js +3 -0
  530. data/mod/bootstrap/vendor/select2/dist/js/i18n/hu.js +3 -0
  531. data/mod/bootstrap/vendor/select2/dist/js/i18n/hy.js +3 -0
  532. data/mod/bootstrap/vendor/select2/dist/js/i18n/id.js +3 -0
  533. data/mod/bootstrap/vendor/select2/dist/js/i18n/is.js +3 -0
  534. data/mod/bootstrap/vendor/select2/dist/js/i18n/it.js +3 -0
  535. data/mod/bootstrap/vendor/select2/dist/js/i18n/ja.js +3 -0
  536. data/mod/bootstrap/vendor/select2/dist/js/i18n/km.js +3 -0
  537. data/mod/bootstrap/vendor/select2/dist/js/i18n/ko.js +3 -0
  538. data/mod/bootstrap/vendor/select2/dist/js/i18n/lt.js +3 -0
  539. data/mod/bootstrap/vendor/select2/dist/js/i18n/lv.js +3 -0
  540. data/mod/bootstrap/vendor/select2/dist/js/i18n/mk.js +3 -0
  541. data/mod/bootstrap/vendor/select2/dist/js/i18n/ms.js +3 -0
  542. data/mod/bootstrap/vendor/select2/dist/js/i18n/nb.js +3 -0
  543. data/mod/bootstrap/vendor/select2/dist/js/i18n/nl.js +3 -0
  544. data/mod/bootstrap/vendor/select2/dist/js/i18n/pl.js +3 -0
  545. data/mod/bootstrap/vendor/select2/dist/js/i18n/ps.js +3 -0
  546. data/mod/bootstrap/vendor/select2/dist/js/i18n/pt-BR.js +3 -0
  547. data/mod/bootstrap/vendor/select2/dist/js/i18n/pt.js +3 -0
  548. data/mod/bootstrap/vendor/select2/dist/js/i18n/ro.js +3 -0
  549. data/mod/bootstrap/vendor/select2/dist/js/i18n/ru.js +3 -0
  550. data/mod/bootstrap/vendor/select2/dist/js/i18n/sk.js +3 -0
  551. data/mod/bootstrap/vendor/select2/dist/js/i18n/sl.js +3 -0
  552. data/mod/bootstrap/vendor/select2/dist/js/i18n/sr-Cyrl.js +3 -0
  553. data/mod/bootstrap/vendor/select2/dist/js/i18n/sr.js +3 -0
  554. data/mod/bootstrap/vendor/select2/dist/js/i18n/sv.js +3 -0
  555. data/mod/bootstrap/vendor/select2/dist/js/i18n/th.js +3 -0
  556. data/mod/bootstrap/vendor/select2/dist/js/i18n/tr.js +3 -0
  557. data/mod/bootstrap/vendor/select2/dist/js/i18n/uk.js +3 -0
  558. data/mod/bootstrap/vendor/select2/dist/js/i18n/vi.js +3 -0
  559. data/mod/bootstrap/vendor/select2/dist/js/i18n/zh-CN.js +3 -0
  560. data/mod/bootstrap/vendor/select2/dist/js/i18n/zh-TW.js +3 -0
  561. data/mod/bootstrap/vendor/select2/dist/js/select2.full.js +6457 -0
  562. data/mod/bootstrap/vendor/select2/dist/js/select2.full.min.js +1 -0
  563. data/mod/bootstrap/{lib/javascript/script_select2.js → vendor/select2/dist/js/select2.js} +90 -69
  564. data/mod/bootstrap/vendor/select2/dist/js/select2.min.js +1 -0
  565. data/mod/bootstrap/vendor/select2/docs/README.md +1 -0
  566. data/mod/bootstrap/vendor/select2/docs/announcements-4.0.html +12 -0
  567. data/mod/bootstrap/vendor/select2/docs/community.html +12 -0
  568. data/mod/bootstrap/vendor/select2/docs/examples.html +12 -0
  569. data/mod/bootstrap/vendor/select2/docs/index.html +12 -0
  570. data/mod/bootstrap/vendor/select2/docs/options-old.html +12 -0
  571. data/mod/bootstrap/vendor/select2/docs/options.html +12 -0
  572. data/mod/bootstrap/vendor/select2/package.json +73 -0
  573. data/mod/bootstrap/vendor/select2/select2.jquery.json +32 -0
  574. data/mod/bootstrap/vendor/select2/src/js/banner.end.js +6 -0
  575. data/mod/bootstrap/vendor/select2/src/js/banner.start.js +6 -0
  576. data/mod/bootstrap/vendor/select2/src/js/jquery.mousewheel.shim.js +6 -0
  577. data/mod/bootstrap/vendor/select2/src/js/jquery.select2.js +57 -0
  578. data/mod/bootstrap/vendor/select2/src/js/jquery.shim.js +14 -0
  579. data/mod/bootstrap/vendor/select2/src/js/select2/compat/containerCss.js +56 -0
  580. data/mod/bootstrap/vendor/select2/src/js/select2/compat/dropdownCss.js +56 -0
  581. data/mod/bootstrap/vendor/select2/src/js/select2/compat/initSelection.js +42 -0
  582. data/mod/bootstrap/vendor/select2/src/js/select2/compat/inputData.js +127 -0
  583. data/mod/bootstrap/vendor/select2/src/js/select2/compat/matcher.js +42 -0
  584. data/mod/bootstrap/vendor/select2/src/js/select2/compat/query.js +26 -0
  585. data/mod/bootstrap/vendor/select2/src/js/select2/compat/utils.js +43 -0
  586. data/mod/bootstrap/vendor/select2/src/js/select2/core.js +612 -0
  587. data/mod/bootstrap/vendor/select2/src/js/select2/data/ajax.js +109 -0
  588. data/mod/bootstrap/vendor/select2/src/js/select2/data/array.js +79 -0
  589. data/mod/bootstrap/vendor/select2/src/js/select2/data/base.js +40 -0
  590. data/mod/bootstrap/vendor/select2/src/js/select2/data/maximumInputLength.js +31 -0
  591. data/mod/bootstrap/vendor/select2/src/js/select2/data/maximumSelectionLength.js +31 -0
  592. data/mod/bootstrap/vendor/select2/src/js/select2/data/minimumInputLength.js +30 -0
  593. data/mod/bootstrap/vendor/select2/src/js/select2/data/select.js +285 -0
  594. data/mod/bootstrap/vendor/select2/src/js/select2/data/tags.js +128 -0
  595. data/mod/bootstrap/vendor/select2/src/js/select2/data/tokenizer.js +116 -0
  596. data/mod/bootstrap/vendor/select2/src/js/select2/defaults.js +396 -0
  597. data/mod/bootstrap/vendor/select2/src/js/select2/diacritics.js +847 -0
  598. data/mod/bootstrap/vendor/select2/src/js/select2/dropdown.js +42 -0
  599. data/mod/bootstrap/vendor/select2/src/js/select2/dropdown/attachBody.js +222 -0
  600. data/mod/bootstrap/vendor/select2/src/js/select2/dropdown/attachContainer.js +18 -0
  601. data/mod/bootstrap/vendor/select2/src/js/select2/dropdown/closeOnSelect.js +35 -0
  602. data/mod/bootstrap/vendor/select2/src/js/select2/dropdown/hidePlaceholder.js +42 -0
  603. data/mod/bootstrap/vendor/select2/src/js/select2/dropdown/infiniteScroll.js +89 -0
  604. data/mod/bootstrap/vendor/select2/src/js/select2/dropdown/minimumResultsForSearch.js +39 -0
  605. data/mod/bootstrap/vendor/select2/src/js/select2/dropdown/search.js +101 -0
  606. data/mod/bootstrap/vendor/select2/src/js/select2/dropdown/selectOnClose.js +50 -0
  607. data/mod/bootstrap/vendor/select2/src/js/select2/dropdown/stopPropagation.js +38 -0
  608. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/af.js +44 -0
  609. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/ar.js +30 -0
  610. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/az.js +27 -0
  611. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/bg.js +47 -0
  612. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/bs.js +55 -0
  613. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/ca.js +52 -0
  614. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/cs.js +61 -0
  615. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/da.js +36 -0
  616. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/de.js +40 -0
  617. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/dsb.js +48 -0
  618. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/el.js +52 -0
  619. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/en.js +44 -0
  620. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/es.js +52 -0
  621. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/et.js +53 -0
  622. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/eu.js +51 -0
  623. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/fa.js +38 -0
  624. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/fi.js +30 -0
  625. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/fr.js +33 -0
  626. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/gl.js +39 -0
  627. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/he.js +56 -0
  628. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/hi.js +39 -0
  629. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/hr.js +44 -0
  630. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/hsb.js +48 -0
  631. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/hu.js +30 -0
  632. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/hy.js +38 -0
  633. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/id.js +30 -0
  634. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/is.js +41 -0
  635. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/it.js +48 -0
  636. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/ja.js +36 -0
  637. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/km.js +36 -0
  638. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/ko.js +36 -0
  639. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/lt.js +52 -0
  640. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/lv.js +51 -0
  641. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/mk.js +47 -0
  642. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/ms.js +30 -0
  643. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/nb.js +32 -0
  644. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/nl.js +43 -0
  645. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/pl.js +45 -0
  646. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/ps.js +45 -0
  647. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/pt-BR.js +46 -0
  648. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/pt.js +40 -0
  649. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/ro.js +46 -0
  650. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/ru.js +58 -0
  651. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/sk.js +59 -0
  652. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/sl.js +54 -0
  653. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/sr-Cyrl.js +55 -0
  654. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/sr.js +55 -0
  655. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/sv.js +37 -0
  656. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/th.js +36 -0
  657. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/tr.js +36 -0
  658. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/uk.js +43 -0
  659. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/vi.js +37 -0
  660. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/zh-CN.js +36 -0
  661. data/mod/bootstrap/vendor/select2/src/js/select2/i18n/zh-TW.js +33 -0
  662. data/mod/bootstrap/vendor/select2/src/js/select2/keys.js +25 -0
  663. data/mod/bootstrap/vendor/select2/src/js/select2/options.js +122 -0
  664. data/mod/bootstrap/vendor/select2/src/js/select2/results.js +523 -0
  665. data/mod/bootstrap/vendor/select2/src/js/select2/selection/allowClear.js +97 -0
  666. data/mod/bootstrap/vendor/select2/src/js/select2/selection/base.js +158 -0
  667. data/mod/bootstrap/vendor/select2/src/js/select2/selection/clickMask.js +29 -0
  668. data/mod/bootstrap/vendor/select2/src/js/select2/selection/eventRelay.js +45 -0
  669. data/mod/bootstrap/vendor/select2/src/js/select2/selection/multiple.js +109 -0
  670. data/mod/bootstrap/vendor/select2/src/js/select2/selection/placeholder.js +49 -0
  671. data/mod/bootstrap/vendor/select2/src/js/select2/selection/search.js +222 -0
  672. data/mod/bootstrap/vendor/select2/src/js/select2/selection/single.js +99 -0
  673. data/mod/bootstrap/vendor/select2/src/js/select2/selection/stopPropagation.js +38 -0
  674. data/mod/bootstrap/vendor/select2/src/js/select2/translation.js +36 -0
  675. data/mod/bootstrap/vendor/select2/src/js/select2/utils.js +276 -0
  676. data/mod/bootstrap/vendor/select2/src/js/wrapper.end.js +12 -0
  677. data/mod/bootstrap/vendor/select2/src/js/wrapper.start.js +38 -0
  678. data/mod/bootstrap/vendor/select2/src/scss/_dropdown.scss +73 -0
  679. data/mod/bootstrap/vendor/select2/src/scss/_multiple.scss +35 -0
  680. data/mod/bootstrap/vendor/select2/src/scss/_single.scss +34 -0
  681. data/mod/bootstrap/vendor/select2/src/scss/core.scss +48 -0
  682. data/mod/bootstrap/vendor/select2/src/scss/mixins/_gradients.scss +13 -0
  683. data/mod/bootstrap/vendor/select2/src/scss/theme/classic/_defaults.scss +34 -0
  684. data/mod/bootstrap/vendor/select2/src/scss/theme/classic/_multiple.scss +93 -0
  685. data/mod/bootstrap/vendor/select2/src/scss/theme/classic/_single.scss +124 -0
  686. data/mod/bootstrap/vendor/select2/src/scss/theme/classic/layout.scss +64 -0
  687. data/mod/bootstrap/vendor/select2/src/scss/theme/default/_multiple.scss +98 -0
  688. data/mod/bootstrap/vendor/select2/src/scss/theme/default/_single.scss +83 -0
  689. data/mod/bootstrap/vendor/select2/src/scss/theme/default/layout.scss +97 -0
  690. data/mod/bootstrap/vendor/select2/tests/a11y/search-tests.js +51 -0
  691. data/mod/bootstrap/vendor/select2/tests/a11y/selection-tests.js +154 -0
  692. data/mod/bootstrap/vendor/select2/tests/data/array-tests.js +318 -0
  693. data/mod/bootstrap/vendor/select2/tests/data/base-tests.js +29 -0
  694. data/mod/bootstrap/vendor/select2/tests/data/inputData-tests.js +158 -0
  695. data/mod/bootstrap/vendor/select2/tests/data/maximumInputLength-tests.js +138 -0
  696. data/mod/bootstrap/vendor/select2/tests/data/maximumSelectionLength-tests.js +202 -0
  697. data/mod/bootstrap/vendor/select2/tests/data/minimumInputLength-tests.js +138 -0
  698. data/mod/bootstrap/vendor/select2/tests/data/select-tests.js +489 -0
  699. data/mod/bootstrap/vendor/select2/tests/data/tags-tests.js +276 -0
  700. data/mod/bootstrap/vendor/select2/tests/data/tokenizer-tests.js +219 -0
  701. data/mod/bootstrap/vendor/select2/tests/dropdown/dropdownCss-tests.js +104 -0
  702. data/mod/bootstrap/vendor/select2/tests/dropdown/positioning-tests.js +177 -0
  703. data/mod/bootstrap/vendor/select2/tests/dropdown/selectOnClose-tests.js +137 -0
  704. data/mod/bootstrap/vendor/select2/tests/dropdown/stopPropagation-tests.js +33 -0
  705. data/mod/bootstrap/vendor/select2/tests/helpers.js +46 -0
  706. data/mod/bootstrap/vendor/select2/tests/integration.html +21 -0
  707. data/mod/bootstrap/vendor/select2/tests/integration/dom-changes.js +257 -0
  708. data/mod/bootstrap/vendor/select2/tests/integration/jquery-calls.js +30 -0
  709. data/mod/bootstrap/vendor/select2/tests/integration/select2-methods.js +139 -0
  710. data/mod/bootstrap/vendor/select2/tests/options/ajax-tests.js +32 -0
  711. data/mod/bootstrap/vendor/select2/tests/options/data-tests.js +44 -0
  712. data/mod/bootstrap/vendor/select2/tests/options/deprecated-tests.js +250 -0
  713. data/mod/bootstrap/vendor/select2/tests/options/translation-tests.js +28 -0
  714. data/mod/bootstrap/vendor/select2/tests/options/width-tests.js +66 -0
  715. data/mod/bootstrap/vendor/select2/tests/results/focusing-tests.js +138 -0
  716. data/mod/bootstrap/vendor/select2/tests/selection/allowClear-tests.js +218 -0
  717. data/mod/bootstrap/vendor/select2/tests/selection/containerCss-tests.js +104 -0
  718. data/mod/bootstrap/vendor/select2/tests/selection/multiple-tests.js +149 -0
  719. data/mod/bootstrap/vendor/select2/tests/selection/placeholder-tests.js +74 -0
  720. data/mod/bootstrap/vendor/select2/tests/selection/search-tests.js +191 -0
  721. data/mod/bootstrap/vendor/select2/tests/selection/single-tests.js +117 -0
  722. data/mod/bootstrap/vendor/select2/tests/selection/stopPropagation-tests.js +33 -0
  723. data/mod/bootstrap/vendor/select2/tests/unit.html +95 -0
  724. data/mod/bootstrap/vendor/select2/tests/utils/decorator-tests.js +189 -0
  725. data/mod/bootstrap/vendor/select2/tests/utils/escapeMarkup-tests.js +36 -0
  726. data/mod/bootstrap/vendor/select2/tests/vendor/jquery-1.7.2.js +9404 -0
  727. data/mod/bootstrap/vendor/select2/tests/vendor/qunit-1.23.1.css +305 -0
  728. data/mod/bootstrap/vendor/select2/tests/vendor/qunit-1.23.1.js +4334 -0
  729. data/mod/bootstrap/vendor/select2/vendor/jquery-2.1.0.js +9111 -0
  730. data/mod/carrierwave/lib/carrier_wave/cardmount.rb +6 -1
  731. data/mod/carrierwave/lib/carrier_wave/file_card_uploader.rb +4 -0
  732. data/mod/carrierwave/set/abstract/attachment.rb +13 -6
  733. data/mod/carrierwave/set/abstract/attachment/storage_type.rb +15 -12
  734. data/mod/carrierwave/set/abstract/attachment/upload_cache.rb +2 -3
  735. data/mod/carrierwave/set/type/file.rb +17 -17
  736. data/mod/carrierwave/set/type/image.rb +40 -37
  737. data/mod/carrierwave/spec/set/type/file_spec.rb +15 -15
  738. data/mod/carrierwave/spec/set/type/image_spec.rb +3 -3
  739. data/mod/core/chunk/reference.rb +3 -3
  740. data/mod/core/chunk/view_stub.rb +12 -4
  741. data/mod/core/format/html_format.rb +1 -1
  742. data/mod/core/format/text_format.rb +5 -0
  743. data/mod/core/set/abstract/code_file.rb +8 -3
  744. data/mod/core/set/all/actify.rb +8 -50
  745. data/mod/core/set/all/assign_attributes.rb +1 -1
  746. data/mod/core/set/all/cache.rb +1 -1
  747. data/mod/core/set/all/collection.rb +7 -7
  748. data/mod/core/set/all/content.rb +12 -6
  749. data/mod/core/set/all/fetch.rb +23 -15
  750. data/mod/core/set/all/fetch_helper.rb +11 -9
  751. data/mod/core/set/all/haml.rb +4 -0
  752. data/mod/core/set/all/initialize.rb +2 -2
  753. data/mod/core/set/all/mark.rb +17 -35
  754. data/mod/core/set/all/name.rb +25 -25
  755. data/mod/core/set/all/name_validations.rb +6 -6
  756. data/mod/core/set/all/permissions.rb +1 -1
  757. data/mod/core/set/all/phases.rb +3 -3
  758. data/mod/core/set/all/references.rb +4 -4
  759. data/mod/core/set/all/rename.rb +6 -7
  760. data/mod/core/set/all/rules.rb +2 -2
  761. data/mod/core/set/all/stages.rb +2 -11
  762. data/mod/core/set/all/subcards.rb +1 -1
  763. data/mod/core/set/all/templating.rb +4 -4
  764. data/mod/core/set/all/type.rb +2 -2
  765. data/mod/core/set/all/update_read_rules.rb +2 -56
  766. data/mod/core/set_pattern/04_star.rb +1 -1
  767. data/mod/core/set_pattern/05_rstar.rb +1 -1
  768. data/mod/core/set_pattern/06_right.rb +1 -1
  769. data/mod/core/set_pattern/07_type_plus_right.rb +2 -3
  770. data/mod/core/spec/format/html_format_spec.rb +4 -4
  771. data/mod/core/spec/set/all/actify_spec.rb +107 -42
  772. data/mod/core/spec/set/all/event_conditions_spec.rb +1 -1
  773. data/mod/core/spec/set/all/fetch_spec.rb +57 -13
  774. data/mod/core/spec/set/all/name_spec.rb +1 -1
  775. data/mod/core/spec/set/all/permissions/reader_rules_spec.rb +1 -1
  776. data/mod/core/spec/set/all/permissions_spec.rb +2 -2
  777. data/mod/core/spec/set/all/rename_spec.rb +7 -5
  778. data/mod/core/spec/set/all/templating_spec.rb +5 -5
  779. data/mod/core/spec/set/all/type_spec.rb +1 -1
  780. data/mod/developer/set/all/event_viz.rb +1 -3
  781. data/mod/history/lib/card/act.rb +2 -6
  782. data/mod/history/lib/card/act/act_renderer.rb +6 -11
  783. data/mod/history/lib/card/action/action_renderer.rb +1 -1
  784. data/mod/history/lib/card/change.rb +1 -1
  785. data/mod/history/set/all/action_view.rb +1 -1
  786. data/mod/history/set/all/actions.rb +10 -1
  787. data/mod/history/set/all/content_history.rb +9 -9
  788. data/mod/history/set/all/history.rb +40 -27
  789. data/mod/machines/lib/javascript/decko.js.coffee +1 -1
  790. data/mod/machines/lib/javascript/decko_filter.js.coffee +40 -0
  791. data/mod/machines/lib/javascript/decko_layout.js.coffee +16 -8
  792. data/mod/machines/lib/stylesheets/style_cards.scss +9 -0
  793. data/mod/machines/set/abstract/machine.rb +12 -9
  794. data/mod/machines/set/abstract/script.rb +4 -0
  795. data/mod/machines/set/self/script_slot.rb +2 -1
  796. data/mod/machines/set/type/css.rb +4 -0
  797. data/mod/machines/spec/set/type/skin_spec.rb +2 -2
  798. data/mod/machines/spec/shared_examples/machine_input.rb +3 -3
  799. data/mod/notifications/format/email_html_format.rb +4 -0
  800. data/mod/notifications/set/all/follow.rb +1 -1
  801. data/mod/notifications/set/all/send_notifications.rb +18 -17
  802. data/mod/notifications/set/right/bcc.rb +1 -1
  803. data/mod/notifications/set/right/follow.rb +3 -3
  804. data/mod/notifications/set/right/followers.rb +1 -1
  805. data/mod/notifications/set/right/following.rb +2 -2
  806. data/mod/notifications/set/right/html_message.rb +0 -5
  807. data/mod/notifications/set/right/text_message.rb +0 -5
  808. data/mod/notifications/set/self/follow_defaults.rb +3 -3
  809. data/mod/notifications/set/type_plus_right/user/follow.rb +1 -1
  810. data/mod/notifications/spec/set/right/followers_spec.rb +1 -1
  811. data/mod/pointer/set/abstract/01_paging.rb +1 -1
  812. data/mod/pointer/set/abstract/02_pointer.rb +2 -2
  813. data/mod/pointer/set/abstract/02_pointer/edit.rb +10 -8
  814. data/mod/pointer/set/abstract/code_pointer.rb +1 -1
  815. data/mod/pointer/set/self/input_options.rb +1 -1
  816. data/mod/pointer/spec/set/type/pointer_spec.rb +1 -1
  817. data/mod/prosemirror_editor/set/abstract/prosemirror_editor.rb +1 -1
  818. data/mod/{standard → search}/set/abstract/01_search_params.rb +0 -0
  819. data/mod/{standard → search}/set/abstract/search.rb +1 -1
  820. data/mod/{standard → search}/set/abstract/wql_search.rb +2 -2
  821. data/mod/search/set/all/filter.rb +12 -0
  822. data/mod/{standard → search}/set/self/navbox.rb +1 -1
  823. data/mod/{standard → search}/set/self/recent.rb +1 -1
  824. data/mod/{standard → search}/set/self/search.rb +2 -2
  825. data/mod/{standard → search}/set/type/search_type.rb +2 -2
  826. data/mod/search/spec/set/all/filter_spec.rb +37 -0
  827. data/mod/{standard → search}/spec/set/self/navbox_spec.rb +0 -0
  828. data/mod/{standard → search}/spec/set/self/recent_spec.rb +0 -0
  829. data/mod/{standard → search}/spec/set/self/search_spec.rb +0 -0
  830. data/mod/search/template/all/filter/_filter_input.haml +8 -0
  831. data/mod/search/template/all/filter/filter_form.haml +32 -0
  832. data/mod/settings/lib/card/setting.rb +11 -11
  833. data/mod/settings/set/abstract/permission.rb +3 -3
  834. data/mod/settings/set/right/read.rb +56 -0
  835. data/mod/settings/set/type/setting.rb +1 -1
  836. data/mod/solid_cache/set/right/solid_cache.rb +1 -1
  837. data/mod/standard/set/abstract/toolbar_split_button.rb +1 -1
  838. data/mod/standard/set/all/error.rb +1 -1
  839. data/mod/standard/set/all/links.rb +3 -3
  840. data/mod/standard/set/all/list_changes.rb +7 -3
  841. data/mod/standard/set/all/rich_html/content.rb +17 -17
  842. data/mod/standard/set/all/rich_html/editing.rb +3 -3
  843. data/mod/standard/set/all/rich_html/editor.rb +1 -1
  844. data/mod/standard/set/all/rich_html/form.rb +2 -2
  845. data/mod/standard/set/all/rich_html/formgroup.rb +1 -1
  846. data/mod/standard/set/all/rich_html/header.rb +3 -3
  847. data/mod/standard/set/all/rich_html/menu.rb +7 -7
  848. data/mod/standard/set/all/rich_html/modal.rb +3 -3
  849. data/mod/standard/set/all/rich_html/new.rb +3 -3
  850. data/mod/standard/set/all/rich_html/toolbar.rb +16 -14
  851. data/mod/standard/set/all/rich_html/wrapper.rb +7 -7
  852. data/mod/standard/set/rstar/rules.rb +5 -5
  853. data/mod/standard/set/rstar/rules_editor.rb +5 -5
  854. data/mod/standard/set/type/cardtype.rb +1 -1
  855. data/mod/standard/set/type/list.rb +6 -6
  856. data/mod/standard/set/type/listed_by.rb +29 -24
  857. data/mod/standard/set/type/session.rb +0 -4
  858. data/mod/standard/set/type/set.rb +23 -26
  859. data/mod/standard/set/type/toggle.rb +2 -2
  860. data/mod/standard/spec/set/all/history_spec.rb +1 -0
  861. data/mod/standard/spec/set/all/rich_html/editing_spec.rb +1 -1
  862. data/mod/standard/spec/set/all/rich_html/wrapper_spec.rb +2 -2
  863. data/mod/standard/spec/set/type/list_spec.rb +7 -3
  864. data/mod/standard/spec/set/type/listed_by_spec.rb +3 -2
  865. data/mod/standard/spec/set/type/uri_spec.rb +8 -8
  866. data/spec/config/initializers/core_extensions_spec.rb +2 -2
  867. data/spec/lib/card/cache_spec.rb +3 -3
  868. data/spec/lib/card/codename_spec.rb +40 -2
  869. data/spec/lib/card/format_spec.rb +6 -6
  870. data/spec/lib/card/query_spec.rb +0 -2
  871. data/spec/lib/card/reference_spec.rb +3 -3
  872. data/spec/lib/card/stage_director_spec.rb +52 -17
  873. data/spec/lib/card/success_spec.rb +1 -1
  874. data/spec/models/card/trash_spec.rb +1 -1
  875. data/spec/models/card_spec.rb +3 -3
  876. data/spec/support/helper/event_helper.rb +14 -0
  877. data/spec/support/helper/render_helper.rb +1 -1
  878. data/spec/support/matchers/card_matchers.rb +7 -9
  879. metadata +643 -111
  880. data/lib/active_record/connection_adapters_ext.rb +0 -52
  881. data/lib/active_support/callbacks_ext.rb +0 -9
  882. data/lib/card/name/view_name.rb +0 -50
  883. data/mod/bootstrap/db/migrate_cards/20170719163701_update_bootswatch_themes.rb +0 -80
  884. data/mod/bootstrap/lib/javascript/bootstrap.js +0 -3535
  885. data/mod/bootstrap/lib/javascript/bootstrap.min.js +0 -7
  886. data/mod/bootstrap/lib/javascript/select2.min.js +0 -3
  887. data/mod/bootstrap/lib/javascript/tether.min.js +0 -1
  888. data/mod/bootstrap/lib/stylesheets/bootstrap.css +0 -9320
  889. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/.scss-lint.yml +0 -548
  890. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_alert.scss +0 -55
  891. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_badge.scss +0 -77
  892. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_breadcrumb.scss +0 -38
  893. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_buttons.scss +0 -170
  894. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_card.scss +0 -276
  895. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_carousel.scss +0 -178
  896. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_close.scss +0 -31
  897. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_code.scss +0 -64
  898. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_custom-forms.scss +0 -263
  899. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_custom.scss +0 -4
  900. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_dropdown.scss +0 -161
  901. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_forms.scss +0 -388
  902. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_grid.scss +0 -52
  903. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_images.scss +0 -43
  904. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_input-group.scss +0 -178
  905. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_jumbotron.scss +0 -20
  906. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_list-group.scss +0 -141
  907. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_media.scss +0 -8
  908. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_mixins.scss +0 -57
  909. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_modal.scss +0 -142
  910. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_nav.scss +0 -119
  911. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_navbar.scss +0 -268
  912. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_normalize.scss +0 -461
  913. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_pagination.scss +0 -67
  914. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_popover.scss +0 -171
  915. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_print.scss +0 -119
  916. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_progress.scss +0 -32
  917. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_reboot.scss +0 -389
  918. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_tables.scss +0 -153
  919. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_tooltip.scss +0 -90
  920. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_transitions.scss +0 -34
  921. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_type.scss +0 -143
  922. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_utilities.scss +0 -13
  923. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/_variables.scss +0 -961
  924. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/bootstrap-grid.scss +0 -43
  925. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/bootstrap-reboot.scss +0 -10
  926. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/bootstrap.scss +0 -54
  927. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_alert.scss +0 -14
  928. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_background-variant.scss +0 -12
  929. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_badge.scss +0 -11
  930. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_border-radius.scss +0 -35
  931. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_breakpoints.scss +0 -95
  932. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_buttons.scss +0 -86
  933. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_cards.scss +0 -47
  934. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_clearfix.scss +0 -7
  935. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_float.scss +0 -9
  936. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_forms.scss +0 -79
  937. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_gradients.scss +0 -37
  938. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_grid-framework.scss +0 -65
  939. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_grid.scss +0 -100
  940. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_hover.scss +0 -60
  941. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_image.scss +0 -36
  942. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_list-group.scss +0 -28
  943. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_lists.scss +0 -7
  944. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_pagination.scss +0 -21
  945. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_screen-reader.scss +0 -32
  946. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_size.scss +0 -6
  947. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_table-row.scss +0 -30
  948. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_text-emphasis.scss +0 -12
  949. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_text-hide.scss +0 -8
  950. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_transforms.scss +0 -14
  951. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/mixins/_visibility.scss +0 -5
  952. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/utilities/_align.scss +0 -6
  953. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/utilities/_background.scss +0 -19
  954. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/utilities/_borders.scss +0 -37
  955. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/utilities/_clearfix.scss +0 -3
  956. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/utilities/_display.scss +0 -18
  957. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/utilities/_flex.scss +0 -48
  958. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/utilities/_float.scss +0 -9
  959. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/utilities/_position.scss +0 -23
  960. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/utilities/_screenreaders.scss +0 -11
  961. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/utilities/_sizing.scss +0 -10
  962. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/utilities/_spacing.scss +0 -43
  963. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/utilities/_text.scss +0 -61
  964. data/mod/bootstrap/lib/stylesheets/bootstrap/scss/utilities/_visibility.scss +0 -55
  965. data/mod/bootstrap/lib/stylesheets/select2-boostrap-v4-alpha-6.scss +0 -828
@@ -0,0 +1,5 @@
1
+ /*! jQuery v1.12.4 | (c) jQuery Foundation | jquery.org/license */
2
+ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="1.12.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(!l.ownFirst)for(b in a)return k.call(a,b);for(b in a);return void 0===b||k.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(h)return h.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=e.call(arguments,2),d=function(){return a.apply(b||this,c.concat(e.call(arguments)))},d.guid=a.guid=a.guid||n.guid++,d):void 0},now:function(){return+new Date},support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=R.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}if(f=d.getElementById(e[2]),f&&f.parentNode){if(f.id!==e[2])return A.find(a);this.length=1,this[0]=f}return this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||(e=n.uniqueSort(e)),D.test(a)&&(e=e.reverse())),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=!0,c||j.disable(),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.addEventListener?(d.removeEventListener("DOMContentLoaded",K),a.removeEventListener("load",K)):(d.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(d.addEventListener||"load"===a.event.type||"complete"===d.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll)a.setTimeout(n.ready);else if(d.addEventListener)d.addEventListener("DOMContentLoaded",K),a.addEventListener("load",K);else{d.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&d.documentElement}catch(e){}c&&c.doScroll&&!function f(){if(!n.isReady){try{c.doScroll("left")}catch(b){return a.setTimeout(f,50)}J(),n.ready()}}()}return I.promise(b)},n.ready.promise();var L;for(L in n(l))break;l.ownFirst="0"===L,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c,e;c=d.getElementsByTagName("body")[0],c&&c.style&&(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",l.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(e))}),function(){var a=d.createElement("div");l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}a=null}();var M=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b},N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0;
3
+ }return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(M(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),"object"!=typeof b&&"function"!=typeof b||(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f}}function S(a,b,c){if(M(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=n._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}}),function(){var a;l.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,e;return c=d.getElementsByTagName("body")[0],c&&c.style?(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(d.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(e),a):void 0}}();var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),V=["Top","Right","Bottom","Left"],W=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function X(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&U.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var Y=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)Y(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},Z=/^(?:checkbox|radio)$/i,$=/<([\w:-]+)/,_=/^$|\/(?:java|ecma)script/i,aa=/^\s+/,ba="abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video";function ca(a){var b=ba.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}!function(){var a=d.createElement("div"),b=d.createDocumentFragment(),c=d.createElement("input");a.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",l.leadingWhitespace=3===a.firstChild.nodeType,l.tbody=!a.getElementsByTagName("tbody").length,l.htmlSerialize=!!a.getElementsByTagName("link").length,l.html5Clone="<:nav></:nav>"!==d.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,b.appendChild(c),l.appendChecked=c.checked,a.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!a.cloneNode(!0).lastChild.defaultValue,b.appendChild(a),c=d.createElement("input"),c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),a.appendChild(c),l.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!!a.addEventListener,a[n.expando]=1,l.attributes=!a.getAttribute(n.expando)}();var da={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]};da.optgroup=da.option,da.tbody=da.tfoot=da.colgroup=da.caption=da.thead,da.th=da.td;function ea(a,b){var c,d,e=0,f="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,ea(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function fa(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}var ga=/<|&#?\w+;/,ha=/<tbody/i;function ia(a){Z.test(a.type)&&(a.defaultChecked=a.checked)}function ja(a,b,c,d,e){for(var f,g,h,i,j,k,m,o=a.length,p=ca(b),q=[],r=0;o>r;r++)if(g=a[r],g||0===g)if("object"===n.type(g))n.merge(q,g.nodeType?[g]:g);else if(ga.test(g)){i=i||p.appendChild(b.createElement("div")),j=($.exec(g)||["",""])[1].toLowerCase(),m=da[j]||da._default,i.innerHTML=m[1]+n.htmlPrefilter(g)+m[2],f=m[0];while(f--)i=i.lastChild;if(!l.leadingWhitespace&&aa.test(g)&&q.push(b.createTextNode(aa.exec(g)[0])),!l.tbody){g="table"!==j||ha.test(g)?"<table>"!==m[1]||ha.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;while(f--)n.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k)}n.merge(q,i.childNodes),i.textContent="";while(i.firstChild)i.removeChild(i.firstChild);i=p.lastChild}else q.push(b.createTextNode(g));i&&p.removeChild(i),l.appendChecked||n.grep(ea(q,"input"),ia),r=0;while(g=q[r++])if(d&&n.inArray(g,d)>-1)e&&e.push(g);else if(h=n.contains(g.ownerDocument,g),i=ea(p.appendChild(g),"script"),h&&fa(i),c){f=0;while(g=i[f++])_.test(g.type||"")&&c.push(g)}return i=null,p}!function(){var b,c,e=d.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b]=c in a)||(e.setAttribute(c,"t"),l[b]=e.attributes[c].expando===!1);e=null}();var ka=/^(?:input|select|textarea)$/i,la=/^key/,ma=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,na=/^(?:focusinfocus|focusoutblur)$/,oa=/^([^.]*)(?:\.(.+)|)/;function pa(){return!0}function qa(){return!1}function ra(){try{return d.activeElement}catch(a){}}function sa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)sa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=qa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return"undefined"==typeof n||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(G)||[""],h=b.length;while(h--)f=oa.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=oa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(i=m=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!na.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),h=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),l=n.event.special[q]||{},f||!l.trigger||l.trigger.apply(e,c)!==!1)){if(!f&&!l.noBubble&&!n.isWindow(e)){for(j=l.delegateType||q,na.test(j+q)||(i=i.parentNode);i;i=i.parentNode)p.push(i),m=i;m===(e.ownerDocument||d)&&p.push(m.defaultView||m.parentWindow||a)}o=0;while((i=p[o++])&&!b.isPropagationStopped())b.type=o>1?j:l.bindType||q,g=(n._data(i,"events")||{})[b.type]&&n._data(i,"handle"),g&&g.apply(i,c),g=h&&i[h],g&&g.apply&&M(i)&&(b.result=g.apply(i,c),b.result===!1&&b.preventDefault());if(b.type=q,!f&&!b.isDefaultPrevented()&&(!l._default||l._default.apply(p.pop(),c)===!1)&&M(e)&&h&&e[q]&&!n.isWindow(e)){m=e[h],m&&(e[h]=null),n.event.triggered=q;try{e[q]()}catch(s){}n.event.triggered=void 0,m&&(e[h]=m)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ma.test(f)?this.mouseHooks:la.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=g.srcElement||d),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,h.filter?h.filter(a,g):a},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button,h=b.fromElement;return null==a.pageX&&null!=b.clientX&&(e=a.target.ownerDocument||d,f=e.documentElement,c=e.body,a.pageX=b.clientX+(f&&f.scrollLeft||c&&c.scrollLeft||0)-(f&&f.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(f&&f.scrollTop||c&&c.scrollTop||0)-(f&&f.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&h&&(a.relatedTarget=h===a.target?b.toElement:h),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ra()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===ra()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return n.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b),d.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=d.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)}:function(a,b,c){var d="on"+b;a.detachEvent&&("undefined"==typeof a[d]&&(a[d]=null),a.detachEvent(d,c))},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?pa:qa):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:qa,isPropagationStopped:qa,isImmediatePropagationStopped:qa,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=pa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=pa,a&&!this.isSimulated&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=pa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||n.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.submit||(n.event.special.submit={setup:function(){return n.nodeName(this,"form")?!1:void n.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=n.nodeName(b,"input")||n.nodeName(b,"button")?n.prop(b,"form"):void 0;c&&!n._data(c,"submit")&&(n.event.add(c,"submit._submit",function(a){a._submitBubble=!0}),n._data(c,"submit",!0))})},postDispatch:function(a){a._submitBubble&&(delete a._submitBubble,this.parentNode&&!a.isTrigger&&n.event.simulate("submit",this.parentNode,a))},teardown:function(){return n.nodeName(this,"form")?!1:void n.event.remove(this,"._submit")}}),l.change||(n.event.special.change={setup:function(){return ka.test(this.nodeName)?("checkbox"!==this.type&&"radio"!==this.type||(n.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._justChanged=!0)}),n.event.add(this,"click._change",function(a){this._justChanged&&!a.isTrigger&&(this._justChanged=!1),n.event.simulate("change",this,a)})),!1):void n.event.add(this,"beforeactivate._change",function(a){var b=a.target;ka.test(b.nodeName)&&!n._data(b,"change")&&(n.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||n.event.simulate("change",this.parentNode,a)}),n._data(b,"change",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return n.event.remove(this,"._change"),!ka.test(this.nodeName)}}),l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=n._data(d,b);e||d.addEventListener(a,c,!0),n._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=n._data(d,b)-1;e?n._data(d,b,e):(d.removeEventListener(a,c,!0),n._removeData(d,b))}}}),n.fn.extend({on:function(a,b,c,d){return sa(this,a,b,c,d)},one:function(a,b,c,d){return sa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=qa),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ta=/ jQuery\d+="(?:null|\d+)"/g,ua=new RegExp("<(?:"+ba+")[\\s/>]","i"),va=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,wa=/<script|<style|<link/i,xa=/checked\s*(?:[^=]|=\s*.checked.)/i,ya=/^true\/(.*)/,za=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Aa=ca(d),Ba=Aa.appendChild(d.createElement("div"));function Ca(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function Da(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function Ea(a){var b=ya.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Ga(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(Da(b).text=a.text,Ea(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&Z.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}}function Ha(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&xa.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(o&&(k=ja(b,a[0].ownerDocument,!1,a,d),e=k.firstChild,1===k.childNodes.length&&(k=e),e||d)){for(i=n.map(ea(k,"script"),Da),h=i.length;o>m;m++)g=k,m!==p&&(g=n.clone(g,!0,!0),h&&n.merge(i,ea(g,"script"))),c.call(a[m],g,m);if(h)for(j=i[i.length-1].ownerDocument,n.map(i,Ea),m=0;h>m;m++)g=i[m],_.test(g.type||"")&&!n._data(g,"globalEval")&&n.contains(j,g)&&(g.src?n._evalUrl&&n._evalUrl(g.src):n.globalEval((g.text||g.textContent||g.innerHTML||"").replace(za,"")));k=e=null}return a}function Ia(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(ea(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&fa(ea(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(va,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!ua.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(Ba.innerHTML=a.outerHTML,Ba.removeChild(f=Ba.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=ea(f),h=ea(a),g=0;null!=(e=h[g]);++g)d[g]&&Ga(e,d[g]);if(b)if(c)for(h=h||ea(a),d=d||ea(f),g=0;null!=(e=h[g]);g++)Fa(e,d[g]);else Fa(a,f);return d=ea(f,"script"),d.length>0&&fa(d,!i&&ea(a,"script")),d=h=e=null,f},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.attributes,m=n.event.special;null!=(d=a[h]);h++)if((b||M(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k||"undefined"==typeof d.removeAttribute?d[i]=void 0:d.removeAttribute(i),c.push(f))}}}),n.fn.extend({domManip:Ha,detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return Y(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||d).createTextNode(a))},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(ea(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return Y(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(ta,""):void 0;if("string"==typeof a&&!wa.test(a)&&(l.htmlSerialize||!ua.test(a))&&(l.leadingWhitespace||!aa.test(a))&&!da[($.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ea(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(ea(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],f=n(a),h=f.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(f[d])[b](c),g.apply(e,c.get());return this.pushStack(e)}});var Ja,Ka={HTML:"block",BODY:"block"};function La(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function Ma(a){var b=d,c=Ka[a];return c||(c=La(a,b),"none"!==c&&c||(Ja=(Ja||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Ja[0].contentWindow||Ja[0].contentDocument).document,b.write(),b.close(),c=La(a,b),Ja.detach()),Ka[a]=c),c}var Na=/^margin/,Oa=new RegExp("^("+T+")(?!px)[a-z%]+$","i"),Pa=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Qa=d.documentElement;!function(){var b,c,e,f,g,h,i=d.createElement("div"),j=d.createElement("div");if(j.style){j.style.cssText="float:left;opacity:.5",l.opacity="0.5"===j.style.opacity,l.cssFloat=!!j.style.cssFloat,j.style.backgroundClip="content-box",j.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===j.style.backgroundClip,i=d.createElement("div"),i.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",j.innerHTML="",i.appendChild(j),l.boxSizing=""===j.style.boxSizing||""===j.style.MozBoxSizing||""===j.style.WebkitBoxSizing,n.extend(l,{reliableHiddenOffsets:function(){return null==b&&k(),f},boxSizingReliable:function(){return null==b&&k(),e},pixelMarginRight:function(){return null==b&&k(),c},pixelPosition:function(){return null==b&&k(),b},reliableMarginRight:function(){return null==b&&k(),g},reliableMarginLeft:function(){return null==b&&k(),h}});function k(){var k,l,m=d.documentElement;m.appendChild(i),j.style.cssText="-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",b=e=h=!1,c=g=!0,a.getComputedStyle&&(l=a.getComputedStyle(j),b="1%"!==(l||{}).top,h="2px"===(l||{}).marginLeft,e="4px"===(l||{width:"4px"}).width,j.style.marginRight="50%",c="4px"===(l||{marginRight:"4px"}).marginRight,k=j.appendChild(d.createElement("div")),k.style.cssText=j.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",k.style.marginRight=k.style.width="0",j.style.width="1px",g=!parseFloat((a.getComputedStyle(k)||{}).marginRight),j.removeChild(k)),j.style.display="none",f=0===j.getClientRects().length,f&&(j.style.display="",j.innerHTML="<table><tr><td></td><td>t</td></tr></table>",j.childNodes[0].style.borderCollapse="separate",k=j.getElementsByTagName("td"),k[0].style.cssText="margin:0;border:0;padding:0;display:none",f=0===k[0].offsetHeight,f&&(k[0].style.display="",k[1].style.display="none",f=0===k[0].offsetHeight)),m.removeChild(i)}}}();var Ra,Sa,Ta=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ra=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c.getPropertyValue(b)||c[b]:void 0,""!==g&&void 0!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),c&&!l.pixelMarginRight()&&Oa.test(g)&&Na.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f),void 0===g?g:g+""}):Qa.currentStyle&&(Ra=function(a){return a.currentStyle},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Oa.test(g)&&!Ta.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Ua(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Va=/alpha\([^)]*\)/i,Wa=/opacity\s*=\s*([^)]*)/i,Xa=/^(none|table(?!-c[ea]).+)/,Ya=new RegExp("^("+T+")(.*)$","i"),Za={position:"absolute",visibility:"hidden",display:"block"},$a={letterSpacing:"0",fontWeight:"400"},_a=["Webkit","O","Moz","ms"],ab=d.createElement("div").style;function bb(a){if(a in ab)return a;var b=a.charAt(0).toUpperCase()+a.slice(1),c=_a.length;while(c--)if(a=_a[c]+b,a in ab)return a}function cb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=n._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&W(d)&&(f[g]=n._data(d,"olddisplay",Ma(d.nodeName)))):(e=W(d),(c&&"none"!==c||!e)&&n._data(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function db(a,b,c){var d=Ya.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function eb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+V[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+V[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+V[f]+"Width",!0,e))):(g+=n.css(a,"padding"+V[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+V[f]+"Width",!0,e)));return g}function fb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ra(a),g=l.boxSizing&&"border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Sa(a,b,f),(0>e||null==e)&&(e=a.style[b]),Oa.test(e))return e;d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+eb(a,b,c||(g?"border":"content"),d,f)+"px"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Sa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":l.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=U.exec(c))&&e[1]&&(c=X(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Sa(a,b,d)),"normal"===f&&b in $a&&(f=$a[b]),""===c||c?(e=parseFloat(f),c===!0||isFinite(e)?e||0:f):f}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Xa.test(n.css(a,"display"))&&0===a.offsetWidth?Pa(a,Za,function(){return fb(a,b,d)}):fb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ra(a);return db(a,c,d?eb(a,b,d,l.boxSizing&&"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Wa.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===n.trim(f.replace(Va,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Va.test(f)?f.replace(Va,e):f+" "+e)}}),n.cssHooks.marginRight=Ua(l.reliableMarginRight,function(a,b){return b?Pa(a,{display:"inline-block"},Sa,[a,"marginRight"]):void 0}),n.cssHooks.marginLeft=Ua(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Sa(a,"marginLeft"))||(n.contains(a.ownerDocument,a)?a.getBoundingClientRect().left-Pa(a,{
4
+ marginLeft:0},function(){return a.getBoundingClientRect().left}):0))+"px":void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+V[d]+b]=f[d]||f[d-2]||f[0];return e}},Na.test(a)||(n.cssHooks[a+b].set=db)}),n.fn.extend({css:function(a,b){return Y(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ra(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return cb(this,!0)},hide:function(){return cb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){W(this)?n(this).show():n(this).hide()})}});function gb(a,b,c,d,e){return new gb.prototype.init(a,b,c,d,e)}n.Tween=gb,gb.prototype={constructor:gb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=gb.propHooks[this.prop];return a&&a.get?a.get(this):gb.propHooks._default.get(this)},run:function(a){var b,c=gb.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):gb.propHooks._default.set(this),this}},gb.prototype.init.prototype=gb.prototype,gb.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},gb.propHooks.scrollTop=gb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=gb.prototype.init,n.fx.step={};var hb,ib,jb=/^(?:toggle|show|hide)$/,kb=/queueHooks$/;function lb(){return a.setTimeout(function(){hb=void 0}),hb=n.now()}function mb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=V[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function nb(a,b,c){for(var d,e=(qb.tweeners[b]||[]).concat(qb.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ob(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&W(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k="none"===j?n._data(a,"olddisplay")||Ma(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==Ma(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],jb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(o))"inline"===("none"===j?Ma(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o)n.style(a,b,o[b])});for(d in o)g=nb(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function pb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function qb(a,b,c){var d,e,f=0,g=qb.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=hb||lb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:hb||lb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(pb(k,j.opts.specialEasing);g>f;f++)if(d=qb.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,nb,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(qb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return X(c.elem,a,U.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],qb.tweeners[c]=qb.tweeners[c]||[],qb.tweeners[c].unshift(b)},prefilters:[ob],prefilter:function(a,b){b?qb.prefilters.unshift(a):qb.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(W).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=qb(this,n.extend({},a),f);(e||n._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=n._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&kb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=n._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(mb(b,!0),a,d,e)}}),n.each({slideDown:mb("show"),slideUp:mb("hide"),slideToggle:mb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(hb=n.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||n.fx.stop(),hb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){ib||(ib=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(ib),ib=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a,b=d.createElement("input"),c=d.createElement("div"),e=d.createElement("select"),f=e.appendChild(d.createElement("option"));c=d.createElement("div"),c.setAttribute("className","t"),c.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=c.getElementsByTagName("a")[0],b.setAttribute("type","checkbox"),c.appendChild(b),a=c.getElementsByTagName("a")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==c.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=f.selected,l.enctype=!!d.createElement("form").enctype,e.disabled=!0,l.optDisabled=!f.disabled,b=d.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value}();var rb=/\r/g,sb=/[\x20\t\r\n\f]+/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a)).replace(sb," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>-1)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var tb,ub,vb=n.expr.attrHandle,wb=/^(?:checked|selected)$/i,xb=l.getSetAttribute,yb=l.input;n.fn.extend({attr:function(a,b){return Y(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?ub:tb)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?yb&&xb||!wb.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(xb?c:d)}}),ub={set:function(a,b,c){return b===!1?n.removeAttr(a,c):yb&&xb||!wb.test(c)?a.setAttribute(!xb&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=vb[b]||n.find.attr;yb&&xb||!wb.test(b)?vb[b]=function(a,b,d){var e,f;return d||(f=vb[b],vb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,vb[b]=f),e}:vb[b]=function(a,b,c){return c?void 0:a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),yb&&xb||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,"input")?void(a.defaultValue=b):tb&&tb.set(a,b,c)}}),xb||(tb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},vb.id=vb.name=vb.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:tb.set},n.attrHooks.contenteditable={set:function(a,b,c){tb.set(a,""===b?!1:b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var zb=/^(?:input|select|textarea|button|object)$/i,Ab=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return Y(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):zb.test(a.nodeName)||Ab.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var Bb=/[\t\r\n\f]/g;function Cb(a){return n.attr(a,"class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,Cb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Cb(c),d=1===c.nodeType&&(" "+e+" ").replace(Bb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,Cb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Cb(c),d=1===c.nodeType&&(" "+e+" ").replace(Bb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,Cb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=Cb(this),b&&n._data(this,"__className__",b),n.attr(this,"class",b||a===!1?"":n._data(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+Cb(c)+" ").replace(Bb," ").indexOf(b)>-1)return!0;return!1}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Db=a.location,Eb=n.now(),Fb=/\?/,Gb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(Gb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new a.DOMParser,c=d.parseFromString(b,"text/xml")):(c=new a.ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var Hb=/#.*$/,Ib=/([?&])_=[^&]*/,Jb=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Kb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Lb=/^(?:GET|HEAD)$/,Mb=/^\/\//,Nb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Ob={},Pb={},Qb="*/".concat("*"),Rb=Db.href,Sb=Nb.exec(Rb.toLowerCase())||[];function Tb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Ub(a,b,c,d){var e={},f=a===Pb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Vb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Wb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Xb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Rb,type:"GET",isLocal:Kb.test(Sb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Qb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Vb(Vb(a,n.ajaxSettings),b):Vb(n.ajaxSettings,a)},ajaxPrefilter:Tb(Ob),ajaxTransport:Tb(Pb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var d,e,f,g,h,i,j,k,l=n.ajaxSetup({},c),m=l.context||l,o=l.context&&(m.nodeType||m.jquery)?n(m):n.event,p=n.Deferred(),q=n.Callbacks("once memory"),r=l.statusCode||{},s={},t={},u=0,v="canceled",w={readyState:0,getResponseHeader:function(a){var b;if(2===u){if(!k){k={};while(b=Jb.exec(g))k[b[1].toLowerCase()]=b[2]}b=k[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===u?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return u||(a=t[c]=t[c]||a,s[a]=b),this},overrideMimeType:function(a){return u||(l.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>u)for(b in a)r[b]=[r[b],a[b]];else w.always(a[w.status]);return this},abort:function(a){var b=a||v;return j&&j.abort(b),y(0,b),this}};if(p.promise(w).complete=q.add,w.success=w.done,w.error=w.fail,l.url=((b||l.url||Rb)+"").replace(Hb,"").replace(Mb,Sb[1]+"//"),l.type=c.method||c.type||l.method||l.type,l.dataTypes=n.trim(l.dataType||"*").toLowerCase().match(G)||[""],null==l.crossDomain&&(d=Nb.exec(l.url.toLowerCase()),l.crossDomain=!(!d||d[1]===Sb[1]&&d[2]===Sb[2]&&(d[3]||("http:"===d[1]?"80":"443"))===(Sb[3]||("http:"===Sb[1]?"80":"443")))),l.data&&l.processData&&"string"!=typeof l.data&&(l.data=n.param(l.data,l.traditional)),Ub(Ob,l,c,w),2===u)return w;i=n.event&&l.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),l.type=l.type.toUpperCase(),l.hasContent=!Lb.test(l.type),f=l.url,l.hasContent||(l.data&&(f=l.url+=(Fb.test(f)?"&":"?")+l.data,delete l.data),l.cache===!1&&(l.url=Ib.test(f)?f.replace(Ib,"$1_="+Eb++):f+(Fb.test(f)?"&":"?")+"_="+Eb++)),l.ifModified&&(n.lastModified[f]&&w.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&w.setRequestHeader("If-None-Match",n.etag[f])),(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&w.setRequestHeader("Content-Type",l.contentType),w.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+("*"!==l.dataTypes[0]?", "+Qb+"; q=0.01":""):l.accepts["*"]);for(e in l.headers)w.setRequestHeader(e,l.headers[e]);if(l.beforeSend&&(l.beforeSend.call(m,w,l)===!1||2===u))return w.abort();v="abort";for(e in{success:1,error:1,complete:1})w[e](l[e]);if(j=Ub(Pb,l,c,w)){if(w.readyState=1,i&&o.trigger("ajaxSend",[w,l]),2===u)return w;l.async&&l.timeout>0&&(h=a.setTimeout(function(){w.abort("timeout")},l.timeout));try{u=1,j.send(s,y)}catch(x){if(!(2>u))throw x;y(-1,x)}}else y(-1,"No Transport");function y(b,c,d,e){var k,s,t,v,x,y=c;2!==u&&(u=2,h&&a.clearTimeout(h),j=void 0,g=e||"",w.readyState=b>0?4:0,k=b>=200&&300>b||304===b,d&&(v=Wb(l,w,d)),v=Xb(l,v,w,k),k?(l.ifModified&&(x=w.getResponseHeader("Last-Modified"),x&&(n.lastModified[f]=x),x=w.getResponseHeader("etag"),x&&(n.etag[f]=x)),204===b||"HEAD"===l.type?y="nocontent":304===b?y="notmodified":(y=v.state,s=v.data,t=v.error,k=!t)):(t=y,!b&&y||(y="error",0>b&&(b=0))),w.status=b,w.statusText=(c||y)+"",k?p.resolveWith(m,[s,y,w]):p.rejectWith(m,[w,y,t]),w.statusCode(r),r=void 0,i&&o.trigger(k?"ajaxSuccess":"ajaxError",[w,l,k?s:t]),q.fireWith(m,[w,y]),i&&(o.trigger("ajaxComplete",[w,l]),--n.active||n.event.trigger("ajaxStop")))}return w},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}});function Yb(a){return a.style&&a.style.display||n.css(a,"display")}function Zb(a){if(!n.contains(a.ownerDocument||d,a))return!0;while(a&&1===a.nodeType){if("none"===Yb(a)||"hidden"===a.type)return!0;a=a.parentNode}return!1}n.expr.filters.hidden=function(a){return l.reliableHiddenOffsets()?a.offsetWidth<=0&&a.offsetHeight<=0&&!a.getClientRects().length:Zb(a)},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var $b=/%20/g,_b=/\[\]$/,ac=/\r?\n/g,bc=/^(?:submit|button|image|reset|file)$/i,cc=/^(?:input|select|textarea|keygen)/i;function dc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||_b.test(a)?d(a,e):dc(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)dc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)dc(c,a[c],b,e);return d.join("&").replace($b,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&cc.test(this.nodeName)&&!bc.test(a)&&(this.checked||!Z.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(ac,"\r\n")}}):{name:b.name,value:c.replace(ac,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return this.isLocal?ic():d.documentMode>8?hc():/^(get|post|head|put|delete|options)$/i.test(this.type)&&hc()||ic()}:hc;var ec=0,fc={},gc=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in fc)fc[a](void 0,!0)}),l.cors=!!gc&&"withCredentials"in gc,gc=l.ajax=!!gc,gc&&n.ajaxTransport(function(b){if(!b.crossDomain||l.cors){var c;return{send:function(d,e){var f,g=b.xhr(),h=++ec;if(g.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(f in b.xhrFields)g[f]=b.xhrFields[f];b.mimeType&&g.overrideMimeType&&g.overrideMimeType(b.mimeType),b.crossDomain||d["X-Requested-With"]||(d["X-Requested-With"]="XMLHttpRequest");for(f in d)void 0!==d[f]&&g.setRequestHeader(f,d[f]+"");g.send(b.hasContent&&b.data||null),c=function(a,d){var f,i,j;if(c&&(d||4===g.readyState))if(delete fc[h],c=void 0,g.onreadystatechange=n.noop,d)4!==g.readyState&&g.abort();else{j={},f=g.status,"string"==typeof g.responseText&&(j.text=g.responseText);try{i=g.statusText}catch(k){i=""}f||!b.isLocal||b.crossDomain?1223===f&&(f=204):f=j.text?200:404}j&&e(f,i,j,g.getAllResponseHeaders())},b.async?4===g.readyState?a.setTimeout(c):g.onreadystatechange=fc[h]=c:c()},abort:function(){c&&c(void 0,!0)}}}});function hc(){try{return new a.XMLHttpRequest}catch(b){}}function ic(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=d.head||n("head")[0]||d.documentElement;return{send:function(e,f){b=d.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||f(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var jc=[],kc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=jc.pop()||n.expando+"_"+Eb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(kc.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&kc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(kc,"$1"+e):b.jsonp!==!1&&(b.url+=(Fb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,jc.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||d;var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ja([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var lc=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&lc)return lc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h,a.length)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function mc(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?("undefined"!=typeof e.getBoundingClientRect&&(d=e.getBoundingClientRect()),c=mc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0),c.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Qa})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return Y(this,function(a,d,e){var f=mc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ua(l.pixelPosition,function(a,c){return c?(c=Sa(a,b),Oa.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({
5
+ padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return Y(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var nc=a.jQuery,oc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=oc),b&&a.jQuery===n&&(a.jQuery=nc),n},b||(a.jQuery=a.$=n),n});
@@ -0,0 +1,305 @@
1
+ /*!
2
+ * QUnit 1.22.0
3
+ * https://qunitjs.com/
4
+ *
5
+ * Copyright jQuery Foundation and other contributors
6
+ * Released under the MIT license
7
+ * https://jquery.org/license
8
+ *
9
+ * Date: 2016-02-23T15:57Z
10
+ */
11
+
12
+ /** Font Family and Sizes */
13
+
14
+ #qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult {
15
+ font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
16
+ }
17
+
18
+ #qunit-testrunner-toolbar, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
19
+ #qunit-tests { font-size: smaller; }
20
+
21
+
22
+ /** Resets */
23
+
24
+ #qunit-tests, #qunit-header, #qunit-banner, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter {
25
+ margin: 0;
26
+ padding: 0;
27
+ }
28
+
29
+
30
+ /** Header */
31
+
32
+ #qunit-header {
33
+ padding: 0.5em 0 0.5em 1em;
34
+
35
+ color: #8699A4;
36
+ background-color: #0D3349;
37
+
38
+ font-size: 1.5em;
39
+ line-height: 1em;
40
+ font-weight: 400;
41
+
42
+ border-radius: 5px 5px 0 0;
43
+ }
44
+
45
+ #qunit-header a {
46
+ text-decoration: none;
47
+ color: #C2CCD1;
48
+ }
49
+
50
+ #qunit-header a:hover,
51
+ #qunit-header a:focus {
52
+ color: #FFF;
53
+ }
54
+
55
+ #qunit-testrunner-toolbar label {
56
+ display: inline-block;
57
+ padding: 0 0.5em 0 0.1em;
58
+ }
59
+
60
+ #qunit-banner {
61
+ height: 5px;
62
+ }
63
+
64
+ #qunit-testrunner-toolbar {
65
+ padding: 0.5em 1em 0.5em 1em;
66
+ color: #5E740B;
67
+ background-color: #EEE;
68
+ overflow: hidden;
69
+ }
70
+
71
+ #qunit-filteredTest {
72
+ padding: 0.5em 1em 0.5em 1em;
73
+ background-color: #F4FF77;
74
+ color: #366097;
75
+ }
76
+
77
+ #qunit-userAgent {
78
+ padding: 0.5em 1em 0.5em 1em;
79
+ background-color: #2B81AF;
80
+ color: #FFF;
81
+ text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
82
+ }
83
+
84
+ #qunit-modulefilter-container {
85
+ float: right;
86
+ padding: 0.2em;
87
+ }
88
+
89
+ .qunit-url-config {
90
+ display: inline-block;
91
+ padding: 0.1em;
92
+ }
93
+
94
+ .qunit-filter {
95
+ display: block;
96
+ float: right;
97
+ margin-left: 1em;
98
+ }
99
+
100
+ /** Tests: Pass/Fail */
101
+
102
+ #qunit-tests {
103
+ list-style-position: inside;
104
+ }
105
+
106
+ #qunit-tests li {
107
+ padding: 0.4em 1em 0.4em 1em;
108
+ border-bottom: 1px solid #FFF;
109
+ list-style-position: inside;
110
+ }
111
+
112
+ #qunit-tests > li {
113
+ display: none;
114
+ }
115
+
116
+ #qunit-tests li.running,
117
+ #qunit-tests li.pass,
118
+ #qunit-tests li.fail,
119
+ #qunit-tests li.skipped {
120
+ display: list-item;
121
+ }
122
+
123
+ #qunit-tests.hidepass {
124
+ position: relative;
125
+ }
126
+
127
+ #qunit-tests.hidepass li.running,
128
+ #qunit-tests.hidepass li.pass {
129
+ visibility: hidden;
130
+ position: absolute;
131
+ width: 0;
132
+ height: 0;
133
+ padding: 0;
134
+ border: 0;
135
+ margin: 0;
136
+ }
137
+
138
+ #qunit-tests li strong {
139
+ cursor: pointer;
140
+ }
141
+
142
+ #qunit-tests li.skipped strong {
143
+ cursor: default;
144
+ }
145
+
146
+ #qunit-tests li a {
147
+ padding: 0.5em;
148
+ color: #C2CCD1;
149
+ text-decoration: none;
150
+ }
151
+
152
+ #qunit-tests li p a {
153
+ padding: 0.25em;
154
+ color: #6B6464;
155
+ }
156
+ #qunit-tests li a:hover,
157
+ #qunit-tests li a:focus {
158
+ color: #000;
159
+ }
160
+
161
+ #qunit-tests li .runtime {
162
+ float: right;
163
+ font-size: smaller;
164
+ }
165
+
166
+ .qunit-assert-list {
167
+ margin-top: 0.5em;
168
+ padding: 0.5em;
169
+
170
+ background-color: #FFF;
171
+
172
+ border-radius: 5px;
173
+ }
174
+
175
+ .qunit-source {
176
+ margin: 0.6em 0 0.3em;
177
+ }
178
+
179
+ .qunit-collapsed {
180
+ display: none;
181
+ }
182
+
183
+ #qunit-tests table {
184
+ border-collapse: collapse;
185
+ margin-top: 0.2em;
186
+ }
187
+
188
+ #qunit-tests th {
189
+ text-align: right;
190
+ vertical-align: top;
191
+ padding: 0 0.5em 0 0;
192
+ }
193
+
194
+ #qunit-tests td {
195
+ vertical-align: top;
196
+ }
197
+
198
+ #qunit-tests pre {
199
+ margin: 0;
200
+ white-space: pre-wrap;
201
+ word-wrap: break-word;
202
+ }
203
+
204
+ #qunit-tests del {
205
+ background-color: #E0F2BE;
206
+ color: #374E0C;
207
+ text-decoration: none;
208
+ }
209
+
210
+ #qunit-tests ins {
211
+ background-color: #FFCACA;
212
+ color: #500;
213
+ text-decoration: none;
214
+ }
215
+
216
+ /*** Test Counts */
217
+
218
+ #qunit-tests b.counts { color: #000; }
219
+ #qunit-tests b.passed { color: #5E740B; }
220
+ #qunit-tests b.failed { color: #710909; }
221
+
222
+ #qunit-tests li li {
223
+ padding: 5px;
224
+ background-color: #FFF;
225
+ border-bottom: none;
226
+ list-style-position: inside;
227
+ }
228
+
229
+ /*** Passing Styles */
230
+
231
+ #qunit-tests li li.pass {
232
+ color: #3C510C;
233
+ background-color: #FFF;
234
+ border-left: 10px solid #C6E746;
235
+ }
236
+
237
+ #qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; }
238
+ #qunit-tests .pass .test-name { color: #366097; }
239
+
240
+ #qunit-tests .pass .test-actual,
241
+ #qunit-tests .pass .test-expected { color: #999; }
242
+
243
+ #qunit-banner.qunit-pass { background-color: #C6E746; }
244
+
245
+ /*** Failing Styles */
246
+
247
+ #qunit-tests li li.fail {
248
+ color: #710909;
249
+ background-color: #FFF;
250
+ border-left: 10px solid #EE5757;
251
+ white-space: pre;
252
+ }
253
+
254
+ #qunit-tests > li:last-child {
255
+ border-radius: 0 0 5px 5px;
256
+ }
257
+
258
+ #qunit-tests .fail { color: #000; background-color: #EE5757; }
259
+ #qunit-tests .fail .test-name,
260
+ #qunit-tests .fail .module-name { color: #000; }
261
+
262
+ #qunit-tests .fail .test-actual { color: #EE5757; }
263
+ #qunit-tests .fail .test-expected { color: #008000; }
264
+
265
+ #qunit-banner.qunit-fail { background-color: #EE5757; }
266
+
267
+ /*** Skipped tests */
268
+
269
+ #qunit-tests .skipped {
270
+ background-color: #EBECE9;
271
+ }
272
+
273
+ #qunit-tests .qunit-skipped-label {
274
+ background-color: #F4FF77;
275
+ display: inline-block;
276
+ font-style: normal;
277
+ color: #366097;
278
+ line-height: 1.8em;
279
+ padding: 0 0.5em;
280
+ margin: -0.4em 0.4em -0.4em 0;
281
+ }
282
+
283
+ /** Result */
284
+
285
+ #qunit-testresult {
286
+ padding: 0.5em 1em 0.5em 1em;
287
+
288
+ color: #2B81AF;
289
+ background-color: #D2E0E6;
290
+
291
+ border-bottom: 1px solid #FFF;
292
+ }
293
+ #qunit-testresult .module-name {
294
+ font-weight: 700;
295
+ }
296
+
297
+ /** Fixture */
298
+
299
+ #qunit-fixture {
300
+ position: absolute;
301
+ top: -10000px;
302
+ left: -10000px;
303
+ width: 1000px;
304
+ height: 1000px;
305
+ }
@@ -0,0 +1,4204 @@
1
+ /*!
2
+ * QUnit 1.22.0
3
+ * https://qunitjs.com/
4
+ *
5
+ * Copyright jQuery Foundation and other contributors
6
+ * Released under the MIT license
7
+ * https://jquery.org/license
8
+ *
9
+ * Date: 2016-02-23T15:57Z
10
+ */
11
+
12
+ (function( global ) {
13
+
14
+ var QUnit = {};
15
+
16
+ var Date = global.Date;
17
+ var now = Date.now || function() {
18
+ return new Date().getTime();
19
+ };
20
+
21
+ var setTimeout = global.setTimeout;
22
+ var clearTimeout = global.clearTimeout;
23
+
24
+ // Store a local window from the global to allow direct references.
25
+ var window = global.window;
26
+
27
+ var defined = {
28
+ document: window && window.document !== undefined,
29
+ setTimeout: setTimeout !== undefined,
30
+ sessionStorage: (function() {
31
+ var x = "qunit-test-string";
32
+ try {
33
+ sessionStorage.setItem( x, x );
34
+ sessionStorage.removeItem( x );
35
+ return true;
36
+ } catch ( e ) {
37
+ return false;
38
+ }
39
+ }() )
40
+ };
41
+
42
+ var fileName = ( sourceFromStacktrace( 0 ) || "" ).replace( /(:\d+)+\)?/, "" ).replace( /.+\//, "" );
43
+ var globalStartCalled = false;
44
+ var runStarted = false;
45
+
46
+ var toString = Object.prototype.toString,
47
+ hasOwn = Object.prototype.hasOwnProperty;
48
+
49
+ // returns a new Array with the elements that are in a but not in b
50
+ function diff( a, b ) {
51
+ var i, j,
52
+ result = a.slice();
53
+
54
+ for ( i = 0; i < result.length; i++ ) {
55
+ for ( j = 0; j < b.length; j++ ) {
56
+ if ( result[ i ] === b[ j ] ) {
57
+ result.splice( i, 1 );
58
+ i--;
59
+ break;
60
+ }
61
+ }
62
+ }
63
+ return result;
64
+ }
65
+
66
+ // from jquery.js
67
+ function inArray( elem, array ) {
68
+ if ( array.indexOf ) {
69
+ return array.indexOf( elem );
70
+ }
71
+
72
+ for ( var i = 0, length = array.length; i < length; i++ ) {
73
+ if ( array[ i ] === elem ) {
74
+ return i;
75
+ }
76
+ }
77
+
78
+ return -1;
79
+ }
80
+
81
+ /**
82
+ * Makes a clone of an object using only Array or Object as base,
83
+ * and copies over the own enumerable properties.
84
+ *
85
+ * @param {Object} obj
86
+ * @return {Object} New object with only the own properties (recursively).
87
+ */
88
+ function objectValues ( obj ) {
89
+ var key, val,
90
+ vals = QUnit.is( "array", obj ) ? [] : {};
91
+ for ( key in obj ) {
92
+ if ( hasOwn.call( obj, key ) ) {
93
+ val = obj[ key ];
94
+ vals[ key ] = val === Object( val ) ? objectValues( val ) : val;
95
+ }
96
+ }
97
+ return vals;
98
+ }
99
+
100
+ function extend( a, b, undefOnly ) {
101
+ for ( var prop in b ) {
102
+ if ( hasOwn.call( b, prop ) ) {
103
+
104
+ // Avoid "Member not found" error in IE8 caused by messing with window.constructor
105
+ // This block runs on every environment, so `global` is being used instead of `window`
106
+ // to avoid errors on node.
107
+ if ( prop !== "constructor" || a !== global ) {
108
+ if ( b[ prop ] === undefined ) {
109
+ delete a[ prop ];
110
+ } else if ( !( undefOnly && typeof a[ prop ] !== "undefined" ) ) {
111
+ a[ prop ] = b[ prop ];
112
+ }
113
+ }
114
+ }
115
+ }
116
+
117
+ return a;
118
+ }
119
+
120
+ function objectType( obj ) {
121
+ if ( typeof obj === "undefined" ) {
122
+ return "undefined";
123
+ }
124
+
125
+ // Consider: typeof null === object
126
+ if ( obj === null ) {
127
+ return "null";
128
+ }
129
+
130
+ var match = toString.call( obj ).match( /^\[object\s(.*)\]$/ ),
131
+ type = match && match[ 1 ];
132
+
133
+ switch ( type ) {
134
+ case "Number":
135
+ if ( isNaN( obj ) ) {
136
+ return "nan";
137
+ }
138
+ return "number";
139
+ case "String":
140
+ case "Boolean":
141
+ case "Array":
142
+ case "Set":
143
+ case "Map":
144
+ case "Date":
145
+ case "RegExp":
146
+ case "Function":
147
+ case "Symbol":
148
+ return type.toLowerCase();
149
+ }
150
+ if ( typeof obj === "object" ) {
151
+ return "object";
152
+ }
153
+ }
154
+
155
+ // Safe object type checking
156
+ function is( type, obj ) {
157
+ return QUnit.objectType( obj ) === type;
158
+ }
159
+
160
+ var getUrlParams = function() {
161
+ var i, param, name, value;
162
+ var urlParams = {};
163
+ var location = window.location;
164
+ var params = location.search.slice( 1 ).split( "&" );
165
+ var length = params.length;
166
+
167
+ for ( i = 0; i < length; i++ ) {
168
+ if ( params[ i ] ) {
169
+ param = params[ i ].split( "=" );
170
+ name = decodeURIComponent( param[ 0 ] );
171
+
172
+ // allow just a key to turn on a flag, e.g., test.html?noglobals
173
+ value = param.length === 1 ||
174
+ decodeURIComponent( param.slice( 1 ).join( "=" ) ) ;
175
+ if ( urlParams[ name ] ) {
176
+ urlParams[ name ] = [].concat( urlParams[ name ], value );
177
+ } else {
178
+ urlParams[ name ] = value;
179
+ }
180
+ }
181
+ }
182
+
183
+ return urlParams;
184
+ };
185
+
186
+ // Doesn't support IE6 to IE9, it will return undefined on these browsers
187
+ // See also https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error/Stack
188
+ function extractStacktrace( e, offset ) {
189
+ offset = offset === undefined ? 4 : offset;
190
+
191
+ var stack, include, i;
192
+
193
+ if ( e.stack ) {
194
+ stack = e.stack.split( "\n" );
195
+ if ( /^error$/i.test( stack[ 0 ] ) ) {
196
+ stack.shift();
197
+ }
198
+ if ( fileName ) {
199
+ include = [];
200
+ for ( i = offset; i < stack.length; i++ ) {
201
+ if ( stack[ i ].indexOf( fileName ) !== -1 ) {
202
+ break;
203
+ }
204
+ include.push( stack[ i ] );
205
+ }
206
+ if ( include.length ) {
207
+ return include.join( "\n" );
208
+ }
209
+ }
210
+ return stack[ offset ];
211
+
212
+ // Support: Safari <=6 only
213
+ } else if ( e.sourceURL ) {
214
+
215
+ // exclude useless self-reference for generated Error objects
216
+ if ( /qunit.js$/.test( e.sourceURL ) ) {
217
+ return;
218
+ }
219
+
220
+ // for actual exceptions, this is useful
221
+ return e.sourceURL + ":" + e.line;
222
+ }
223
+ }
224
+
225
+ function sourceFromStacktrace( offset ) {
226
+ var error = new Error();
227
+
228
+ // Support: Safari <=7 only, IE <=10 - 11 only
229
+ // Not all browsers generate the `stack` property for `new Error()`, see also #636
230
+ if ( !error.stack ) {
231
+ try {
232
+ throw error;
233
+ } catch ( err ) {
234
+ error = err;
235
+ }
236
+ }
237
+
238
+ return extractStacktrace( error, offset );
239
+ }
240
+
241
+ /**
242
+ * Config object: Maintain internal state
243
+ * Later exposed as QUnit.config
244
+ * `config` initialized at top of scope
245
+ */
246
+ var config = {
247
+ // The queue of tests to run
248
+ queue: [],
249
+
250
+ // block until document ready
251
+ blocking: true,
252
+
253
+ // by default, run previously failed tests first
254
+ // very useful in combination with "Hide passed tests" checked
255
+ reorder: true,
256
+
257
+ // by default, modify document.title when suite is done
258
+ altertitle: true,
259
+
260
+ // HTML Reporter: collapse every test except the first failing test
261
+ // If false, all failing tests will be expanded
262
+ collapse: true,
263
+
264
+ // by default, scroll to top of the page when suite is done
265
+ scrolltop: true,
266
+
267
+ // depth up-to which object will be dumped
268
+ maxDepth: 5,
269
+
270
+ // when enabled, all tests must call expect()
271
+ requireExpects: false,
272
+
273
+ // add checkboxes that are persisted in the query-string
274
+ // when enabled, the id is set to `true` as a `QUnit.config` property
275
+ urlConfig: [
276
+ {
277
+ id: "hidepassed",
278
+ label: "Hide passed tests",
279
+ tooltip: "Only show tests and assertions that fail. Stored as query-strings."
280
+ },
281
+ {
282
+ id: "noglobals",
283
+ label: "Check for Globals",
284
+ tooltip: "Enabling this will test if any test introduces new properties on the " +
285
+ "global object (`window` in Browsers). Stored as query-strings."
286
+ },
287
+ {
288
+ id: "notrycatch",
289
+ label: "No try-catch",
290
+ tooltip: "Enabling this will run tests outside of a try-catch block. Makes debugging " +
291
+ "exceptions in IE reasonable. Stored as query-strings."
292
+ }
293
+ ],
294
+
295
+ // Set of all modules.
296
+ modules: [],
297
+
298
+ // Stack of nested modules
299
+ moduleStack: [],
300
+
301
+ // The first unnamed module
302
+ currentModule: {
303
+ name: "",
304
+ tests: []
305
+ },
306
+
307
+ callbacks: {}
308
+ };
309
+
310
+ var urlParams = defined.document ? getUrlParams() : {};
311
+
312
+ // Push a loose unnamed module to the modules collection
313
+ config.modules.push( config.currentModule );
314
+
315
+ if ( urlParams.filter === true ) {
316
+ delete urlParams.filter;
317
+ }
318
+
319
+ // String search anywhere in moduleName+testName
320
+ config.filter = urlParams.filter;
321
+
322
+ config.testId = [];
323
+ if ( urlParams.testId ) {
324
+ // Ensure that urlParams.testId is an array
325
+ urlParams.testId = decodeURIComponent( urlParams.testId ).split( "," );
326
+ for (var i = 0; i < urlParams.testId.length; i++ ) {
327
+ config.testId.push( urlParams.testId[ i ] );
328
+ }
329
+ }
330
+
331
+ var loggingCallbacks = {};
332
+
333
+ // Register logging callbacks
334
+ function registerLoggingCallbacks( obj ) {
335
+ var i, l, key,
336
+ callbackNames = [ "begin", "done", "log", "testStart", "testDone",
337
+ "moduleStart", "moduleDone" ];
338
+
339
+ function registerLoggingCallback( key ) {
340
+ var loggingCallback = function( callback ) {
341
+ if ( objectType( callback ) !== "function" ) {
342
+ throw new Error(
343
+ "QUnit logging methods require a callback function as their first parameters."
344
+ );
345
+ }
346
+
347
+ config.callbacks[ key ].push( callback );
348
+ };
349
+
350
+ // DEPRECATED: This will be removed on QUnit 2.0.0+
351
+ // Stores the registered functions allowing restoring
352
+ // at verifyLoggingCallbacks() if modified
353
+ loggingCallbacks[ key ] = loggingCallback;
354
+
355
+ return loggingCallback;
356
+ }
357
+
358
+ for ( i = 0, l = callbackNames.length; i < l; i++ ) {
359
+ key = callbackNames[ i ];
360
+
361
+ // Initialize key collection of logging callback
362
+ if ( objectType( config.callbacks[ key ] ) === "undefined" ) {
363
+ config.callbacks[ key ] = [];
364
+ }
365
+
366
+ obj[ key ] = registerLoggingCallback( key );
367
+ }
368
+ }
369
+
370
+ function runLoggingCallbacks( key, args ) {
371
+ var i, l, callbacks;
372
+
373
+ callbacks = config.callbacks[ key ];
374
+ for ( i = 0, l = callbacks.length; i < l; i++ ) {
375
+ callbacks[ i ]( args );
376
+ }
377
+ }
378
+
379
+ // DEPRECATED: This will be removed on 2.0.0+
380
+ // This function verifies if the loggingCallbacks were modified by the user
381
+ // If so, it will restore it, assign the given callback and print a console warning
382
+ function verifyLoggingCallbacks() {
383
+ var loggingCallback, userCallback;
384
+
385
+ for ( loggingCallback in loggingCallbacks ) {
386
+ if ( QUnit[ loggingCallback ] !== loggingCallbacks[ loggingCallback ] ) {
387
+
388
+ userCallback = QUnit[ loggingCallback ];
389
+
390
+ // Restore the callback function
391
+ QUnit[ loggingCallback ] = loggingCallbacks[ loggingCallback ];
392
+
393
+ // Assign the deprecated given callback
394
+ QUnit[ loggingCallback ]( userCallback );
395
+
396
+ if ( global.console && global.console.warn ) {
397
+ global.console.warn(
398
+ "QUnit." + loggingCallback + " was replaced with a new value.\n" +
399
+ "Please, check out the documentation on how to apply logging callbacks.\n" +
400
+ "Reference: https://api.qunitjs.com/category/callbacks/"
401
+ );
402
+ }
403
+ }
404
+ }
405
+ }
406
+
407
+ ( function() {
408
+ if ( !defined.document ) {
409
+ return;
410
+ }
411
+
412
+ // `onErrorFnPrev` initialized at top of scope
413
+ // Preserve other handlers
414
+ var onErrorFnPrev = window.onerror;
415
+
416
+ // Cover uncaught exceptions
417
+ // Returning true will suppress the default browser handler,
418
+ // returning false will let it run.
419
+ window.onerror = function( error, filePath, linerNr ) {
420
+ var ret = false;
421
+ if ( onErrorFnPrev ) {
422
+ ret = onErrorFnPrev( error, filePath, linerNr );
423
+ }
424
+
425
+ // Treat return value as window.onerror itself does,
426
+ // Only do our handling if not suppressed.
427
+ if ( ret !== true ) {
428
+ if ( QUnit.config.current ) {
429
+ if ( QUnit.config.current.ignoreGlobalErrors ) {
430
+ return true;
431
+ }
432
+ QUnit.pushFailure( error, filePath + ":" + linerNr );
433
+ } else {
434
+ QUnit.test( "global failure", extend(function() {
435
+ QUnit.pushFailure( error, filePath + ":" + linerNr );
436
+ }, { validTest: true } ) );
437
+ }
438
+ return false;
439
+ }
440
+
441
+ return ret;
442
+ };
443
+ } )();
444
+
445
+ QUnit.urlParams = urlParams;
446
+
447
+ // Figure out if we're running the tests from a server or not
448
+ QUnit.isLocal = !( defined.document && window.location.protocol !== "file:" );
449
+
450
+ // Expose the current QUnit version
451
+ QUnit.version = "1.22.0";
452
+
453
+ extend( QUnit, {
454
+
455
+ // call on start of module test to prepend name to all tests
456
+ module: function( name, testEnvironment, executeNow ) {
457
+ var module, moduleFns;
458
+ var currentModule = config.currentModule;
459
+
460
+ if ( arguments.length === 2 ) {
461
+ if ( testEnvironment instanceof Function ) {
462
+ executeNow = testEnvironment;
463
+ testEnvironment = undefined;
464
+ }
465
+ }
466
+
467
+ // DEPRECATED: handles setup/teardown functions,
468
+ // beforeEach and afterEach should be used instead
469
+ if ( testEnvironment && testEnvironment.setup ) {
470
+ testEnvironment.beforeEach = testEnvironment.setup;
471
+ delete testEnvironment.setup;
472
+ }
473
+ if ( testEnvironment && testEnvironment.teardown ) {
474
+ testEnvironment.afterEach = testEnvironment.teardown;
475
+ delete testEnvironment.teardown;
476
+ }
477
+
478
+ module = createModule();
479
+
480
+ moduleFns = {
481
+ beforeEach: setHook( module, "beforeEach" ),
482
+ afterEach: setHook( module, "afterEach" )
483
+ };
484
+
485
+ if ( executeNow instanceof Function ) {
486
+ config.moduleStack.push( module );
487
+ setCurrentModule( module );
488
+ executeNow.call( module.testEnvironment, moduleFns );
489
+ config.moduleStack.pop();
490
+ module = module.parentModule || currentModule;
491
+ }
492
+
493
+ setCurrentModule( module );
494
+
495
+ function createModule() {
496
+ var parentModule = config.moduleStack.length ?
497
+ config.moduleStack.slice( -1 )[ 0 ] : null;
498
+ var moduleName = parentModule !== null ?
499
+ [ parentModule.name, name ].join( " > " ) : name;
500
+ var module = {
501
+ name: moduleName,
502
+ parentModule: parentModule,
503
+ tests: []
504
+ };
505
+
506
+ var env = {};
507
+ if ( parentModule ) {
508
+ extend( env, parentModule.testEnvironment );
509
+ delete env.beforeEach;
510
+ delete env.afterEach;
511
+ }
512
+ extend( env, testEnvironment );
513
+ module.testEnvironment = env;
514
+
515
+ config.modules.push( module );
516
+ return module;
517
+ }
518
+
519
+ function setCurrentModule( module ) {
520
+ config.currentModule = module;
521
+ }
522
+
523
+ },
524
+
525
+ // DEPRECATED: QUnit.asyncTest() will be removed in QUnit 2.0.
526
+ asyncTest: asyncTest,
527
+
528
+ test: test,
529
+
530
+ skip: skip,
531
+
532
+ only: only,
533
+
534
+ // DEPRECATED: The functionality of QUnit.start() will be altered in QUnit 2.0.
535
+ // In QUnit 2.0, invoking it will ONLY affect the `QUnit.config.autostart` blocking behavior.
536
+ start: function( count ) {
537
+ var globalStartAlreadyCalled = globalStartCalled;
538
+
539
+ if ( !config.current ) {
540
+ globalStartCalled = true;
541
+
542
+ if ( runStarted ) {
543
+ throw new Error( "Called start() outside of a test context while already started" );
544
+ } else if ( globalStartAlreadyCalled || count > 1 ) {
545
+ throw new Error( "Called start() outside of a test context too many times" );
546
+ } else if ( config.autostart ) {
547
+ throw new Error( "Called start() outside of a test context when " +
548
+ "QUnit.config.autostart was true" );
549
+ } else if ( !config.pageLoaded ) {
550
+
551
+ // The page isn't completely loaded yet, so bail out and let `QUnit.load` handle it
552
+ config.autostart = true;
553
+ return;
554
+ }
555
+ } else {
556
+
557
+ // If a test is running, adjust its semaphore
558
+ config.current.semaphore -= count || 1;
559
+
560
+ // If semaphore is non-numeric, throw error
561
+ if ( isNaN( config.current.semaphore ) ) {
562
+ config.current.semaphore = 0;
563
+
564
+ QUnit.pushFailure(
565
+ "Called start() with a non-numeric decrement.",
566
+ sourceFromStacktrace( 2 )
567
+ );
568
+ return;
569
+ }
570
+
571
+ // Don't start until equal number of stop-calls
572
+ if ( config.current.semaphore > 0 ) {
573
+ return;
574
+ }
575
+
576
+ // throw an Error if start is called more often than stop
577
+ if ( config.current.semaphore < 0 ) {
578
+ config.current.semaphore = 0;
579
+
580
+ QUnit.pushFailure(
581
+ "Called start() while already started (test's semaphore was 0 already)",
582
+ sourceFromStacktrace( 2 )
583
+ );
584
+ return;
585
+ }
586
+ }
587
+
588
+ resumeProcessing();
589
+ },
590
+
591
+ // DEPRECATED: QUnit.stop() will be removed in QUnit 2.0.
592
+ stop: function( count ) {
593
+
594
+ // If there isn't a test running, don't allow QUnit.stop() to be called
595
+ if ( !config.current ) {
596
+ throw new Error( "Called stop() outside of a test context" );
597
+ }
598
+
599
+ // If a test is running, adjust its semaphore
600
+ config.current.semaphore += count || 1;
601
+
602
+ pauseProcessing();
603
+ },
604
+
605
+ config: config,
606
+
607
+ is: is,
608
+
609
+ objectType: objectType,
610
+
611
+ extend: extend,
612
+
613
+ load: function() {
614
+ config.pageLoaded = true;
615
+
616
+ // Initialize the configuration options
617
+ extend( config, {
618
+ stats: { all: 0, bad: 0 },
619
+ moduleStats: { all: 0, bad: 0 },
620
+ started: 0,
621
+ updateRate: 1000,
622
+ autostart: true,
623
+ filter: ""
624
+ }, true );
625
+
626
+ config.blocking = false;
627
+
628
+ if ( config.autostart ) {
629
+ resumeProcessing();
630
+ }
631
+ },
632
+
633
+ stack: function( offset ) {
634
+ offset = ( offset || 0 ) + 2;
635
+ return sourceFromStacktrace( offset );
636
+ }
637
+ });
638
+
639
+ registerLoggingCallbacks( QUnit );
640
+
641
+ function begin() {
642
+ var i, l,
643
+ modulesLog = [];
644
+
645
+ // If the test run hasn't officially begun yet
646
+ if ( !config.started ) {
647
+
648
+ // Record the time of the test run's beginning
649
+ config.started = now();
650
+
651
+ verifyLoggingCallbacks();
652
+
653
+ // Delete the loose unnamed module if unused.
654
+ if ( config.modules[ 0 ].name === "" && config.modules[ 0 ].tests.length === 0 ) {
655
+ config.modules.shift();
656
+ }
657
+
658
+ // Avoid unnecessary information by not logging modules' test environments
659
+ for ( i = 0, l = config.modules.length; i < l; i++ ) {
660
+ modulesLog.push({
661
+ name: config.modules[ i ].name,
662
+ tests: config.modules[ i ].tests
663
+ });
664
+ }
665
+
666
+ // The test run is officially beginning now
667
+ runLoggingCallbacks( "begin", {
668
+ totalTests: Test.count,
669
+ modules: modulesLog
670
+ });
671
+ }
672
+
673
+ config.blocking = false;
674
+ process( true );
675
+ }
676
+
677
+ function process( last ) {
678
+ function next() {
679
+ process( last );
680
+ }
681
+ var start = now();
682
+ config.depth = ( config.depth || 0 ) + 1;
683
+
684
+ while ( config.queue.length && !config.blocking ) {
685
+ if ( !defined.setTimeout || config.updateRate <= 0 ||
686
+ ( ( now() - start ) < config.updateRate ) ) {
687
+ if ( config.current ) {
688
+
689
+ // Reset async tracking for each phase of the Test lifecycle
690
+ config.current.usedAsync = false;
691
+ }
692
+ config.queue.shift()();
693
+ } else {
694
+ setTimeout( next, 13 );
695
+ break;
696
+ }
697
+ }
698
+ config.depth--;
699
+ if ( last && !config.blocking && !config.queue.length && config.depth === 0 ) {
700
+ done();
701
+ }
702
+ }
703
+
704
+ function pauseProcessing() {
705
+ config.blocking = true;
706
+
707
+ if ( config.testTimeout && defined.setTimeout ) {
708
+ clearTimeout( config.timeout );
709
+ config.timeout = setTimeout(function() {
710
+ if ( config.current ) {
711
+ config.current.semaphore = 0;
712
+ QUnit.pushFailure( "Test timed out", sourceFromStacktrace( 2 ) );
713
+ } else {
714
+ throw new Error( "Test timed out" );
715
+ }
716
+ resumeProcessing();
717
+ }, config.testTimeout );
718
+ }
719
+ }
720
+
721
+ function resumeProcessing() {
722
+ runStarted = true;
723
+
724
+ // A slight delay to allow this iteration of the event loop to finish (more assertions, etc.)
725
+ if ( defined.setTimeout ) {
726
+ setTimeout(function() {
727
+ if ( config.current && config.current.semaphore > 0 ) {
728
+ return;
729
+ }
730
+ if ( config.timeout ) {
731
+ clearTimeout( config.timeout );
732
+ }
733
+
734
+ begin();
735
+ }, 13 );
736
+ } else {
737
+ begin();
738
+ }
739
+ }
740
+
741
+ function done() {
742
+ var runtime, passed;
743
+
744
+ config.autorun = true;
745
+
746
+ // Log the last module results
747
+ if ( config.previousModule ) {
748
+ runLoggingCallbacks( "moduleDone", {
749
+ name: config.previousModule.name,
750
+ tests: config.previousModule.tests,
751
+ failed: config.moduleStats.bad,
752
+ passed: config.moduleStats.all - config.moduleStats.bad,
753
+ total: config.moduleStats.all,
754
+ runtime: now() - config.moduleStats.started
755
+ });
756
+ }
757
+ delete config.previousModule;
758
+
759
+ runtime = now() - config.started;
760
+ passed = config.stats.all - config.stats.bad;
761
+
762
+ runLoggingCallbacks( "done", {
763
+ failed: config.stats.bad,
764
+ passed: passed,
765
+ total: config.stats.all,
766
+ runtime: runtime
767
+ });
768
+ }
769
+
770
+ function setHook( module, hookName ) {
771
+ if ( module.testEnvironment === undefined ) {
772
+ module.testEnvironment = {};
773
+ }
774
+
775
+ return function( callback ) {
776
+ module.testEnvironment[ hookName ] = callback;
777
+ };
778
+ }
779
+
780
+ var focused = false;
781
+ var priorityCount = 0;
782
+
783
+ function Test( settings ) {
784
+ var i, l;
785
+
786
+ ++Test.count;
787
+
788
+ extend( this, settings );
789
+ this.assertions = [];
790
+ this.semaphore = 0;
791
+ this.usedAsync = false;
792
+ this.module = config.currentModule;
793
+ this.stack = sourceFromStacktrace( 3 );
794
+
795
+ // Register unique strings
796
+ for ( i = 0, l = this.module.tests; i < l.length; i++ ) {
797
+ if ( this.module.tests[ i ].name === this.testName ) {
798
+ this.testName += " ";
799
+ }
800
+ }
801
+
802
+ this.testId = generateHash( this.module.name, this.testName );
803
+
804
+ this.module.tests.push({
805
+ name: this.testName,
806
+ testId: this.testId
807
+ });
808
+
809
+ if ( settings.skip ) {
810
+
811
+ // Skipped tests will fully ignore any sent callback
812
+ this.callback = function() {};
813
+ this.async = false;
814
+ this.expected = 0;
815
+ } else {
816
+ this.assert = new Assert( this );
817
+ }
818
+ }
819
+
820
+ Test.count = 0;
821
+
822
+ Test.prototype = {
823
+ before: function() {
824
+ if (
825
+
826
+ // Emit moduleStart when we're switching from one module to another
827
+ this.module !== config.previousModule ||
828
+
829
+ // They could be equal (both undefined) but if the previousModule property doesn't
830
+ // yet exist it means this is the first test in a suite that isn't wrapped in a
831
+ // module, in which case we'll just emit a moduleStart event for 'undefined'.
832
+ // Without this, reporters can get testStart before moduleStart which is a problem.
833
+ !hasOwn.call( config, "previousModule" )
834
+ ) {
835
+ if ( hasOwn.call( config, "previousModule" ) ) {
836
+ runLoggingCallbacks( "moduleDone", {
837
+ name: config.previousModule.name,
838
+ tests: config.previousModule.tests,
839
+ failed: config.moduleStats.bad,
840
+ passed: config.moduleStats.all - config.moduleStats.bad,
841
+ total: config.moduleStats.all,
842
+ runtime: now() - config.moduleStats.started
843
+ });
844
+ }
845
+ config.previousModule = this.module;
846
+ config.moduleStats = { all: 0, bad: 0, started: now() };
847
+ runLoggingCallbacks( "moduleStart", {
848
+ name: this.module.name,
849
+ tests: this.module.tests
850
+ });
851
+ }
852
+
853
+ config.current = this;
854
+
855
+ if ( this.module.testEnvironment ) {
856
+ delete this.module.testEnvironment.beforeEach;
857
+ delete this.module.testEnvironment.afterEach;
858
+ }
859
+ this.testEnvironment = extend( {}, this.module.testEnvironment );
860
+
861
+ this.started = now();
862
+ runLoggingCallbacks( "testStart", {
863
+ name: this.testName,
864
+ module: this.module.name,
865
+ testId: this.testId
866
+ });
867
+
868
+ if ( !config.pollution ) {
869
+ saveGlobal();
870
+ }
871
+ },
872
+
873
+ run: function() {
874
+ var promise;
875
+
876
+ config.current = this;
877
+
878
+ if ( this.async ) {
879
+ QUnit.stop();
880
+ }
881
+
882
+ this.callbackStarted = now();
883
+
884
+ if ( config.notrycatch ) {
885
+ runTest( this );
886
+ return;
887
+ }
888
+
889
+ try {
890
+ runTest( this );
891
+ } catch ( e ) {
892
+ this.pushFailure( "Died on test #" + ( this.assertions.length + 1 ) + " " +
893
+ this.stack + ": " + ( e.message || e ), extractStacktrace( e, 0 ) );
894
+
895
+ // else next test will carry the responsibility
896
+ saveGlobal();
897
+
898
+ // Restart the tests if they're blocking
899
+ if ( config.blocking ) {
900
+ QUnit.start();
901
+ }
902
+ }
903
+
904
+ function runTest( test ) {
905
+ promise = test.callback.call( test.testEnvironment, test.assert );
906
+ test.resolvePromise( promise );
907
+ }
908
+ },
909
+
910
+ after: function() {
911
+ checkPollution();
912
+ },
913
+
914
+ queueHook: function( hook, hookName ) {
915
+ var promise,
916
+ test = this;
917
+ return function runHook() {
918
+ config.current = test;
919
+ if ( config.notrycatch ) {
920
+ callHook();
921
+ return;
922
+ }
923
+ try {
924
+ callHook();
925
+ } catch ( error ) {
926
+ test.pushFailure( hookName + " failed on " + test.testName + ": " +
927
+ ( error.message || error ), extractStacktrace( error, 0 ) );
928
+ }
929
+
930
+ function callHook() {
931
+ promise = hook.call( test.testEnvironment, test.assert );
932
+ test.resolvePromise( promise, hookName );
933
+ }
934
+ };
935
+ },
936
+
937
+ // Currently only used for module level hooks, can be used to add global level ones
938
+ hooks: function( handler ) {
939
+ var hooks = [];
940
+
941
+ function processHooks( test, module ) {
942
+ if ( module.parentModule ) {
943
+ processHooks( test, module.parentModule );
944
+ }
945
+ if ( module.testEnvironment &&
946
+ QUnit.objectType( module.testEnvironment[ handler ] ) === "function" ) {
947
+ hooks.push( test.queueHook( module.testEnvironment[ handler ], handler ) );
948
+ }
949
+ }
950
+
951
+ // Hooks are ignored on skipped tests
952
+ if ( !this.skip ) {
953
+ processHooks( this, this.module );
954
+ }
955
+ return hooks;
956
+ },
957
+
958
+ finish: function() {
959
+ config.current = this;
960
+ if ( config.requireExpects && this.expected === null ) {
961
+ this.pushFailure( "Expected number of assertions to be defined, but expect() was " +
962
+ "not called.", this.stack );
963
+ } else if ( this.expected !== null && this.expected !== this.assertions.length ) {
964
+ this.pushFailure( "Expected " + this.expected + " assertions, but " +
965
+ this.assertions.length + " were run", this.stack );
966
+ } else if ( this.expected === null && !this.assertions.length ) {
967
+ this.pushFailure( "Expected at least one assertion, but none were run - call " +
968
+ "expect(0) to accept zero assertions.", this.stack );
969
+ }
970
+
971
+ var i,
972
+ bad = 0;
973
+
974
+ this.runtime = now() - this.started;
975
+ config.stats.all += this.assertions.length;
976
+ config.moduleStats.all += this.assertions.length;
977
+
978
+ for ( i = 0; i < this.assertions.length; i++ ) {
979
+ if ( !this.assertions[ i ].result ) {
980
+ bad++;
981
+ config.stats.bad++;
982
+ config.moduleStats.bad++;
983
+ }
984
+ }
985
+
986
+ runLoggingCallbacks( "testDone", {
987
+ name: this.testName,
988
+ module: this.module.name,
989
+ skipped: !!this.skip,
990
+ failed: bad,
991
+ passed: this.assertions.length - bad,
992
+ total: this.assertions.length,
993
+ runtime: this.runtime,
994
+
995
+ // HTML Reporter use
996
+ assertions: this.assertions,
997
+ testId: this.testId,
998
+
999
+ // Source of Test
1000
+ source: this.stack,
1001
+
1002
+ // DEPRECATED: this property will be removed in 2.0.0, use runtime instead
1003
+ duration: this.runtime
1004
+ });
1005
+
1006
+ // QUnit.reset() is deprecated and will be replaced for a new
1007
+ // fixture reset function on QUnit 2.0/2.1.
1008
+ // It's still called here for backwards compatibility handling
1009
+ QUnit.reset();
1010
+
1011
+ config.current = undefined;
1012
+ },
1013
+
1014
+ queue: function() {
1015
+ var priority,
1016
+ test = this;
1017
+
1018
+ if ( !this.valid() ) {
1019
+ return;
1020
+ }
1021
+
1022
+ function run() {
1023
+
1024
+ // each of these can by async
1025
+ synchronize([
1026
+ function() {
1027
+ test.before();
1028
+ },
1029
+
1030
+ test.hooks( "beforeEach" ),
1031
+ function() {
1032
+ test.run();
1033
+ },
1034
+
1035
+ test.hooks( "afterEach" ).reverse(),
1036
+
1037
+ function() {
1038
+ test.after();
1039
+ },
1040
+ function() {
1041
+ test.finish();
1042
+ }
1043
+ ]);
1044
+ }
1045
+
1046
+ // Prioritize previously failed tests, detected from sessionStorage
1047
+ priority = QUnit.config.reorder && defined.sessionStorage &&
1048
+ +sessionStorage.getItem( "qunit-test-" + this.module.name + "-" + this.testName );
1049
+
1050
+ return synchronize( run, priority );
1051
+ },
1052
+
1053
+ pushResult: function( resultInfo ) {
1054
+
1055
+ // resultInfo = { result, actual, expected, message, negative }
1056
+ var source,
1057
+ details = {
1058
+ module: this.module.name,
1059
+ name: this.testName,
1060
+ result: resultInfo.result,
1061
+ message: resultInfo.message,
1062
+ actual: resultInfo.actual,
1063
+ expected: resultInfo.expected,
1064
+ testId: this.testId,
1065
+ negative: resultInfo.negative || false,
1066
+ runtime: now() - this.started
1067
+ };
1068
+
1069
+ if ( !resultInfo.result ) {
1070
+ source = sourceFromStacktrace();
1071
+
1072
+ if ( source ) {
1073
+ details.source = source;
1074
+ }
1075
+ }
1076
+
1077
+ runLoggingCallbacks( "log", details );
1078
+
1079
+ this.assertions.push({
1080
+ result: !!resultInfo.result,
1081
+ message: resultInfo.message
1082
+ });
1083
+ },
1084
+
1085
+ pushFailure: function( message, source, actual ) {
1086
+ if ( !( this instanceof Test ) ) {
1087
+ throw new Error( "pushFailure() assertion outside test context, was " +
1088
+ sourceFromStacktrace( 2 ) );
1089
+ }
1090
+
1091
+ var details = {
1092
+ module: this.module.name,
1093
+ name: this.testName,
1094
+ result: false,
1095
+ message: message || "error",
1096
+ actual: actual || null,
1097
+ testId: this.testId,
1098
+ runtime: now() - this.started
1099
+ };
1100
+
1101
+ if ( source ) {
1102
+ details.source = source;
1103
+ }
1104
+
1105
+ runLoggingCallbacks( "log", details );
1106
+
1107
+ this.assertions.push({
1108
+ result: false,
1109
+ message: message
1110
+ });
1111
+ },
1112
+
1113
+ resolvePromise: function( promise, phase ) {
1114
+ var then, message,
1115
+ test = this;
1116
+ if ( promise != null ) {
1117
+ then = promise.then;
1118
+ if ( QUnit.objectType( then ) === "function" ) {
1119
+ QUnit.stop();
1120
+ then.call(
1121
+ promise,
1122
+ function() { QUnit.start(); },
1123
+ function( error ) {
1124
+ message = "Promise rejected " +
1125
+ ( !phase ? "during" : phase.replace( /Each$/, "" ) ) +
1126
+ " " + test.testName + ": " + ( error.message || error );
1127
+ test.pushFailure( message, extractStacktrace( error, 0 ) );
1128
+
1129
+ // else next test will carry the responsibility
1130
+ saveGlobal();
1131
+
1132
+ // Unblock
1133
+ QUnit.start();
1134
+ }
1135
+ );
1136
+ }
1137
+ }
1138
+ },
1139
+
1140
+ valid: function() {
1141
+ var filter = config.filter,
1142
+ regexFilter = /^(!?)\/([\w\W]*)\/(i?$)/.exec( filter ),
1143
+ module = QUnit.urlParams.module && QUnit.urlParams.module.toLowerCase(),
1144
+ fullName = ( this.module.name + ": " + this.testName );
1145
+
1146
+ function testInModuleChain( testModule ) {
1147
+ var testModuleName = testModule.name ? testModule.name.toLowerCase() : null;
1148
+ if ( testModuleName === module ) {
1149
+ return true;
1150
+ } else if ( testModule.parentModule ) {
1151
+ return testInModuleChain( testModule.parentModule );
1152
+ } else {
1153
+ return false;
1154
+ }
1155
+ }
1156
+
1157
+ // Internally-generated tests are always valid
1158
+ if ( this.callback && this.callback.validTest ) {
1159
+ return true;
1160
+ }
1161
+
1162
+ if ( config.testId.length > 0 && inArray( this.testId, config.testId ) < 0 ) {
1163
+ return false;
1164
+ }
1165
+
1166
+ if ( module && !testInModuleChain( this.module ) ) {
1167
+ return false;
1168
+ }
1169
+
1170
+ if ( !filter ) {
1171
+ return true;
1172
+ }
1173
+
1174
+ return regexFilter ?
1175
+ this.regexFilter( !!regexFilter[1], regexFilter[2], regexFilter[3], fullName ) :
1176
+ this.stringFilter( filter, fullName );
1177
+ },
1178
+
1179
+ regexFilter: function( exclude, pattern, flags, fullName ) {
1180
+ var regex = new RegExp( pattern, flags );
1181
+ var match = regex.test( fullName );
1182
+
1183
+ return match !== exclude;
1184
+ },
1185
+
1186
+ stringFilter: function( filter, fullName ) {
1187
+ filter = filter.toLowerCase();
1188
+ fullName = fullName.toLowerCase();
1189
+
1190
+ var include = filter.charAt( 0 ) !== "!";
1191
+ if ( !include ) {
1192
+ filter = filter.slice( 1 );
1193
+ }
1194
+
1195
+ // If the filter matches, we need to honour include
1196
+ if ( fullName.indexOf( filter ) !== -1 ) {
1197
+ return include;
1198
+ }
1199
+
1200
+ // Otherwise, do the opposite
1201
+ return !include;
1202
+ }
1203
+ };
1204
+
1205
+ // Resets the test setup. Useful for tests that modify the DOM.
1206
+ /*
1207
+ DEPRECATED: Use multiple tests instead of resetting inside a test.
1208
+ Use testStart or testDone for custom cleanup.
1209
+ This method will throw an error in 2.0, and will be removed in 2.1
1210
+ */
1211
+ QUnit.reset = function() {
1212
+
1213
+ // Return on non-browser environments
1214
+ // This is necessary to not break on node tests
1215
+ if ( !defined.document ) {
1216
+ return;
1217
+ }
1218
+
1219
+ var fixture = defined.document && document.getElementById &&
1220
+ document.getElementById( "qunit-fixture" );
1221
+
1222
+ if ( fixture ) {
1223
+ fixture.innerHTML = config.fixture;
1224
+ }
1225
+ };
1226
+
1227
+ QUnit.pushFailure = function() {
1228
+ if ( !QUnit.config.current ) {
1229
+ throw new Error( "pushFailure() assertion outside test context, in " +
1230
+ sourceFromStacktrace( 2 ) );
1231
+ }
1232
+
1233
+ // Gets current test obj
1234
+ var currentTest = QUnit.config.current;
1235
+
1236
+ return currentTest.pushFailure.apply( currentTest, arguments );
1237
+ };
1238
+
1239
+ // Based on Java's String.hashCode, a simple but not
1240
+ // rigorously collision resistant hashing function
1241
+ function generateHash( module, testName ) {
1242
+ var hex,
1243
+ i = 0,
1244
+ hash = 0,
1245
+ str = module + "\x1C" + testName,
1246
+ len = str.length;
1247
+
1248
+ for ( ; i < len; i++ ) {
1249
+ hash = ( ( hash << 5 ) - hash ) + str.charCodeAt( i );
1250
+ hash |= 0;
1251
+ }
1252
+
1253
+ // Convert the possibly negative integer hash code into an 8 character hex string, which isn't
1254
+ // strictly necessary but increases user understanding that the id is a SHA-like hash
1255
+ hex = ( 0x100000000 + hash ).toString( 16 );
1256
+ if ( hex.length < 8 ) {
1257
+ hex = "0000000" + hex;
1258
+ }
1259
+
1260
+ return hex.slice( -8 );
1261
+ }
1262
+
1263
+ function synchronize( callback, priority ) {
1264
+ var last = !priority;
1265
+
1266
+ if ( QUnit.objectType( callback ) === "array" ) {
1267
+ while ( callback.length ) {
1268
+ synchronize( callback.shift() );
1269
+ }
1270
+ return;
1271
+ }
1272
+
1273
+ if ( priority ) {
1274
+ config.queue.splice( priorityCount++, 0, callback );
1275
+ } else {
1276
+ config.queue.push( callback );
1277
+ }
1278
+
1279
+ if ( config.autorun && !config.blocking ) {
1280
+ process( last );
1281
+ }
1282
+ }
1283
+
1284
+ function saveGlobal() {
1285
+ config.pollution = [];
1286
+
1287
+ if ( config.noglobals ) {
1288
+ for ( var key in global ) {
1289
+ if ( hasOwn.call( global, key ) ) {
1290
+
1291
+ // in Opera sometimes DOM element ids show up here, ignore them
1292
+ if ( /^qunit-test-output/.test( key ) ) {
1293
+ continue;
1294
+ }
1295
+ config.pollution.push( key );
1296
+ }
1297
+ }
1298
+ }
1299
+ }
1300
+
1301
+ function checkPollution() {
1302
+ var newGlobals,
1303
+ deletedGlobals,
1304
+ old = config.pollution;
1305
+
1306
+ saveGlobal();
1307
+
1308
+ newGlobals = diff( config.pollution, old );
1309
+ if ( newGlobals.length > 0 ) {
1310
+ QUnit.pushFailure( "Introduced global variable(s): " + newGlobals.join( ", " ) );
1311
+ }
1312
+
1313
+ deletedGlobals = diff( old, config.pollution );
1314
+ if ( deletedGlobals.length > 0 ) {
1315
+ QUnit.pushFailure( "Deleted global variable(s): " + deletedGlobals.join( ", " ) );
1316
+ }
1317
+ }
1318
+
1319
+ // Will be exposed as QUnit.asyncTest
1320
+ function asyncTest( testName, expected, callback ) {
1321
+ if ( arguments.length === 2 ) {
1322
+ callback = expected;
1323
+ expected = null;
1324
+ }
1325
+
1326
+ QUnit.test( testName, expected, callback, true );
1327
+ }
1328
+
1329
+ // Will be exposed as QUnit.test
1330
+ function test( testName, expected, callback, async ) {
1331
+ if ( focused ) { return; }
1332
+
1333
+ var newTest;
1334
+
1335
+ if ( arguments.length === 2 ) {
1336
+ callback = expected;
1337
+ expected = null;
1338
+ }
1339
+
1340
+ newTest = new Test({
1341
+ testName: testName,
1342
+ expected: expected,
1343
+ async: async,
1344
+ callback: callback
1345
+ });
1346
+
1347
+ newTest.queue();
1348
+ }
1349
+
1350
+ // Will be exposed as QUnit.skip
1351
+ function skip( testName ) {
1352
+ if ( focused ) { return; }
1353
+
1354
+ var test = new Test({
1355
+ testName: testName,
1356
+ skip: true
1357
+ });
1358
+
1359
+ test.queue();
1360
+ }
1361
+
1362
+ // Will be exposed as QUnit.only
1363
+ function only( testName, expected, callback, async ) {
1364
+ var newTest;
1365
+
1366
+ if ( focused ) { return; }
1367
+
1368
+ QUnit.config.queue.length = 0;
1369
+ focused = true;
1370
+
1371
+ if ( arguments.length === 2 ) {
1372
+ callback = expected;
1373
+ expected = null;
1374
+ }
1375
+
1376
+ newTest = new Test({
1377
+ testName: testName,
1378
+ expected: expected,
1379
+ async: async,
1380
+ callback: callback
1381
+ });
1382
+
1383
+ newTest.queue();
1384
+ }
1385
+
1386
+ function Assert( testContext ) {
1387
+ this.test = testContext;
1388
+ }
1389
+
1390
+ // Assert helpers
1391
+ QUnit.assert = Assert.prototype = {
1392
+
1393
+ // Specify the number of expected assertions to guarantee that failed test
1394
+ // (no assertions are run at all) don't slip through.
1395
+ expect: function( asserts ) {
1396
+ if ( arguments.length === 1 ) {
1397
+ this.test.expected = asserts;
1398
+ } else {
1399
+ return this.test.expected;
1400
+ }
1401
+ },
1402
+
1403
+ // Increment this Test's semaphore counter, then return a function that
1404
+ // decrements that counter a maximum of once.
1405
+ async: function( count ) {
1406
+ var test = this.test,
1407
+ popped = false,
1408
+ acceptCallCount = count;
1409
+
1410
+ if ( typeof acceptCallCount === "undefined" ) {
1411
+ acceptCallCount = 1;
1412
+ }
1413
+
1414
+ test.semaphore += 1;
1415
+ test.usedAsync = true;
1416
+ pauseProcessing();
1417
+
1418
+ return function done() {
1419
+
1420
+ if ( popped ) {
1421
+ test.pushFailure( "Too many calls to the `assert.async` callback",
1422
+ sourceFromStacktrace( 2 ) );
1423
+ return;
1424
+ }
1425
+ acceptCallCount -= 1;
1426
+ if ( acceptCallCount > 0 ) {
1427
+ return;
1428
+ }
1429
+
1430
+ test.semaphore -= 1;
1431
+ popped = true;
1432
+ resumeProcessing();
1433
+ };
1434
+ },
1435
+
1436
+ // Exports test.push() to the user API
1437
+ // Alias of pushResult.
1438
+ push: function( result, actual, expected, message, negative ) {
1439
+ var currentAssert = this instanceof Assert ? this : QUnit.config.current.assert;
1440
+ return currentAssert.pushResult( {
1441
+ result: result,
1442
+ actual: actual,
1443
+ expected: expected,
1444
+ message: message,
1445
+ negative: negative
1446
+ } );
1447
+ },
1448
+
1449
+ pushResult: function( resultInfo ) {
1450
+
1451
+ // resultInfo = { result, actual, expected, message, negative }
1452
+ var assert = this,
1453
+ currentTest = ( assert instanceof Assert && assert.test ) || QUnit.config.current;
1454
+
1455
+ // Backwards compatibility fix.
1456
+ // Allows the direct use of global exported assertions and QUnit.assert.*
1457
+ // Although, it's use is not recommended as it can leak assertions
1458
+ // to other tests from async tests, because we only get a reference to the current test,
1459
+ // not exactly the test where assertion were intended to be called.
1460
+ if ( !currentTest ) {
1461
+ throw new Error( "assertion outside test context, in " + sourceFromStacktrace( 2 ) );
1462
+ }
1463
+
1464
+ if ( currentTest.usedAsync === true && currentTest.semaphore === 0 ) {
1465
+ currentTest.pushFailure( "Assertion after the final `assert.async` was resolved",
1466
+ sourceFromStacktrace( 2 ) );
1467
+
1468
+ // Allow this assertion to continue running anyway...
1469
+ }
1470
+
1471
+ if ( !( assert instanceof Assert ) ) {
1472
+ assert = currentTest.assert;
1473
+ }
1474
+
1475
+ return assert.test.pushResult( resultInfo );
1476
+ },
1477
+
1478
+ ok: function( result, message ) {
1479
+ message = message || ( result ? "okay" : "failed, expected argument to be truthy, was: " +
1480
+ QUnit.dump.parse( result ) );
1481
+ this.pushResult( {
1482
+ result: !!result,
1483
+ actual: result,
1484
+ expected: true,
1485
+ message: message
1486
+ } );
1487
+ },
1488
+
1489
+ notOk: function( result, message ) {
1490
+ message = message || ( !result ? "okay" : "failed, expected argument to be falsy, was: " +
1491
+ QUnit.dump.parse( result ) );
1492
+ this.pushResult( {
1493
+ result: !result,
1494
+ actual: result,
1495
+ expected: false,
1496
+ message: message
1497
+ } );
1498
+ },
1499
+
1500
+ equal: function( actual, expected, message ) {
1501
+ /*jshint eqeqeq:false */
1502
+ this.pushResult( {
1503
+ result: expected == actual,
1504
+ actual: actual,
1505
+ expected: expected,
1506
+ message: message
1507
+ } );
1508
+ },
1509
+
1510
+ notEqual: function( actual, expected, message ) {
1511
+ /*jshint eqeqeq:false */
1512
+ this.pushResult( {
1513
+ result: expected != actual,
1514
+ actual: actual,
1515
+ expected: expected,
1516
+ message: message,
1517
+ negative: true
1518
+ } );
1519
+ },
1520
+
1521
+ propEqual: function( actual, expected, message ) {
1522
+ actual = objectValues( actual );
1523
+ expected = objectValues( expected );
1524
+ this.pushResult( {
1525
+ result: QUnit.equiv( actual, expected ),
1526
+ actual: actual,
1527
+ expected: expected,
1528
+ message: message
1529
+ } );
1530
+ },
1531
+
1532
+ notPropEqual: function( actual, expected, message ) {
1533
+ actual = objectValues( actual );
1534
+ expected = objectValues( expected );
1535
+ this.pushResult( {
1536
+ result: !QUnit.equiv( actual, expected ),
1537
+ actual: actual,
1538
+ expected: expected,
1539
+ message: message,
1540
+ negative: true
1541
+ } );
1542
+ },
1543
+
1544
+ deepEqual: function( actual, expected, message ) {
1545
+ this.pushResult( {
1546
+ result: QUnit.equiv( actual, expected ),
1547
+ actual: actual,
1548
+ expected: expected,
1549
+ message: message
1550
+ } );
1551
+ },
1552
+
1553
+ notDeepEqual: function( actual, expected, message ) {
1554
+ this.pushResult( {
1555
+ result: !QUnit.equiv( actual, expected ),
1556
+ actual: actual,
1557
+ expected: expected,
1558
+ message: message,
1559
+ negative: true
1560
+ } );
1561
+ },
1562
+
1563
+ strictEqual: function( actual, expected, message ) {
1564
+ this.pushResult( {
1565
+ result: expected === actual,
1566
+ actual: actual,
1567
+ expected: expected,
1568
+ message: message
1569
+ } );
1570
+ },
1571
+
1572
+ notStrictEqual: function( actual, expected, message ) {
1573
+ this.pushResult( {
1574
+ result: expected !== actual,
1575
+ actual: actual,
1576
+ expected: expected,
1577
+ message: message,
1578
+ negative: true
1579
+ } );
1580
+ },
1581
+
1582
+ "throws": function( block, expected, message ) {
1583
+ var actual, expectedType,
1584
+ expectedOutput = expected,
1585
+ ok = false,
1586
+ currentTest = ( this instanceof Assert && this.test ) || QUnit.config.current;
1587
+
1588
+ // 'expected' is optional unless doing string comparison
1589
+ if ( message == null && typeof expected === "string" ) {
1590
+ message = expected;
1591
+ expected = null;
1592
+ }
1593
+
1594
+ currentTest.ignoreGlobalErrors = true;
1595
+ try {
1596
+ block.call( currentTest.testEnvironment );
1597
+ } catch (e) {
1598
+ actual = e;
1599
+ }
1600
+ currentTest.ignoreGlobalErrors = false;
1601
+
1602
+ if ( actual ) {
1603
+ expectedType = QUnit.objectType( expected );
1604
+
1605
+ // we don't want to validate thrown error
1606
+ if ( !expected ) {
1607
+ ok = true;
1608
+ expectedOutput = null;
1609
+
1610
+ // expected is a regexp
1611
+ } else if ( expectedType === "regexp" ) {
1612
+ ok = expected.test( errorString( actual ) );
1613
+
1614
+ // expected is a string
1615
+ } else if ( expectedType === "string" ) {
1616
+ ok = expected === errorString( actual );
1617
+
1618
+ // expected is a constructor, maybe an Error constructor
1619
+ } else if ( expectedType === "function" && actual instanceof expected ) {
1620
+ ok = true;
1621
+
1622
+ // expected is an Error object
1623
+ } else if ( expectedType === "object" ) {
1624
+ ok = actual instanceof expected.constructor &&
1625
+ actual.name === expected.name &&
1626
+ actual.message === expected.message;
1627
+
1628
+ // expected is a validation function which returns true if validation passed
1629
+ } else if ( expectedType === "function" && expected.call( {}, actual ) === true ) {
1630
+ expectedOutput = null;
1631
+ ok = true;
1632
+ }
1633
+ }
1634
+
1635
+ currentTest.assert.pushResult( {
1636
+ result: ok,
1637
+ actual: actual,
1638
+ expected: expectedOutput,
1639
+ message: message
1640
+ } );
1641
+ }
1642
+ };
1643
+
1644
+ // Provide an alternative to assert.throws(), for environments that consider throws a reserved word
1645
+ // Known to us are: Closure Compiler, Narwhal
1646
+ (function() {
1647
+ /*jshint sub:true */
1648
+ Assert.prototype.raises = Assert.prototype[ "throws" ];
1649
+ }());
1650
+
1651
+ function errorString( error ) {
1652
+ var name, message,
1653
+ resultErrorString = error.toString();
1654
+ if ( resultErrorString.substring( 0, 7 ) === "[object" ) {
1655
+ name = error.name ? error.name.toString() : "Error";
1656
+ message = error.message ? error.message.toString() : "";
1657
+ if ( name && message ) {
1658
+ return name + ": " + message;
1659
+ } else if ( name ) {
1660
+ return name;
1661
+ } else if ( message ) {
1662
+ return message;
1663
+ } else {
1664
+ return "Error";
1665
+ }
1666
+ } else {
1667
+ return resultErrorString;
1668
+ }
1669
+ }
1670
+
1671
+ // Test for equality any JavaScript type.
1672
+ // Author: Philippe Rathé <prathe@gmail.com>
1673
+ QUnit.equiv = (function() {
1674
+
1675
+ // Stack to decide between skip/abort functions
1676
+ var callers = [];
1677
+
1678
+ // Stack to avoiding loops from circular referencing
1679
+ var parents = [];
1680
+ var parentsB = [];
1681
+
1682
+ var getProto = Object.getPrototypeOf || function( obj ) {
1683
+
1684
+ /*jshint proto: true */
1685
+ return obj.__proto__;
1686
+ };
1687
+
1688
+ function useStrictEquality( b, a ) {
1689
+
1690
+ // To catch short annotation VS 'new' annotation of a declaration. e.g.:
1691
+ // `var i = 1;`
1692
+ // `var j = new Number(1);`
1693
+ if ( typeof a === "object" ) {
1694
+ a = a.valueOf();
1695
+ }
1696
+ if ( typeof b === "object" ) {
1697
+ b = b.valueOf();
1698
+ }
1699
+
1700
+ return a === b;
1701
+ }
1702
+
1703
+ function compareConstructors( a, b ) {
1704
+ var protoA = getProto( a );
1705
+ var protoB = getProto( b );
1706
+
1707
+ // Comparing constructors is more strict than using `instanceof`
1708
+ if ( a.constructor === b.constructor ) {
1709
+ return true;
1710
+ }
1711
+
1712
+ // Ref #851
1713
+ // If the obj prototype descends from a null constructor, treat it
1714
+ // as a null prototype.
1715
+ if ( protoA && protoA.constructor === null ) {
1716
+ protoA = null;
1717
+ }
1718
+ if ( protoB && protoB.constructor === null ) {
1719
+ protoB = null;
1720
+ }
1721
+
1722
+ // Allow objects with no prototype to be equivalent to
1723
+ // objects with Object as their constructor.
1724
+ if ( ( protoA === null && protoB === Object.prototype ) ||
1725
+ ( protoB === null && protoA === Object.prototype ) ) {
1726
+ return true;
1727
+ }
1728
+
1729
+ return false;
1730
+ }
1731
+
1732
+ function getRegExpFlags( regexp ) {
1733
+ return "flags" in regexp ? regexp.flags : regexp.toString().match( /[gimuy]*$/ )[ 0 ];
1734
+ }
1735
+
1736
+ var callbacks = {
1737
+ "string": useStrictEquality,
1738
+ "boolean": useStrictEquality,
1739
+ "number": useStrictEquality,
1740
+ "null": useStrictEquality,
1741
+ "undefined": useStrictEquality,
1742
+ "symbol": useStrictEquality,
1743
+ "date": useStrictEquality,
1744
+
1745
+ "nan": function() {
1746
+ return true;
1747
+ },
1748
+
1749
+ "regexp": function( b, a ) {
1750
+ return a.source === b.source &&
1751
+
1752
+ // Include flags in the comparison
1753
+ getRegExpFlags( a ) === getRegExpFlags( b );
1754
+ },
1755
+
1756
+ // - skip when the property is a method of an instance (OOP)
1757
+ // - abort otherwise,
1758
+ // initial === would have catch identical references anyway
1759
+ "function": function() {
1760
+ var caller = callers[ callers.length - 1 ];
1761
+ return caller !== Object && typeof caller !== "undefined";
1762
+ },
1763
+
1764
+ "array": function( b, a ) {
1765
+ var i, j, len, loop, aCircular, bCircular;
1766
+
1767
+ len = a.length;
1768
+ if ( len !== b.length ) {
1769
+ // safe and faster
1770
+ return false;
1771
+ }
1772
+
1773
+ // Track reference to avoid circular references
1774
+ parents.push( a );
1775
+ parentsB.push( b );
1776
+ for ( i = 0; i < len; i++ ) {
1777
+ loop = false;
1778
+ for ( j = 0; j < parents.length; j++ ) {
1779
+ aCircular = parents[ j ] === a[ i ];
1780
+ bCircular = parentsB[ j ] === b[ i ];
1781
+ if ( aCircular || bCircular ) {
1782
+ if ( a[ i ] === b[ i ] || aCircular && bCircular ) {
1783
+ loop = true;
1784
+ } else {
1785
+ parents.pop();
1786
+ parentsB.pop();
1787
+ return false;
1788
+ }
1789
+ }
1790
+ }
1791
+ if ( !loop && !innerEquiv( a[ i ], b[ i ] ) ) {
1792
+ parents.pop();
1793
+ parentsB.pop();
1794
+ return false;
1795
+ }
1796
+ }
1797
+ parents.pop();
1798
+ parentsB.pop();
1799
+ return true;
1800
+ },
1801
+
1802
+ "set": function( b, a ) {
1803
+ var aArray, bArray;
1804
+
1805
+ aArray = [];
1806
+ a.forEach( function( v ) {
1807
+ aArray.push( v );
1808
+ });
1809
+ bArray = [];
1810
+ b.forEach( function( v ) {
1811
+ bArray.push( v );
1812
+ });
1813
+
1814
+ return innerEquiv( bArray, aArray );
1815
+ },
1816
+
1817
+ "map": function( b, a ) {
1818
+ var aArray, bArray;
1819
+
1820
+ aArray = [];
1821
+ a.forEach( function( v, k ) {
1822
+ aArray.push( [ k, v ] );
1823
+ });
1824
+ bArray = [];
1825
+ b.forEach( function( v, k ) {
1826
+ bArray.push( [ k, v ] );
1827
+ });
1828
+
1829
+ return innerEquiv( bArray, aArray );
1830
+ },
1831
+
1832
+ "object": function( b, a ) {
1833
+ var i, j, loop, aCircular, bCircular;
1834
+
1835
+ // Default to true
1836
+ var eq = true;
1837
+ var aProperties = [];
1838
+ var bProperties = [];
1839
+
1840
+ if ( compareConstructors( a, b ) === false ) {
1841
+ return false;
1842
+ }
1843
+
1844
+ // Stack constructor before traversing properties
1845
+ callers.push( a.constructor );
1846
+
1847
+ // Track reference to avoid circular references
1848
+ parents.push( a );
1849
+ parentsB.push( b );
1850
+
1851
+ // Be strict: don't ensure hasOwnProperty and go deep
1852
+ for ( i in a ) {
1853
+ loop = false;
1854
+ for ( j = 0; j < parents.length; j++ ) {
1855
+ aCircular = parents[ j ] === a[ i ];
1856
+ bCircular = parentsB[ j ] === b[ i ];
1857
+ if ( aCircular || bCircular ) {
1858
+ if ( a[ i ] === b[ i ] || aCircular && bCircular ) {
1859
+ loop = true;
1860
+ } else {
1861
+ eq = false;
1862
+ break;
1863
+ }
1864
+ }
1865
+ }
1866
+ aProperties.push( i );
1867
+ if ( !loop && !innerEquiv( a[ i ], b[ i ] ) ) {
1868
+ eq = false;
1869
+ break;
1870
+ }
1871
+ }
1872
+
1873
+ parents.pop();
1874
+ parentsB.pop();
1875
+
1876
+ // Unstack, we are done
1877
+ callers.pop();
1878
+
1879
+ for ( i in b ) {
1880
+
1881
+ // Collect b's properties
1882
+ bProperties.push( i );
1883
+ }
1884
+
1885
+ // Ensures identical properties name
1886
+ return eq && innerEquiv( aProperties.sort(), bProperties.sort() );
1887
+ }
1888
+ };
1889
+
1890
+ function typeEquiv( a, b ) {
1891
+ var type = QUnit.objectType( a );
1892
+ return QUnit.objectType( b ) === type && callbacks[ type ]( b, a );
1893
+ }
1894
+
1895
+ // The real equiv function
1896
+ function innerEquiv( a, b ) {
1897
+
1898
+ // We're done when there's nothing more to compare
1899
+ if ( arguments.length < 2 ) {
1900
+ return true;
1901
+ }
1902
+
1903
+ // Require type-specific equality
1904
+ return ( a === b || typeEquiv( a, b ) ) &&
1905
+
1906
+ // ...across all consecutive argument pairs
1907
+ ( arguments.length === 2 || innerEquiv.apply( this, [].slice.call( arguments, 1 ) ) );
1908
+ }
1909
+
1910
+ return innerEquiv;
1911
+ }());
1912
+
1913
+ // Based on jsDump by Ariel Flesler
1914
+ // http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html
1915
+ QUnit.dump = (function() {
1916
+ function quote( str ) {
1917
+ return "\"" + str.toString().replace( /\\/g, "\\\\" ).replace( /"/g, "\\\"" ) + "\"";
1918
+ }
1919
+ function literal( o ) {
1920
+ return o + "";
1921
+ }
1922
+ function join( pre, arr, post ) {
1923
+ var s = dump.separator(),
1924
+ base = dump.indent(),
1925
+ inner = dump.indent( 1 );
1926
+ if ( arr.join ) {
1927
+ arr = arr.join( "," + s + inner );
1928
+ }
1929
+ if ( !arr ) {
1930
+ return pre + post;
1931
+ }
1932
+ return [ pre, inner + arr, base + post ].join( s );
1933
+ }
1934
+ function array( arr, stack ) {
1935
+ var i = arr.length,
1936
+ ret = new Array( i );
1937
+
1938
+ if ( dump.maxDepth && dump.depth > dump.maxDepth ) {
1939
+ return "[object Array]";
1940
+ }
1941
+
1942
+ this.up();
1943
+ while ( i-- ) {
1944
+ ret[ i ] = this.parse( arr[ i ], undefined, stack );
1945
+ }
1946
+ this.down();
1947
+ return join( "[", ret, "]" );
1948
+ }
1949
+
1950
+ var reName = /^function (\w+)/,
1951
+ dump = {
1952
+
1953
+ // objType is used mostly internally, you can fix a (custom) type in advance
1954
+ parse: function( obj, objType, stack ) {
1955
+ stack = stack || [];
1956
+ var res, parser, parserType,
1957
+ inStack = inArray( obj, stack );
1958
+
1959
+ if ( inStack !== -1 ) {
1960
+ return "recursion(" + ( inStack - stack.length ) + ")";
1961
+ }
1962
+
1963
+ objType = objType || this.typeOf( obj );
1964
+ parser = this.parsers[ objType ];
1965
+ parserType = typeof parser;
1966
+
1967
+ if ( parserType === "function" ) {
1968
+ stack.push( obj );
1969
+ res = parser.call( this, obj, stack );
1970
+ stack.pop();
1971
+ return res;
1972
+ }
1973
+ return ( parserType === "string" ) ? parser : this.parsers.error;
1974
+ },
1975
+ typeOf: function( obj ) {
1976
+ var type;
1977
+ if ( obj === null ) {
1978
+ type = "null";
1979
+ } else if ( typeof obj === "undefined" ) {
1980
+ type = "undefined";
1981
+ } else if ( QUnit.is( "regexp", obj ) ) {
1982
+ type = "regexp";
1983
+ } else if ( QUnit.is( "date", obj ) ) {
1984
+ type = "date";
1985
+ } else if ( QUnit.is( "function", obj ) ) {
1986
+ type = "function";
1987
+ } else if ( obj.setInterval !== undefined &&
1988
+ obj.document !== undefined &&
1989
+ obj.nodeType === undefined ) {
1990
+ type = "window";
1991
+ } else if ( obj.nodeType === 9 ) {
1992
+ type = "document";
1993
+ } else if ( obj.nodeType ) {
1994
+ type = "node";
1995
+ } else if (
1996
+
1997
+ // native arrays
1998
+ toString.call( obj ) === "[object Array]" ||
1999
+
2000
+ // NodeList objects
2001
+ ( typeof obj.length === "number" && obj.item !== undefined &&
2002
+ ( obj.length ? obj.item( 0 ) === obj[ 0 ] : ( obj.item( 0 ) === null &&
2003
+ obj[ 0 ] === undefined ) ) )
2004
+ ) {
2005
+ type = "array";
2006
+ } else if ( obj.constructor === Error.prototype.constructor ) {
2007
+ type = "error";
2008
+ } else {
2009
+ type = typeof obj;
2010
+ }
2011
+ return type;
2012
+ },
2013
+ separator: function() {
2014
+ return this.multiline ? this.HTML ? "<br />" : "\n" : this.HTML ? "&#160;" : " ";
2015
+ },
2016
+ // extra can be a number, shortcut for increasing-calling-decreasing
2017
+ indent: function( extra ) {
2018
+ if ( !this.multiline ) {
2019
+ return "";
2020
+ }
2021
+ var chr = this.indentChar;
2022
+ if ( this.HTML ) {
2023
+ chr = chr.replace( /\t/g, " " ).replace( / /g, "&#160;" );
2024
+ }
2025
+ return new Array( this.depth + ( extra || 0 ) ).join( chr );
2026
+ },
2027
+ up: function( a ) {
2028
+ this.depth += a || 1;
2029
+ },
2030
+ down: function( a ) {
2031
+ this.depth -= a || 1;
2032
+ },
2033
+ setParser: function( name, parser ) {
2034
+ this.parsers[ name ] = parser;
2035
+ },
2036
+ // The next 3 are exposed so you can use them
2037
+ quote: quote,
2038
+ literal: literal,
2039
+ join: join,
2040
+ //
2041
+ depth: 1,
2042
+ maxDepth: QUnit.config.maxDepth,
2043
+
2044
+ // This is the list of parsers, to modify them, use dump.setParser
2045
+ parsers: {
2046
+ window: "[Window]",
2047
+ document: "[Document]",
2048
+ error: function( error ) {
2049
+ return "Error(\"" + error.message + "\")";
2050
+ },
2051
+ unknown: "[Unknown]",
2052
+ "null": "null",
2053
+ "undefined": "undefined",
2054
+ "function": function( fn ) {
2055
+ var ret = "function",
2056
+
2057
+ // functions never have name in IE
2058
+ name = "name" in fn ? fn.name : ( reName.exec( fn ) || [] )[ 1 ];
2059
+
2060
+ if ( name ) {
2061
+ ret += " " + name;
2062
+ }
2063
+ ret += "( ";
2064
+
2065
+ ret = [ ret, dump.parse( fn, "functionArgs" ), "){" ].join( "" );
2066
+ return join( ret, dump.parse( fn, "functionCode" ), "}" );
2067
+ },
2068
+ array: array,
2069
+ nodelist: array,
2070
+ "arguments": array,
2071
+ object: function( map, stack ) {
2072
+ var keys, key, val, i, nonEnumerableProperties,
2073
+ ret = [];
2074
+
2075
+ if ( dump.maxDepth && dump.depth > dump.maxDepth ) {
2076
+ return "[object Object]";
2077
+ }
2078
+
2079
+ dump.up();
2080
+ keys = [];
2081
+ for ( key in map ) {
2082
+ keys.push( key );
2083
+ }
2084
+
2085
+ // Some properties are not always enumerable on Error objects.
2086
+ nonEnumerableProperties = [ "message", "name" ];
2087
+ for ( i in nonEnumerableProperties ) {
2088
+ key = nonEnumerableProperties[ i ];
2089
+ if ( key in map && inArray( key, keys ) < 0 ) {
2090
+ keys.push( key );
2091
+ }
2092
+ }
2093
+ keys.sort();
2094
+ for ( i = 0; i < keys.length; i++ ) {
2095
+ key = keys[ i ];
2096
+ val = map[ key ];
2097
+ ret.push( dump.parse( key, "key" ) + ": " +
2098
+ dump.parse( val, undefined, stack ) );
2099
+ }
2100
+ dump.down();
2101
+ return join( "{", ret, "}" );
2102
+ },
2103
+ node: function( node ) {
2104
+ var len, i, val,
2105
+ open = dump.HTML ? "&lt;" : "<",
2106
+ close = dump.HTML ? "&gt;" : ">",
2107
+ tag = node.nodeName.toLowerCase(),
2108
+ ret = open + tag,
2109
+ attrs = node.attributes;
2110
+
2111
+ if ( attrs ) {
2112
+ for ( i = 0, len = attrs.length; i < len; i++ ) {
2113
+ val = attrs[ i ].nodeValue;
2114
+
2115
+ // IE6 includes all attributes in .attributes, even ones not explicitly
2116
+ // set. Those have values like undefined, null, 0, false, "" or
2117
+ // "inherit".
2118
+ if ( val && val !== "inherit" ) {
2119
+ ret += " " + attrs[ i ].nodeName + "=" +
2120
+ dump.parse( val, "attribute" );
2121
+ }
2122
+ }
2123
+ }
2124
+ ret += close;
2125
+
2126
+ // Show content of TextNode or CDATASection
2127
+ if ( node.nodeType === 3 || node.nodeType === 4 ) {
2128
+ ret += node.nodeValue;
2129
+ }
2130
+
2131
+ return ret + open + "/" + tag + close;
2132
+ },
2133
+
2134
+ // function calls it internally, it's the arguments part of the function
2135
+ functionArgs: function( fn ) {
2136
+ var args,
2137
+ l = fn.length;
2138
+
2139
+ if ( !l ) {
2140
+ return "";
2141
+ }
2142
+
2143
+ args = new Array( l );
2144
+ while ( l-- ) {
2145
+
2146
+ // 97 is 'a'
2147
+ args[ l ] = String.fromCharCode( 97 + l );
2148
+ }
2149
+ return " " + args.join( ", " ) + " ";
2150
+ },
2151
+ // object calls it internally, the key part of an item in a map
2152
+ key: quote,
2153
+ // function calls it internally, it's the content of the function
2154
+ functionCode: "[code]",
2155
+ // node calls it internally, it's a html attribute value
2156
+ attribute: quote,
2157
+ string: quote,
2158
+ date: quote,
2159
+ regexp: literal,
2160
+ number: literal,
2161
+ "boolean": literal
2162
+ },
2163
+ // if true, entities are escaped ( <, >, \t, space and \n )
2164
+ HTML: false,
2165
+ // indentation unit
2166
+ indentChar: " ",
2167
+ // if true, items in a collection, are separated by a \n, else just a space.
2168
+ multiline: true
2169
+ };
2170
+
2171
+ return dump;
2172
+ }());
2173
+
2174
+ // back compat
2175
+ QUnit.jsDump = QUnit.dump;
2176
+
2177
+ // Deprecated
2178
+ // Extend assert methods to QUnit for Backwards compatibility
2179
+ (function() {
2180
+ var i,
2181
+ assertions = Assert.prototype;
2182
+
2183
+ function applyCurrent( current ) {
2184
+ return function() {
2185
+ var assert = new Assert( QUnit.config.current );
2186
+ current.apply( assert, arguments );
2187
+ };
2188
+ }
2189
+
2190
+ for ( i in assertions ) {
2191
+ QUnit[ i ] = applyCurrent( assertions[ i ] );
2192
+ }
2193
+ })();
2194
+
2195
+ // For browser, export only select globals
2196
+ if ( defined.document ) {
2197
+
2198
+ (function() {
2199
+ var i, l,
2200
+ keys = [
2201
+ "test",
2202
+ "module",
2203
+ "expect",
2204
+ "asyncTest",
2205
+ "start",
2206
+ "stop",
2207
+ "ok",
2208
+ "notOk",
2209
+ "equal",
2210
+ "notEqual",
2211
+ "propEqual",
2212
+ "notPropEqual",
2213
+ "deepEqual",
2214
+ "notDeepEqual",
2215
+ "strictEqual",
2216
+ "notStrictEqual",
2217
+ "throws",
2218
+ "raises"
2219
+ ];
2220
+
2221
+ for ( i = 0, l = keys.length; i < l; i++ ) {
2222
+ window[ keys[ i ] ] = QUnit[ keys[ i ] ];
2223
+ }
2224
+ })();
2225
+
2226
+ window.QUnit = QUnit;
2227
+ }
2228
+
2229
+ // For nodejs
2230
+ if ( typeof module !== "undefined" && module && module.exports ) {
2231
+ module.exports = QUnit;
2232
+
2233
+ // For consistency with CommonJS environments' exports
2234
+ module.exports.QUnit = QUnit;
2235
+ }
2236
+
2237
+ // For CommonJS with exports, but without module.exports, like Rhino
2238
+ if ( typeof exports !== "undefined" && exports ) {
2239
+ exports.QUnit = QUnit;
2240
+ }
2241
+
2242
+ if ( typeof define === "function" && define.amd ) {
2243
+ define( function() {
2244
+ return QUnit;
2245
+ } );
2246
+ QUnit.config.autostart = false;
2247
+ }
2248
+
2249
+ /*
2250
+ * This file is a modified version of google-diff-match-patch's JavaScript implementation
2251
+ * (https://code.google.com/p/google-diff-match-patch/source/browse/trunk/javascript/diff_match_patch_uncompressed.js),
2252
+ * modifications are licensed as more fully set forth in LICENSE.txt.
2253
+ *
2254
+ * The original source of google-diff-match-patch is attributable and licensed as follows:
2255
+ *
2256
+ * Copyright 2006 Google Inc.
2257
+ * https://code.google.com/p/google-diff-match-patch/
2258
+ *
2259
+ * Licensed under the Apache License, Version 2.0 (the "License");
2260
+ * you may not use this file except in compliance with the License.
2261
+ * You may obtain a copy of the License at
2262
+ *
2263
+ * https://www.apache.org/licenses/LICENSE-2.0
2264
+ *
2265
+ * Unless required by applicable law or agreed to in writing, software
2266
+ * distributed under the License is distributed on an "AS IS" BASIS,
2267
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2268
+ * See the License for the specific language governing permissions and
2269
+ * limitations under the License.
2270
+ *
2271
+ * More Info:
2272
+ * https://code.google.com/p/google-diff-match-patch/
2273
+ *
2274
+ * Usage: QUnit.diff(expected, actual)
2275
+ *
2276
+ */
2277
+ QUnit.diff = ( function() {
2278
+ function DiffMatchPatch() {
2279
+ }
2280
+
2281
+ // DIFF FUNCTIONS
2282
+
2283
+ /**
2284
+ * The data structure representing a diff is an array of tuples:
2285
+ * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]
2286
+ * which means: delete 'Hello', add 'Goodbye' and keep ' world.'
2287
+ */
2288
+ var DIFF_DELETE = -1,
2289
+ DIFF_INSERT = 1,
2290
+ DIFF_EQUAL = 0;
2291
+
2292
+ /**
2293
+ * Find the differences between two texts. Simplifies the problem by stripping
2294
+ * any common prefix or suffix off the texts before diffing.
2295
+ * @param {string} text1 Old string to be diffed.
2296
+ * @param {string} text2 New string to be diffed.
2297
+ * @param {boolean=} optChecklines Optional speedup flag. If present and false,
2298
+ * then don't run a line-level diff first to identify the changed areas.
2299
+ * Defaults to true, which does a faster, slightly less optimal diff.
2300
+ * @return {!Array.<!DiffMatchPatch.Diff>} Array of diff tuples.
2301
+ */
2302
+ DiffMatchPatch.prototype.DiffMain = function( text1, text2, optChecklines ) {
2303
+ var deadline, checklines, commonlength,
2304
+ commonprefix, commonsuffix, diffs;
2305
+
2306
+ // The diff must be complete in up to 1 second.
2307
+ deadline = ( new Date() ).getTime() + 1000;
2308
+
2309
+ // Check for null inputs.
2310
+ if ( text1 === null || text2 === null ) {
2311
+ throw new Error( "Null input. (DiffMain)" );
2312
+ }
2313
+
2314
+ // Check for equality (speedup).
2315
+ if ( text1 === text2 ) {
2316
+ if ( text1 ) {
2317
+ return [
2318
+ [ DIFF_EQUAL, text1 ]
2319
+ ];
2320
+ }
2321
+ return [];
2322
+ }
2323
+
2324
+ if ( typeof optChecklines === "undefined" ) {
2325
+ optChecklines = true;
2326
+ }
2327
+
2328
+ checklines = optChecklines;
2329
+
2330
+ // Trim off common prefix (speedup).
2331
+ commonlength = this.diffCommonPrefix( text1, text2 );
2332
+ commonprefix = text1.substring( 0, commonlength );
2333
+ text1 = text1.substring( commonlength );
2334
+ text2 = text2.substring( commonlength );
2335
+
2336
+ // Trim off common suffix (speedup).
2337
+ commonlength = this.diffCommonSuffix( text1, text2 );
2338
+ commonsuffix = text1.substring( text1.length - commonlength );
2339
+ text1 = text1.substring( 0, text1.length - commonlength );
2340
+ text2 = text2.substring( 0, text2.length - commonlength );
2341
+
2342
+ // Compute the diff on the middle block.
2343
+ diffs = this.diffCompute( text1, text2, checklines, deadline );
2344
+
2345
+ // Restore the prefix and suffix.
2346
+ if ( commonprefix ) {
2347
+ diffs.unshift( [ DIFF_EQUAL, commonprefix ] );
2348
+ }
2349
+ if ( commonsuffix ) {
2350
+ diffs.push( [ DIFF_EQUAL, commonsuffix ] );
2351
+ }
2352
+ this.diffCleanupMerge( diffs );
2353
+ return diffs;
2354
+ };
2355
+
2356
+ /**
2357
+ * Reduce the number of edits by eliminating operationally trivial equalities.
2358
+ * @param {!Array.<!DiffMatchPatch.Diff>} diffs Array of diff tuples.
2359
+ */
2360
+ DiffMatchPatch.prototype.diffCleanupEfficiency = function( diffs ) {
2361
+ var changes, equalities, equalitiesLength, lastequality,
2362
+ pointer, preIns, preDel, postIns, postDel;
2363
+ changes = false;
2364
+ equalities = []; // Stack of indices where equalities are found.
2365
+ equalitiesLength = 0; // Keeping our own length var is faster in JS.
2366
+ /** @type {?string} */
2367
+ lastequality = null;
2368
+ // Always equal to diffs[equalities[equalitiesLength - 1]][1]
2369
+ pointer = 0; // Index of current position.
2370
+ // Is there an insertion operation before the last equality.
2371
+ preIns = false;
2372
+ // Is there a deletion operation before the last equality.
2373
+ preDel = false;
2374
+ // Is there an insertion operation after the last equality.
2375
+ postIns = false;
2376
+ // Is there a deletion operation after the last equality.
2377
+ postDel = false;
2378
+ while ( pointer < diffs.length ) {
2379
+
2380
+ // Equality found.
2381
+ if ( diffs[ pointer ][ 0 ] === DIFF_EQUAL ) {
2382
+ if ( diffs[ pointer ][ 1 ].length < 4 && ( postIns || postDel ) ) {
2383
+
2384
+ // Candidate found.
2385
+ equalities[ equalitiesLength++ ] = pointer;
2386
+ preIns = postIns;
2387
+ preDel = postDel;
2388
+ lastequality = diffs[ pointer ][ 1 ];
2389
+ } else {
2390
+
2391
+ // Not a candidate, and can never become one.
2392
+ equalitiesLength = 0;
2393
+ lastequality = null;
2394
+ }
2395
+ postIns = postDel = false;
2396
+
2397
+ // An insertion or deletion.
2398
+ } else {
2399
+
2400
+ if ( diffs[ pointer ][ 0 ] === DIFF_DELETE ) {
2401
+ postDel = true;
2402
+ } else {
2403
+ postIns = true;
2404
+ }
2405
+
2406
+ /*
2407
+ * Five types to be split:
2408
+ * <ins>A</ins><del>B</del>XY<ins>C</ins><del>D</del>
2409
+ * <ins>A</ins>X<ins>C</ins><del>D</del>
2410
+ * <ins>A</ins><del>B</del>X<ins>C</ins>
2411
+ * <ins>A</del>X<ins>C</ins><del>D</del>
2412
+ * <ins>A</ins><del>B</del>X<del>C</del>
2413
+ */
2414
+ if ( lastequality && ( ( preIns && preDel && postIns && postDel ) ||
2415
+ ( ( lastequality.length < 2 ) &&
2416
+ ( preIns + preDel + postIns + postDel ) === 3 ) ) ) {
2417
+
2418
+ // Duplicate record.
2419
+ diffs.splice(
2420
+ equalities[ equalitiesLength - 1 ],
2421
+ 0,
2422
+ [ DIFF_DELETE, lastequality ]
2423
+ );
2424
+
2425
+ // Change second copy to insert.
2426
+ diffs[ equalities[ equalitiesLength - 1 ] + 1 ][ 0 ] = DIFF_INSERT;
2427
+ equalitiesLength--; // Throw away the equality we just deleted;
2428
+ lastequality = null;
2429
+ if ( preIns && preDel ) {
2430
+ // No changes made which could affect previous entry, keep going.
2431
+ postIns = postDel = true;
2432
+ equalitiesLength = 0;
2433
+ } else {
2434
+ equalitiesLength--; // Throw away the previous equality.
2435
+ pointer = equalitiesLength > 0 ? equalities[ equalitiesLength - 1 ] : -1;
2436
+ postIns = postDel = false;
2437
+ }
2438
+ changes = true;
2439
+ }
2440
+ }
2441
+ pointer++;
2442
+ }
2443
+
2444
+ if ( changes ) {
2445
+ this.diffCleanupMerge( diffs );
2446
+ }
2447
+ };
2448
+
2449
+ /**
2450
+ * Convert a diff array into a pretty HTML report.
2451
+ * @param {!Array.<!DiffMatchPatch.Diff>} diffs Array of diff tuples.
2452
+ * @param {integer} string to be beautified.
2453
+ * @return {string} HTML representation.
2454
+ */
2455
+ DiffMatchPatch.prototype.diffPrettyHtml = function( diffs ) {
2456
+ var op, data, x,
2457
+ html = [];
2458
+ for ( x = 0; x < diffs.length; x++ ) {
2459
+ op = diffs[ x ][ 0 ]; // Operation (insert, delete, equal)
2460
+ data = diffs[ x ][ 1 ]; // Text of change.
2461
+ switch ( op ) {
2462
+ case DIFF_INSERT:
2463
+ html[ x ] = "<ins>" + data + "</ins>";
2464
+ break;
2465
+ case DIFF_DELETE:
2466
+ html[ x ] = "<del>" + data + "</del>";
2467
+ break;
2468
+ case DIFF_EQUAL:
2469
+ html[ x ] = "<span>" + data + "</span>";
2470
+ break;
2471
+ }
2472
+ }
2473
+ return html.join( "" );
2474
+ };
2475
+
2476
+ /**
2477
+ * Determine the common prefix of two strings.
2478
+ * @param {string} text1 First string.
2479
+ * @param {string} text2 Second string.
2480
+ * @return {number} The number of characters common to the start of each
2481
+ * string.
2482
+ */
2483
+ DiffMatchPatch.prototype.diffCommonPrefix = function( text1, text2 ) {
2484
+ var pointermid, pointermax, pointermin, pointerstart;
2485
+ // Quick check for common null cases.
2486
+ if ( !text1 || !text2 || text1.charAt( 0 ) !== text2.charAt( 0 ) ) {
2487
+ return 0;
2488
+ }
2489
+ // Binary search.
2490
+ // Performance analysis: https://neil.fraser.name/news/2007/10/09/
2491
+ pointermin = 0;
2492
+ pointermax = Math.min( text1.length, text2.length );
2493
+ pointermid = pointermax;
2494
+ pointerstart = 0;
2495
+ while ( pointermin < pointermid ) {
2496
+ if ( text1.substring( pointerstart, pointermid ) ===
2497
+ text2.substring( pointerstart, pointermid ) ) {
2498
+ pointermin = pointermid;
2499
+ pointerstart = pointermin;
2500
+ } else {
2501
+ pointermax = pointermid;
2502
+ }
2503
+ pointermid = Math.floor( ( pointermax - pointermin ) / 2 + pointermin );
2504
+ }
2505
+ return pointermid;
2506
+ };
2507
+
2508
+ /**
2509
+ * Determine the common suffix of two strings.
2510
+ * @param {string} text1 First string.
2511
+ * @param {string} text2 Second string.
2512
+ * @return {number} The number of characters common to the end of each string.
2513
+ */
2514
+ DiffMatchPatch.prototype.diffCommonSuffix = function( text1, text2 ) {
2515
+ var pointermid, pointermax, pointermin, pointerend;
2516
+ // Quick check for common null cases.
2517
+ if ( !text1 ||
2518
+ !text2 ||
2519
+ text1.charAt( text1.length - 1 ) !== text2.charAt( text2.length - 1 ) ) {
2520
+ return 0;
2521
+ }
2522
+ // Binary search.
2523
+ // Performance analysis: https://neil.fraser.name/news/2007/10/09/
2524
+ pointermin = 0;
2525
+ pointermax = Math.min( text1.length, text2.length );
2526
+ pointermid = pointermax;
2527
+ pointerend = 0;
2528
+ while ( pointermin < pointermid ) {
2529
+ if ( text1.substring( text1.length - pointermid, text1.length - pointerend ) ===
2530
+ text2.substring( text2.length - pointermid, text2.length - pointerend ) ) {
2531
+ pointermin = pointermid;
2532
+ pointerend = pointermin;
2533
+ } else {
2534
+ pointermax = pointermid;
2535
+ }
2536
+ pointermid = Math.floor( ( pointermax - pointermin ) / 2 + pointermin );
2537
+ }
2538
+ return pointermid;
2539
+ };
2540
+
2541
+ /**
2542
+ * Find the differences between two texts. Assumes that the texts do not
2543
+ * have any common prefix or suffix.
2544
+ * @param {string} text1 Old string to be diffed.
2545
+ * @param {string} text2 New string to be diffed.
2546
+ * @param {boolean} checklines Speedup flag. If false, then don't run a
2547
+ * line-level diff first to identify the changed areas.
2548
+ * If true, then run a faster, slightly less optimal diff.
2549
+ * @param {number} deadline Time when the diff should be complete by.
2550
+ * @return {!Array.<!DiffMatchPatch.Diff>} Array of diff tuples.
2551
+ * @private
2552
+ */
2553
+ DiffMatchPatch.prototype.diffCompute = function( text1, text2, checklines, deadline ) {
2554
+ var diffs, longtext, shorttext, i, hm,
2555
+ text1A, text2A, text1B, text2B,
2556
+ midCommon, diffsA, diffsB;
2557
+
2558
+ if ( !text1 ) {
2559
+ // Just add some text (speedup).
2560
+ return [
2561
+ [ DIFF_INSERT, text2 ]
2562
+ ];
2563
+ }
2564
+
2565
+ if ( !text2 ) {
2566
+ // Just delete some text (speedup).
2567
+ return [
2568
+ [ DIFF_DELETE, text1 ]
2569
+ ];
2570
+ }
2571
+
2572
+ longtext = text1.length > text2.length ? text1 : text2;
2573
+ shorttext = text1.length > text2.length ? text2 : text1;
2574
+ i = longtext.indexOf( shorttext );
2575
+ if ( i !== -1 ) {
2576
+ // Shorter text is inside the longer text (speedup).
2577
+ diffs = [
2578
+ [ DIFF_INSERT, longtext.substring( 0, i ) ],
2579
+ [ DIFF_EQUAL, shorttext ],
2580
+ [ DIFF_INSERT, longtext.substring( i + shorttext.length ) ]
2581
+ ];
2582
+ // Swap insertions for deletions if diff is reversed.
2583
+ if ( text1.length > text2.length ) {
2584
+ diffs[ 0 ][ 0 ] = diffs[ 2 ][ 0 ] = DIFF_DELETE;
2585
+ }
2586
+ return diffs;
2587
+ }
2588
+
2589
+ if ( shorttext.length === 1 ) {
2590
+ // Single character string.
2591
+ // After the previous speedup, the character can't be an equality.
2592
+ return [
2593
+ [ DIFF_DELETE, text1 ],
2594
+ [ DIFF_INSERT, text2 ]
2595
+ ];
2596
+ }
2597
+
2598
+ // Check to see if the problem can be split in two.
2599
+ hm = this.diffHalfMatch( text1, text2 );
2600
+ if ( hm ) {
2601
+ // A half-match was found, sort out the return data.
2602
+ text1A = hm[ 0 ];
2603
+ text1B = hm[ 1 ];
2604
+ text2A = hm[ 2 ];
2605
+ text2B = hm[ 3 ];
2606
+ midCommon = hm[ 4 ];
2607
+ // Send both pairs off for separate processing.
2608
+ diffsA = this.DiffMain( text1A, text2A, checklines, deadline );
2609
+ diffsB = this.DiffMain( text1B, text2B, checklines, deadline );
2610
+ // Merge the results.
2611
+ return diffsA.concat( [
2612
+ [ DIFF_EQUAL, midCommon ]
2613
+ ], diffsB );
2614
+ }
2615
+
2616
+ if ( checklines && text1.length > 100 && text2.length > 100 ) {
2617
+ return this.diffLineMode( text1, text2, deadline );
2618
+ }
2619
+
2620
+ return this.diffBisect( text1, text2, deadline );
2621
+ };
2622
+
2623
+ /**
2624
+ * Do the two texts share a substring which is at least half the length of the
2625
+ * longer text?
2626
+ * This speedup can produce non-minimal diffs.
2627
+ * @param {string} text1 First string.
2628
+ * @param {string} text2 Second string.
2629
+ * @return {Array.<string>} Five element Array, containing the prefix of
2630
+ * text1, the suffix of text1, the prefix of text2, the suffix of
2631
+ * text2 and the common middle. Or null if there was no match.
2632
+ * @private
2633
+ */
2634
+ DiffMatchPatch.prototype.diffHalfMatch = function( text1, text2 ) {
2635
+ var longtext, shorttext, dmp,
2636
+ text1A, text2B, text2A, text1B, midCommon,
2637
+ hm1, hm2, hm;
2638
+
2639
+ longtext = text1.length > text2.length ? text1 : text2;
2640
+ shorttext = text1.length > text2.length ? text2 : text1;
2641
+ if ( longtext.length < 4 || shorttext.length * 2 < longtext.length ) {
2642
+ return null; // Pointless.
2643
+ }
2644
+ dmp = this; // 'this' becomes 'window' in a closure.
2645
+
2646
+ /**
2647
+ * Does a substring of shorttext exist within longtext such that the substring
2648
+ * is at least half the length of longtext?
2649
+ * Closure, but does not reference any external variables.
2650
+ * @param {string} longtext Longer string.
2651
+ * @param {string} shorttext Shorter string.
2652
+ * @param {number} i Start index of quarter length substring within longtext.
2653
+ * @return {Array.<string>} Five element Array, containing the prefix of
2654
+ * longtext, the suffix of longtext, the prefix of shorttext, the suffix
2655
+ * of shorttext and the common middle. Or null if there was no match.
2656
+ * @private
2657
+ */
2658
+ function diffHalfMatchI( longtext, shorttext, i ) {
2659
+ var seed, j, bestCommon, prefixLength, suffixLength,
2660
+ bestLongtextA, bestLongtextB, bestShorttextA, bestShorttextB;
2661
+ // Start with a 1/4 length substring at position i as a seed.
2662
+ seed = longtext.substring( i, i + Math.floor( longtext.length / 4 ) );
2663
+ j = -1;
2664
+ bestCommon = "";
2665
+ while ( ( j = shorttext.indexOf( seed, j + 1 ) ) !== -1 ) {
2666
+ prefixLength = dmp.diffCommonPrefix( longtext.substring( i ),
2667
+ shorttext.substring( j ) );
2668
+ suffixLength = dmp.diffCommonSuffix( longtext.substring( 0, i ),
2669
+ shorttext.substring( 0, j ) );
2670
+ if ( bestCommon.length < suffixLength + prefixLength ) {
2671
+ bestCommon = shorttext.substring( j - suffixLength, j ) +
2672
+ shorttext.substring( j, j + prefixLength );
2673
+ bestLongtextA = longtext.substring( 0, i - suffixLength );
2674
+ bestLongtextB = longtext.substring( i + prefixLength );
2675
+ bestShorttextA = shorttext.substring( 0, j - suffixLength );
2676
+ bestShorttextB = shorttext.substring( j + prefixLength );
2677
+ }
2678
+ }
2679
+ if ( bestCommon.length * 2 >= longtext.length ) {
2680
+ return [ bestLongtextA, bestLongtextB,
2681
+ bestShorttextA, bestShorttextB, bestCommon
2682
+ ];
2683
+ } else {
2684
+ return null;
2685
+ }
2686
+ }
2687
+
2688
+ // First check if the second quarter is the seed for a half-match.
2689
+ hm1 = diffHalfMatchI( longtext, shorttext,
2690
+ Math.ceil( longtext.length / 4 ) );
2691
+ // Check again based on the third quarter.
2692
+ hm2 = diffHalfMatchI( longtext, shorttext,
2693
+ Math.ceil( longtext.length / 2 ) );
2694
+ if ( !hm1 && !hm2 ) {
2695
+ return null;
2696
+ } else if ( !hm2 ) {
2697
+ hm = hm1;
2698
+ } else if ( !hm1 ) {
2699
+ hm = hm2;
2700
+ } else {
2701
+ // Both matched. Select the longest.
2702
+ hm = hm1[ 4 ].length > hm2[ 4 ].length ? hm1 : hm2;
2703
+ }
2704
+
2705
+ // A half-match was found, sort out the return data.
2706
+ text1A, text1B, text2A, text2B;
2707
+ if ( text1.length > text2.length ) {
2708
+ text1A = hm[ 0 ];
2709
+ text1B = hm[ 1 ];
2710
+ text2A = hm[ 2 ];
2711
+ text2B = hm[ 3 ];
2712
+ } else {
2713
+ text2A = hm[ 0 ];
2714
+ text2B = hm[ 1 ];
2715
+ text1A = hm[ 2 ];
2716
+ text1B = hm[ 3 ];
2717
+ }
2718
+ midCommon = hm[ 4 ];
2719
+ return [ text1A, text1B, text2A, text2B, midCommon ];
2720
+ };
2721
+
2722
+ /**
2723
+ * Do a quick line-level diff on both strings, then rediff the parts for
2724
+ * greater accuracy.
2725
+ * This speedup can produce non-minimal diffs.
2726
+ * @param {string} text1 Old string to be diffed.
2727
+ * @param {string} text2 New string to be diffed.
2728
+ * @param {number} deadline Time when the diff should be complete by.
2729
+ * @return {!Array.<!DiffMatchPatch.Diff>} Array of diff tuples.
2730
+ * @private
2731
+ */
2732
+ DiffMatchPatch.prototype.diffLineMode = function( text1, text2, deadline ) {
2733
+ var a, diffs, linearray, pointer, countInsert,
2734
+ countDelete, textInsert, textDelete, j;
2735
+ // Scan the text on a line-by-line basis first.
2736
+ a = this.diffLinesToChars( text1, text2 );
2737
+ text1 = a.chars1;
2738
+ text2 = a.chars2;
2739
+ linearray = a.lineArray;
2740
+
2741
+ diffs = this.DiffMain( text1, text2, false, deadline );
2742
+
2743
+ // Convert the diff back to original text.
2744
+ this.diffCharsToLines( diffs, linearray );
2745
+ // Eliminate freak matches (e.g. blank lines)
2746
+ this.diffCleanupSemantic( diffs );
2747
+
2748
+ // Rediff any replacement blocks, this time character-by-character.
2749
+ // Add a dummy entry at the end.
2750
+ diffs.push( [ DIFF_EQUAL, "" ] );
2751
+ pointer = 0;
2752
+ countDelete = 0;
2753
+ countInsert = 0;
2754
+ textDelete = "";
2755
+ textInsert = "";
2756
+ while ( pointer < diffs.length ) {
2757
+ switch ( diffs[ pointer ][ 0 ] ) {
2758
+ case DIFF_INSERT:
2759
+ countInsert++;
2760
+ textInsert += diffs[ pointer ][ 1 ];
2761
+ break;
2762
+ case DIFF_DELETE:
2763
+ countDelete++;
2764
+ textDelete += diffs[ pointer ][ 1 ];
2765
+ break;
2766
+ case DIFF_EQUAL:
2767
+ // Upon reaching an equality, check for prior redundancies.
2768
+ if ( countDelete >= 1 && countInsert >= 1 ) {
2769
+ // Delete the offending records and add the merged ones.
2770
+ diffs.splice( pointer - countDelete - countInsert,
2771
+ countDelete + countInsert );
2772
+ pointer = pointer - countDelete - countInsert;
2773
+ a = this.DiffMain( textDelete, textInsert, false, deadline );
2774
+ for ( j = a.length - 1; j >= 0; j-- ) {
2775
+ diffs.splice( pointer, 0, a[ j ] );
2776
+ }
2777
+ pointer = pointer + a.length;
2778
+ }
2779
+ countInsert = 0;
2780
+ countDelete = 0;
2781
+ textDelete = "";
2782
+ textInsert = "";
2783
+ break;
2784
+ }
2785
+ pointer++;
2786
+ }
2787
+ diffs.pop(); // Remove the dummy entry at the end.
2788
+
2789
+ return diffs;
2790
+ };
2791
+
2792
+ /**
2793
+ * Find the 'middle snake' of a diff, split the problem in two
2794
+ * and return the recursively constructed diff.
2795
+ * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.
2796
+ * @param {string} text1 Old string to be diffed.
2797
+ * @param {string} text2 New string to be diffed.
2798
+ * @param {number} deadline Time at which to bail if not yet complete.
2799
+ * @return {!Array.<!DiffMatchPatch.Diff>} Array of diff tuples.
2800
+ * @private
2801
+ */
2802
+ DiffMatchPatch.prototype.diffBisect = function( text1, text2, deadline ) {
2803
+ var text1Length, text2Length, maxD, vOffset, vLength,
2804
+ v1, v2, x, delta, front, k1start, k1end, k2start,
2805
+ k2end, k2Offset, k1Offset, x1, x2, y1, y2, d, k1, k2;
2806
+ // Cache the text lengths to prevent multiple calls.
2807
+ text1Length = text1.length;
2808
+ text2Length = text2.length;
2809
+ maxD = Math.ceil( ( text1Length + text2Length ) / 2 );
2810
+ vOffset = maxD;
2811
+ vLength = 2 * maxD;
2812
+ v1 = new Array( vLength );
2813
+ v2 = new Array( vLength );
2814
+ // Setting all elements to -1 is faster in Chrome & Firefox than mixing
2815
+ // integers and undefined.
2816
+ for ( x = 0; x < vLength; x++ ) {
2817
+ v1[ x ] = -1;
2818
+ v2[ x ] = -1;
2819
+ }
2820
+ v1[ vOffset + 1 ] = 0;
2821
+ v2[ vOffset + 1 ] = 0;
2822
+ delta = text1Length - text2Length;
2823
+ // If the total number of characters is odd, then the front path will collide
2824
+ // with the reverse path.
2825
+ front = ( delta % 2 !== 0 );
2826
+ // Offsets for start and end of k loop.
2827
+ // Prevents mapping of space beyond the grid.
2828
+ k1start = 0;
2829
+ k1end = 0;
2830
+ k2start = 0;
2831
+ k2end = 0;
2832
+ for ( d = 0; d < maxD; d++ ) {
2833
+ // Bail out if deadline is reached.
2834
+ if ( ( new Date() ).getTime() > deadline ) {
2835
+ break;
2836
+ }
2837
+
2838
+ // Walk the front path one step.
2839
+ for ( k1 = -d + k1start; k1 <= d - k1end; k1 += 2 ) {
2840
+ k1Offset = vOffset + k1;
2841
+ if ( k1 === -d || ( k1 !== d && v1[ k1Offset - 1 ] < v1[ k1Offset + 1 ] ) ) {
2842
+ x1 = v1[ k1Offset + 1 ];
2843
+ } else {
2844
+ x1 = v1[ k1Offset - 1 ] + 1;
2845
+ }
2846
+ y1 = x1 - k1;
2847
+ while ( x1 < text1Length && y1 < text2Length &&
2848
+ text1.charAt( x1 ) === text2.charAt( y1 ) ) {
2849
+ x1++;
2850
+ y1++;
2851
+ }
2852
+ v1[ k1Offset ] = x1;
2853
+ if ( x1 > text1Length ) {
2854
+ // Ran off the right of the graph.
2855
+ k1end += 2;
2856
+ } else if ( y1 > text2Length ) {
2857
+ // Ran off the bottom of the graph.
2858
+ k1start += 2;
2859
+ } else if ( front ) {
2860
+ k2Offset = vOffset + delta - k1;
2861
+ if ( k2Offset >= 0 && k2Offset < vLength && v2[ k2Offset ] !== -1 ) {
2862
+ // Mirror x2 onto top-left coordinate system.
2863
+ x2 = text1Length - v2[ k2Offset ];
2864
+ if ( x1 >= x2 ) {
2865
+ // Overlap detected.
2866
+ return this.diffBisectSplit( text1, text2, x1, y1, deadline );
2867
+ }
2868
+ }
2869
+ }
2870
+ }
2871
+
2872
+ // Walk the reverse path one step.
2873
+ for ( k2 = -d + k2start; k2 <= d - k2end; k2 += 2 ) {
2874
+ k2Offset = vOffset + k2;
2875
+ if ( k2 === -d || ( k2 !== d && v2[ k2Offset - 1 ] < v2[ k2Offset + 1 ] ) ) {
2876
+ x2 = v2[ k2Offset + 1 ];
2877
+ } else {
2878
+ x2 = v2[ k2Offset - 1 ] + 1;
2879
+ }
2880
+ y2 = x2 - k2;
2881
+ while ( x2 < text1Length && y2 < text2Length &&
2882
+ text1.charAt( text1Length - x2 - 1 ) ===
2883
+ text2.charAt( text2Length - y2 - 1 ) ) {
2884
+ x2++;
2885
+ y2++;
2886
+ }
2887
+ v2[ k2Offset ] = x2;
2888
+ if ( x2 > text1Length ) {
2889
+ // Ran off the left of the graph.
2890
+ k2end += 2;
2891
+ } else if ( y2 > text2Length ) {
2892
+ // Ran off the top of the graph.
2893
+ k2start += 2;
2894
+ } else if ( !front ) {
2895
+ k1Offset = vOffset + delta - k2;
2896
+ if ( k1Offset >= 0 && k1Offset < vLength && v1[ k1Offset ] !== -1 ) {
2897
+ x1 = v1[ k1Offset ];
2898
+ y1 = vOffset + x1 - k1Offset;
2899
+ // Mirror x2 onto top-left coordinate system.
2900
+ x2 = text1Length - x2;
2901
+ if ( x1 >= x2 ) {
2902
+ // Overlap detected.
2903
+ return this.diffBisectSplit( text1, text2, x1, y1, deadline );
2904
+ }
2905
+ }
2906
+ }
2907
+ }
2908
+ }
2909
+ // Diff took too long and hit the deadline or
2910
+ // number of diffs equals number of characters, no commonality at all.
2911
+ return [
2912
+ [ DIFF_DELETE, text1 ],
2913
+ [ DIFF_INSERT, text2 ]
2914
+ ];
2915
+ };
2916
+
2917
+ /**
2918
+ * Given the location of the 'middle snake', split the diff in two parts
2919
+ * and recurse.
2920
+ * @param {string} text1 Old string to be diffed.
2921
+ * @param {string} text2 New string to be diffed.
2922
+ * @param {number} x Index of split point in text1.
2923
+ * @param {number} y Index of split point in text2.
2924
+ * @param {number} deadline Time at which to bail if not yet complete.
2925
+ * @return {!Array.<!DiffMatchPatch.Diff>} Array of diff tuples.
2926
+ * @private
2927
+ */
2928
+ DiffMatchPatch.prototype.diffBisectSplit = function( text1, text2, x, y, deadline ) {
2929
+ var text1a, text1b, text2a, text2b, diffs, diffsb;
2930
+ text1a = text1.substring( 0, x );
2931
+ text2a = text2.substring( 0, y );
2932
+ text1b = text1.substring( x );
2933
+ text2b = text2.substring( y );
2934
+
2935
+ // Compute both diffs serially.
2936
+ diffs = this.DiffMain( text1a, text2a, false, deadline );
2937
+ diffsb = this.DiffMain( text1b, text2b, false, deadline );
2938
+
2939
+ return diffs.concat( diffsb );
2940
+ };
2941
+
2942
+ /**
2943
+ * Reduce the number of edits by eliminating semantically trivial equalities.
2944
+ * @param {!Array.<!DiffMatchPatch.Diff>} diffs Array of diff tuples.
2945
+ */
2946
+ DiffMatchPatch.prototype.diffCleanupSemantic = function( diffs ) {
2947
+ var changes, equalities, equalitiesLength, lastequality,
2948
+ pointer, lengthInsertions2, lengthDeletions2, lengthInsertions1,
2949
+ lengthDeletions1, deletion, insertion, overlapLength1, overlapLength2;
2950
+ changes = false;
2951
+ equalities = []; // Stack of indices where equalities are found.
2952
+ equalitiesLength = 0; // Keeping our own length var is faster in JS.
2953
+ /** @type {?string} */
2954
+ lastequality = null;
2955
+ // Always equal to diffs[equalities[equalitiesLength - 1]][1]
2956
+ pointer = 0; // Index of current position.
2957
+ // Number of characters that changed prior to the equality.
2958
+ lengthInsertions1 = 0;
2959
+ lengthDeletions1 = 0;
2960
+ // Number of characters that changed after the equality.
2961
+ lengthInsertions2 = 0;
2962
+ lengthDeletions2 = 0;
2963
+ while ( pointer < diffs.length ) {
2964
+ if ( diffs[ pointer ][ 0 ] === DIFF_EQUAL ) { // Equality found.
2965
+ equalities[ equalitiesLength++ ] = pointer;
2966
+ lengthInsertions1 = lengthInsertions2;
2967
+ lengthDeletions1 = lengthDeletions2;
2968
+ lengthInsertions2 = 0;
2969
+ lengthDeletions2 = 0;
2970
+ lastequality = diffs[ pointer ][ 1 ];
2971
+ } else { // An insertion or deletion.
2972
+ if ( diffs[ pointer ][ 0 ] === DIFF_INSERT ) {
2973
+ lengthInsertions2 += diffs[ pointer ][ 1 ].length;
2974
+ } else {
2975
+ lengthDeletions2 += diffs[ pointer ][ 1 ].length;
2976
+ }
2977
+ // Eliminate an equality that is smaller or equal to the edits on both
2978
+ // sides of it.
2979
+ if ( lastequality && ( lastequality.length <=
2980
+ Math.max( lengthInsertions1, lengthDeletions1 ) ) &&
2981
+ ( lastequality.length <= Math.max( lengthInsertions2,
2982
+ lengthDeletions2 ) ) ) {
2983
+
2984
+ // Duplicate record.
2985
+ diffs.splice(
2986
+ equalities[ equalitiesLength - 1 ],
2987
+ 0,
2988
+ [ DIFF_DELETE, lastequality ]
2989
+ );
2990
+
2991
+ // Change second copy to insert.
2992
+ diffs[ equalities[ equalitiesLength - 1 ] + 1 ][ 0 ] = DIFF_INSERT;
2993
+
2994
+ // Throw away the equality we just deleted.
2995
+ equalitiesLength--;
2996
+
2997
+ // Throw away the previous equality (it needs to be reevaluated).
2998
+ equalitiesLength--;
2999
+ pointer = equalitiesLength > 0 ? equalities[ equalitiesLength - 1 ] : -1;
3000
+
3001
+ // Reset the counters.
3002
+ lengthInsertions1 = 0;
3003
+ lengthDeletions1 = 0;
3004
+ lengthInsertions2 = 0;
3005
+ lengthDeletions2 = 0;
3006
+ lastequality = null;
3007
+ changes = true;
3008
+ }
3009
+ }
3010
+ pointer++;
3011
+ }
3012
+
3013
+ // Normalize the diff.
3014
+ if ( changes ) {
3015
+ this.diffCleanupMerge( diffs );
3016
+ }
3017
+
3018
+ // Find any overlaps between deletions and insertions.
3019
+ // e.g: <del>abcxxx</del><ins>xxxdef</ins>
3020
+ // -> <del>abc</del>xxx<ins>def</ins>
3021
+ // e.g: <del>xxxabc</del><ins>defxxx</ins>
3022
+ // -> <ins>def</ins>xxx<del>abc</del>
3023
+ // Only extract an overlap if it is as big as the edit ahead or behind it.
3024
+ pointer = 1;
3025
+ while ( pointer < diffs.length ) {
3026
+ if ( diffs[ pointer - 1 ][ 0 ] === DIFF_DELETE &&
3027
+ diffs[ pointer ][ 0 ] === DIFF_INSERT ) {
3028
+ deletion = diffs[ pointer - 1 ][ 1 ];
3029
+ insertion = diffs[ pointer ][ 1 ];
3030
+ overlapLength1 = this.diffCommonOverlap( deletion, insertion );
3031
+ overlapLength2 = this.diffCommonOverlap( insertion, deletion );
3032
+ if ( overlapLength1 >= overlapLength2 ) {
3033
+ if ( overlapLength1 >= deletion.length / 2 ||
3034
+ overlapLength1 >= insertion.length / 2 ) {
3035
+ // Overlap found. Insert an equality and trim the surrounding edits.
3036
+ diffs.splice(
3037
+ pointer,
3038
+ 0,
3039
+ [ DIFF_EQUAL, insertion.substring( 0, overlapLength1 ) ]
3040
+ );
3041
+ diffs[ pointer - 1 ][ 1 ] =
3042
+ deletion.substring( 0, deletion.length - overlapLength1 );
3043
+ diffs[ pointer + 1 ][ 1 ] = insertion.substring( overlapLength1 );
3044
+ pointer++;
3045
+ }
3046
+ } else {
3047
+ if ( overlapLength2 >= deletion.length / 2 ||
3048
+ overlapLength2 >= insertion.length / 2 ) {
3049
+
3050
+ // Reverse overlap found.
3051
+ // Insert an equality and swap and trim the surrounding edits.
3052
+ diffs.splice(
3053
+ pointer,
3054
+ 0,
3055
+ [ DIFF_EQUAL, deletion.substring( 0, overlapLength2 ) ]
3056
+ );
3057
+
3058
+ diffs[ pointer - 1 ][ 0 ] = DIFF_INSERT;
3059
+ diffs[ pointer - 1 ][ 1 ] =
3060
+ insertion.substring( 0, insertion.length - overlapLength2 );
3061
+ diffs[ pointer + 1 ][ 0 ] = DIFF_DELETE;
3062
+ diffs[ pointer + 1 ][ 1 ] =
3063
+ deletion.substring( overlapLength2 );
3064
+ pointer++;
3065
+ }
3066
+ }
3067
+ pointer++;
3068
+ }
3069
+ pointer++;
3070
+ }
3071
+ };
3072
+
3073
+ /**
3074
+ * Determine if the suffix of one string is the prefix of another.
3075
+ * @param {string} text1 First string.
3076
+ * @param {string} text2 Second string.
3077
+ * @return {number} The number of characters common to the end of the first
3078
+ * string and the start of the second string.
3079
+ * @private
3080
+ */
3081
+ DiffMatchPatch.prototype.diffCommonOverlap = function( text1, text2 ) {
3082
+ var text1Length, text2Length, textLength,
3083
+ best, length, pattern, found;
3084
+ // Cache the text lengths to prevent multiple calls.
3085
+ text1Length = text1.length;
3086
+ text2Length = text2.length;
3087
+ // Eliminate the null case.
3088
+ if ( text1Length === 0 || text2Length === 0 ) {
3089
+ return 0;
3090
+ }
3091
+ // Truncate the longer string.
3092
+ if ( text1Length > text2Length ) {
3093
+ text1 = text1.substring( text1Length - text2Length );
3094
+ } else if ( text1Length < text2Length ) {
3095
+ text2 = text2.substring( 0, text1Length );
3096
+ }
3097
+ textLength = Math.min( text1Length, text2Length );
3098
+ // Quick check for the worst case.
3099
+ if ( text1 === text2 ) {
3100
+ return textLength;
3101
+ }
3102
+
3103
+ // Start by looking for a single character match
3104
+ // and increase length until no match is found.
3105
+ // Performance analysis: https://neil.fraser.name/news/2010/11/04/
3106
+ best = 0;
3107
+ length = 1;
3108
+ while ( true ) {
3109
+ pattern = text1.substring( textLength - length );
3110
+ found = text2.indexOf( pattern );
3111
+ if ( found === -1 ) {
3112
+ return best;
3113
+ }
3114
+ length += found;
3115
+ if ( found === 0 || text1.substring( textLength - length ) ===
3116
+ text2.substring( 0, length ) ) {
3117
+ best = length;
3118
+ length++;
3119
+ }
3120
+ }
3121
+ };
3122
+
3123
+ /**
3124
+ * Split two texts into an array of strings. Reduce the texts to a string of
3125
+ * hashes where each Unicode character represents one line.
3126
+ * @param {string} text1 First string.
3127
+ * @param {string} text2 Second string.
3128
+ * @return {{chars1: string, chars2: string, lineArray: !Array.<string>}}
3129
+ * An object containing the encoded text1, the encoded text2 and
3130
+ * the array of unique strings.
3131
+ * The zeroth element of the array of unique strings is intentionally blank.
3132
+ * @private
3133
+ */
3134
+ DiffMatchPatch.prototype.diffLinesToChars = function( text1, text2 ) {
3135
+ var lineArray, lineHash, chars1, chars2;
3136
+ lineArray = []; // e.g. lineArray[4] === 'Hello\n'
3137
+ lineHash = {}; // e.g. lineHash['Hello\n'] === 4
3138
+
3139
+ // '\x00' is a valid character, but various debuggers don't like it.
3140
+ // So we'll insert a junk entry to avoid generating a null character.
3141
+ lineArray[ 0 ] = "";
3142
+
3143
+ /**
3144
+ * Split a text into an array of strings. Reduce the texts to a string of
3145
+ * hashes where each Unicode character represents one line.
3146
+ * Modifies linearray and linehash through being a closure.
3147
+ * @param {string} text String to encode.
3148
+ * @return {string} Encoded string.
3149
+ * @private
3150
+ */
3151
+ function diffLinesToCharsMunge( text ) {
3152
+ var chars, lineStart, lineEnd, lineArrayLength, line;
3153
+ chars = "";
3154
+ // Walk the text, pulling out a substring for each line.
3155
+ // text.split('\n') would would temporarily double our memory footprint.
3156
+ // Modifying text would create many large strings to garbage collect.
3157
+ lineStart = 0;
3158
+ lineEnd = -1;
3159
+ // Keeping our own length variable is faster than looking it up.
3160
+ lineArrayLength = lineArray.length;
3161
+ while ( lineEnd < text.length - 1 ) {
3162
+ lineEnd = text.indexOf( "\n", lineStart );
3163
+ if ( lineEnd === -1 ) {
3164
+ lineEnd = text.length - 1;
3165
+ }
3166
+ line = text.substring( lineStart, lineEnd + 1 );
3167
+ lineStart = lineEnd + 1;
3168
+
3169
+ if ( lineHash.hasOwnProperty ? lineHash.hasOwnProperty( line ) :
3170
+ ( lineHash[ line ] !== undefined ) ) {
3171
+ chars += String.fromCharCode( lineHash[ line ] );
3172
+ } else {
3173
+ chars += String.fromCharCode( lineArrayLength );
3174
+ lineHash[ line ] = lineArrayLength;
3175
+ lineArray[ lineArrayLength++ ] = line;
3176
+ }
3177
+ }
3178
+ return chars;
3179
+ }
3180
+
3181
+ chars1 = diffLinesToCharsMunge( text1 );
3182
+ chars2 = diffLinesToCharsMunge( text2 );
3183
+ return {
3184
+ chars1: chars1,
3185
+ chars2: chars2,
3186
+ lineArray: lineArray
3187
+ };
3188
+ };
3189
+
3190
+ /**
3191
+ * Rehydrate the text in a diff from a string of line hashes to real lines of
3192
+ * text.
3193
+ * @param {!Array.<!DiffMatchPatch.Diff>} diffs Array of diff tuples.
3194
+ * @param {!Array.<string>} lineArray Array of unique strings.
3195
+ * @private
3196
+ */
3197
+ DiffMatchPatch.prototype.diffCharsToLines = function( diffs, lineArray ) {
3198
+ var x, chars, text, y;
3199
+ for ( x = 0; x < diffs.length; x++ ) {
3200
+ chars = diffs[ x ][ 1 ];
3201
+ text = [];
3202
+ for ( y = 0; y < chars.length; y++ ) {
3203
+ text[ y ] = lineArray[ chars.charCodeAt( y ) ];
3204
+ }
3205
+ diffs[ x ][ 1 ] = text.join( "" );
3206
+ }
3207
+ };
3208
+
3209
+ /**
3210
+ * Reorder and merge like edit sections. Merge equalities.
3211
+ * Any edit section can move as long as it doesn't cross an equality.
3212
+ * @param {!Array.<!DiffMatchPatch.Diff>} diffs Array of diff tuples.
3213
+ */
3214
+ DiffMatchPatch.prototype.diffCleanupMerge = function( diffs ) {
3215
+ var pointer, countDelete, countInsert, textInsert, textDelete,
3216
+ commonlength, changes, diffPointer, position;
3217
+ diffs.push( [ DIFF_EQUAL, "" ] ); // Add a dummy entry at the end.
3218
+ pointer = 0;
3219
+ countDelete = 0;
3220
+ countInsert = 0;
3221
+ textDelete = "";
3222
+ textInsert = "";
3223
+ commonlength;
3224
+ while ( pointer < diffs.length ) {
3225
+ switch ( diffs[ pointer ][ 0 ] ) {
3226
+ case DIFF_INSERT:
3227
+ countInsert++;
3228
+ textInsert += diffs[ pointer ][ 1 ];
3229
+ pointer++;
3230
+ break;
3231
+ case DIFF_DELETE:
3232
+ countDelete++;
3233
+ textDelete += diffs[ pointer ][ 1 ];
3234
+ pointer++;
3235
+ break;
3236
+ case DIFF_EQUAL:
3237
+ // Upon reaching an equality, check for prior redundancies.
3238
+ if ( countDelete + countInsert > 1 ) {
3239
+ if ( countDelete !== 0 && countInsert !== 0 ) {
3240
+ // Factor out any common prefixes.
3241
+ commonlength = this.diffCommonPrefix( textInsert, textDelete );
3242
+ if ( commonlength !== 0 ) {
3243
+ if ( ( pointer - countDelete - countInsert ) > 0 &&
3244
+ diffs[ pointer - countDelete - countInsert - 1 ][ 0 ] ===
3245
+ DIFF_EQUAL ) {
3246
+ diffs[ pointer - countDelete - countInsert - 1 ][ 1 ] +=
3247
+ textInsert.substring( 0, commonlength );
3248
+ } else {
3249
+ diffs.splice( 0, 0, [ DIFF_EQUAL,
3250
+ textInsert.substring( 0, commonlength )
3251
+ ] );
3252
+ pointer++;
3253
+ }
3254
+ textInsert = textInsert.substring( commonlength );
3255
+ textDelete = textDelete.substring( commonlength );
3256
+ }
3257
+ // Factor out any common suffixies.
3258
+ commonlength = this.diffCommonSuffix( textInsert, textDelete );
3259
+ if ( commonlength !== 0 ) {
3260
+ diffs[ pointer ][ 1 ] = textInsert.substring( textInsert.length -
3261
+ commonlength ) + diffs[ pointer ][ 1 ];
3262
+ textInsert = textInsert.substring( 0, textInsert.length -
3263
+ commonlength );
3264
+ textDelete = textDelete.substring( 0, textDelete.length -
3265
+ commonlength );
3266
+ }
3267
+ }
3268
+ // Delete the offending records and add the merged ones.
3269
+ if ( countDelete === 0 ) {
3270
+ diffs.splice( pointer - countInsert,
3271
+ countDelete + countInsert, [ DIFF_INSERT, textInsert ] );
3272
+ } else if ( countInsert === 0 ) {
3273
+ diffs.splice( pointer - countDelete,
3274
+ countDelete + countInsert, [ DIFF_DELETE, textDelete ] );
3275
+ } else {
3276
+ diffs.splice(
3277
+ pointer - countDelete - countInsert,
3278
+ countDelete + countInsert,
3279
+ [ DIFF_DELETE, textDelete ], [ DIFF_INSERT, textInsert ]
3280
+ );
3281
+ }
3282
+ pointer = pointer - countDelete - countInsert +
3283
+ ( countDelete ? 1 : 0 ) + ( countInsert ? 1 : 0 ) + 1;
3284
+ } else if ( pointer !== 0 && diffs[ pointer - 1 ][ 0 ] === DIFF_EQUAL ) {
3285
+
3286
+ // Merge this equality with the previous one.
3287
+ diffs[ pointer - 1 ][ 1 ] += diffs[ pointer ][ 1 ];
3288
+ diffs.splice( pointer, 1 );
3289
+ } else {
3290
+ pointer++;
3291
+ }
3292
+ countInsert = 0;
3293
+ countDelete = 0;
3294
+ textDelete = "";
3295
+ textInsert = "";
3296
+ break;
3297
+ }
3298
+ }
3299
+ if ( diffs[ diffs.length - 1 ][ 1 ] === "" ) {
3300
+ diffs.pop(); // Remove the dummy entry at the end.
3301
+ }
3302
+
3303
+ // Second pass: look for single edits surrounded on both sides by equalities
3304
+ // which can be shifted sideways to eliminate an equality.
3305
+ // e.g: A<ins>BA</ins>C -> <ins>AB</ins>AC
3306
+ changes = false;
3307
+ pointer = 1;
3308
+
3309
+ // Intentionally ignore the first and last element (don't need checking).
3310
+ while ( pointer < diffs.length - 1 ) {
3311
+ if ( diffs[ pointer - 1 ][ 0 ] === DIFF_EQUAL &&
3312
+ diffs[ pointer + 1 ][ 0 ] === DIFF_EQUAL ) {
3313
+
3314
+ diffPointer = diffs[ pointer ][ 1 ];
3315
+ position = diffPointer.substring(
3316
+ diffPointer.length - diffs[ pointer - 1 ][ 1 ].length
3317
+ );
3318
+
3319
+ // This is a single edit surrounded by equalities.
3320
+ if ( position === diffs[ pointer - 1 ][ 1 ] ) {
3321
+
3322
+ // Shift the edit over the previous equality.
3323
+ diffs[ pointer ][ 1 ] = diffs[ pointer - 1 ][ 1 ] +
3324
+ diffs[ pointer ][ 1 ].substring( 0, diffs[ pointer ][ 1 ].length -
3325
+ diffs[ pointer - 1 ][ 1 ].length );
3326
+ diffs[ pointer + 1 ][ 1 ] =
3327
+ diffs[ pointer - 1 ][ 1 ] + diffs[ pointer + 1 ][ 1 ];
3328
+ diffs.splice( pointer - 1, 1 );
3329
+ changes = true;
3330
+ } else if ( diffPointer.substring( 0, diffs[ pointer + 1 ][ 1 ].length ) ===
3331
+ diffs[ pointer + 1 ][ 1 ] ) {
3332
+
3333
+ // Shift the edit over the next equality.
3334
+ diffs[ pointer - 1 ][ 1 ] += diffs[ pointer + 1 ][ 1 ];
3335
+ diffs[ pointer ][ 1 ] =
3336
+ diffs[ pointer ][ 1 ].substring( diffs[ pointer + 1 ][ 1 ].length ) +
3337
+ diffs[ pointer + 1 ][ 1 ];
3338
+ diffs.splice( pointer + 1, 1 );
3339
+ changes = true;
3340
+ }
3341
+ }
3342
+ pointer++;
3343
+ }
3344
+ // If shifts were made, the diff needs reordering and another shift sweep.
3345
+ if ( changes ) {
3346
+ this.diffCleanupMerge( diffs );
3347
+ }
3348
+ };
3349
+
3350
+ return function( o, n ) {
3351
+ var diff, output, text;
3352
+ diff = new DiffMatchPatch();
3353
+ output = diff.DiffMain( o, n );
3354
+ diff.diffCleanupEfficiency( output );
3355
+ text = diff.diffPrettyHtml( output );
3356
+
3357
+ return text;
3358
+ };
3359
+ }() );
3360
+
3361
+ // Get a reference to the global object, like window in browsers
3362
+ }( (function() {
3363
+ return this;
3364
+ })() ));
3365
+
3366
+ (function() {
3367
+
3368
+ // Don't load the HTML Reporter on non-Browser environments
3369
+ if ( typeof window === "undefined" || !window.document ) {
3370
+ return;
3371
+ }
3372
+
3373
+ // Deprecated QUnit.init - Ref #530
3374
+ // Re-initialize the configuration options
3375
+ QUnit.init = function() {
3376
+ var tests, banner, result, qunit,
3377
+ config = QUnit.config;
3378
+
3379
+ config.stats = { all: 0, bad: 0 };
3380
+ config.moduleStats = { all: 0, bad: 0 };
3381
+ config.started = 0;
3382
+ config.updateRate = 1000;
3383
+ config.blocking = false;
3384
+ config.autostart = true;
3385
+ config.autorun = false;
3386
+ config.filter = "";
3387
+ config.queue = [];
3388
+
3389
+ // Return on non-browser environments
3390
+ // This is necessary to not break on node tests
3391
+ if ( typeof window === "undefined" ) {
3392
+ return;
3393
+ }
3394
+
3395
+ qunit = id( "qunit" );
3396
+ if ( qunit ) {
3397
+ qunit.innerHTML =
3398
+ "<h1 id='qunit-header'>" + escapeText( document.title ) + "</h1>" +
3399
+ "<h2 id='qunit-banner'></h2>" +
3400
+ "<div id='qunit-testrunner-toolbar'></div>" +
3401
+ "<h2 id='qunit-userAgent'></h2>" +
3402
+ "<ol id='qunit-tests'></ol>";
3403
+ }
3404
+
3405
+ tests = id( "qunit-tests" );
3406
+ banner = id( "qunit-banner" );
3407
+ result = id( "qunit-testresult" );
3408
+
3409
+ if ( tests ) {
3410
+ tests.innerHTML = "";
3411
+ }
3412
+
3413
+ if ( banner ) {
3414
+ banner.className = "";
3415
+ }
3416
+
3417
+ if ( result ) {
3418
+ result.parentNode.removeChild( result );
3419
+ }
3420
+
3421
+ if ( tests ) {
3422
+ result = document.createElement( "p" );
3423
+ result.id = "qunit-testresult";
3424
+ result.className = "result";
3425
+ tests.parentNode.insertBefore( result, tests );
3426
+ result.innerHTML = "Running...<br />&#160;";
3427
+ }
3428
+ };
3429
+
3430
+ var config = QUnit.config,
3431
+ collapseNext = false,
3432
+ hasOwn = Object.prototype.hasOwnProperty,
3433
+ defined = {
3434
+ document: window.document !== undefined,
3435
+ sessionStorage: (function() {
3436
+ var x = "qunit-test-string";
3437
+ try {
3438
+ sessionStorage.setItem( x, x );
3439
+ sessionStorage.removeItem( x );
3440
+ return true;
3441
+ } catch ( e ) {
3442
+ return false;
3443
+ }
3444
+ }())
3445
+ },
3446
+ modulesList = [];
3447
+
3448
+ /**
3449
+ * Escape text for attribute or text content.
3450
+ */
3451
+ function escapeText( s ) {
3452
+ if ( !s ) {
3453
+ return "";
3454
+ }
3455
+ s = s + "";
3456
+
3457
+ // Both single quotes and double quotes (for attributes)
3458
+ return s.replace( /['"<>&]/g, function( s ) {
3459
+ switch ( s ) {
3460
+ case "'":
3461
+ return "&#039;";
3462
+ case "\"":
3463
+ return "&quot;";
3464
+ case "<":
3465
+ return "&lt;";
3466
+ case ">":
3467
+ return "&gt;";
3468
+ case "&":
3469
+ return "&amp;";
3470
+ }
3471
+ });
3472
+ }
3473
+
3474
+ /**
3475
+ * @param {HTMLElement} elem
3476
+ * @param {string} type
3477
+ * @param {Function} fn
3478
+ */
3479
+ function addEvent( elem, type, fn ) {
3480
+ if ( elem.addEventListener ) {
3481
+
3482
+ // Standards-based browsers
3483
+ elem.addEventListener( type, fn, false );
3484
+ } else if ( elem.attachEvent ) {
3485
+
3486
+ // support: IE <9
3487
+ elem.attachEvent( "on" + type, function() {
3488
+ var event = window.event;
3489
+ if ( !event.target ) {
3490
+ event.target = event.srcElement || document;
3491
+ }
3492
+
3493
+ fn.call( elem, event );
3494
+ });
3495
+ }
3496
+ }
3497
+
3498
+ /**
3499
+ * @param {Array|NodeList} elems
3500
+ * @param {string} type
3501
+ * @param {Function} fn
3502
+ */
3503
+ function addEvents( elems, type, fn ) {
3504
+ var i = elems.length;
3505
+ while ( i-- ) {
3506
+ addEvent( elems[ i ], type, fn );
3507
+ }
3508
+ }
3509
+
3510
+ function hasClass( elem, name ) {
3511
+ return ( " " + elem.className + " " ).indexOf( " " + name + " " ) >= 0;
3512
+ }
3513
+
3514
+ function addClass( elem, name ) {
3515
+ if ( !hasClass( elem, name ) ) {
3516
+ elem.className += ( elem.className ? " " : "" ) + name;
3517
+ }
3518
+ }
3519
+
3520
+ function toggleClass( elem, name ) {
3521
+ if ( hasClass( elem, name ) ) {
3522
+ removeClass( elem, name );
3523
+ } else {
3524
+ addClass( elem, name );
3525
+ }
3526
+ }
3527
+
3528
+ function removeClass( elem, name ) {
3529
+ var set = " " + elem.className + " ";
3530
+
3531
+ // Class name may appear multiple times
3532
+ while ( set.indexOf( " " + name + " " ) >= 0 ) {
3533
+ set = set.replace( " " + name + " ", " " );
3534
+ }
3535
+
3536
+ // trim for prettiness
3537
+ elem.className = typeof set.trim === "function" ? set.trim() : set.replace( /^\s+|\s+$/g, "" );
3538
+ }
3539
+
3540
+ function id( name ) {
3541
+ return defined.document && document.getElementById && document.getElementById( name );
3542
+ }
3543
+
3544
+ function getUrlConfigHtml() {
3545
+ var i, j, val,
3546
+ escaped, escapedTooltip,
3547
+ selection = false,
3548
+ len = config.urlConfig.length,
3549
+ urlConfigHtml = "";
3550
+
3551
+ for ( i = 0; i < len; i++ ) {
3552
+ val = config.urlConfig[ i ];
3553
+ if ( typeof val === "string" ) {
3554
+ val = {
3555
+ id: val,
3556
+ label: val
3557
+ };
3558
+ }
3559
+
3560
+ escaped = escapeText( val.id );
3561
+ escapedTooltip = escapeText( val.tooltip );
3562
+
3563
+ if ( config[ val.id ] === undefined ) {
3564
+ config[ val.id ] = QUnit.urlParams[ val.id ];
3565
+ }
3566
+
3567
+ if ( !val.value || typeof val.value === "string" ) {
3568
+ urlConfigHtml += "<input id='qunit-urlconfig-" + escaped +
3569
+ "' name='" + escaped + "' type='checkbox'" +
3570
+ ( val.value ? " value='" + escapeText( val.value ) + "'" : "" ) +
3571
+ ( config[ val.id ] ? " checked='checked'" : "" ) +
3572
+ " title='" + escapedTooltip + "' /><label for='qunit-urlconfig-" + escaped +
3573
+ "' title='" + escapedTooltip + "'>" + val.label + "</label>";
3574
+ } else {
3575
+ urlConfigHtml += "<label for='qunit-urlconfig-" + escaped +
3576
+ "' title='" + escapedTooltip + "'>" + val.label +
3577
+ ": </label><select id='qunit-urlconfig-" + escaped +
3578
+ "' name='" + escaped + "' title='" + escapedTooltip + "'><option></option>";
3579
+
3580
+ if ( QUnit.is( "array", val.value ) ) {
3581
+ for ( j = 0; j < val.value.length; j++ ) {
3582
+ escaped = escapeText( val.value[ j ] );
3583
+ urlConfigHtml += "<option value='" + escaped + "'" +
3584
+ ( config[ val.id ] === val.value[ j ] ?
3585
+ ( selection = true ) && " selected='selected'" : "" ) +
3586
+ ">" + escaped + "</option>";
3587
+ }
3588
+ } else {
3589
+ for ( j in val.value ) {
3590
+ if ( hasOwn.call( val.value, j ) ) {
3591
+ urlConfigHtml += "<option value='" + escapeText( j ) + "'" +
3592
+ ( config[ val.id ] === j ?
3593
+ ( selection = true ) && " selected='selected'" : "" ) +
3594
+ ">" + escapeText( val.value[ j ] ) + "</option>";
3595
+ }
3596
+ }
3597
+ }
3598
+ if ( config[ val.id ] && !selection ) {
3599
+ escaped = escapeText( config[ val.id ] );
3600
+ urlConfigHtml += "<option value='" + escaped +
3601
+ "' selected='selected' disabled='disabled'>" + escaped + "</option>";
3602
+ }
3603
+ urlConfigHtml += "</select>";
3604
+ }
3605
+ }
3606
+
3607
+ return urlConfigHtml;
3608
+ }
3609
+
3610
+ // Handle "click" events on toolbar checkboxes and "change" for select menus.
3611
+ // Updates the URL with the new state of `config.urlConfig` values.
3612
+ function toolbarChanged() {
3613
+ var updatedUrl, value,
3614
+ field = this,
3615
+ params = {};
3616
+
3617
+ // Detect if field is a select menu or a checkbox
3618
+ if ( "selectedIndex" in field ) {
3619
+ value = field.options[ field.selectedIndex ].value || undefined;
3620
+ } else {
3621
+ value = field.checked ? ( field.defaultValue || true ) : undefined;
3622
+ }
3623
+
3624
+ params[ field.name ] = value;
3625
+ updatedUrl = setUrl( params );
3626
+
3627
+ if ( "hidepassed" === field.name && "replaceState" in window.history ) {
3628
+ config[ field.name ] = value || false;
3629
+ if ( value ) {
3630
+ addClass( id( "qunit-tests" ), "hidepass" );
3631
+ } else {
3632
+ removeClass( id( "qunit-tests" ), "hidepass" );
3633
+ }
3634
+
3635
+ // It is not necessary to refresh the whole page
3636
+ window.history.replaceState( null, "", updatedUrl );
3637
+ } else {
3638
+ window.location = updatedUrl;
3639
+ }
3640
+ }
3641
+
3642
+ function setUrl( params ) {
3643
+ var key,
3644
+ querystring = "?";
3645
+
3646
+ params = QUnit.extend( QUnit.extend( {}, QUnit.urlParams ), params );
3647
+
3648
+ for ( key in params ) {
3649
+ if ( hasOwn.call( params, key ) ) {
3650
+ if ( params[ key ] === undefined ) {
3651
+ continue;
3652
+ }
3653
+ querystring += encodeURIComponent( key );
3654
+ if ( params[ key ] !== true ) {
3655
+ querystring += "=" + encodeURIComponent( params[ key ] );
3656
+ }
3657
+ querystring += "&";
3658
+ }
3659
+ }
3660
+ return location.protocol + "//" + location.host +
3661
+ location.pathname + querystring.slice( 0, -1 );
3662
+ }
3663
+
3664
+ function applyUrlParams() {
3665
+ var selectedModule,
3666
+ modulesList = id( "qunit-modulefilter" ),
3667
+ filter = id( "qunit-filter-input" ).value;
3668
+
3669
+ selectedModule = modulesList ?
3670
+ decodeURIComponent( modulesList.options[ modulesList.selectedIndex ].value ) :
3671
+ undefined;
3672
+
3673
+ window.location = setUrl({
3674
+ module: ( selectedModule === "" ) ? undefined : selectedModule,
3675
+ filter: ( filter === "" ) ? undefined : filter,
3676
+
3677
+ // Remove testId filter
3678
+ testId: undefined
3679
+ });
3680
+ }
3681
+
3682
+ function toolbarUrlConfigContainer() {
3683
+ var urlConfigContainer = document.createElement( "span" );
3684
+
3685
+ urlConfigContainer.innerHTML = getUrlConfigHtml();
3686
+ addClass( urlConfigContainer, "qunit-url-config" );
3687
+
3688
+ // For oldIE support:
3689
+ // * Add handlers to the individual elements instead of the container
3690
+ // * Use "click" instead of "change" for checkboxes
3691
+ addEvents( urlConfigContainer.getElementsByTagName( "input" ), "click", toolbarChanged );
3692
+ addEvents( urlConfigContainer.getElementsByTagName( "select" ), "change", toolbarChanged );
3693
+
3694
+ return urlConfigContainer;
3695
+ }
3696
+
3697
+ function toolbarLooseFilter() {
3698
+ var filter = document.createElement( "form" ),
3699
+ label = document.createElement( "label" ),
3700
+ input = document.createElement( "input" ),
3701
+ button = document.createElement( "button" );
3702
+
3703
+ addClass( filter, "qunit-filter" );
3704
+
3705
+ label.innerHTML = "Filter: ";
3706
+
3707
+ input.type = "text";
3708
+ input.value = config.filter || "";
3709
+ input.name = "filter";
3710
+ input.id = "qunit-filter-input";
3711
+
3712
+ button.innerHTML = "Go";
3713
+
3714
+ label.appendChild( input );
3715
+
3716
+ filter.appendChild( label );
3717
+ filter.appendChild( button );
3718
+ addEvent( filter, "submit", function( ev ) {
3719
+ applyUrlParams();
3720
+
3721
+ if ( ev && ev.preventDefault ) {
3722
+ ev.preventDefault();
3723
+ }
3724
+
3725
+ return false;
3726
+ });
3727
+
3728
+ return filter;
3729
+ }
3730
+
3731
+ function toolbarModuleFilterHtml() {
3732
+ var i,
3733
+ moduleFilterHtml = "";
3734
+
3735
+ if ( !modulesList.length ) {
3736
+ return false;
3737
+ }
3738
+
3739
+ modulesList.sort(function( a, b ) {
3740
+ return a.localeCompare( b );
3741
+ });
3742
+
3743
+ moduleFilterHtml += "<label for='qunit-modulefilter'>Module: </label>" +
3744
+ "<select id='qunit-modulefilter' name='modulefilter'><option value='' " +
3745
+ ( QUnit.urlParams.module === undefined ? "selected='selected'" : "" ) +
3746
+ ">< All Modules ></option>";
3747
+
3748
+ for ( i = 0; i < modulesList.length; i++ ) {
3749
+ moduleFilterHtml += "<option value='" +
3750
+ escapeText( encodeURIComponent( modulesList[ i ] ) ) + "' " +
3751
+ ( QUnit.urlParams.module === modulesList[ i ] ? "selected='selected'" : "" ) +
3752
+ ">" + escapeText( modulesList[ i ] ) + "</option>";
3753
+ }
3754
+ moduleFilterHtml += "</select>";
3755
+
3756
+ return moduleFilterHtml;
3757
+ }
3758
+
3759
+ function toolbarModuleFilter() {
3760
+ var toolbar = id( "qunit-testrunner-toolbar" ),
3761
+ moduleFilter = document.createElement( "span" ),
3762
+ moduleFilterHtml = toolbarModuleFilterHtml();
3763
+
3764
+ if ( !toolbar || !moduleFilterHtml ) {
3765
+ return false;
3766
+ }
3767
+
3768
+ moduleFilter.setAttribute( "id", "qunit-modulefilter-container" );
3769
+ moduleFilter.innerHTML = moduleFilterHtml;
3770
+
3771
+ addEvent( moduleFilter.lastChild, "change", applyUrlParams );
3772
+
3773
+ toolbar.appendChild( moduleFilter );
3774
+ }
3775
+
3776
+ function appendToolbar() {
3777
+ var toolbar = id( "qunit-testrunner-toolbar" );
3778
+
3779
+ if ( toolbar ) {
3780
+ toolbar.appendChild( toolbarUrlConfigContainer() );
3781
+ toolbar.appendChild( toolbarLooseFilter() );
3782
+ }
3783
+ }
3784
+
3785
+ function appendHeader() {
3786
+ var header = id( "qunit-header" );
3787
+
3788
+ if ( header ) {
3789
+ header.innerHTML = "<a href='" +
3790
+ escapeText( setUrl( { filter: undefined, module: undefined, testId: undefined } ) ) +
3791
+ "'>" + header.innerHTML + "</a> ";
3792
+ }
3793
+ }
3794
+
3795
+ function appendBanner() {
3796
+ var banner = id( "qunit-banner" );
3797
+
3798
+ if ( banner ) {
3799
+ banner.className = "";
3800
+ }
3801
+ }
3802
+
3803
+ function appendTestResults() {
3804
+ var tests = id( "qunit-tests" ),
3805
+ result = id( "qunit-testresult" );
3806
+
3807
+ if ( result ) {
3808
+ result.parentNode.removeChild( result );
3809
+ }
3810
+
3811
+ if ( tests ) {
3812
+ tests.innerHTML = "";
3813
+ result = document.createElement( "p" );
3814
+ result.id = "qunit-testresult";
3815
+ result.className = "result";
3816
+ tests.parentNode.insertBefore( result, tests );
3817
+ result.innerHTML = "Running...<br />&#160;";
3818
+ }
3819
+ }
3820
+
3821
+ function storeFixture() {
3822
+ var fixture = id( "qunit-fixture" );
3823
+ if ( fixture ) {
3824
+ config.fixture = fixture.innerHTML;
3825
+ }
3826
+ }
3827
+
3828
+ function appendFilteredTest() {
3829
+ var testId = QUnit.config.testId;
3830
+ if ( !testId || testId.length <= 0 ) {
3831
+ return "";
3832
+ }
3833
+ return "<div id='qunit-filteredTest'>Rerunning selected tests: " +
3834
+ escapeText( testId.join(", ") ) +
3835
+ " <a id='qunit-clearFilter' href='" +
3836
+ escapeText( setUrl( { filter: undefined, module: undefined, testId: undefined } ) ) +
3837
+ "'>" + "Run all tests" + "</a></div>";
3838
+ }
3839
+
3840
+ function appendUserAgent() {
3841
+ var userAgent = id( "qunit-userAgent" );
3842
+
3843
+ if ( userAgent ) {
3844
+ userAgent.innerHTML = "";
3845
+ userAgent.appendChild(
3846
+ document.createTextNode(
3847
+ "QUnit " + QUnit.version + "; " + navigator.userAgent
3848
+ )
3849
+ );
3850
+ }
3851
+ }
3852
+
3853
+ function appendTestsList( modules ) {
3854
+ var i, l, x, z, test, moduleObj;
3855
+
3856
+ for ( i = 0, l = modules.length; i < l; i++ ) {
3857
+ moduleObj = modules[ i ];
3858
+
3859
+ if ( moduleObj.name ) {
3860
+ modulesList.push( moduleObj.name );
3861
+ }
3862
+
3863
+ for ( x = 0, z = moduleObj.tests.length; x < z; x++ ) {
3864
+ test = moduleObj.tests[ x ];
3865
+
3866
+ appendTest( test.name, test.testId, moduleObj.name );
3867
+ }
3868
+ }
3869
+ }
3870
+
3871
+ function appendTest( name, testId, moduleName ) {
3872
+ var title, rerunTrigger, testBlock, assertList,
3873
+ tests = id( "qunit-tests" );
3874
+
3875
+ if ( !tests ) {
3876
+ return;
3877
+ }
3878
+
3879
+ title = document.createElement( "strong" );
3880
+ title.innerHTML = getNameHtml( name, moduleName );
3881
+
3882
+ rerunTrigger = document.createElement( "a" );
3883
+ rerunTrigger.innerHTML = "Rerun";
3884
+ rerunTrigger.href = setUrl({ testId: testId });
3885
+
3886
+ testBlock = document.createElement( "li" );
3887
+ testBlock.appendChild( title );
3888
+ testBlock.appendChild( rerunTrigger );
3889
+ testBlock.id = "qunit-test-output-" + testId;
3890
+
3891
+ assertList = document.createElement( "ol" );
3892
+ assertList.className = "qunit-assert-list";
3893
+
3894
+ testBlock.appendChild( assertList );
3895
+
3896
+ tests.appendChild( testBlock );
3897
+ }
3898
+
3899
+ // HTML Reporter initialization and load
3900
+ QUnit.begin(function( details ) {
3901
+ var qunit = id( "qunit" );
3902
+
3903
+ // Fixture is the only one necessary to run without the #qunit element
3904
+ storeFixture();
3905
+
3906
+ if ( qunit ) {
3907
+ qunit.innerHTML =
3908
+ "<h1 id='qunit-header'>" + escapeText( document.title ) + "</h1>" +
3909
+ "<h2 id='qunit-banner'></h2>" +
3910
+ "<div id='qunit-testrunner-toolbar'></div>" +
3911
+ appendFilteredTest() +
3912
+ "<h2 id='qunit-userAgent'></h2>" +
3913
+ "<ol id='qunit-tests'></ol>";
3914
+ }
3915
+
3916
+ appendHeader();
3917
+ appendBanner();
3918
+ appendTestResults();
3919
+ appendUserAgent();
3920
+ appendToolbar();
3921
+ appendTestsList( details.modules );
3922
+ toolbarModuleFilter();
3923
+
3924
+ if ( qunit && config.hidepassed ) {
3925
+ addClass( qunit.lastChild, "hidepass" );
3926
+ }
3927
+ });
3928
+
3929
+ QUnit.done(function( details ) {
3930
+ var i, key,
3931
+ banner = id( "qunit-banner" ),
3932
+ tests = id( "qunit-tests" ),
3933
+ html = [
3934
+ "Tests completed in ",
3935
+ details.runtime,
3936
+ " milliseconds.<br />",
3937
+ "<span class='passed'>",
3938
+ details.passed,
3939
+ "</span> assertions of <span class='total'>",
3940
+ details.total,
3941
+ "</span> passed, <span class='failed'>",
3942
+ details.failed,
3943
+ "</span> failed."
3944
+ ].join( "" );
3945
+
3946
+ if ( banner ) {
3947
+ banner.className = details.failed ? "qunit-fail" : "qunit-pass";
3948
+ }
3949
+
3950
+ if ( tests ) {
3951
+ id( "qunit-testresult" ).innerHTML = html;
3952
+ }
3953
+
3954
+ if ( config.altertitle && defined.document && document.title ) {
3955
+
3956
+ // show ✖ for good, ✔ for bad suite result in title
3957
+ // use escape sequences in case file gets loaded with non-utf-8-charset
3958
+ document.title = [
3959
+ ( details.failed ? "\u2716" : "\u2714" ),
3960
+ document.title.replace( /^[\u2714\u2716] /i, "" )
3961
+ ].join( " " );
3962
+ }
3963
+
3964
+ // clear own sessionStorage items if all tests passed
3965
+ if ( config.reorder && defined.sessionStorage && details.failed === 0 ) {
3966
+ for ( i = 0; i < sessionStorage.length; i++ ) {
3967
+ key = sessionStorage.key( i++ );
3968
+ if ( key.indexOf( "qunit-test-" ) === 0 ) {
3969
+ sessionStorage.removeItem( key );
3970
+ }
3971
+ }
3972
+ }
3973
+
3974
+ // scroll back to top to show results
3975
+ if ( config.scrolltop && window.scrollTo ) {
3976
+ window.scrollTo( 0, 0 );
3977
+ }
3978
+ });
3979
+
3980
+ function getNameHtml( name, module ) {
3981
+ var nameHtml = "";
3982
+
3983
+ if ( module ) {
3984
+ nameHtml = "<span class='module-name'>" + escapeText( module ) + "</span>: ";
3985
+ }
3986
+
3987
+ nameHtml += "<span class='test-name'>" + escapeText( name ) + "</span>";
3988
+
3989
+ return nameHtml;
3990
+ }
3991
+
3992
+ QUnit.testStart(function( details ) {
3993
+ var running, testBlock, bad;
3994
+
3995
+ testBlock = id( "qunit-test-output-" + details.testId );
3996
+ if ( testBlock ) {
3997
+ testBlock.className = "running";
3998
+ } else {
3999
+
4000
+ // Report later registered tests
4001
+ appendTest( details.name, details.testId, details.module );
4002
+ }
4003
+
4004
+ running = id( "qunit-testresult" );
4005
+ if ( running ) {
4006
+ bad = QUnit.config.reorder && defined.sessionStorage &&
4007
+ +sessionStorage.getItem( "qunit-test-" + details.module + "-" + details.name );
4008
+
4009
+ running.innerHTML = ( bad ?
4010
+ "Rerunning previously failed test: <br />" :
4011
+ "Running: <br />" ) +
4012
+ getNameHtml( details.name, details.module );
4013
+ }
4014
+
4015
+ });
4016
+
4017
+ function stripHtml( string ) {
4018
+ // strip tags, html entity and whitespaces
4019
+ return string.replace(/<\/?[^>]+(>|$)/g, "").replace(/\&quot;/g, "").replace(/\s+/g, "");
4020
+ }
4021
+
4022
+ QUnit.log(function( details ) {
4023
+ var assertList, assertLi,
4024
+ message, expected, actual, diff,
4025
+ showDiff = false,
4026
+ testItem = id( "qunit-test-output-" + details.testId );
4027
+
4028
+ if ( !testItem ) {
4029
+ return;
4030
+ }
4031
+
4032
+ message = escapeText( details.message ) || ( details.result ? "okay" : "failed" );
4033
+ message = "<span class='test-message'>" + message + "</span>";
4034
+ message += "<span class='runtime'>@ " + details.runtime + " ms</span>";
4035
+
4036
+ // pushFailure doesn't provide details.expected
4037
+ // when it calls, it's implicit to also not show expected and diff stuff
4038
+ // Also, we need to check details.expected existence, as it can exist and be undefined
4039
+ if ( !details.result && hasOwn.call( details, "expected" ) ) {
4040
+ if ( details.negative ) {
4041
+ expected = escapeText( "NOT " + QUnit.dump.parse( details.expected ) );
4042
+ } else {
4043
+ expected = escapeText( QUnit.dump.parse( details.expected ) );
4044
+ }
4045
+
4046
+ actual = escapeText( QUnit.dump.parse( details.actual ) );
4047
+ message += "<table><tr class='test-expected'><th>Expected: </th><td><pre>" +
4048
+ expected +
4049
+ "</pre></td></tr>";
4050
+
4051
+ if ( actual !== expected ) {
4052
+
4053
+ message += "<tr class='test-actual'><th>Result: </th><td><pre>" +
4054
+ actual + "</pre></td></tr>";
4055
+
4056
+ // Don't show diff if actual or expected are booleans
4057
+ if ( !( /^(true|false)$/.test( actual ) ) &&
4058
+ !( /^(true|false)$/.test( expected ) ) ) {
4059
+ diff = QUnit.diff( expected, actual );
4060
+ showDiff = stripHtml( diff ).length !==
4061
+ stripHtml( expected ).length +
4062
+ stripHtml( actual ).length;
4063
+ }
4064
+
4065
+ // Don't show diff if expected and actual are totally different
4066
+ if ( showDiff ) {
4067
+ message += "<tr class='test-diff'><th>Diff: </th><td><pre>" +
4068
+ diff + "</pre></td></tr>";
4069
+ }
4070
+ } else if ( expected.indexOf( "[object Array]" ) !== -1 ||
4071
+ expected.indexOf( "[object Object]" ) !== -1 ) {
4072
+ message += "<tr class='test-message'><th>Message: </th><td>" +
4073
+ "Diff suppressed as the depth of object is more than current max depth (" +
4074
+ QUnit.config.maxDepth + ").<p>Hint: Use <code>QUnit.dump.maxDepth</code> to " +
4075
+ " run with a higher max depth or <a href='" +
4076
+ escapeText( setUrl( { maxDepth: -1 } ) ) + "'>" +
4077
+ "Rerun</a> without max depth.</p></td></tr>";
4078
+ }
4079
+
4080
+ if ( details.source ) {
4081
+ message += "<tr class='test-source'><th>Source: </th><td><pre>" +
4082
+ escapeText( details.source ) + "</pre></td></tr>";
4083
+ }
4084
+
4085
+ message += "</table>";
4086
+
4087
+ // this occurs when pushFailure is set and we have an extracted stack trace
4088
+ } else if ( !details.result && details.source ) {
4089
+ message += "<table>" +
4090
+ "<tr class='test-source'><th>Source: </th><td><pre>" +
4091
+ escapeText( details.source ) + "</pre></td></tr>" +
4092
+ "</table>";
4093
+ }
4094
+
4095
+ assertList = testItem.getElementsByTagName( "ol" )[ 0 ];
4096
+
4097
+ assertLi = document.createElement( "li" );
4098
+ assertLi.className = details.result ? "pass" : "fail";
4099
+ assertLi.innerHTML = message;
4100
+ assertList.appendChild( assertLi );
4101
+ });
4102
+
4103
+ QUnit.testDone(function( details ) {
4104
+ var testTitle, time, testItem, assertList,
4105
+ good, bad, testCounts, skipped, sourceName,
4106
+ tests = id( "qunit-tests" );
4107
+
4108
+ if ( !tests ) {
4109
+ return;
4110
+ }
4111
+
4112
+ testItem = id( "qunit-test-output-" + details.testId );
4113
+
4114
+ assertList = testItem.getElementsByTagName( "ol" )[ 0 ];
4115
+
4116
+ good = details.passed;
4117
+ bad = details.failed;
4118
+
4119
+ // store result when possible
4120
+ if ( config.reorder && defined.sessionStorage ) {
4121
+ if ( bad ) {
4122
+ sessionStorage.setItem( "qunit-test-" + details.module + "-" + details.name, bad );
4123
+ } else {
4124
+ sessionStorage.removeItem( "qunit-test-" + details.module + "-" + details.name );
4125
+ }
4126
+ }
4127
+
4128
+ if ( bad === 0 ) {
4129
+
4130
+ // Collapse the passing tests
4131
+ addClass( assertList, "qunit-collapsed" );
4132
+ } else if ( bad && config.collapse && !collapseNext ) {
4133
+
4134
+ // Skip collapsing the first failing test
4135
+ collapseNext = true;
4136
+ } else {
4137
+
4138
+ // Collapse remaining tests
4139
+ addClass( assertList, "qunit-collapsed" );
4140
+ }
4141
+
4142
+ // testItem.firstChild is the test name
4143
+ testTitle = testItem.firstChild;
4144
+
4145
+ testCounts = bad ?
4146
+ "<b class='failed'>" + bad + "</b>, " + "<b class='passed'>" + good + "</b>, " :
4147
+ "";
4148
+
4149
+ testTitle.innerHTML += " <b class='counts'>(" + testCounts +
4150
+ details.assertions.length + ")</b>";
4151
+
4152
+ if ( details.skipped ) {
4153
+ testItem.className = "skipped";
4154
+ skipped = document.createElement( "em" );
4155
+ skipped.className = "qunit-skipped-label";
4156
+ skipped.innerHTML = "skipped";
4157
+ testItem.insertBefore( skipped, testTitle );
4158
+ } else {
4159
+ addEvent( testTitle, "click", function() {
4160
+ toggleClass( assertList, "qunit-collapsed" );
4161
+ });
4162
+
4163
+ testItem.className = bad ? "fail" : "pass";
4164
+
4165
+ time = document.createElement( "span" );
4166
+ time.className = "runtime";
4167
+ time.innerHTML = details.runtime + " ms";
4168
+ testItem.insertBefore( time, assertList );
4169
+ }
4170
+
4171
+ // Show the source of the test when showing assertions
4172
+ if ( details.source ) {
4173
+ sourceName = document.createElement( "p" );
4174
+ sourceName.innerHTML = "<strong>Source: </strong>" + details.source;
4175
+ addClass( sourceName, "qunit-source" );
4176
+ if ( bad === 0 ) {
4177
+ addClass( sourceName, "qunit-collapsed" );
4178
+ }
4179
+ addEvent( testTitle, "click", function() {
4180
+ toggleClass( sourceName, "qunit-collapsed" );
4181
+ });
4182
+ testItem.appendChild( sourceName );
4183
+ }
4184
+ });
4185
+
4186
+ if ( defined.document ) {
4187
+
4188
+ // Avoid readyState issue with phantomjs
4189
+ // Ref: #818
4190
+ var notPhantom = ( function( p ) {
4191
+ return !( p && p.version && p.version.major > 0 );
4192
+ } )( window.phantom );
4193
+
4194
+ if ( notPhantom && document.readyState === "complete" ) {
4195
+ QUnit.load();
4196
+ } else {
4197
+ addEvent( window, "load", QUnit.load );
4198
+ }
4199
+ } else {
4200
+ config.pageLoaded = true;
4201
+ config.autorun = true;
4202
+ }
4203
+
4204
+ })();