card 1.91 → 1.92

Sign up to get free protection for your applications and to get access to all the features.
Files changed (779) hide show
  1. checksums.yaml +4 -4
  2. data/README.rdoc +80 -0
  3. data/VERSION +1 -1
  4. data/card.gemspec +29 -22
  5. data/config/i18n-tasks.yml +8 -1
  6. data/config/initializers/01_core_extensions/module.rb +46 -4
  7. data/config/initializers/02_patches/action_dispatch.rb +16 -0
  8. data/config/initializers/02_patches/active_job.rb +35 -0
  9. data/config/initializers/patches.rb +12 -0
  10. data/config/initializers/recaptcha.rb +8 -2
  11. data/config/locales/de.yml +36 -23
  12. data/config/locales/en.yml +508 -15
  13. data/db/migrate/20110511221913_require_earlier_migrations.rb +1 -1
  14. data/db/migrate/20120105203350_require_1_8_migrations.rb +1 -1
  15. data/db/migrate/20121111025347_require_1_10_migrations.rb +1 -1
  16. data/db/migrate/20121118114000_split_link_type.rb +1 -1
  17. data/db/migrate/20121118115000_update_link_type.rb +2 -2
  18. data/db/migrate/20130106052640_table_cleanup.rb +1 -1
  19. data/db/migrate/20130109015336_trunk_left.rb +1 -1
  20. data/db/migrate/20130411210957_update_codenames.rb +1 -1
  21. data/db/migrate/20140822073704_create_new_revision_tables.rb +1 -1
  22. data/db/migrate/20141001105348_move_revisions_to_actions.rb +6 -6
  23. data/db/migrate/20141121172918_rename_card_migration_table.rb +1 -1
  24. data/db/migrate/20141208132159_remove_present_from_reference_table.rb +1 -1
  25. data/db/migrate/20141216053032_better_index_names.rb +1 -1
  26. data/db/migrate/20150724210803_add_comment_to_actions.rb +1 -1
  27. data/db/migrate/20151105225559_more_space_for_db_content.rb +1 -1
  28. data/db/migrate/20160122153608_new_indeces.rb +1 -1
  29. data/db/migrate/20170908114442_create_delayed_jobs.rb +22 -0
  30. data/db/migrate_core_cards/20140307231621_user_data_to_cards.rb +1 -1
  31. data/db/migrate_core_cards/20140512155840_add_script_cards.rb +2 -2
  32. data/db/migrate_core_cards/20140629222005_add_email_cards.rb +1 -1
  33. data/db/migrate_core_cards/20150202143810_import_bootstrap_layout.rb +1 -1
  34. data/db/migrate_core_cards/20150317162412_bootstrap_themes.rb +1 -1
  35. data/db/migrate_core_cards/20150429090551_search_card_context.rb +1 -0
  36. data/db/migrate_core_cards/20150508212032_menu_compatibility.rb +1 -1
  37. data/db/migrate_core_cards/20150824135418_update_file_history.rb +1 -0
  38. data/db/migrate_core_cards/20161103154836_update_keys.rb +1 -1
  39. data/db/migrate_core_cards/20170209132834_email_test_context.rb +1 -1
  40. data/db/migrate_core_cards/20170830210517_correct_signup_success_message.rb +10 -0
  41. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/bootstrap_default/_bootswatch.scss +0 -0
  42. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/bootstrap_default/_variables.scss +0 -0
  43. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/cerulean/_bootswatch.scss +0 -0
  44. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/cerulean/_variables.scss +0 -0
  45. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/cerulean/thumbnail.png +0 -0
  46. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/cosmo/_bootswatch.scss +0 -0
  47. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/cosmo/_variables.scss +0 -0
  48. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/cosmo/thumbnail.png +0 -0
  49. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/cyborg/_bootswatch.scss +0 -0
  50. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/cyborg/_variables.scss +0 -0
  51. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/cyborg/thumbnail.png +0 -0
  52. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/darkly/_bootswatch.scss +0 -0
  53. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/darkly/_variables.scss +0 -0
  54. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/darkly/thumbnail.png +0 -0
  55. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/flatly/_bootswatch.scss +0 -0
  56. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/flatly/_variables.scss +0 -0
  57. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/flatly/thumbnail.png +0 -0
  58. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/journal/_bootswatch.scss +0 -0
  59. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/journal/_variables.scss +0 -0
  60. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/journal/thumbnail.png +0 -0
  61. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/litera/_bootswatch.scss +0 -0
  62. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/litera/_variables.scss +0 -0
  63. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/litera/thumbnail.png +0 -0
  64. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/lumen/_bootswatch.scss +0 -0
  65. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/lumen/_variables.scss +0 -0
  66. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/lumen/thumbnail.png +0 -0
  67. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/lux/_bootswatch.scss +0 -0
  68. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/lux/_variables.scss +0 -0
  69. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/lux/thumbnail.png +0 -0
  70. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/materia/_bootswatch.scss +0 -0
  71. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/materia/_variables.scss +0 -0
  72. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/materia/thumbnail.png +0 -0
  73. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/minty/_bootswatch.scss +0 -0
  74. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/minty/_variables.scss +0 -0
  75. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/minty/thumbnail.png +0 -0
  76. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/paper/_bootswatch.scss +0 -0
  77. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/paper/_variables.scss +0 -0
  78. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/pulse/_bootswatch.scss +0 -0
  79. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/pulse/_variables.scss +0 -0
  80. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/pulse/thumbnail.png +0 -0
  81. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/readable/_bootswatch.scss +0 -0
  82. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/readable/_variables.scss +0 -0
  83. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/sandstone/_bootswatch.scss +0 -0
  84. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/sandstone/_variables.scss +0 -0
  85. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/sandstone/thumbnail.png +0 -0
  86. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/simplex/_bootswatch.scss +0 -0
  87. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/simplex/_variables.scss +0 -0
  88. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/simplex/thumbnail.png +0 -0
  89. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/slate/_bootswatch.scss +0 -0
  90. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/slate/_variables.scss +0 -0
  91. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/slate/thumbnail.png +0 -0
  92. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/solar/_bootswatch.scss +0 -0
  93. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/solar/_variables.scss +0 -0
  94. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/solar/thumbnail.png +0 -0
  95. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/spacelab/_bootswatch.scss +0 -0
  96. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/spacelab/_variables.scss +0 -0
  97. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/spacelab/thumbnail.png +0 -0
  98. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/superhero/_bootswatch.scss +0 -0
  99. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/superhero/_variables.scss +0 -0
  100. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/superhero/thumbnail.png +0 -0
  101. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/united/_bootswatch.scss +0 -0
  102. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/united/_variables.scss +0 -0
  103. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/united/thumbnail.png +0 -0
  104. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/yeti/_bootswatch.scss +0 -0
  105. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/yeti/_full.scss +0 -0
  106. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/yeti/_variables.scss +0 -0
  107. data/db/migrate_core_cards/data/{b4_themes → b4_alpha_themes}/yeti/thumbnail.png +0 -0
  108. data/db/migrate_core_cards/data/b4_beta_themes/bootstrap_default/_bootswatch.scss +0 -0
  109. data/db/migrate_core_cards/data/b4_beta_themes/bootstrap_default/_variables.scss +961 -0
  110. data/db/migrate_core_cards/data/b4_beta_themes/cerulean/_bootswatch.scss +67 -0
  111. data/db/migrate_core_cards/data/b4_beta_themes/cerulean/_variables.scss +961 -0
  112. data/db/migrate_core_cards/data/b4_beta_themes/cerulean/thumbnail.png +0 -0
  113. data/db/migrate_core_cards/data/b4_beta_themes/cosmo/_bootswatch.scss +45 -0
  114. data/db/migrate_core_cards/data/b4_beta_themes/cosmo/_variables.scss +961 -0
  115. data/db/migrate_core_cards/data/b4_beta_themes/cosmo/thumbnail.png +0 -0
  116. data/db/migrate_core_cards/data/b4_beta_themes/cyborg/_bootswatch.scss +141 -0
  117. data/db/migrate_core_cards/data/b4_beta_themes/cyborg/_variables.scss +961 -0
  118. data/db/migrate_core_cards/data/b4_beta_themes/cyborg/thumbnail.png +0 -0
  119. data/db/migrate_core_cards/data/b4_beta_themes/darkly/_bootswatch.scss +142 -0
  120. data/db/migrate_core_cards/data/b4_beta_themes/darkly/_variables.scss +961 -0
  121. data/db/migrate_core_cards/data/b4_beta_themes/darkly/thumbnail.png +0 -0
  122. data/db/migrate_core_cards/data/b4_beta_themes/flatly/_bootswatch.scss +107 -0
  123. data/db/migrate_core_cards/data/b4_beta_themes/flatly/_variables.scss +961 -0
  124. data/db/migrate_core_cards/data/b4_beta_themes/flatly/thumbnail.png +0 -0
  125. data/db/migrate_core_cards/data/b4_beta_themes/journal/_bootswatch.scss +69 -0
  126. data/db/migrate_core_cards/data/b4_beta_themes/journal/_variables.scss +961 -0
  127. data/db/migrate_core_cards/data/b4_beta_themes/journal/thumbnail.png +0 -0
  128. data/db/migrate_core_cards/data/b4_beta_themes/litera/_bootswatch.scss +130 -0
  129. data/db/migrate_core_cards/data/b4_beta_themes/litera/_variables.scss +961 -0
  130. data/db/migrate_core_cards/data/b4_beta_themes/litera/thumbnail.png +0 -0
  131. data/db/migrate_core_cards/data/b4_beta_themes/lumen/_bootswatch.scss +294 -0
  132. data/db/migrate_core_cards/data/b4_beta_themes/lumen/_variables.scss +961 -0
  133. data/db/migrate_core_cards/data/b4_beta_themes/lumen/thumbnail.png +0 -0
  134. data/db/migrate_core_cards/data/b4_beta_themes/lux/_bootswatch.scss +111 -0
  135. data/db/migrate_core_cards/data/b4_beta_themes/lux/_variables.scss +961 -0
  136. data/db/migrate_core_cards/data/b4_beta_themes/lux/thumbnail.png +0 -0
  137. data/db/migrate_core_cards/data/b4_beta_themes/materia/_bootswatch.scss +610 -0
  138. data/db/migrate_core_cards/data/b4_beta_themes/materia/_variables.scss +961 -0
  139. data/db/migrate_core_cards/data/b4_beta_themes/materia/thumbnail.png +0 -0
  140. data/db/migrate_core_cards/data/b4_beta_themes/minty/_bootswatch.scss +85 -0
  141. data/db/migrate_core_cards/data/b4_beta_themes/minty/_variables.scss +961 -0
  142. data/db/migrate_core_cards/data/b4_beta_themes/minty/thumbnail.png +0 -0
  143. data/db/migrate_core_cards/data/b4_beta_themes/paper/_bootswatch.scss +607 -0
  144. data/db/migrate_core_cards/data/b4_beta_themes/paper/_variables.scss +861 -0
  145. data/db/migrate_core_cards/data/b4_beta_themes/pulse/_bootswatch.scss +122 -0
  146. data/db/migrate_core_cards/data/b4_beta_themes/pulse/_variables.scss +961 -0
  147. data/db/migrate_core_cards/data/b4_beta_themes/pulse/thumbnail.png +0 -0
  148. data/db/migrate_core_cards/data/b4_beta_themes/readable/_bootswatch.scss +174 -0
  149. data/db/migrate_core_cards/data/b4_beta_themes/readable/_variables.scss +861 -0
  150. data/db/migrate_core_cards/data/b4_beta_themes/sandstone/_bootswatch.scss +152 -0
  151. data/db/migrate_core_cards/data/b4_beta_themes/sandstone/_variables.scss +961 -0
  152. data/db/migrate_core_cards/data/b4_beta_themes/sandstone/thumbnail.png +0 -0
  153. data/db/migrate_core_cards/data/b4_beta_themes/simplex/_bootswatch.scss +103 -0
  154. data/db/migrate_core_cards/data/b4_beta_themes/simplex/_variables.scss +961 -0
  155. data/db/migrate_core_cards/data/b4_beta_themes/simplex/thumbnail.png +0 -0
  156. data/db/migrate_core_cards/data/b4_beta_themes/slate/_bootswatch.scss +274 -0
  157. data/db/migrate_core_cards/data/b4_beta_themes/slate/_variables.scss +961 -0
  158. data/db/migrate_core_cards/data/b4_beta_themes/slate/thumbnail.png +0 -0
  159. data/db/migrate_core_cards/data/b4_beta_themes/solar/_bootswatch.scss +45 -0
  160. data/db/migrate_core_cards/data/b4_beta_themes/solar/_variables.scss +961 -0
  161. data/db/migrate_core_cards/data/b4_beta_themes/solar/thumbnail.png +0 -0
  162. data/db/migrate_core_cards/data/b4_beta_themes/spacelab/_bootswatch.scss +125 -0
  163. data/db/migrate_core_cards/data/b4_beta_themes/spacelab/_variables.scss +961 -0
  164. data/db/migrate_core_cards/data/b4_beta_themes/spacelab/thumbnail.png +0 -0
  165. data/db/migrate_core_cards/data/b4_beta_themes/superhero/_bootswatch.scss +136 -0
  166. data/db/migrate_core_cards/data/b4_beta_themes/superhero/_variables.scss +961 -0
  167. data/db/migrate_core_cards/data/b4_beta_themes/superhero/thumbnail.png +0 -0
  168. data/db/migrate_core_cards/data/b4_beta_themes/united/_bootswatch.scss +32 -0
  169. data/db/migrate_core_cards/data/b4_beta_themes/united/_variables.scss +961 -0
  170. data/db/migrate_core_cards/data/b4_beta_themes/united/thumbnail.png +0 -0
  171. data/db/migrate_core_cards/data/b4_beta_themes/variables/_variables.scss +0 -0
  172. data/db/migrate_core_cards/data/b4_beta_themes/yeti/_bootswatch.scss +304 -0
  173. data/db/migrate_core_cards/data/b4_beta_themes/yeti/_full.scss +9921 -0
  174. data/db/migrate_core_cards/data/b4_beta_themes/yeti/_variables.scss +961 -0
  175. data/db/migrate_core_cards/data/b4_beta_themes/yeti/thumbnail.png +0 -0
  176. data/db/migrate_core_cards/data/cards.yml +2 -2
  177. data/db/migrate_core_cards/data/cards/*header +2 -2
  178. data/db/schema.rb +89 -106
  179. data/db/seed/new/card_actions.yml +2146 -1922
  180. data/db/seed/new/card_acts.yml +2 -248
  181. data/db/seed/new/card_changes.yml +1 -32341
  182. data/db/seed/new/card_references.yml +1162 -980
  183. data/db/seed/new/cards.yml +23244 -14385
  184. data/db/seed/test/fixtures/card_actions.yml +3459 -3011
  185. data/db/seed/test/fixtures/card_acts.yml +470 -608
  186. data/db/seed/test/fixtures/card_changes.yml +109 -37619
  187. data/db/seed/test/fixtures/card_references.yml +2264 -1865
  188. data/db/seed/test/fixtures/cards.yml +26422 -16915
  189. data/db/seed/test/seed.rb +247 -179
  190. data/db/seed_consts.rb +10 -0
  191. data/db/seeds.rb +1 -6
  192. data/db/version.txt +1 -1
  193. data/db/version_core_cards.txt +1 -1
  194. data/lib/active_record/connection_adapters_ext.rb +1 -1
  195. data/lib/application_job.rb +2 -0
  196. data/lib/application_record.rb +3 -0
  197. data/lib/card.rb +77 -13
  198. data/lib/card/act_manager.rb +3 -0
  199. data/lib/card/act_manager/stage_director.rb +3 -38
  200. data/lib/card/act_manager/stage_director/phases.rb +39 -0
  201. data/lib/card/codename.rb +15 -9
  202. data/lib/card/content.rb +4 -0
  203. data/lib/card/content/chunk.rb +4 -0
  204. data/lib/card/env.rb +6 -2
  205. data/lib/card/env/location_history.rb +1 -1
  206. data/lib/card/env/success.rb +5 -2
  207. data/lib/card/error.rb +3 -2
  208. data/lib/card/format.rb +13 -21
  209. data/lib/card/format/context_names.rb +40 -0
  210. data/lib/card/format/error.rb +8 -4
  211. data/lib/card/format/nest.rb +7 -7
  212. data/lib/card/format/nest/fetch.rb +1 -1
  213. data/lib/card/format/nest/mode.rb +75 -0
  214. data/lib/card/format/nest/subformat.rb +18 -5
  215. data/lib/card/format/permission.rb +1 -1
  216. data/lib/card/format/registration.rb +18 -12
  217. data/lib/card/format/render.rb +22 -11
  218. data/lib/card/migration.rb +1 -1
  219. data/lib/card/mod.rb +63 -0
  220. data/lib/card/mod/dirs.rb +73 -4
  221. data/lib/card/mod/load_strategy.rb +64 -0
  222. data/lib/card/mod/load_strategy/eval.rb +16 -0
  223. data/lib/card/mod/load_strategy/pattern_tmp_files.rb +29 -0
  224. data/lib/card/mod/load_strategy/set_binding_magic.rb +48 -0
  225. data/lib/card/mod/load_strategy/set_tmp_files.rb +33 -0
  226. data/lib/card/mod/load_strategy/tmp_files.rb +38 -0
  227. data/lib/card/mod/loader.rb +44 -129
  228. data/lib/card/mod/loader/set_loader.rb +85 -0
  229. data/lib/card/mod/loader/set_pattern_loader.rb +58 -0
  230. data/lib/card/mod/module_template.rb +67 -0
  231. data/lib/card/model/save_helper.rb +27 -4
  232. data/lib/card/name.rb +8 -10
  233. data/lib/card/name/fields_and_traits.rb +7 -5
  234. data/lib/card/name/view_name.rb +4 -4
  235. data/lib/card/query.rb +11 -5
  236. data/lib/card/query/attributes.rb +1 -1
  237. data/lib/card/query/interpretation.rb +3 -3
  238. data/lib/card/reference.rb +2 -2
  239. data/lib/card/set.rb +6 -28
  240. data/lib/card/set/advanced_api.rb +2 -2
  241. data/lib/card/set/event.rb +39 -14
  242. data/lib/card/set/helpers.rb +8 -7
  243. data/lib/card/set/i18n_scanner.rb +22 -0
  244. data/lib/card/set/i18n_scope.rb +41 -7
  245. data/lib/card/set/loader.rb +3 -52
  246. data/lib/card/set_pattern.rb +22 -38
  247. data/lib/card/subcards.rb +1 -1
  248. data/lib/card/tasks/card.rake +43 -3
  249. data/lib/card/tasks/card/migrate.rake +77 -0
  250. data/lib/card/view.rb +34 -5
  251. data/lib/card/view/cache.rb +69 -32
  252. data/lib/card/view/cache_action.rb +158 -0
  253. data/lib/card/view/options.rb +107 -57
  254. data/lib/card/view/stub.rb +46 -12
  255. data/lib/card/view/visibility.rb +3 -3
  256. data/lib/cardio.rb +9 -5
  257. data/mod/account/set/right/account.rb +2 -3
  258. data/mod/account/set/right/email.rb +4 -5
  259. data/mod/account/set/right/password.rb +2 -2
  260. data/mod/account/set/right/salt.rb +1 -1
  261. data/mod/account/set/right/status.rb +1 -1
  262. data/mod/account/set/right/token.rb +5 -5
  263. data/mod/account/set/self/account_links.rb +1 -1
  264. data/mod/account/set/self/signin.rb +7 -7
  265. data/mod/account/set/type/signup.rb +6 -4
  266. data/mod/account/set/type/user.rb +16 -15
  267. data/mod/account/spec/set/all/account_spec.rb +96 -103
  268. data/mod/account/spec/set/right/account_spec.rb +1 -1
  269. data/mod/account/spec/set/self/account_links_spec.rb +2 -2
  270. data/mod/account/spec/set/self/signin_spec.rb +1 -1
  271. data/mod/account/template/type/signup/core.haml +22 -0
  272. data/mod/admin/set/self/admin.rb +26 -4
  273. data/mod/admin/set/self/admin_info.rb +7 -2
  274. data/mod/admin/spec/set/self/admin_spec.rb +47 -30
  275. data/mod/admin/spec/set/self/version_spec.rb +2 -2
  276. data/mod/basic_formats/format/css_format.rb +9 -0
  277. data/mod/basic_formats/format/csv_format.rb +10 -0
  278. data/mod/basic_formats/format/js_format.rb +4 -0
  279. data/mod/basic_formats/format/json_format.rb +15 -0
  280. data/mod/basic_formats/format/xml_format.rb +4 -0
  281. data/mod/basic_formats/set/all/all_csv.rb +1 -1
  282. data/mod/basic_formats/set/all/base.rb +17 -9
  283. data/mod/basic_formats/set/all/json.rb +1 -1
  284. data/mod/basic_formats/set/self/01_head/javascript.rb +11 -7
  285. data/mod/basic_formats/set/self/head.rb +3 -2
  286. data/{db/migrate_core_cards/20170719163708_update_bootswatch_themes.rb → mod/bootstrap/db/migrate_cards/20170719163701_update_bootswatch_themes.rb} +1 -1
  287. data/{db/migrate_core_cards → mod/bootstrap/db/migrate_cards}/20170726111053_add_bootstrap_mixins.rb +0 -0
  288. data/{db/migrate_core_cards → mod/bootstrap/db/migrate_cards}/20170726145012_select2.rb +0 -0
  289. data/mod/bootstrap/file/cerulean_skin_image/image-icon.png +0 -0
  290. data/mod/bootstrap/file/cerulean_skin_image/image-large.png +0 -0
  291. data/mod/bootstrap/file/cerulean_skin_image/image-medium.png +0 -0
  292. data/mod/bootstrap/file/cerulean_skin_image/image-small.png +0 -0
  293. data/mod/bootstrap/file/cosmo_skin_image/image-icon.png +0 -0
  294. data/mod/bootstrap/file/cosmo_skin_image/image-large.png +0 -0
  295. data/mod/bootstrap/file/cosmo_skin_image/image-medium.png +0 -0
  296. data/mod/bootstrap/file/cosmo_skin_image/image-small.png +0 -0
  297. data/mod/bootstrap/file/cyborg_skin_image/image-icon.png +0 -0
  298. data/mod/bootstrap/file/cyborg_skin_image/image-large.png +0 -0
  299. data/mod/bootstrap/file/cyborg_skin_image/image-medium.png +0 -0
  300. data/mod/bootstrap/file/cyborg_skin_image/image-small.png +0 -0
  301. data/mod/bootstrap/file/darkly_skin_image/image-icon.png +0 -0
  302. data/mod/bootstrap/file/darkly_skin_image/image-large.png +0 -0
  303. data/mod/bootstrap/file/darkly_skin_image/image-medium.png +0 -0
  304. data/mod/bootstrap/file/darkly_skin_image/image-small.png +0 -0
  305. data/mod/bootstrap/file/flatly_skin_image/image-icon.png +0 -0
  306. data/mod/bootstrap/file/flatly_skin_image/image-large.png +0 -0
  307. data/mod/bootstrap/file/flatly_skin_image/image-medium.png +0 -0
  308. data/mod/bootstrap/file/flatly_skin_image/image-small.png +0 -0
  309. data/mod/bootstrap/file/journal_skin_image/image-icon.png +0 -0
  310. data/mod/bootstrap/file/journal_skin_image/image-large.png +0 -0
  311. data/mod/bootstrap/file/journal_skin_image/image-medium.png +0 -0
  312. data/mod/bootstrap/file/journal_skin_image/image-small.png +0 -0
  313. data/mod/bootstrap/file/litera_skin_image/image-icon.png +0 -0
  314. data/mod/bootstrap/file/litera_skin_image/image-large.png +0 -0
  315. data/mod/bootstrap/file/litera_skin_image/image-medium.png +0 -0
  316. data/mod/bootstrap/file/litera_skin_image/image-original.png +0 -0
  317. data/mod/bootstrap/file/litera_skin_image/image-small.png +0 -0
  318. data/mod/bootstrap/file/lumen_skin_image/image-icon.png +0 -0
  319. data/mod/bootstrap/file/lumen_skin_image/image-large.png +0 -0
  320. data/mod/bootstrap/file/lumen_skin_image/image-medium.png +0 -0
  321. data/mod/bootstrap/file/lumen_skin_image/image-small.png +0 -0
  322. data/mod/bootstrap/file/lux_skin_image/image-icon.png +0 -0
  323. data/mod/bootstrap/file/lux_skin_image/image-large.png +0 -0
  324. data/mod/bootstrap/file/lux_skin_image/image-medium.png +0 -0
  325. data/mod/bootstrap/file/lux_skin_image/image-original.png +0 -0
  326. data/mod/bootstrap/file/lux_skin_image/image-small.png +0 -0
  327. data/mod/bootstrap/file/materia_skin_image/image-icon.png +0 -0
  328. data/mod/bootstrap/file/materia_skin_image/image-large.png +0 -0
  329. data/mod/bootstrap/file/materia_skin_image/image-medium.png +0 -0
  330. data/mod/bootstrap/file/materia_skin_image/image-original.png +0 -0
  331. data/mod/bootstrap/file/materia_skin_image/image-small.png +0 -0
  332. data/mod/bootstrap/file/minty_skin_image/image-icon.png +0 -0
  333. data/mod/bootstrap/file/minty_skin_image/image-large.png +0 -0
  334. data/mod/bootstrap/file/minty_skin_image/image-medium.png +0 -0
  335. data/mod/bootstrap/file/minty_skin_image/image-original.png +0 -0
  336. data/mod/bootstrap/file/minty_skin_image/image-small.png +0 -0
  337. data/mod/bootstrap/file/pulse_skin_image/image-icon.png +0 -0
  338. data/mod/bootstrap/file/pulse_skin_image/image-large.png +0 -0
  339. data/mod/bootstrap/file/pulse_skin_image/image-medium.png +0 -0
  340. data/mod/bootstrap/file/pulse_skin_image/image-original.png +0 -0
  341. data/mod/bootstrap/file/pulse_skin_image/image-small.png +0 -0
  342. data/mod/bootstrap/file/sandstone_skin_image/image-icon.png +0 -0
  343. data/mod/bootstrap/file/sandstone_skin_image/image-large.png +0 -0
  344. data/mod/bootstrap/file/sandstone_skin_image/image-medium.png +0 -0
  345. data/mod/bootstrap/file/sandstone_skin_image/image-small.png +0 -0
  346. data/mod/bootstrap/file/simplex_skin_image/image-icon.png +0 -0
  347. data/mod/bootstrap/file/simplex_skin_image/image-large.png +0 -0
  348. data/mod/bootstrap/file/simplex_skin_image/image-medium.png +0 -0
  349. data/mod/bootstrap/file/simplex_skin_image/image-small.png +0 -0
  350. data/mod/bootstrap/file/slate_skin_image/image-icon.png +0 -0
  351. data/mod/bootstrap/file/slate_skin_image/image-large.png +0 -0
  352. data/mod/bootstrap/file/slate_skin_image/image-medium.png +0 -0
  353. data/mod/bootstrap/file/slate_skin_image/image-small.png +0 -0
  354. data/mod/bootstrap/file/solar_skin_image/image-icon.png +0 -0
  355. data/mod/bootstrap/file/solar_skin_image/image-large.png +0 -0
  356. data/mod/bootstrap/file/solar_skin_image/image-medium.png +0 -0
  357. data/mod/bootstrap/file/solar_skin_image/image-original.png +0 -0
  358. data/mod/bootstrap/file/solar_skin_image/image-small.png +0 -0
  359. data/mod/bootstrap/file/spacelab_skin_image/image-icon.png +0 -0
  360. data/mod/bootstrap/file/spacelab_skin_image/image-large.png +0 -0
  361. data/mod/bootstrap/file/spacelab_skin_image/image-medium.png +0 -0
  362. data/mod/bootstrap/file/spacelab_skin_image/image-small.png +0 -0
  363. data/mod/bootstrap/file/superhero_skin_image/image-icon.png +0 -0
  364. data/mod/bootstrap/file/superhero_skin_image/image-large.png +0 -0
  365. data/mod/bootstrap/file/superhero_skin_image/image-medium.png +0 -0
  366. data/mod/bootstrap/file/superhero_skin_image/image-small.png +0 -0
  367. data/mod/bootstrap/file/united_skin_image/image-icon.png +0 -0
  368. data/mod/bootstrap/file/united_skin_image/image-large.png +0 -0
  369. data/mod/bootstrap/file/united_skin_image/image-medium.png +0 -0
  370. data/mod/bootstrap/file/united_skin_image/image-small.png +0 -0
  371. data/mod/bootstrap/file/yeti_skin_image/image-icon.png +0 -0
  372. data/mod/bootstrap/file/yeti_skin_image/image-large.png +0 -0
  373. data/mod/bootstrap/file/yeti_skin_image/image-medium.png +0 -0
  374. data/mod/bootstrap/file/yeti_skin_image/image-small.png +0 -0
  375. data/mod/bootstrap/lib/bootstrap/basic_tags.rb +3 -3
  376. data/mod/bootstrap/lib/bootstrap/component.rb +124 -37
  377. data/mod/bootstrap/lib/bootstrap/component/carousel.rb +68 -0
  378. data/mod/bootstrap/lib/bootstrap/component/form.rb +49 -16
  379. data/mod/bootstrap/lib/bootstrap/component/horizontal_form.rb +35 -10
  380. data/mod/bootstrap/lib/bootstrap/component/layout.rb +10 -2
  381. data/mod/bootstrap/lib/bootstrap/component/panel.rb +4 -4
  382. data/mod/bootstrap/lib/bootstrap/old_component.rb +182 -0
  383. data/mod/bootstrap/lib/javascript/bootstrap_modal_wagn.js +1 -1
  384. data/mod/bootstrap/set/all/bootstrap/accordion.rb +10 -10
  385. data/mod/bootstrap/set/all/bootstrap/helper.rb +2 -0
  386. data/mod/bootstrap/set/all/bootstrap/tabs.rb +1 -1
  387. data/mod/bootstrap/spec/set/all/bootstrap/bootstrap_builder_spec.rb +24 -14
  388. data/mod/bootstrap/spec/set/all/bootstrap/bootstrap_spec.rb +2 -2
  389. data/mod/bootstrap/spec/set/all/bootstrap/carousel_spec.rb +65 -0
  390. data/mod/bootstrap/spec/set/all/bootstrap/form_spec.rb +4 -44
  391. data/mod/bootstrap/spec/set/all/bootstrap/horizontal_form_spec.rb +46 -0
  392. data/mod/bootstrap/spec/set/all/bootstrap/layout_spec.rb +85 -91
  393. data/mod/carrierwave/lib/carrier_wave/file_card_uploader.rb +7 -1
  394. data/mod/carrierwave/set/abstract/attachment/paths.rb +2 -2
  395. data/mod/carrierwave/set/abstract/attachment/upload_cache.rb +10 -3
  396. data/mod/carrierwave/set/type/file.rb +5 -5
  397. data/mod/carrierwave/set/type/image.rb +4 -4
  398. data/mod/carrierwave/spec/lib/carrier_wave/file_card_uploader_spec.rb +1 -0
  399. data/mod/carrierwave/spec/set/type/file/bucket_config_spec.rb +90 -0
  400. data/mod/carrierwave/spec/set/type/file_spec.rb +41 -99
  401. data/mod/core/chunk/link.rb +1 -2
  402. data/mod/core/chunk/nest.rb +1 -1
  403. data/mod/core/chunk/reference.rb +1 -1
  404. data/mod/core/chunk/view_stub.rb +8 -0
  405. data/mod/core/format/html_format.rb +9 -3
  406. data/mod/core/set/abstract/code_file.rb +1 -1
  407. data/mod/core/set/all/actify.rb +34 -0
  408. data/mod/core/set/all/assign_attributes.rb +13 -0
  409. data/mod/core/set/all/cache.rb +96 -0
  410. data/mod/core/set/all/collection.rb +16 -8
  411. data/mod/core/set/all/{event.rb → event_conditions.rb} +1 -1
  412. data/mod/core/set/all/fetch.rb +43 -315
  413. data/mod/core/set/all/fetch_helper.rb +130 -0
  414. data/mod/core/set/all/haml.rb +13 -0
  415. data/mod/core/set/all/i18n.rb +5 -4
  416. data/mod/core/set/all/mark.rb +66 -0
  417. data/mod/core/set/all/name.rb +35 -57
  418. data/mod/core/set/all/permissions.rb +6 -3
  419. data/mod/core/set/all/references.rb +5 -5
  420. data/mod/core/set/all/rename.rb +34 -0
  421. data/mod/core/set/all/rules.rb +1 -1
  422. data/mod/core/set/all/states.rb +12 -0
  423. data/mod/core/set/all/trash.rb +4 -3
  424. data/mod/core/set/all/type.rb +4 -0
  425. data/mod/core/set/all/update_read_rules.rb +1 -1
  426. data/mod/core/spec/set/all/actify_spec.rb +9 -8
  427. data/mod/core/spec/set/all/assign_attributes_spec.rb +33 -299
  428. data/mod/core/spec/set/all/collection_spec.rb +2 -2
  429. data/mod/core/spec/set/all/event_conditions_spec.rb +54 -0
  430. data/mod/core/spec/set/all/fetch_spec.rb +21 -29
  431. data/mod/core/spec/set/all/i18n_spec.rb +17 -0
  432. data/mod/core/spec/set/all/name_spec.rb +39 -3
  433. data/mod/core/spec/set/all/name_validations_spec.rb +21 -0
  434. data/mod/core/spec/set/all/permissions/reader_rules_spec.rb +166 -0
  435. data/mod/core/spec/set/all/permissions_spec.rb +25 -171
  436. data/mod/core/spec/set/all/rename_spec.rb +171 -0
  437. data/mod/core/spec/set/all/rules2_spec.rb +45 -49
  438. data/mod/core/spec/set/all/trash_spec.rb +84 -61
  439. data/mod/history/lib/card/act.rb +5 -4
  440. data/mod/history/lib/card/act/act_renderer.rb +55 -28
  441. data/mod/history/lib/card/act/act_renderer/absolute_act_renderer.rb +10 -2
  442. data/mod/history/lib/card/act/act_renderer/relative_act_renderer.rb +8 -1
  443. data/mod/history/lib/card/action.rb +35 -3
  444. data/mod/history/lib/card/action/action_renderer.rb +3 -3
  445. data/mod/history/lib/card/action/admin.rb +17 -0
  446. data/mod/history/lib/card/change.rb +1 -1
  447. data/mod/history/set/all/act_view.rb +16 -9
  448. data/mod/history/set/all/actions.rb +35 -9
  449. data/mod/history/set/all/content_history.rb +22 -14
  450. data/mod/history/set/all/history.rb +52 -19
  451. data/mod/machines/file/all_script_machine_output/file.js +34 -16
  452. data/mod/machines/file/script_html5shiv_printshiv_machine_output/file.js +2 -0
  453. data/mod/machines/lib/card/machine.rb +49 -0
  454. data/mod/machines/lib/javascript/decko.js.coffee +9 -0
  455. data/mod/machines/lib/javascript/decko_mod.js.coffee +3 -0
  456. data/mod/machines/lib/stylesheets/style_cards.scss +10 -14
  457. data/mod/machines/set/abstract/machine.rb +1 -1
  458. data/mod/machines/spec/set/abstract/machine_spec.rb +1 -1
  459. data/mod/machines/spec/set/type/scss_spec.rb +5 -7
  460. data/mod/machines/spec/shared_examples/machine.rb +3 -3
  461. data/mod/notifications/set/all/follow.rb +2 -2
  462. data/mod/notifications/set/all/send_notifications.rb +21 -15
  463. data/mod/notifications/set/right/bcc.rb +1 -1
  464. data/mod/notifications/set/right/follow.rb +1 -1
  465. data/mod/notifications/set/right/html_message.rb +6 -0
  466. data/mod/notifications/set/right/text_message.rb +6 -0
  467. data/mod/notifications/spec/set/all/notify_spec.rb +87 -166
  468. data/mod/notifications/spec/set/type/notification_template_spec.rb +3 -2
  469. data/mod/pointer/set/abstract/02_pointer.rb +4 -4
  470. data/mod/pointer/set/abstract/02_pointer/edit.rb +41 -14
  471. data/mod/pointer/spec/set/type/pointer_spec.rb +10 -9
  472. data/mod/prosemirror_editor/lib/javascript/script_prosemirror.js +305 -143
  473. data/mod/settings/set/abstract/permission.rb +1 -1
  474. data/mod/settings/set/right/structure.rb +0 -1
  475. data/mod/settings/set/self/recent_settings.rb +4 -0
  476. data/mod/standard/file/credit_image/image-icon.png +0 -0
  477. data/mod/standard/file/credit_image/image-large.png +0 -0
  478. data/mod/standard/file/credit_image/image-medium.png +0 -0
  479. data/mod/standard/file/credit_image/image-small.png +0 -0
  480. data/mod/standard/file/favicon/image-icon.png +0 -0
  481. data/mod/standard/file/favicon/image-large.png +0 -0
  482. data/mod/standard/file/favicon/image-medium.png +0 -0
  483. data/mod/standard/file/favicon/image-small.png +0 -0
  484. data/mod/standard/file/logo/image-icon.png +0 -0
  485. data/mod/standard/file/logo/image-large.png +0 -0
  486. data/mod/standard/file/logo/image-medium.png +0 -0
  487. data/mod/standard/file/logo/image-small.png +0 -0
  488. data/mod/standard/set/abstract/search.rb +1 -1
  489. data/mod/standard/set/all/error.rb +5 -5
  490. data/mod/standard/set/all/links.rb +1 -2
  491. data/mod/standard/set/all/list_changes.rb +1 -1
  492. data/mod/standard/set/all/rich_html/content.rb +20 -14
  493. data/mod/standard/set/all/rich_html/editing.rb +9 -7
  494. data/mod/standard/set/all/rich_html/form.rb +24 -27
  495. data/mod/standard/set/all/rich_html/header.rb +1 -1
  496. data/mod/standard/set/all/rich_html/new.rb +12 -10
  497. data/mod/standard/set/all/rich_html/toolbar.rb +2 -2
  498. data/mod/standard/set/all/rich_html/wrapper.rb +4 -4
  499. data/mod/standard/set/self/activity_toolbar_button.rb +1 -1
  500. data/mod/standard/set/self/recent.rb +4 -2
  501. data/mod/standard/set/type/basic.rb +2 -2
  502. data/mod/standard/set/type/cardtype.rb +11 -8
  503. data/mod/standard/set/type/list.rb +4 -4
  504. data/mod/standard/set/type/search_type.rb +4 -4
  505. data/mod/standard/set/type/session.rb +4 -0
  506. data/mod/standard/set/type/set.rb +1 -1
  507. data/mod/standard/set/type/toggle.rb +2 -2
  508. data/mod/standard/spec/chunk/link_spec.rb +1 -1
  509. data/mod/standard/spec/set/all/history_spec.rb +31 -12
  510. data/mod/standard/spec/set/all/rich_html/form_spec.rb +2 -2
  511. data/mod/standard/spec/set/all/rich_html/toolbar_spec.rb +1 -0
  512. data/mod/standard/spec/set/type/cardtype_spec.rb +44 -1
  513. data/mod/standard/spec/set/type/email_template/email_config_spec.rb +2 -1
  514. data/mod/standard/spec/set/type/list_spec.rb +8 -3
  515. data/mod/standard/spec/set/type/listed_by_spec.rb +0 -6
  516. data/spec/config/initializers/patches/active_job_spec.rb +7 -0
  517. data/spec/lib/card/action_spec.rb +3 -2
  518. data/spec/lib/card/codename_spec.rb +7 -2
  519. data/spec/lib/card/content_spec.rb +19 -1
  520. data/spec/lib/card/format/render_spec.rb +5 -5
  521. data/spec/lib/card/i18n_spec.rb +5 -20
  522. data/spec/lib/card/{loader → mod/loader}/mod_dirs.rb +0 -0
  523. data/spec/lib/card/mod/loader/set_loader_spec.rb +19 -0
  524. data/spec/lib/card/mod/loader/set_pattern_loader_spec.rb +19 -0
  525. data/spec/lib/card/name/fields_and_traits_spec.rb +18 -0
  526. data/spec/lib/card/name_spec.rb +3 -3
  527. data/spec/lib/card/query/sorting_spec.rb +1 -1
  528. data/spec/lib/card/query_spec.rb +16 -9
  529. data/spec/lib/card/reference_spec.rb +5 -6
  530. data/spec/lib/card/set_pattern_spec.rb +4 -0
  531. data/spec/lib/card/view_cache_spec.rb +17 -0
  532. data/spec/models/card/create_spec.rb +40 -22
  533. data/spec/models/card/trash_spec.rb +8 -70
  534. data/spec/models/card_spec.rb +16 -46
  535. data/spec/spec_helper.rb +1 -3
  536. data/spec/support/card_spec_helper.rb +5 -2
  537. data/spec/support/card_spec_loader.rb +34 -6
  538. data/spec/support/helper/event_helper.rb +1 -1
  539. data/spec/support/helper/save_helper.rb +4 -0
  540. data/spec/support/helper/set_helper.rb +1 -1
  541. data/spec/support/matchers/card_matchers.rb +136 -0
  542. data/spec/support/matchers/expectations.rb +5 -0
  543. data/spec/support/matchers/file_matchers.rb +71 -0
  544. data/spec/support/matchers/negated_matchers.rb +2 -0
  545. data/spec/support/test_mods/mod1/set/all/test_set.rb +3 -0
  546. data/spec/support/test_mods/mod2/set_pattern/test_pattern.rb +0 -0
  547. data/tmpsets/set/mod001-admin/self/admin.rb +130 -0
  548. data/tmpsets/set/mod001-admin/self/admin_info.rb +110 -0
  549. data/tmpsets/set/mod001-admin/self/version.rb +15 -0
  550. data/tmpsets/set/mod002-core/abstract/code_file.rb +79 -0
  551. data/tmpsets/set/mod002-core/all/actify.rb +101 -0
  552. data/tmpsets/set/mod002-core/all/active_card.rb +42 -0
  553. data/tmpsets/set/mod002-core/all/collection.rb +313 -0
  554. data/tmpsets/set/mod002-core/all/content.rb +69 -0
  555. data/tmpsets/set/mod002-core/all/debug.rb +30 -0
  556. data/tmpsets/set/mod002-core/all/erb.rb +18 -0
  557. data/tmpsets/set/mod002-core/all/event.rb +62 -0
  558. data/tmpsets/set/mod002-core/all/export.rb +49 -0
  559. data/tmpsets/set/mod002-core/all/fetch.rb +335 -0
  560. data/tmpsets/set/mod002-core/all/haml.rb +14 -0
  561. data/tmpsets/set/mod002-core/all/initialize.rb +42 -0
  562. data/tmpsets/set/mod002-core/all/location_history.rb +15 -0
  563. data/tmpsets/set/mod002-core/all/name.rb +282 -0
  564. data/tmpsets/set/mod002-core/all/name_validations.rb +65 -0
  565. data/tmpsets/set/mod002-core/all/pattern.rb +67 -0
  566. data/tmpsets/set/mod002-core/all/permissions.rb +319 -0
  567. data/tmpsets/set/mod002-core/all/phases.rb +23 -0
  568. data/tmpsets/set/mod002-core/all/references.rb +187 -0
  569. data/tmpsets/set/mod002-core/all/rules.rb +311 -0
  570. data/tmpsets/set/mod002-core/all/stages.rb +31 -0
  571. data/tmpsets/set/mod002-core/all/states.rb +31 -0
  572. data/tmpsets/set/mod002-core/all/subcards.rb +85 -0
  573. data/tmpsets/set/mod002-core/all/templating.rb +78 -0
  574. data/tmpsets/set/mod002-core/all/tracked_attributes.rb +78 -0
  575. data/tmpsets/set/mod002-core/all/trash.rb +113 -0
  576. data/tmpsets/set/mod002-core/all/type.rb +60 -0
  577. data/tmpsets/set/mod002-core/all/update_read_rules.rb +91 -0
  578. data/tmpsets/set/mod002-core/all/utils.rb +62 -0
  579. data/tmpsets/set/mod002-core/all/view_cache.rb +16 -0
  580. data/tmpsets/set/mod003-history/all/actions.rb +60 -0
  581. data/tmpsets/set/mod003-history/all/content_history.rb +168 -0
  582. data/tmpsets/set/mod003-history/all/history.rb +408 -0
  583. data/tmpsets/set/mod004-basic_formats/all/all_css.rb +45 -0
  584. data/tmpsets/set/mod004-basic_formats/all/all_csv.rb +56 -0
  585. data/tmpsets/set/mod004-basic_formats/all/all_js.rb +13 -0
  586. data/tmpsets/set/mod004-basic_formats/all/base.rb +155 -0
  587. data/tmpsets/set/mod004-basic_formats/all/file.rb +16 -0
  588. data/tmpsets/set/mod004-basic_formats/all/json.rb +76 -0
  589. data/tmpsets/set/mod004-basic_formats/all/rss.rb +77 -0
  590. data/tmpsets/set/mod004-basic_formats/all/text.rb +13 -0
  591. data/tmpsets/set/mod004-basic_formats/self/01_head/javascript.rb +79 -0
  592. data/tmpsets/set/mod004-basic_formats/self/head.rb +101 -0
  593. data/tmpsets/set/mod005-pointer/abstract/01_pointer.rb +193 -0
  594. data/tmpsets/set/mod005-pointer/abstract/01_pointer/edit.rb +224 -0
  595. data/tmpsets/set/mod005-pointer/abstract/code_pointer.rb +16 -0
  596. data/tmpsets/set/mod005-pointer/self/script_editors.rb +8 -0
  597. data/tmpsets/set/mod005-pointer/self/script_mods.rb +8 -0
  598. data/tmpsets/set/mod005-pointer/self/script_pointer_config.rb +10 -0
  599. data/tmpsets/set/mod005-pointer/type/pointer.rb +8 -0
  600. data/tmpsets/set/mod006-ace_editor/abstract/ace_editor.rb +18 -0
  601. data/tmpsets/set/mod006-ace_editor/self/script_ace.rb +10 -0
  602. data/tmpsets/set/mod006-ace_editor/self/script_ace_config.rb +12 -0
  603. data/tmpsets/set/mod007-prosemirror_editor/abstract/prosemirror_editor.rb +14 -0
  604. data/tmpsets/set/mod007-prosemirror_editor/self/script_prosemirror.rb +10 -0
  605. data/tmpsets/set/mod007-prosemirror_editor/self/script_prosemirror_config.rb +13 -0
  606. data/tmpsets/set/mod009-solid_cache/abstract/solid_cache.rb +106 -0
  607. data/tmpsets/set/mod009-solid_cache/all/solid_cache.rb +21 -0
  608. data/tmpsets/set/mod009-solid_cache/right/solid_cache.rb +39 -0
  609. data/tmpsets/set/mod010-basic_types/type/html.rb +26 -0
  610. data/tmpsets/set/mod010-basic_types/type/plain_text.rb +19 -0
  611. data/tmpsets/set/mod011-machines/abstract/machine.rb +277 -0
  612. data/tmpsets/set/mod011-machines/abstract/machine_input.rb +83 -0
  613. data/tmpsets/set/mod011-machines/abstract/script.rb +49 -0
  614. data/tmpsets/set/mod011-machines/all/reset_machines.rb +19 -0
  615. data/tmpsets/set/mod011-machines/right/machine_cache.rb +18 -0
  616. data/tmpsets/set/mod011-machines/right/machine_input.rb +10 -0
  617. data/tmpsets/set/mod011-machines/right/machine_output.rb +47 -0
  618. data/tmpsets/set/mod011-machines/self/script_card_menu.rb +8 -0
  619. data/tmpsets/set/mod011-machines/self/script_html5shiv_printshiv.rb +8 -0
  620. data/tmpsets/set/mod011-machines/self/script_jquery.rb +8 -0
  621. data/tmpsets/set/mod011-machines/self/script_jquery_helper.rb +16 -0
  622. data/tmpsets/set/mod011-machines/self/script_slot.rb +14 -0
  623. data/tmpsets/set/mod011-machines/self/style_bootstrap_compatible.rb +8 -0
  624. data/tmpsets/set/mod011-machines/self/style_cards.rb +8 -0
  625. data/tmpsets/set/mod011-machines/self/style_jquery_ui_smoothness.rb +8 -0
  626. data/tmpsets/set/mod011-machines/type/coffee_script.rb +43 -0
  627. data/tmpsets/set/mod011-machines/type/css.rb +67 -0
  628. data/tmpsets/set/mod011-machines/type/java_script.rb +36 -0
  629. data/tmpsets/set/mod011-machines/type/scss.rb +21 -0
  630. data/tmpsets/set/mod011-machines/type/skin.rb +13 -0
  631. data/tmpsets/set/mod012-settings/abstract/permission.rb +119 -0
  632. data/tmpsets/set/mod012-settings/right/add_help.rb +18 -0
  633. data/tmpsets/set/mod012-settings/right/comment.rb +8 -0
  634. data/tmpsets/set/mod012-settings/right/create.rb +8 -0
  635. data/tmpsets/set/mod012-settings/right/default.rb +14 -0
  636. data/tmpsets/set/mod012-settings/right/delete.rb +8 -0
  637. data/tmpsets/set/mod012-settings/right/help.rb +10 -0
  638. data/tmpsets/set/mod012-settings/right/read.rb +10 -0
  639. data/tmpsets/set/mod012-settings/right/script.rb +16 -0
  640. data/tmpsets/set/mod012-settings/right/structure.rb +68 -0
  641. data/tmpsets/set/mod012-settings/right/style.rb +17 -0
  642. data/tmpsets/set/mod012-settings/right/update.rb +8 -0
  643. data/tmpsets/set/mod012-settings/self/accountable.rb +10 -0
  644. data/tmpsets/set/mod012-settings/self/add_help.rb +9 -0
  645. data/tmpsets/set/mod012-settings/self/autoname.rb +9 -0
  646. data/tmpsets/set/mod012-settings/self/captcha.rb +9 -0
  647. data/tmpsets/set/mod012-settings/self/create.rb +9 -0
  648. data/tmpsets/set/mod012-settings/self/default.rb +9 -0
  649. data/tmpsets/set/mod012-settings/self/default_html_view.rb +9 -0
  650. data/tmpsets/set/mod012-settings/self/delete.rb +9 -0
  651. data/tmpsets/set/mod012-settings/self/follow_fields.rb +9 -0
  652. data/tmpsets/set/mod012-settings/self/help.rb +9 -0
  653. data/tmpsets/set/mod012-settings/self/input.rb +11 -0
  654. data/tmpsets/set/mod012-settings/self/layout.rb +9 -0
  655. data/tmpsets/set/mod012-settings/self/on_create.rb +9 -0
  656. data/tmpsets/set/mod012-settings/self/on_delete.rb +9 -0
  657. data/tmpsets/set/mod012-settings/self/on_update.rb +9 -0
  658. data/tmpsets/set/mod012-settings/self/options.rb +11 -0
  659. data/tmpsets/set/mod012-settings/self/options_label.rb +11 -0
  660. data/tmpsets/set/mod012-settings/self/read.rb +9 -0
  661. data/tmpsets/set/mod012-settings/self/recent_settings.rb +10 -0
  662. data/tmpsets/set/mod012-settings/self/script.rb +9 -0
  663. data/tmpsets/set/mod012-settings/self/structure.rb +9 -0
  664. data/tmpsets/set/mod012-settings/self/style.rb +9 -0
  665. data/tmpsets/set/mod012-settings/self/table_of_contents.rb +9 -0
  666. data/tmpsets/set/mod012-settings/self/thanks.rb +9 -0
  667. data/tmpsets/set/mod012-settings/self/update.rb +9 -0
  668. data/tmpsets/set/mod012-settings/type/setting.rb +111 -0
  669. data/tmpsets/set/mod013-email/all/email_html.rb +11 -0
  670. data/tmpsets/set/mod013-email/all/email_text.rb +12 -0
  671. data/tmpsets/set/mod013-email/all/follow.rb +253 -0
  672. data/tmpsets/set/mod013-email/all/notify.rb +271 -0
  673. data/tmpsets/set/mod013-email/all/observer.rb +33 -0
  674. data/tmpsets/set/mod013-email/right/bcc.rb +47 -0
  675. data/tmpsets/set/mod013-email/right/cc.rb +10 -0
  676. data/tmpsets/set/mod013-email/right/follow.rb +106 -0
  677. data/tmpsets/set/mod013-email/right/follow_fields.rb +10 -0
  678. data/tmpsets/set/mod013-email/right/followers.rb +41 -0
  679. data/tmpsets/set/mod013-email/right/following.rb +65 -0
  680. data/tmpsets/set/mod013-email/right/from.rb +10 -0
  681. data/tmpsets/set/mod013-email/right/html_message.rb +10 -0
  682. data/tmpsets/set/mod013-email/right/to.rb +10 -0
  683. data/tmpsets/set/mod013-email/self/always.rb +20 -0
  684. data/tmpsets/set/mod013-email/self/created.rb +26 -0
  685. data/tmpsets/set/mod013-email/self/edited.rb +27 -0
  686. data/tmpsets/set/mod013-email/self/follow.rb +9 -0
  687. data/tmpsets/set/mod013-email/self/follow_defaults.rb +75 -0
  688. data/tmpsets/set/mod013-email/self/never.rb +20 -0
  689. data/tmpsets/set/mod013-email/type/email_template.rb +133 -0
  690. data/tmpsets/set/mod013-email/type_plus_right/user/follow.rb +180 -0
  691. data/tmpsets/set/mod014-developer/all/event_viz.rb +59 -0
  692. data/tmpsets/set/mod014-developer/all/view_viz.rb +30 -0
  693. data/tmpsets/set/mod014-developer/right/debug.rb +96 -0
  694. data/tmpsets/set/mod015-carrierwave/abstract/attachment.rb +118 -0
  695. data/tmpsets/set/mod015-carrierwave/abstract/attachment/paths.rb +57 -0
  696. data/tmpsets/set/mod015-carrierwave/abstract/attachment/storage_type.rb +326 -0
  697. data/tmpsets/set/mod015-carrierwave/abstract/attachment/upload_cache.rb +84 -0
  698. data/tmpsets/set/mod015-carrierwave/all/file_utils.rb +35 -0
  699. data/tmpsets/set/mod015-carrierwave/self/admin.rb +30 -0
  700. data/tmpsets/set/mod015-carrierwave/type/file.rb +158 -0
  701. data/tmpsets/set/mod015-carrierwave/type/image.rb +97 -0
  702. data/tmpsets/set/mod016-standard/all/comment.rb +67 -0
  703. data/tmpsets/set/mod016-standard/all/error.rb +229 -0
  704. data/tmpsets/set/mod016-standard/all/links.rb +165 -0
  705. data/tmpsets/set/mod016-standard/all/list_changes.rb +53 -0
  706. data/tmpsets/set/mod016-standard/all/rich_html/content.rb +261 -0
  707. data/tmpsets/set/mod016-standard/all/rich_html/editing.rb +247 -0
  708. data/tmpsets/set/mod016-standard/all/rich_html/form.rb +298 -0
  709. data/tmpsets/set/mod016-standard/all/rich_html/header.rb +78 -0
  710. data/tmpsets/set/mod016-standard/all/rich_html/menu.rb +154 -0
  711. data/tmpsets/set/mod016-standard/all/rich_html/modal.rb +58 -0
  712. data/tmpsets/set/mod016-standard/all/rich_html/toolbar.rb +312 -0
  713. data/tmpsets/set/mod016-standard/all/rich_html/wrapper.rb +191 -0
  714. data/tmpsets/set/mod016-standard/right/discussion.rb +10 -0
  715. data/tmpsets/set/mod016-standard/right/when_created.rb +14 -0
  716. data/tmpsets/set/mod016-standard/right/when_last_edited.rb +14 -0
  717. data/tmpsets/set/mod016-standard/rstar/rules.rb +107 -0
  718. data/tmpsets/set/mod016-standard/rstar/rules_editor.rb +371 -0
  719. data/tmpsets/set/mod016-standard/self/alerts.rb +12 -0
  720. data/tmpsets/set/mod016-standard/self/codenames.rb +7 -0
  721. data/tmpsets/set/mod016-standard/self/foot.rb +15 -0
  722. data/tmpsets/set/mod016-standard/self/navbox.rb +36 -0
  723. data/tmpsets/set/mod016-standard/self/now.rb +14 -0
  724. data/tmpsets/set/mod016-standard/self/recent.rb +34 -0
  725. data/tmpsets/set/mod016-standard/self/search.rb +71 -0
  726. data/tmpsets/set/mod016-standard/type/basic.rb +59 -0
  727. data/tmpsets/set/mod016-standard/type/cardtype.rb +81 -0
  728. data/tmpsets/set/mod016-standard/type/date.rb +15 -0
  729. data/tmpsets/set/mod016-standard/type/layout_type.rb +17 -0
  730. data/tmpsets/set/mod016-standard/type/list.rb +120 -0
  731. data/tmpsets/set/mod016-standard/type/listed_by.rb +85 -0
  732. data/tmpsets/set/mod016-standard/type/number.rb +25 -0
  733. data/tmpsets/set/mod016-standard/type/phrase.rb +10 -0
  734. data/tmpsets/set/mod016-standard/type/search_type.rb +339 -0
  735. data/tmpsets/set/mod016-standard/type/session.rb +42 -0
  736. data/tmpsets/set/mod016-standard/type/set.rb +371 -0
  737. data/tmpsets/set/mod016-standard/type/toggle.rb +19 -0
  738. data/tmpsets/set/mod016-standard/type/uri.rb +18 -0
  739. data/tmpsets/set/mod017-account/all/account.rb +72 -0
  740. data/tmpsets/set/mod017-account/right/account.rb +196 -0
  741. data/tmpsets/set/mod017-account/right/email.rb +61 -0
  742. data/tmpsets/set/mod017-account/right/password.rb +54 -0
  743. data/tmpsets/set/mod017-account/right/salt.rb +12 -0
  744. data/tmpsets/set/mod017-account/right/status.rb +16 -0
  745. data/tmpsets/set/mod017-account/right/token.rb +57 -0
  746. data/tmpsets/set/mod017-account/self/account_links.rb +72 -0
  747. data/tmpsets/set/mod017-account/self/signin.rb +165 -0
  748. data/tmpsets/set/mod017-account/type/signup.rb +175 -0
  749. data/tmpsets/set/mod017-account/type/user.rb +88 -0
  750. data/tmpsets/set/mod018-bootstrap/all/bootstrap/form.rb +42 -0
  751. data/tmpsets/set/mod018-bootstrap/all/bootstrap/helper.rb +236 -0
  752. data/tmpsets/set/mod018-bootstrap/all/bootstrap/table.rb +68 -0
  753. data/tmpsets/set/mod018-bootstrap/all/bootstrap/tabs.rb +88 -0
  754. data/tmpsets/set/mod018-bootstrap/all/bootstrap/wrapper.rb +18 -0
  755. data/tmpsets/set/mod018-bootstrap/all/rich_bootstrap.rb +13 -0
  756. data/tmpsets/set/mod018-bootstrap/self/bootstrap_cards.rb +8 -0
  757. data/tmpsets/set/mod018-bootstrap/self/bootstrap_js.rb +12 -0
  758. data/tmpsets/set/mod018-bootstrap/self/bootswatch_shared.rb +47 -0
  759. data/tmpsets/set/mod018-bootstrap/self/script_mods.rb +7 -0
  760. data/tmpsets/set/mod018-bootstrap/self/smartmenu_css.rb +12 -0
  761. data/tmpsets/set/mod018-bootstrap/self/smartmenu_js.rb +12 -0
  762. data/tmpsets/set_pattern/100-all.rb +24 -0
  763. data/tmpsets/set_pattern/101-all_plus.rb +26 -0
  764. data/tmpsets/set_pattern/102-type.rb +36 -0
  765. data/tmpsets/set_pattern/103-star.rb +28 -0
  766. data/tmpsets/set_pattern/104-rstar.rb +30 -0
  767. data/tmpsets/set_pattern/105-right.rb +33 -0
  768. data/tmpsets/set_pattern/106-type_plus_right.rb +39 -0
  769. data/tmpsets/set_pattern/107-self.rb +32 -0
  770. metadata +494 -167
  771. data/README_Developers.rdoc +0 -100
  772. data/lib/card/format/names.rb +0 -43
  773. data/lib/card/format/nest/view.rb +0 -65
  774. data/lib/card/view/fetch.rb +0 -121
  775. data/mod/core/spec/set/all/attribute_tracking_spec.rb +0 -21
  776. data/spec/models/card/cardtype_spec.rb +0 -189
  777. data/spec/models/card/type_transition_spec.rb +0 -132
  778. data/spec/models/card/validation_spec.rb +0 -34
  779. data/spec/support/matchers.rb +0 -74
@@ -27,7 +27,7 @@ class Card
27
27
  bs_layout container: true, fluid: true do
28
28
  row do
29
29
  html <<-HTML
30
- <ul class="action-list">
30
+ <ul class="action-list w-100">
31
31
  <li class="glyphicon-bullet #{action.action_type}">
32
32
  #{action_panel}
33
33
  </li>
@@ -81,11 +81,11 @@ class Card
81
81
  end
82
82
 
83
83
  def old_name
84
- (name = @action.previous_value :name) && showname(name).to_s
84
+ (name = @action.previous_value :name) && title_in_context(name)
85
85
  end
86
86
 
87
87
  def new_name
88
- showname(@action.value(:name)).to_s
88
+ title_in_context @action.value(:name)
89
89
  end
90
90
  end
91
91
  end
@@ -22,9 +22,26 @@ class Card
22
22
  # permanently delete all {Action actions} associate with non-current
23
23
  # {Change changes}
24
24
  def delete_old
25
+ Card::Change.delete_all
25
26
  Card.find_each(&:delete_old_actions)
26
27
  Card::Act.delete_actionless
27
28
  end
29
+
30
+ # If an act is given then all remaining actions will be attached to that act.
31
+ # Otherwise the actions keep their acts.
32
+ def make_current_state_the_initial_state act=nil
33
+ Card::Change.delete_all
34
+ Card.find_each(&:delete_old_actions)
35
+ action_update = { action_type: Card::Action::TYPE_OPTIONS.index(:create) }
36
+ action_update[:card_act_id] = act.id if act
37
+ Card::Action.update_all action_update
38
+
39
+ if act
40
+ Card::Act.where("id != :id", id: act.id).delete_all
41
+ else
42
+ Card::Act.delete_actionless
43
+ end
44
+ end
28
45
  end
29
46
  end
30
47
  end
@@ -15,7 +15,7 @@ class Card
15
15
  # * the new _value_ of that field
16
16
  # * the {Action action} of which the change is part
17
17
  #
18
- class Change < ActiveRecord::Base
18
+ class Change < ApplicationRecord
19
19
  belongs_to :action, foreign_key: :card_action_id,
20
20
  inverse_of: :card_changes
21
21
 
@@ -11,20 +11,27 @@ format :html do
11
11
  end
12
12
 
13
13
  view :act_list, cache: :never do |args|
14
- acts = args.delete :acts
14
+ act_accordion args.delete(:acts) do |act, act_seq|
15
+ render_act args.merge(act: act, act_seq: act_seq)
16
+ end
17
+ end
18
+
19
+ def act_accordion acts
15
20
  page = params["page"] || 1
16
21
  count = acts.size + 1 - (page.to_i - 1) * ACTS_PER_PAGE
17
- accordion_group(acts.map do |act|
18
- if (act_card = act.card)
22
+ rendered_acts =
23
+ acts.map do |act|
24
+ unless act.card
25
+ Rails.logger.info "bad data, act: #{act}"
26
+ next
27
+ end
19
28
  count -= 1
20
- act_card.format(:html).render_act args.merge(act: act, act_seq: count)
21
- else
22
- Rails.logger.info "bad data, act: #{act}"
23
- ""
24
- end
25
- end, nil, class: "clear-both")
29
+ yield act, count
30
+ end.compact
31
+ accordion_group rendered_acts, nil, class: "clear-both"
26
32
  end
27
33
 
34
+
28
35
  view :act, cache: :never do |args|
29
36
  act_renderer(args[:act_context]).new(self, args[:act], args).render
30
37
  end
@@ -40,14 +40,40 @@ def revision action
40
40
  end
41
41
  end
42
42
 
43
+ # Delete all changes and old actions and make the last action the create action
44
+ # (that way the changes for that action will be created with the first update)
45
+ def make_last_action_the_initial_action
46
+ delete_all_changes
47
+ old_actions.delete_all
48
+ last_action.update_attributes! action_type: :create
49
+ end
50
+
51
+ # # moves for every field the last change to the last action and deletes all other actions
52
+ # def clear_history
53
+ # Card::Change::TRACKED_FIELDS.each do |field|
54
+ # # assign previous changes on each tracked field to the last action
55
+ # next unless (la = last_action) && !la.change(field).present? &&
56
+ # (last_change = last_change_on field)
57
+ # # last_change comes as readonly record
58
+ # last_change = Card::Change.find(last_change.id)
59
+ # last_change.update_attributes!(card_action_id: last_action_id)
60
+ # end
61
+ # delete_old_action
62
+ # end
63
+
64
+ def clear_history
65
+ delete_all_changes
66
+ delete_old_actions
67
+ end
68
+
43
69
  def delete_old_actions
44
- Card::Change::TRACKED_FIELDS.each do |field|
45
- # assign previous changes on each tracked field to the last action
46
- next unless (la = last_action) && !la.change(field).present? &&
47
- (last_change = last_change_on field)
48
- # last_change comes as readonly record
49
- last_change = Card::Change.find(last_change.id)
50
- last_change.update_attributes!(card_action_id: last_action_id)
51
- end
52
- actions.where("id != ?", last_action_id).delete_all
70
+ old_actions.delete_all
71
+ end
72
+
73
+ def delete_all_changes
74
+ Card::Change.where(card_action_id: Card::Action.where(card_id: id).pluck(:id)).delete_all
75
+ end
76
+
77
+ def old_actions
78
+ actions.where("id != ?", last_action_id)
53
79
  end
@@ -28,12 +28,23 @@ def save_content_draft content
28
28
  end
29
29
 
30
30
  def last_change_on field, opts={}
31
- Change.joins(:action).where(
32
- last_change_sql_conditions(opts),
33
- card_id: id,
34
- action_id: extract_action_id(opts[:before] || opts[:not_after]),
35
- field: Card::Change.field_index(field)
36
- ).order(:id).last
31
+ action_id = extract_action_id(opts[:before] || opts[:not_after])
32
+
33
+ # If there is only one action then there are no entries in the changes table,
34
+ # so we can't do a sql search but the changes are accessible via the action.
35
+ if action_id == create_action.id
36
+ return if opts[:before] # there is no before the first action
37
+ create_action.change field
38
+ elsif !action_id && create_action.sole?
39
+ create_action.change field
40
+ else
41
+ Change.joins(:action).where(
42
+ last_change_sql_conditions(opts),
43
+ card_id: id,
44
+ action_id: action_id,
45
+ field: Card::Change.field_index(field)
46
+ ).order(:id).last
47
+ end
37
48
  end
38
49
 
39
50
  def extract_action_id action_arg
@@ -87,11 +98,11 @@ def new_content_action_id
87
98
  end
88
99
 
89
100
  def current_action_changes_content?
90
- new_card? || @current_action.new_content? || db_content_changed?
101
+ new_card? || @current_action.new_content? || db_content_is_changing?
91
102
  end
92
103
 
93
104
  def last_action_id
94
- (la = last_action) && la.id
105
+ last_action&.id
95
106
  end
96
107
 
97
108
  def last_action
@@ -99,13 +110,11 @@ def last_action
99
110
  end
100
111
 
101
112
  def last_content_action
102
- l_c = last_change_on :db_content
103
- l_c && l_c.action
113
+ last_change_on(:db_content)&.action
104
114
  end
105
115
 
106
116
  def last_content_action_id
107
- l_c = last_change_on :db_content
108
- l_c && l_c.card_action_id
117
+ last_change_on(:db_content)&.card_action_id
109
118
  end
110
119
 
111
120
  def last_actor
@@ -159,8 +168,7 @@ def draft_acts
159
168
  drafts.created_by(Card::Auth.current_id).map(&:act)
160
169
  end
161
170
 
162
- event :detect_conflict, :validate, on: :update,
163
- when: proc { |c| c.edit_conflict? } do
171
+ event :detect_conflict, :validate, on: :update, when: :edit_conflict? do
164
172
  errors.add :conflict, "changes not based on latest revision"
165
173
  end
166
174
 
@@ -8,7 +8,7 @@ end
8
8
  # :validate_delete_children
9
9
 
10
10
  def actionable?
11
- history? || respond_to?(:attachment)
11
+ history?
12
12
  end
13
13
 
14
14
  event :assign_action, :initialize, when: proc { |c| c.actionable? } do
@@ -26,23 +26,50 @@ end
26
26
  # stores changes in the changes table and assigns them to the current action
27
27
  # removes the action if there are no changes
28
28
  event :finalize_action, :finalize, when: :finalize_action? do
29
- @changed_fields = Card::Change::TRACKED_FIELDS.select do |f|
30
- changed_attributes.member? f
31
- end
32
- if @changed_fields.present?
33
- # FIXME: should be one bulk insert
34
- @changed_fields.each do |f|
35
- Card::Change.create field: f,
36
- value: self[f],
37
- card_action_id: @current_action.id
38
- end
29
+ if changed_fields.present?
39
30
  @current_action.update_attributes! card_id: id
40
- elsif @current_action.card_changes(true).empty?
31
+
32
+ # Note: #last_change_on uses the id to sort by date
33
+ # so the changes for the create changes have to be created befire the first change
34
+ store_card_changes_for_create_action if first_change?
35
+ store_card_changes if @current_action.action_type != :create
36
+ elsif @current_action.card_changes.reload.empty?
41
37
  @current_action.delete
42
38
  @current_action = nil
43
39
  end
44
40
  end
45
41
 
42
+ def first_change? # = update or delete
43
+ @current_action.action_type != :create && @current_action.card.actions.size == 2 &&
44
+ create_action.card_changes.empty?
45
+ end
46
+
47
+ def create_action
48
+ @create_action ||= actions.first
49
+ end
50
+
51
+ # changes for the create action are stored after the first update
52
+ def store_card_changes_for_create_action
53
+ Card::Change::TRACKED_FIELDS.each do |f|
54
+ Card::Change.create field: f,
55
+ value: attribute_before_act(f),
56
+ card_action_id: create_action.id
57
+ end
58
+ end
59
+
60
+ def store_card_changes
61
+ # FIXME: should be one bulk insert
62
+ changed_fields.each do |f|
63
+ Card::Change.create field: f,
64
+ value: self[f],
65
+ card_action_id: @current_action.id
66
+ end
67
+ end
68
+
69
+ def changed_fields
70
+ Card::Change::TRACKED_FIELDS & (changed_attribute_names_to_save | saved_changes.keys)
71
+ end
72
+
46
73
  def finalize_action?
47
74
  actionable? && current_action
48
75
  end
@@ -51,7 +78,7 @@ event :finalize_act,
51
78
  after: :finalize_action,
52
79
  when: proc { |c| c.act_card? } do
53
80
  # removed subcards can leave behind actions without card id
54
- if @current_act.actions(true).empty?
81
+ if @current_act.actions.reload.empty?
55
82
  @current_act.delete
56
83
  @current_act = nil
57
84
  else
@@ -66,9 +93,7 @@ end
66
93
  event :rollback_actions,
67
94
  :prepare_to_validate, on: :update, when: :rollback_request? do
68
95
  revision = { subcards: {} }
69
- rollback_actions = Env.params["action_ids"].map do |a_id|
70
- Action.fetch(a_id) || nil
71
- end
96
+
72
97
  rollback_actions.each do |action|
73
98
  if action.card_id == id
74
99
  revision.merge!(revision(action))
@@ -82,9 +107,17 @@ event :rollback_actions,
82
107
  abort :success
83
108
  end
84
109
 
110
+ def rollback_actions
111
+ actions =
112
+ Env.params["revert_actions"].map do |a_id|
113
+ Action.fetch(a_id) || nil
114
+ end.compact
115
+ actions.map! { |a| a.previous_action } if Env.params["revert_to"] == "previous"
116
+ actions.compact
117
+ end
118
+
85
119
  def rollback_request?
86
- history? && Env && Env.params["action_ids"] &&
87
- Env.params["action_ids"].class == Array
120
+ history? && Env&.params["revert_actions"]&.class == Array
88
121
  end
89
122
 
90
123
  # all acts with actions on self and on cards that are descendants of self and
@@ -163,7 +196,7 @@ format :html do
163
196
  intrusive_acts = card.intrusive_acts
164
197
  .page(page_from_params).per(ACTS_PER_PAGE)
165
198
  wrap_with :span, class: "slotter" do
166
- paginate intrusive_acts, remote: true, theme: "twitter-bootstrap-3"
199
+ paginate intrusive_acts, remote: true, theme: "twitter-bootstrap-4"
167
200
  end
168
201
  end
169
202
 
@@ -4,9 +4,9 @@
4
4
  !T.relative[s=a.type]);)if((l=T.find[s])&&(r=l(a.matches[0].replace(we,Te),be.test(o[0].type)&&c(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&f(o)))return K.apply(n,r),n;break}}return(u||k(e,d))(r,t,!_,n,be.test(e)&&c(t.parentNode)||t),n},w.sortStable=P.split("").sort(U).join("")===P,w.detectDuplicates=!!j,L(),w.sortDetached=i(function(e){return 1&e.compareDocumentPosition(H.createElement("div"))}),i(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),w.attributes&&i(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,n){var r;return n?void 0:!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(e);ie.find=ue,ie.expr=ue.selectors,ie.expr[":"]=ie.expr.pseudos,ie.unique=ue.uniqueSort,ie.text=ue.getText,ie.isXMLDoc=ue.isXML,ie.contains=ue.contains;var ce=ie.expr.match.needsContext,de=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,fe=/^.[^:#\[\.,]*$/;ie.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?ie.find.matchesSelector(r,e)?[r]:[]:ie.find.matches(e,ie.grep(t,function(e){return 1===e.nodeType}))},ie.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(ie(e).filter(function(){for(t=0;i>t;t++)if(ie.contains(r[t],this))return!0}));for(t=0;i>t;t++)ie.find(e,r[t],n);return n=this.pushStack(i>1?ie.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(r(this,e||[],!1))},not:function(e){return this.pushStack(r(this,e||[],!0))},is:function(e){return!!r(this,"string"==typeof e&&ce.test(e)?ie(e):e||[],!1).length}});var pe,he=e.document,me=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(ie.fn.init=function(e,t){var n,r;if(!e)return this;if("string"==typeof e){if(!(n="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:me.exec(e))||!n[1]&&t)return!t||t.jquery?(t||pe).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof ie?t[0]:t,ie.merge(this,ie.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:he,!0)),de.test(n[1])&&ie.isPlainObject(t))for(n in t)ie.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}if((r=he.getElementById(n[2]))&&r.parentNode){if(r.id!==n[2])return pe.find(e);this.length=1,this[0]=r}return this.context=he,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):ie.isFunction(e)?"undefined"!=typeof pe.ready?pe.ready(e):e(ie):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),ie.makeArray(e,this))}).prototype=ie.fn,pe=ie(he);var ge=/^(?:parents|prev(?:Until|All))/,ve={children:!0,contents:!0,next:!0,prev:!0};ie.extend({dir:function(e,t,n){for(var r=[],i=e[t];i&&9!==i.nodeType&&(void 0===n||1!==i.nodeType||!ie(i).is(n));)1===i.nodeType&&r.push(i),i=i[t];return r},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}}),ie.fn.extend({has:function(e){var t,n=ie(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(ie.contains(this,n[t]))return!0})},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=ce.test(e)||"string"!=typeof e?ie(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&ie.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?ie.unique(o):o)},index:function(e){return e?"string"==typeof e?ie.inArray(this[0],ie(e)):ie.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(ie.unique(ie.merge(this.get(),ie(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),ie.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return ie.dir(e,"parentNode")},parentsUntil:function(e,t,n){return ie.dir(e,"parentNode",n)},next:function(e){return i(e,"nextSibling")},prev:function(e){return i(e,"previousSibling")},nextAll:function(e){return ie.dir(e,"nextSibling")},prevAll:function(e){return ie.dir(e,"previousSibling")},nextUntil:function(e,t,n){return ie.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return ie.dir(e,"previousSibling",n)},siblings:function(e){return ie.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return ie.sibling(e.firstChild)},contents:function(e){return ie.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:ie.merge([],e.childNodes)}},function(e,t){ie.fn[e]=function(n,r){var i=ie.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=ie.filter(r,i)),this.length>1&&(ve[e]||(i=ie.unique(i)),ge.test(e)&&(i=i.reverse())),this.pushStack(i)}});var ye=/\S+/g,be={};ie.Callbacks=function(e){e="string"==typeof e?be[e]||o(e):ie.extend({},e);var t,n,r,i,a,s,l=[],u=!e.once&&[],c=function(o){for(n=e.memory&&o,r=!0,a=s||0,s=0,i=l.length,t=!0;l&&i>a;a++)if(!1===l[a].apply(o[0],o[1])&&e.stopOnFalse){n=!1;break}t=!1,l&&(u?u.length&&c(u.shift()):n?l=[]:d.disable())},d={add:function(){if(l){var r=l.length;!function t(n){ie.each(n,function(n,r){var i=ie.type(r);"function"===i?e.unique&&d.has(r)||l.push(r):r&&r.length&&"string"!==i&&t(r)})}(arguments),t?i=l.length:n&&(s=r,c(n))}return this},remove:function(){return l&&ie.each(arguments,function(e,n){for(var r;(r=ie.inArray(n,l,r))>-1;)l.splice(r,1),t&&(i>=r&&i--,a>=r&&a--)}),this},has:function(e){return e?ie.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],i=0,this},disable:function(){return l=u=n=void 0,this},disabled:function(){return!l},lock:function(){return u=void 0,n||d.disable(),this},locked:function(){return!u},fireWith:function(e,n){return!l||r&&!u||(n=n||[],n=[e,n.slice?n.slice():n],t?u.push(n):c(n)),this},fire:function(){return d.fireWith(this,arguments),this},fired:function(){return!!r}};return d},ie.extend({Deferred:function(e){var t=[["resolve","done",ie.Callbacks("once memory"),"resolved"],["reject","fail",ie.Callbacks("once memory"),"rejected"],["notify","progress",ie.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return ie.Deferred(function(n){ie.each(t,function(t,o){var a=ie.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&ie.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o[0]+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?ie.extend(e,r):r}},i={};return r.pipe=r.then,ie.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=Y.call(arguments),a=o.length,s=1!==a||e&&ie.isFunction(e.promise)?a:0,l=1===s?e:ie.Deferred(),u=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?Y.call(arguments):i,r===t?l.notifyWith(n,r):--s||l.resolveWith(n,r)}};if(a>1)for(t=new Array(a),n=new Array(a),r=new Array(a);a>i;i++)o[i]&&ie.isFunction(o[i].promise)?o[i].promise().done(u(i,r,o)).fail(l.reject).progress(u(i,n,t)):--s;return s||l.resolveWith(r,o),l.promise()}});var xe;ie.fn.ready=function(e){return ie.ready.promise().done(e),this},ie.extend({isReady:!1,readyWait:1,holdReady:function(e){e?ie.readyWait++:ie.ready(!0)},ready:function(e){if(!0===e?!--ie.readyWait:!ie.isReady){if(!he.body)return setTimeout(ie.ready);ie.isReady=!0,!0!==e&&--ie.readyWait>0||(xe.resolveWith(he,[ie]),ie.fn.triggerHandler&&(ie(he).triggerHandler("ready"),ie(he).off("ready")))}}}),ie.ready.promise=function(t){if(!xe)if(xe=ie.Deferred(),"complete"===he.readyState)setTimeout(ie.ready);else if(he.addEventListener)he.addEventListener("DOMContentLoaded",s,!1),e.addEventListener("load",s,!1);else{he.attachEvent("onreadystatechange",s),e.attachEvent("onload",s);var n=!1;try{n=null==e.frameElement&&he.documentElement}catch(e){}n&&n.doScroll&&function e(){if(!ie.isReady){try{n.doScroll("left")}catch(t){return setTimeout(e,50)}a(),ie.ready()}}()}return xe.promise(t)};var we,Te="undefined";for(we in ie(ne))break;ne.ownLast="0"!==we,ne.inlineBlockNeedsLayout=!1,ie(function(){var e,t,n,r;(n=he.getElementsByTagName("body")[0])&&n.style&&(t=he.createElement("div"),r=he.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),typeof t.style.zoom!==Te&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",ne.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(r))}),function(){var e=he.createElement("div");if(null==ne.deleteExpando){ne.deleteExpando=!0;try{delete e.test}catch(e){ne.deleteExpando=!1}}e=null}(),ie.acceptData=function(e){var t=ie.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return(1===n||9===n)&&(!t||!0!==t&&e.getAttribute("classid")===t)};var Ce=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Ne=/([A-Z])/g;ie.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return!!(e=e.nodeType?ie.cache[e[ie.expando]]:e[ie.expando])&&!u(e)},data:function(e,t,n){return c(e,t,n)},removeData:function(e,t){return d(e,t)},_data:function(e,t,n){return c(e,t,n,!0)},_removeData:function(e,t){return d(e,t,!0)}}),ie.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=ie.data(o),1===o.nodeType&&!ie._data(o,"parsedAttrs"))){for(n=a.length;n--;)a[n]&&(r=a[n].name,0===r.indexOf("data-")&&(r=ie.camelCase(r.slice(5)),l(o,r,i[r])));ie._data(o,"parsedAttrs",!0)}return i}return"object"==typeof e?this.each(function(){ie.data(this,e)}):arguments.length>1?this.each(function(){ie.data(this,e,t)}):o?l(o,e,ie.data(o,e)):void 0},removeData:function(e){return this.each(function(){ie.removeData(this,e)})}}),ie.extend({queue:function(e,t,n){var r;return e?(t=(t||"fx")+"queue",r=ie._data(e,t),n&&(!r||ie.isArray(n)?r=ie._data(e,t,ie.makeArray(n)):r.push(n)),r||[]):void 0},dequeue:function(e,t){t=t||"fx";var n=ie.queue(e,t),r=n.length,i=n.shift(),o=ie._queueHooks(e,t),a=function(){ie.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return ie._data(e,n)||ie._data(e,n,{empty:ie.Callbacks("once memory").add(function(){ie._removeData(e,t+"queue"),ie._removeData(e,n)})})}}),ie.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?ie.queue(this[0],e):void 0===t?this:this.each(function(){var n=ie.queue(this,e,t);ie._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&ie.dequeue(this,e)})},dequeue:function(e){return this.each(function(){ie.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=ie.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=ie._data(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var Ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ke=["Top","Right","Bottom","Left"],Se=function(e,t){return e=t||e,"none"===ie.css(e,"display")||!ie.contains(e.ownerDocument,e)},Ae=ie.access=function(e,t,n,r,i,o,a){var s=0,l=e.length,u=null==n;if("object"===ie.type(n)){i=!0;for(s in n)ie.access(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,ie.isFunction(r)||(a=!0),u&&(a?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(ie(e),n)})),t))for(;l>s;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:u?t.call(e):l?t(e[0],n):o},De=/^(?:checkbox|radio)$/i;!function(){var e=he.createElement("input"),t=he.createElement("div"),n=he.createDocumentFragment();if(t.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",ne.leadingWhitespace=3===t.firstChild.nodeType,ne.tbody=!t.getElementsByTagName("tbody").length,ne.htmlSerialize=!!t.getElementsByTagName("link").length,ne.html5Clone="<:nav></:nav>"!==he.createElement("nav").cloneNode(!0).outerHTML,e.type="checkbox",e.checked=!0,n.appendChild(e),ne.appendChecked=e.checked,t.innerHTML="<textarea>x</textarea>",ne.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue,n.appendChild(t),t.innerHTML="<input type='radio' checked='checked' name='t'/>",ne.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,ne.noCloneEvent=!0,t.attachEvent&&(t.attachEvent("onclick",function(){ne.noCloneEvent=!1}),t.cloneNode(!0).click()),null==ne.deleteExpando){ne.deleteExpando=!0;try{delete t.test}catch(e){ne.deleteExpando=!1}}}(),function(){var t,n,r=he.createElement("div");for(t in{submit:!0,change:!0,focusin:!0})n="on"+t,(ne[t+"Bubbles"]=n in e)||(r.setAttribute(n,"t"),ne[t+"Bubbles"]=!1===r.attributes[n].expando);r=null}();var je=/^(?:input|select|textarea)$/i,Le=/^key/,He=/^(?:mouse|pointer|contextmenu)|click/,qe=/^(?:focusinfocus|focusoutblur)$/,_e=/^([^.]*)(?:\.(.+)|)$/;ie.event={global:{},add:function(e,t,n,r,i){var o,a,s,l,u,c,d,f,p,h,m,g=ie._data(e);if(g){for(n.handler&&(l=n,n=l.handler,i=l.selector),n.guid||(n.guid=ie.guid++),(a=g.events)||(a=g.events={}),(c=g.handle)||(c=g.handle=function(e){return typeof ie===Te||e&&ie.event.triggered===e.type?void 0:ie.event.dispatch.apply(c.elem,arguments)},c.elem=e),t=(t||"").match(ye)||[""],s=t.length;s--;)o=_e.exec(t[s])||[],p=m=o[1],h=(o[2]||"").split(".").sort(),p&&(u=ie.event.special[p]||{},p=(i?u.delegateType:u.bindType)||p,u=ie.event.special[p]||{},d=ie.extend({type:p,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&ie.expr.match.needsContext.test(i),namespace:h.join(".")},l),(f=a[p])||(f=a[p]=[],f.delegateCount=0,u.setup&&!1!==u.setup.call(e,r,h,c)||(e.addEventListener?e.addEventListener(p,c,!1):e.attachEvent&&e.attachEvent("on"+p,c))),u.add&&(u.add.call(e,d),d.handler.guid||(d.handler.guid=n.guid)),i?f.splice(f.delegateCount++,0,d):f.push(d),ie.event.global[p]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,d,f,p,h,m,g=ie.hasData(e)&&ie._data(e);if(g&&(c=g.events)){for(t=(t||"").match(ye)||[""],u=t.length;u--;)if(s=_e.exec(t[u])||[],p=m=s[1],h=(s[2]||"").split(".").sort(),p){for(d=ie.event.special[p]||{},p=(r?d.delegateType:d.bindType)||p,f=c[p]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;o--;)a=f[o],!i&&m!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,d.remove&&d.remove.call(e,a));l&&!f.length&&(d.teardown&&!1!==d.teardown.call(e,h,g.handle)||ie.removeEvent(e,p,g.handle),delete c[p])}else for(p in c)ie.event.remove(e,p+t[u],n,r,!0);ie.isEmptyObject(c)&&(delete g.handle,ie._removeData(e,"events"))}},trigger:function(t,n,r,i){var o,a,s,l,u,c,d,f=[r||he],p=te.call(t,"type")?t.type:t,h=te.call(t,"namespace")?t.namespace.split("."):[];if(s=c=r=r||he,3!==r.nodeType&&8!==r.nodeType&&!qe.test(p+ie.event.triggered)&&(p.indexOf(".")>=0&&(h=p.split("."),p=h.shift(),h.sort()),a=p.indexOf(":")<0&&"on"+p,t=t[ie.expando]?t:new ie.Event(p,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=h.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:ie.makeArray(n,[t]),u=ie.event.special[p]||{},i||!u.trigger||!1!==u.trigger.apply(r,n))){if(!i&&!u.noBubble&&!ie.isWindow(r)){for(l=u.delegateType||p,qe.test(l+p)||(s=s.parentNode);s;s=s.parentNode)f.push(s),c=s;c===(r.ownerDocument||he)&&f.push(c.defaultView||c.parentWindow||e)}for(d=0;(s=f[d++])&&!t.isPropagationStopped();)t.type=d>1?l:u.bindType||p,o=(ie._data(s,"events")||{})[t.type]&&ie._data(s,"handle"),o&&o.apply(s,n),(o=a&&s[a])&&o.apply&&ie.acceptData(s)&&(t.result=o.apply(s,n),!1===t.result&&t.preventDefault());if(t.type=p,!i&&!t.isDefaultPrevented()&&(!u._default||!1===u._default.apply(f.pop(),n))&&ie.acceptData(r)&&a&&r[p]&&!ie.isWindow(r)){c=r[a],c&&(r[a]=null),ie.event.triggered=p;try{r[p]()}catch(e){}ie.event.triggered=void 0,c&&(r[a]=c)}return t.result}},dispatch:function(e){e=ie.event.fix(e);var t,n,r,i,o,a=[],s=Y.call(arguments),l=(ie._data(this,"events")||{})[e.type]||[],u=ie.event.special[e.type]||{};if(s[0]=e,e.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,e)){for(a=ie.event.handlers.call(this,e,l),t=0;(i=a[t++])&&!e.isPropagationStopped();)for(e.currentTarget=i.elem,o=0;(r=i.handlers[o++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(r.namespace))&&(e.handleObj=r,e.data=r.data,void 0!==(n=((ie.event.special[r.origType]||{}).handle||r.handler).apply(i.elem,s))&&!1===(e.result=n)&&(e.preventDefault(),e.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,a=[],s=t.delegateCount,l=e.target;if(s&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(!0!==l.disabled||"click"!==e.type)){for(i=[],o=0;s>o;o++)r=t[o],n=r.selector+" ",void 0===i[n]&&(i[n]=r.needsContext?ie(n,this).index(l)>=0:ie.find(n,this,null,[l]).length),i[n]&&i.push(r);i.length&&a.push({elem:l,handlers:i})}return s<t.length&&a.push({elem:this,handlers:t.slice(s)}),a},fix:function(e){if(e[ie.expando])return e;var t,n,r,i=e.type,o=e,a=this.fixHooks[i];for(a||(this.fixHooks[i]=a=He.test(i)?this.mouseHooks:Le.test(i)?this.keyHooks:{}),r=a.props?this.props.concat(a.props):this.props,e=new ie.Event(o),t=r.length;t--;)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||he),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,a.filter?a.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,o=t.button,a=t.fromElement;return null==e.pageX&&null!=t.clientX&&(r=e.target.ownerDocument||he,i=r.documentElement,n=r.body,e.pageX=t.clientX+(i&&i.scrollLeft||n&&n.scrollLeft||0)-(i&&i.clientLeft||n&&n.clientLeft||0),e.pageY=t.clientY+(i&&i.scrollTop||n&&n.scrollTop||0)-(i&&i.clientTop||n&&n.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?t.toElement:a),e.which||void 0===o||(e.which=1&o?1:2&o?3:4&o?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==h()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===h()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return ie.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(e){return ie.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=ie.extend(new ie.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?ie.event.trigger(i,null,t):ie.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},ie.removeEvent=he.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===Te&&(e[r]=null),e.detachEvent(r,n))},ie.Event=function(e,t){return this instanceof ie.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?f:p):this.type=e,t&&ie.extend(this,t),this.timeStamp=e&&e.timeStamp||ie.now(),void(this[ie.expando]=!0)):new ie.Event(e,t)},ie.Event.prototype={isDefaultPrevented:p,isPropagationStopped:p,isImmediatePropagationStopped:p,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=f,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=f,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=f,e&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.stopPropagation()}},ie.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){ie.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!ie.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),ne.submitBubbles||(ie.event.special.submit={setup:function(){return!ie.nodeName(this,"form")&&void ie.event.add(this,"click._submit keypress._submit",function(e){var t=e.target,n=ie.nodeName(t,"input")||ie.nodeName(t,"button")?t.form:void 0;n&&!ie._data(n,"submitBubbles")&&(ie.event.add(n,"submit._submit",function(e){e._submit_bubble=!0}),ie._data(n,"submitBubbles",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&ie.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return!ie.nodeName(this,"form")&&void ie.event.remove(this,"._submit")}}),ne.changeBubbles||(ie.event.special.change={setup:function(){return je.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(ie.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),ie.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),ie.event.simulate("change",this,e,!0)})),!1):void ie.event.add(this,"beforeactivate._change",function(e){var t=e.target;je.test(t.nodeName)&&!ie._data(t,"changeBubbles")&&(ie.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||ie.event.simulate("change",this.parentNode,e,!0)}),ie._data(t,"changeBubbles",!0))})},handle:function(e){var t=e.target;return this!==t||e.isSimulated||e.isTrigger||"radio"!==t.type&&"checkbox"!==t.type?e.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return ie.event.remove(this,"._change"),!je.test(this.nodeName)}}),ne.focusinBubbles||ie.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){ie.event.simulate(t,e.target,ie.event.fix(e),!0)};ie.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=ie._data(r,t);i||r.addEventListener(e,n,!0),ie._data(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=ie._data(r,t)-1;i?ie._data(r,t,i):(r.removeEventListener(e,n,!0),ie._removeData(r,t))}}}),ie.fn.extend({on:function(e,t,n,r,i){var o,a;if("object"==typeof e){"string"!=typeof t&&(n=n||t,t=void 0);for(o in e)this.on(o,t,n,e[o],i);return this}if(null==n&&null==r?(r=t,n=t=void 0):null==r&&("string"==typeof t?(r=n,n=void 0):(r=n,n=t,t=void 0)),!1===r)r=p;else if(!r)return this;return 1===i&&(a=r,r=function(e){return ie().off(e),a.apply(this,arguments)},r.guid=a.guid||(a.guid=ie.guid++)),this.each(function(){ie.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,ie(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return(!1===t||"function"==typeof t)&&(n=t,t=void 0),!1===n&&(n=p),this.each(function(){ie.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){ie.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?ie.event.trigger(e,t,n,!0):void 0}});var Me="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Fe=/ jQuery\d+="(?:null|\d+)"/g,Oe=new RegExp("<(?:"+Me+")[\\s/>]","i"),Be=/^\s+/,Pe=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Re=/<([\w:]+)/,We=/<tbody/i,$e=/<|&#?\w+;/,ze=/<(?:script|style|link)/i,Ie=/checked\s*(?:[^=]|=\s*.checked.)/i,Xe=/^$|\/(?:java|ecma)script/i,Ue=/^true\/(.*)/,Ve=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Je={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:ne.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},Ye=m(he),Ge=Ye.appendChild(he.createElement("div"));Je.optgroup=Je.option,Je.tbody=Je.tfoot=Je.colgroup=Je.caption=Je.thead,Je.th=Je.td,ie.extend({clone:function(e,t,n){var r,i,o,a,s,l=ie.contains(e.ownerDocument,e);if(ne.html5Clone||ie.isXMLDoc(e)||!Oe.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Ge.innerHTML=e.outerHTML,Ge.removeChild(o=Ge.firstChild)),!(ne.noCloneEvent&&ne.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ie.isXMLDoc(e)))for(r=g(o),s=g(e),a=0;null!=(i=s[a]);++a)r[a]&&C(i,r[a]);if(t)if(n)for(s=s||g(e),r=r||g(o),a=0;null!=(i=s[a]);a++)T(i,r[a]);else T(e,o);return r=g(o,"script"),r.length>0&&w(r,!l&&g(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){for(var i,o,a,s,l,u,c,d=e.length,f=m(t),p=[],h=0;d>h;h++)if((o=e[h])||0===o)if("object"===ie.type(o))ie.merge(p,o.nodeType?[o]:o);else if($e.test(o)){for(s=s||f.appendChild(t.createElement("div")),l=(Re.exec(o)||["",""])[1].toLowerCase(),c=Je[l]||Je._default,s.innerHTML=c[1]+o.replace(Pe,"<$1></$2>")+c[2],i=c[0];i--;)s=s.lastChild;if(!ne.leadingWhitespace&&Be.test(o)&&p.push(t.createTextNode(Be.exec(o)[0])),!ne.tbody)for(o="table"!==l||We.test(o)?"<table>"!==c[1]||We.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;i--;)ie.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u);for(ie.merge(p,s.childNodes),s.textContent="";s.firstChild;)s.removeChild(s.firstChild);s=f.lastChild}else p.push(t.createTextNode(o));for(s&&f.removeChild(s),ne.appendChecked||ie.grep(g(p,"input"),v),h=0;o=p[h++];)if((!r||-1===ie.inArray(o,r))&&(a=ie.contains(o.ownerDocument,o),s=g(f.appendChild(o),"script"),a&&w(s),n))for(i=0;o=s[i++];)Xe.test(o.type||"")&&n.push(o);return s=null,f},cleanData:function(e,t){for(var n,r,i,o,a=0,s=ie.expando,l=ie.cache,u=ne.deleteExpando,c=ie.event.special;null!=(n=e[a]);a++)if((t||ie.acceptData(n))&&(i=n[s],o=i&&l[i])){if(o.events)for(r in o.events)c[r]?ie.event.remove(n,r):ie.removeEvent(n,r,o.handle);l[i]&&(delete l[i],u?delete n[s]:typeof n.removeAttribute!==Te?n.removeAttribute(s):n[s]=null,J.push(i))}}}),ie.fn.extend({text:function(e){return Ae(this,function(e){return void 0===e?ie.text(this):this.empty().append((this[0]&&this[0].ownerDocument||he).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){y(this,e).appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=y(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=e?ie.filter(e,this):this,i=0;null!=(n=r[i]);i++)t||1!==n.nodeType||ie.cleanData(g(n)),n.parentNode&&(t&&ie.contains(n.ownerDocument,n)&&w(g(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&ie.cleanData(g(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&ie.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return ie.clone(this,e,t)})},html:function(e){return Ae(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(Fe,""):void 0;if(!("string"!=typeof e||ze.test(e)||!ne.htmlSerialize&&Oe.test(e)||!ne.leadingWhitespace&&Be.test(e)||Je[(Re.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(Pe,"<$1></$2>");try{for(;r>n;n++)t=this[n]||{},1===t.nodeType&&(ie.cleanData(g(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=arguments[0];return this.domManip(arguments,function(t){e=this.parentNode,ie.cleanData(g(this)),e&&e.replaceChild(t,this)}),e&&(e.length||e.nodeType)?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t){e=G.apply([],e);var n,r,i,o,a,s,l=0,u=this.length,c=this,d=u-1,f=e[0],p=ie.isFunction(f);if(p||u>1&&"string"==typeof f&&!ne.checkClone&&Ie.test(f))return this.each(function(n){var r=c.eq(n);p&&(e[0]=f.call(this,n,r.html())),r.domManip(e,t)});if(u&&(s=ie.buildFragment(e,this[0].ownerDocument,!1,this),n=s.firstChild,1===s.childNodes.length&&(s=n),n)){for(o=ie.map(g(s,"script"),b),i=o.length;u>l;l++)r=s,l!==d&&(r=ie.clone(r,!0,!0),i&&ie.merge(o,g(r,"script"))),t.call(this[l],r,l);if(i)for(a=o[o.length-1].ownerDocument,ie.map(o,x),l=0;i>l;l++)r=o[l],Xe.test(r.type||"")&&!ie._data(r,"globalEval")&&ie.contains(a,r)&&(r.src?ie._evalUrl&&ie._evalUrl(r.src):ie.globalEval((r.text||r.textContent||r.innerHTML||"").replace(Ve,"")));s=n=null}return this}}),ie.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){ie.fn[e]=function(e){for(var n,r=0,i=[],o=ie(e),a=o.length-1;a>=r;r++)n=r===a?this:this.clone(!0),ie(o[r])[t](n),Q.apply(i,n.get());return this.pushStack(i)}});var Qe,Ke={};!function(){var e;ne.shrinkWrapBlocks=function(){if(null!=e)return e;e=!1;var t,n,r;return n=he.getElementsByTagName("body")[0],n&&n.style?(t=he.createElement("div"),r=he.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),typeof t.style.zoom!==Te&&(t.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",t.appendChild(he.createElement("div")).style.width="5px",e=3!==t.offsetWidth),n.removeChild(r),e):void 0}}();var Ze,et,tt=/^margin/,nt=new RegExp("^("+Ee+")(?!px)[a-z%]+$","i"),rt=/^(top|right|bottom|left)$/;e.getComputedStyle?(Ze=function(t){return t.ownerDocument.defaultView.opener?t.ownerDocument.defaultView.getComputedStyle(t,null):e.getComputedStyle(t,null)},et=function(e,t,n){var r,i,o,a,s=e.style;return n=n||Ze(e),a=n?n.getPropertyValue(t)||n[t]:void 0,n&&(""!==a||ie.contains(e.ownerDocument,e)||(a=ie.style(e,t)),nt.test(a)&&tt.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0===a?a:a+""}):he.documentElement.currentStyle&&(Ze=function(e){return e.currentStyle},et=function(e,t,n){var r,i,o,a,s=e.style;return n=n||Ze(e),a=n?n[t]:void 0,null==a&&s&&s[t]&&(a=s[t]),nt.test(a)&&!rt.test(t)&&(r=s.left,i=e.runtimeStyle,o=i&&i.left,o&&(i.left=e.currentStyle.left),s.left="fontSize"===t?"1em":a,a=s.pixelLeft+"px",s.left=r,o&&(i.left=o)),void 0===a?a:a+""||"auto"}),!function(){function t(){var t,n,r,i;(n=he.getElementsByTagName("body")[0])&&n.style&&(t=he.createElement("div"),r=he.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),t.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",o=a=!1,l=!0,e.getComputedStyle&&(o="1%"!==(e.getComputedStyle(t,null)||{}).top,a="4px"===(e.getComputedStyle(t,null)||{width:"4px"}).width,i=t.appendChild(he.createElement("div")),i.style.cssText=t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",t.style.width="1px",l=!parseFloat((e.getComputedStyle(i,null)||{}).marginRight),t.removeChild(i)),t.innerHTML="<table><tr><td></td><td>t</td></tr></table>",
5
5
  i=t.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",s=0===i[0].offsetHeight,s&&(i[0].style.display="",i[1].style.display="none",s=0===i[0].offsetHeight),n.removeChild(r))}var n,r,i,o,a,s,l;n=he.createElement("div"),n.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",i=n.getElementsByTagName("a")[0],(r=i&&i.style)&&(r.cssText="float:left;opacity:.5",ne.opacity="0.5"===r.opacity,ne.cssFloat=!!r.cssFloat,n.style.backgroundClip="content-box",n.cloneNode(!0).style.backgroundClip="",ne.clearCloneStyle="content-box"===n.style.backgroundClip,ne.boxSizing=""===r.boxSizing||""===r.MozBoxSizing||""===r.WebkitBoxSizing,ie.extend(ne,{reliableHiddenOffsets:function(){return null==s&&t(),s},boxSizingReliable:function(){return null==a&&t(),a},pixelPosition:function(){return null==o&&t(),o},reliableMarginRight:function(){return null==l&&t(),l}}))}(),ie.swap=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i};var it=/alpha\([^)]*\)/i,ot=/opacity\s*=\s*([^)]*)/,at=/^(none|table(?!-c[ea]).+)/,st=new RegExp("^("+Ee+")(.*)$","i"),lt=new RegExp("^([+-])=("+Ee+")","i"),ut={position:"absolute",visibility:"hidden",display:"block"},ct={letterSpacing:"0",fontWeight:"400"},dt=["Webkit","O","Moz","ms"];ie.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=et(e,"opacity");return""===n?"1":n}}}},cssNumber:{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":ne.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=ie.camelCase(t),l=e.style;if(t=ie.cssProps[s]||(ie.cssProps[s]=S(l,s)),a=ie.cssHooks[t]||ie.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];if(o=typeof n,"string"===o&&(i=lt.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(ie.css(e,t)),o="number"),null!=n&&n===n&&("number"!==o||ie.cssNumber[s]||(n+="px"),ne.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),!(a&&"set"in a&&void 0===(n=a.set(e,n,r)))))try{l[t]=n}catch(e){}}},css:function(e,t,n,r){var i,o,a,s=ie.camelCase(t);return t=ie.cssProps[s]||(ie.cssProps[s]=S(e.style,s)),a=ie.cssHooks[t]||ie.cssHooks[s],a&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=et(e,t,r)),"normal"===o&&t in ct&&(o=ct[t]),""===n||n?(i=parseFloat(o),!0===n||ie.isNumeric(i)?i||0:o):o}}),ie.each(["height","width"],function(e,t){ie.cssHooks[t]={get:function(e,n,r){return n?at.test(ie.css(e,"display"))&&0===e.offsetWidth?ie.swap(e,ut,function(){return L(e,t,r)}):L(e,t,r):void 0},set:function(e,n,r){var i=r&&Ze(e);return D(e,n,r?j(e,t,r,ne.boxSizing&&"border-box"===ie.css(e,"boxSizing",!1,i),i):0)}}}),ne.opacity||(ie.cssHooks.opacity={get:function(e,t){return ot.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=ie.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===ie.trim(o.replace(it,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=it.test(o)?o.replace(it,i):o+" "+i)}}),ie.cssHooks.marginRight=k(ne.reliableMarginRight,function(e,t){return t?ie.swap(e,{display:"inline-block"},et,[e,"marginRight"]):void 0}),ie.each({margin:"",padding:"",border:"Width"},function(e,t){ie.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+ke[r]+t]=o[r]||o[r-2]||o[0];return i}},tt.test(e)||(ie.cssHooks[e+t].set=D)}),ie.fn.extend({css:function(e,t){return Ae(this,function(e,t,n){var r,i,o={},a=0;if(ie.isArray(t)){for(r=Ze(e),i=t.length;i>a;a++)o[t[a]]=ie.css(e,t[a],!1,r);return o}return void 0!==n?ie.style(e,t,n):ie.css(e,t)},e,t,arguments.length>1)},show:function(){return A(this,!0)},hide:function(){return A(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Se(this)?ie(this).show():ie(this).hide()})}}),ie.Tween=H,H.prototype={constructor:H,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(ie.cssNumber[n]?"":"px")},cur:function(){var e=H.propHooks[this.prop];return e&&e.get?e.get(this):H.propHooks._default.get(this)},run:function(e){var t,n=H.propHooks[this.prop];return this.pos=t=this.options.duration?ie.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):H.propHooks._default.set(this),this}},H.prototype.init.prototype=H.prototype,H.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=ie.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){ie.fx.step[e.prop]?ie.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[ie.cssProps[e.prop]]||ie.cssHooks[e.prop])?ie.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},H.propHooks.scrollTop=H.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},ie.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},ie.fx=H.prototype.init,ie.fx.step={};var ft,pt,ht=/^(?:toggle|show|hide)$/,mt=new RegExp("^(?:([+-])=|)("+Ee+")([a-z%]*)$","i"),gt=/queueHooks$/,vt=[F],yt={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=mt.exec(t),o=i&&i[3]||(ie.cssNumber[e]?"":"px"),a=(ie.cssNumber[e]||"px"!==o&&+r)&&mt.exec(ie.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do{s=s||".5",a/=s,ie.style(n.elem,e,a+o)}while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};ie.Animation=ie.extend(B,{tweener:function(e,t){ie.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],yt[n]=yt[n]||[],yt[n].unshift(t)},prefilter:function(e,t){t?vt.unshift(e):vt.push(e)}}),ie.speed=function(e,t,n){var r=e&&"object"==typeof e?ie.extend({},e):{complete:n||!n&&t||ie.isFunction(e)&&e,duration:e,easing:n&&t||t&&!ie.isFunction(t)&&t};return r.duration=ie.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in ie.fx.speeds?ie.fx.speeds[r.duration]:ie.fx.speeds._default,(null==r.queue||!0===r.queue)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){ie.isFunction(r.old)&&r.old.call(this),r.queue&&ie.dequeue(this,r.queue)},r},ie.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Se).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=ie.isEmptyObject(e),o=ie.speed(t,n,r),a=function(){var t=B(this,ie.extend({},e),o);(i||ie._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=ie.timers,a=ie._data(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&gt.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));(t||!n)&&ie.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=ie._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=ie.timers,a=r?r.length:0;for(n.finish=!0,ie.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),ie.each(["toggle","show","hide"],function(e,t){var n=ie.fn[t];ie.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(_(t,!0),e,r,i)}}),ie.each({slideDown:_("show"),slideUp:_("hide"),slideToggle:_("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){ie.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),ie.timers=[],ie.fx.tick=function(){var e,t=ie.timers,n=0;for(ft=ie.now();n<t.length;n++)(e=t[n])()||t[n]!==e||t.splice(n--,1);t.length||ie.fx.stop(),ft=void 0},ie.fx.timer=function(e){ie.timers.push(e),e()?ie.fx.start():ie.timers.pop()},ie.fx.interval=13,ie.fx.start=function(){pt||(pt=setInterval(ie.fx.tick,ie.fx.interval))},ie.fx.stop=function(){clearInterval(pt),pt=null},ie.fx.speeds={slow:600,fast:200,_default:400},ie.fn.delay=function(e,t){return e=ie.fx?ie.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},function(){var e,t,n,r,i;t=he.createElement("div"),t.setAttribute("className","t"),t.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",r=t.getElementsByTagName("a")[0],n=he.createElement("select"),i=n.appendChild(he.createElement("option")),e=t.getElementsByTagName("input")[0],r.style.cssText="top:1px",ne.getSetAttribute="t"!==t.className,ne.style=/top/.test(r.getAttribute("style")),ne.hrefNormalized="/a"===r.getAttribute("href"),ne.checkOn=!!e.value,ne.optSelected=i.selected,ne.enctype=!!he.createElement("form").enctype,n.disabled=!0,ne.optDisabled=!i.disabled,e=he.createElement("input"),e.setAttribute("value",""),ne.input=""===e.getAttribute("value"),e.value="t",e.setAttribute("type","radio"),ne.radioValue="t"===e.value}();var bt=/\r/g;ie.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=ie.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,ie(this).val()):e,null==i?i="":"number"==typeof i?i+="":ie.isArray(i)&&(i=ie.map(i,function(e){return null==e?"":e+""})),(t=ie.valHooks[this.type]||ie.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=ie.valHooks[i.type]||ie.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(bt,""):null==n?"":n)):void 0}}),ie.extend({valHooks:{option:{get:function(e){var t=ie.find.attr(e,"value");return null!=t?t:ie.trim(ie.text(e))}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(ne.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&ie.nodeName(n.parentNode,"optgroup"))){if(t=ie(n).val(),o)return t;a.push(t)}return a},set:function(e,t){for(var n,r,i=e.options,o=ie.makeArray(t),a=i.length;a--;)if(r=i[a],ie.inArray(ie.valHooks.option.get(r),o)>=0)try{r.selected=n=!0}catch(e){r.scrollHeight}else r.selected=!1;return n||(e.selectedIndex=-1),i}}}}),ie.each(["radio","checkbox"],function(){ie.valHooks[this]={set:function(e,t){return ie.isArray(t)?e.checked=ie.inArray(ie(e).val(),t)>=0:void 0}},ne.checkOn||(ie.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var xt,wt,Tt=ie.expr.attrHandle,Ct=/^(?:checked|selected)$/i,Nt=ne.getSetAttribute,Et=ne.input;ie.fn.extend({attr:function(e,t){return Ae(this,ie.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){ie.removeAttr(this,e)})}}),ie.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return typeof e.getAttribute===Te?ie.prop(e,t,n):(1===o&&ie.isXMLDoc(e)||(t=t.toLowerCase(),r=ie.attrHooks[t]||(ie.expr.match.bool.test(t)?wt:xt)),void 0===n?r&&"get"in r&&null!==(i=r.get(e,t))?i:(i=ie.find.attr(e,t),null==i?void 0:i):null!==n?r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):void ie.removeAttr(e,t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(ye);if(o&&1===e.nodeType)for(;n=o[i++];)r=ie.propFix[n]||n,ie.expr.match.bool.test(n)?Et&&Nt||!Ct.test(n)?e[r]=!1:e[ie.camelCase("default-"+n)]=e[r]=!1:ie.attr(e,n,""),e.removeAttribute(Nt?n:r)},attrHooks:{type:{set:function(e,t){if(!ne.radioValue&&"radio"===t&&ie.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}}}),wt={set:function(e,t,n){return!1===t?ie.removeAttr(e,n):Et&&Nt||!Ct.test(n)?e.setAttribute(!Nt&&ie.propFix[n]||n,n):e[ie.camelCase("default-"+n)]=e[n]=!0,n}},ie.each(ie.expr.match.bool.source.match(/\w+/g),function(e,t){var n=Tt[t]||ie.find.attr;Tt[t]=Et&&Nt||!Ct.test(t)?function(e,t,r){var i,o;return r||(o=Tt[t],Tt[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,Tt[t]=o),i}:function(e,t,n){return n?void 0:e[ie.camelCase("default-"+t)]?t.toLowerCase():null}}),Et&&Nt||(ie.attrHooks.value={set:function(e,t,n){return ie.nodeName(e,"input")?void(e.defaultValue=t):xt&&xt.set(e,t,n)}}),Nt||(xt={set:function(e,t,n){var r=e.getAttributeNode(n);return r||e.setAttributeNode(r=e.ownerDocument.createAttribute(n)),r.value=t+="","value"===n||t===e.getAttribute(n)?t:void 0}},Tt.id=Tt.name=Tt.coords=function(e,t,n){var r;return n?void 0:(r=e.getAttributeNode(t))&&""!==r.value?r.value:null},ie.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);return n&&n.specified?n.value:void 0},set:xt.set},ie.attrHooks.contenteditable={set:function(e,t,n){xt.set(e,""!==t&&t,n)}},ie.each(["width","height"],function(e,t){ie.attrHooks[t]={set:function(e,n){return""===n?(e.setAttribute(t,"auto"),n):void 0}}})),ne.style||(ie.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var kt=/^(?:input|select|textarea|button|object)$/i,St=/^(?:a|area)$/i;ie.fn.extend({prop:function(e,t){return Ae(this,ie.prop,e,t,arguments.length>1)},removeProp:function(e){return e=ie.propFix[e]||e,this.each(function(){try{this[e]=void 0,delete this[e]}catch(e){}})}}),ie.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,n){var r,i,o,a=e.nodeType;if(e&&3!==a&&8!==a&&2!==a)return o=1!==a||!ie.isXMLDoc(e),o&&(t=ie.propFix[t]||t,i=ie.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=ie.find.attr(e,"tabindex");return t?parseInt(t,10):kt.test(e.nodeName)||St.test(e.nodeName)&&e.href?0:-1}}}}),ne.hrefNormalized||ie.each(["href","src"],function(e,t){ie.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),ne.optSelected||(ie.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),ie.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ie.propFix[this.toLowerCase()]=this}),ne.enctype||(ie.propFix.enctype="encoding");var At=/[\t\r\n\f]/g;ie.fn.extend({addClass:function(e){var t,n,r,i,o,a,s=0,l=this.length,u="string"==typeof e&&e;if(ie.isFunction(e))return this.each(function(t){ie(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(ye)||[];l>s;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(At," "):" ")){for(o=0;i=t[o++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");a=ie.trim(r),n.className!==a&&(n.className=a)}return this},removeClass:function(e){var t,n,r,i,o,a,s=0,l=this.length,u=0===arguments.length||"string"==typeof e&&e;if(ie.isFunction(e))return this.each(function(t){ie(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(ye)||[];l>s;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(At," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");a=e?ie.trim(r):"",n.className!==a&&(n.className=a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):this.each(ie.isFunction(e)?function(n){ie(this).toggleClass(e.call(this,n,this.className,t),t)}:function(){if("string"===n)for(var t,r=0,i=ie(this),o=e.match(ye)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else(n===Te||"boolean"===n)&&(this.className&&ie._data(this,"__className__",this.className),this.className=this.className||!1===e?"":ie._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(At," ").indexOf(t)>=0)return!0;return!1}}),ie.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(e,t){ie.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),ie.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var Dt=ie.now(),jt=/\?/,Lt=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;ie.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,r=null,i=ie.trim(t+"");return i&&!ie.trim(i.replace(Lt,function(e,t,i,o){return n&&t&&(r=0),0===r?e:(n=i||t,r+=!o-!i,"")}))?Function("return "+i)():ie.error("Invalid JSON: "+t)},ie.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{e.DOMParser?(r=new DOMParser,n=r.parseFromString(t,"text/xml")):(n=new ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(t))}catch(e){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||ie.error("Invalid XML: "+t),n};var Ht,qt,_t=/#.*$/,Mt=/([?&])_=[^&]*/,Ft=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Ot=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Bt=/^(?:GET|HEAD)$/,Pt=/^\/\//,Rt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Wt={},$t={},zt="*/".concat("*");try{qt=location.href}catch(e){qt=he.createElement("a"),qt.href="",qt=qt.href}Ht=Rt.exec(qt.toLowerCase())||[],ie.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:qt,type:"GET",isLocal:Ot.test(Ht[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":ie.parseJSON,"text xml":ie.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?W(W(e,ie.ajaxSettings),t):W(ie.ajaxSettings,e)},ajaxPrefilter:P(Wt),ajaxTransport:P($t),ajax:function(e,t){function n(e,t,n,r){var i,c,v,y,x,T=t;2!==b&&(b=2,s&&clearTimeout(s),u=void 0,a=r||"",w.readyState=e>0?4:0,i=e>=200&&300>e||304===e,n&&(y=$(d,w,n)),y=z(d,y,w,i),i?(d.ifModified&&(x=w.getResponseHeader("Last-Modified"),x&&(ie.lastModified[o]=x),(x=w.getResponseHeader("etag"))&&(ie.etag[o]=x)),204===e||"HEAD"===d.type?T="nocontent":304===e?T="notmodified":(T=y.state,c=y.data,v=y.error,i=!v)):(v=T,(e||!T)&&(T="error",0>e&&(e=0))),w.status=e,w.statusText=(t||T)+"",i?h.resolveWith(f,[c,T,w]):h.rejectWith(f,[w,T,v]),w.statusCode(g),g=void 0,l&&p.trigger(i?"ajaxSuccess":"ajaxError",[w,d,i?c:v]),m.fireWith(f,[w,T]),l&&(p.trigger("ajaxComplete",[w,d]),--ie.active||ie.event.trigger("ajaxStop")))}"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,i,o,a,s,l,u,c,d=ie.ajaxSetup({},t),f=d.context||d,p=d.context&&(f.nodeType||f.jquery)?ie(f):ie.event,h=ie.Deferred(),m=ie.Callbacks("once memory"),g=d.statusCode||{},v={},y={},b=0,x="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c)for(c={};t=Ft.exec(a);)c[t[1].toLowerCase()]=t[2];t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=y[n]=y[n]||e,v[e]=t),this},overrideMimeType:function(e){return b||(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)g[t]=[g[t],e[t]];else w.always(e[w.status]);return this},abort:function(e){var t=e||x;return u&&u.abort(t),n(0,t),this}};if(h.promise(w).complete=m.add,w.success=w.done,w.error=w.fail,d.url=((e||d.url||qt)+"").replace(_t,"").replace(Pt,Ht[1]+"//"),d.type=t.method||t.type||d.method||d.type,d.dataTypes=ie.trim(d.dataType||"*").toLowerCase().match(ye)||[""],null==d.crossDomain&&(r=Rt.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]===Ht[1]&&r[2]===Ht[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(Ht[3]||("http:"===Ht[1]?"80":"443")))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=ie.param(d.data,d.traditional)),R(Wt,d,t,w),2===b)return w;l=ie.event&&d.global,l&&0==ie.active++&&ie.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Bt.test(d.type),o=d.url,d.hasContent||(d.data&&(o=d.url+=(jt.test(o)?"&":"?")+d.data,delete d.data),!1===d.cache&&(d.url=Mt.test(o)?o.replace(Mt,"$1_="+Dt++):o+(jt.test(o)?"&":"?")+"_="+Dt++)),d.ifModified&&(ie.lastModified[o]&&w.setRequestHeader("If-Modified-Since",ie.lastModified[o]),ie.etag[o]&&w.setRequestHeader("If-None-Match",ie.etag[o])),(d.data&&d.hasContent&&!1!==d.contentType||t.contentType)&&w.setRequestHeader("Content-Type",d.contentType),w.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+zt+"; q=0.01":""):d.accepts["*"]);for(i in d.headers)w.setRequestHeader(i,d.headers[i]);if(d.beforeSend&&(!1===d.beforeSend.call(f,w,d)||2===b))return w.abort();x="abort";for(i in{success:1,error:1,complete:1})w[i](d[i]);if(u=R($t,d,t,w)){w.readyState=1,l&&p.trigger("ajaxSend",[w,d]),d.async&&d.timeout>0&&(s=setTimeout(function(){w.abort("timeout")},d.timeout));try{b=1,u.send(v,n)}catch(e){if(!(2>b))throw e;n(-1,e)}}else n(-1,"No Transport");return w},getJSON:function(e,t,n){return ie.get(e,t,n,"json")},getScript:function(e,t){return ie.get(e,void 0,t,"script")}}),ie.each(["get","post"],function(e,t){ie[t]=function(e,n,r,i){return ie.isFunction(n)&&(i=i||r,r=n,n=void 0),ie.ajax({url:e,type:t,dataType:i,data:n,success:r})}}),ie._evalUrl=function(e){return ie.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},ie.fn.extend({wrapAll:function(e){if(ie.isFunction(e))return this.each(function(t){ie(this).wrapAll(e.call(this,t))});if(this[0]){var t=ie(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return this.each(ie.isFunction(e)?function(t){ie(this).wrapInner(e.call(this,t))}:function(){var t=ie(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=ie.isFunction(e);return this.each(function(n){ie(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){ie.nodeName(this,"body")||ie(this).replaceWith(this.childNodes)}).end()}}),ie.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!ne.reliableHiddenOffsets()&&"none"===(e.style&&e.style.display||ie.css(e,"display"))},ie.expr.filters.visible=function(e){return!ie.expr.filters.hidden(e)};var It=/%20/g,Xt=/\[\]$/,Ut=/\r?\n/g,Vt=/^(?:submit|button|image|reset|file)$/i,Jt=/^(?:input|select|textarea|keygen)/i;ie.param=function(e,t){var n,r=[],i=function(e,t){t=ie.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=ie.ajaxSettings&&ie.ajaxSettings.traditional),ie.isArray(e)||e.jquery&&!ie.isPlainObject(e))ie.each(e,function(){i(this.name,this.value)});else for(n in e)I(n,e[n],t,i);return r.join("&").replace(It,"+")},ie.fn.extend({serialize:function(){return ie.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=ie.prop(this,"elements");return e?ie.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!ie(this).is(":disabled")&&Jt.test(this.nodeName)&&!Vt.test(e)&&(this.checked||!De.test(e))}).map(function(e,t){var n=ie(this).val();return null==n?null:ie.isArray(n)?ie.map(n,function(e){return{name:t.name,value:e.replace(Ut,"\r\n")}}):{name:t.name,value:n.replace(Ut,"\r\n")}}).get()}}),ie.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&X()||U()}:X;var Yt=0,Gt={},Qt=ie.ajaxSettings.xhr();e.attachEvent&&e.attachEvent("onunload",function(){for(var e in Gt)Gt[e](void 0,!0)}),ne.cors=!!Qt&&"withCredentials"in Qt,(Qt=ne.ajax=!!Qt)&&ie.ajaxTransport(function(e){if(!e.crossDomain||ne.cors){var t;return{send:function(n,r){var i,o=e.xhr(),a=++Yt;if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)o[i]=e.xhrFields[i];e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)void 0!==n[i]&&o.setRequestHeader(i,n[i]+"");o.send(e.hasContent&&e.data||null),t=function(n,i){var s,l,u;if(t&&(i||4===o.readyState))if(delete Gt[a],t=void 0,o.onreadystatechange=ie.noop,i)4!==o.readyState&&o.abort();else{u={},s=o.status,"string"==typeof o.responseText&&(u.text=o.responseText);try{l=o.statusText}catch(e){l=""}s||!e.isLocal||e.crossDomain?1223===s&&(s=204):s=u.text?200:404}u&&r(s,l,u,o.getAllResponseHeaders())},e.async?4===o.readyState?setTimeout(t):o.onreadystatechange=Gt[a]=t:t()},abort:function(){t&&t(void 0,!0)}}}}),ie.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return ie.globalEval(e),e}}}),ie.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),ie.ajaxTransport("script",function(e){if(e.crossDomain){var t,n=he.head||ie("head")[0]||he.documentElement;return{send:function(r,i){t=he.createElement("script"),t.async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,n){(n||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,n||i(200,"success"))},n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ie.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ie.expando+"_"+Dt++;return this[e]=!0,e}}),ie.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=!1!==t.jsonp&&(Zt.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(t.data)&&"data");return s||"jsonp"===t.dataTypes[0]?(i=t.jsonpCallback=ie.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(Zt,"$1"+i):!1!==t.jsonp&&(t.url+=(jt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||ie.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,Kt.push(i)),a&&ie.isFunction(o)&&o(a[0]),a=o=void 0}),"script"):void 0}),ie.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||he;var r=de.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=ie.buildFragment([e],t,i),i&&i.length&&ie(i).remove(),ie.merge([],r.childNodes))};var en=ie.fn.load;ie.fn.load=function(e,t,n){if("string"!=typeof e&&en)return en.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");return s>=0&&(r=ie.trim(e.slice(s,e.length)),e=e.slice(0,s)),ie.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(o="POST"),a.length>0&&ie.ajax({url:e,type:o,dataType:"html",data:t}).done(function(e){i=arguments,a.html(r?ie("<div>").append(ie.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){a.each(n,i||[e.responseText,t,e])}),this},ie.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ie.fn[t]=function(e){return this.on(t,e)}}),ie.expr.filters.animated=function(e){return ie.grep(ie.timers,function(t){return e===t.elem}).length};var tn=e.document.documentElement;ie.offset={setOffset:function(e,t,n){var r,i,o,a,s,l,u,c=ie.css(e,"position"),d=ie(e),f={};"static"===c&&(e.style.position="relative"),s=d.offset(),o=ie.css(e,"top"),l=ie.css(e,"left"),u=("absolute"===c||"fixed"===c)&&ie.inArray("auto",[o,l])>-1,u?(r=d.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),ie.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):d.css(f)}},ie.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){ie.offset.setOffset(this,e,t)});var t,n,r={top:0,left:0},i=this[0],o=i&&i.ownerDocument;return o?(t=o.documentElement,ie.contains(t,i)?(typeof i.getBoundingClientRect!==Te&&(r=i.getBoundingClientRect()),n=V(o),{top:r.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:r.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):r):void 0},position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===ie.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),ie.nodeName(e[0],"html")||(n=e.offset()),n.top+=ie.css(e[0],"borderTopWidth",!0),n.left+=ie.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-ie.css(r,"marginTop",!0),left:t.left-n.left-ie.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||tn;e&&!ie.nodeName(e,"html")&&"static"===ie.css(e,"position");)e=e.offsetParent;return e||tn})}}),ie.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n=/Y/.test(t);ie.fn[e]=function(r){return Ae(this,function(e,r,i){var o=V(e);return void 0===i?o?t in o?o[t]:o.document.documentElement[r]:e[r]:void(o?o.scrollTo(n?ie(o).scrollLeft():i,n?i:ie(o).scrollTop()):e[r]=i)},e,r,arguments.length,null)}}),ie.each(["top","left"],function(e,t){ie.cssHooks[t]=k(ne.pixelPosition,function(e,n){return n?(n=et(e,t),nt.test(n)?ie(e).position()[t]+"px":n):void 0})}),ie.each({Height:"height",Width:"width"},function(e,t){ie.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){ie.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(!0===r||!0===i?"margin":"border");return Ae(this,function(t,n,r){var i;return ie.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?ie.css(t,n,a):ie.style(t,n,r,a)},t,o?r:void 0,o,null)}})}),ie.fn.size=function(){return this.length},ie.fn.andSelf=ie.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return ie});var nn=e.jQuery,rn=e.$;return ie.noConflict=function(t){return e.$===ie&&(e.$=rn),t&&e.jQuery===ie&&(e.jQuery=nn),ie},typeof t===Te&&(e.jQuery=e.$=ie),ie});
6
6
  //script: slot
7
- (function(){var t,e,n,a,i,o,r,s,l,d,c,u,f,h,p;window.wagn||(window.wagn={}),$(window).ready(function(){var t;return $("body").on("click",".pointer-item-add",function(t){var e,n,a;return n=$(this).closest(".content-editor").find(".pointer-li:last"),a=n.clone(),e=a.find("input"),e.val(""),n.after(a),wagn.initPointerList(e),t.preventDefault()}),$("body").on("click",".pointer-item-delete",function(){var t;return t=$(this).closest("li"),t.closest("ul").find(".pointer-li").length>1?t.remove():t.find("input").val("")}),$("body").on("show.bs.tab","a.load[data-toggle=tab][data-url]",function(t){var e,n;return e=$(t.target).attr("href"),n=$(t.target).data("url"),$(t.target).removeClass("load"),$(e).load(n)}),$("body").on("click",".toolbar-pin.active",function(t){return t.preventDefault(),$(this).blur(),$(".toolbar-pin").removeClass("active").addClass("inactive"),$.ajax("/*toolbar_pinned",{type:"PUT",data:"card[content]=false"})}),$("body").on("click",".toolbar-pin.inactive",function(t){return t.preventDefault(),$(this).blur(),$(".toolbar-pin").removeClass("inactive").addClass("active"),$.ajax("/*toolbar_pinned",{type:"PUT",data:"card[content]=true"})}),$("body").on("click",".btn-item-delete",function(){return $(this).find(".glyphicon").addClass("glyphicon-hourglass").removeClass("glyphicon-remove")}),$("body").on("click",".btn-item-add",function(){return $(this).find(".glyphicon").addClass("glyphicon-hourglass").removeClass("glyphicon-plus")}),$("body").on("mouseenter",".btn-item-delete",function(){return $(this).find(".glyphicon").addClass("glyphicon-remove").removeClass("glyphicon-ok"),$(this).addClass("btn-danger").removeClass("btn-primary")}),$("body").on("mouseleave",".btn-item-delete",function(){return $(this).find(".glyphicon").addClass("glyphicon-ok").removeClass("glyphicon-remove"),$(this).addClass("btn-primary").removeClass("btn-danger")}),$("body").on("hidden.bs.modal",function(t){var e,n,a,i,o;if(n=$(t.target).find(".modal-dialog > .modal-content"),"modal-main-slot"!==$(t.target).attr("id"))return i=$(t.target).slot(),e=i.find(".menu-slot:first"),o=wagn.rootPath+"/~"+i.data("card-id"),a={view:"menu"},i.isMain()&&(a.is_main=!0),n.empty(),$.ajax(o,{type:"GET",data:a,success:function(t){return e.replaceWith(t)}})}),$("body").on("click",".perm-vals input",function(){return $(this).slot().find("#inherit").attr("checked",!1)}),$("body").on("click",".perm-editor #inherit",function(){var t;return t=$(this).slot(),t.find(".perm-group input:checked").attr("checked",!1),t.find(".perm-indiv input").val("")}),$("body").on("click",".rule-submit-button",function(){var t,e;return e=$(this).closest("form"),t=e.find(".set-editor input:checked"),t.val()?!t.attr("warning")||confirm(t.attr("warning")):(e.find(".set-editor").addClass("attention"),$(this).notify("To what Set does this Rule apply?"),!1)}),$("body").on("click",".submit-modal",function(){return $(this).closest(".modal-content").find("form").submit()}),$("body").on("click",".shade-view h1",function(){var t;if(t=$(this).slot().find(".shade-content").is(":hidden"),f($(this).closest(".pointer-list").find(".shade-content:visible").parent()),t)return f($(this).slot())}),(t=$(".shade-view h1")[0])&&$(t).trigger("click"),$("body").on("change",".go-to-selected select",function(){var t;if(""!==(t=$(this).val()))return window.location=wagn.rootPath+escape(t)}),$("body").on("click",".open-slow-items",function(){var t;return t=$(this).closest(".panel-group"),t.find(".open-slow-items").removeClass("open-slow-items").addClass("close-slow-items"),t.find(".toggle-fast-items").text("show < 100ms"),t.find(".duration-ok").hide(),t.find(".panel-danger > .panel-collapse").collapse("show").find("a > span").addClass("show-fast-items")}),$("body").on("click",".close-slow-items",function(){var t;return t=$(this).closest(".panel-group"),t.find(".close-slow-items").removeClass("close-slow-items").addClass("open-slow-items"),t.find(".toggle-fast-items").text("hide < 100ms"),t.find(".panel-danger > .panel-collapse").collapse("hide").removeClass("show-fast-items"),t.find(".duration-ok").show()}),$("body").on("click",".toggle-fast-items",function(){var t;return t=$(this).closest(".panel-group"),"hide < 100ms"===$(this).text()?(t.find(".duration-ok").hide(),$(this).text("show < 100ms")):(t.find(".duration-ok").show(),$(this).text("hide < 100ms"))}),$("body").on("click",".show-fast-items",function(t){var e;return $(this).removeClass("show-fast-items"),e=$(this).closest(".panel-group"),e.find(".duration-ok").show(),e.find(".show-fast-items").removeClass("show-fast-items"),e.find(".panel-collapse").collapse("show"),t.stopPropagation()})}),f=function(t){return t.find(".shade-content").slideToggle(1e3),t.find(".glyphicon").toggleClass("glyphicon-triangle-right glpyphicon-triangle-bottom")},$.extend(wagn,{editorContentFunctionMap:{},editorInitFunctionMap:{".date-editor":function(){return this.datepicker({dateFormat:"yy-mm-dd"})},textarea:function(){return $(this).autosize()},".file-upload":function(){return wagn.upload_file(this)},".etherpad-textarea":function(){return $(this).closest("form").find(".edit-submit-button").attr("class","etherpad-submit-button")}},addEditor:function(t,e,n){return wagn.editorContentFunctionMap[t]=n,wagn.editorInitFunctionMap[t]=e}}),jQuery.fn.extend({setContentFieldsFromMap:function(t){var e;return null==t&&(t=wagn.editorContentFunctionMap),e=$(this),$.each(t,function(t,n){return e.setContentFields(t,n)})},setContentFields:function(t,e){return $.each(this.find(t),function(){return $(this).setContentField(e)})},setContentField:function(t){var e,n,a;if(e=this.closest(".card-editor").find(".d0-card-content"),n=e.val(),a=t.call(this),e.val(a),n!==a)return e.change()}}),h=function(){var t;if(t=$("body > footer").first(),$("body > article, body > aside").wrapAll("<div class='"+e()+"'/>"),$("body > div > article, body > div > aside").wrapAll('<div class="row row-offcanvas">'),t)return $("body").append(t)},p=function(t){return"<div class='container'><div class='row'>"+t+"</div></div>"},e=function(){return $("body").hasClass("fluid")?"container-fluid":"container"},d=function(t){var e;return e="left"===t?"right":"left","<button class='offcanvas-toggle offcanvas-toggle-"+t+" btn btn-secondary hidden-sm-up' data-toggle='offcanvas-"+t+"'><i class='material-icons'>chevron-"+e+"</i></button>"},c=function(t){var e,n;return e=$("body > article").first(),n=$("body > aside").first(),e.addClass("col-xs-12 col-sm-9 col-md-9"),n.addClass("col-xs-6 col-sm-3 col-md-3 sidebar-offcanvas sidebar-offcanvas-"+t),"left"===t?$("body").append(n).append(e):$("body").append(e).append(n),h(),e.prepend(p(d(t)))},a=function(){var t,e,n,a,i;return t=$("body > article").first(),e=$("body > aside").first(),n=$($("body > aside")[1]),t.addClass("col-xs-12 col-sm-6"),a="col-xs-6 col-sm-3 sidebar-offcanvas",e.addClass(a+" sidebar-offcanvas-left"),n.addClass(a+" sidebar-offcanvas-right"),$("body").append(e).append(t).append(n),h(),i=p(d("right")+d("left")),t.prepend(i)},$.fn.extend({toggleText:function(t,e){return this.text(this.text()===e?t:e),this}}),$(window).ready(function(){switch(!1){case!$("body").hasClass("right-sidebar"):c("right");break;case!$("body").hasClass("left-sidebar"):c("left");break;case!$("body").hasClass("two-sidebar"):a()}return $('[data-toggle="offcanvas-left"]').click(function(){return $(".row-offcanvas").removeClass("right-active").toggleClass("left-active"),$(this).find("i.material-icons").toggleText("chevron_left chevron_right")}),$('[data-toggle="offcanvas-right"]').click(function(){return $(".row-offcanvas").removeClass("left-active").toggleClass("right-active"),$(this).find("i.material-icons").toggleText("chevron_left chevron_right")})}),$(window).ready(function(){return $("._navbox").autocomplete({html:"html",source:o,select:r})}),l=0,o=function(t,e){var n,a;return n=this.element.closest("form"),a=n.serialize()+"&view=complete",this.xhr=$.ajax({url:wagn.prepUrl(wagn.rootPath+"/:search.json"),data:a,dataType:"json",wagReq:++l,success:function(n){if(this.wagReq===l)return e(s(t.term,n))},error:function(){if(this.wagReq===l)return e([])}})},s=function(t,e){var n;return n=[],$.each(["search","add","new"],function(a,i){var o,r;if(r=e[i])return o={value:t,prefix:i,icon:"add",label:'<strong class="highlight">'+t+"</strong>"},"search"===i?(o.icon=i,o.term=t):"add"===i?o.href="/card/new?card[name]="+encodeURIComponent(r):"new"===i&&(o.type="add",o.href="/new/"+r[1]),n.push(o)}),$.each(e["goto"],function(t,e){return n.push({icon:"arrow_forward",prefix:"go to",value:e[0],label:e[1],href:"/"+e[2]})}),$.each(n,function(t,e){return e.label='<i class="material-icons">'+e.icon+'</i><span class="navbox-item-label">'+e.prefix+':</span> <span class="navbox-item-value">'+e.label+"</span>"}),n},r=function(t,e){return e.item.term?$(this).closest("form").submit():window.location=wagn.rootPath+e.item.href,$(this).attr("disabled","disabled")},$.extend(wagn,{upload_file:function(t){var e,n;return $(t).bind("fileuploadsubmit",function(t,e){var n,a,i;return n=$(this),a=n.siblings(".attachment_card_name:first").attr("name"),i=n.siblings("#attachment_type_id").val(),e.formData={"card[type_id]":i,attachment_upload:a}}),e=$(t),n=e.closest("form").attr("action").indexOf("update")>-1?"/card/update/"+$(t).siblings("#file_card_name").val():"/card/create",$(t).fileupload({url:n,dataType:"html",done:wagn.doneFile,add:wagn.chooseFile,progressall:wagn.progressallFile})},chooseFile:function(t,e){var n;return e.form.find("button[type=submit]").attr("disabled",!0),n=$(this).closest(".card-editor"),$("#progress").show(),n.append('<input type="hidden" class="extra_upload_param" value="true" name="attachment_upload">'),n.append('<input type="hidden" class="extra_upload_param" value="preview_editor" name="view">'),e.submit(),n.find(".choose-file").hide(),n.find(".extra_upload_param").remove()},progressallFile:function(t,e){var n;return n=parseInt(e.loaded/e.total*100,10),$("#progress .progress-bar").css("width",n+"%")},doneFile:function(t,e){var n;return n=$(this).closest(".card-editor"),n.find(".chosen-file").replaceWith(e.result),e.form.find("button[type=submit]").attr("disabled",!1)}}),$(window).ready(function(){return $("body").on("click",".cancel-upload",function(){var t;return t=$(this).closest(".card-editor"),t.find(".choose-file").show(),t.find(".chosen-file").empty(),t.find(".progress").show(),t.find("#progress .progress-bar").css("width","0%"),t.find("#progress").hide()})}),$.extend(wagn,{initializeEditors:function(t,e){return null==e&&(e=wagn.editorInitFunctionMap),$.each(e,function(e,n){return $.each(t.find(e),function(){return n.call($(this))})})},prepUrl:function(t,e){var n,a,i;return i={},n=$("#main").children(".card-slot").data("cardName"),null!=n&&(i.main=n),e&&(e.isMain()&&(i.is_main=!0),null!=(a=e.data("slot"))&&wagn.slotParams(a,i,"slot")),t+(t.match(/\?/)?"&":"?")+$.param(i)},slotParams:function(t,e,n){return $.each(t,function(t,a){var i;return i=n+"["+u(t)+"]","items"===t?wagn.slotParams(a,e,i):e[i]=a})},slotReady:function(t){return $("document").ready(function(){return $("body").on("slotReady",".card-slot",function(e){return e.stopPropagation(),t.call(this,$(this))})})},pingName:function(t,e){return $.getJSON(wagn.rootPath+"/",{format:"json",view:"status","card[name]":t},e)},isTouchDevice:function(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)||n()}},n=function(t){return t=navigator.userAgent||navigator.vendor||window.opera,/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}),jQuery.fn.extend({slot:function(t){return null==t&&(t="success"),this.data("slot-"+t+"-selector")?this.findSlot(this.data("slot-"+t+"-selector")):this.data("slot-selector")?this.findSlot(this.data("slot-selector")):this.closest(".card-slot")},findSlot:function(t){var e,n;for(n=this.closest(t),e=this.closest(".card-slot");0===n.length&&e.length>0;)n=$(e).find(t),e=$(e).parent().closest(".card-slot");return 0===n.length?$(t):n},setSlotContent:function(t){var e,n;return e=this.slot(),n=$(t),n[0]||(n=t),e.replaceWith(n),n.trigger("slotReady"),n},slotSuccess:function(t){var e,n;return t.redirect?window.location=t.redirect:(n=this.attr("notify-success"),e=this.setSlotContent(t),e.jquery&&(wagn.initializeEditors(e),null!=n)?e.notify(n,"success"):void 0)},slotError:function(t,e){return 403===t?this.setSlotContent(e):(this.notify(e,"error"),409===t?this.slot().find(".current_revision_id").val(this.slot().find(".new-current-revision-id").text()):449===t?this.slot().find("g-recaptcha").reloadCaptcha():void 0)},notify:function(t,e){var n,a,i;return i=this.slot(e),a=i.find(".card-notice"),a[0]||(a=$('<div class="card-notice"></div>'),n=i.find(".card-form"),n[0]?$(n[0]).append(a):i.append(a)),a.html(t),a.show("blind")},report:function(t){var e;return e=this.slot().find(".card-report"),!!e[0]&&(e.hide(),e.html(t),e.show("drop",750),setTimeout(function(){return e.hide("drop",750)},3e3))},isMain:function(){return this.slot().parent("#main")[0]},reloadCaptcha:function(){return this[0].empty(),grecaptcha.render(this[0],{sitekey:wagn.recaptchaKey})},autosave:function(){var t,e,n,a,i;if(a=this.slot(),!this.attr("no-autosave")){if(n=this.closest(".form-group"),n[0]){if(!(e=n.data("cardId")))return;": "+n.data("cardName")}else e=a.data("cardId"),"";return i=wagn.rootPath+"/update/~"+e,t=$("#edit_card_"+e).serializeArray().reduce(function(t,e){return t[e.name]=e.value,t},{draft:"true","success[view]":"blank"}),$.ajax(i,{data:t,type:"POST"})}}}),setInterval(function(){return $(".card-form").setContentFieldsFromMap()},2e4),$(window).ready(function(){return $.ajaxSetup({cache:!1}),setTimeout(function(){return wagn.initializeEditors($("body"))},10),$("body").on("ajax:success",".slotter",function(t,e){var n;if(!t.slotSuccessful)return n=$(this).slot().offset().top,$(this).slotSuccess(e),$(this).hasClass("close-modal")&&$(this).closest(".modal").modal("hide"),$(this).hasClass("card-paging-link")&&$("body").scrollTop(n),t.slotSuccessful=!0}),$("body").on("loaded.bs.modal",null,function(t){if(!t.slotSuccessful)return wagn.initializeEditors($(t.target)),$(t.target).find(".card-slot").trigger("slotReady"),t.slotSuccessful=!0}),$("body").on("ajax:error",".slotter",function(t,e){return $(this).slotError(e.status,e.responseText)}),$("body").on("click","button.slotter",function(){return!!$.rails.allowAction($(this))&&$.rails.handleRemote($(this))}),$("body").on("ajax:beforeSend",".slotter",function(e,n,a){var o,r,s,l,d;if(!a.skip_before_send&&(a.url.match(/home_view/)||(a.url=wagn.prepUrl(a.url,$(this).slot())),$(this).is("form"))){if(wagn.recaptchaKey&&"on"===$(this).attr("recaptcha")&&!$(this).find(".g-recaptcha")[0])return $(".g-recaptcha")[0]?t(this):i(this),!1;if(r=$(this).data("file-data"))return l=$(this).find(".file-upload"),l[1]?($(this).notify("Wagn does not yet support multiple files in a single form.","error"),!1):(d=l.data("blueimpFileupload"),d._isXHRUpload(d.options)||($(this).find("[name=success]").val("_self"),a.url+="&simulate_xhr=true",s=function(t){return t.find("body").html()},a.dataFilter=s),o=$.extend(a,d._getAJAXSettings(r),{url:a.url}),o.skip_before_send=!0,$.ajax(o),!1)}}),$("body").on("submit",".card-form",function(){return $(this).setContentFieldsFromMap(),$(this).find(".d0-card-content").attr("no-autosave","true"),!0}),$("body").on("click",".submitter",function(){return $(this).closest("form").submit()}),$("body").on("click",".renamer-updater",function(){return $(this).closest("form").find("#card_update_referers").val("true")}),$("body").on("submit",".edit_name-view .card-form",function(){var t;if(t=$(this).find(".alert"),t.is(":hidden"))return $(this).find("#referers").val()>0&&$(this).find(".renamer-updater").show(),t.show("blind"),!1}),$("body").on("click",".follow-updater",function(){return $(this).closest("form").find("#card_update_all_users").val("true")}),$("body").on("submit",".edit-view.SELF-Xfollow_default .card-form",function(){var t;if(t=$(this).find(".confirm_update_all-view"),t.is(":hidden"))return $(this).find(".follow-updater").show(),t.show("blind"),!1}),$("body").on("click","button.redirecter",function(){return window.location=$(this).attr("href")}),wagn.noDoubleClick||$("body").on("dblclick","div",function(){var t,e;return e=$(this),!e.closest(".nodblclick")[0]&&(!e.closest(".d0-card-header")[0]&&(t=e.slot(),!t.find(".card-editor")[0]&&(!!t.data("cardId")&&(t.addClass("slotter"),t.attr("href",wagn.rootPath+"/card/edit/~"+t.data("cardId")),$.rails.handleRemote(t),!1))))}),$("body").on("submit","form.slotter",function(){var t,e;if((e=$(this).attr("main-success"))&&$(this).isMain()&&(t=$(this).find("[name=success]"))&&!t.val().match(/^REDIRECT/))return t.val("REDIRECT"===e?e+": "+t.val():e)}),$("body").on("change",".live-type-field",function(){return $(this).data("params",$(this).closest("form").serialize()),$(this).data("url",$(this).attr("href"))}),$("body").on("change",".edit-type-field",function(){return $(this).closest("form").submit()}),$("body").on("change",".autosave .d0-card-content",function(){var t;return t=$(this),setTimeout(function(){return t.autosave()},500)}),$("body").on("mouseenter","[hover_content]",function(){return $(this).attr("hover_restore",$(this).html()),$(this).html($(this).attr("hover_content"))}),$("body").on("mouseleave","[hover_content]",function(){return $(this).html($(this).attr("hover_restore"))}),$("body").on("keyup",".name-editor input",function(){var t,e;return t=$(this),e=t.val(),wagn.pingName(e,function(n){var a,i,o,r,s,l;return t.val()!==e?null:(l=n.status,l?(a=t.parent(),i=t.closest("fieldset").find("legend"),o=i.find(".name-messages"),o[0]||(o=$('<span class="name-messages"></span>'),i.append(o)),a.removeClass("real-name virtual-name known-name"),s=t.slot().data("cardId"),"unknown"===l||s&&parseInt(s)===n.id?o.html(""):(a.addClass(l+"-name known-name"),r="virtual"===l?"in virtual":"already in",o.html('"<a href="'+wagn.rootPath+"/"+n.url_key+'">'+e+'</a>" '+r+" use"))):void 0)})}),$("body").on("click",".render-error-link",function(t){var e;return e=$(this).closest(".render-error").find(".render-error-message"),e.show(),t.preventDefault()}),$("card-view-placeholder").each(function(){var t;return t=$(this),$.get(t.data("url"),function(e){return t.replaceWith(e)})})}),i=function(t){var e,n;return e=$("<div class='g-recaptcha' data-sitekey='"+wagn.recaptchaKey+"'></div>"),$(t).children().last().after(e),n="https://www.google.com/recaptcha/api.js",$.getScript(n)},t=function(t){var e;return e=$('<div class="g-recaptcha"></div>'),$(t).children().last().after(e),grecaptcha.render(e,{sitekey:wagn.recaptchaKey})},u=function(t){return t.replace(/([a-z])([A-Z])/g,function(t){return t[0]+"_"+t[1].toLowerCase()})},wagn.slotReady(function(t){return t.find("._disappear").delay(5e3).animate({height:0},1e3,function(){return $(this).hide()})})}).call(this);
7
+ (function(){var t,e,n,o,i,a,r,s,d,c,l,u,f,h,p;window.decko||(window.decko={}),$(window).ready(function(){var t;return $("body").on("click","._stop_propagation",function(t){return t.stopPropagation()}),$("body").on("click",".pointer-item-add",function(t){var e,n,o;return n=$(this).closest(".content-editor").find(".pointer-li:last"),o=n.clone(),e=o.find("input"),e.val(""),n.after(o),decko.initPointerList(e),t.preventDefault()}),$("body").on("click",".pointer-item-delete",function(){var t;return t=$(this).closest("li"),t.closest("ul").find(".pointer-li").length>1?t.remove():t.find("input").val("")}),$("body").on("show.bs.tab","a.load[data-toggle=tab][data-url]",function(t){var e,n;return e=$(t.target).attr("href"),n=$(t.target).data("url"),$(t.target).removeClass("load"),$(e).load(n)}),$("body").on("click",".toolbar-pin.active",function(t){return t.preventDefault(),$(this).blur(),$(".toolbar-pin").removeClass("active").addClass("inactive"),$.ajax("/*toolbar_pinned",{type:"PUT",data:"card[content]=false"})}),$("body").on("click",".toolbar-pin.inactive",function(t){return t.preventDefault(),$(this).blur(),$(".toolbar-pin").removeClass("inactive").addClass("active"),$.ajax("/*toolbar_pinned",{type:"PUT",data:"card[content]=true"})}),$("body").on("click",".btn-item-delete",function(){return $(this).find(".glyphicon").addClass("glyphicon-hourglass").removeClass("glyphicon-remove")}),$("body").on("click",".btn-item-add",function(){return $(this).find(".glyphicon").addClass("glyphicon-hourglass").removeClass("glyphicon-plus")}),$("body").on("mouseenter",".btn-item-delete",function(){return $(this).find(".glyphicon").addClass("glyphicon-remove").removeClass("glyphicon-ok"),$(this).addClass("btn-danger").removeClass("btn-primary")}),$("body").on("mouseleave",".btn-item-delete",function(){return $(this).find(".glyphicon").addClass("glyphicon-ok").removeClass("glyphicon-remove"),$(this).addClass("btn-primary").removeClass("btn-danger")}),$("body").on("hidden.bs.modal",function(t){var e,n,o,i,a;if(n=$(t.target).find(".modal-dialog > .modal-content"),"modal-main-slot"!==$(t.target).attr("id"))return i=$(t.target).slot(),e=i.find(".menu-slot:first"),a=decko.rootPath+"/~"+i.data("card-id"),o={view:"menu"},i.isMain()&&(o.is_main=!0),n.empty(),$.ajax(a,{type:"GET",data:o,success:function(t){return e.replaceWith(t)}})}),$("body").on("click",".perm-vals input",function(){return $(this).slot().find("#inherit").attr("checked",!1)}),$("body").on("click",".perm-editor #inherit",function(){var t;return t=$(this).slot(),t.find(".perm-group input:checked").attr("checked",!1),t.find(".perm-indiv input").val("")}),$("body").on("click",".rule-submit-button",function(){var t,e;return e=$(this).closest("form"),t=e.find(".set-editor input:checked"),t.val()?!t.attr("warning")||confirm(t.attr("warning")):(e.find(".set-editor").addClass("attention"),$(this).notify("To what Set does this Rule apply?"),!1)}),$("body").on("click",".submit-modal",function(){return $(this).closest(".modal-content").find("form").submit()}),$("body").on("click",".shade-view h1",function(){var t;if(t=$(this).slot().find(".shade-content").is(":hidden"),f($(this).closest(".pointer-list").find(".shade-content:visible").parent()),t)return f($(this).slot())}),(t=$(".shade-view h1")[0])&&$(t).trigger("click"),$("body").on("change",".go-to-selected select",function(){var t;if(""!==(t=$(this).val()))return window.location=decko.rootPath+escape(t)}),$("body").on("click",".open-slow-items",function(){var t;return t=$(this).closest(".panel-group"),t.find(".open-slow-items").removeClass("open-slow-items").addClass("close-slow-items"),t.find(".toggle-fast-items").text("show < 100ms"),t.find(".duration-ok").hide(),t.find(".panel-danger > .panel-collapse").collapse("show").find("a > span").addClass("show-fast-items")}),$("body").on("click",".close-slow-items",function(){var t;return t=$(this).closest(".panel-group"),t.find(".close-slow-items").removeClass("close-slow-items").addClass("open-slow-items"),t.find(".toggle-fast-items").text("hide < 100ms"),t.find(".panel-danger > .panel-collapse").collapse("hide").removeClass("show-fast-items"),t.find(".duration-ok").show()}),$("body").on("click",".toggle-fast-items",function(){var t;return t=$(this).closest(".panel-group"),"hide < 100ms"===$(this).text()?(t.find(".duration-ok").hide(),$(this).text("show < 100ms")):(t.find(".duration-ok").show(),$(this).text("hide < 100ms"))}),$("body").on("click",".show-fast-items",function(t){var e;return $(this).removeClass("show-fast-items"),e=$(this).closest(".panel-group"),e.find(".duration-ok").show(),e.find(".show-fast-items").removeClass("show-fast-items"),e.find(".panel-collapse").collapse("show"),t.stopPropagation()})}),f=function(t){return t.find(".shade-content").slideToggle(1e3),t.find(".glyphicon").toggleClass("glyphicon-triangle-right glpyphicon-triangle-bottom")},$.extend(decko,{editorContentFunctionMap:{},editorInitFunctionMap:{".date-editor":function(){return this.datepicker({dateFormat:"yy-mm-dd"})},textarea:function(){return $(this).autosize()},".file-upload":function(){return decko.upload_file(this)},".etherpad-textarea":function(){return $(this).closest("form").find(".edit-submit-button").attr("class","etherpad-submit-button")}},addEditor:function(t,e,n){return decko.editorContentFunctionMap[t]=n,decko.editorInitFunctionMap[t]=e}}),jQuery.fn.extend({setContentFieldsFromMap:function(t){var e;return null==t&&(t=decko.editorContentFunctionMap),e=$(this),$.each(t,function(t,n){return e.setContentFields(t,n)})},setContentFields:function(t,e){return $.each(this.find(t),function(){return $(this).setContentField(e)})},setContentField:function(t){var e,n,o;if(e=this.closest(".card-editor").find(".d0-card-content"),n=e.val(),o=t.call(this),e.val(o),n!==o)return e.change()}}),h=function(){var t;if(t=$("body > footer").first(),$("body > article, body > aside").wrapAll("<div class='"+e()+"'/>"),$("body > div > article, body > div > aside").wrapAll('<div class="row row-offcanvas">'),t)return $("body").append(t)},p=function(t){return"<div class='container'><div class='row'>"+t+"</div></div>"},e=function(){return $("body").hasClass("fluid")?"container-fluid":"container"},c=function(t){var e;return e="left"===t?"right":"left","<button class='offcanvas-toggle offcanvas-toggle-"+t+" btn btn-secondary hidden-sm-up' data-toggle='offcanvas-"+t+"'><i class='material-icons'>chevron-"+e+"</i></button>"},l=function(t){var e,n;return e=$("body > article").first(),n=$("body > aside").first(),e.addClass("col-xs-12 col-sm-9 col-md-9"),n.addClass("col-xs-6 col-sm-3 col-md-3 sidebar-offcanvas sidebar-offcanvas-"+t),"left"===t?$("body").append(n).append(e):$("body").append(e).append(n),h(),e.prepend(p(c(t)))},o=function(){var t,e,n,o,i;return t=$("body > article").first(),e=$("body > aside").first(),n=$($("body > aside")[1]),t.addClass("col-xs-12 col-sm-6"),o="col-xs-6 col-sm-3 sidebar-offcanvas",e.addClass(o+" sidebar-offcanvas-left"),n.addClass(o+" sidebar-offcanvas-right"),$("body").append(e).append(t).append(n),h(),i=p(c("right")+c("left")),t.prepend(i)},$.fn.extend({toggleText:function(t,e){return this.text(this.text()===e?t:e),this}}),$(window).ready(function(){switch(!1){case!$("body").hasClass("right-sidebar"):l("right");break;case!$("body").hasClass("left-sidebar"):l("left");break;case!$("body").hasClass("two-sidebar"):o()}return $('[data-toggle="offcanvas-left"]').click(function(){return $(".row-offcanvas").removeClass("right-active").toggleClass("left-active"),$(this).find("i.material-icons").toggleText("chevron_left chevron_right")}),$('[data-toggle="offcanvas-right"]').click(function(){return $(".row-offcanvas").removeClass("left-active").toggleClass("right-active"),$(this).find("i.material-icons").toggleText("chevron_left chevron_right")})}),$(window).ready(function(){return $("._navbox").autocomplete({html:"html",source:a,select:r})}),d=0,a=function(t,e){var n,o;return n=this.element.closest("form"),o=n.serialize()+"&view=complete",this.xhr=$.ajax({url:decko.prepUrl(decko.rootPath+"/:search.json"),data:o,dataType:"json",wagReq:++d,success:function(n){if(this.wagReq===d)return e(s(t.term,n))},error:function(){if(this.wagReq===d)return e([])}})},s=function(t,e){var n;return n=[],$.each(["search","add","new"],function(o,i){var a,r;if(r=e[i])return a={value:t,prefix:i,icon:"add",label:'<strong class="highlight">'+t+"</strong>"},"search"===i?(a.icon=i,a.term=t):"add"===i?a.href="/card/new?card[name]="+encodeURIComponent(r):"new"===i&&(a.type="add",a.href="/new/"+r[1]),n.push(a)}),$.each(e["goto"],function(t,e){return n.push({icon:"arrow_forward",prefix:"go to",value:e[0],label:e[1],href:"/"+e[2]})}),$.each(n,function(t,e){return e.label='<i class="material-icons">'+e.icon+'</i><span class="navbox-item-label">'+e.prefix+':</span> <span class="navbox-item-value">'+e.label+"</span>"}),n},r=function(t,e){return e.item.term?$(this).closest("form").submit():window.location=decko.rootPath+e.item.href,$(this).attr("disabled","disabled")},$.extend(decko,{upload_file:function(t){var e,n;return $(t).bind("fileuploadsubmit",function(t,e){var n,o,i;return n=$(this),o=n.siblings(".attachment_card_name:first").attr("name"),i=n.siblings("#attachment_type_id").val(),e.formData={"card[type_id]":i,attachment_upload:o}}),e=$(t),n=e.closest("form").attr("action").indexOf("update")>-1?"/card/update/"+$(t).siblings("#file_card_name").val():"/card/create",$(t).fileupload({url:n,dataType:"html",done:decko.doneFile,add:decko.chooseFile,progressall:decko.progressallFile})},chooseFile:function(t,e){var n;return e.form.find("button[type=submit]").attr("disabled",!0),n=$(this).closest(".card-editor"),$("#progress").show(),n.append('<input type="hidden" class="extra_upload_param" value="true" name="attachment_upload">'),n.append('<input type="hidden" class="extra_upload_param" value="preview_editor" name="view">'),e.submit(),n.find(".choose-file").hide(),n.find(".extra_upload_param").remove()},progressallFile:function(t,e){var n;return n=parseInt(e.loaded/e.total*100,10),$("#progress .progress-bar").css("width",n+"%")},doneFile:function(t,e){var n;return n=$(this).closest(".card-editor"),n.find(".chosen-file").replaceWith(e.result),e.form.find("button[type=submit]").attr("disabled",!1)}}),$(window).ready(function(){return $("body").on("click",".cancel-upload",function(){var t;return t=$(this).closest(".card-editor"),t.find(".choose-file").show(),t.find(".chosen-file").empty(),t.find(".progress").show(),t.find("#progress .progress-bar").css("width","0%"),t.find("#progress").hide()})}),$.extend(decko,{initializeEditors:function(t,e){return null==e&&(e=decko.editorInitFunctionMap),$.each(e,function(e,n){return $.each(t.find(e),function(){return n.call($(this))})})},prepUrl:function(t,e){var n,o,i;return i={},n=$("#main").children(".card-slot").data("cardName"),null!=n&&(i.main=n),e&&(e.isMain()&&(i.is_main=!0),null!=(o=e.data("slot"))&&decko.slotParams(o,i,"slot")),t+(t.match(/\?/)?"&":"?")+$.param(i)},slotParams:function(t,e,n){return $.each(t,function(t,o){var i;return i=n+"["+u(t)+"]","items"===t?decko.slotParams(o,e,i):e[i]=o})},slotReady:function(t){return $("document").ready(function(){return $("body").on("slotReady",".card-slot",function(e){return e.stopPropagation(),t.call(this,$(this))})})},pingName:function(t,e){return $.getJSON(decko.rootPath+"/",{format:"json",view:"status","card[name]":t},e)},isTouchDevice:function(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)||n()}},n=function(t){return t=navigator.userAgent||navigator.vendor||window.opera,/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}),jQuery.fn.extend({slot:function(t){return null==t&&(t="success"),this.data("slot-"+t+"-selector")?this.findSlot(this.data("slot-"+t+"-selector")):this.data("slot-selector")?this.findSlot(this.data("slot-selector")):this.closest(".card-slot")},findSlot:function(t){var e,n;for(n=this.closest(t),e=this.closest(".card-slot");0===n.length&&e.length>0;)n=$(e).find(t),e=$(e).parent().closest(".card-slot");return 0===n.length?$(t):n},setSlotContent:function(t){var e,n;return e=this.slot(),n=$(t),n[0]||(n=t),e.replaceWith(n),n.trigger("slotReady"),n},slotSuccess:function(t){var e,n;return t.redirect?window.location=t.redirect:(n=this.attr("notify-success"),e=this.setSlotContent(t),e.jquery&&(decko.initializeEditors(e),null!=n)?e.notify(n,"success"):void 0)},slotError:function(t,e){return 403===t?this.setSlotContent(e):(this.notify(e,"error"),409===t?this.slot().find(".current_revision_id").val(this.slot().find(".new-current-revision-id").text()):449===t?this.slot().find("g-recaptcha").reloadCaptcha():void 0)},notify:function(t,e){var n,o,i;return i=this.slot(e),o=i.find(".card-notice"),o[0]||(o=$('<div class="card-notice"></div>'),n=i.find(".card-form"),n[0]?$(n[0]).append(o):i.append(o)),o.html(t),o.show("blind")},report:function(t){var e;return e=this.slot().find(".card-report"),!!e[0]&&(e.hide(),e.html(t),e.show("drop",750),setTimeout(function(){return e.hide("drop",750)},3e3))},isMain:function(){return this.slot().parent("#main")[0]},reloadCaptcha:function(){return this[0].empty(),grecaptcha.render(this[0],{sitekey:decko.recaptchaKey})},autosave:function(){var t,e,n,o,i;if(o=this.slot(),!this.attr("no-autosave")){if(n=this.closest(".form-group"),n[0]){if(!(e=n.data("cardId")))return;": "+n.data("cardName")}else e=o.data("cardId"),"";return i=decko.rootPath+"/update/~"+e,t=$("#edit_card_"+e).serializeArray().reduce(function(t,e){return t[e.name]=e.value,t},{draft:"true","success[view]":"blank"}),$.ajax(i,{data:t,type:"POST"})}}}),setInterval(function(){return $(".card-form").setContentFieldsFromMap()},2e4),$(window).ready(function(){return $.ajaxSetup({cache:!1}),setTimeout(function(){return decko.initializeEditors($("body"))},10),$("body").on("ajax:success",".slotter",function(t,e){var n;if(!t.slotSuccessful)return n=$(this).slot().offset().top,$(this).slotSuccess(e),$(this).hasClass("close-modal")&&$(this).closest(".modal").modal("hide"),$(this).hasClass("card-paging-link")&&$("body").scrollTop(n),t.slotSuccessful=!0}),$("body").on("loaded.bs.modal",null,function(t){if(!t.slotSuccessful)return decko.initializeEditors($(t.target)),$(t.target).find(".card-slot").trigger("slotReady"),t.slotSuccessful=!0}),$("body").on("ajax:error",".slotter",function(t,e){return $(this).slotError(e.status,e.responseText)}),$("body").on("click","button.slotter",function(){return!!$.rails.allowAction($(this))&&$.rails.handleRemote($(this))}),$("body").on("ajax:beforeSend",".slotter",function(e,n,o){var a,r,s,d,c;if(!o.skip_before_send&&(o.url.match(/home_view/)||(o.url=decko.prepUrl(o.url,$(this).slot())),$(this).is("form"))){if(decko.recaptchaKey&&"on"===$(this).attr("recaptcha")&&!$(this).find(".g-recaptcha")[0])return $(".g-recaptcha")[0]?t(this):i(this),!1;if(r=$(this).data("file-data"))return d=$(this).find(".file-upload"),d[1]?($(this).notify("Wagn does not yet support multiple files in a single form.","error"),!1):(c=d.data("blueimpFileupload"),c._isXHRUpload(c.options)||($(this).find("[name=success]").val("_self"),o.url+="&simulate_xhr=true",s=function(t){return t.find("body").html()},o.dataFilter=s),a=$.extend(o,c._getAJAXSettings(r),{url:o.url}),a.skip_before_send=!0,$.ajax(a),!1)}}),$("body").on("submit",".card-form",function(){return $(this).setContentFieldsFromMap(),$(this).find(".d0-card-content").attr("no-autosave","true"),!0}),$("body").on("click",".submitter",function(){return $(this).closest("form").submit()}),$("body").on("click",".renamer-updater",function(){return $(this).closest("form").find("#card_update_referers").val("true")}),$("body").on("submit",".edit_name-view .card-form",function(){var t;if(t=$(this).find(".alert"),t.is(":hidden"))return $(this).find("#referers").val()>0&&$(this).find(".renamer-updater").show(),t.show("blind"),!1}),$("body").on("click",".follow-updater",function(){return $(this).closest("form").find("#card_update_all_users").val("true")}),$("body").on("submit",".edit-view.SELF-Xfollow_default .card-form",function(){var t;if(t=$(this).find(".confirm_update_all-view"),t.is(":hidden"))return $(this).find(".follow-updater").show(),t.show("blind"),!1}),$("body").on("click","button.redirecter",function(){return window.location=$(this).attr("href")}),decko.noDoubleClick||$("body").on("dblclick","div",function(){var t,e;return e=$(this),!e.closest(".nodblclick")[0]&&(!e.closest(".d0-card-header")[0]&&(t=e.slot(),!t.find(".card-editor")[0]&&(!!t.data("cardId")&&(t.addClass("slotter"),t.attr("href",decko.rootPath+"/card/edit/~"+t.data("cardId")),$.rails.handleRemote(t),!1))))}),$("body").on("submit","form.slotter",function(){var t,e;if((e=$(this).attr("main-success"))&&$(this).isMain()&&(t=$(this).find("[name=success]"))&&!t.val().match(/^REDIRECT/))return t.val("REDIRECT"===e?e+": "+t.val():e)}),$("body").on("change",".live-type-field",function(){return $(this).data("params",$(this).closest("form").serialize()),$(this).data("url",$(this).attr("href"))}),$("body").on("change",".edit-type-field",function(){return $(this).closest("form").submit()}),$("body").on("change",".autosave .d0-card-content",function(){var t;return t=$(this),setTimeout(function(){return t.autosave()},500)}),$("body").on("mouseenter","[hover_content]",function(){return $(this).attr("hover_restore",$(this).html()),$(this).html($(this).attr("hover_content"))}),$("body").on("mouseleave","[hover_content]",function(){return $(this).html($(this).attr("hover_restore"))}),$("body").on("keyup",".name-editor input",function(){var t,e;return t=$(this),e=t.val(),decko.pingName(e,function(n){var o,i,a,r,s,d;return t.val()!==e?null:(d=n.status,d?(o=t.parent(),i=t.closest("fieldset").find("legend"),a=i.find(".name-messages"),a[0]||(a=$('<span class="name-messages"></span>'),i.append(a)),o.removeClass("real-name virtual-name known-name"),s=t.slot().data("cardId"),"unknown"===d||s&&parseInt(s)===n.id?a.html(""):(o.addClass(d+"-name known-name"),r="virtual"===d?"in virtual":"already in",a.html('"<a href="'+decko.rootPath+"/"+n.url_key+'">'+e+'</a>" '+r+" use"))):void 0)})}),$("body").on("click",".render-error-link",function(t){var e;return e=$(this).closest(".render-error").find(".render-error-message"),e.show(),t.preventDefault()}),$("card-view-placeholder").each(function(){var t;return t=$(this),$.get(t.data("url"),function(e){return t.replaceWith(e)})})}),i=function(t){var e,n;return e=$("<div class='g-recaptcha' data-sitekey='"+decko.recaptchaKey+"'></div>"),$(t).children().last().after(e),n="https://www.google.com/recaptcha/api.js",$.getScript(n)},t=function(t){var e;return e=$('<div class="g-recaptcha"></div>'),$(t).children().last().after(e),grecaptcha.render(e,{sitekey:decko.recaptchaKey})},u=function(t){return t.replace(/([a-z])([A-Z])/g,function(t){return t[0]+"_"+t[1].toLowerCase()})},decko.slotReady(function(t){return t.find("._disappear").delay(5e3).animate({height:0},1e3,function(){return $(this).hide()})})}).call(this);
8
8
  //script: card menu
9
- (function(){wagn.slotReady(function(o){var n;if(null!=(n=$(o).find(".open-menu.dropdown-toggle")))return $(n).dropdown("toggle")}),$(window).ready(function(){if($("body").on("click",".toolbar .nav-pills > li",function(){return $(this).tab("show")}),wagn.isTouchDevice())return $("._show-on-hover").removeClass("_show-on-hover")})}).call(this);
9
+ (function(){decko.slotReady(function(o){var n;if(null!=(n=$(o).find(".open-menu.dropdown-toggle")))return $(n).dropdown("toggle")}),$(window).ready(function(){if($("body").on("click",".toolbar .nav-pills > li",function(){return $(this).tab("show")}),decko.isTouchDevice())return $("._show-on-hover").removeClass("_show-on-hover")})}).call(this);
10
10
  //script: jquery helper
11
11
  /*! jQuery UI - v1.9.2 - 2012-11-23
12
12
  * http://jqueryui.com
@@ -63,13 +63,13 @@ function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery",
63
63
  */
64
64
  function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(window.jQuery)}(function(t){"use strict";var e=0;t.ajaxTransport("iframe",function(i){if(i.async){var s,n,a;return{send:function(o,r){s=t('<form style="display:none;"></form>'),s.attr("accept-charset",i.formAcceptCharset),a=/\?/.test(i.url)?"&":"?","DELETE"===i.type?(i.url=i.url+a+"_method=DELETE",i.type="POST"):"PUT"===i.type?(i.url=i.url+a+"_method=PUT",i.type="POST"):"PATCH"===i.type&&(i.url=i.url+a+"_method=PATCH",i.type="POST"),n=t('<iframe src="javascript:false;" name="iframe-transport-'+(e+=1)+'"></iframe>').bind("load",function(){var e,a=t.isArray(i.paramName)?i.paramName:[i.paramName];n.unbind("load").bind("load",function(){var e;try{if(e=n.contents(),!e.length||!e[0].firstChild)throw new Error}catch(t){e=undefined}r(200,"success",{iframe:e}),t('<iframe src="javascript:false;"></iframe>').appendTo(s),s.remove()}),s.prop("target",n.prop("name")).prop("action",i.url).prop("method",i.type),i.formData&&t.each(i.formData,function(e,i){t('<input type="hidden"/>').prop("name",i.name).val(i.value).appendTo(s)}),i.fileInput&&i.fileInput.length&&"POST"===i.type&&(e=i.fileInput.clone(),i.fileInput.after(function(t){return e[t]}),i.paramName&&i.fileInput.each(function(e){t(this).prop("name",a[e]||i.paramName)}),s.append(i.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data")),s.submit(),e&&e.length&&i.fileInput.each(function(i,s){var n=t(e[i]);t(s).prop("name",n.prop("name")),n.replaceWith(s)})}),s.append(n).appendTo(document.body)},abort:function(){n&&n.unbind("load").prop("src","javascript".concat(":false;")),s&&s.remove()}}}}),t.ajaxSetup({converters:{"iframe text":function(e){return e&&t(e[0].body).text()},"iframe json":function(e){return e&&t.parseJSON(t(e[0].body).text())},"iframe html":function(e){return e&&t(e[0].body).html()},"iframe script":function(e){return e&&t.globalEval(t(e[0].body).text())}}})}),function(t,e){t.rails!==e&&t.error("jquery-ujs has already been loaded!");var i,s=t(document);t.rails=i={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote], a[data-disable-with], a[data-disable]",buttonClickSelector:"button[data-remote]:not(form button), button[data-confirm]:not(form button)",inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form",formInputClickSelector:"form input[type=submit], form input[type=image], form button[type=submit], form button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])",disableSelector:"input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled",enableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled",requiredInputSelector:"input[name][required]:not([disabled]),textarea[name][required]:not([disabled])",fileInputSelector:"input[type=file]",linkDisableSelector:"a[data-disable-with], a[data-disable]",buttonDisableSelector:"button[data-remote][data-disable-with], button[data-remote][data-disable]",CSRFProtection:function(e){var i=t('meta[name="csrf-token"]').attr("content");i&&e.setRequestHeader("X-CSRF-Token",i)},refreshCSRFTokens:function(){var e=t("meta[name=csrf-token]").attr("content"),i=t("meta[name=csrf-param]").attr("content");t('form input[name="'+i+'"]').val(e)},fire:function(e,i,s){var n=t.Event(i);return e.trigger(n,s),!1!==n.result},confirm:function(t){return confirm(t)},ajax:function(e){return t.ajax(e)},href:function(t){return t.attr("href")},handleRemote:function(s){var n,a,o,r,l,h,c,u;if(i.fire(s,"ajax:before")){if(r=s.data("cross-domain"),l=r===e?null:r,h=s.data("with-credentials")||null,c=s.data("type")||t.ajaxSettings&&t.ajaxSettings.dataType,s.is("form")){n=s.attr("method"),a=s.attr("action"),o=s.serializeArray();var d=s.data("ujs:submit-button");d&&(o.push(d),s.data("ujs:submit-button",null))}else s.is(i.inputChangeSelector)?(n=s.data("method"),a=s.data("url"),o=s.serialize(),s.data("params")&&(o=o+"&"+s.data("params"))):s.is(i.buttonClickSelector)?(n=s.data("method")||"get",a=s.data("url"),o=s.serialize(),s.data("params")&&(o=o+"&"+s.data("params"))):(n=s.data("method"),a=i.href(s),o=s.data("params")||null);return u={type:n||"GET",data:o,dataType:c,beforeSend:function(t,n){if(n.dataType===e&&t.setRequestHeader("accept","*/*;q=0.5, "+n.accepts.script),!i.fire(s,"ajax:beforeSend",[t,n]))return!1;s.trigger("ajax:send",t)},success:function(t,e,i){s.trigger("ajax:success",[t,e,i])},complete:function(t,e){s.trigger("ajax:complete",[t,e])},error:function(t,e,i){s.trigger("ajax:error",[t,e,i])},crossDomain:l},h&&(u.xhrFields={withCredentials:h}),a&&(u.url=a),i.ajax(u)}return!1},handleMethod:function(s){var n=i.href(s),a=s.data("method"),o=s.attr("target"),r=t("meta[name=csrf-token]").attr("content"),l=t("meta[name=csrf-param]").attr("content"),h=t('<form method="post" action="'+n+'"></form>'),c='<input name="_method" value="'+a+'" type="hidden" />';l!==e&&r!==e&&(c+='<input name="'+l+'" value="'+r+'" type="hidden" />'),o&&h.attr("target",o),h.hide().append(c).appendTo("body"),h.submit()},formElements:function(e,i){return e.is("form")?t(e[0].elements).filter(i):e.find(i)},disableFormElements:function(e){i.formElements(e,i.disableSelector).each(function(){i.disableFormElement(t(this))})},disableFormElement:function(t){var i,s;i=t.is("button")?"html":"val",s=t.data("disable-with"),t.data("ujs:enable-with",t[i]()),s!==e&&t[i](s),t.prop("disabled",!0)},enableFormElements:function(e){i.formElements(e,i.enableSelector).each(function(){i.enableFormElement(t(this))})},enableFormElement:function(t){var e=t.is("button")?"html":"val";t.data("ujs:enable-with")&&t[e](t.data("ujs:enable-with")),t.prop("disabled",!1)},allowAction:function(t){var e,s=t.data("confirm"),n=!1;return!s||(i.fire(t,"confirm")&&(n=i.confirm(s),e=i.fire(t,"confirm:complete",[n])),n&&e)},blankInputs:function(e,i,s){var n,a,o=t(),r=i||"input,textarea",l=e.find(r);return l.each(function(){if(n=t(this),!(a=n.is("input[type=checkbox],input[type=radio]")?n.is(":checked"):n.val())==!s){if(n.is("input[type=radio]")&&l.filter('input[type=radio]:checked[name="'+n.attr("name")+'"]').length)return!0;o=o.add(n)}}),!!o.length&&o},nonBlankInputs:function(t,e){return i.blankInputs(t,e,!0)},stopEverything:function(e){return t(e.target).trigger("ujs:everythingStopped"),e.stopImmediatePropagation(),!1},disableElement:function(t){var s=t.data("disable-with");t.data("ujs:enable-with",t.html()),s!==e&&t.html(s),t.bind("click.railsDisable",function(t){return i.stopEverything(t)})},enableElement:function(t){t.data("ujs:enable-with")!==e&&(t.html(t.data("ujs:enable-with")),t.removeData("ujs:enable-with")),t.unbind("click.railsDisable")}},i.fire(s,"rails:attachBindings")&&(t.ajaxPrefilter(function(t,e,s){t.crossDomain||i.CSRFProtection(s)}),t(window).on("pageshow.rails",function(){t(t.rails.enableSelector).each(function(){var e=t(this);e.data("ujs:enable-with")&&t.rails.enableFormElement(e)}),t(t.rails.linkDisableSelector).each(function(){var e=t(this);e.data("ujs:enable-with")&&t.rails.enableElement(e)})}),s.delegate(i.linkDisableSelector,"ajax:complete",function(){i.enableElement(t(this))}),s.delegate(i.buttonDisableSelector,"ajax:complete",function(){i.enableFormElement(t(this))}),s.delegate(i.linkClickSelector,"click.rails",function(s){var n=t(this),a=n.data("method"),o=n.data("params"),r=s.metaKey||s.ctrlKey;if(!i.allowAction(n))return i.stopEverything(s);if(!r&&n.is(i.linkDisableSelector)&&i.disableElement(n),n.data("remote")!==e){if(r&&(!a||"GET"===a)&&!o)return!0;var l=i.handleRemote(n);return!1===l?i.enableElement(n):l.fail(function(){i.enableElement(n)}),!1}return a?(i.handleMethod(n),!1):void 0}),s.delegate(i.buttonClickSelector,"click.rails",function(e){var s=t(this);if(!i.allowAction(s))return i.stopEverything(e);s.is(i.buttonDisableSelector)&&i.disableFormElement(s);var n=i.handleRemote(s);return!1===n?i.enableFormElement(s):n.fail(function(){i.enableFormElement(s)}),!1}),s.delegate(i.inputChangeSelector,"change.rails",function(e){var s=t(this);return i.allowAction(s)?(i.handleRemote(s),!1):i.stopEverything(e)}),s.delegate(i.formSubmitSelector,"submit.rails",function(s){var n,a,o=t(this),r=o.data("remote")!==e;if(!i.allowAction(o))return i.stopEverything(s);if(o.attr("novalidate")==e&&(n=i.blankInputs(o,i.requiredInputSelector))&&i.fire(o,"ajax:aborted:required",[n]))return i.stopEverything(s);if(r){if(a=i.nonBlankInputs(o,i.fileInputSelector)){setTimeout(function(){i.disableFormElements(o)},13);var l=i.fire(o,"ajax:aborted:file",[a]);return l||setTimeout(function(){i.enableFormElements(o)},13),l}return i.handleRemote(o),!1}setTimeout(function(){i.disableFormElements(o)},13)}),s.delegate(i.formInputClickSelector,"click.rails",function(e){var s=t(this);if(!i.allowAction(s))return i.stopEverything(e);var n=s.attr("name"),a=n?{name:n,value:s.val()}:null;s.closest("form").data("ujs:submit-button",a)}),s.delegate(i.formSubmitSelector,"ajax:send.rails",function(e){this==e.target&&i.disableFormElements(t(this))}),s.delegate(i.formSubmitSelector,"ajax:complete.rails",function(e){this==e.target&&i.enableFormElements(t(this))}),t(function(){i.refreshCSRFTokens()}))}(jQuery);
65
65
  //script: pointer config
66
- (function(){var t,n;$.extend(wagn.editorContentFunctionMap,{".pointer-select":function(){return n(this.val())},".pointer-multiselect":function(){return n(this.val())},".pointer-radio-list":function(){return n(this.find("input:checked").val())},".pointer-list-ul":function(){return n(this.find("input").map(function(){return $(this).val()}))},".pointer-checkbox-list":function(){return n(this.find("input:checked").map(function(){return $(this).val()}))},".pointer-select-list":function(){return n(this.find(".pointer-select select").map(function(){return $(this).val()}))},".pointer-mixed":function(){var t;return t=".pointer-checkbox-sublist input:checked,.pointer-sublist-ul input",n(this.find(t).map(function(){return $(this).val()}))},".perm-editor":function(){return t(this)}}),wagn.editorInitFunctionMap[".pointer-list-editor"]=function(){return this.sortable({handle:".handle",cancel:""}),wagn.initPointerList(this.find("input"))},$.extend(wagn,{initPointerList:function(t){var n;return n=t.closest("ul").data("options-card"),n||(n=t.closest(".pointer-list-editor").data("options-card")),t.autocomplete({source:wagn.prepUrl(wagn.rootPath+"/"+n+".json?view=name_complete")})}}),n=function(t){var n;return n=$.map($.makeArray(t),function(t){if(t)return"[["+t+"]]"}),$.makeArray(n).join("\n")},t=function(t){var i,e;return t.find("#inherit").is(":checked")?"_left":(i=t.find(".perm-group input:checked").map(function(){return $(this).val()}),e=t.find(".perm-indiv input").map(function(){return $(this).val()}),n($.makeArray(i).concat($.makeArray(e))))}}).call(this);
66
+ (function(){var t,n;$.extend(decko.editorContentFunctionMap,{".pointer-select":function(){return n(this.val())},".pointer-multiselect":function(){return n(this.val())},".pointer-radio-list":function(){return n(this.find("input:checked").val())},".pointer-list-ul":function(){return n(this.find("input").map(function(){return $(this).val()}))},".pointer-checkbox-list":function(){return n(this.find("input:checked").map(function(){return $(this).val()}))},".pointer-select-list":function(){return n(this.find(".pointer-select select").map(function(){return $(this).val()}))},".pointer-mixed":function(){var t;return t=".pointer-checkbox-sublist input:checked,.pointer-sublist-ul input",n(this.find(t).map(function(){return $(this).val()}))},".perm-editor":function(){return t(this)}}),decko.editorInitFunctionMap[".pointer-list-editor"]=function(){return this.sortable({handle:".handle",cancel:""}),decko.initPointerList(this.find("input"))},$.extend(decko,{initPointerList:function(t){var n;return n=t.closest("ul").data("options-card"),n||(n=t.closest(".pointer-list-editor").data("options-card")),t.autocomplete({source:decko.prepUrl(decko.rootPath+"/"+n+".json?view=name_complete")})}}),n=function(t){var n;return n=$.map($.makeArray(t),function(t){if(t)return"[["+t+"]]"}),$.makeArray(n).join("\n")},t=function(t){var i,e;return t.find("#inherit").is(":checked")?"_left":(i=t.find(".perm-group input:checked").map(function(){return $(this).val()}),e=t.find(".perm-indiv input").map(function(){return $(this).val()}),n($.makeArray(i).concat($.makeArray(e))))}}).call(this);
67
67
  //script: ace config
68
- (function(){var e;wagn.addEditor(".ace-editor-textarea",function(){return wagn.initAce($(this))},function(){return e(this[0])}),$.extend(wagn,{setAceConfig:function(e){var t;return t=function(){try{return $.parseJSON(e)}catch(e){return{}}},wagn.aceConfig=t()},configAceEditor:function(e,t){var n,i,r;return n={showGutter:!0,theme:"ace/theme/github",printMargin:!1,tabSize:2,useSoftTabs:!0,maxLines:30},i={mode:"ace/mode/"+t},r=null!=wagn.aceConfig?wagn.aceConfig:{},$.extend(n,r["default"],r[t],i),e.setOptions(n)},initAce:function(e){var t,n,i;if(!(i=e.attr("data-ace-mode")))return void e.autosize();t=$("<div>",{position:"absolute",width:"auto",height:e.height()}).insertBefore(e),e.css("visibility","hidden"),e.css("height","0px"),ace.config.set("basePath","/assets/ace"),n=ace.edit(t[0]),n.getSession().setValue(e.val()),wagn.configAceEditor(n,i)}}),e=function(e){var t,n;return t=$(e).siblings(".ace_editor"),n=ace.edit(t[0]),n.getSession().getValue()},$.extend(wagn,{initProseMirror:function(e){var t,n,i;return t={menuBar:!0,tooltipMenu:!1},n={docFormat:"html"},i=null!=wagn.proseMirrorConfig?wagn.proseMirrorConfig:{},$.extend(t,i,n),createProseMirror(e,t)}})}).call(this);
68
+ (function(){var e;decko.addEditor(".ace-editor-textarea",function(){return decko.initAce($(this))},function(){return e(this[0])}),$.extend(decko,{setAceConfig:function(e){var t;return t=function(){try{return $.parseJSON(e)}catch(e){return{}}},decko.aceConfig=t()},configAceEditor:function(e,t){var i,o,n;return i={showGutter:!0,theme:"ace/theme/github",printMargin:!1,tabSize:2,useSoftTabs:!0,maxLines:30},o={mode:"ace/mode/"+t},n=null!=decko.aceConfig?decko.aceConfig:{},$.extend(i,n["default"],n[t],o),e.setOptions(i)},initAce:function(e){var t,i,o;if(!(o=e.attr("data-ace-mode")))return void e.autosize();t=$("<div>",{position:"absolute",width:"auto",height:e.height()}).insertBefore(e),e.css("visibility","hidden"),e.css("height","0px"),ace.config.set("basePath","/assets/ace"),i=ace.edit(t[0]),i.getSession().setValue(e.val()),decko.configAceEditor(i,o)}}),e=function(e){var t,i;return t=$(e).siblings(".ace_editor"),i=ace.edit(t[0]),i.getSession().getValue()},$.extend(decko,{initProseMirror:function(e){var t,i,o;return t={menuBar:!0,tooltipMenu:!1},i={docFormat:"html"},o=null!=decko.proseMirrorConfig?decko.proseMirrorConfig:{},$.extend(t,o,i),createProseMirror(e,t)}})}).call(this);
69
69
  //script: prosemirror config
70
- (function(){var r;wagn.addEditor(".prosemirror-editor",function(){return wagn.initProseMirror(this[0].id)},function(){return r(this[0].id)}),$.extend(wagn,{setProseMirrorConfig:function(r){var n;return n=function(){try{return $.parseJSON(r)}catch(r){return{}}},wagn.proseMirrorConfig=n()},initProseMirror:function(r){var n,o,t;return n={menuBar:!0,tooltipMenu:!1},o={docFormat:"html"},t=null!=wagn.proseMirrorConfig?wagn.proseMirrorConfig:{},$.extend(n,t,o),createProseMirror(r,n)}}),r=function(r){var n;return n=getProseMirrorContent(r),"<p></p>"===n?"":n}}).call(this);
70
+ (function(){var r;decko.addEditor(".prosemirror-editor",function(){return decko.initProseMirror(this[0].id)},function(){return r(this[0].id)}),$.extend(decko,{setProseMirrorConfig:function(r){var o;return o=function(){try{return $.parseJSON(r)}catch(r){return{}}},decko.proseMirrorConfig=o()},initProseMirror:function(r){var o,e,n;return o={menuBar:!0,tooltipMenu:!1},e={docFormat:"html"},n=null!=decko.proseMirrorConfig?decko.proseMirrorConfig:{},$.extend(o,n,e),createProseMirror(r,o)}}),r=function(r){var o;return o=getProseMirrorContent(r),"<p></p>"===o?"":o}}).call(this);
71
71
  //script: tinymce config
72
- (function(){wagn.addEditor(".tinymce-textarea",function(){return wagn.initTinyMCE(this[0].id)},function(){return tinyMCE.get(this[0].id).getContent()}),$.extend(wagn,{setTinyMCEConfig:function(n){var t;return t=function(){try{return $.parseJSON(n)}catch(n){return{}}},wagn.tinyMCEConfig=t()},initTinyMCE:function(n){var t,i,e;return t={plugins:"autoresize",autoresize_max_height:500},e=null!=wagn.tinyMCEConfig?wagn.tinyMCEConfig:{},i={mode:"exact",elements:n,content_css:wagn.cssPath,entity_encoding:"raw"},$.extend(t,e,i),tinyMCE.init(t)}})}).call(this);
72
+ (function(){decko.addEditor(".tinymce-textarea",function(){return decko.initTinyMCE(this[0].id)},function(){return tinyMCE.get(this[0].id).getContent()}),$.extend(decko,{setTinyMCEConfig:function(n){var t;return t=function(){try{return $.parseJSON(n)}catch(n){return{}}},decko.tinyMCEConfig=t()},initTinyMCE:function(n){var t,e,i;return t={plugins:"autoresize",autoresize_max_height:500},i=null!=decko.tinyMCEConfig?decko.tinyMCEConfig:{},e={mode:"exact",elements:n,content_css:decko.cssPath,entity_encoding:"raw"},$.extend(t,i,e),tinyMCE.init(t)}})}).call(this);
73
73
  //script: ace
74
74
  /* ***** BEGIN LICENSE BLOCK *****
75
75
  * Distributed under the BSD license:
@@ -112,13 +112,13 @@ printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",s
112
112
  n.removeCssClass(this.container,"ace_focus")},this.showComposition=function(){this.$composition||(this.$composition={keepTextAreaAtCursor:this.$keepTextAreaAtCursor,cssText:this.textarea.style.cssText}),this.$keepTextAreaAtCursor=!0,n.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor()},this.setCompositionText=function(){this.$moveTextAreaToCursor()},this.hideComposition=function(){this.$composition&&(n.removeCssClass(this.textarea,"ace_composition"),this.$keepTextAreaAtCursor=this.$composition.keepTextAreaAtCursor,this.textarea.style.cssText=this.$composition.cssText,this.$composition=null)},this.setTheme=function(e,t){function i(i){if(o.$themeId!=e)return t&&t();if(i.cssClass){n.importCssString(i.cssText,i.cssClass,o.container.ownerDocument),o.theme&&n.removeCssClass(o.container,o.theme.cssClass);var s="padding"in i?i.padding:"padding"in(o.theme||{})?4:o.$padding;o.$padding&&s!=o.$padding&&o.setPadding(s),o.$theme=i.cssClass,o.theme=i,n.addCssClass(o.container,i.cssClass),n.setCssClass(o.container,"ace_dark",i.isDark),o.$size&&(o.$size.width=0,o.$updateSizeAsync()),o._dispatchEvent("themeLoaded",{theme:i}),t&&t()}}var o=this;if(this.$themeId=e,o._dispatchEvent("themeChange",{theme:e}),e&&"string"!=typeof e)i(e);else{var r=e||this.$options.theme.initialValue;s.loadModule(["theme",r],i)}},this.getTheme=function(){return this.$themeId},this.setStyle=function(e,t){n.setCssClass(this.container,e,!1!==t)},this.unsetStyle=function(e){n.removeCssClass(this.container,e)},this.setCursorStyle=function(e){this.scroller.style.cursor!=e&&(this.scroller.style.cursor=e)},this.setMouseCursor=function(e){this.scroller.style.cursor=e},this.destroy=function(){this.$textLayer.destroy(),this.$cursorLayer.destroy()}}).call(m.prototype),s.defineOptions(m.prototype,"renderer",{animatedScroll:{initialValue:!1},showInvisibles:{set:function(e){this.$textLayer.setShowInvisibles(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!1},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:!0},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(e){"number"==typeof e&&(this.$printMarginColumn=e),this.$showPrintMargin=!!e,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(e){this.$gutter.style.display=e?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},fadeFoldWidgets:{set:function(e){n.setCssClass(this.$gutter,"ace_fade-fold-widgets",e)},initialValue:!1},showFoldWidgets:{set:function(e){this.$gutterLayer.setShowFoldWidgets(e)},initialValue:!0},showLineNumbers:{set:function(e){this.$gutterLayer.setShowLineNumbers(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(e){this.$textLayer.setDisplayIndentGuides(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightGutterLine:{set:function(e){if(!this.$gutterLineHighlight)return this.$gutterLineHighlight=n.createElement("div"),this.$gutterLineHighlight.className="ace_gutter-active-line",void this.$gutter.appendChild(this.$gutterLineHighlight);this.$gutterLineHighlight.style.display=e?"":"none",this.$cursorLayer.$pixelPos&&this.$updateGutterLineHighlight()},initialValue:!1,value:!0},hScrollBarAlwaysVisible:{set:function(){this.$hScrollBarAlwaysVisible&&this.$horizScroll||this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(){this.$vScrollBarAlwaysVisible&&this.$vScroll||this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(e){"number"==typeof e&&(e+="px"),this.container.style.fontSize=e,this.updateFontSize()},initialValue:12},fontFamily:{set:function(e){this.container.style.fontFamily=e,this.updateFontSize()}},maxLines:{set:function(){this.updateFull()}},minLines:{set:function(){this.updateFull()}},scrollPastEnd:{set:function(e){e=+e||0,this.$scrollPastEnd!=e&&(this.$scrollPastEnd=e,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(e){this.$gutterLayer.$fixedWidth=!!e,this.$loop.schedule(this.CHANGE_GUTTER)}},theme:{set:function(e){this.setTheme(e)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0}}),t.VirtualRenderer=m}),define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(e,t){"use strict";var i=e("../lib/oop"),n=e("../lib/net"),s=e("../lib/event_emitter").EventEmitter,o=e("../config"),r=function(t,i,n,s){if(this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),e.nameToUrl&&!e.toUrl&&(e.toUrl=e.nameToUrl),o.get("packaged")||!e.toUrl)s=s||o.moduleUrl(i,"worker");else{var r=this.$normalizePath;s=s||r(e.toUrl("ace/worker/worker.js",null,"_"));var a={};t.forEach(function(t){a[t]=r(e.toUrl(t,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}try{this.$worker=new Worker(s)}catch(e){if(!(e instanceof window.DOMException))throw e;var l=this.$workerBlob(s),h=window.URL||window.webkitURL,c=h.createObjectURL(l);this.$worker=new Worker(c),h.revokeObjectURL(c)}this.$worker.postMessage({init:!0,tlns:a,module:i,classname:n}),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){i.implement(this,s),this.onMessage=function(e){var t=e.data;switch(t.type){case"event":this._signal(t.name,{data:t.data});break;case"call":var i=this.callbacks[t.id];i&&(i(t.data),delete this.callbacks[t.id]);break;case"error":this.reportError(t.data);break;case"log":window.console&&console.log&&console.log.apply(console,t.data)}},this.reportError=function(e){window.console&&console.error&&console.error(e)},this.$normalizePath=function(e){return n.qualifyURL(e)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(e,t){this.$worker.postMessage({command:e,args:t})},this.call=function(e,t,i){if(i){var n=this.callbackId++;this.callbacks[n]=i,t.push(n)}this.send(e,t)},this.emit=function(e,t){try{this.$worker.postMessage({event:e,data:{data:t.data}})}catch(e){console.error(e.stack)}},this.attachToDocument=function(e){this.$doc&&this.terminate(),this.$doc=e,this.call("setValue",[e.getValue()]),e.on("change",this.changeListener)},this.changeListener=function(e){this.deltaQueue?this.deltaQueue.push(e.data):(this.deltaQueue=[e.data],setTimeout(this.$sendDeltaQueue,0))},this.$sendDeltaQueue=function(){var e=this.deltaQueue;e&&(this.deltaQueue=null,e.length>20&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))},this.$workerBlob=function(e){var t="importScripts('"+n.qualifyURL(e)+"');";try{return new Blob([t],{type:"application/javascript"})}catch(e){var i=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,s=new i;return s.append(t),s.getBlob("application/javascript")}}}).call(r.prototype);var a=function(e,t,i){this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.callbackId=1,this.callbacks={},this.messageBuffer=[];var n=null,r=!1,a=Object.create(s),l=this;this.$worker={},this.$worker.terminate=function(){},this.$worker.postMessage=function(e){l.messageBuffer.push(e),n&&(r?setTimeout(h):h())},this.setEmitSync=function(e){r=e};var h=function(){var e=l.messageBuffer.shift();e.command?n[e.command].apply(n,e.args):e.event&&a._signal(e.event,e.data)};a.postMessage=function(e){l.onMessage({data:e})},a.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},a.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},o.loadModule(["worker",t],function(e){for(n=new e[i](a);l.messageBuffer.length;)h()})};a.prototype=r.prototype,t.UIWorkerClient=a,t.WorkerClient=r}),define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t){"use strict";var i=e("./range").Range,n=e("./lib/event_emitter").EventEmitter,s=e("./lib/oop"),o=function(e,t,i,n,s,o){var r=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=s,this.othersClass=o,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=n,this.$onCursorChange=function(){setTimeout(function(){r.onCursorChange()})},this.$pos=i;var a=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)};(function(){s.implement(this,n),this.setup=function(){var e=this,t=this.doc,n=this.session,s=this.$pos;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(s.row,s.column),this.markerId=n.addMarker(new i(s.row,s.column,s.row,s.column+this.length),this.mainClass,null,!1),this.pos.on("change",function(t){n.removeMarker(e.markerId),e.markerId=n.addMarker(new i(t.value.row,t.value.column,t.value.row,t.value.column+e.length),e.mainClass,null,!1)}),this.others=[],this.$others.forEach(function(i){var n=t.createAnchor(i.row,i.column);e.others.push(n)}),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=e.addMarker(new i(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1),n.on("change",function(s){e.removeMarker(n.markerId),n.markerId=e.addMarker(new i(s.value.row,s.value.column,s.value.row,s.value.column+t.length),t.othersClass,null,!1)})})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e<this.others.length;e++)this.session.removeMarker(this.others[e].markerId)}},this.onUpdate=function(e){var t=e.data,n=t.range;if(n.start.row===n.end.row&&n.start.row===this.pos.row&&!this.$updating){this.$updating=!0;var s="insertText"===t.action?n.end.column-n.start.column:n.start.column-n.end.column;if(n.start.column>=this.pos.column&&n.start.column<=this.pos.column+this.length+1){var o=n.start.column-this.pos.column;if(this.length+=s,!this.session.$fromUndo){if("insertText"===t.action)for(var r=this.others.length-1;r>=0;r--){var a=this.others[r],l={row:a.row,column:a.column+o};a.row===n.start.row&&n.start.column<a.column&&(l.column+=s),this.doc.insert(l,t.text)}else if("removeText"===t.action)for(var r=this.others.length-1;r>=0;r--){var a=this.others[r],l={row:a.row,column:a.column+o};a.row===n.start.row&&n.start.column<a.column&&(l.column+=s),this.doc.remove(new i(l.row,l.column,l.row,l.column-s))}n.start.column===this.pos.column&&"insertText"===t.action?setTimeout(function(){this.pos.setPosition(this.pos.row,this.pos.column-s);for(var e=0;e<this.others.length;e++){var t=this.others[e],i={row:t.row,column:t.column-s};t.row===n.start.row&&n.start.column<t.column&&(i.column+=s),t.setPosition(i.row,i.column)}}.bind(this),0):n.start.column===this.pos.column&&"removeText"===t.action&&setTimeout(function(){for(var e=0;e<this.others.length;e++){var t=this.others[e];t.row===n.start.row&&n.start.column<t.column&&t.setPosition(t.row,t.column-s)}}.bind(this),0)}this.pos._emit("change",{value:this.pos});for(var r=0;r<this.others.length;r++)this.others[r]._emit("change",{value:this.others[r]})}this.$updating=!1}},this.onCursorChange=function(e){if(!this.$updating&&this.session){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},this.detach=function(){this.session.removeMarker(this.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.pos.detach();for(var e=0;e<this.others.length;e++)this.others[e].detach();this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1===this.$undoStackDepth)throw Error("Canceling placeholders only supported with undo manager attached to session.");for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,i=0;i<t;i++)e.undo(!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}}).call(o.prototype),t.PlaceHolder=o}),define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t){function i(e,t){return e.row==t.row&&e.column==t.column}function n(e){var t=e.domEvent,n=t.altKey,r=t.shiftKey,a=t.ctrlKey,l=e.getAccelKey(),h=e.getButton();if(a&&o.isMac&&(h=t.button),e.editor.inMultiSelectMode&&2==h)return void e.editor.textInput.onContextMenu(e.domEvent);if(!a&&!n&&!l)return void(0===h&&e.editor.inMultiSelectMode&&e.editor.exitMultiSelectMode());if(0===h){var c,u=e.editor,d=u.selection,g=u.inMultiSelectMode,f=e.getDocumentPosition(),m=d.getCursor(),p=e.inSelection()||d.isEmpty()&&i(f,m),A=e.x,C=e.y,F=function(e){A=e.clientX,C=e.clientY},v=u.session,w=u.renderer.pixelToScreenCoordinates(A,C),E=w;if(u.$mouseHandler.$enableJumpToDef)a&&n||l&&n?c="add":n&&(c="block");else if(l&&!n){if(c="add",!g&&r)return}else n&&(c="block");if(c&&o.isMac&&t.ctrlKey&&u.$mouseHandler.cancelContextMenu(),"add"==c){if(!g&&p)return;if(!g){var $=d.toOrientedRange();u.addSelectionMarker($)}var y=d.rangeList.rangeAtPoint(f);u.$blockScrolling++,u.inVirtualSelectionMode=!0,r&&(y=null,$=d.ranges[0],u.removeSelectionMarker($)),u.once("mouseup",function(){var e=d.toOrientedRange();y&&e.isEmpty()&&i(y.cursor,e.cursor)?d.substractPoint(e.cursor):(r?d.substractPoint($.cursor):$&&(u.removeSelectionMarker($),d.addRange($)),d.addRange(e)),u.$blockScrolling--,u.inVirtualSelectionMode=!1})}else if("block"==c){e.stop(),u.inVirtualSelectionMode=!0;var b,B=[],D=function(){var e=u.renderer.pixelToScreenCoordinates(A,C),t=v.screenToDocumentPosition(e.row,e.column);i(E,e)&&i(t,d.lead)||(E=e,u.selection.moveToPosition(t),u.renderer.scrollCursorIntoView(),u.removeSelectionMarkers(B),B=d.rectangularRangeBlock(E,w),u.$mouseHandler.$clickSelection&&1==B.length&&B[0].isEmpty()&&(B[0]=u.$mouseHandler.$clickSelection.clone()),B.forEach(u.addSelectionMarker,u),u.updateSelectionMarkers())};g&&!l?d.toSingleRange():!g&&l&&(b=d.toOrientedRange(),u.addSelectionMarker(b)),r?w=v.documentToScreenPosition(d.lead):d.moveToPosition(f),E={row:-1,column:-1};var S=function(){clearInterval(x),u.removeSelectionMarkers(B),B.length||(B=[d.toOrientedRange()]),u.$blockScrolling++,b&&(u.removeSelectionMarker(b),d.toSingleRange(b));for(var e=0;e<B.length;e++)d.addRange(B[e]);u.inVirtualSelectionMode=!1,u.$mouseHandler.$clickSelection=null,u.$blockScrolling--},k=D;s.capture(u.container,F,S);var x=setInterval(function(){k()},20);return e.preventDefault()}}}var s=e("../lib/event"),o=e("../lib/useragent");t.onMouseDown=n}),define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(e,t){t.defaultCommands=[{name:"addCursorAbove",exec:function(e){e.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},readonly:!0},{name:"addCursorBelow",exec:function(e){e.selectMoreLines(1)},bindKey:{win:"Ctrl-Alt-Down",mac:"Ctrl-Alt-Down"},readonly:!0},{name:"addCursorAboveSkipCurrent",exec:function(e){e.selectMoreLines(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Up",mac:"Ctrl-Alt-Shift-Up"},readonly:!0},{name:"addCursorBelowSkipCurrent",exec:function(e){e.selectMoreLines(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Down",mac:"Ctrl-Alt-Shift-Down"},readonly:!0},{name:"selectMoreBefore",exec:function(e){e.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},readonly:!0},{name:"selectMoreAfter",exec:function(e){e.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},readonly:!0},{name:"selectNextBefore",exec:function(e){e.selectMore(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Left",mac:"Ctrl-Alt-Shift-Left"},readonly:!0},{name:"selectNextAfter",exec:function(e){e.selectMore(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Right",mac:"Ctrl-Alt-Shift-Right"},readonly:!0},{name:"splitIntoLines",exec:function(e){e.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readonly:!0},{name:"alignCursors",exec:function(e){e.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"}},{name:"findAll",exec:function(e){e.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},readonly:!0}],t.multiSelectCommands=[{name:"singleSelection",bindKey:"esc",exec:function(e){e.exitMultiSelectMode()},readonly:!0,isAvailable:function(e){return e&&e.inMultiSelectMode}}];var i=e("../keyboard/hash_handler").HashHandler;t.keyboardHandler=new i(t.multiSelectCommands)}),define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],function(e,t){function i(e,t,i){return f.$options.wrap=!0,f.$options.needle=t,f.$options.backwards=-1==i,f.find(e)}function n(e,t){return e.row==t.row&&e.column==t.column}function s(e){e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",h),e.commands.addCommands(d.defaultCommands),o(e))}function o(e){function t(){n&&(e.renderer.setMouseCursor(""),n=!1)}var i=e.textInput.getElement(),n=!1;c.addListener(i,"keydown",function(i){18!=i.keyCode||i.ctrlKey||i.shiftKey||i.metaKey?n&&t():n||(e.renderer.setMouseCursor("crosshair"),n=!0)}),c.addListener(i,"keyup",t),c.addListener(i,"blur",t)}var r=e("./range_list").RangeList,a=e("./range").Range,l=e("./selection").Selection,h=e("./mouse/multi_select_handler").onMouseDown,c=e("./lib/event"),u=e("./lib/lang"),d=e("./commands/multi_select_commands");t.commands=d.defaultCommands.concat(d.multiSelectCommands);var g=e("./search").Search,f=new g,m=e("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(m.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(e,t){if(e){if(!this.inMultiSelectMode&&0===this.rangeCount){var i=this.toOrientedRange();if(this.rangeList.add(i),this.rangeList.add(e),2!=this.rangeList.ranges.length)return this.rangeList.removeAll(),t||this.fromOrientedRange(e);this.rangeList.removeAll(),this.rangeList.add(i),this.$onAddRange(i)}e.cursor||(e.cursor=e.end);var n=this.rangeList.add(e);return this.$onAddRange(e),n.length&&this.$onRemoveRange(n),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length?this.$onRemoveRange(e):this.ranges[0]&&this.fromOrientedRange(this.ranges[0])},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var i=e.length;i--;){var n=this.ranges.indexOf(e[i]);this.ranges.splice(n,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new r,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],i=a.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(i,t.cursor==t.start)}else{var i=this.getRange(),n=this.isBackwards(),s=i.start.row,o=i.end.row;if(s==o){if(n)var r=i.end,l=i.start;else var r=i.start,l=i.end;return this.addRange(a.fromPoints(l,l)),void this.addRange(a.fromPoints(r,r))}var h=[],c=this.getLineRange(s,!0);c.start.column=i.start.column,h.push(c);for(var u=s+1;u<o;u++)h.push(this.getLineRange(u,!0));c=this.getLineRange(o,!0),c.end.column=i.end.column,h.push(c),h.forEach(this.addRange,this)}},this.toggleBlockSelection=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],i=a.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(i,t.cursor==t.start)}else{var n=this.session.documentToScreenPosition(this.selectionLead),s=this.session.documentToScreenPosition(this.selectionAnchor);this.rectangularRangeBlock(n,s).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,i){var s=[],o=e.column<t.column;if(o)var r=e.column,l=t.column;else var r=t.column,l=e.column;var h=e.row<t.row;if(h)var c=e.row,u=t.row;else var c=t.row,u=e.row;r<0&&(r=0),c<0&&(c=0),c==u&&(i=!0);for(var d=c;d<=u;d++){var g=a.fromPoints(this.session.screenToDocumentPosition(d,r),this.session.screenToDocumentPosition(d,l));if(g.isEmpty()){if(f&&n(g.end,f))break;var f=g.end}g.cursor=o?g.start:g.end,s.push(g)}if(h&&s.reverse(),!i){for(var m=s.length-1;s[m].isEmpty()&&m>0;)m--;if(m>0)for(var p=0;s[p].isEmpty();)p++;for(var A=m;A>=p;A--)s[A].isEmpty()&&s.splice(A,1)}return s}}.call(l.prototype);var p=e("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,i=e.length;i--;){var n=e[i];if(n.marker){this.session.removeMarker(n.marker);var s=t.indexOf(n);-1!=s&&t.splice(s,1)}}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(d.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(d.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t=e.command,i=e.editor;if(i.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?n=i.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?n=i.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(i.exitMultiSelectMode(),n=t.exec(i,e.args||{})):n=t.multiSelectAction(i,e.args||{});else{var n=t.exec(i,e.args||{});i.multiSelect.addRange(i.multiSelect.toOrientedRange()),i.multiSelect.mergeOverlappingRanges()}return n}},this.forEachSelection=function(e,t,i){if(!this.inVirtualSelectionMode){var n,s=i&&i.keepOrder,o=1==i||i&&i.$byLines,r=this.session,a=this.selection,h=a.rangeList,c=(s?a:h).ranges;if(!c.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var u=a._eventRegistry;a._eventRegistry={};var d=new l(r);this.inVirtualSelectionMode=!0;for(var g=c.length;g--;){if(o)for(;g>0&&c[g].start.row==c[g-1].end.row;)g--;d.fromOrientedRange(c[g]),d.index=g,this.selection=r.selection=d;var f=e.exec?e.exec(this,t||{}):e(this,t||{});n||f===undefined||(n=f),d.toOrientedRange(c[g])}d.detach(),this.selection=r.selection=a,this.inVirtualSelectionMode=!1,a._eventRegistry=u,a.mergeOverlappingRanges();var m=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),m&&m.from==m.to&&this.renderer.animateScrolling(m.from),n}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,i=[],n=0;n<t.length;n++)i.push(this.session.getTextRange(t[n]));var s=this.session.getDocument().getNewLineCharacter();e=i.join(s),e.length==(i.length-1)*s.length&&(e="")}else this.selection.isEmpty()||(e=this.session.getTextRange(this.getSelectionRange()));return e},this.$checkMultiselectChange=function(e,t){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var i=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&t==this.multiSelect.anchor)return;n(t==this.multiSelect.anchor?i.cursor==i.start?i.end:i.start:i.cursor,t)||this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange())}},this.onPaste=function(e){if(!this.$readOnly){var t={text:e};if(this._signal("paste",t),e=t.text,!this.inMultiSelectMode||this.inVirtualSelectionMode)return this.insert(e);var i=e.split(/\r\n|\r|\n/),n=this.selection.rangeList.ranges;if(i.length>n.length||i.length<2||!i[1])return this.commands.exec("insertstring",this,e);for(var s=n.length;s--;){var o=n[s];o.isEmpty()||this.session.remove(o),this.session.insert(o.start,i[s])}}},this.findAll=function(e,t,i){if(t=t||{},t.needle=e||t.needle,t.needle==undefined){var n=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();t.needle=this.session.getTextRange(n)}this.$search.set(t);var s=this.$search.findAll(this.session);if(!s.length)return 0;this.$blockScrolling+=1;var o=this.multiSelect;i||o.toSingleRange(s[0]);for(var r=s.length;r--;)o.addRange(s[r],!0);return n&&o.rangeList.rangeAtPoint(n.start)&&o.addRange(n,!0),this.$blockScrolling-=1,s.length},this.selectMoreLines=function(e,t){var i=this.selection.toOrientedRange(),n=i.cursor==i.end,s=this.session.documentToScreenPosition(i.cursor);this.selection.$desiredColumn&&(s.column=this.selection.$desiredColumn);var o=this.session.screenToDocumentPosition(s.row+e,s.column);if(i.isEmpty())var r=o;else var l=this.session.documentToScreenPosition(n?i.end:i.start),r=this.session.screenToDocumentPosition(l.row+e,l.column);if(n){var h=a.fromPoints(o,r);h.cursor=h.start}else{var h=a.fromPoints(r,o);h.cursor=h.end}if(h.desiredColumn=s.column,this.selection.inMultiSelectMode){if(t)var c=i.cursor}else this.selection.addRange(i);this.selection.addRange(h),c&&this.selection.substractPoint(c)},this.transposeSelections=function(e){for(var t=this.session,i=t.multiSelect,n=i.ranges,s=n.length;s--;){var o=n[s];if(o.isEmpty()){var r=t.getWordRange(o.start.row,o.start.column);o.start.row=r.start.row,o.start.column=r.start.column,o.end.row=r.end.row,o.end.column=r.end.column}}i.mergeOverlappingRanges();for(var a=[],s=n.length;s--;){var o=n[s];a.unshift(t.getTextRange(o))}e<0?a.unshift(a.pop()):a.push(a.shift());for(var s=n.length;s--;){var o=n[s],r=o.clone();t.replace(o,a[s]),o.start.row=r.start.row,o.start.column=r.start.column}},this.selectMore=function(e,t,n){var s=this.session,o=s.multiSelect,r=o.toOrientedRange();if(!r.isEmpty()||(r=s.getWordRange(r.start.row,r.start.column),r.cursor=-1==e?r.start:r.end,this.multiSelect.addRange(r),!n)){var a=s.getTextRange(r),l=i(s,a,e);l&&(l.cursor=-1==e?l.start:l.end,this.$blockScrolling+=1,this.session.unfold(l),this.multiSelect.addRange(l),this.$blockScrolling-=1,this.renderer.scrollCursorIntoView(null,.5)),t&&this.multiSelect.substractPoint(r.cursor)}},this.alignCursors=function(){var e=this.session,t=e.multiSelect,i=t.ranges,n=-1,s=i.filter(function(e){if(e.cursor.row==n)return!0;n=e.cursor.row});if(i.length&&s.length!=i.length-1){s.forEach(function(e){t.substractPoint(e.cursor)});var o=0,r=Infinity,l=i.map(function(t){var i=t.cursor,n=e.getLine(i.row),s=n.substr(i.column).search(/\S/g);return-1==s&&(s=0),i.column>o&&(o=i.column),s<r&&(r=s),s});i.forEach(function(t,i){var n=t.cursor,s=o-n.column,h=l[i]-r;s>h?e.insert(n,u.stringRepeat(" ",s-h)):e.remove(new a(n.row,n.column,n.row,n.column-s+h)),t.start.column=t.end.column=o,t.start.row=t.end.row=n.row,t.cursor=t.end}),t.fromOrientedRange(i[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var h=this.selection.getRange(),c=h.start.row,d=h.end.row,g=c==d;if(g){var f,m=this.session.getLength();do{f=this.session.getLine(d)}while(/[=:]/.test(f)&&++d<m);do{f=this.session.getLine(c)}while(/[=:]/.test(f)&&--c>0);c<0&&(c=0),d>=m&&(d=m-1)}var p=this.session.doc.removeLines(c,d);p=this.$reAlignText(p,g),this.session.doc.insert({row:c,column:0},p.join("\n")+"\n"),g||(h.start.column=0,h.end.column=p[p.length-1].length),this.selection.setRange(h)}},this.$reAlignText=function(e,t){function i(e){return u.stringRepeat(" ",e)}function n(e){return e[2]?i(r)+e[2]+i(a-e[2].length+l)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}function s(e){return e[2]?i(r+a-e[2].length)+e[2]+i(l," ")+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}function o(e){return e[2]?i(r)+e[2]+i(l)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}var r,a,l,h=!0,c=!0;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?null==r?(r=t[1].length,a=t[2].length,l=t[3].length,t):(r+a+l!=t[1].length+t[2].length+t[3].length&&(c=!1),r!=t[1].length&&(h=!1),r>t[1].length&&(r=t[1].length),a<t[2].length&&(a=t[2].length),l>t[3].length&&(l=t[3].length),t):[e]}).map(t?n:h?c?s:n:o)}}).call(p.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var i=e.oldSession;i&&(i.multiSelect.off("addRange",this.$onAddRange),i.multiSelect.off("removeRange",this.$onRemoveRange),i.multiSelect.off("multiSelect",this.$onMultiSelect),i.multiSelect.off("singleSelect",this.$onSingleSelect),i.multiSelect.lead.off("change",this.$checkMultiselectChange),i.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=s,e("./config").defineOptions(p.prototype,"editor",{enableMultiselect:{set:function(e){s(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",h)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",h))},value:!0}})}),define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t){"use strict";var i=e("../../range").Range,n=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,i){var n=e.getLine(i);return this.foldingStartMarker.test(n)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(n)?"end":""},this.getFoldWidgetRange=function(){return null},this.indentationBlock=function(e,t,n){var s=/\S/,o=e.getLine(t),r=o.search(s);if(-1!=r){for(var a=n||o.length,l=e.getLength(),h=t,c=t;++t<l;){var u=e.getLine(t).search(s);if(-1!=u){if(u<=r)break;c=t}}if(c>h){var d=e.getLine(c).length;return new i(h,a,c,d)}}},
113
113
  this.openingBracketBlock=function(e,t,n,s,o){var r={row:n,column:s+1},a=e.$findClosingBracket(t,r,o);if(a){var l=e.foldWidgets[a.row];return null==l&&(l=e.getFoldWidget(a.row)),"start"==l&&a.row>r.row&&(a.row--,a.column=e.getLine(a.row).length),i.fromPoints(r,a)}},this.closingBracketBlock=function(e,t,n,s){var o={row:n,column:s},r=e.$findOpeningBracket(t,o);if(r)return r.column++,o.column--,i.fromPoints(r,o)}}).call(n.prototype)}),define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;border-radius: 2px;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',e("../lib/dom").importCssString(t.cssText,t.cssClass)}),define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"],function(e,t){"use strict";function i(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeEditor",this.$onChangeEditor)}var n=(e("./lib/oop"),e("./lib/dom"));e("./range").Range;(function(){this.getRowLength=function(e){var t;return t=this.lineWidgets?this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0:0,this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach(function(t){t&&t.rowCount&&(e+=t.rowCount)}),e},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(){var e=this.editor;if(e){this.editor=null,e.widgetManager=null,e.renderer.off("beforeRender",this.measureWidgets),e.renderer.off("afterRender",this.renderWidgets);var t=this.session.lineWidgets;t&&t.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})}},this.updateOnChange=function(e){var t=this.session.lineWidgets;if(t){var i=e.data,n=i.range,s=n.start.row,o=n.end.row-s;if(0===o);else if("removeText"==i.action||"removeLines"==i.action){var r=t.splice(s+1,o);r.forEach(function(e){e&&this.removeLineWidget(e)},this),this.$updateRows()}else{var a=new Array(o);a.unshift(s,0),t.splice.apply(t,a),this.$updateRows()}}},this.$updateRows=function(){var e=this.session.lineWidgets;if(e){var t=!0;e.forEach(function(e,i){e&&(t=!1,e.row=i)}),t&&(this.session.lineWidgets=null)}},this.addLineWidget=function(e){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength())),this.session.lineWidgets[e.row]=e;var t=this.editor.renderer;return e.html&&!e.el&&(e.el=n.createElement("div"),e.el.innerHTML=e.html),e.el&&(n.addCssClass(e.el,"ace_lineWidgetContainer"),e.el.style.position="absolute",e.el.style.zIndex=5,t.container.appendChild(e.el),e._inDocument=!0),e.coverGutter||(e.el.style.zIndex=3),e.pixelHeight||(e.pixelHeight=e.el.offsetHeight),null==e.rowCount&&(e.rowCount=e.pixelHeight/t.layerConfig.lineHeight),this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows(),this.renderWidgets(null,t),e},this.removeLineWidget=function(e){if(e._inDocument=!1,e.el&&e.el.parentNode&&e.el.parentNode.removeChild(e.el),e.editor&&e.editor.destroy)try{e.editor.destroy()}catch(e){}this.session.lineWidgets&&(this.session.lineWidgets[e.row]=undefined),this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows()},this.onWidgetChanged=function(e){this.session._changedWidgets.push(e),this.editor&&this.editor.renderer.updateFull()},this.measureWidgets=function(e,t){var i=this.session._changedWidgets,n=t.layerConfig;if(i&&i.length){for(var s=Infinity,o=0;o<i.length;o++){var r=i[o];r._inDocument||(r._inDocument=!0,t.container.appendChild(r.el)),r.h=r.el.offsetHeight,r.fixedWidth||(r.w=r.el.offsetWidth,r.screenWidth=Math.ceil(r.w/n.characterWidth));var a=r.h/n.lineHeight;r.coverLine&&(a-=this.session.getRowLineCount(r.row))<0&&(a=0),r.rowCount!=a&&(r.rowCount=a,r.row<s&&(s=r.row))}s!=Infinity&&(this.session._emit("changeFold",{data:{start:{row:s}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},this.renderWidgets=function(e,t){var i=t.layerConfig,n=this.session.lineWidgets;if(n){for(var s=Math.min(this.firstRow,i.firstRow),o=Math.max(this.lastRow,i.lastRow,n.length);s>0&&!n[s];)s--;this.firstRow=i.firstRow,this.lastRow=i.lastRow,t.$cursorLayer.config=i;for(var r=s;r<=o;r++){var a=n[r];if(a&&a.el){a._inDocument||(a._inDocument=!0,t.container.appendChild(a.el));var l=t.$cursorLayer.getPixelPosition({row:r,column:0},!0).top;a.coverLine||(l+=i.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-i.offset+"px";var h=a.coverGutter?0:t.gutterWidth;a.fixedWidth||(h-=t.scrollLeft),a.el.style.left=h+"px",a.fixedWidth?a.el.style.right=t.scrollBar.getWidth()+"px":a.el.style.right=""}}}}}).call(i.prototype),t.LineWidgets=i}),define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t){"use strict";function i(e,t,i){for(var n=0,s=e.length-1;n<=s;){var o=n+s>>1,r=i(t,e[o]);if(r>0)n=o+1;else{if(!(r<0))return o;s=o-1}}return-(n+1)}function n(e,t,n){var s=e.getAnnotations().sort(r.comparePoints);if(s.length){var o=i(s,{row:t,column:-1},r.comparePoints);o<0&&(o=-o-1),o>=s.length-1?o=n>0?0:s.length-1:0===o&&n<0&&(o=s.length-1);var a=s[o];if(a&&n){if(a.row===t){do{a=s[o+=n]}while(a&&a.row===t);if(!a)return s.slice()}var l=[];t=a.row;do{l[n<0?"unshift":"push"](a),a=s[o+=n]}while(a&&a.row==t);return l.length&&l}}}var s=e("../line_widgets").LineWidgets,o=e("../lib/dom"),r=e("../range").Range;t.showErrorMarker=function(e,t){var i=e.session;i.widgetManager||(i.widgetManager=new s(i),i.widgetManager.attach(e));var r=e.getCursorPosition(),a=r.row,l=i.lineWidgets&&i.lineWidgets[a];l?l.destroy():a-=t;var h,c=n(i,a,t);if(c){var u=c[0];r.column=(u.pos&&"number"!=typeof u.column?u.pos.sc:u.column)||0,r.row=u.row,h=e.renderer.$gutterLayer.$annotations[r.row]}else{if(l)return;h={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(r.row),e.selection.moveToPosition(r);var d={row:r.row,fixedWidth:!0,coverGutter:!0,el:o.createElement("div")},g=d.el.appendChild(o.createElement("div")),f=d.el.appendChild(o.createElement("div"));f.className="error_widget_arrow "+h.className;var m=e.renderer.$cursorLayer.getPixelPosition(r).left;f.style.left=m+e.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",g.className="error_widget "+h.className,g.innerHTML=h.text.join("<br>"),g.appendChild(o.createElement("div"));var p=function(e,t,i){if(0===t&&("esc"===i||"return"===i))return d.destroy(),{command:"null"}};d.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(p),i.widgetManager.removeLineWidget(d),e.off("changeSelection",d.destroy),e.off("changeSession",d.destroy),e.off("mouseup",d.destroy),e.off("change",d.destroy))},e.keyBinding.addKeyboardHandler(p),e.on("changeSelection",d.destroy),e.on("changeSession",d.destroy),e.on("mouseup",d.destroy),e.on("change",d.destroy),e.session.widgetManager.addLineWidget(d),d.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})},o.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")}),define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,t){"use strict";e("./lib/fixoldbrowsers");var i=e("./lib/dom"),n=e("./lib/event"),s=e("./editor").Editor,o=e("./edit_session").EditSession,r=e("./undomanager").UndoManager,a=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.require=e,t.edit=function(e){if("string"==typeof e){var o=e;if(!(e=document.getElementById(o)))throw new Error("ace.edit can't find div #"+o)}if(e&&e.env&&e.env.editor instanceof s)return e.env.editor;var r="";if(e&&/input|textarea/i.test(e.tagName)){var l=e;r=l.value,e=i.createElement("pre"),l.parentNode.replaceChild(e,l)}else r=i.getInnerText(e),e.innerHTML="";var h=t.createEditSession(r),c=new s(new a(e));c.setSession(h);var u={document:h,editor:c,onResize:c.resize.bind(c,null)};return l&&(u.textarea=l),n.addListener(window,"resize",u.onResize),c.on("destroy",function(){n.removeListener(window,"resize",u.onResize),u.editor.container.env=null}),c.container.env=c.env=u,c},t.createEditSession=function(e,t){var i=new o(e,t);return i.setUndoManager(new r),i},t.EditSession=o,t.UndoManager=r}),function(){window.require(["ace/ace"],function(e){e&&e.config.init(!0),window.ace||(window.ace=e);for(var t in e)e.hasOwnProperty(t)&&(window.ace[t]=e[t])})}();
114
114
  //script: prosemirror
115
- !function(t){function e(t,e,o){return 4===arguments.length?n.apply(this,arguments):void r(t,{declarative:!0,deps:e,declare:o})}function n(t,e,n,o){r(t,{declarative:!1,deps:e,executingRequire:n,execute:o})}function r(t,e){e.name=t,t in m||(m[t]=e),e.normalizedDeps=e.deps}function o(t,e){if(e[t.groupIndex]=e[t.groupIndex]||[],-1==v.call(e[t.groupIndex],t)){e[t.groupIndex].push(t);for(var n=0,r=t.normalizedDeps.length;r>n;n++){var i=t.normalizedDeps[n],s=m[i];if(s&&!s.evaluated){var a=t.groupIndex+(s.declarative!=t.declarative);if(void 0===s.groupIndex||s.groupIndex<a){if(void 0!==s.groupIndex&&(e[s.groupIndex].splice(v.call(e[s.groupIndex],s),1),0==e[s.groupIndex].length))throw new TypeError("Mixed dependency cycle detected");s.groupIndex=a}o(s,e)}}}}function i(t){var e=m[t];e.groupIndex=0;var n=[];o(e,n);for(var r=!!e.declarative==n.length%2,i=n.length-1;i>=0;i--){for(var s=n[i],c=0;c<s.length;c++){var p=s[c];r?a(p):l(p)}r=!r}}function s(t){return w[t]||(w[t]={name:t,dependencies:[],exports:{},importers:[]})}function a(e){if(!e.module){var n=e.module=s(e.name),r=e.module.exports,o=e.declare.call(t,function(t,e){if(n.locked=!0,"object"==typeof t)for(var o in t)r[o]=t[o];else r[t]=e;for(var i=0,s=n.importers.length;s>i;i++){var a=n.importers[i];if(!a.locked)for(var c=0;c<a.dependencies.length;++c)a.dependencies[c]===n&&a.setters[c](r)}return n.locked=!1,e},e.name);n.setters=o.setters,n.execute=o.execute;for(var i=0,c=e.normalizedDeps.length;c>i;i++){var l,p=e.normalizedDeps[i],u=m[p],f=w[p];f?l=f.exports:u&&!u.declarative?l=u.esModule:u?(a(u),f=u.module,l=f.exports):l=d(p),f&&f.importers?(f.importers.push(n),n.dependencies.push(f)):n.dependencies.push(null),n.setters[i]&&n.setters[i](l)}}}function c(t){var e,n=m[t];if(n)n.declarative?h(t,[]):n.evaluated||l(n),e=n.module.exports;else if(!(e=d(t)))throw new Error("Unable to load dependency "+t+".");return(!n||n.declarative)&&e&&e.__useDefault?e["default"]:e}function l(e){if(!e.module){var n={},r=e.module={exports:n,id:e.name};if(!e.executingRequire)for(var o=0,i=e.normalizedDeps.length;i>o;o++){var s=e.normalizedDeps[o],a=m[s];a&&l(a)}e.evaluated=!0;var u=e.execute.call(t,function(t){for(var n=0,r=e.deps.length;r>n;n++)if(e.deps[n]==t)return c(e.normalizedDeps[n]);throw new TypeError("Module "+t+" not declared as a dependency.")},n,r);u&&(r.exports=u),n=r.exports,n&&n.__esModule?e.esModule=n:e.esModule=p(n)}}function p(t){var e={};if("object"==typeof t||"function"==typeof t){var n=t&&t.hasOwnProperty;if(g)for(var r in t)f(e,t,r)||u(e,t,r,n);else for(var r in t)u(e,t,r,n)}return e["default"]=t,y(e,"__useDefault",{value:!0}),e}function u(t,e,n,r){(!r||e.hasOwnProperty(n))&&(t[n]=e[n])}function f(t,e,n){try{var r;return(r=Object.getOwnPropertyDescriptor(e,n))&&y(t,n,r),!0}catch(t){return!1}}function h(e,n){var r=m[e];if(r&&!r.evaluated&&r.declarative){n.push(e);for(var o=0,i=r.normalizedDeps.length;i>o;o++){var s=r.normalizedDeps[o];-1==v.call(n,s)&&(m[s]?h(s,n):d(s))}r.evaluated||(r.evaluated=!0,r.module.execute.call(t))}}function d(t){if(b[t])return b[t];if("@node/"==t.substr(0,6))return x(t.substr(6));var e=m[t];if(!e)throw"Module "+t+" not present.";return i(t),h(t,[]),m[t]=void 0,e.declarative&&y(e.module.exports,"__esModule",{value:!0}),b[t]=e.declarative?e.module.exports:e.esModule}var m={},v=Array.prototype.indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(this[e]===t)return e;return-1},g=!0;try{Object.getOwnPropertyDescriptor({a:0},"a")}catch(t){g=!1}var y;!function(){try{Object.defineProperty({},"a",{})&&(y=Object.defineProperty)}catch(t){y=function(t,e,n){try{t[e]=n.value||n.get.call(t)}catch(t){}}}}();var w={},x="undefined"!=typeof System&&System._nodeRequire||"undefined"!=typeof require&&require.resolve&&"undefined"!=typeof process&&require,b={"@empty":{}};return function(t,r,o){return function(i){i(function(){for(var i={_nodeRequire:x,register:e,registerDynamic:n,get:d,set:function(t,e){b[t]=e},newModule:function(t){return t}},s=0;s<r.length;s++)!function(t,e){e&&e.__esModule?b[t]=e:b[t]=p(e)}(r[s],arguments[s]);o(i);var a=d(t[0]);if(t.length>1)for(var s=1;s<t.length;s++)d(t[s]);return a.__useDefault?a["default"]:a})}}}("undefined"!=typeof self?self:global)(["1"],[],function(t){this.require,this.exports,this.module;t.registerDynamic("2",["3"],!0,function(t,e,n){var r=t("3"),o=r.Schema,i={doc:{content:"block+"},paragraph:{content:"inline<_>*",group:"block",parseDOM:[{tag:"p"}],toDOM:function(){return["p",0]}},blockquote:{content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:function(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:function(){return["hr"]}},heading:{attrs:{level:{"default":1}},content:"inline<_>*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM:function(t){return["h"+t.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,parseDOM:[{tag:"pre",preserveWhitespace:!0}],toDOM:function(){return["pre",["code",0]]}},text:{group:"inline",toDOM:function(t){return t.text}},image:{inline:!0,attrs:{src:{},alt:{"default":null},title:{"default":null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs:function(t){return{src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")}}}],toDOM:function(t){return["img",t.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:function(){return["br"]}}};e.nodes=i;var s={em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style",getAttrs:function(t){return"italic"==t&&null}}],toDOM:function(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:function(t){return"normal"!=t.style.fontWeight&&null}},{style:"font-weight",getAttrs:function(t){return/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}}],toDOM:function(){return["strong"]}},link:{attrs:{href:{},title:{"default":null}},parseDOM:[{tag:"a[href]",getAttrs:function(t){return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM:function(t){return["a",t.attrs]}},code:{parseDOM:[{tag:"code"}],toDOM:function(){return["code"]}}};e.marks=s;var a=new o({nodes:i,marks:s});return e.schema=a,n.exports}),t.registerDynamic("4",["2"],!0,function(t,e,n){return n.exports=t("2"),n.exports}),t.registerDynamic("5",["6"],!0,function(t,e,n){var r=t("6"),o=r.InputRule,i=new o(/--$/,"\u2014");e.emDash=i;var s=new o(/\.\.\.$/,"\u2026");e.ellipsis=s;var a=new o(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"\u201c");e.openDoubleQuote=a;var c=new o(/"$/,"\u201d");e.closeDoubleQuote=c;var l=new o(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"\u2018");e.openSingleQuote=l;var p=new o(/'$/,"\u2019");e.closeSingleQuote=p;var u=[a,c,l,p];e.smartQuotes=u;var f=[i,s].concat(u);return e.allInputRules=f,n.exports}),t.registerDynamic("6",["7"],!0,function(t,e,n){function r(t){return function(e,n,r,o){var i=t;if(n[1]){var s=n[0].lastIndexOf(n[1]);i+=n[0].slice(s+n[1].length),r+=s;var a=r-o;a>0&&(i=n[0].slice(s-a,s)+i,r=o)}var c=e.doc.resolve(r).marks();return e.tr.replaceWith(r,o,e.schema.text(i,c))}}function o(t){var e=t.rules;return new a({state:{init:function(){return null},apply:function(t,e){var n=t.getMeta(u);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:function(t,n,r,o){for(var i=t.state,s=i.doc.resolve(n),a=s.parent.textBetween(Math.max(0,s.parentOffset-p),s.parentOffset,null,"\ufffc")+o,c=0;c<e.length;c++){var l=e[c].match.exec(a),f=l&&e[c].handler(i,l,n-(l[0].length-o.length),r);if(f)return t.dispatch(f.setMeta(u,{transform:f,from:n,to:r,text:o})),!0}return!1},handleKeyDown:function(t,e){return 8==e.keyCode&&i(t.state,t.dispatch,this.getState(t.state))}}})}function i(t,e,n){if(!n)return!1;for(var r=t.tr,o=n.transform,i=o.steps.length-1;i>=0;i--)r.step(o.steps[i].invert(o.docs[i]));var s=r.doc.resolve(n.from).marks();return e(r.replaceWith(n.from,n.to,t.schema.text(n.text,s))),!0}var s=t("7"),a=s.Plugin,c=s.PluginKey,l=function(t,e){this.match=t,this.handler="string"==typeof e?r(e):e};e.InputRule=l;var p=100,u=new c("fromInputRule");return e.inputRules=o,n.exports}),t.registerDynamic("8",["6","9"],!0,function(t,e,n){function r(t,e,n,r){return new u(t,function(t,o,i,s){var a=n instanceof Function?n(o):n,c=t.tr["delete"](i,s),l=c.doc.resolve(i),p=l.blockRange(),u=p&&h(p,e,a);if(!u)return null;c.wrap(p,u);var f=c.doc.resolve(i-1).nodeBefore;return f&&f.type==e&&d(c.doc,i-1)&&(!r||r(o,f))&&c.join(i-1),c})}function o(t,e,n){return new u(t,function(t,r,o,i){var s=t.doc.resolve(o),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),e,a)?t.tr["delete"](o,i).setBlockType(o,o,e,a):null})}function i(t){return r(/^\s*> $/,t)}function s(t){return r(/^(\d+)\. $/,t,function(t){return{order:+t[1]}},function(t,e){return e.childCount+e.attrs.order==+t[1]})}function a(t){return r(/^\s*([-+*]) $/,t)}function c(t){return o(/^```$/,t)}function l(t,e){return o(new RegExp("^(#{1,"+e+"}) $"),t,function(t){return{level:t[1].length}})}var p=t("6"),u=p.InputRule,f=t("9"),h=f.findWrapping,d=f.canJoin;return e.wrappingInputRule=r,e.textblockTypeInputRule=o,e.blockQuoteRule=i,e.orderedListRule=s,e.bulletListRule=a,e.codeBlockRule=c,e.headingRule=l,n.exports}),t.registerDynamic("a",["6","5","8"],!0,function(t,e,n){var r;r=t("6"),e.InputRule=r.InputRule,e.inputRules=r.inputRules;var o;o=t("5"),e.emDash=o.emDash,e.ellipsis=o.ellipsis,e.openDoubleQuote=o.openDoubleQuote,e.closeDoubleQuote=o.closeDoubleQuote,e.openSingleQuote=o.openSingleQuote,e.closeSingleQuote=o.closeSingleQuote,e.smartQuotes=o.smartQuotes,e.allInputRules=o.allInputRules;var i;return i=t("8"),e.wrappingInputRule=i.wrappingInputRule,e.textblockTypeInputRule=i.textblockTypeInputRule,e.blockQuoteRule=i.blockQuoteRule,e.orderedListRule=i.orderedListRule,e.bulletListRule=i.bulletListRule,e.codeBlockRule=i.codeBlockRule,e.headingRule=i.headingRule,n.exports}),t.registerDynamic("b",["a"],!0,function(t,e,n){return n.exports=t("a"),n.exports}),t.registerDynamic("c",[],!0,function(t,e,n){function r(t){var e=(!a||!t.ctrlKey&&!t.altKey&&!t.metaKey)&&t.key||(t.shiftKey?i:o)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),e}for(var o={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},i={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:";",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},s="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),a=s&&+s[1]<57,c=0;c<10;c++)o[48+c]=o[96+c]=String(c);for(var c=1;c<=24;c++)o[c+111]="F"+c;for(var c=65;c<=90;c++)o[c]=String.fromCharCode(c+32),i[c]=String.fromCharCode(c);for(var l in o)i.hasOwnProperty(l)||(i[l]=o[l]);return n.exports=r,r.base=o,r.shift=i,n.exports}),t.registerDynamic("d",["c"],!0,function(t,e,n){return n.exports=t("c"),n.exports}),t.registerDynamic("e",["d","7"],!0,function(t,e,n){function r(t){var e=t.split(/-(?!$)/),n=e[e.length-1];"Space"==n&&(n=" ");for(var r,o,i,s,a=0;a<e.length-1;a++){var c=e[a];if(/^(cmd|meta|m)$/i.test(c))s=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))i=!0;else{if(!/^mod$/i.test(c))throw new Error("Unrecognized modifier name: "+c);p?s=!0:o=!0}}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),s&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function o(t){var e=Object.create(null);for(var n in t)e[r(n)]=t[n];return e}function i(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==n&&e.shiftKey&&(t="Shift-"+t),t}function s(t){var e=o(t);return new l({props:{handleKeyDown:function(t,n){var r,o=a(n),s=1==o.length&&" "!=o,c=e[i(o,n,!s)];if(c&&c(t.state,t.dispatch,t))return!0;if(n.shiftKey&&s&&(r=a.base[n.keyCode])){var l=e[i(r,n,!0)];if(l&&l(t.state,t.dispatch,t))return!0}return!1}}})}var a=t("d"),c=t("7"),l=c.Plugin,p="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);return e.keymap=s,n.exports}),t.registerDynamic("f",["e"],!0,function(t,e,n){return n.exports=t("e"),n.exports}),t.registerDynamic("10",["7","11"],!0,function(t,e,n){function r(t){function e(t,e){t.dispatch(t.state.tr.setMeta(o,e))}function n(t){clearTimeout(r),r=setTimeout(function(){o.getState(t.state)&&e(t,{type:"remove"})},1e3)}var r=null,o=new a({state:{init:function(){return null},apply:function(e,n,r){if(u&&f)return null;var s=e.getMeta(o);return s?"set"==s.type?i(r,s.pos,t):null:n}},props:{handleDOMEvents:{dragover:function(t,r){var i=o.getState(t.state),s=t.posAtCoords({left:r.clientX,top:r.clientY});return(s&&!i||i.pos!=s.pos)&&e(t,{type:"setDropCursor",pos:s.pos}),n(t),!1},dragend:function(t){return o.getState(t.state)&&e(t,{type:"remove"}),!1},drop:function(t){return o.getState(t.state)&&e(t,{type:"remove"}),!1},dragleave:function(t,n){return n.target==t.content&&e(t,{type:"remove"}),!1}},decorations:function(t){var e=o.getState(t);return e&&e.deco}}});return o}function o(t,e){var n=t&&t.width||1;return"border-"+e+": "+n+"px solid "+(t&&t.color||"black")+"; margin-"+e+": -"+n+"px"}function i(t,e,n){var r,i=t.doc.resolve(e);if(!i.parent.isTextblock){var s,a;(s=i.nodeBefore)?r=l.node(e-s.nodeSize,e,{nodeName:"div",style:o(n,"right")}):(a=i.nodeAfter)&&(r=l.node(e,e+a.nodeSize,{nodeName:"div",style:o(n,"left")}))}if(!r){var c=document.createElement("span");c.textContent="\u200b",c.style.cssText=o(n,"left")+"; display: inline-block; pointer-events: none",r=l.widget(e,c)}return{pos:e,deco:p.create(t.doc,[r])}}var s=t("7"),a=s.Plugin,c=t("11"),l=c.Decoration,p=c.DecorationSet,u="undefined"!=typeof navigator&&/gecko\/\d/i.test(navigator.userAgent),f="undefined"!=typeof navigator&&/linux/i.test(navigator.platform);return e.dropCursor=r,n.exports}),t.registerDynamic("12",["10"],!0,function(t,e,n){return n.exports=t("10"),n.exports}),t.registerDynamic("13",[],!0,function(t,e,n){function r(){return{left:0,right:window.innerWidth,top:0,bottom:window.innerHeight}}function o(t){var e=t.parentNode;return 11==e.nodeType?e.host:e}function i(t,e){var n=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin");null==i&&(i=5);for(var s=t.content;;s=o(s)){var a=s==document.body,c=a?r():s.getBoundingClientRect(),l=0,p=0;if(e.top<c.top+n?p=-(c.top-e.top+i):e.bottom>c.bottom-n&&(p=e.bottom-c.bottom+i),e.left<c.left+n?l=-(c.left-e.left+i):e.right>c.right-n&&(l=e.right-c.right+i),(l||p)&&(a?window.scrollBy(l,p):(p&&(s.scrollTop+=p),l&&(s.scrollLeft+=l))),a)break}}function s(t,e){for(var n,r,o=2e8,i=0,c=e.top,l=e.top,u=t.firstChild,f=0;u;u=u.nextSibling,f++){var h=void 0;if(1==u.nodeType)h=u.getClientRects();else{if(3!=u.nodeType)continue;h=p(u).getClientRects()}for(var d=0;d<h.length;d++){var m=h[d];if(m.top<=c&&m.bottom>=l){c=Math.max(m.bottom,c),l=Math.min(m.top,l);var v=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(v<o){n=u,o=v,r=v&&3==n.nodeType?{left:m.right<e.left?m.right:m.left,top:e.top}:e,1==u.nodeType&&v&&(i=f+(e.left>=(m.left+m.right)/2?1:0));continue}}!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(i=f+1)}}return n&&3==n.nodeType?a(n,r):!n||o&&1==n.nodeType?{node:t,offset:i}:s(n,r)}function a(t,e){for(var n=t.nodeValue.length,r=document.createRange(),o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);var i=u(r,1);if(i.top!=i.bottom&&(i.left-1<=e.left&&i.right+1>=e.left&&i.top-1<=e.top&&i.bottom+1>=e.top))return{node:t,offset:o+(e.left>=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}function c(t,e){if(/^[uo]l$/i.test(t.nodeName))for(var n=t.firstChild;n;n=n.nextSibling)if(n.pmViewDesc&&/^li$/i.test(n.nodeName)){var r=n.getBoundingClientRect();if(e.left>r.left-2)break;if(r.top<=e.top&&r.bottom>=e.top)return n}return t}function l(t,e){var n=c(t.root.elementFromPoint(e.left,e.top+1),e);if(!t.content.contains(3==n.nodeType?n.parentNode:n))return null;var r=s(n,e),o=r.node,i=r.offset,a=-1;if(1==o.nodeType&&!o.firstChild){var l=o.getBoundingClientRect();a=l.left!=l.right&&e.left>(l.left+l.right)/2?1:-1}var p=t.docView.nearestDesc(n,!0);return{pos:t.docView.posFromDOM(o,i,a),inside:p&&p.posAtStart-p.border}}function p(t,e,n){var r=document.createRange();return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r}function u(t,e){var n=t.getClientRects();return n.length?n[e<0?0:n.length-1]:t.getBoundingClientRect()}function f(t,e){var n,r,o=t.docView.domFromPos(e),i=o.node,s=o.offset;if(3==i.nodeType)s<i.nodeValue.length&&(r=u(p(i,s,s+1),-1),n="left"),r&&r.left!=r.right||!s||(r=u(p(i,s-1,s),1),n="right");else if(i.firstChild){if(s<i.childNodes.length){var a=i.childNodes[s];r=u(3==a.nodeType?p(a):a,-1),n="left"}if((!r||r.top==r.bottom)&&s){var c=i.childNodes[s-1];r=u(3==c.nodeType?p(c):c,1),n="right"}}else r=i.getBoundingClientRect(),n="left";var l=r[n];return{top:r.top,bottom:r.bottom,left:l,right:l}}function h(t,e,n){var r=t.state,o=t.root.activeElement;r==e&&t.inDOMChange||t.updateState(e),o!=t.content&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.content&&o.focus()}}function d(t,e,n){var r="up"==n?e.selection.$from:e.selection.$to;return!!r.depth&&h(t,e,function(){for(var e=t.docView.domAfterPos(r.before()),o=f(t,r.pos),i=e.firstChild;i;i=i.nextSibling){var s=void 0;if(1==i.nodeType)s=i.getClientRects();else{if(3!=i.nodeType)continue;s=p(i,0,i.nodeValue.length).getClientRects()}for(var a=0;a<s.length;a++){var c=s[a];if("up"==n?c.bottom<o.top+1:c.top>o.bottom-1)return!1}}return!0})}function m(t,e,n){var r=e.selection,o=r.$head;if(!r.empty||!o.parent.isTextblock||!o.depth)return!1;var i=o.parentOffset,s=!i,a=i==o.parent.content.size;if(!s&&!a&&!g.test(o.parent.textContent))return!1;var c=getSelection();return c.modify?h(t,e,function(){var e=c.getRangeAt(0);c.modify("move",n,"character");var r=t.docView.domAfterPos(o.before()),i=!r.contains(1==c.focusNode.nodeType?c.focusNode:c.focusNode.parentNode)||t.docView.posFromDOM(c.focusNode,c.focusOffset)==o.pos;return c.removeAllRanges(),c.addRange(e),i}):"left"==n||"backward"==n?s:a}function v(t,e,n){return y==e&&w==n?x:(y=e,w=n,x="up"==n||"down"==n?d(t,e,n):m(t,e,n))}e.scrollRectIntoView=i,e.posAtCoords=l,e.coordsAtPos=f;var g=/[\u0590-\u08ac]/,y=null,w=null,x=!1;return e.endOfTextblock=v,n.exports}),t.registerDynamic("14",["3","15"],!0,function(t,e,n){function r(t,e,n,r,o){return c(r,e,t,!0),new O(null,t,e,n,r,r,r,o)}function o(t,e){for(var n=t.firstChild,r=0;r<e.length;r++){var i=e[r],s=i.dom;if(s.parentNode==t){for(;s!=n;)n=p(n);n=n.nextSibling}else t.insertBefore(s,n);i instanceof C&&o(i.contentDOM,i.children)}for(;n;)n=p(n)}function i(t,e,n){if(0==t.length)return E;for(var r=n?E[0]:new N,o=[r],i=0;i<t.length;i++){var s=t[i].type.attrs,a=r;if(s){s.nodeName&&o.push(a=new N(s.nodeName));for(var c in s){var l=s[c];null!=l&&(n&&1==o.length&&o.push(a=r=new N(e.isInline?"span":"div")),"class"==c?a["class"]=(a["class"]?a["class"]+" ":"")+l:"style"==c?a.style=(a.style?a.style+";":"")+l:"nodeName"!=c&&(a[c]=l))}}}return o}function s(t,e,n,r){if(n==E&&r==E)return e;for(var o=e,i=0;i<r.length;i++){var s=r[i],c=n[i];if(i){var l=void 0;c&&c.nodeName==s.nodeName&&o!=t&&(l=e.parentNode)&&l.tagName.toLowerCase()==s.nodeName?o=l:(l=document.createElement(s.nodeName),l.appendChild(o),o=l)}a(o,c||E[0],s)}return o}function a(t,e,n){for(var r in e)"class"==r||"style"==r||"nodeName"==r||r in n||t.removeAttribute(r);for(var o in n)"class"!=o&&"style"!=o&&"nodeName"!=o&&n[o]!=e[o]&&t.setAttribute(o,n[o]);if(e["class"]!=n["class"]){for(var i=e["class"]?e["class"].split(" "):k,s=n["class"]?n["class"].split(" "):k,a=0;a<i.length;a++)-1==s.indexOf(i[a])&&t.classList.remove(i[a]);for(var c=0;c<s.length;c++)-1==i.indexOf(s[c])&&t.classList.add(s[c])}if(e.style!=n.style){var l,p=t.style.cssText;e.style&&(l=p.indexOf(e.style))>-1&&(p=p.slice(0,l)+p.slice(l+e.style.length)),t.style.cssText=p+(n.style||"")}}function c(t,e,n){return s(t,t,E,i(e,n,1!=t.nodeType))}function l(t,e){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function p(t){var e=t.nextSibling;return t.parentNode.removeChild(t),e}function u(t,e,n,r){var o=e.locals(t),i=0;if(0!=o.length)for(var s=0,a=[],c=null,l=0;;){for(;s<o.length&&o[s].to==i;)n(o[s++]);var p=void 0;if(c)p=c,c=null;else{if(!(l<t.childCount))break;p=t.child(l++)}for(var u=0;u<a.length;u++)a[u].to<=i&&a.splice(u--,1);for(;s<o.length&&o[s].from==i;)a.push(o[s++]);var f=i+p.nodeSize;if(p.isText){var h=f;s<o.length&&o[s].from<h&&(h=o[s].from);for(var d=0;d<a.length;d++)a[d].to<h&&(h=a[d].to);h<f&&(c=p.cut(h-i),p=p.cut(0,h-i),f=h)}r(p,a.length?a.slice():k,e.forChild(i,p),l-1),i=f}else for(var m=0;m<t.childCount;m++){var v=t.child(m);r(v,o,e.forChild(i,v),m),i+=v.nodeSize}}function f(t){return z==t.props?I:(z=t.props,I=h(t))}function h(t){var e={};return t.someProp("nodeViews",function(t){for(var n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])}),e}function d(t){if("UL"==t.nodeName||"OL"==t.nodeName){var e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}var m=t("3"),v=m.DOMSerializer,g=t("15"),y=0,w=2,x=3,b=function(t,e,n,r){this.parent=t,this.children=e,this.dom=n,n.pmViewDesc=this,this.contentDOM=r,this.dirty=y},S={size:{},border:{},posAtStart:{},posAtEnd:{}};b.prototype.matchesWidget=function(){return!1},b.prototype.matchesMark=function(){return!1},b.prototype.matchesNode=function(){return!1},b.prototype.matchesHack=function(){return!1},b.prototype.parseRule=function(){return null},b.prototype.stopEvent=function(){return!1},S.size.get=function(){for(var t=this,e=0,n=0;n<this.children.length;n++)e+=t.children[n].size;return e},S.border.get=function(){return 0},b.prototype.destroy=function(){var t=this;this.parent=this.dom.pmViewDesc=null;for(var e=0;e<this.children.length;e++)t.children[e].destroy()},b.prototype.posBeforeChild=function(t){for(var e=this,n=0,r=this.posAtStart;n<this.children.length;n++){var o=e.children[n];if(o==t)return r;r+=o.size}},S.posAtStart.get=function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0},S.posAtEnd.get=function(){return this.posAtStart+this.size-2*this.border},b.prototype.localPosFromDOM=function(t,e,n){var r=this;if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(n<0){var o,i;if(t==this.contentDOM)o=t.childNodes[e-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.previousSibling}for(;o&&(!(i=o.pmViewDesc)||i.parent!=this);)o=o.previousSibling;return o?this.posBeforeChild(i)+i.size:this.posAtStart}var s,a;if(t==this.contentDOM)s=t.childNodes[e];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;s=t.nextSibling}for(;s&&(!(a=s.pmViewDesc)||a.parent!=this);)s=s.nextSibling;return s?this.posBeforeChild(a):this.posAtEnd}var c;if(this.contentDOM)c=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(var l=t;;l=l.parentNode){if(l==r.dom){c=!1;break}if(l.parentNode.firstChild!=l)break}if(null==c&&e==t.childNodes.length)for(var p=t;;p=p.parentNode){if(p==r.dom){c=!0;break}if(p.parentNode.lastChild!=p)break}}return(null==c?n>0:c)?this.posAtEnd:this.posAtStart},b.prototype.nearestDesc=function(t,e){for(var n=this,r=!0,o=t;o;o=o.parentNode){var i=n.getDesc(o);if(i&&(!e||i.node)){if(!r||!i.nodeDOM||i.nodeDOM.contains(t))return i;r=!1}}},b.prototype.getDesc=function(t){for(var e=this,n=t.pmViewDesc,r=n;r;r=r.parent)if(r==e)return n},b.prototype.posFromDOM=function(t,e,n){for(var r=this,o=t;;o=o.parentNode){var i=r.getDesc(o);if(i)return i.localPosFromDOM(t,e,n)}},b.prototype.descAt=function(t){for(var e=this,n=0,r=0;n<this.children.length;n++){var o=e.children[n],i=r+o.size;if(r==t&&i!=r){for(;!o.border&&o.children.length;)o=o.children[0];return o}if(t<i)return o.descAt(t-r-o.border);r=i}},b.prototype.domFromPos=function(t,e){var n=this;if(!this.contentDOM)return{node:this.dom,offset:0};for(var r=0,o=0;;o++){if(r==t)return{node:n.contentDOM,offset:e?n.findDOMOffset(o,e):o};if(o==n.children.length)throw new Error("Invalid position "+t);var i=n.children[o],s=r+i.size;if(t<s)return i.domFromPos(t-r-i.border,e);r=s}},b.prototype.findDOMOffset=function(t,e){var n=this,r=this.contentDOM;if(e<0){for(var o=t-1;o>=0;o--){var i=n.children[o];if(i.size){var s=Array.prototype.indexOf.call(r.childNodes,i.dom);if(s>-1)return s+1}}return 0}for(var a=t;a<this.children.length;a++){var c=n.children[a];if(c.size){var l=Array.prototype.indexOf.call(r.childNodes,c.dom);if(l>-1)return l}}return r.childNodes.length},b.prototype.domAfterPos=function(t){var e=this.domFromPos(t),n=e.node,r=e.offset;if(1!=n.nodeType||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]},b.prototype.setSelection=function(t,e,n){for(var r=this,o=Math.min(t,e),i=Math.max(t,e),s=0,a=0;s<this.children.length;s++){var c=r.children[s],l=a+c.size;if(o>a&&i<l)return c.setSelection(t-a-c.border,e-a-c.border,n);a=l}var p=this.domFromPos(t),u=this.domFromPos(e),f=n.getSelection(),h=document.createRange();if(f.extend)h.setEnd(p.node,p.offset),h.collapse(!1);else{if(t>e){var d=p;p=u,u=d}h.setEnd(u.node,u.offset),h.setStart(p.node,p.offset)}f.removeAllRanges(),f.addRange(h),f.extend&&f.extend(u.node,u.offset)},b.prototype.ignoreMutation=function(){return!this.contentDOM},b.prototype.markDirty=function(t,e){for(var n=this,r=0,o=0;o<this.children.length;o++){var i=n.children[o],s=r+i.size;if(r==s?t<=s&&e>=r:t<s&&e>r){var a=r+i.border,c=s-i.border;if(t>=a&&e<=c)return n.dirty=t==r||e==s?w:1,void i.markDirty(t-a,e-a);i.dirty=x}r=s}this.dirty=w},Object.defineProperties(b.prototype,S);var k=[],M=function(t){function e(e,n){t.call(this,e,k,n.type.widget,null),this.widget=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.matchesWidget=function(t){return this.dirty==y&&t.type==this.widget.type},e.prototype.parseRule=function(){return{ignore:!0}},e.prototype.stopEvent=function(t){var e=this.widget.type.options.stopEvent;return!!e&&e(t)},e}(b),C=function(t){function e(e,n,r){t.call(this,e,[],r,r),this.mark=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t,n,r){var o=f(r)[n.type.name],i=o&&o(n,r);return new e(t,n,i&&i.dom||v.renderSpec(document,n.type.spec.toDOM(n)).dom)},e.prototype.parseRule=function(){return{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}},e.prototype.matchesMark=function(t){return this.dirty!=x&&this.mark.eq(t)},e}(b),O=function(t){function e(e,n,r,o,i,s,a,c){t.call(this,e,n.isLeaf?k:[],i,s),this.nodeDOM=a,this.node=n,this.outerDeco=r,this.innerDeco=o,s&&this.updateChildren(c)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={size:{},border:{}};return e.create=function(t,n,r,o,i){var s,a=f(i)[n.type.name],l=a&&a(n,i,function(){if(s&&s.parent)return s.parent.posBeforeChild(s)},r),p=l&&l.dom,u=l&&l.contentDOM;if(!p){var h;h=v.renderSpec(document,n.type.spec.toDOM(n)),p=h.dom,u=h.contentDOM}u||n.isText||(p.contentEditable=!1);var d=p;return p=c(p,r,n),l?s=new R(t,n,r,o,p,u,d,l,i):n.isText?new D(t,n,r,o,p,d,i):new e(t,n,r,o,p,u,d,i)},e.prototype.parseRule=function(){return{node:this.node.type.name,attrs:this.node.attrs,contentElement:this.contentDOM}},e.prototype.matchesNode=function(t,e,n){return this.dirty==y&&t.eq(this.node)&&l(e,this.outerDeco)&&n.eq(this.innerDeco)},n.size.get=function(){return this.node.nodeSize},n.border.get=function(){return this.node.isLeaf?0:1},e.prototype.updateChildren=function(t){var e=this,n=new A(this);u(this.node,this.innerDeco,function(t){n.placeWidget(t)},function(r,o,i,s){n.syncToMarks(r.marks,t),n.findNodeMatch(r,o,i)||n.updateNextNode(r,o,i,t,e.node.content,s)||n.addNode(r,o,i,t)}),n.syncToMarks(k,t),this.node.isTextblock&&n.addTextblockHacks(),n.destroyRest(),(n.changed||this.dirty==w)&&this.renderChildren()},e.prototype.renderChildren=function(){o(this.contentDOM,this.children,e.is),g.ios&&d(this.dom)},e.prototype.update=function(t,e,n,r){return!(this.dirty==x||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),this.node=t,this.innerDeco=n,t.isLeaf||this.updateChildren(r),this.dirty=y,!0)},e.prototype.updateOuterDeco=function(t){if(!l(t,this.outerDeco)){var e=1!=this.nodeDOM.nodeType;this.dom=s(this.dom,this.nodeDOM,i(this.outerDeco,this.node,e),i(t,this.node,e)),this.outerDeco=t}},e.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode")},e.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode")},Object.defineProperties(e.prototype,n),e}(b);e.docViewDesc=r;var D=function(t){function e(e,n,r,o,i,s,a){t.call(this,e,n,r,o,i,null,s,a)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.parseRule=function(){return{skip:this.nodeDOM.parentNode}},e.prototype.update=function(t,e){return!(this.dirty==x||this.dirty!=y&&!this.inParent||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),this.dirty==y&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text),this.node=t,this.dirty=y,!0)},e.prototype.inParent=function(){for(var t=this.parent.contentDOM,e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1},e.prototype.domFromPos=function(t,e){return{node:this.nodeDOM,offset:e?Math.max(t,this.nodeDOM.nodeValue.length):t}},e.prototype.localPosFromDOM=function(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):t.prototype.localPosFromDOM.call(this,e,n,r)},e.prototype.ignoreMutation=function(t){return"characterData"!=t.type},e}(O),T=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.parseRule=function(){return{ignore:!0}},e.prototype.matchesHack=function(){return this.dirty==y},e}(b),R=function(t){function e(e,n,r,o,i,s,a,c,l){t.call(this,e,n,r,o,i,s,a,l),this.spec=c}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.update=function(e,n,r,o){if(this.spec.update){var i=this.spec.update(e,n);return i&&(this.node=e,this.contentDOM&&this.updateChildren(o)),i}return!(!this.contentDOM&&!e.isLeaf)&&t.prototype.update.call(this,e,n,this.contentDOM?this.innerDeco:r,o)},e.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():t.prototype.selectNode.call(this)},e.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():t.prototype.deselectNode.call(this)},e.prototype.setSelection=function(e,n,r){this.spec.setSelection?this.spec.setSelection(e,n,r):t.prototype.setSelection.call(this,e,n,r)},e.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),t.prototype.destroy.call(this)},e.prototype.stopEvent=function(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)},e.prototype.ignoreMutation=function(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):t.prototype.ignoreMutation.call(this,e)},e}(O),N=function(t){t&&(this.nodeName=t)};N.prototype=Object.create(null);var E=[new N],A=function(t){this.top=t,this.index=0,this.stack=[],this.changed=!1};A.prototype.destroyBetween=function(t,e){var n=this;if(t!=e){for(var r=t;r<e;r++)n.top.children[r].destroy();this.top.children.splice(t,e-t),this.changed=!0}},A.prototype.destroyRest=function(){this.destroyBetween(this.index,this.top.children.length)},A.prototype.syncToMarks=function(t,e){for(var n,r=this,o=0,i=this.stack.length>>1,s=Math.min(i,t.length);o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(t[o]);)o++;for(;o<i;)r.destroyRest(),r.top.dirty=y,r.index=r.stack.pop(),r.top=r.stack.pop(),i--;for(;i<t.length;){if(r.stack.push(r.top,r.index+1),r.index<r.top.children.length&&(n=r.top.children[r.index]).matchesMark(t[i]))r.top=n;else{var a=C.create(r.top,t[i],e);r.top.children.splice(r.index,0,a),r.top=a,r.changed=!0}r.index=0,i++}},A.prototype.findNodeMatch=function(t,e,n){for(var r=this,o=this.index,i=this.top.children,s=Math.min(i.length,o+5);o<s;o++)if(i[o].matchesNode(t,e,n))return r.destroyBetween(r.index,o),r.index++,!0;return!1},A.prototype.updateNextNode=function(t,e,n,r,o,i){
116
- if(this.index==this.top.children.length)return!1;var s=this.top.children[this.index];if(s instanceof O){for(var a=i+1,c=Math.min(o.childCount,a+5);a<c;a++)if(s.node==o.child(a))return!1;var l=s.dom;if(s.update(t,e,n,r))return s.dom!=l&&(this.changed=!0),this.index++,!0}return!1},A.prototype.addNode=function(t,e,n,r){this.top.children.splice(this.index++,0,O.create(this.top,t,e,n,r)),this.changed=!0},A.prototype.placeWidget=function(t){this.index<this.top.children.length&&this.top.children[this.index].matchesWidget(t)?this.index++:(this.top.children.splice(this.index++,0,new M(this.top,t)),this.changed=!0)},A.prototype.addTextblockHacks=function(){for(var t=this.top.children[this.index-1];t instanceof C;)t=t.children[t.children.length-1];if(!t||!(t instanceof D)||/\n$/.test(t.node.text))if(this.index<this.top.children.length&&this.top.children[this.index].matchesHack())this.index++;else{var e=document.createElement("br");this.top.children.splice(this.index++,0,new T(this.top,k,e,null)),this.changed=!0}};var I,z;return n.exports}),t.registerDynamic("16",["7","15"],!0,function(t,e,n){function r(t,e){var n=t.selection,r=n.$from,o=n.$to,i=n.node,s=e>0?o:r,a=i&&i.isBlock?s:s.depth?t.doc.resolve(e>0?s.after():s.before()):null;return a&&v.findFrom(a,e)}function o(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function i(t,e){var n=t.state.selection,i=n.empty,s=n.node,a=n.$from,c=n.$to;if(!i&&!s)return!1;if(s&&s.isInline)return o(t,new y(e>0?c:a));if(!s&&!t.endOfTextblock(e>0?"right":"left")){var l=e>0?a.parent.childAfter(a.parentOffset):a.parent.childBefore(a.parentOffset),p=l.node,u=l.offset;return!(!p||!g.isSelectable(p)||u!=a.parentOffset-(e>0?0:p.nodeSize))&&o(t,new g(e<0?t.state.doc.resolve(a.pos-p.nodeSize):a))}var f=r(t.state,e);return!(!f||!(f instanceof g||s))&&o(t,f)}function s(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function a(t){var e=t.pmViewDesc;return e&&0==e.size}function c(t){for(var e,n,r=t.root.getSelection(),o=r.anchorNode,i=r.anchorOffset;;)if(i>0){if(1!=o.nodeType)break;var c=o.childNodes[i-1];if(!a(c))break;e=o,n=--i}else{if(p(o))break;for(var l=o.previousSibling;l&&a(l);)e=o.parentNode,n=Array.prototype.indexOf.call(e.childNodes,l),l=l.previousSibling;if(l)o=l,i=s(o);else{if((o=o.parentNode)==t.content)break;i=0}}e&&u(r,e,n)}function l(t){for(var e,n,r=t.root.getSelection(),o=r.anchorNode,i=r.anchorOffset,c=s(o);;)if(i<c){if(1!=o.nodeType)break;var l=o.childNodes[i];if(!a(l))break;e=o,n=++i}else{if(p(o))break;for(var f=o.nextSibling;f&&a(f);)e=f.parentNode,n=Array.prototype.indexOf.call(e.childNodes,f)+1,f=f.nextSibling;if(f)o=f,i=0,c=s(o);else{if((o=o.parentNode)==t.content)break;i=c=0}}e&&u(r,e,n)}function p(t){var e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function u(t,e,n){var r=document.createRange();r.setEnd(e,n),r.setStart(e,n),t.removeAllRanges(),t.addRange(r)}function f(t,e){var n=t.state.selection,i=n.empty,s=n.node,a=n.$from,c=n.$to;if(!i&&!s)return!1;var l=!0,p=e<0?a:c;if(s&&!s.isInline||(l=t.endOfTextblock(e<0?"up":"down")),l){var u=r(t.state,e);if(u&&u instanceof g)return o(t,u)}if(!s||s.isInline)return!1;var f=v.findFrom(p,e);return!f||o(t,f)}function h(t,e){var n=t.state.selection,r=n.$head,o=n.$anchor,i=n.empty;if(!r||!r.sameParent(o)||!r.parent.isTextblock)return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;var s=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(s&&!s.isText){var a=t.state.tr;return e<0?a["delete"](r.pos-s.nodeSize,r.pos):a["delete"](r.pos,r.pos+s.nodeSize),t.dispatch(a),!0}return!1}function d(t,e){var n=e.keyCode,r=w.mac?e.metaKey:e.ctrlKey;if(8==n)return h(t,-1)||c(t);if(46==n)return h(t,1)||l(t);if(13==n||27==n)return!0;if(37==n)return i(t,-1)||c(t);if(39==n)return i(t,1)||l(t);if(38==n)return f(t,-1);if(40==n)return f(t,1);if(!r||e.altKey||e.shiftKey){if(w.mac&&68==n&&e.altKey&&!r&&!e.shiftKey)return h(t,1)||l(t)}else{if(66==n||73==n||89==n||90==n)return!0;if(w.mac&&68==n)return h(t,1)||l(t);if(w.mac&&72==n)return h(t,-1)||c(t)}return!1}var m=t("7"),v=m.Selection,g=m.NodeSelection,y=m.TextSelection,w=t("15");return e.captureKeyDown=d,n.exports}),t.registerDynamic("17",["3","7","18"],!0,function(t,e,n){function r(t,e,n,r){var i=t.docView.domFromPos(n,-1),s=i.node,a=i.offset,c=t.docView.domFromPos(r,1),l=c.node,p=c.offset;if(s!=l)return null;if(p==s.childNodes.length)for(var u=s;u!=t.content;){if(u.nextSibling){if(!u.nextSibling.pmViewDesc)return null;break}u=u.parentNode}var f=t.root.getSelection(),h=null;f.anchorNode&&t.content.contains(f.anchorNode)&&(h=[{node:f.anchorNode,offset:f.anchorOffset}],f.isCollapsed||h.push({node:f.focusNode,offset:f.focusOffset}));var d=e.doc,m=t.someProp("domParser")||g.fromSchema(t.state.schema),v=d.resolve(n),y=null,w=m.parse(s,{topNode:v.parent.copy(),topStart:v.index(),topOpen:!0,from:a,to:p,preserveWhitespace:!0,editableContent:!0,findPositions:h,ruleFromNode:o});if(h&&null!=h[0].pos){var x=h[0].pos,b=h[1]&&h[1].pos;null==b&&(b=x),y={anchor:x+n,head:b+n}}return{doc:w,sel:y}}function o(t){var e=t.pmViewDesc;return e?e.parseRule():"BR"==t.nodeName&&t.parentNode&&t.parentNode.lastChild==t?{ignore:!0}:void 0}function i(t,e){for(var n=e||0;n<t.depth;n++)if(t.index(n)+1<t.node(n).childCount)return!1;return t.parentOffset==t.parent.content.size}function s(t,e){for(var n=e||0;n<t.depth;n++)if(t.index(0)>0)return!1;return 0==t.parentOffset}function a(t){var e=t.$from,n=t.$to;if(e.sameParent(n)&&e.parent.isTextblock&&e.parentOffset&&n.parentOffset<n.parent.content.size){var r=Math.max(0,e.parentOffset),o=e.parent.content.size,a=Math.min(o,n.parentOffset);if(r>0&&(r=e.parent.childBefore(r).offset),a<o){var c=e.parent.childAfter(a);a=c.offset+c.node.nodeSize}var l=e.start();return{from:l+r,to:l+a}}for(var p=0;;p++){var u=s(e,p+1),f=i(n,p+1);if(u||f||e.index(p)!=n.index(p)||n.node(p).isTextblock){var h=e.before(p+1),d=n.after(p+1);return u&&e.index(p)>0&&(h-=e.node(p).child(e.index(p)-1).nodeSize),f&&n.index(p)+1<n.node(p).childCount&&(d+=n.node(p).child(n.index(p)+1).nodeSize),{from:h,to:d}}}}function c(t,e){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function l(t,e,n,o){for(var i,s=n.doc;!(i=r(t,n,o.from,o.to));){var a=s.resolve(o.from),l=s.resolve(o.to);o={from:a.depth?a.before():0,to:l.depth?l.after():s.content.size}}var h=i.doc,m=i.sel,v=s.slice(o.from,o.to),g=d(v.content,h.content,o.from,n.selection.from);if(g){var y,x=h.resolveNoCache(g.start-o.from),b=h.resolveNoCache(g.endB-o.from);if(!(!x.sameParent(b)&&x.pos<h.content.size&&(y=w.findFrom(h.resolve(x.pos+1),1,!0))&&y.head==b.pos&&t.someProp("handleKeyDown",function(e){return e(t,c(13,"Enter"))})||n.selection.anchor>g.start&&f(s,g.start,g.endA,x,b)&&t.someProp("handleKeyDown",function(e){return e(t,c(8,"Backspace"))}))){var S,k,M,C,O=e.map(g.start),D=e.map(g.endA,-1);if(x.sameParent(b)&&x.parent.isTextblock)if(x.pos==b.pos){S=t.state.tr["delete"](O,D);var T=s.resolve(g.start);T.parentOffset<T.parent.content.size&&(k=T.marks(!0))}else if(g.endA==g.endB&&(C=s.resolve(g.start))&&(M=u(x.parent.content.cut(x.parentOffset,b.parentOffset),C.parent.content.cut(C.parentOffset,g.endA-C.start()))))S=t.state.tr,"add"==M.type?S.addMark(O,D,M.mark):S.removeMark(O,D,M.mark);else if(x.parent.child(x.index()).isText&&x.index()==b.index()-(b.textOffset?0:1)){var R=x.parent.textBetween(x.parentOffset,b.parentOffset);if(t.someProp("handleTextInput",function(e){return e(t,O,D,R)}))return;S=t.state.tr.insertText(R,O,D)}S||(S=t.state.tr.replace(O,D,h.slice(g.start-o.from,g.endB-o.from))),m&&S.setSelection(p(S.doc,e,m)),k&&S.setStoredMarks(k),t.dispatch(S.scrollIntoView())}}else if(m){var N=p(t.state.doc,e,m);N.eq(t.state.selection)||t.dispatch(t.state.tr.setSelection(N))}}function p(t,e,n){return w.between(t.resolve(e.map(n.anchor)),t.resolve(e.map(n.head)))}function u(t,e){for(var n,r,o,i=t.firstChild.marks,s=e.firstChild.marks,a=i,c=s,l=0;l<s.length;l++)a=s[l].removeFromSet(a);for(var p=0;p<i.length;p++)c=i[p].removeFromSet(c);if(1==a.length&&0==c.length)r=a[0],n="add",o=function(t){return t.mark(r.addToSet(t.marks))};else{if(0!=a.length||1!=c.length)return null;r=c[0],n="remove",o=function(t){return t.mark(r.removeFromSet(t.marks))}}for(var u=[],f=0;f<e.childCount;f++)u.push(o(e.child(f)));if(v.from(u).eq(t))return{mark:r,type:n}}function f(t,e,n,r,o){if(!r.parent.isTextblock||n-e<=o.pos-r.pos||h(r,!0,!1)<o.pos)return!1;var i=t.resolve(e);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;var s=t.resolve(h(i,!0,!0));return!(!s.parent.isTextblock||s.pos>n||h(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function h(t,e,n){for(var r=t.depth,o=e?t.end():t.pos;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n)for(var i=t.node(r).maybeChild(t.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function d(t,e,n,r){var o=t.findDiffStart(e,n);if(!o)return null;var i=t.findDiffEnd(e,n+t.size,n+e.size),s=i.a,a=i.b;if(s<o&&t.size<e.size){o-=r<=o&&r>=s?o-r:0,a=o+(a-s),s=o}else if(a<o){var c=r<=o&&r>=a?o-r:0;o-=c,s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}var m=t("3"),v=m.Fragment,g=m.DOMParser,y=t("7"),w=y.Selection,x=t("18"),b=x.TrackMappings,S=function(t,e,n){var r=this;this.view=t,this.id=e,this.state=t.state,this.composing=n,this.from=this.to=null,this.timeout=n?null:setTimeout(function(){return r.finish()},20),this.mappings=new b(t.state)};return S.prototype.addRange=function(t,e){null==this.from?(this.from=t,this.to=e):(this.from=Math.min(t,this.from),this.to=Math.max(e,this.to))},S.prototype.changedRange=function(){if(null==this.from)return a(this.state.selection);var t=this.state.doc.resolve(this.from),e=this.state.doc.resolve(this.to),n=t.sharedDepth(this.to);return{from:t.before(n+1),to:e.after(n+1)}},S.prototype.finish=function(t){if(clearTimeout(this.timeout),!this.composing||t){var e=this.changedRange();null==this.from?this.view.docView.markDirty(e.from,e.to):this.view.docView.markDirty(this.from,this.to);var n=this.mappings.getMapping(this.view.state);this.destroy(),n&&l(this.view,n,this.state,e),this.view.docView.dirty&&this.view.updateState(this.view.state)}},S.prototype.destroy=function(){this.mappings.destroy(),this.view.inDOMChange=null},S.prototype.compositionEnd=function(){var t=this;this.composing&&(this.composing=!1,this.timeout=setTimeout(function(){return t.finish()},50))},S.start=function(t,e){if(t.inDOMChange)e&&(clearTimeout(t.inDOMChange.timeout),t.inDOMChange.composing=!0);else{var n=Math.floor(4294967295*Math.random());t.inDOMChange=new S(t,n,e)}},e.DOMChange=S,n.exports}),t.registerDynamic("19",["3"],!0,function(t,e,n){function r(t,e,n){var r,o=t.state.doc,i=o.slice(e.from,e.to,!e.node),s=i;if(!e.node){var a=Math.max(0,e.$from.sharedDepth(e.to)-1);r=u(s,a);for(var c=s.content,l=0;l<a;l++)c=c.firstChild.content;s=new d(c,s.openLeft-a,s.openRight-a)}var p=t.someProp("clipboardSerializer")||g.fromSchema(t.state.schema),f=p.serializeFragment(s.content),h=document.createElement("div");h.appendChild(f);var m=1==h.firstChild.nodeType&&h.firstChild;return m&&(e.node?m.setAttribute("data-pm-node-selection",!0):m.setAttribute("data-pm-context",r)),n.clearData(),n.setData("text/html",h.innerHTML),n.setData("text/plain",s.content.textBetween(0,s.content.size,"\n\n")),i}function o(t){return null!=y?y:(t.setData("text/html","<hr>"),y="<hr>"==t.getData("text/html"))}function i(t,e,n,r){var o=e.getData("text/plain"),i=e.getData("text/html");if(!i&&!o)return null;var a,c=r.parent.type.spec.code;if((n||c||!i)&&o){if(t.someProp("transformPastedText",function(t){return o=t(o)}),c)return new d(m.from(t.state.schema.text(o)),0,0);a=document.createElement("div"),o.split(/(?:\r\n?|\n)+/).forEach(function(t){a.appendChild(document.createElement("p")).textContent=t})}else t.someProp("transformPastedHTML",function(t){return i=t(i)}),a=p(i);var l,u=t.someProp("clipboardParser")||t.someProp("domParser")||v.fromSchema(t.state.schema),h=u.parseSlice(a,{preserveWhitespace:!0});return h=a.querySelector("[data-pm-node-selection]")?new d(h.content,0,0):(l=a.querySelector("[data-pm-context]"))?f(h,l.getAttribute("data-pm-context")):s(h,r)}function s(t,e){if(t.content.childCount<2)return t;for(var n=function(n){var r=e.node(n),o=r.contentMatchAt(e.index(n)),i=void 0,s=[];if(t.content.forEach(function(t){if(s){var e,n=o.findWrappingFor(t);if(!n)return s=null;if(e=s.length&&i.length&&c(n,i,t,s[s.length-1],0))s[s.length-1]=e;else{s.length&&(s[s.length-1]=l(s[s.length-1],i.length));var r=a(t,n);s.push(r),o=o.matchType(r.type,r.attrs),i=n}}}),s)return{v:d.maxOpen(m.from(s))}},r=e.depth;r>=0;r--){var o=n(r);if(o)return o.v}return t}function a(t,e,n){void 0===n&&(n=0);for(var r=e.length-1;r>=n;r--)t=e[r].type.create(e[r].attrs,m.from(t));return t}function c(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o].type==e[o].type){var i=c(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));var s=r.contentMatchAt(r.childCount);if(o==t.length-1?s.matchNode(n):s.matchType(t[o+1].type,t[o+1].attrs))return r.copy(r.content.append(m.from(a(n,t,o+1))))}}function l(t,e){if(0==e)return t;var n=t.content.replaceChild(t.childCount-1,l(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(m.empty,!0);return t.copy(n.append(r))}function p(t){var e=/(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));var n,r=x||(x=document.implementation.createHTMLDocument("title")),o=r.createElement("div"),i=/(?:<meta [^>]*>)*<([a-z][^>\s]+)/i.exec(t),s=0;if(n=i&&w[i[1].toLowerCase()]){var a=n.split(" ");t=a.map(function(t){return"<"+t+">"}).join("")+t+a.map(function(t){return"</"+t+">"}).reverse().join(""),s=a.length}o.innerHTML=t;for(var c=0;c<s;c++)o=o.firstChild;return o}function u(t,e){for(var n=[],r=t.content,o=0;o<e;o++){var i=r.firstChild;n.push(i.type.name,i.type.hasRequiredAttrs()?i.attrs:null),r=i.content}return JSON.stringify(n)}function f(t,e){if(!t.size)return t;var n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(e){return t}for(var o=t.content,i=t.openLeft,s=t.openRight,a=n.length-2;a>=0;a-=2){var c=r.nodes[n[a]];if(!c||c.hasRequiredAttrs())break;o=m.from(c.create(n[a+1],o)),i++,s++}return new d(o,i,s)}var h=t("3"),d=h.Slice,m=h.Fragment,v=h.DOMParser,g=h.DOMSerializer;e.toClipboard=r;var y=null;e.canUpdateClipboard=o,e.fromClipboard=i;var w={thead:"table",colgroup:"table",col:"table colgroup",tr:"table tbody",td:"table tbody tr",th:"table tbody tr"},x=null;return n.exports}),t.registerDynamic("18",["7","9"],!0,function(t,e,n){var r=t("7"),o=r.EditorState,i=t("9"),s=i.Mapping,a=function(t,e,n){this.prev=t,this.mapping=e,this.state=n},c=function(t){this.seen=[new a(null,null,t)],o.addApplyListener(this.track=this.track.bind(this))};return c.prototype.destroy=function(){o.removeApplyListener(this.track)},c.prototype.find=function(t){for(var e=this,n=this.seen.length-1;n>=0;n--){var r=e.seen[n];if(r.state==t)return r}},c.prototype.track=function(t,e,n){var r=this.seen.length<200?this.find(t):null;r&&this.seen.push(new a(r,e.docChanged?e.mapping:null,n))},c.prototype.getMapping=function(t){var e=this.find(t);if(!e)return null;for(var n=[],r=e;r;r=r.prev)r.mapping&&n.push(r.mapping);for(var o=new s,i=n.length-1;i>=0;i--)o.appendMapping(n[i]);return o},e.TrackMappings=c,n.exports}),t.registerDynamic("1a",["7","15","16","17","19","18"],!0,function(t,e,n){function r(t){t.shiftKey=!1,t.mouseDown=null,t.dragging=null,t.inDOMChange=null,t.mutationObserver=window.MutationObserver&&new window.MutationObserver(function(e){return S(t,e)}),x(t);var e=function(e){var n=V[e];t.content.addEventListener(e,function(e){!a(t,e)||s(t,e)||!t.editable&&e.type in j||n(t,e)})};for(var n in V)e(n);t.extraHandlers=Object.create(null),i(t)}function o(t){b(t),t.inDOMChange&&t.inDOMChange.destroy(),t.dragging&&t.dragging.destroy()}function i(t){t.someProp("handleDOMEvents",function(e){for(var n in e)t.extraHandlers[n]||e.hasOwnProperty(n)||(t.extraHandlers[n]=!0,t.content.addEventListener(n,function(e){return s(t,e)}))})}function s(t,e){return t.someProp("handleDOMEvents",function(n){var r=n[e.type];return!!r&&r(t,e)})}function a(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(var n=e.target;n!=t.content;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function c(t,e){s(t,e)||!V[e.type]||!t.editable&&e.type in j||V[e.type](t,e)}function l(t){return{left:t.clientX,top:t.clientY}}function p(t,e){var n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function u(t,e,n,r,o){if(-1==r)return!1;for(var i=t.state.doc.resolve(r),s=function(r){if(t.someProp(e,function(e){return r>i.depth?e(t,n,i.nodeAfter,i.before(r),o,!0):e(t,n,i.node(r),i.before(r),o,!1)}))return{v:!0}},a=i.depth+1;a>0;a--){var c=s(a);if(c)return c.v}return!1}function f(t,e,n){t.focus();var r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function h(t,e){if(-1==e)return!1;var n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isLeaf&&T.isSelectable(r))&&(f(t,new T(n),"pointer"),!0)}function d(t,e){if(-1==e)return!1;for(var n,r=t.state.selection,o=r.node,i=r.$from,s=t.state.doc.resolve(e),a=s.depth+1;a>0;a--){var c=a>s.depth?s.nodeAfter:s.node(a);if(T.isSelectable(c)){n=o&&i.depth>0&&a>=i.depth&&s.before(i.depth+1)==i.pos?s.before(i.depth):s.before(a);break}}return null!=n&&(f(t,T.create(t.state.doc,n),"pointer"),!0)}function m(t,e,n,r){return u(t,"handleClickOn",e,n,r)||t.someProp("handleClick",function(n){return n(t,e,r)})||h(t,n)}function v(t,e,n,r){return u(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",function(n){return n(t,e,r)})}function g(t,e,n,r){return u(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",function(n){return n(t,e,r)})||y(t,n)}function y(t,e){var n=t.state.doc;if(-1==e)return!!n.isTextblock&&(f(t,R.create(n,0,n.content.size),"pointer"),!0);for(var r=n.resolve(e),o=r.depth+1;o>0;o--){var i=o>r.depth?r.nodeAfter:r.node(o),s=r.before(o);if(i.isTextblock)f(t,R.create(n,s+1,s+1+i.content.size),"pointer");else{if(!T.isSelectable(i))continue;f(t,T.create(n,s),"pointer")}return!0}}function w(t){return!!t.inDOMChange&&(t.inDOMChange.finish(!0),!0)}function x(t){t.mutationObserver&&t.mutationObserver.observe(t.content,K)}function b(t){t.mutationObserver&&t.mutationObserver.disconnect()}function S(t,e){if(t.editable)for(var n=0;n<e.length;n++){var r=e[n],o=t.docView.nearestDesc(r.target);if(("attributes"!=r.type||o!=t.docView&&"contenteditable"!=r.attributeName)&&(o&&!o.ignoreMutation(r))){var i=void 0,s=void 0;if("childList"==r.type){var a=r.previousSibling&&r.previousSibling.parentNode==r.target?Array.prototype.indexOf.call(r.target.childNodes,o.previousSibling)+1:0;i=o.localPosFromDOM(r.target,a,-1);var c=r.nextSibling&&r.nextSibling.parentNode==r.target?Array.prototype.indexOf.call(r.target.childNodes,o.nextSibling):r.target.childNodes.length;s=o.localPosFromDOM(r.target,c,1)}else"attributes"==r.type?(i=o.posAtStart-o.border,s=o.posAtEnd+o.border):(i=o.posAtStart,s=o.posAtEnd);z.start(t),t.inDOMChange.addRange(i,s)}}}function k(t){return 0==t.openLeft&&0==t.openRight&&1==t.content.childCount?t.content.firstChild:null}function M(t){t.dragging&&(t.dragging.destroy(),t.dragging=null)}function C(t,e){if(!t||!t.content.size)return e.pos;for(var n=t.content,r=0;r<t.openLeft;r++)n=n.firstChild.content;for(var o=e.depth;o>=0;o--){var i=o==e.depth?0:e.pos<=(e.start(o+1)+e.end(o+1))/2?-1:1,s=e.index(o)+(i>0?1:0);if(e.node(o).canReplace(s,s,n))return 0==i?e.pos:i<0?e.before(o+1):e.after(o+1)}return e.pos}var O=t("7"),D=O.Selection,T=O.NodeSelection,R=O.TextSelection,N=t("15"),E=t("16"),A=E.captureKeyDown,I=t("17"),z=I.DOMChange,P=t("19"),L=P.fromClipboard,F=P.toClipboard,q=P.canUpdateClipboard,B=t("18"),_=B.TrackMappings,V={},j={};e.initInput=r,e.destroyInput=o,e.ensureListeners=i,e.dispatchEvent=c,j.keydown=function(t,e){16==e.keyCode&&(t.shiftKey=!0),t.inDOMChange||(t.someProp("handleKeyDown",function(n){return n(t,e)})||A(t,e)?e.preventDefault():t.selectionReader.poll())},j.keyup=function(t,e){16==e.keyCode&&(t.shiftKey=!1)},j.keypress=function(t,e){if(!(t.inDOMChange||!e.charCode||e.ctrlKey&&!e.altKey||N.mac&&e.metaKey)){if(t.someProp("handleKeyPress",function(n){return n(t,e)}))return void e.preventDefault();var n=t.state.selection,r=n.node,o=n.$from,i=n.$to;if(r||!o.sameParent(i)){var s=String.fromCharCode(e.charCode);t.someProp("handleTextInput",function(e){return e(t,o.pos,i.pos,s)})||t.dispatch(t.state.tr.insertText(s).scrollIntoView()),e.preventDefault()}}};var $={time:0,x:0,y:0},J=$,W=N.mac?"metaKey":"ctrlKey";V.mousedown=function(t,e){var n,r=w(t),o=Date.now();n=o-$.time>=500||!p(e,$)||e[W]?"singleClick":o-J.time>=600||!p(e,J)?"doubleClick":"tripleClick",J=$,$={time:o,x:e.clientX,y:e.clientY};var i=t.posAtCoords(l(e));i&&("singleClick"==n?t.mouseDown=new H(t,i,e,r):("doubleClick"==n?v:g)(t,i.pos,i.inside,e)?e.preventDefault():t.selectionReader.poll("pointer"))};var H=function(t,e,n,r){var o=this;this.view=t,this.pos=e,this.flushed=r,this.selectNode=n[W],this.allowDefault=n.shiftKey;var i,s;if(e.inside>-1)i=t.state.doc.nodeAt(e.inside),s=e.inside;else{var a=t.state.doc.resolve(e.pos);i=a.parent,s=a.depth?a.before():0}this.mightDrag=i.type.spec.draggable||i==t.state.selection.node?{node:i,pos:s}:null,this.target=r?null:n.target,this.target&&this.mightDrag&&(b(this.view),this.target.draggable=!0,N.gecko&&(this.setContentEditable=!this.target.hasAttribute("contentEditable"))&&setTimeout(function(){return o.target.setAttribute("contentEditable","false")},20),x(this.view)),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),t.selectionReader.poll("pointer")};H.prototype.done=function(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(b(this.view),this.target.draggable=!1,N.gecko&&this.setContentEditable&&this.target.removeAttribute("contentEditable"),x(this.view))},H.prototype.up=function(t){this.done(),this.view.content.contains(3==t.target.nodeType?t.target.parentNode:t.target)&&(this.allowDefault?this.view.selectionReader.poll("pointer"):(this.selectNode?d(this.view,this.pos.inside):m(this.view,this.pos.pos,this.pos.inside,t))?t.preventDefault():this.flushed?(f(this.view,D.near(this.view.state.doc.resolve(this.pos.pos)),"pointer"),t.preventDefault()):this.view.selectionReader.poll("pointer"))},H.prototype.move=function(t){!this.allowDefault&&(Math.abs(this.x-t.clientX)>4||Math.abs(this.y-t.clientY)>4)&&(this.allowDefault=!0),this.view.selectionReader.poll("pointer")},V.touchdown=function(t){w(t),t.selectionReader.poll("pointer")},V.contextmenu=function(t,e){w(t);var n=t.posAtCoords(l(e));n&&t.someProp("handleContextMenu",function(r){return r(t,n.pos,e)})&&e.preventDefault()},j.compositionstart=j.compositionupdate=function(t){z.start(t,!0),t.state.storedMarks&&t.inDOMChange.finish(!0)},j.compositionend=function(t,e){if(!t.inDOMChange){if(!e.data)return;z.start(t,!0)}t.inDOMChange.compositionEnd()};var K={childList:!0,characterData:!0,attributes:!0,subtree:!0};e.startObserving=x,e.stopObserving=b,j.input=function(t){return z.start(t)},V.copy=j.cut=function(t,e){var n=t.state.selection,r="cut"==e.type;if(!n.empty){if(!e.clipboardData||!q(e.clipboardData))return void(r&&N.ie&&N.ie_version<=11&&z.start(t));F(t,n,e.clipboardData),e.preventDefault(),r&&t.dispatch(t.state.tr.deleteRange(n.from,n.to).scrollIntoView())}},j.paste=function(t,e){if(!e.clipboardData)return void(N.ie&&N.ie_version<=11&&z.start(t));var n=L(t,e.clipboardData,t.shiftKey,t.state.selection.$from);if(n){e.preventDefault(),t.someProp("transformPasted",function(t){n=t(n)});var r=k(n),o=r?t.state.tr.replaceSelectionWith(r):t.state.tr.replaceSelection(n);t.dispatch(o.scrollIntoView())}};var Q=function(t,e,n,r){this.slice=e,this.range=n,this.move=r&&new _(t)};Q.prototype.destroy=function(){this.move&&this.move.destroy()},V.dragstart=function(t,e){var n=t.mouseDown;if(n&&n.done(),e.dataTransfer){var r,o=t.state.selection,i=o.empty?null:t.posAtCoords(l(e));if(null!=i&&i.pos>=o.from&&i.pos<=o.to?r=o:n&&n.mightDrag&&(r=T.create(t.state.doc,n.mightDrag.pos)),r){var s=F(t,r,e.dataTransfer);t.dragging=new Q(t.state,s,r,!e.ctrlKey)}}},V.dragend=function(t){window.setTimeout(function(){return M(t)},50)},j.dragover=j.dragenter=function(t,e){return e.preventDefault()},j.drop=function(t,e){var n=t.dragging;if(M(t),e.dataTransfer){var r=t.state.doc.resolve(t.posAtCoords(l(e)).pos);if(r){var o=n&&n.slice||L(t,e.dataTransfer,!1,r);if(o){var i=C(o,t.state.doc.resolve(r.pos));e.preventDefault();var s=t.state.tr;if(n&&n.move){var a=n.range,c=a.from,p=a.to,u=n.move.getMapping(t.state);u&&s.deleteRange(u.map(c,1),u.map(p,-1))}t.someProp("transformPasted",function(t){o=t(o)});var f=s.mapping.map(i),h=0==o.openLeft&&0==o.openRight&&1==o.content.childCount;h?s.replaceRangeWith(f,f,o.content.firstChild):s.replaceRange(f,f,o);var d=s.doc.resolve(f);h&&T.isSelectable(o.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(o.content.firstChild)?s.setSelection(new T(d)):s.setSelection(D.between(d,s.doc.resolve(s.mapping.map(i)))),t.focus(),t.dispatch(s)}}}},V.focus=function(t,e){t.focused||(t.content.classList.add("ProseMirror-focused"),t.focused=!0),t.someProp("onFocus",function(n){n(t,e)})},V.blur=function(t,e){t.focused&&(t.content.classList.remove("ProseMirror-focused"),t.focused=!1),t.someProp("onBlur",function(n){n(t,e)})};for(var U in j)V[U]=j[U];return n.exports}),t.registerDynamic("15",[],!0,function(t,e,n){var r=n.exports={};if("undefined"!=typeof navigator){var o=/MSIE \d/.test(navigator.userAgent),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);r.mac=/Mac/.test(navigator.platform),r.ie=o||!!i,r.ie_version=o?document.documentMode||6:i&&+i[1],r.gecko=/gecko\/\d/i.test(navigator.userAgent),r.ios=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),r.webkit="WebkitAppearance"in document.documentElement.style}return n.exports}),t.registerDynamic("1b",["7","15"],!0,function(t,e,n){function r(t){return new("onselectionchange"in document?f:h)(t)}function o(t,e,n){if(i(t,e),!t.hasFocus()){if(!n)return;p.gecko&&t.editable&&t.content.focus()}var r=t.selectionReader;if(!e.eq(r.lastSelection)||r.domChanged()){var o,s=e.anchor,a=e.head;if(null==s&&(s=e.from,a=e.to,p.webkit&&e.node.isBlock)){var c=t.docView.descAt(e.from);c.contentDOM||"false"!=c.dom.contentEditable||(o=c.dom,c.dom.contentEditable="true")}t.docView.setSelection(s,a,t.root),o&&(o.contentEditable="false"),r.storeDOMState(e)}}function i(t,e){if(e instanceof l){var n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(s(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else s(t)}function s(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=null)}var a=t("7"),c=a.Selection,l=a.NodeSelection,p=t("15"),u=function(t){var e=this;this.view=t,this.lastAnchorNode=this.lastHeadNode=this.lastAnchorOffset=this.lastHeadOffset=null,this.lastSelection=t.state.selection,this.poller=r(this),t.content.addEventListener("focus",function(){return e.poller.start()}),t.content.addEventListener("blur",function(){return e.poller.stop()}),t.editable||this.poller.start()};u.prototype.destroy=function(){this.poller.stop()},u.prototype.poll=function(t){this.poller.poll(t)},u.prototype.editableChanged=function(){this.view.editable?this.view.hasFocus()||this.poller.stop():this.poller.start()},u.prototype.domChanged=function(){var t=this.view.root.getSelection();return t.anchorNode!=this.lastAnchorNode||t.anchorOffset!=this.lastAnchorOffset||t.focusNode!=this.lastHeadNode||t.focusOffset!=this.lastHeadOffset},u.prototype.storeDOMState=function(t){var e=this.view.root.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastHeadNode=e.focusNode,this.lastHeadOffset=e.focusOffset,this.lastSelection=t},u.prototype.readFromDOM=function(t){if(this.view.hasFocus()&&!this.view.inDOMChange&&this.domChanged()){var e=this.view.root.getSelection(),n=this.view.state.doc,r=this.view.docView.nearestDesc(e.focusNode);if(!r.size)return void this.storeDOMState();var o,i,s=this.view.docView.posFromDOM(e.focusNode,e.focusOffset),a=n.resolve(s);if(e.isCollapsed){for(o=a;r&&!r.node;)r=r.parent;if(r&&r.node.isLeaf&&l.isSelectable(r.node)){var p=r.posAtStart;i=new l(s==p?a:n.resolve(p))}}else o=n.resolve(this.view.docView.posFromDOM(e.anchorNode,e.anchorOffset));if(!i){var u=null!=this.view.state.selection.head&&this.view.state.selection.head<a.pos?1:-1;i=c.between(o,a,u),-1==u&&i.node&&(i=c.between(o,a,1))}a.pos==i.head&&o.pos==i.anchor&&this.storeDOMState(i);var f=this.view.state.tr.setSelection(i);"pointer"==t&&f.setMeta("pointer",!0),this.view.dispatch(f)}},e.SelectionReader=u;var f=function(t){var e=this;this.listening=!1,this.curOrigin=null,this.originTime=0,this.readFunc=function(){return t.readFromDOM(e.originTime>Date.now()-50?e.curOrigin:null)}};f.prototype.poll=function(t){this.curOrigin=t,this.originTime=Date.now()},f.prototype.start=function(){this.listening||(document.addEventListener("selectionchange",this.readFunc),this.listening=!0)},f.prototype.stop=function(){this.listening&&(document.removeEventListener("selectionchange",this.readFunc),this.listening=!1)};var h=function(t){this.polling=null,this.reader=t,this.pollFunc=this.doPoll.bind(this,null)};return h.prototype.doPoll=function(t){var e=this.reader.view;e.focused||!e.editable?(this.reader.readFromDOM(t),this.polling=setTimeout(this.pollFunc,100)):this.polling=null},h.prototype.poll=function(t){clearTimeout(this.polling),this.polling=setTimeout(t?this.doPoll.bind(this,t):this.pollFunc,0)},h.prototype.start=function(){null==this.polling&&this.poll()},h.prototype.stop=function(){clearTimeout(this.polling),this.polling=null},e.selectionToDOM=o,n.exports}),t.registerDynamic("1c",[],!0,function(t,e,n){function r(t,e){if(t==e)return!0;for(var n in t)if(t[n]!==e[n])return!1;for(var r in e)if(!(r in t))return!1;return!0}function o(t,e,n,r,o,a,c){for(var u=t.slice(),f=function(t,e,n,r){for(var o=0;o<u.length;o+=3){var i=u[o+1],s=void 0;-1==i||t>i+a||(e>=u[o]+a?u[o+1]=-1:(s=r-n-(e-t))&&(u[o]+=s,u[o+1]+=s))}},h=0;h<n.maps.length;h++)n.maps[h].forEach(f);for(var d=!1,m=0;m<u.length;m+=3)if(-1==u[m+1]){var v=n.map(u[m]+a),g=v-o;if(g<0||g>=r.content.size){d=!0;continue}var y=n.map(t[m+1]+a,-1),w=y-o,x=r.content.findIndex(g),k=x.index,M=x.offset,C=r.maybeChild(k);if(C&&M==g&&M+C.nodeSize==w){var O=u[m+2].mapInner(n,C,v+1,u[m]+a+1,c);O!=S?(u[m]=g,u[m+1]=w,u[m+2]=O):(u.splice(m,3),m-=3)}else d=!0}if(d){var D=s(u,e?i(e,o):[],n,a,c),T=l(D,r,0,c);e=T.local;for(var R=0;R<u.length;R+=3)-1==u[R+1]&&(u.splice(R,3),R-=3);for(var N=0,E=0;N<T.children.length;N+=3){for(var A=T.children[N];E<u.length&&u[E]<A;)E+=3;u.splice(E,0,T.children[N],T.children[N+1],T.children[N+2])}}return new b(e&&e.sort(p),u)}function i(t,e){if(!e||!t.length)return t;for(var n=[],r=0;r<t.length;r++){var o=t[r];n.push(new g(o.from+e,o.to+e,o.type))}return n}function s(t,e,n,r,o){function i(t,r){for(var s=0;s<t.local.length;s++){var a=t.local[s].map(n,0,r);a?e.push(a):o.onRemove&&o.onRemove(t.local[s].options)}for(var c=0;c<t.children.length;c+=3)i(t.children[c+2],t.children[c]+r+1)}for(var s=0;s<t.length;s+=3)-1==t[s+1]&&i(t[s+2],t[s]+r+1);return e}function a(t,e,n){if(e.isLeaf)return null;for(var r=n+e.nodeSize,o=null,i=0,s=void 0;i<t.length;i++)(s=t[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),t[i]=null);return o}function c(t){for(var e=[],n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function l(t,e,n,r){var o=[],s=!1;e.forEach(function(e,i){var c=a(t,e,i+n);if(c){s=!0;var p=l(c,e,n+i+1,r);p!=S&&o.push(i,i+e.nodeSize,p)}});for(var u=i(s?c(t):t,-n).sort(p),f=0;f<u.length;f++)u[f].type.valid(e,u[f])||(r.onRemove&&r.onRemove(u[f].options),u.splice(f--,1));return u.length||o.length?new b(u,o):S}function p(t,e){return t.from-e.from||t.to-e.to}function u(t){for(var e=t,n=0;n<e.length-1;n++){var r=e[n];if(r.from!=r.to)for(var o=n+1;o<e.length;o++){var i=e[o];{if(i.from!=r.from){i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),f(e,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),f(e,o+1,i.copy(r.to,i.to)))}}}return e}function f(t,e,n){for(;e<t.length&&p(n,t[e])>0;)e++;t.splice(e,0,n)}function h(t){var e=[];return t.someProp("decorations",function(n){var r=n(t.state);r&&r!=S&&e.push(r)}),k.from(e)}var d=function(t,e){if(1!=t.nodeType){var n=document.createElement("span");n.appendChild(t),t=n}t.contentEditable=!1,t.classList.add("ProseMirror-widget"),this.widget=t,this.options=e||x};d.prototype.map=function(t,e,n,r){
117
- var o=t.mapResult(e.from+r,"left"==this.options.associative?-1:1),i=o.pos;return o.deleted?null:new g(i-n,i-n,this)},d.prototype.valid=function(){return!0},d.prototype.eq=function(t){return this==t||t instanceof d&&(this.widget==t.widget||this.options.key)&&r(this.options,t.options)};var m=function(t,e){this.options=e||x,this.attrs=t};m.prototype.map=function(t,e,n,r){var o=t.map(e.from+r,this.options.inclusiveLeft?-1:1)-n,i=t.map(e.to+r,this.options.inclusiveRight?1:-1)-n;return o>=i?null:new g(o,i,this)},m.prototype.valid=function(t,e){return e.from<e.to},m.prototype.eq=function(t){return this==t||t instanceof m&&r(this.attrs,t.attrs)&&r(this.options,t.options)},m.is=function(t){return t.type instanceof m};var v=function(t,e){this.attrs=t,this.options=e||x};v.prototype.map=function(t,e,n,r){var o=t.mapResult(e.from+r,1);if(o.deleted)return null;var i=t.mapResult(e.to+r,-1);return i.deleted||i.pos<=o.pos?null:new g(o.pos-n,i.pos-n,this)},v.prototype.valid=function(t,e){var n=t.content.findIndex(e.from),r=n.index,o=n.offset;return o==e.from&&o+t.child(r).nodeSize==e.to},v.prototype.eq=function(t){return this==t||t instanceof v&&r(this.attrs,t.attrs)&&r(this.options,t.options)};var g=function(t,e,n){this.from=t,this.to=e,this.type=n},y={options:{}};g.prototype.copy=function(t,e){return new g(t,e,this.type)},g.prototype.eq=function(t){return this.type.eq(t.type)&&this.from==t.from&&this.to==t.to},g.prototype.map=function(t,e,n){return this.type.map(t,this,e,n)},g.widget=function(t,e,n){return new g(t,t,new d(e,n))},g.inline=function(t,e,n,r){return new g(t,e,new m(n,r))},g.node=function(t,e,n,r){return new g(t,e,new v(n,r))},y.options.get=function(){return this.type.options},Object.defineProperties(g.prototype,y),e.Decoration=g;var w=[],x={},b=function(t,e){this.local=t&&t.length?t:w,this.children=e&&e.length?e:w};b.create=function(t,e){return e.length?l(e,t,0,x):S},b.prototype.find=function(t,e){var n=[];return this.findInner(null==t?0:t,null==e?1e9:e,n,0),n},b.prototype.findInner=function(t,e,n,r){for(var o=this,i=0;i<this.local.length;i++){var s=o.local[i];s.from<=e&&s.to>=t&&n.push(s.copy(s.from+r,s.to+r))}for(var a=0;a<this.children.length;a+=3)if(o.children[a]<e&&o.children[a+1]>t){var c=o.children[a]+1;o.children[a+2].findInner(t-c,e-c,n,r+c)}},b.prototype.map=function(t,e,n){return this==S||0==t.maps.length?this:this.mapInner(t,e,0,0,n||x)},b.prototype.mapInner=function(t,e,n,r,i){for(var s,a=this,c=0;c<this.local.length;c++){var l=a.local[c].map(t,n,r);l&&l.type.valid(e,l)?(s||(s=[])).push(l):i.onRemove&&i.onRemove(a.local[c].options)}return this.children.length?o(this.children,s,t,e,n,r,i):s?new b(s.sort(p)):S},b.prototype.add=function(t,e){return e.length?this==S?b.create(t,e):this.addInner(t,e,0):this},b.prototype.addInner=function(t,e,n){var r,o=this,s=0;t.forEach(function(t,i){var c,p=i+n;if(c=a(e,t,p)){for(r||(r=o.children.slice());s<r.length&&r[s]<i;)s+=3;r[s]==i?r[s+2]=r[s+2].addInner(t,c,p+1):r.splice(s,0,i,i+t.nodeSize,l(c,t,p+1,x)),s+=3}});var u=i(s?c(e):e,-n);return new b(u.length?this.local.concat(u).sort(p):this.local,r||this.children)},b.prototype.remove=function(t){return 0==t.length||this==S?this:this.removeInner(t,0)},b.prototype.removeInner=function(t,e){for(var n=this,r=this.children,o=this.local,i=0;i<r.length;i+=3){for(var s=void 0,a=r[i]+e,c=r[i+1]+e,l=0,p=void 0;l<t.length;l++)(p=t[l])&&p.from>a&&p.to<c&&(t[l]=null,(s||(s=[])).push(p));if(s){r==n.children&&(r=n.children.slice());var u=r[i+2].removeInner(s,a+1);u!=S?r[i+2]=u:(r.splice(i,3),i-=3)}}if(o.length)for(var f=0,h=void 0;f<t.length;f++)if(h=t[f])for(var d=0;d<o.length;d++)o[d].type==h.type&&(o==n.local&&(o=n.local.slice()),o.splice(d--,1));return r==this.children&&o==this.local?this:o.length||r.length?new b(o,r):S},b.prototype.forChild=function(t,e){var n=this;if(this==S)return this;if(e.isLeaf)return b.empty;for(var r,o,i=0;i<this.children.length;i+=3)if(n.children[i]>=t){n.children[i]==t&&(r=n.children[i+2]);break}for(var s=t+1,a=s+e.content.size,c=0;c<this.local.length;c++){var l=n.local[c];if(l.from<a&&l.to>s&&l.type instanceof m){var p=Math.max(s,l.from)-s,u=Math.min(a,l.to)-s;p<u&&(o||(o=[])).push(l.copy(p,u))}}if(o){var f=new b(o);return r?new k([f,r]):f}return r||S},b.prototype.eq=function(t){var e=this;if(this==t)return!0;if(!(t instanceof b)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(var n=0;n<this.local.length;n++)if(!e.local[n].eq(t.local[n]))return!1;for(var r=0;r<this.children.length;r+=3)if(e.children[r]!=t.children[r]||e.children[r+1]!=t.children[r+1]||!e.children[r+2].eq(t.children[r+2]))return!1;return!1},b.prototype.locals=function(t){return u(this.localsInner(t))},b.prototype.localsInner=function(t){var e=this;if(this==S)return w;if(t.isTextblock||!this.local.some(m.is))return this.local;for(var n=[],r=0;r<this.local.length;r++)e.local[r].type instanceof m||n.push(e.local[r]);return n},e.DecorationSet=b;var S=new b;b.empty=S;var k=function(t){this.members=t};return k.prototype.forChild=function(t,e){var n=this;if(e.isLeaf)return b.empty;for(var r=[],o=0;o<this.members.length;o++){var i=n.members[o].forChild(t,e);i!=S&&(i instanceof k?r=r.concat(i.members):r.push(i))}return k.from(r)},k.prototype.eq=function(t){var e=this;if(!(t instanceof k)||t.members.length!=this.members.length)return!1;for(var n=0;n<this.members.length;n++)if(!e.members[n].eq(t.members[n]))return!1;return!0},k.prototype.locals=function(t){for(var e,n=this,r=!0,o=0;o<this.members.length;o++){var i=n.members[o].localsInner(t);if(i.length)if(e){r&&(e=e.slice(),r=!1);for(var s=0;s<i.length;s++)e.push(i[s])}else e=i}return e?u(r?e:e.sort(p)):w},k.from=function(t){switch(t.length){case 0:return S;case 1:return t[0];default:return new k(t)}},e.DecorationGroup=k,e.removeOverlap=u,e.viewDecorations=h,n.exports}),t.registerDynamic("1d",["13","14","1a","1b","1c"],!0,function(t,e,n){function r(t){var e=Object.create(null);return e["class"]="ProseMirror"+(t.focused?" ProseMirror-focused":"")+(t.state.selection.node?" ProseMirror-nodeselection":""),e.contenteditable=String(t.editable),t.someProp("attributes",function(n){if("function"==typeof n&&(n=n(t.state)),n)for(var r in n)"class"==r?e["class"]+=" "+n[r]:e[r]||"contenteditable"==r||"nodeName"==r||(e[r]=String(n[r]))}),[C.node(0,t.state.doc.content.size,e)]}function o(t){return!t.someProp("editable",function(e){return!1===e(t.state)})}var i,s=t("13"),a=s.scrollRectIntoView,c=s.posAtCoords,l=s.coordsAtPos,p=s.endOfTextblock,u=t("14"),f=u.docViewDesc,h=t("1a"),d=h.initInput,m=h.destroyInput,v=h.dispatchEvent,g=h.startObserving,y=h.stopObserving,w=h.ensureListeners,x=t("1b"),b=x.SelectionReader,S=x.selectionToDOM,k=t("1c"),M=k.viewDecorations,C=k.Decoration;i=t("1c"),e.Decoration=i.Decoration,e.DecorationSet=i.DecorationSet;var O=function(t,e){this.props=e,this.state=e.state,this.dispatch=this.dispatch.bind(this),this._root=null,this.focused=!1,this.content=document.createElement("div"),t&&t.appendChild?t.appendChild(this.content):t&&t(this.content),this.editable=o(this),this.docView=f(this.state.doc,r(this),M(this),this.content,this),this.lastSelectedViewDesc=null,this.selectionReader=new b(this),d(this),this.pluginViews=[],this.updatePluginViews()},D={root:{}};return O.prototype.update=function(t){t.handleDOMEvents!=this.props.handleDOMEvents&&w(this),this.props=t,this.updateState(t.state)},O.prototype.updateState=function(t){var e=this.state;if(this.state=t,e.plugins!=t.plugins&&w(this),!this.inDOMChange){var n=this.editable;this.editable=o(this);var i=M(this),s=r(this);this.docView.matchesNode(t.doc,s,i)?t.selection.eq(e.selection)&&!this.selectionReader.domChanged()||(y(this),S(this,t.selection),g(this)):(y(this),this.docView.update(t.doc,s,i,this),S(this,t.selection),g(this)),n!=this.editable&&this.selectionReader.editableChanged(),this.updatePluginViews(e),(t.scrollToSelection>e.scrollToSelection||e.config!=t.config)&&(t.selection.node?a(this,this.docView.domAfterPos(t.selection.from).getBoundingClientRect()):a(this,this.coordsAtPos(t.selection.head)))}},O.prototype.destroyPluginViews=function(){for(var t;t=this.pluginViews.pop();)t.destroy&&t.destroy()},O.prototype.updatePluginViews=function(t){var e=this,n=this.state.plugins;if(t&&t.plugins==n)for(var r=0;r<this.pluginViews.length;r++){var o=e.pluginViews[r];o.update&&o.update(e)}else{this.destroyPluginViews();for(var i=0;i<n.length;i++){var s=n[i];s.options.view&&e.pluginViews.push(s.options.view(e))}}},O.prototype.hasFocus=function(){if(this.editable&&this.content.ownerDocument.activeElement!=this.content)return!1;var t=this.root.getSelection();return t.rangeCount&&this.content.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)},O.prototype.someProp=function(t,e){var n,r=this.props&&this.props[t];if(null!=r&&(n=e?e(r):r))return n;var o=this.state.plugins;if(o)for(var i=0;i<o.length;i++){var s=o[i].props[t];if(null!=s&&(n=e?e(s):s))return n}},O.prototype.focus=function(){this.editable&&this.content.focus(),y(this),S(this,this.state.selection,!0),g(this)},D.root.get=function(){var t=this,e=this._root;if(null==e)for(var n=this.content.parentNode;n;n=n.parentNode)if(9==n.nodeType||11==n.nodeType&&n.host)return t._root=n;return e||document},O.prototype.posAtCoords=function(t){return c(this,t)},O.prototype.coordsAtPos=function(t){return l(this,t)},O.prototype.endOfTextblock=function(t,e){return p(this,e||this.state,t)},O.prototype.destroy=function(){m(this),this.destroyPluginViews(),this.docView.destroy(),this.selectionReader.destroy(),this.content.parentNode&&this.content.parentNode.removeChild(this.content)},O.prototype.dispatchEvent=function(t){return v(this,t)},O.prototype.dispatch=function(t){var e=this.props.dispatchTransaction;e?e(t):this.updateState(this.state.apply(t))},Object.defineProperties(O.prototype,D),e.EditorView=O,n.exports}),t.registerDynamic("11",["1d"],!0,function(t,e,n){return n.exports=t("1d"),n.exports}),t.registerDynamic("1e",[],!0,function(t,e,n){var r;return function(t,o){"object"==typeof e?n.exports=o():"function"==typeof r&&r.amd?r(o):t.crel=o()}(this,function(){function t(){var r,u=arguments,f=u[0],m=u[1],v=2,g=u.length,y=t[s];if(f=t[c](f)?f:l.createElement(f),1===g)return f;if((!p(m,n)||t[a](m)||h(m))&&(--v,m=null),g-v==1&&p(u[v],"string")&&f[o]!==undefined)f[o]=u[v];else for(;v<g;++v)if(null!=(r=u[v]))if(h(r))for(var w=0;w<r.length;++w)d(f,r[w]);else d(f,r);for(var x in m)if(y[x]){var b=y[x];typeof b===e?b(f,m[x]):f[i](b,m[x])}else f[i](x,m[x]);return f}var e="function",n="object",r="nodeType",o="textContent",i="setAttribute",s="attrMap",a="isNode",c="isElement",l=typeof document===n?document:{},p=function(t,e){return typeof t===e},u=typeof Node===e?function(t){return t instanceof Node}:function(t){return t&&p(t,n)&&r in t&&p(t.ownerDocument,n)},f=function(e){return t[a](e)&&1===e[r]},h=function(t){return t instanceof Array},d=function(e,n){t[a](n)||(n=l.createTextNode(n)),e.appendChild(n)};return t[s]={},t[c]=f,t[a]=u,"undefined"!=typeof Proxy&&(t.proxy=new Proxy(t,{get:function(e,n){return!(n in t)&&(t[n]=t.bind(null,n)),t[n]}})),t}),n.exports}),t.registerDynamic("1f",["1e"],!0,function(t,e,n){return n.exports=t("1e"),n.exports}),t.registerDynamic("20",[],!0,function(t,e,n){function r(t){for(var e=0,n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n)|0;return e}function o(t){var e=document.createElement("div");if(e.className=c,t.path){var n="pm-icon-"+r(t.path).toString(16);document.getElementById(n)||i(n,t);var o=e.appendChild(document.createElementNS(s,"svg"));o.style.width=t.width/t.height+"em";o.appendChild(document.createElementNS(s,"use")).setAttributeNS(a,"href",/([^#]*)/.exec(document.location)[1]+"#"+n)}else t.dom?e.appendChild(t.dom.cloneNode(!0)):(e.appendChild(document.createElement("span")).textContent=t.text||"",t.css&&(e.firstChild.style.cssText=t.css));return e}function i(t,e){var n=document.getElementById(c+"-collection");n||(n=document.createElementNS(s,"svg"),n.id=c+"-collection",n.style.display="none",document.body.insertBefore(n,document.body.firstChild));var r=document.createElementNS(s,"symbol");r.id=t,r.setAttribute("viewBox","0 0 "+e.width+" "+e.height),r.appendChild(document.createElementNS(s,"path")).setAttribute("d",e.path),n.appendChild(r)}var s="http://www.w3.org/2000/svg",a="http://www.w3.org/1999/xlink",c="ProseMirror-icon";return e.getIcon=o,n.exports}),t.registerDynamic("21",["1f","22","23","20"],!0,function(t,e,n){function r(t,e){return t.props.translate?t.props.translate(e):e}function o(t){C.time=Date.now(),C.node=t.target}function i(t){return Date.now()-100<C.time&&C.node&&t.contains(C.node)}function s(t,e){for(var n=[],r=0;r<t.length;r++){var o=t[r].render(e);o&&n.push(u("div",{"class":k+"-dropdown-item"},o))}return n}function a(t,e){for(var n=document.createDocumentFragment(),r=!1,o=0;o<e.length;o++){for(var i=e[o],s=!1,a=0;a<i.length;a++){var l=i[a].render(t);l&&(!s&&r&&n.appendChild(c()),n.appendChild(u("span",{"class":k+"item"},l)),s=!0)}s&&(r=!0)}return n}function c(){return u("span",{"class":k+"separator"})}function l(t,e){var n={run:function(n,r){return v(t,e.attrs)(n,r)},select:function(n){return v(t,e.attrs instanceof Function?null:e.attrs)(n)}};for(var r in e)n[r]=e[r];return new M(n)}function p(t,e){var n=g(t,e.attrs),r={run:n,select:function(t){return n(t)},active:function(n){var r=n.selection,o=r.$from,i=r.to,s=r.node;return s?s.hasMarkup(t,e.attrs):i<=o.end()&&o.parent.hasMarkup(t,e.attrs)}};for(var o in e)r[o]=e[o];return new M(r)}var u=t("1f"),f=t("22"),h=f.lift,d=f.joinUp,m=f.selectParentNode,v=f.wrapIn,g=f.setBlockType,y=t("23"),w=y.undo,x=y.redo,b=t("20"),S=b.getIcon,k="ProseMirror-menu",M=function(t){this.spec=t};M.prototype.render=function(t){var e=!1,n=this.spec;if(n.select&&!n.select(t.state)){if("disable"!=n.onDeselected)return null;e=!0}var o,i=n.active&&!e&&n.active(t.state);if(n.render)o=n.render(t);else if(n.icon)o=S(n.icon),i&&o.classList.add(k+"-active");else{if(!n.label)throw new RangeError("MenuItem without render, icon, or label property");o=u("div",null,r(t,n.label))}return n.title&&o.setAttribute("title",r(t,n.title)),n["class"]&&o.classList.add(n["class"]),e&&o.classList.add(k+"-disabled"),n.css&&(o.style.cssText+=n.css),e||o.addEventListener(n.execEvent||"mousedown",function(e){e.preventDefault(),n.run(t.state,t.dispatch,t)}),o},e.MenuItem=M;var C={time:0,node:null},O=function(t,e){this.options=e||{},this.content=Array.isArray(t)?t:[t]};O.prototype.render=function(t){var e=this,n=s(this.content,t);if(!n.length)return null;var a=u("div",{"class":k+"-dropdown "+(this.options["class"]||""),style:this.options.css,title:this.options.title&&r(t,this.options.title)},r(t,this.options.label)),c=u("div",{"class":k+"-dropdown-wrap"},a),l=null,p=null,f=function(){l&&l.close()&&(l=null,window.removeEventListener("mousedown",p))};return a.addEventListener("mousedown",function(t){t.preventDefault(),o(t),l?f():(l=e.expand(c,n),window.addEventListener("mousedown",p=function(){i(c)||f()}))}),c},O.prototype.expand=function(t,e){function n(){if(!o)return o=!0,t.removeChild(r),!0}var r=u("div",{"class":k+"-dropdown-menu "+(this.options["class"]||"")},e),o=!1;return t.appendChild(r),{close:n,node:r}},e.Dropdown=O;var D=function(t,e){this.options=e||{},this.content=Array.isArray(t)?t:[t]};D.prototype.render=function(t){var e=s(this.content,t);if(!e.length)return null;var n=u("div",{"class":k+"-submenu-label"},r(t,this.options.label)),a=u("div",{"class":k+"-submenu-wrap"},n,u("div",{"class":k+"-submenu"},e)),c=null;return n.addEventListener("mousedown",function(t){t.preventDefault(),o(t),a.classList.toggle(k+"-submenu-wrap-active"),c||window.addEventListener("mousedown",c=function(){i(a)||(a.classList.remove(k+"-submenu-wrap-active"),window.removeEventListener("mousedown",c),c=null)})}),a},e.DropdownSubmenu=D,e.renderGrouped=a;var T={join:{width:800,height:900,path:"M0 75h800v125h-800z M0 825h800v-125h-800z M250 400h100v-100h100v100h100v100h-100v100h-100v-100h-100z"},lift:{width:1024,height:1024,path:"M219 310v329q0 7-5 12t-12 5q-8 0-13-5l-164-164q-5-5-5-13t5-13l164-164q5-5 13-5 7 0 12 5t5 12zM1024 749v109q0 7-5 12t-12 5h-987q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h987q7 0 12 5t5 12zM1024 530v109q0 7-5 12t-12 5h-621q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h621q7 0 12 5t5 12zM1024 310v109q0 7-5 12t-12 5h-621q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h621q7 0 12 5t5 12zM1024 91v109q0 7-5 12t-12 5h-987q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h987q7 0 12 5t5 12z"},selectParentNode:{text:"\u2b1a",css:"font-weight: bold"},undo:{width:1024,height:1024,path:"M761 1024c113-206 132-520-313-509v253l-384-384 384-384v248c534-13 594 472 313 775z"},redo:{width:1024,height:1024,path:"M576 248v-248l384 384-384 384v-253c-446-10-427 303-313 509-280-303-221-789 313-775z"},strong:{width:805,height:1024,path:"M317 869q42 18 80 18 214 0 214-191 0-65-23-102-15-25-35-42t-38-26-46-14-48-6-54-1q-41 0-57 5 0 30-0 90t-0 90q0 4-0 38t-0 55 2 47 6 38zM309 442q24 4 62 4 46 0 81-7t62-25 42-51 14-81q0-40-16-70t-45-46-61-24-70-8q-28 0-74 7 0 28 2 86t2 86q0 15-0 45t-0 45q0 26 0 39zM0 950l1-53q8-2 48-9t60-15q4-6 7-15t4-19 3-18 1-21 0-19v-37q0-561-12-585-2-4-12-8t-25-6-28-4-27-2-17-1l-2-47q56-1 194-6t213-5q13 0 39 0t38 0q40 0 78 7t73 24 61 40 42 59 16 78q0 29-9 54t-22 41-36 32-41 25-48 22q88 20 146 76t58 141q0 57-20 102t-53 74-78 48-93 27-100 8q-25 0-75-1t-75-1q-60 0-175 6t-132 6z"},em:{width:585,height:1024,path:"M0 949l9-48q3-1 46-12t63-21q16-20 23-57 0-4 35-165t65-310 29-169v-14q-13-7-31-10t-39-4-33-3l10-58q18 1 68 3t85 4 68 1q27 0 56-1t69-4 56-3q-2 22-10 50-17 5-58 16t-62 19q-4 10-8 24t-5 22-4 26-3 24q-15 84-50 239t-44 203q-1 5-7 33t-11 51-9 47-3 32l0 10q9 2 105 17-1 25-9 56-6 0-18 0t-18 0q-16 0-49-5t-49-5q-78-1-117-1-29 0-81 5t-69 6z"},code:{width:896,height:1024,path:"M608 192l-96 96 224 224-224 224 96 96 288-320-288-320zM288 192l-288 320 288 320 96-96-224-224 224-224-96-96z"},link:{width:951,height:1024,path:"M832 694q0-22-16-38l-118-118q-16-16-38-16-24 0-41 18 1 1 10 10t12 12 8 10 7 14 2 15q0 22-16 38t-38 16q-8 0-15-2t-14-7-10-8-12-12-10-10q-18 17-18 41 0 22 16 38l117 118q15 15 38 15 22 0 38-14l84-83q16-16 16-38zM430 292q0-22-16-38l-117-118q-16-16-38-16-22 0-38 15l-84 83q-16 16-16 38 0 22 16 38l118 118q15 15 38 15 24 0 41-17-1-1-10-10t-12-12-8-10-7-14-2-15q0-22 16-38t38-16q8 0 15 2t14 7 10 8 12 12 10 10q18-17 18-41zM941 694q0 68-48 116l-84 83q-47 47-116 47-69 0-116-48l-117-118q-47-47-47-116 0-70 50-119l-50-50q-49 50-118 50-68 0-116-48l-118-118q-48-48-48-116t48-116l84-83q47-47 116-47 69 0 116 48l117 118q47 47 47 116 0 70-50 119l50 50q49-50 118-50 68 0 116 48l118 118q48 48 48 116z"},bulletList:{width:768,height:896,path:"M0 512h128v-128h-128v128zM0 256h128v-128h-128v128zM0 768h128v-128h-128v128zM256 512h512v-128h-512v128zM256 256h512v-128h-512v128zM256 768h512v-128h-512v128z"},orderedList:{width:768,height:896,path:"M320 512h448v-128h-448v128zM320 768h448v-128h-448v128zM320 128v128h448v-128h-448zM79 384h78v-256h-36l-85 23v50l43-2v185zM189 590c0-36-12-78-96-78-33 0-64 6-83 16l1 66c21-10 42-15 67-15s32 11 32 28c0 26-30 58-110 112v50h192v-67l-91 2c49-30 87-66 87-113l1-1z"},blockquote:{width:640,height:896,path:"M0 448v256h256v-256h-128c0 0 0-128 128-128v-128c0 0-256 0-256 256zM640 320v-128c0 0-256 0-256 256v256h256v-256h-128c0 0 0-128 128-128z"}};e.icons=T;var R=new M({title:"Join with above block",run:d,select:function(t){return d(t)},icon:T.join});e.joinUpItem=R;var N=new M({title:"Lift out of enclosing block",run:h,select:function(t){return h(t)},icon:T.lift});e.liftItem=N;var E=new M({title:"Select parent node",run:m,select:function(t){return m(t)},icon:T.selectParentNode});e.selectParentNodeItem=E;var A=new M({title:"Undo last change",run:w,select:function(t){return w(t)},icon:T.undo});e.undoItem=A;var I=new M({title:"Redo last undone change",run:x,select:function(t){return x(t)},icon:T.redo});return e.redoItem=I,e.wrapItem=l,e.blockTypeItem=p,n.exports}),t.registerDynamic("24",["1f","11","21"],!0,function(t,e,n){function r(t){return t.anchorNode==t.focusNode?t.anchorOffset>t.focusOffset:t.anchorNode.compareDocumentPosition(t.focusNode)==Node.DOCUMENT_POSITION_FOLLOWING}function o(t){for(var e=t.parentNode;e;e=e.parentNode)if(e.scrollHeight>e.clientHeight)return e}var i=t("1f"),s=t("11"),a=s.EditorView,c=t("21"),l=c.renderGrouped,p="ProseMirror-menubar",u=function(t,e){var n=this;this.wrapper=i("div",{"class":p+"-wrapper"}),t&&t.appendChild?t.appendChild(this.wrapper):t&&t(this.wrapper),e.dispatchTransaction||(e.dispatchTransaction=function(t){return n.updateState(n.editor.state.apply(t))}),this.editor=new a(this.wrapper,e),this.menu=i("div",{"class":p}),this.menu.className=p,this.spacer=null,this.wrapper.insertBefore(this.menu,this.wrapper.firstChild),this.maxHeight=0,this.widthForMaxHeight=0,this.floating=!1,this.props=e,this.updateMenu(),this.editor.someProp("floatingMenu")&&(this.updateFloat(),this.scrollFunc=function(){n.editor.root.contains(n.wrapper)?n.updateFloat():window.removeEventListener("scroll",n.scrollFunc)},window.addEventListener("scroll",this.scrollFunc))};return u.prototype.update=function(t){this.props=t,this.editor.update(t),this.updateMenu()},u.prototype.updateState=function(t){this.editor.updateState(t),this.updateMenu()},u.prototype.updateMenu=function(){this.menu.textContent="",this.menu.appendChild(l(this.editor,this.editor.someProp("menuContent"))),this.floating?this.updateScrollCursor():(this.menu.offsetWidth!=this.widthForMaxHeight&&(this.widthForMaxHeight=this.menu.offsetWidth,this.maxHeight=0),this.menu.offsetHeight>this.maxHeight&&(this.maxHeight=this.menu.offsetHeight,this.menu.style.minHeight=this.maxHeight+"px"))},u.prototype.updateScrollCursor=function(){var t=this.editor.root.getSelection();if(t.focusNode){var e=t.getRangeAt(0).getClientRects(),n=e[r(t)?0:e.length-1];if(n){var i=this.menu.getBoundingClientRect();if(n.top<i.bottom&&n.bottom>i.top){var s=o(this.wrapper);s&&(s.scrollTop-=i.bottom-n.top)}}}},u.prototype.updateFloat=function(){var t=this.wrapper,e=t.getBoundingClientRect();if(this.floating)if(e.top>=0||e.bottom<this.menu.offsetHeight+10)this.floating=!1,this.menu.style.position=this.menu.style.left=this.menu.style.width="",this.menu.style.display="",this.spacer.parentNode.removeChild(this.spacer),this.spacer=null;else{var n=(t.offsetWidth-t.clientWidth)/2;this.menu.style.left=e.left+n+"px",this.menu.style.display=e.top>window.innerHeight?"none":""}else if(e.top<0&&e.bottom>=this.menu.offsetHeight+10){this.floating=!0;var r=this.menu.getBoundingClientRect();this.menu.style.left=r.left+"px",this.menu.style.width=r.width+"px",this.menu.style.position="fixed",this.spacer=i("div",{"class":p+"-spacer",style:"height: "+r.height+"px"}),t.insertBefore(this.spacer,this.menu)}},u.prototype.destroy=function(){this.editor.destroy()},e.MenuBarEditorView=u,n.exports}),t.registerDynamic("25",["21","24"],!0,function(t,e,n){var r;return r=t("21"),e.MenuItem=r.MenuItem,e.Dropdown=r.Dropdown,e.DropdownSubmenu=r.DropdownSubmenu,e.renderGrouped=r.renderGrouped,e.icons=r.icons,e.joinUpItem=r.joinUpItem,e.liftItem=r.liftItem,e.selectParentNodeItem=r.selectParentNodeItem,e.undoItem=r.undoItem,e.redoItem=r.redoItem,e.wrapItem=r.wrapItem,e.blockTypeItem=r.blockTypeItem,e.MenuBarEditorView=t("24").MenuBarEditorView,n.exports}),t.registerDynamic("26",["25"],!0,function(t,e,n){return n.exports=t("25"),n.exports}),t.registerDynamic("27",[],!0,function(t,e,n){function r(t){var e=document.body.appendChild(document.createElement("div"));e.className=s;var n=function(t){e.contains(t.target)||r()};setTimeout(function(){return window.addEventListener("mousedown",n)},50);var r=function(){window.removeEventListener("mousedown",n),e.parentNode&&e.parentNode.removeChild(e)},i=[];for(var a in t.fields)i.push(t.fields[a].render());var c=document.createElement("button");c.type="submit",c.className=s+"-submit",c.textContent="OK";var l=document.createElement("button");l.type="button",l.className=s+"-cancel",l.textContent="Cancel",l.addEventListener("click",r);var p=e.appendChild(document.createElement("form"));t.title&&(p.appendChild(document.createElement("h5")).textContent=t.title),i.forEach(function(t){p.appendChild(document.createElement("div")).appendChild(t)});var u=p.appendChild(document.createElement("div"));u.className=s+"-buttons",u.appendChild(c),u.appendChild(document.createTextNode(" ")),u.appendChild(l);var f=e.getBoundingClientRect();e.style.top=(window.innerHeight-f.height)/2+"px",e.style.left=(window.innerWidth-f.width)/2+"px";var h=function(){var e=o(t.fields,i);e&&(r(),t.callback(e))};p.addEventListener("submit",function(t){t.preventDefault(),h()}),p.addEventListener("keydown",function(t){27==t.keyCode?(t.preventDefault(),r()):13!=t.keyCode||t.ctrlKey||t.metaKey||t.shiftKey?9==t.keyCode&&window.setTimeout(function(){e.contains(document.activeElement)||r()},500):(t.preventDefault(),h())});var d=p.elements[0];d&&d.focus()}function o(t,e){var n=Object.create(null),r=0;for(var o in t){var s=t[o],a=e[r++],c=s.read(a),l=s.validate(c);if(l)return i(a,l),null;n[o]=s.clean(c)}return n}function i(t,e){var n=t.parentNode,r=n.appendChild(document.createElement("div"));r.style.left=t.offsetLeft+t.offsetWidth+2+"px",r.style.top=t.offsetTop-5+"px",r.className="ProseMirror-invalid",r.textContent=e,setTimeout(function(){return n.removeChild(r)},1500)}var s="ProseMirror-prompt";e.openPrompt=r;var a=function(t){this.options=t};a.prototype.read=function(t){return t.value},a.prototype.validateType=function(){},a.prototype.validate=function(t){return!t&&this.options.required?"Required field":this.validateType(t)||this.options.validate&&this.options.validate(t)},a.prototype.clean=function(t){return this.options.clean?this.options.clean(t):t},e.Field=a;var c=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){var t=document.createElement("input");return t.type="text",t.placeholder=this.options.label,t.value=this.options.value||"",t.autocomplete="off",t},e}(a);e.TextField=c;var l=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){var t=this,e=document.createElement("select");return this.options.options.forEach(function(n){var r=e.appendChild(document.createElement("option"));r.value=n.value,r.selected=n.value==t.options.value,r.label=n.label}),e},e}(a);return e.SelectField=l,n.exports}),t.registerDynamic("28",["26","29","7","22","2a","27"],!0,function(t,e,n){function r(t,e,n){for(var r=t.selection.$from,o=r.depth;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,e,n))return!0}return!1}function o(t){return new M({title:"Insert image",label:"Image",select:function(e){return r(e,t)},run:function(e,n,r){var o=e.selection,i=o.node,s=o.from,a=o.to,c=t&&i&&i.type==t&&i.attrs;V({title:"Insert image",fields:{src:new _({label:"Location",required:!0,value:c&&c.src}),title:new _({label:"Title",value:c&&c.title}),alt:new _({label:"Description",value:c?c.title:e.doc.textBetween(s,a," ")})},callback:function(e){r.dispatch(r.state.tr.replaceSelectionWith(t.createAndFill(e))),r.focus()}})}})}function i(t){if(!/^[1-9]\d*$/.test(t))return"Should be a positive integer"}function s(t){return new M({title:"Insert a table",run:function(e,n,r){V({title:"Insert table",fields:{rows:new _({label:"Rows",validate:i}),cols:new _({label:"Columns",validate:i})},callback:function(e){var n=e.rows,o=e.cols,i=r.state.tr.replaceSelectionWith(O(t,+n,+o));i.setSelection(z.near(i.doc.resolve(r.state.selection.from))),r.dispatch(i.scrollIntoView()),r.focus()}})},select:function(e){for(var n=e.selection.$from,r=n.depth;r>=0;r--){var o=n.index(r);if(n.node(r).canReplaceWith(o,o,t))return!0}return!1},label:"Table"})}function a(t,e){var n={label:e.title,run:t,select:function(e){return t(e)}};for(var r in e)n[r]=e[r];return new M(n)}function c(t,e){var n=t.selection,r=n.from,o=n.$from,i=n.to;return n.empty?e.isInSet(t.storedMarks||o.marks()):t.doc.rangeHasMark(r,i,e)}function l(t,e){var n={active:function(e){return c(e,t)}};for(var r in e)n[r]=e[r];return a(L(t),n)}function p(t){return l(t,{title:"Add or remove link",icon:k.link,run:function(e,n,r){if(c(e,t))return L(t)(e,n),!0;V({title:"Create a link",fields:{href:new _({label:"Link target",required:!0,clean:function(t){return/^https?:\/\//i.test(t)||(t="http://"+t),t}}),title:new _({label:"Title"})},callback:function(e){L(t,e)(r.state,r.dispatch),r.focus()}})}})}function u(t,e){return a(q(t,e.attrs),e)}function f(t){var e,n={};if((e=t.marks.strong)&&(n.toggleStrong=l(e,{title:"Toggle strong style",icon:k.strong})),(e=t.marks.em)&&(n.toggleEm=l(e,{title:"Toggle emphasis",icon:k.em})),(e=t.marks.code)&&(n.toggleCode=l(e,{title:"Toggle code font",icon:k.code})),(e=t.marks.link)&&(n.toggleLink=p(e)),(e=t.nodes.image)&&(n.insertImage=o(e)),(e=t.nodes.bullet_list)&&(n.wrapBulletList=u(e,{title:"Wrap in bullet list",icon:k.bulletList})),(e=t.nodes.ordered_list)&&(n.wrapOrderedList=u(e,{title:"Wrap in ordered list",icon:k.orderedList})),(e=t.nodes.blockquote)&&(n.wrapBlockQuote=d(e,{title:"Wrap in block quote",icon:k.blockquote})),(e=t.nodes.paragraph)&&(n.makeParagraph=m(e,{title:"Change to paragraph",label:"Plain"})),(e=t.nodes.code_block)&&(n.makeCodeBlock=m(e,{title:"Change to code block",label:"Code"})),e=t.nodes.heading)for(var i=1;i<=10;i++)n["makeHead"+i]=m(e,{title:"Change to heading "+i,label:"Level "+i,attrs:{level:i}});if(e=t.nodes.horizontal_rule){var c=e;n.insertHorizontalRule=new M({title:"Insert horizontal rule",label:"Horizontal rule",select:function(t){return r(t,c)},run:function(t,e){e(t.tr.replaceSelectionWith(c.create()))}})}(e=t.nodes.table)&&(n.insertTable=s(e)),(e=t.nodes.table_row)&&(n.addRowBefore=a(N,{title:"Add row before"}),n.addRowAfter=a(E,{title:"Add row after"}),n.removeRow=a(A,{title:"Remove row"}),n.addColumnBefore=a(D,{title:"Add column before"}),n.addColumnAfter=a(T,{title:"Add column after"}),n.removeColumn=a(R,{title:"Remove column"}));var f=function(t){return t.filter(function(t){return t})};n.insertMenu=new v(f([n.insertImage,n.insertHorizontalRule,n.insertTable]),{label:"Insert"}),n.typeMenu=new v(f([n.makeParagraph,n.makeCodeBlock,n.makeHead1&&new g(f([n.makeHead1,n.makeHead2,n.makeHead3,n.makeHead4,n.makeHead5,n.makeHead6]),{label:"Heading"})]),{label:"Type..."});var h=f([n.addRowBefore,n.addRowAfter,n.removeRow,n.addColumnBefore,n.addColumnAfter,n.removeColumn]);return h.length&&(n.tableMenu=new v(h,{label:"Table"})),n.inlineMenu=[f([n.toggleStrong,n.toggleEm,n.toggleCode,n.toggleLink]),[n.insertMenu]],n.blockMenu=[f([n.typeMenu,n.tableMenu,n.wrapBulletList,n.wrapOrderedList,n.wrapBlockQuote,y,w,x])],n.fullMenu=n.inlineMenu.concat(n.blockMenu).concat([[b,S]]),n}var h=t("26"),d=h.wrapItem,m=h.blockTypeItem,v=h.Dropdown,g=h.DropdownSubmenu,y=h.joinUpItem,w=h.liftItem,x=h.selectParentNodeItem,b=h.undoItem,S=h.redoItem,k=h.icons,M=h.MenuItem,C=t("29"),O=C.createTable,D=C.addColumnBefore,T=C.addColumnAfter,R=C.removeColumn,N=C.addRowBefore,E=C.addRowAfter,A=C.removeRow,I=t("7"),z=I.Selection,P=t("22"),L=P.toggleMark,F=t("2a"),q=F.wrapInList,B=t("27"),_=B.TextField,V=B.openPrompt;return e.buildMenuItems=f,n.exports}),t.registerDynamic("2b",["9","3","7"],!0,function(t,e,n){function r(t,e){if(t.selection.empty)return!1;if(e){var n=t.selection,r=n.$from,o=n.$to,i=t.tr.deleteSelection().scrollIntoView();r.sameParent(o)&&r.parent.isTextblock&&i.setStoredMarks(r.marks(!0)),e(i)}return!0}function o(t,e,n){var r=t.selection,o=r.$head;if(!r.empty||(n?!n.endOfTextblock("backward",t):o.parentOffset>0))return!1;for(var i,s,a=o.depth-1;!i&&a>=0;a--)o.index(a)>0&&(s=o.before(a+1),i=o.node(a).child(o.index(a)-1));if(!i){var c=o.blockRange(),l=c&&N(c);return null!=l&&(e&&e(t.tr.lift(c,l).scrollIntoView()),!0)}if(i.isLeaf&&B.isSelectable(i)&&0==o.parent.content.size){if(e){var p=t.tr["delete"](s,s+o.parent.nodeSize);p.setSelection(B.create(p.doc,s-i.nodeSize)),e(p.scrollIntoView())}return!0}return i.isLeaf?(e&&e(t.tr["delete"](s-i.nodeSize,s).scrollIntoView()),!0):v(t,s,e)||g(t,s,-1,e)}function i(t,e,n){var r=t.selection,o=r.$head;if(!r.empty||(n?!n.endOfTextblock("forward",t):o.parentOffset<o.parent.content.size))return!1;for(var i,s,a=o.depth-1;!i&&a>=0;a--){var c=o.node(a);o.index(a)+1<c.childCount&&(i=c.child(o.index(a)+1),s=o.after(a+1))}return!!i&&(i.isLeaf?(e&&e(t.tr["delete"](s,s+i.nodeSize).scrollIntoView()),!0):v(t,s,e)||g(t,s,1,e))}function s(t,e){var n,r=t.selection,o=r.node,i=r.from;if(o){if(o.isTextblock||!T(t.doc,i))return!1;n=i}else if(null==(n=D(t.doc,i,-1)))return!1;if(e){var s=t.tr.join(n);t.selection.node&&s.setSelection(B.create(s.doc,n-t.doc.resolve(n).nodeBefore.nodeSize)),
118
- e(s.scrollIntoView())}return!0}function a(t,e){var n=t.selection.node,r=t.selection.from,o=y(t);if(!o)return!1;if(e){var i=t.tr.join(o);n&&i.setSelection(B.create(i.doc,r)),e(i.scrollIntoView())}return!0}function c(t,e){var n=t.selection,r=n.$from,o=n.$to,i=r.blockRange(o),s=i&&N(i);return null!=s&&(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)}function l(t,e){var n=t.selection,r=n.$head,o=n.anchor;return!(!r||!r.parent.type.spec.code||r.sharedDepth(o)!=r.depth)&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)}function p(t,e){var n=t.selection,r=n.$head,o=n.anchor;if(!r||!r.parent.type.spec.code||r.sharedDepth(o)!=r.depth)return!1;var i=r.node(-1),s=r.indexAfter(-1),a=i.defaultContentType(s);if(!i.canReplaceWith(s,s,a))return!1;if(e){var c=r.after(),l=t.tr.replaceWith(c,c,a.createAndFill());l.setSelection(F.near(l.doc.resolve(c),1)),e(l.scrollIntoView())}return!0}function u(t,e){var n=t.selection,r=n.$from,o=n.$to,i=n.node;if(!i||!i.isBlock)return!1;var s=r.parent.defaultContentType(o.indexAfter());if(!s||!s.isTextblock)return!1;if(e){var a=(r.parentOffset?o:r).pos,c=t.tr.insert(a,s.createAndFill());c.setSelection(q.create(c.doc,a+1)),e(c.scrollIntoView())}return!0}function f(t,e){var n=t.selection,r=n.$head;if(!n.empty||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){var o=r.before();if(E(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}var i=r.blockRange(),s=i&&N(i);return null!=s&&(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)}function h(t,e){var n=t.selection,r=n.$from,o=n.$to,i=n.node;if(i&&i.isBlock)return!(!r.parentOffset||!E(t.doc,r.pos))&&(e&&e(t.tr.split(r.pos).scrollIntoView()),!0);if(e){var s=o.parentOffset==o.parent.content.size,a=t.tr["delete"](r.pos,o.pos),c=0==r.depth?null:r.node(-1).defaultContentType(r.indexAfter(-1)),l=s?[{type:c}]:null,p=E(a.doc,r.pos,1,l);l||p||!E(a.doc,r.pos,1,[{type:c}])||(l=[{type:c}],p=!0),p&&(a.split(r.pos,1,l),s||r.parentOffset||r.parent.type==c||!r.node(-1).canReplace(r.index(-1),r.indexAfter(-1),P.from(c.create(),r.parent))||a.setNodeType(r.before(),c)),e(a.scrollIntoView())}return!0}function d(t,e){var n,r=t.selection;if(r.node){if(!r.$from.depth)return!1;n=r.$from.before()}else{var o=r.$head.sharedDepth(r.anchor);if(0==o)return!1;n=r.$head.before(o)}return e&&e(t.tr.setSelection(B.create(t.doc,n))),!0}function m(t,e,n){var r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!!(r&&o&&r.type.compatibleContent(o.type))&&(!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr["delete"](e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!!e.parent.canReplace(i,i+1)&&(n&&n(t.tr.clearNonMatching(e.pos,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0))}function v(t,e,n){var r,o,i=t.doc.resolve(e),s=i.nodeBefore,a=i.nodeAfter;if(m(t,i,n))return!0;if(a.isTextblock&&i.parent.canReplace(i.index(),i.index()+1)&&(r=(o=s.contentMatchAt(s.childCount)).findWrappingFor(a))&&o.matchType((r[0]||a).type,(r[0]||a).attrs).validEnd()){if(n){for(var c=e+a.nodeSize,l=P.empty,p=r.length-1;p>=0;p--)l=P.from(r[p].type.create(r[p].attrs,l));l=P.from(s.copy(l));var u=t.tr.step(new A(e-1,c,e,c,new z(l,1,0),r.length,!0)),f=c+2*r.length;T(u.doc,f)&&u.join(f),n(u.scrollIntoView())}return!0}var h=F.findFrom(i,1),d=h.$from.blockRange(h.$to),v=d&&N(d);return null!=v&&(n&&n(t.tr.lift(d,v).scrollIntoView()),!0)}function g(t,e,n,r){var o=t.doc.resolve(e),i=n>0?o.nodeAfter:o.nodeBefore;return!(!i||!B.isSelectable(i))&&(r&&r(t.tr.setSelection(B.create(t.doc,e-(n>0?0:i.nodeSize))).scrollIntoView()),!0)}function y(t){var e=t.selection,n=e.node,r=e.to;return n?T(t.doc,r)?r:null:D(t.doc,r,1)}function w(t,e){return function(n,r){var o=n.selection,i=o.$from,s=o.$to,a=i.blockRange(s),c=a&&R(a,t,e);return!!c&&(r&&r(n.tr.wrap(a,c).scrollIntoView()),!0)}}function x(t,e){return function(n,r){var o,i=n.selection,s=i.$from,a=i.$to,c=i.node;if(c)o=s.depth;else{if(!s.depth||a.pos>s.end())return!1;o=s.depth-1}var l=c||s.parent;if(!l.isTextblock||l.hasMarkup(t,e))return!1;var p=s.index(o);if(!s.node(o).canReplaceWith(p,p+1,t))return!1;if(r){var u=s.before(o+1);r(n.tr.clearNonMatching(u,t.contentExpr.start(e)).setNodeType(u,t,e).scrollIntoView())}return!0}}function b(t,e,n,r){var o=!1;return t.nodesBetween(e,n,function(t){if(o)return!1;o=t.isTextblock&&t.contentMatchAt(0).allowsMark(r)}),o}function S(t,e){return function(n,r){var o=n.selection,i=o.empty,s=o.from,a=o.to,c=o.$from;return!!b(n.doc,s,a,t)&&(r&&r(i?t.isInSet(n.storedMarks||c.marks())?n.tr.removeStoredMark(t):n.tr.addStoredMark(t.create(e)):n.doc.rangeHasMark(s,a,t)?n.tr.removeMark(s,a,t).scrollIntoView():n.tr.addMark(s,a,t.create(e)).scrollIntoView()),!0)}}function k(t,e){return function(n){if(!n.isGeneric)return t(n);for(var r=[],o=0;o<n.mapping.maps.length;o++){for(var i=n.mapping.maps[o],s=0;s<r.length;s++)r[s]=i.map(r[s]);i.forEach(function(t,e,n,o){return r.push(n,o)})}for(var a=[],c=0;c<r.length;c+=2)for(var l=r[c],p=r[c+1],u=n.doc.resolve(l),f=u.sharedDepth(p),h=u.node(f),d=u.indexAfter(f),m=u.after(f+1);m<=p;++d){var v=h.maybeChild(d);if(!v)break;if(d&&-1==a.indexOf(m)){var g=h.child(d-1);g.type==v.type&&e(g,v)&&a.push(m)}m+=v.nodeSize}a.sort(function(t,e){return t-e});for(var y=a.length-1;y>=0;y--)T(n.doc,a[y])&&n.join(a[y]);t(n)}}function M(t,e){if(Array.isArray(e)){var n=e;e=function(t){return n.indexOf(t.type.name)>-1}}return function(n,r){return t(n,r&&k(r,e))}}function C(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return function(e,n,r){for(var o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}var O=t("9"),D=O.joinPoint,T=O.canJoin,R=O.findWrapping,N=O.liftTarget,E=O.canSplit,A=O.ReplaceAroundStep,I=t("3"),z=I.Slice,P=I.Fragment,L=t("7"),F=L.Selection,q=L.TextSelection,B=L.NodeSelection;e.deleteSelection=r,e.joinBackward=o,e.joinForward=i,e.joinUp=s,e.joinDown=a,e.lift=c,e.newlineInCode=l,e.exitCode=p,e.createParagraphNear=u,e.liftEmptyBlock=f,e.splitBlock=h,e.selectParentNode=d,e.wrapIn=w,e.setBlockType=x,e.toggleMark=S,e.autoJoin=M,e.chainCommands=C;var _={Enter:C(l,u,f,h),"Mod-Enter":p,Backspace:C(r,o),"Mod-Backspace":C(r,o),Delete:C(r,i),"Mod-Delete":C(r,i),"Alt-ArrowUp":s,"Alt-ArrowDown":a,"Mod-BracketLeft":c,Escape:d};if("undefined"!=typeof navigator?/Mac/.test(navigator.platform):"undefined"!=typeof os&&"darwin"==os.platform()){var V={"Ctrl-h":_.Backspace,"Alt-Backspace":_["Mod-Backspace"],"Ctrl-d":_.Delete,"Ctrl-Alt-Backspace":_["Mod-Delete"],"Alt-Delete":_["Mod-Delete"],"Alt-d":_["Mod-Delete"]};for(var j in V)_[j]=V[j]}return e.baseKeymap=_,n.exports}),t.registerDynamic("22",["2b"],!0,function(t,e,n){return n.exports=t("2b"),n.exports}),t.registerDynamic("2c",["3","9","7"],!0,function(t,e,n){function r(t,e){var n={};for(var r in t)n[r]=t[r];for(var o in e)n[o]=e[o];return n}function o(t,e,n){return t.append({table:r(R,{content:"table_row[columns=.columns]+",group:n}),table_row:r(N,{content:"table_cell{.columns}"}),table_cell:r(E,{content:e})})}function i(t,e,n,r){r=s(r,n);for(var o=t.contentExpr.elements[0].nodeTypes[0],i=o.contentExpr.elements[0].nodeTypes[0],a=i.createAndFill(),c=[],l=0;l<n;l++)c.push(a);for(var p=o.create({columns:n},x.from(c)),u=[],f=0;f<e;f++)u.push(p);return t.create(r,x.from(u))}function s(t,e){var n=Object.create(null);if(t)for(var r in t)n[r]=t[r];return n.columns=e,n}function a(t,e){return s(t,t.columns+e)}function c(t,e){for(var n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRow&&(!e||e(n)))return n;return-1}function l(t,e){var n,r=t.selection.$from,o=c(r,function(t){return n=t==r.depth?r.nodeBefore:r.node(t+1)});return-1!=o&&(e&&e(t.tr.step(A.create(t.doc,r.before(o-1),r.index(o),n.type,n.attrs))),!0)}function p(t,e){var n,r=t.selection.$from,o=c(r,function(t){return n=t==r.depth?r.nodeAfter:r.node(t+1)});return-1!=o&&(e&&e(t.tr.step(A.create(t.doc,r.before(o-1),r.indexAfter(o)+(o==r.depth?1:0),n.type,n.attrs))),!0)}function u(t,e){var n=t.selection.$from,r=c(n,function(t){return n.node(t).childCount>1});return-1!=r&&(e&&e(t.tr.step(I.create(t.doc,n.before(r-1),n.index(r)))),!0)}function f(t,e,n){var r=t.selection.$from,o=c(r);if(-1==o)return!1;if(e){var i=r.node(o),s=[],a=n<0?r.before(o):r.after(o);i.forEach(function(t){return s.push(t.type.createAndFill(t.attrs))});var l=i.copy(x.from(s));e(t.tr.step(new O(a,a,new b(x.from(l),0,0))))}return!0}function h(t,e){return f(t,e,-1)}function d(t,e){return f(t,e,1)}function m(t,e){var n=t.selection.$from,r=c(n,function(t){return n.node(t-1).childCount>1});return-1!=r&&(e&&e(t.tr.step(new O(n.before(r),n.after(r),b.empty))),!0)}function v(t,e,n){var r=t.selection,o=r.$from,i=c(o);if(-1==i)return!1;var s=o.node(i),a=o.index(i)+e;if(a>=0&&a<s.childCount){var l=t.doc.resolve(s.content.offsetAt(a)+o.start(i)),p=T.findFrom(l,1);return!(!p||p.from>=l.end())&&(n&&n(t.tr.setSelection(p).scrollIntoView()),!0)}var u=o.index(i-1)+e,f=o.node(i-1);if(u<0||u>=f.childCount)return!1;var h=e>0?o.after(i)+2:o.before(i)-2-f.child(u).lastChild.content.size,d=t.doc.resolve(h),m=T.findFrom(d,1);return!(!m||m.from>=d.end())&&(n&&n(t.tr.setSelection(m).scrollIntoView()),!0)}function g(t,e){return v(t,1,e)}function y(t,e){return v(t,-1,e)}var w=t("3"),x=w.Fragment,b=w.Slice,S=t("9"),k=S.Step,M=S.StepResult,C=S.StepMap,O=S.ReplaceStep,D=t("7"),T=D.Selection,R={attrs:{columns:{"default":1}},parseDOM:[{tag:"table",getAttrs:function(t){var e=t.querySelector("tr");return!(!e||!e.children.length)&&{columns:e.children.length}}}],toDOM:function(){return["table",["tbody",0]]}};e.table=R;var N={attrs:{columns:{"default":1}},parseDOM:[{tag:"tr",getAttrs:function(t){return!!t.children.length&&{columns:t.children.length}}}],toDOM:function(){return["tr",0]},tableRow:!0};e.tableRow=N;var E={parseDOM:[{tag:"td"}],toDOM:function(){return["td",0]}};e.tableCell=E,e.addTableNodes=o,e.createTable=i;var A=function(t){function e(e,n){t.call(this),this.positions=e,this.cells=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t,n,r,o,i){var s=o.createAndFill(i),a=[],c=[];return t.nodeAt(n).forEach(function(t,e){for(var o=n+2+e,i=0;i<r;i++)o+=t.child(i).nodeSize;a.push(o),c.push(s)}),new e(a,c)},e.prototype.apply=function(t){for(var e=this,n=null,r=null,o=null,i=0;i<this.positions.length;i++){var s=t.resolve(e.positions[i]);if(s.depth<2||s.index(-1)!=i)return M.fail("Invalid cell insert position");if(null==r){if(r=s.node(-1),r.childCount!=e.positions.length)return M.fail("Mismatch in number of rows");o=s.before(-1),n=s.index()}else if(s.before(-1)!=o||s.index()!=n)return M.fail("Column insert positions not consistent")}for(var c=[],l=0;l<r.childCount;l++){for(var p=r.child(l),u=n?[]:[e.cells[l]],f=0;f<p.childCount;f++)u.push(p.child(f)),f+1==n&&u.push(e.cells[l]);c.push(p.type.create(a(p.attrs,1),x.from(u)))}var h=r.type.create(a(r.attrs,1),x.from(c));return M.fromReplace(t,o,o+r.nodeSize,new b(x.from(h),0,0))},e.prototype.getMap=function(){for(var t=this,e=[],n=0;n<this.positions.length;n++)e.push(t.positions[n],0,t.cells[n].nodeSize);return new C(e)},e.prototype.invert=function(t){for(var e=this,n=t.resolve(this.positions[0]),r=n.node(-1),o=[],i=[],s=0,a=0;a<r.childCount;a++){var c=e.positions[a]+s,l=e.cells[a].nodeSize;o.push(c),i.push(c+l),s+=l}return new I(o,i)},e.prototype.map=function(t){return new e(this.positions.map(function(e){return t.map(e)}),this.cells)},e.prototype.toJSON=function(){return{stepType:this.jsonID,positions:this.positions,cells:this.cells.map(function(t){return t.toJSON()})}},e.fromJSON=function(t,n){return new e(n.positions,n.cells.map(t.nodeFromJSON))},e}(k);e.AddColumnStep=A,k.jsonID("addTableColumn",A);var I=function(t){function e(e,n){t.call(this),this.from=e,this.to=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t,n,r){var o=[],i=[];return t.nodeAt(n).forEach(function(t,e){for(var s=n+2+e,a=0;a<r;a++)s+=t.child(a).nodeSize;o.push(s),i.push(s+t.child(r).nodeSize)}),new e(o,i)},e.prototype.apply=function(t){for(var e=this,n=null,r=null,o=null,i=0;i<this.from.length;i++){var s=t.resolve(e.from[i]),c=s.nodeAfter;if(s.depth<2||s.index(-1)!=i||!c||e.from[i]+c.nodeSize!=e.to[i])return M.fail("Invalid cell delete positions");if(null==r){if(r=s.node(-1),r.childCount!=e.from.length)return M.fail("Mismatch in number of rows");o=s.before(-1),n=s.index()}else if(s.before(-1)!=o||s.index()!=n)return M.fail("Column delete positions not consistent")}for(var l=[],p=0;p<r.childCount;p++){for(var u=r.child(p),f=[],h=0;h<u.childCount;h++)h!=n&&f.push(u.child(h));l.push(u.type.create(a(u.attrs,-1),x.from(f)))}var d=r.type.create(a(r.attrs,-1),x.from(l));return M.fromReplace(t,o,o+r.nodeSize,new b(x.from(d),0,0))},e.prototype.getMap=function(){for(var t=this,e=[],n=0;n<this.from.length;n++)e.push(t.from[n],t.to[n]-t.from[n],0);return new C(e)},e.prototype.invert=function(t){for(var e=this,n=t.resolve(this.from[0]),r=n.node(-1),o=n.index(),i=[],s=[],a=0,c=0;c<r.childCount;c++){i.push(e.from[c]-a);var l=r.child(c).child(o);a+=l.nodeSize,s.push(l)}return new A(i,s)},e.prototype.map=function(t){for(var n=this,r=[],o=[],i=0;i<this.from.length;i++){var s=t.map(n.from[i],1),a=t.map(n.to[i],-1);if(a<=s)return null;r.push(s),o.push(a)}return new e(r,o)},e.fromJSON=function(t,n){return new e(n.from,n.to)},e}(k);return e.RemoveColumnStep=I,k.jsonID("removeTableColumn",I),e.addColumnBefore=l,e.addColumnAfter=p,e.removeColumn=u,e.addRowBefore=h,e.addRowAfter=d,e.removeRow=m,e.selectNextCell=g,e.selectPreviousCell=y,n.exports}),t.registerDynamic("29",["2c"],!0,function(t,e,n){return n.exports=t("2c"),n.exports}),t.registerDynamic("2d",[],!0,function(t,e,n){var r=200,o=function(){};o.prototype.append=function(t){return t.length?(t=o.from(t),!this.length&&t||t.length<r&&this.leafAppend(t)||this.length<r&&t.leafPrepend(this)||this.appendInner(t)):this},o.prototype.prepend=function(t){return t.length?o.from(t).append(this):this},o.prototype.appendInner=function(t){return new s(this,t)},o.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?o.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},o.prototype.get=function(t){return t<0||t>=this.length?undefined:this.getInner(t)},o.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},o.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(e,n){return r.push(t(e,n))},e,n),r},o.from=function(t){return t instanceof o?t:t&&t.length?new i(t):o.empty};var i=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{},depth:{}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var o=this,i=e;i<n;i++)if(!1===t(o.values[i],r+i))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var o=this,i=e-1;i>=n;i--)if(!1===t(o.values[i],r+i))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=r)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=r)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(o);o.empty=new i([]);var s=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var o=this.left.length;return!(e<o&&!1===this.left.forEachInner(t,e,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(t,Math.max(e-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var o=this.left.length;return!(e>o&&!1===this.right.forEachInvertedInner(t,e-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(t,Math.min(e,o),n,r))&&void 0)},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(o);return n.exports=o,n.exports}),t.registerDynamic("2e",["2d"],!0,function(t,e,n){return n.exports=t("2d"),n.exports}),t.registerDynamic("2f",[],!0,function(t,e,n){function r(t,e,n,o,i,c){if(e.isTextblock)return s.create(t,n);for(var l=o-(i>0?0:1);i>0?l<e.childCount:l>=0;l+=i){var p=e.child(l);if(p.isLeaf){if(!c&&a.isSelectable(p))return a.create(t,n-(i<0?p.nodeSize:0))}else{var u=r(t,p,n+i,i<0?p.childCount:0,i,c);if(u)return u}n+=p.nodeSize*i}}var o=function(t,e){this.$from=t,this.$to=e},i={from:{},to:{},empty:{}};i.from.get=function(){return this.$from.pos},i.to.get=function(){return this.$to.pos},i.empty.get=function(){return this.from==this.to},o.findFrom=function(t,e,n){var o=t.parent.isTextblock?new s(t):r(t.node(0),t.parent,t.pos,t.index(),e,n);if(o)return o;for(var i=t.depth-1;i>=0;i--){var a=e<0?r(t.node(0),t.node(i),t.before(i+1),t.index(i),e,n):r(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,e,n);if(a)return a}},o.near=function(t,e){void 0===e&&(e=1);var n=this.findFrom(t,e)||this.findFrom(t,-e);if(!n)throw new RangeError("Searching for selection in invalid document "+t.node(0));return n},o.atStart=function(t,e){return r(t,t,0,0,1,e)},o.atEnd=function(t,e){return r(t,t,t.content.size,t.childCount,-1,e)},o.between=function(t,e,n){var r=o.near(e,n);if(r instanceof s){var i=o.findFrom(t,t.pos>r.to?-1:1,!0);r=new s(i.$anchor,r.$head)}else if(t.pos<r.from||t.pos>r.to){var a=t.pos>r.to,c=o.findFrom(t,a?-1:1,!0),l=o.findFrom(a?r.$from:r.$to,a?1:-1,!0);c&&l&&(r=new s(c.$anchor,l.$head))}return r},o.mapJSON=function(t,e){return null!=t.anchor?{head:e.map(t.head),anchor:e.map(t.anchor)}:{node:e.map(t.node),after:e.map(t.after,-1)}},o.fromJSON=function(t,e){if(null!=e.head){var n=t.resolve(e.anchor),r=t.resolve(e.head);return n.parent.isTextblock&&r.parent.isTextblock?new s(n,r):o.between(n,r)}var i=t.resolve(e.node),c=i.nodeAfter;return c&&e.after==e.pos+c.nodeSize&&a.isSelectable(c)?new a(i):o.near(i)},Object.defineProperties(o.prototype,i),e.Selection=o;var s=function(t){function e(e,n){void 0===n&&(n=e);var r=e.pos>n.pos;t.call(this,r?n:e,r?e:n),this.$anchor=e,this.$head=n}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={anchor:{},head:{},inverted:{}};return n.anchor.get=function(){return this.$anchor.pos},n.head.get=function(){return this.$head.pos},n.inverted.get=function(){return this.anchor>this.head},e.prototype.eq=function(t){return t instanceof e&&t.head==this.head&&t.anchor==this.anchor},e.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));if(!o.parent.isTextblock)return t.near(o);var i=n.resolve(r.map(this.anchor));return new e(i.parent.isTextblock?i:o,o)},e.prototype.toJSON=function(){return{head:this.head,anchor:this.anchor}},e.create=function(t,e,n){void 0===n&&(n=e);var r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))},Object.defineProperties(e.prototype,n),e}(o);e.TextSelection=s;var a=function(t){function e(e){var n=e.node(0).resolve(e.pos+e.nodeAfter.nodeSize);t.call(this,e,n),this.node=e.nodeAfter}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.eq=function(t){return t instanceof e&&this.from==t.from},e.prototype.map=function(n,r){var o=r.mapResult(this.from,1),i=r.mapResult(this.to,-1),s=n.resolve(o.pos),a=s.nodeAfter;return!o.deleted&&!i.deleted&&a&&i.pos==o.pos+a.nodeSize&&e.isSelectable(a)?new e(s):t.near(s)},e.prototype.toJSON=function(){return{node:this.from,after:this.to}},e.create=function(t,e){return new this(t.resolve(e))},e.isSelectable=function(t){return!t.isText&&!1!==t.type.spec.selectable},e}(o);return e.NodeSelection=a,n.exports}),t.registerDynamic("30",["9","3","2f"],!0,function(t,e,n){function r(t,e,n){if(t.steps.length!=e){var r,o=t.mapping.maps[t.mapping.maps.length-1];o.forEach(function(t,e,n,o){return r=o}),null!=r&&t.setSelection(p.near(t.doc.resolve(r),n))}}function o(t){return null==t.head?c.none:t.$head.marks()}var i=t("9"),s=i.Transform,a=t("3"),c=a.Mark,l=t("2f"),p=l.Selection,u=1,f=2,h=4,d=function(t){function e(e){t.call(this,e.doc),this.time=Date.now(),this.curSelection=e.selection,this.curSelectionFor=0,this.storedMarks=e.storedMarks,this.updated=0,this.meta=Object.create(null)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={docChanged:{},selection:{},selectionSet:{},storedMarksSet:{},isGeneric:{},scrolledIntoView:{}};return n.docChanged.get=function(){return this.steps.length>0},n.selection.get=function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection},e.prototype.setSelection=function(t){return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|u)&~f,this.storedMarks=null,this},n.selectionSet.get=function(){return this.updated&u>0},e.prototype.setStoredMarks=function(t){return this.storedMarks=t,this.updated|=f,this},n.storedMarksSet.get=function(){return this.updated&f>0},e.prototype.addStep=function(e,n){t.prototype.addStep.call(this,e,n),this.updated=this.updated&~f,this.storedMarks=null},e.prototype.setTime=function(t){return this.time=t,this},e.prototype.replaceSelection=function(t){var e=this.selection,n=e.from,o=e.to,i=this.steps.length;this.replaceRange(n,o,t);for(var s=t.content.lastChild,a=null,c=0;c<t.openRight;c++)a=s,s=s.lastChild;return r(this,i,(s?s.isInline:a&&a.isTextblock)?-1:1),this},e.prototype.replaceSelectionWith=function(t,e){var n=this.selection,o=n.$from,i=n.from,s=n.to,a=this.steps.length;return!1!==e&&(t=t.mark(this.storedMarks||o.marks(s>i))),this.replaceRangeWith(i,s,t),r(this,a,t.isInline?-1:1),this},e.prototype.deleteSelection=function(){var t=this.selection,e=t.from,n=t.to;return this.deleteRange(e,n)},e.prototype.insertText=function(t,e,n){void 0===n&&(n=e);var r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();if(!t)return this.deleteRange(e,n);var o=r.text(t,this.storedMarks||this.doc.resolve(e).marks(n>e));return this.replaceRangeWith(e,n,o)},e.prototype.setMeta=function(t,e){return this.meta["string"==typeof t?t:t.key]=e,this},e.prototype.getMeta=function(t){return this.meta["string"==typeof t?t:t.key]},n.isGeneric.get=function(){var t=this;for(var e in t.meta)return!1;return!0},e.prototype.scrollIntoView=function(){return this.updated|=h,this},n.scrolledIntoView.get=function(){return this.updated|h>0},e.prototype.addStoredMark=function(t){return this.storedMarks=t.addToSet(this.storedMarks||o(this.selection)),this},e.prototype.removeStoredMark=function(t){return this.storedMarks=t.removeFromSet(this.storedMarks||o(this.selection)),this},Object.defineProperties(e.prototype,n),e}(s);return e.Transaction=d,n.exports}),t.registerDynamic("31",["3","2f","30"],!0,function(t,e,n){function r(t,e){return e&&t?t.bind(e):t}var o=t("3"),i=o.Node,s=t("2f"),a=s.Selection,c=t("30"),l=c.Transaction,p=function(t,e,n){this.name=t,this.init=r(e.init,n),this.apply=r(e.apply,n)},u=[new p("doc",{init:function(t){return t.doc||t.schema.nodes.doc.createAndFill()},apply:function(t){return t.doc}}),new p("selection",{init:function(t,e){return t.selection||a.atStart(e.doc)},apply:function(t){return t.selection}}),new p("storedMarks",{init:function(){return null},apply:function(t,e,n,r){return r.selection.empty?t.storedMarks:null}}),new p("scrollToSelection",{init:function(){return 0},apply:function(t,e){return t.scrolledIntoView?e+1:e}})],f=function(t,e){var n=this;this.schema=t,this.fields=u.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),e&&e.forEach(function(t){if(n.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");n.plugins.push(t),n.pluginsByKey[t.key]=t,t.options.state&&n.fields.push(new p(t.key,t.options.state,t))})},h=function(t){this.config=t},d={schema:{},plugins:{},tr:{}};d.schema.get=function(){return this.config.schema},d.plugins.get=function(){return this.config.plugins},h.prototype.apply=function(t){return this.applyTransaction(t).state},h.prototype.filterTransaction=function(t,e){var n=this;void 0===e&&(e=-1);for(var r=0;r<this.config.plugins.length;r++)if(r!=e){var o=n.config.plugins[r];if(o.options.filterTransaction&&!o.options.filterTransaction.call(o,t,n))return!1}return!0},h.prototype.applyTransaction=function(t){var e=this;if(!this.filterTransaction(t))return{state:this,transactions:[]};for(var n=[t],r=this.applyInner(t),o=null;;){for(var i=!1,s=0;s<this.config.plugins.length;s++){var a=e.config.plugins[s];if(a.options.appendTransaction){var c=o?o[s].n:0,l=o?o[s].state:e,p=c<n.length&&a.options.appendTransaction.call(a,c?n.slice(c):n,l,r);if(p&&r.filterTransaction(p,s)){if(!o){o=[];for(var u=0;u<this.config.plugins.length;u++)o.push(u<s?{state:r,n:n.length}:{state:e,n:0})}n.push(p),r=r.applyInner(p),i=!0}o&&(o[s]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}},h.prototype.applyInner=function(t){var e=this;if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var n=new h(this.config),r=this.config.fields,o=0;o<r.length;o++){var i=r[o];n[i.name]=i.apply(t,e[i.name],e,n)}for(var s=0;s<m.length;s++)m[s](e,t,n);return n},d.tr.get=function(){return new l(this)},h.create=function(t){for(var e=new f(t.schema||t.doc.type.schema,t.plugins),n=new h(e),r=0;r<e.fields.length;r++)n[e.fields[r].name]=e.fields[r].init(t,n);return n},h.prototype.reconfigure=function(t){for(var e=this,n=new f(t.schema||this.schema,t.plugins),r=n.fields,o=new h(n),i=0;i<r.length;i++){var s=r[i].name;o[s]=e.hasOwnProperty(s)?e[s]:r[i].init(t,o)}return o},h.prototype.toJSON=function(t){var e=this,n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(t)for(var r in t){if("doc"==r||"selection"==r)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var o=t[r],i=o.options.state;i&&i.toJSON&&(n[r]=i.toJSON.call(o,e[o.key]))}return n},h.fromJSON=function(t,e,n){if(!t.schema)throw new RangeError("Required config field 'schema' missing");var r=new f(t.schema,t.plugins),o=new h(r);return r.fields.forEach(function(r){if("doc"==r.name)o.doc=i.fromJSON(t.schema,e.doc);else if("selection"==r.name)o.selection=a.fromJSON(o.doc,e.selection);else{if(n)for(var s in n){var c=n[s],l=c.options.state;if(c.key==r.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(e,s))return void(o[r.name]=l.fromJSON.call(c,t,e[s],o))}o[r.name]=r.init(t,o)}}),o},h.addApplyListener=function(t){m.push(t)},h.removeApplyListener=function(t){var e=m.indexOf(t);e>-1&&m.splice(e,1)},Object.defineProperties(h.prototype,d),e.EditorState=h;var m=[];return n.exports}),t.registerDynamic("32",[],!0,function(t,e,n){function r(t){return t in i?t+"$"+ ++i[t]:(i[t]=0,t+"$")}var o=function(t){var e=this;if(this.props={},t.props)for(var n in t.props){var o=t.props[n];o instanceof Function&&(o=o.bind(e)),e.props[n]=o}this.options=t,this.key=t.key?t.key.key:r("plugin")};o.prototype.getState=function(t){return t[this.key]},e.Plugin=o;var i=Object.create(null),s=function(t){void 0===t&&(t="key"),this.key=r(t)};return s.prototype.get=function(t){return t.config.pluginsByKey[this.key]},s.prototype.getState=function(t){return t[this.key]},e.PluginKey=s,n.exports}),t.registerDynamic("33",["2f","30","31","32"],!0,function(t,e,n){var r;r=t("2f"),e.Selection=r.Selection,e.TextSelection=r.TextSelection,e.NodeSelection=r.NodeSelection,e.Transaction=t("30").Transaction,e.EditorState=t("31").EditorState;var o;return o=t("32"),e.Plugin=o.Plugin,e.PluginKey=o.PluginKey,n.exports}),t.registerDynamic("7",["33"],!0,function(t,e,n){return n.exports=t("33"),n.exports}),t.registerDynamic("34",["2e","9","7"],!0,function(t,e,n){function r(t,e){var n;return t.forEach(function(t,r){if(t.selection&&0==--e)return n=r,!1}),t.slice(n)}function o(t,e,n,r){var o,s=n.getMeta(M);if(s)return s;if(0==n.steps.length)return n.getMeta(C)?new S(t.done,t.undone,null,0):t;if(!1!==n.getMeta("addToHistory")){var a=t.prevTime<(n.time||0)-r.newGroupDelay||!i(n,t.prevMap,t.done);return new S(t.done.addTransform(n,a?e.toJSON():null,r),x.empty,n.mapping.maps[n.steps.length-1],n.time)}return(o=n.getMeta("rebased"))?new S(t.done.rebased(n,o),t.undone.rebased(n,o),t.prevMap&&n.mapping.maps[n.steps.length-1],t.prevTime):new S(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),t.prevMap,t.prevTime)}function i(t,e,n){if(!e)return!1;var r=t.mapping.maps[0],o=!1;return!r||(r.forEach(function(t,r){n.items.forEach(function(n){if(n.step)return e.forEach(function(e,n,i,s){t<=s&&r>=i&&(o=!0)}),!1;t=n.map.invert().map(t,-1),r=n.map.invert().map(r,1)},n.items.length,0)}),o)}function s(t,e,n,r){var o=M.get(e).options.config,i=(r?t.undone:t.done).popEvent(e,o.preserveItems);if(i){var s=e.selection,a=g.fromJSON(i.transform.doc,i.selection),c=(r?t.done:t.undone).addTransform(i.transform,s.toJSON(),o),l=new S(r?c:i.remaining,r?i.remaining:c,null,0);n(i.transform.setSelection(a).setMeta(M,l).scrollIntoView())}}function a(t){return t.tr.setMeta(C,!0)}function c(t){return t={depth:t&&t.depth||100,preserveItems:!(!t||!t.preserveItems),newGroupDelay:t&&t.newGroupDelay||500},new y({key:M,state:{init:function(){return new S(x.empty,x.empty,null,0)},apply:function(e,n,r){return o(n,r.selection,e,t)}},config:t})}function l(t,e){var n=M.getState(t);return!(!n||0==n.done.eventCount)&&(e&&s(n,t,e,!1),!0)}function p(t,e){var n=M.getState(t);return!(!n||0==n.undone.eventCount)&&(e&&s(n,t,e,!0),!0)}function u(t){var e=M.getState(t);return e?e.done.eventCount:0}function f(t){var e=M.getState(t);return e?e.undone.eventCount:0}var h=t("2e"),d=t("9"),m=d.Mapping,v=t("7"),g=v.Selection,y=v.Plugin,w=v.PluginKey,x=function(t,e){this.items=t,this.eventCount=e};x.prototype.popEvent=function(t,e){var n=this;if(0==this.eventCount)return null;for(var r=this.items.length;;r--)if(n.items.get(r-1).selection){--r;break}var o,i;e&&(o=this.remapping(r,this.items.length),i=o.maps.length);var s,a,c=t.tr,l=[],p=[];return this.items.forEach(function(t,e){if(!t.step)return o||(o=n.remapping(r,e+1),i=o.maps.length),i--,void p.push(t);if(o){p.push(new b(t.map));var u,f=t.step.map(o.slice(i));f&&c.maybeStep(f).doc&&(u=c.mapping.maps[c.mapping.maps.length-1],l.push(new b(u,null,null,l.length+p.length))),i--,u&&o.appendMap(u,i)}else c.maybeStep(t.step);return t.selection?(s=o?g.mapJSON(t.selection,o.slice(i)):t.selection,a=new x(n.items.slice(0,r).append(p.reverse().concat(l)),n.eventCount-1),!1):void 0},this.items.length,0),{remaining:a,transform:c,selection:s}},x.prototype.addTransform=function(t,e,n){for(var o=[],i=this.eventCount+(e?1:0),s=this.items,a=!n.preserveItems&&s.length?s.get(s.length-1):null,c=0;c<t.steps.length;c++){var l=t.steps[c].invert(t.docs[c]),p=new b(t.mapping.maps[c],l,e),u=void 0;(u=a&&a.merge(p))&&(p=u,c?o.pop():s=s.slice(0,s.length-1)),o.push(p),e=null,n.preserveItems||(a=p)}var f=this.eventCount-n.depth;return f>k&&(s=r(s,f)),new x(s.append(o),i)},x.prototype.remapping=function(t,e){var n=[],r=[];return this.items.forEach(function(e,o){null!=e.mirrorOffset&&o-e.mirrorOffset>=t&&r.push(n.length-e.mirrorOffset,n.length),n.push(e.map)},t,e),new m(n,r)},x.prototype.addMaps=function(t){return 0==this.eventCount?this:new x(this.items.append(t.map(function(t){return new b(t)})),this.eventCount)},x.prototype.rebased=function(t,e){if(!this.eventCount)return this;var n=[],r=this.items.length-e,o=0;r<0&&(o=-r,r=0);var i=t.mapping,s=t.steps.length,a=o;this.items.forEach(function(e){var r=i.getMirror(a++);if(null!=r){s=Math.min(s,r);var o=i.maps[r];if(e.step){var c=t.steps[r].invert(t.docs[r]),l=e.selection&&g.mapJSON(e.selection,i.slice(a-1,r));n.push(new b(o,c,l))}else n.push(new b(o))}},r);for(var c=[],l=e;l<s;l++)c.push(new b(i.maps[l]))
119
- ;var p=this.items.slice(0,r).append(c).append(n),u=new x(p,this.eventCount);return u.emptyItemCount()>500&&(u=u.compress(this.items.length-n.length)),u},x.prototype.emptyItemCount=function(){var t=0;return this.items.forEach(function(e){e.step||t++}),t},x.prototype.compress=function(t){void 0===t&&(t=this.items.length);var e=this.remapping(0,t),n=e.maps.length,r=[],o=0;return this.items.forEach(function(i,s){if(s>=t)r.push(i);else if(i.step){var a=i.step.map(e.slice(n)),c=a&&a.getMap();if(n--,c&&e.appendMap(c,n),a){var l=i.selection&&g.mapJSON(i.selection,e.slice(n));l&&o++;var p,u=new b(c.invert(),a,l),f=r.length-1;(p=r.length&&r[f].merge(u))?r[f]=p:r.push(u)}}else i.map&&n--},this.items.length,0),new x(h.from(r.reverse()),o)},x.empty=new x(h.empty,0);var b=function(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r};b.prototype.merge=function(t){if(this.step&&t.step&&!t.selection){var e=t.step.merge(this.step);if(e)return new b(e.getMap().invert(),e,this.selection)}};var S=function(t,e,n,r){this.done=t,this.undone=e,this.prevMap=n,this.prevTime=r};e.HistoryState=S;var k=20;e.closeHistory=a;var M=new w("history"),C=new w("closeHistory");return e.history=c,e.undo=l,e.redo=p,e.undoDepth=u,e.redoDepth=f,n.exports}),t.registerDynamic("23",["34"],!0,function(t,e,n){return n.exports=t("34"),n.exports}),t.registerDynamic("35",["22","29","2a","23"],!0,function(t,e,n){function r(t,e){function n(t,n){if(e){var r=e[t];if(!1===r)return;r&&(t=r)}o[t]=n}var r,o={};if(n("Mod-z",w),n("Shift-Mod-z",x),b||n("Mod-y",x),(r=t.marks.strong)&&n("Mod-b",c(r)),(r=t.marks.em)&&n("Mod-i",c(r)),(r=t.marks.code)&&n("Mod-`",c(r)),(r=t.nodes.bullet_list)&&n("Shift-Ctrl-8",d(r)),(r=t.nodes.ordered_list)&&n("Shift-Ctrl-9",d(r)),(r=t.nodes.blockquote)&&n("Ctrl->",i(r)),r=t.nodes.hard_break){var p=r,h=a(l,function(t,e){return e(t.tr.replaceSelectionWith(p.create()).scrollIntoView()),!0});n("Mod-Enter",h),n("Shift-Enter",h),b&&n("Ctrl-Enter",h)}if((r=t.nodes.list_item)&&(n("Enter",m(r)),n("Mod-[",v(r)),n("Mod-]",g(r))),(r=t.nodes.paragraph)&&n("Shift-Ctrl-0",s(r)),(r=t.nodes.code_block)&&n("Shift-Ctrl-\\",s(r)),r=t.nodes.heading)for(var y=1;y<=6;y++)n("Shift-Ctrl-"+y,s(r,{level:y}));if(r=t.nodes.horizontal_rule){var S=r;n("Mod-_",function(t,e){return e(t.tr.replaceSelectionWith(S.create()).scrollIntoView()),!0})}return t.nodes.table_row&&(n("Tab",u),n("Shift-Tab",f)),o}var o=t("22"),i=o.wrapIn,s=o.setBlockType,a=o.chainCommands,c=o.toggleMark,l=o.exitCode,p=t("29"),u=p.selectNextCell,f=p.selectPreviousCell,h=t("2a"),d=h.wrapInList,m=h.splitListItem,v=h.liftListItem,g=h.sinkListItem,y=t("23"),w=y.undo,x=y.redo,b="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);return e.buildKeymap=r,n.exports}),t.registerDynamic("36",["b","f","23","22","7","12","28","35"],!0,function(t,e,n){function r(t){var e=[u({rules:f.concat(o(t.schema))}),d(O(t.schema,t.mapKeys)),d(y),S()];return!1!==t.history&&e.push(v()),e.concat(new x({props:{attributes:{"class":"ProseMirror-example-setup-style"},menuContent:M(t.schema).fullMenu,floatingMenu:!0}}))}function o(t){var e,n=[];return(e=t.nodes.blockquote)&&n.push(s(e)),(e=t.nodes.ordered_list)&&n.push(a(e)),(e=t.nodes.bullet_list)&&n.push(c(e)),(e=t.nodes.code_block)&&n.push(l(e)),(e=t.nodes.heading)&&n.push(p(e,6)),n}var i=t("b"),s=i.blockQuoteRule,a=i.orderedListRule,c=i.bulletListRule,l=i.codeBlockRule,p=i.headingRule,u=i.inputRules,f=i.allInputRules,h=t("f"),d=h.keymap,m=t("23"),v=m.history,g=t("22"),y=g.baseKeymap,w=t("7"),x=w.Plugin,b=t("12"),S=b.dropCursor,k=t("28"),M=k.buildMenuItems;e.buildMenuItems=M;var C=t("35"),O=C.buildKeymap;return e.buildKeymap=O,e.exampleSetup=r,e.buildInputRules=o,n.exports}),t.registerDynamic("37",["36"],!0,function(t,e,n){return n.exports=t("36"),n.exports}),t.registerDynamic("38",["3","39"],!0,function(t,e,n){function r(t,e,n){for(var o=[],s=0;s<t.childCount;s++){var a=t.child(s);a.content.size&&(a=a.copy(r(a.content,e,a))),a.isInline&&(a=e(a,n,s)),o.push(a)}return i.fromArray(o)}var o=t("3"),i=o.Fragment,s=o.Slice,a=t("39"),c=a.Step,l=a.StepResult,p=function(t){function e(e,n,r){t.call(this),this.from=e,this.to=n,this.mark=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),o=t.resolve(this.from),i=o.node(o.sharedDepth(this.to)),a=new s(r(n.content,function(t,n,r){return n.contentMatchAt(r+1).allowsMark(e.mark.type)?t.mark(e.mark.addToSet(t.marks)):t},i),n.openLeft,n.openRight);return l.fromReplace(t,this.from,this.to,a)},e.prototype.invert=function(){return new u(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.fromJSON=function(t,n){return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(c);e.AddMarkStep=p,c.jsonID("addMark",p);var u=function(t){function e(e,n,r){t.call(this),this.from=e,this.to=n,this.mark=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),o=new s(r(n.content,function(t){return t.mark(e.mark.removeFromSet(t.marks))}),n.openLeft,n.openRight);return l.fromReplace(t,this.from,this.to,o)},e.prototype.invert=function(){return new p(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.fromJSON=function(t,n){return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(c);return e.RemoveMarkStep=u,c.jsonID("removeMark",u),n.exports}),t.registerDynamic("3a",["3","3b","38","3c"],!0,function(t,e,n){var r=t("3"),o=r.MarkType,i=r.Slice,s=r.Fragment,a=t("3b"),c=a.Transform,l=t("38"),p=l.AddMarkStep,u=l.RemoveMarkStep,f=t("3c"),h=f.ReplaceStep;return c.prototype.addMark=function(t,e,n){var r=this,o=[],i=[],s=null,a=null;return this.doc.nodesBetween(t,e,function(r,c,l,f){if(r.isInline){var h=r.marks;if(n.isInSet(h)||!l.contentMatchAt(f+1).allowsMark(n.type))a=s=null;else{var d=Math.max(c,t),m=Math.min(c+r.nodeSize,e),v=n.type.isInSet(h);v?s&&s.mark.eq(v)?s.to=m:o.push(s=new u(d,m,v)):s=null,a?a.to=m:i.push(a=new p(d,m,n))}}}),o.forEach(function(t){return r.step(t)}),i.forEach(function(t){return r.step(t)}),this},c.prototype.removeMark=function(t,e,n){var r=this;void 0===n&&(n=null);var i=[],s=0;return this.doc.nodesBetween(t,e,function(r,a){if(r.isInline){s++;var c=null;if(n instanceof o){var l=n.isInSet(r.marks);l&&(c=[l])}else n?n.isInSet(r.marks)&&(c=[n]):c=r.marks;if(c&&c.length)for(var p=Math.min(a+r.nodeSize,e),u=0;u<c.length;u++){for(var f=c[u],h=void 0,d=0;d<i.length;d++){var m=i[d];m.step==s-1&&f.eq(i[d].style)&&(h=m)}h?(h.to=p,h.step=s):i.push({style:f,from:Math.max(a,t),to:p,step:s})}}}),i.forEach(function(t){return r.step(new u(t.from,t.to,t.style))}),this},c.prototype.clearMarkup=function(t,e){var n=this,r=[];this.doc.nodesBetween(t,e,function(o,s){if(o.isInline){if(!o.type.isText)return void r.push(new h(s,s+o.nodeSize,i.empty));for(var a=0;a<o.marks.length;a++)n.step(new u(Math.max(s,t),Math.min(s+o.nodeSize,e),o.marks[a]))}});for(var o=r.length-1;o>=0;o--)n.step(r[o]);return this},c.prototype.clearNonMatching=function(t,e){for(var n=this,r=this.doc.nodeAt(t),o=[],a=t+1,c=0;c<r.childCount;c++){var l=r.child(c),p=a+l.nodeSize,f=e.matchType(l.type,l.attrs);if(f){e=f;for(var d=0;d<l.marks.length;d++)e.allowsMark(l.marks[d])||n.step(new u(a,p,l.marks[d]))}else o.push(new h(a,p,i.empty));a=p}if(!e.validEnd()){var m=e.fillBefore(s.empty,!0);this.replace(a,a,new i(m,0,0))}for(var v=o.length-1;v>=0;v--)n.step(o[v]);return this},n.exports}),t.registerDynamic("3b",["3d"],!0,function(t,e,n){var r=t("3d"),o=r.Mapping,i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error);e.TransformError=i;var s=function(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new o},a={before:{}};return a.before.get=function(){return this.docs.length?this.docs[0]:this.doc},s.prototype.step=function(t){var e=this.maybeStep(t);if(e.failed)throw new i(e.failed);return this},s.prototype.maybeStep=function(t){var e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e},s.prototype.addStep=function(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e},Object.defineProperties(s.prototype,a),e.Transform=s,n.exports}),t.registerDynamic("39",["3","3d"],!0,function(t,e,n){function r(){throw new Error("Override me")}var o=t("3"),i=o.ReplaceError,s=t("3d"),a=s.StepMap,c=Object.create(null),l=function(){};l.prototype.apply=function(){return r()},l.prototype.getMap=function(){return a.empty},l.prototype.invert=function(){return r()},l.prototype.map=function(){return r()},l.prototype.merge=function(){return null},l.prototype.toJSON=function(){var t=this,e={stepType:this.jsonID};for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];e[n]=r&&r.toJSON?r.toJSON():r}return e},l.fromJSON=function(t,e){return c[e.stepType].fromJSON(t,e)},l.jsonID=function(t,e){if(t in c)throw new RangeError("Duplicate use of step JSON ID "+t);return c[t]=e,e.prototype.jsonID=t,e},e.Step=l;var p=function(t,e){this.doc=t,this.failed=e};return p.ok=function(t){return new p(t,null)},p.fail=function(t){return new p(null,t)},p.fromReplace=function(t,e,n,r){try{return p.ok(t.replace(e,n,r))}catch(t){if(t instanceof i)return p.fail(t.message);throw t}},e.StepResult=p,n.exports}),t.registerDynamic("3d",[],!0,function(t,e,n){function r(t,e){return t+e*a}function o(t){return t&s}function i(t){return(t-(t&s))/a}var s=65535,a=Math.pow(2,16),c=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=null),this.pos=t,this.deleted=e,this.recover=n};e.MapResult=c;var l=function(t,e){void 0===e&&(e=!1),this.ranges=t,this.inverted=e};l.prototype.recover=function(t){var e=this,n=0,r=o(t);if(!this.inverted)for(var s=0;s<r;s++)n+=e.ranges[3*s+2]-e.ranges[3*s+1];return this.ranges[3*r]+n+i(t)},l.prototype.mapResult=function(t,e){return this._map(t,e,!1)},l.prototype.map=function(t,e){return this._map(t,e,!0)},l.prototype._map=function(t,e,n){for(var o=this,i=0,s=this.inverted?2:1,a=this.inverted?1:2,l=0;l<this.ranges.length;l+=3){var p=o.ranges[l]-(o.inverted?i:0);if(p>t)break;var u=o.ranges[l+s],f=o.ranges[l+a],h=p+u;if(t<=h){var d=u?t==p?-1:t==h?1:e:e,m=p+i+(d<0?0:f);if(n)return m;var v=r(l/3,t-p);return new c(m,e<0?t!=p:t!=h,v)}i+=f-u}return n?t+i:new c(t+i)},l.prototype.touches=function(t,e){for(var n=this,r=0,i=o(e),s=this.inverted?2:1,a=this.inverted?1:2,c=0;c<this.ranges.length;c+=3){var l=n.ranges[c]-(n.inverted?r:0);if(l>t)break;var p=n.ranges[c+s];if(t<=l+p&&c==3*i)return!0;r+=n.ranges[c+a]-p}return!1},l.prototype.forEach=function(t){for(var e=this,n=this.inverted?2:1,r=this.inverted?1:2,o=0,i=0;o<this.ranges.length;o+=3){var s=e.ranges[o],a=s-(e.inverted?i:0),c=s+(e.inverted?0:i),l=e.ranges[o+n],p=e.ranges[o+r];t(a,a+l,c,c+p),i+=p-l}},l.prototype.invert=function(){return new l(this.ranges,!this.inverted)},l.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},e.StepMap=l,l.empty=new l([]);var p=function(t,e,n,r){this.maps=t||[],this.from=n||0,this.to=null==r?this.maps.length:r,this.mirror=e};return p.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.maps.length),new p(this.maps,this.mirror,t,e)},p.prototype.copy=function(){return new p(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},p.prototype.getMirror=function(t){var e=this;if(this.mirror)for(var n=0;n<this.mirror.length;n++)if(e.mirror[n]==t)return e.mirror[n+(n%2?-1:1)]},p.prototype.setMirror=function(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)},p.prototype.appendMap=function(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)},p.prototype.appendMapping=function(t){for(var e=this,n=0,r=this.maps.length;n<t.maps.length;n++){var o=t.getMirror(n);e.appendMap(t.maps[n],null!=o&&o<n?r+o:null)}},p.prototype.map=function(t,e){var n=this;if(this.mirror)return this._map(t,e,!0);for(var r=this.from;r<this.to;r++)t=n.maps[r].map(t,e);return t},p.prototype.mapResult=function(t,e){return this._map(t,e,!1)},p.prototype._map=function(t,e,n){for(var r=this,o=!1,i=null,s=this.from;s<this.to;s++){var a=r.maps[s],l=i&&i[s];if(null!=l&&a.touches(t,l))t=a.recover(l);else{var p=a.mapResult(t,e);if(null!=p.recover){var u=r.getMirror(s);if(null!=u&&u>s&&u<r.to){if(p.deleted){s=u,t=r.maps[u].recover(p.recover);continue}(i||(i=Object.create(null)))[u]=p.recover}}p.deleted&&(o=!0),t=p.pos}}return n?t:new c(t,o)},e.Mapping=p,n.exports}),t.registerDynamic("3c",["3","39","3d"],!0,function(t,e,n){function r(t,e,n){for(var r=t.resolve(e),o=n-e,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var s=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}return!1}var o=t("3"),i=o.Slice,s=t("39"),a=s.Step,c=s.StepResult,l=t("3d"),p=l.StepMap,u=function(t){function e(e,n,r,o){t.call(this),this.from=e,this.to=n,this.slice=r,this.structure=!!o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){return this.structure&&r(t,this.from,this.to)?c.fail("Structure replace would overwrite content"):c.fromReplace(t,this.from,this.to,this.slice)},e.prototype.getMap=function(){return new p([this.from,this.to-this.from,this.slice.size])},e.prototype.invert=function(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice)},e.prototype.merge=function(t){if(!(t instanceof e)||t.structure!=this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openRight||t.slice.openLeft){if(t.to!=this.from||this.slice.openLeft||t.slice.openRight)return null;var n=this.slice.size+t.slice.size==0?i.empty:new i(t.slice.content.append(this.slice.content),t.slice.openLeft,this.slice.openRight);return new e(t.from,this.to,n,this.structure)}var r=this.slice.size+t.slice.size==0?i.empty:new i(this.slice.content.append(t.slice.content),this.slice.openLeft,t.slice.openRight);return new e(this.from,this.to+(t.to-t.from),r,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){return new e(n.from,n.to,i.fromJSON(t,n.slice),!!n.structure)},e}(a);e.ReplaceStep=u,a.jsonID("replace",u);var f=function(t){function e(e,n,r,o,i,s,a){t.call(this),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=!!a}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){if(this.structure&&(r(t,this.from,this.gapFrom)||r(t,this.gapTo,this.to)))return c.fail("Structure gap-replace would overwrite content");var e=t.slice(this.gapFrom,this.gapTo);if(e.openLeft||e.openRight)return c.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,e.content);return n?c.fromReplace(t,this.from,this.to,n):c.fail("Content does not fit in gap")},e.prototype.getMap=function(){return new p([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},e.prototype.invert=function(t){var n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),o=t.map(this.gapFrom,-1),i=t.map(this.gapTo,1);return n.deleted&&r.deleted||o<n.pos||i>r.pos?null:new e(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)},e.toJSON=function(){var t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,slice:this.slice.toJSON()};return this.structure&&(t.structure=!0),!0},e.fromJSON=function(t,n){return new e(n.from,n.to,n.gapFrom,n.gapTo,i.fromJSON(t,n.slice),n.insert,!!n.structure)},e}(a);return e.ReplaceAroundStep=f,a.jsonID("replaceAround",f),n.exports}),t.registerDynamic("3e",["3","3b","3c"],!0,function(t,e,n){function r(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function o(t){for(var e=t.parent,n=e.content.cutByIndex(t.startIndex,t.endIndex),o=t.depth;;--o){var i=t.$from.node(o),s=t.$from.index(o),a=t.$to.indexAfter(o);if(o<t.depth&&i.canReplace(s,a,n))return o;if(0==o||!r(i,s,a))break}}function i(t,e,n,r){void 0===r&&(r=t);var o={type:e,attrs:n},i=s(t,o),c=i&&a(r,o);return c?i.concat(o).concat(c):null}function s(t,e){var n=t.parent,r=t.startIndex,o=t.endIndex,i=n.contentMatchAt(r).findWrapping(e.type,e.attrs);if(!i)return null;var s=i.length?i[0]:e;return n.canReplaceWith(r,o,s.type,s.attrs)?i:null}function a(t,e){var n=t.parent,r=t.startIndex,o=t.endIndex,i=n.child(r),s=e.type.contentExpr.start(e.attrs).findWrappingFor(i);if(!s)return null;for(var a=s.length?s[s.length-1]:e,c=a.type.contentExpr.start(a.attrs),l=r;l<o;l++)c=c&&c.matchNode(n.child(l));return c&&c.validEnd()?s:null}function c(t,e,n,r){void 0===n&&(n=1);var o=t.resolve(e),i=o.depth-n;if(i<0||!o.parent.canReplace(o.index(),o.parent.childCount)||!o.parent.canReplace(0,o.indexAfter()))return!1;for(var s=o.depth-1,a=n-1;s>i;s--,a--){var c=o.node(s),l=o.index(s),p=r&&r[a];if(!c.canReplace(0,l)||!c.canReplaceWith(l,c.childCount,p?p.type:o.node(s+1).type,p?p.attrs:o.node(s+1).attrs))return!1}var u=o.indexAfter(i),f=r&&r[0];return o.node(i).canReplaceWith(u,u,f?f.type:o.node(i+1).type,f?f.attrs:o.node(i+1).attrs)}function l(t,e){var n=t.resolve(e),r=n.index();return p(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function p(t,e){return t&&e&&!t.isLeaf&&t.canAppend(e)}function u(t,e,n){void 0===n&&(n=-1);for(var r=t.resolve(e),o=r.depth;;o--){var i=void 0,s=void 0;if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(o+1),s=r.node(o).maybeChild(r.index(o)+1)):(i=r.node(o).maybeChild(r.index(o)-1),s=r.node(o+1)),i&&!i.isTextblock&&p(i,s))return e;if(0==o)break;e=n<0?r.before(o):r.after(o)}}function f(t,e,n,r){var o=t.resolve(e);if(o.parent.canReplaceWith(o.index(),o.index(),n,r))return e;if(0==o.parentOffset)for(var i=o.depth-1;i>=0;i--){var s=o.index(i);if(o.node(i).canReplaceWith(s,s,n,r))return o.before(i+1);if(s>0)return null}if(o.parentOffset==o.parent.content.size)for(var a=o.depth-1;a>=0;a--){var c=o.indexAfter(a);if(o.node(a).canReplaceWith(c,c,n,r))return o.after(a+1);if(c<o.node(a).childCount)return null}}var h=t("3"),d=h.Slice,m=h.Fragment,v=t("3b"),g=v.Transform,y=t("3c"),w=y.ReplaceStep,x=y.ReplaceAroundStep;return e.liftTarget=o,g.prototype.lift=function(t,e){for(var n=t.$from,r=t.$to,o=t.depth,i=n.before(o+1),s=r.after(o+1),a=i,c=s,l=m.empty,p=0,u=o,f=!1;u>e;u--)f||n.index(u)>0?(f=!0,l=m.from(n.node(u).copy(l)),p++):a--;for(var h=m.empty,v=0,g=o,y=!1;g>e;g--)y||r.after(g+1)<r.end(g)?(y=!0,h=m.from(r.node(g).copy(h)),v++):c++;return this.step(new x(a,c,i,s,new d(l.append(h),p,v),l.size-p,!0))},e.findWrapping=i,g.prototype.wrap=function(t,e){for(var n=m.empty,r=e.length-1;r>=0;r--)n=m.from(e[r].type.create(e[r].attrs,n));var o=t.start,i=t.end;return this.step(new x(o,i,o,i,new d(n,0,0),e.length,!0))},g.prototype.setBlockType=function(t,e,n,r){var o=this;if(void 0===e&&(e=t),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var i=this.steps.length;return this.doc.nodesBetween(t,e,function(t,e){if(t.isTextblock&&!t.hasMarkup(n,r)){o.clearNonMatching(o.mapping.slice(i).map(e,1),n.contentExpr.start(r));var s=o.mapping.slice(i),a=s.map(e,1),c=s.map(e+t.nodeSize,1);return o.step(new x(a,c,a+1,c-1,new d(m.from(n.create(r)),0,0),1,!0)),!1}}),this},g.prototype.setNodeType=function(t,e,n){var r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at given position");if(e||(e=r.type),r.isLeaf)return this.replaceWith(t,t+r.nodeSize,e.create(n,null,r.marks));if(!e.validContent(r.content,n))throw new RangeError("Invalid content for node type "+e.name);return this.step(new x(t,t+r.nodeSize,t+1,t+r.nodeSize-1,new d(m.from(e.create(n)),0,0),1,!0))},e.canSplit=c,g.prototype.split=function(t,e,n){void 0===e&&(e=1);for(var r=this.doc.resolve(t),o=m.empty,i=m.empty,s=r.depth,a=r.depth-e,c=e-1;s>a;s--,c--){o=m.from(r.node(s).copy(o));var l=n&&n[c];i=m.from(l?l.type.create(l.attrs,i):r.node(s).copy(i))}return this.step(new w(t,t,new d(o.append(i),e,e,!0)))},e.canJoin=l,e.joinPoint=u,g.prototype.join=function(t,e){void 0===e&&(e=1);var n=new w(t-e,t+e,d.empty,!0);return this.step(n)},e.insertPoint=f,n.exports}),t.registerDynamic("3f",["3","3c","3b","3e"],!0,function(t,e,n){function r(t,e,n,o,i){if(e<n){var s=t.firstChild;t=t.replaceChild(0,s.copy(r(s.content,e+1,n,o,s)))}return e>o&&(t=i.contentMatchAt(0).fillBefore(t).append(t)),t}function o(t,e){for(var n=[],r=0;r<t.depth;r++){var o=t.depth-r;if(t.pos-r>t.start(o))break;e.depth>=o&&e.pos+(e.depth-o)==t.end(o)&&n.push(o)}return n}function i(t,e,n,r){if(void 0===n&&(n=e),void 0===r&&(r=k.empty),e==n&&!r.size)return null;var o=t.resolve(e),i=t.resolve(n);if(h(o,i,r))return new C(e,n,r);var s=g(o,r),c=a(o,s),l=f(o,i,c);if(!l)return null;if(c.size!=l.size&&d(o,i,c)){for(var p=i.depth,u=i.after(p);p>1&&u==i.end(--p);)++u;var m=f(o,t.resolve(u),c);if(m)return new O(e,u,n,i.end(),m,c.size)}return new C(e,n,l)}function s(t,e,n,r){var o=S.empty,i=0,a=n[e];if(t.depth>e){var c=s(t,e+1,n,r||a);i=c.openRight+1,o=S.from(t.node(e+1).copy(c.content))}return a&&(o=o.append(a.content),i=a.openRight),r&&(o=o.append(t.node(e).contentMatchAt(t.indexAfter(e)).fillBefore(S.empty,!0)),i=0),{content:o,openRight:i}}function a(t,e){var n=s(t,0,e,!1),r=n.content,o=n.openRight;return new k(r,t.depth,o||0)}function c(t,e,n,r,o,i,s){var a,u=t.childCount,f=u-(s>0?1:0);a=i<0?e.contentMatchAt(f):1==u&&s>0?n.node(o).contentMatchAt(i?n.index(o):n.indexAfter(o)):n.node(o).contentMatchAt(n.indexAfter(o)).matchFragment(t,u>0&&i?1:0,f);var h=r.node(o);if(s>0&&o<r.depth){var d=h.content.cutByIndex(r.indexAfter(o)).addToStart(t.lastChild),m=a.fillBefore(d,!0);if(m&&m.size&&i>0&&1==u&&(m=null),m){var v=c(t.lastChild.content,t.lastChild,n,r,o+1,1==u?i-1:-1,s-1);if(v){var g=t.lastChild.copy(v);return m.size?t.cutByIndex(0,u-1).append(m).addToEnd(g):t.replaceChild(u-1,g)}}}s>0&&(a=a.matchNode(1==u&&i>0?n.node(o+1):t.lastChild));var y=r.index(o);if(y==h.childCount&&!h.type.compatibleContent(e.type))return null;var w=a.fillBefore(h.content,!0,y);if(!w)return null;if(s>0){var x=l(t.lastChild,s-1,n,o+1,1==u?i-1:-1);t=t.replaceChild(u-1,x)}return t=t.append(w),r.depth>o&&(t=t.addToEnd(p(r,o+1))),t}function l(t,e,n,r,o){var i,s=t.content,a=s.childCount;if(i=o>=0?n.node(r).contentMatchAt(n.indexAfter(r)).matchFragment(s,o>0?1:0,a):t.contentMatchAt(a),e>0){var c=l(s.lastChild,e-1,n,r+1,1==a?o-1:-1);s=s.replaceChild(a-1,c)}return t.copy(s.append(i.fillBefore(S.empty,!0)))}function p(t,e){var n=t.node(e),r=n.contentMatchAt(0).fillBefore(n.content,!0,t.index(e));return t.depth>e&&(r=r.addToEnd(p(t,e+1))),n.copy(r)}function u(t,e,n){for(;e>0&&n>0&&1==t.childCount;)t=t.firstChild.content,e--,n--;return new k(t,e,n)}function f(t,e,n){var r=c(n.content,t.node(0),t,e,0,n.openLeft,n.openRight);return r?u(r,n.openLeft,e.depth):null}function h(t,e,n){return!n.openLeft&&!n.openRight&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}function d(t,e,n){if(!e.parent.isTextblock)return!1;var r;if(n.openRight){var o=v(n.content,n.openRight);if(!o.isTextblock)return!1;r=o.contentMatchAt(o.childCount)}else{var i=t.node(t.depth-(n.openLeft-n.openRight));if(!i.isTextblock)return!1;r=i.contentMatchAt(i.childCount),n.size&&(r=r.matchFragment(n.content,n.openLeft?1:0))}return(r=r.matchFragment(e.parent.content,e.index()))&&r.validEnd()}function m(t,e){for(var n=1;n<e;n++)t=t.firstChild.content;return t.firstChild}function v(t,e){for(var n=1;n<e;n++)t=t.lastChild.content;return t.lastChild}function g(t,e){for(var n=t.depth,r=null,o=[],i=null,s=e.openLeft;;--s){var a=void 0,c=void 0,l=void 0;if(s>=0){if(s>0){var p;p=m(e.content,s),a=p.type,c=p.attrs,l=p.content}else 0==s&&(l=e.content);s<e.openLeft&&(l=l.cut(l.firstChild.nodeSize))}else{l=S.empty;var u=i[i.length+s-1];a=u.type,c=u.attrs}if(r&&(l=l.addToStart(r)),0==l.size&&s<=0)break;var f=w(l,t,n,o);if(f){if(f.fragment.size>0&&(o[f.depth]={content:f.fragment,openRight:y(e,s)?e.openRight-s:0,depth:f.depth}),s<=0)break;r=null,n=f.depth-(a==t.node(f.depth).type?1:0)}else{if(0==s){var h=t.node(0),d=h.contentMatchAt(t.index(0)).findWrappingFor(l.firstChild);if(!d||0==d.length)break;var v=d[d.length-1];if(!v.type.contentExpr.matches(v.attrs,l))break;i=[{type:h.type,attrs:h.attrs}].concat(d);var g;g=v,a=g.type,c=g.attrs}l.size?(l=a.contentExpr.start(c).fillBefore(l,!0).append(l),r=a.create(c,l)):r=null}}return o}function y(t,e){for(var n=0,r=t.content;n<e;n++){if(r.childCount>1)return!1;r=r.firstChild.content}return!0}function w(t,e,n,r){for(var o=!1,i=0;i<t.childCount;i++)t.child(i).marks.length&&(o=!0);for(var s=n;s>=0;s--){var a=e.node(s).contentMatchAt(e.indexAfter(s)),c=r[s];c&&(a=a.matchFragment(c.content));var l=a.fillBefore(t);if(l)return{depth:s,fragment:(c?c.content.append(l):l).append(t)};if(o){var p=x(a,t);if(p)return{depth:s,fragment:c?c.content.append(p):p}}}}function x(t,e){for(var n=[],r=0;r<e.childCount;r++){var o=e.child(r),i=o.mark(o.marks.filter(function(e){return t.allowsMark(e.type)}));if(!(t=t.matchNode(i)))return null;n.push(i)}return S.from(n)}var b=t("3"),S=b.Fragment,k=b.Slice,M=t("3c"),C=M.ReplaceStep,O=M.ReplaceAroundStep,D=t("3b"),T=D.Transform,R=t("3e"),N=R.insertPoint;return T.prototype.replaceRange=function(t,e,n){var i=this;if(!n.size)return this.deleteRange(t,e);var s=this.doc.resolve(t);if(h(s,this.doc.resolve(e),n))return this.step(new C(t,e,n));var a=o(s,this.doc.resolve(e)),c=0;a.unshift(s.depth+1);for(var l=s.depth;l>0&&!s.node(l).type.spec.defining;l--){var p=a.indexOf(l,1);p>-1&&(c=p)}for(var u=[],f=n.openLeft,d=n.content,m=0;;m++){var v=d.firstChild;if(u.push(v),m==n.openLeft)break;d=v.content}f>0&&u[f-1].type.spec.defining?f-=1:f>=2&&u[f-1].isTextblock&&u[f-2].type.spec.defining&&(f-=2);for(var g=n.openLeft;g>=0;g--){var y=(g+f+1)%(n.openLeft+1),w=u[y];if(w)for(var x=0;x<a.length;x++){var b=a[(x+c)%a.length],S=s.node(b-1),M=s.index(b-1);if(S.canReplaceWith(M,M,w.type,w.attrs,w.marks))return i.replace(s.before(b),b>s.depth?e:s.after(b),new k(r(n.content,0,n.openLeft,y),y,n.openRight))}}return this.replace(t,e,n)},T.prototype.replaceRangeWith=function(t,e,n){if(!n.isInline&&t==e&&this.doc.resolve(t).parent.content.size){var r=N(this.doc,t,n.type,n.attrs);null!=r&&(t=e=r)}return this.replaceRange(t,e,new k(S.from(n),0,0))},T.prototype.deleteRange=function(t,e){for(var n=this.doc.resolve(t),r=o(n,this.doc.resolve(e)),i=!1,s=0;s<r.length;s++)if(n.node(r[s]).contentMatchAt(0).validEnd()){t=n.start(r[s]),e=n.end(r[s]),i=!0;break}if(!i&&r.length){var a=r[r.length-1];n.node(a-1).canReplace(n.index(a-1),n.indexAfter(a-1))&&(t=n.before(a),e=n.after(a))}return this["delete"](t,e)},T.prototype["delete"]=function(t,e){return this.replace(t,e,k.empty)},e.replaceStep=i,T.prototype.replace=function(t,e,n){void 0===e&&(e=t),void 0===n&&(n=k.empty);var r=i(this.doc,t,e,n);return r&&this.step(r),this},T.prototype.replaceWith=function(t,e,n){return this.replace(t,e,new k(S.from(n),0,0))},T.prototype.insert=function(t,e){return this.replaceWith(t,t,e)},n.exports}),t.registerDynamic("40",["3b","39","3e","3d","38","3c","3a","3f"],!0,function(t,e,n){var r;r=t("3b"),e.Transform=r.Transform,e.TransformError=r.TransformError;var o;o=t("39"),e.Step=o.Step,e.StepResult=o.StepResult;var i;i=t("3e"),e.joinPoint=i.joinPoint,e.canJoin=i.canJoin,e.canSplit=i.canSplit,e.insertPoint=i.insertPoint,e.liftTarget=i.liftTarget,e.findWrapping=i.findWrapping;var s;s=t("3d"),e.StepMap=s.StepMap,e.MapResult=s.MapResult,e.Mapping=s.Mapping;var a;a=t("38"),e.AddMarkStep=a.AddMarkStep,e.RemoveMarkStep=a.RemoveMarkStep;var c;c=t("3c"),e.ReplaceStep=c.ReplaceStep,e.ReplaceAroundStep=c.ReplaceAroundStep,t("3a");var l;return l=t("3f"),e.replaceStep=l.replaceStep,n.exports}),t.registerDynamic("9",["40"],!0,function(t,e,n){return n.exports=t("40"),n.exports}),t.registerDynamic("41",[],!0,function(t,e,n){function r(t){this.content=t}return r.prototype={constructor:r,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return-1==e?undefined:this.content[e+1]},update:function(t,e,n){var o=n&&n!=t?this.remove(n):this,i=o.find(t),s=o.content.slice();return-1==i?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new r(s)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new r(n)},addToStart:function(t,e){return new r([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new r(n)},addBefore:function(t,e,n){var o=this.remove(e),i=o.content.slice(),s=o.find(t);return i.splice(-1==s?i.length:s,0,e,n),new r(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=r.from(t),t.size?new r(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=r.from(t),t.size?new r(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=r.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},get size(){return this.content.length>>1}},r.from=function(t){if(t instanceof r)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new r(e)},n.exports=r,n.exports}),t.registerDynamic("42",["41"],!0,function(t,e,n){return n.exports=t("41"),n.exports}),t.registerDynamic("43",["44"],!0,function(t,e,n){var r=t("44"),o=r.Mark,i=function(t,e,n){this.pos=t,this.path=e,this.depth=e.length/3-1,this.parentOffset=n},s={parent:{},textOffset:{},nodeAfter:{},nodeBefore:{}};i.prototype.resolveDepth=function(t){return null==t?this.depth:t<0?this.depth+t:t},s.parent.get=function(){return this.node(this.depth)},i.prototype.node=function(t){return this.path[3*this.resolveDepth(t)]},i.prototype.index=function(t){return this.path[3*this.resolveDepth(t)+1]},i.prototype.indexAfter=function(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)},i.prototype.start=function(t){return t=this.resolveDepth(t),0==t?0:this.path[3*t-1]+1},i.prototype.end=function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size},i.prototype.before=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]},i.prototype.after=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize},s.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},s.nodeAfter.get=function(){var t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r},s.nodeBefore.get=function(){var t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)},i.prototype.marks=function(t){var e=this.parent,n=this.index();if(0==e.content.size)return o.none;if(t&&n<e.childCount||0==n||this.textOffset)return e.child(n).marks;for(var r=e.child(n-1).marks,i=0;i<r.length;i++)!1===r[i].type.spec.inclusiveRight&&(r=r[i--].removeFromSet(r));return r},i.prototype.sharedDepth=function(t){for(var e=this,n=this.depth;n>0;n--)if(e.start(n)<=t&&e.end(n)>=t)return n;return 0},i.prototype.blockRange=function(t,e){var n=this;if(void 0===t&&(t=this),t.pos<this.pos)return t.blockRange(this);for(var r=this.depth-(this.parent.isTextblock||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=n.end(r)&&(!e||e(n.node(r))))return new p(n,t,r)},
120
- i.prototype.sameParent=function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset},i.prototype.toString=function(){for(var t=this,e="",n=1;n<=this.depth;n++)e+=(e?"/":"")+t.node(n).type.name+"_"+t.index(n-1);return e+":"+this.parentOffset},i.resolve=function(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");for(var n=[],r=0,o=e,s=t;;){var a=s.content.findIndex(o),c=a.index,l=a.offset,p=o-l;if(n.push(s,c,r+l),!p)break;if(s=s.child(c),s.isText)break;o=p-1,r+=l+1}return new i(e,n,o)},i.resolveCached=function(t,e){for(var n=0;n<a.length;n++){var r=a[n];if(r.pos==e&&r.node(0)==t)return r}var o=a[c]=i.resolve(t,e);return c=(c+1)%l,o},Object.defineProperties(i.prototype,s),e.ResolvedPos=i;var a=[],c=0,l=6,p=function(t,e,n){this.$from=t,this.$to=e,this.depth=n},u={start:{},end:{},parent:{},startIndex:{},endIndex:{}};return u.start.get=function(){return this.$from.before(this.depth+1)},u.end.get=function(){return this.$to.after(this.depth+1)},u.parent.get=function(){return this.$from.node(this.depth)},u.startIndex.get=function(){return this.$from.index(this.depth)},u.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(p.prototype,u),e.NodeRange=p,n.exports}),t.registerDynamic("45",["46","44","47","43","48"],!0,function(t,e,n){function r(t,e){for(var n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var o=t("46"),i=o.Fragment,s=t("44"),a=s.Mark,c=t("47"),l=c.Slice,p=c.replace,u=t("43"),f=u.ResolvedPos,h=t("48"),d=h.compareDeep,m=Object.create(null),v=!1,g=function(t,e,n,r){this.type=t,this.attrs=e,this.content=n||i.empty,this.marks=r||a.none},y={nodeSize:{},childCount:{},textContent:{},firstChild:{},lastChild:{},isBlock:{},isTextblock:{},isInline:{},isText:{},isLeaf:{}};y.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},y.childCount.get=function(){return this.content.childCount},g.prototype.child=function(t){return this.content.child(t)},g.prototype.maybeChild=function(t){return this.content.maybeChild(t)},g.prototype.forEach=function(t){this.content.forEach(t)},g.prototype.nodesBetween=function(t,e,n,r){void 0===r&&(r=0),this.content.nodesBetween(t,e,n,r,this)},g.prototype.descendants=function(t){this.nodesBetween(0,this.content.size,t)},y.textContent.get=function(){return this.textBetween(0,this.content.size,"")},g.prototype.textBetween=function(t,e,n,r){return this.content.textBetween(t,e,n,r)},y.firstChild.get=function(){return this.content.firstChild},y.lastChild.get=function(){return this.content.lastChild},g.prototype.eq=function(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)},g.prototype.sameMarkup=function(t){return this.hasMarkup(t.type,t.attrs,t.marks)},g.prototype.hasMarkup=function(t,e,n){return this.type==t&&d(this.attrs,e||t.defaultAttrs||m)&&a.sameSet(this.marks,n||a.none)},g.prototype.copy=function(t){return void 0===t&&(t=null),t==this.content?this:new this.constructor(this.type,this.attrs,t,this.marks)},g.prototype.mark=function(t){return t==this.marks?this:new this.constructor(this.type,this.attrs,this.content,t)},g.prototype.cut=function(t,e){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))},g.prototype.slice=function(t,e,n){if(void 0===e&&(e=this.content.size),void 0===n&&(n=!1),t==e)return l.empty;var r=this.resolve(t),o=this.resolve(e),i=n?0:r.sharedDepth(e),s=r.start(i),a=r.node(i),c=a.content.cut(r.pos-s,o.pos-s);return new l(c,r.depth-i,o.depth-i)},g.prototype.replace=function(t,e,n){return p(this.resolve(t),this.resolve(e),n)},g.prototype.nodeAt=function(t){for(var e=this;;){var n=e.content.findIndex(t),r=n.index,o=n.offset;if(!(e=e.maybeChild(r)))return null;if(o==t||e.isText)return e;t-=o+1}},g.prototype.childAfter=function(t){var e=this.content.findIndex(t),n=e.index,r=e.offset;return{node:this.content.maybeChild(n),index:n,offset:r}},g.prototype.childBefore=function(t){if(0==t)return{node:null,index:0,offset:0};var e=this.content.findIndex(t),n=e.index,r=e.offset;if(r<t)return{node:this.content.child(n),index:n,offset:r};var o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}},g.prototype.resolve=function(t){return f.resolveCached(this,t)},g.prototype.resolveNoCache=function(t){return f.resolve(this,t)},g.prototype.marksAt=function(t,e){return!v&&"undefined"!=typeof console&&console.warn&&(v=!0,console.warn("Node.marksAt is deprecated. Use ResolvedPos.marks instead.")),this.resolve(t).marks(e)},g.prototype.rangeHasMark=function(t,e,n){var r=!1;return this.nodesBetween(t,e,function(t){return n.isInSet(t.marks)&&(r=!0),!r}),r},y.isBlock.get=function(){return this.type.isBlock},y.isTextblock.get=function(){return this.type.isTextblock},y.isInline.get=function(){return this.type.isInline},y.isText.get=function(){return this.type.isText},y.isLeaf.get=function(){return this.type.isLeaf},g.prototype.toString=function(){var t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),r(this.marks,t)},g.prototype.contentMatchAt=function(t){return this.type.contentExpr.getMatchAt(this.attrs,this.content,t)},g.prototype.canReplace=function(t,e,n,r,o){return this.type.contentExpr.checkReplace(this.attrs,this.content,t,e,n,r,o)},g.prototype.canReplaceWith=function(t,e,n,r,o){return this.type.contentExpr.checkReplaceWith(this.attrs,this.content,t,e,n,r,o||a.none)},g.prototype.canAppend=function(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)},g.prototype.defaultContentType=function(t){var e=this.contentMatchAt(t).nextElement;return e&&e.defaultType()},g.prototype.toJSON=function(){var t=this,e={type:this.type.name};for(var n in t.attrs){e.attrs=t.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(function(t){return t.toJSON()})),e},g.fromJSON=function(t,e){var n=e.marks&&e.marks.map(t.markFromJSON);return"text"==e.type?t.text(e.text,n):t.nodeType(e.type).create(e.attrs,i.fromJSON(t,e.content),n)},Object.defineProperties(g.prototype,y),e.Node=g;var w=function(t){function e(e,n,r,o){if(t.call(this,e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={textContent:{},nodeSize:{}};return e.prototype.toString=function(){return r(this.marks,JSON.stringify(this.text))},n.textContent.get=function(){return this.text},e.prototype.textBetween=function(t,e){return this.text.slice(t,e)},n.nodeSize.get=function(){return this.text.length},e.prototype.mark=function(t){return new e(this.type,this.attrs,this.text,t)},e.prototype.withText=function(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)},e.prototype.cut=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.text.length),0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))},e.prototype.eq=function(t){return this.sameMarkup(t)&&this.text==t.text},e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.text=this.text,e},Object.defineProperties(e.prototype,n),e}(g);return e.TextNode=w,n.exports}),t.registerDynamic("49",["42","45","46","44","4a"],!0,function(t,e,n){function r(t){var e=Object.create(null);for(var n in t){var r=t[n];if(r["default"]===undefined)return null;e[n]=r["default"]}return e}function o(t,e){var n=Object.create(null);for(var r in t){var o=e&&e[r];if(null==o){var i=t[r];if(i["default"]!==undefined)o=i["default"];else{if(!i.compute)throw new RangeError("No value supplied for attribute "+r);o=i.compute()}}n[r]=o}return n}function i(t){var e=Object.create(null);if(t)for(var n in t)e[n]=new y(t[n]);return e}var s=t("42"),a=t("45"),c=a.Node,l=a.TextNode,p=t("46"),u=p.Fragment,f=t("44"),h=f.Mark,d=t("4a"),m=d.ContentExpr,v=function(t,e,n){this.name=t,this.schema=e,this.spec=n,this.attrs=i(n.attrs),this.defaultAttrs=r(this.attrs),this.contentExpr=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t},g={isInline:{},isTextblock:{},isLeaf:{}};g.isInline.get=function(){return!this.isBlock},g.isTextblock.get=function(){return this.isBlock&&this.contentExpr.inlineContent},g.isLeaf.get=function(){return this.contentExpr.isLeaf},v.prototype.hasRequiredAttrs=function(t){var e=this;for(var n in e.attrs)if(e.attrs[n].isRequired&&(!t||!(n in t)))return!0;return!1},v.prototype.compatibleContent=function(t){return this==t||this.contentExpr.compatible(t.contentExpr)},v.prototype.computeAttrs=function(t){return!t&&this.defaultAttrs?this.defaultAttrs:o(this.attrs,t)},v.prototype.create=function(t,e,n){if("string"==typeof e)throw new Error("Calling create with string");return new c(this,this.computeAttrs(t),u.from(e),h.setFrom(n))},v.prototype.createChecked=function(t,e,n){if(t=this.computeAttrs(t),e=u.from(e),!this.validContent(e,t))throw new RangeError("Invalid content for node "+this.name);return new c(this,t,e,h.setFrom(n))},v.prototype.createAndFill=function(t,e,n){if(t=this.computeAttrs(t),e=u.from(e),e.size){var r=this.contentExpr.start(t).fillBefore(e);if(!r)return null;e=r.append(e)}var o=this.contentExpr.getMatchAt(t,e).fillBefore(u.empty,!0);return o?new c(this,t,e.append(o),h.setFrom(n)):null},v.prototype.validContent=function(t,e){return this.contentExpr.matches(e,t)},v.compile=function(t,e){var n=Object.create(null);if(t.forEach(function(t,r){return n[t]=new v(t,e,r)}),!n.doc)throw new RangeError("Every schema needs a 'doc' type");if(!n.text)throw new RangeError("Every schema needs a 'text' type");return n},Object.defineProperties(v.prototype,g),e.NodeType=v;var y=function(t){this["default"]=t["default"],this.compute=t.compute},w={isRequired:{}};w.isRequired.get=function(){return this["default"]===undefined&&!this.compute},Object.defineProperties(y.prototype,w);var x=function(t,e,n,o){this.name=t,this.schema=n,this.spec=o,this.attrs=i(o.attrs),this.rank=e;var s=r(this.attrs);this.instance=s&&new h(this,s)};x.prototype.create=function(t){return!t&&this.instance?this.instance:new h(this,o(this.attrs,t))},x.compile=function(t,e){var n=Object.create(null),r=0;return t.forEach(function(t,o){return n[t]=new x(t,r++,e,o)}),n},x.prototype.removeFromSet=function(t){for(var e=this,n=0;n<t.length;n++)if(t[n].type==e)return t.slice(0,n).concat(t.slice(n+1));return t},x.prototype.isInSet=function(t){for(var e=this,n=0;n<t.length;n++)if(t[n].type==e)return t[n]},e.MarkType=x;var b=function(t){var e=this;this.nodeSpec=s.from(t.nodes),this.markSpec=s.from(t.marks),this.nodes=v.compile(this.nodeSpec,this),this.marks=x.compile(this.markSpec,this);for(var n in e.nodes){if(n in e.marks)throw new RangeError(n+" can not be both a node and a mark");var r=e.nodes[n];r.contentExpr=m.parse(r,e.nodeSpec.get(n).content||"",e.nodeSpec)}this.cached=Object.create(null),this.cached.wrappings=Object.create(null),this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this)};return b.prototype.node=function(t,e,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof v))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)},b.prototype.text=function(t,e){var n=this.nodes.text;return new l(n,n.defaultAttrs,t,h.setFrom(e))},b.prototype.mark=function(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)},b.prototype.nodeFromJSON=function(t){return c.fromJSON(this,t)},b.prototype.markFromJSON=function(t){return h.fromJSON(this,t)},b.prototype.nodeType=function(t){var e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e},e.Schema=b,n.exports}),t.registerDynamic("4a",["46","44"],!0,function(t,e,n){function r(t,e){if("."==e.charAt(0)){var n=e.slice(1);if(!t.attrs[n])throw new SyntaxError("Node type "+t.name+" has no attribute "+n);return new w(n)}return JSON.parse(e)}function o(t,e){for(var n=[],r=0;r<e.length;r++){var o=t.marks[e[r]];if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'");n.push(o)}return n}function i(t,e,n){if(!(t instanceof w))return t;var r=e&&e[t.attr];return r!==undefined?r:n.nodeType.defaultAttrs[t.attr]}function s(t,e,n,r){return e>=i(t.min,n,r)&&e<=i(t.max,n,r)}function a(t,e,n){var r=[];return n.forEach(function(n){var o=t.nodes[n];if(o?-1==r.indexOf(o)&&r.push(o):e.forEach(function(e,i){i.group&&i.group.split(" ").indexOf(n)>-1&&(o=t.nodes[e],-1==r.indexOf(o)&&r.push(o))}),!o)throw new SyntaxError("Node type or group '"+n+"' does not exist")}),r}function c(t,e){var n=1,o=1;if(e&&("+"==e[1]?o=x:"*"==e[1]?(n=0,o=x):"?"==e[1]?n=0:e[2]&&(n=r(t,e[2]),o=e[3]?e[4]?r(t,e[4]):x:n),0==o||n>o))throw new SyntaxError("Invalid repeat count in '"+e[0]+"'");return{min:n,max:o}}function l(t,e){for(var n=e.split(/\s*,\s*/),o=Object.create(null),i=0;i<n.length;i++){var s=/^(\w+)=(\w+|\"(?:\\.|[^\\])*\"|\.\w+)$/.exec(n[i]);if(!s)throw new SyntaxError("Invalid attribute syntax: "+n[i]);o[s[1]]=r(t,s[2])}return o}var p=t("46"),u=p.Fragment,f=t("44"),h=f.Mark,d=function(t,e,n){this.nodeType=t,this.elements=e,this.inlineContent=n},m={isLeaf:{}};m.isLeaf.get=function(){return 0==this.elements.length},d.prototype.start=function(t){return new g(this,t,0,0)},d.prototype.atType=function(t,e,n,r){var o=this;void 0===r&&(r=h.none);for(var i=0;i<this.elements.length;i++)if(o.elements[i].matchesType(e,n,r,t,o))return new g(o,t,i,0)},d.prototype.matches=function(t,e,n,r){return this.start(t).matchToEnd(e,n,r)},d.prototype.getMatchAt=function(t,e,n){return void 0===n&&(n=e.childCount),1==this.elements.length?new g(this,t,0,n):this.start(t).matchFragment(e,0,n)},d.prototype.checkReplace=function(t,e,n,r,o,i,a){var c=this;if(void 0===o&&(o=u.empty),void 0===i&&(i=0),void 0===a&&(a=o.childCount),1==this.elements.length){var l=this.elements[0];if(!s(l,e.childCount-(r-n)+(a-i),t,this))return!1;for(var p=i;p<a;p++)if(!l.matches(o.child(p),t,c))return!1;return!0}var f=this.getMatchAt(t,e,n).matchFragment(o,i,a);return!!f&&f.matchToEnd(e,r)},d.prototype.checkReplaceWith=function(t,e,n,r,o,i,a){if(1==this.elements.length){var c=this.elements[0];return!!s(c,e.childCount-(r-n)+1,t,this)&&c.matchesType(o,i,a,t,this)}var l=this.getMatchAt(t,e,n).matchType(o,i,a);return!!l&&l.matchToEnd(e,r)},d.prototype.compatible=function(t){for(var e=this,n=0;n<this.elements.length;n++)for(var r=e.elements[n],o=0;o<t.elements.length;o++)if(t.elements[o].compatible(r))return!0;return!1},d.prototype.generateContent=function(t){return this.start(t).fillBefore(u.empty,!0)},d.parse=function(t,e,n){for(var r=[],i=0,s=null;(i+=/^\s*/.exec(e.slice(i))[0].length)!=e.length;){var p=/^(?:(\w+)|\(\s*(\w+(?:\s*\|\s*\w+)*)\s*\))/.exec(e.slice(i));if(!p)throw new SyntaxError("Invalid content expression '"+e+"' at "+i);i+=p[0].length;var u=/^\[([^\]]+)\]/.exec(e.slice(i));u&&(i+=u[0].length);var f=/^<(?:(_)|\s*(\w+(?:\s+\w+)*)\s*)>/.exec(e.slice(i));f&&(i+=f[0].length);var h=/^(?:([+*?])|\{\s*(\d+|\.\w+)\s*(,\s*(\d+|\.\w+)?)?\s*\})/.exec(e.slice(i));h&&(i+=h[0].length);for(var m=a(t.schema,n,p[1]?[p[1]]:p[2].split(/\s*\|\s*/)),g=0;g<m.length;g++)if(null==s)s=m[g].isInline;else if(s!=m[g].isInline)throw new SyntaxError("Mixing inline and block content in a single node");var y=u?l(t,u[1]):null,w=!!f&&(!!f[1]||o(t.schema,f[2].split(/\s+/))),x=c(t,h),b=x.min,S=x.max;if(0!=b&&(m[0].hasRequiredAttrs(y)||m[0].isText))throw new SyntaxError("Node type "+p[0]+" in type "+t.name+" is required, but has non-optional attributes");for(var k=new v(m,y,w,b,S),M=r.length-1;M>=0;M--){var C=r[M];if(C.min!=C.max&&C.overlaps(k))throw new SyntaxError("Possibly ambiguous overlapping adjacent content expressions in '"+e+"'");if(0!=C.min)break}r.push(k)}return new d(t,r,!!s)},Object.defineProperties(d.prototype,m),e.ContentExpr=d;var v=function(t,e,n,r,o){this.nodeTypes=t,this.attrs=e,this.marks=n,this.min=r,this.max=o};v.prototype.matchesType=function(t,e,n,r,o){var s=this;if(-1==this.nodeTypes.indexOf(t))return!1;if(this.attrs){if(!e)return!1;for(var a in s.attrs)if(e[a]!=i(s.attrs[a],r,o))return!1}if(!0===this.marks)return!0;if(!1===this.marks)return 0==n.length;for(var c=0;c<n.length;c++)if(-1==s.marks.indexOf(n[c].type))return!1;return!0},v.prototype.matches=function(t,e,n){return this.matchesType(t.type,t.attrs,t.marks,e,n)},v.prototype.compatible=function(t){for(var e=this,n=0;n<this.nodeTypes.length;n++)if(-1!=t.nodeTypes.indexOf(e.nodeTypes[n]))return!0;return!1},v.prototype.constrainedAttrs=function(t,e){var n=this;if(!this.attrs)return null;var r=Object.create(null);for(var o in n.attrs)r[o]=i(n.attrs[o],t,e);return r},v.prototype.createFiller=function(t,e){var n=this.nodeTypes[0],r=n.computeAttrs(this.constrainedAttrs(t,e));return n.create(r,n.contentExpr.generateContent(r))},v.prototype.defaultType=function(){var t=this.nodeTypes[0];if(!t.hasRequiredAttrs()&&!t.isText)return t},v.prototype.overlaps=function(t){return this.nodeTypes.some(function(e){return t.nodeTypes.indexOf(e)>-1})},v.prototype.allowsMark=function(t){return!0===this.marks||this.marks&&this.marks.indexOf(t)>-1};var g=function(t,e,n,r){this.expr=t,this.attrs=e,this.index=n,this.count=r},y={element:{},nextElement:{}};y.element.get=function(){return this.expr.elements[this.index]},y.nextElement.get=function(){for(var t=this,e=this.index,n=this.count;e<this.expr.elements.length;e++){var r=t.expr.elements[e];if(t.resolveValue(r.max)>n)return r;n=0}},g.prototype.move=function(t,e){return new g(this.expr,this.attrs,t,e)},g.prototype.resolveValue=function(t){return t instanceof w?i(t,this.attrs,this.expr):t},g.prototype.matchNode=function(t){return this.matchType(t.type,t.attrs,t.marks)},g.prototype.matchType=function(t,e,n){var r=this;void 0===n&&(n=h.none);for(var o=this,i=o.index,s=o.count;i<this.expr.elements.length;i++,s=0){var a=r.expr.elements[i];if(s<r.resolveValue(a.max)&&a.matchesType(t,e,n,r.attrs,r.expr))return s++,r.move(i,s);if(s<r.resolveValue(a.min))return null}},g.prototype.matchFragment=function(t,e,n){var r=this;if(void 0===e&&(e=0),void 0===n&&(n=t.childCount),e==n)return this;for(var o=e,i=this.expr.elements.length,s=this,a=s.index,c=s.count;a<i;a++,c=0){for(var l=r.expr.elements[a],p=r.resolveValue(l.max);c<p&&o<n&&l.matches(t.child(o),r.attrs,r.expr);)if(c++,++o==n)return r.move(a,c);if(c<r.resolveValue(l.min))return null}return!1},g.prototype.matchToEnd=function(t,e,n){var r=this.matchFragment(t,e,n);return r&&r.validEnd()||!1},g.prototype.validEnd=function(){for(var t=this,e=this.index,n=this.count;e<this.expr.elements.length;e++,n=0)if(n<t.resolveValue(t.expr.elements[e].min))return!1;return!0},g.prototype.fillBefore=function(t,e,n){for(var r=this,o=[],i=this,s=n||0,a=this.expr.elements.length;;){var c=i.matchFragment(t,s);if(c&&(!e||c.validEnd()))return u.from(o);if(!1===c)return null;var l=i.element;if(i.count<r.resolveValue(l.min))o.push(l.createFiller(r.attrs,r.expr)),i=i.move(i.index,i.count+1);else{if(!(i.index<a))return t.childCount>s?null:u.from(o);i=i.move(i.index+1,0)}}},g.prototype.possibleContent=function(){for(var t=this,e=[],n=this.index,r=this.count;n<this.expr.elements.length;n++,r=0){var o=t.expr.elements[n],i=o.constrainedAttrs(t.attrs,t.expr);if(r<t.resolveValue(o.max))for(var s=0;s<o.nodeTypes.length;s++){var a=o.nodeTypes[s];a.hasRequiredAttrs(i)||a.isText||e.push({type:a,attrs:i})}if(t.resolveValue(o.min)>r)break}return e},g.prototype.allowsMark=function(t){return this.element.allowsMark(t)},g.prototype.findWrapping=function(t,e,n){for(var r=Object.create(null),o={match:this,via:null},i=[o];i.length;){var s=i.shift(),a=s.match;if(a.matchType(t,e,n)){for(var c=[],l=s;l!=o;l=l.via)c.push({type:l.match.expr.nodeType,attrs:l.match.attrs});return c.reverse()}for(var p=a.possibleContent(),u=0;u<p.length;u++){var f=p[u],h=f.type,d=f.attrs,m=h.computeAttrs(d);h.isLeaf||h.name in r||s!=o&&!a.matchType(h,m).validEnd()||(i.push({match:h.contentExpr.start(m),via:s}),r[h.name]=!0)}}},g.prototype.findWrappingFor=function(t){return this.findWrapping(t.type,t.attrs,t.marks)},Object.defineProperties(g.prototype,y),e.ContentMatch=g;var w=function(t){this.attr=t},x=2e9;return n.exports}),t.registerDynamic("4b",[],!0,function(t,e,n){function r(t,e,n){for(var o=0;;o++){if(o==t.childCount||o==e.childCount)return t.childCount==e.childCount?null:n;var i=t.child(o),s=e.child(o);if(i!=s){if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(var a=0;i.text[a]==s.text[a];a++)n++;return n}if(i.content.size||s.content.size){var c=r(i.content,s.content,n+1);if(null!=c)return c}n+=i.nodeSize}else n+=i.nodeSize}}function o(t,e,n,r){for(var i=t.childCount,s=e.childCount;;){if(0==i||0==s)return i==s?null:{a:n,b:r};var a=t.child(--i),c=e.child(--s),l=a.nodeSize;if(a!=c){if(!a.sameMarkup(c))return{a:n,b:r};if(a.isText&&a.text!=c.text){for(var p=0,u=Math.min(a.text.length,c.text.length);p<u&&a.text[a.text.length-p-1]==c.text[c.text.length-p-1];)p++,n--,r--;return{a:n,b:r}}if(a.content.size||c.content.size){var f=o(a.content,c.content,n-1,r-1);if(f)return f}n-=l,r-=l}else n-=l,r-=l}}return e.findDiffStart=r,e.findDiffEnd=o,n.exports}),t.registerDynamic("46",["4b"],!0,function(t,e,n){function r(t,e){return l.index=t,l.offset=e,l}var o=t("4b"),i=o.findDiffStart,s=o.findDiffEnd,a=function(t,e){var n=this;if(this.content=t,this.size=e||0,null==e)for(var r=0;r<t.length;r++)n.size+=t[r].nodeSize},c={firstChild:{},lastChild:{},childCount:{}};a.prototype.nodesBetween=function(t,e,n,r,o){for(var i=this,s=0,a=0;a<e;s++){var c=i.content[s],l=a+c.nodeSize;if(l>t&&!1!==n(c,r+a,o,s)&&c.content.size){var p=a+1;c.nodesBetween(Math.max(0,t-p),Math.min(c.content.size,e-p),n,r+p)}a=l}},a.prototype.textBetween=function(t,e,n,r){var o="",i=!0;return this.nodesBetween(t,e,function(s,a){s.isText?(o+=s.text.slice(Math.max(t,a)-a,e-a),i=!n):s.isLeaf&&r?(o+=r,i=!n):!i&&s.isBlock&&(o+=n,i=!0)},0),o},a.prototype.append=function(t){if(!t.size)return this;if(!this.size)return t;var e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);o<t.content.length;o++)r.push(t.content[o]);return new a(r,this.size+t.size)},a.prototype.cut=function(t,e){var n=this;if(null==e&&(e=this.size),0==t&&e==this.size)return this;var r=[],o=0;if(e>t)for(var i=0,s=0;s<e;i++){var c=n.content[i],l=s+c.nodeSize;l>t&&((s<t||l>e)&&(c=c.isText?c.cut(Math.max(0,t-s),Math.min(c.text.length,e-s)):c.cut(Math.max(0,t-s-1),Math.min(c.content.size,e-s-1))),r.push(c),o+=c.nodeSize),s=l}return new a(r,o)},a.prototype.cutByIndex=function(t,e){return t==e?a.empty:0==t&&e==this.content.length?this:new a(this.content.slice(t,e))},a.prototype.replaceChild=function(t,e){var n=this.content[t];if(n==e)return this;var r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new a(r,o)},a.prototype.addToStart=function(t){return new a([t].concat(this.content),this.size+t.nodeSize)},a.prototype.addToEnd=function(t){return new a(this.content.concat(t),this.size+t.nodeSize)},a.prototype.eq=function(t){var e=this;if(this.content.length!=t.content.length)return!1;for(var n=0;n<this.content.length;n++)if(!e.content[n].eq(t.content[n]))return!1;return!0},c.firstChild.get=function(){return this.content.length?this.content[0]:null},c.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},c.childCount.get=function(){return this.content.length},a.prototype.child=function(t){var e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e},a.prototype.offsetAt=function(t){for(var e=this,n=0,r=0;r<t;r++)n+=e.content[r].nodeSize;return n},a.prototype.maybeChild=function(t){return this.content[t]},a.prototype.forEach=function(t){for(var e=this,n=0,r=0;n<this.content.length;n++){var o=e.content[n];t(o,r,n),r+=o.nodeSize}},a.prototype.findDiffStart=function(t,e){return void 0===e&&(e=0),i(this,t,e)},a.prototype.findDiffEnd=function(t,e,n){return void 0===e&&(e=this.size),void 0===n&&(n=t.size),s(this,t,e,n)},a.prototype.findIndex=function(t,e){var n=this;if(void 0===e&&(e=-1),0==t)return r(0,t);if(t==this.size)return r(this.content.length,t);if(t>this.size||t<0)throw new RangeError("Position "+t+" outside of fragment ("+this+")");for(var o=0,i=0;;o++){var s=n.child(o),a=i+s.nodeSize;if(a>=t)return a==t||e>0?r(o+1,a):r(o,i);i=a}},a.prototype.toString=function(){return"<"+this.toStringInner()+">"},a.prototype.toStringInner=function(){return this.content.join(", ")},a.prototype.toJSON=function(){return this.content.length?this.content.map(function(t){return t.toJSON()}):null},a.fromJSON=function(t,e){return e?new a(e.map(t.nodeFromJSON)):a.empty},a.fromArray=function(t){if(!t.length)return a.empty;for(var e,n=0,r=0;r<t.length;r++){var o=t[r];n+=o.nodeSize,r&&o.isText&&t[r-1].sameMarkup(o)?(e||(e=t.slice(0,r)),e[e.length-1]=o.withText(e[e.length-1].text+o.text)):e&&e.push(o)}return new a(e||t,n)},a.from=function(t){return t?t instanceof a?t:Array.isArray(t)?this.fromArray(t):new a([t],t.nodeSize):a.empty},Object.defineProperties(a.prototype,c),e.Fragment=a;var l={index:0,offset:0};return a.empty=new a([],0),n.exports}),t.registerDynamic("47",["46"],!0,function(t,e,n){function r(t,e,n){var o=t.findIndex(e),i=o.index,s=o.offset,a=t.maybeChild(i),c=t.findIndex(n),l=c.index,p=c.offset;if(s==e||a.isText){if(p!=n&&!t.child(l).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(i!=l)throw new RangeError("Removing non-flat range");return t.replaceChild(i,a.copy(r(a.content,e-s-1,n-s-1)))}function o(t,e,n,r){var i=t.findIndex(e),s=i.index,a=i.offset,c=t.maybeChild(s);if(a==e||c.isText)return r&&!r.canReplace(s,s,n)?null:t.cut(0,e).append(n).append(t.cut(e));var l=o(c.content,e-a-1,n);return l&&t.replaceChild(s,c.copy(l))}function i(t,e,n){if(n.openLeft>t.depth)throw new g("Inserted content deeper than insertion position");if(t.depth-n.openLeft!=e.depth-n.openRight)throw new g("Inconsistent open depths");return s(t,e,n,0)}function s(t,e,n,r){var o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openLeft){var a=s(t,e,n,r+1);return i.copy(i.content.replaceChild(o,a))}if(n.content.size){if(n.openLeft||n.openRight||t.depth!=r||e.depth!=r){var c=d(n,t);return u(i,f(t,c.start,c.end,e,r))}var l=t.parent,p=l.content;return u(l,p.cut(0,t.parentOffset).append(n.content).append(p.cut(e.parentOffset)))}return u(i,h(t,e,r))}function a(t,e){if(!e.type.compatibleContent(t.type))throw new g("Cannot join "+e.type.name+" onto "+t.type.name)}function c(t,e,n){var r=t.node(n);return a(r,e.node(n)),r}function l(t,e){var n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function p(t,e,n,r){var o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(l(t.nodeAfter,r),i++));for(var a=i;a<s;a++)l(o.child(a),r);e&&e.depth==n&&e.textOffset&&l(e.nodeBefore,r)}function u(t,e){if(!t.type.validContent(e,t.attrs))throw new g("Invalid content for node "+t.type.name);return t.copy(e)}function f(t,e,n,r,o){var i=t.depth>o&&c(t,e,o+1),s=r.depth>o&&c(n,r,o+1),d=[];return p(null,t,o,d),i&&s&&e.index(o)==n.index(o)?(a(i,s),l(u(i,f(t,e,n,r,o+1)),d)):(i&&l(u(i,h(t,e,o+1)),d),p(e,n,o,d),s&&l(u(s,h(n,r,o+1)),d)),p(r,null,o,d),new v(d)}function h(t,e,n){var r=[];if(p(null,t,n,r),t.depth>n){l(u(c(t,e,n+1),h(t,e,n+1)),r)}return p(e,null,n,r),new v(r)}function d(t,e){for(var n=e.depth-t.openLeft,r=e.node(n),o=r.copy(t.content),i=n-1;i>=0;i--)o=e.node(i).copy(v.from(o));return{start:o.resolveNoCache(t.openLeft+n),end:o.resolveNoCache(o.content.size-t.openRight-n)}}var m=t("46"),v=m.Fragment,g=function(t){function e(e){t.call(this,e),this.message=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error);e.ReplaceError=g;var y=function(t,e,n){this.content=t,this.openLeft=e,this.openRight=n},w={size:{}};return w.size.get=function(){return this.content.size-this.openLeft-this.openRight},y.prototype.insertAt=function(t,e){var n=o(this.content,t+this.openLeft,e,null);return n&&new y(n,this.openLeft,this.openRight)},y.prototype.removeBetween=function(t,e){return new y(r(this.content,t+this.openLeft,e+this.openLeft),this.openLeft,this.openRight)},y.prototype.eq=function(t){return this.content.eq(t.content)&&this.openLeft==t.openLeft&&this.openRight==t.openRight},y.prototype.toString=function(){return this.content+"("+this.openLeft+","+this.openRight+")"},y.prototype.toJSON=function(){return this.content.size?{content:this.content.toJSON(),openLeft:this.openLeft,openRight:this.openRight}:null},y.fromJSON=function(t,e){return e?new y(v.fromJSON(t,e.content),e.openLeft,e.openRight):y.empty},y.maxOpen=function(t){for(var e=0,n=0,r=t.firstChild;r&&!r.isLeaf;r=r.firstChild)e++;for(var o=t.lastChild;o&&!o.isLeaf;o=o.lastChild)n++;return new y(t,e,n)},Object.defineProperties(y.prototype,w),e.Slice=y,y.empty=new y(v.empty,0,0),e.replace=i,n.exports}),t.registerDynamic("48",[],!0,function(t,e,n){function r(t,e){if(t===e)return!0;if(!t||"object"!=typeof t||!e||"object"!=typeof e)return!1;var n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(var o=0;o<t.length;o++)if(!r(t[o],e[o]))return!1}else{for(var i in t)if(!(i in e&&r(t[i],e[i])))return!1;for(var s in e)if(!(s in t))return!1}return!0}return e.compareDeep=r,n.exports}),t.registerDynamic("44",["48"],!0,function(t,e,n){var r=t("48"),o=r.compareDeep,i=function(t,e){this.type=t,this.attrs=e};return i.prototype.addToSet=function(t){for(var e=this,n=0;n<t.length;n++){var r=t[n];if(r.type==e.type){if(e.eq(r))return t;var o=t.slice();return o[n]=e,o}if(r.type.rank>e.type.rank)return t.slice(0,n).concat(e).concat(t.slice(n))}return t.concat(this)},i.prototype.removeFromSet=function(t){for(var e=this,n=0;n<t.length;n++)if(e.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t},i.prototype.isInSet=function(t){for(var e=this,n=0;n<t.length;n++)if(e.eq(t[n]))return!0;return!1},i.prototype.eq=function(t){return this==t||this.type==t.type&&!!o(t.attrs,this.attrs)},i.prototype.toJSON=function(){var t=this,e={type:this.type.name};for(var n in t.attrs){e.attrs=t.attrs;break}return e},i.fromJSON=function(t,e){return t.marks[e.type].create(e.attrs)},i.sameSet=function(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0},i.setFrom=function(t){if(!t||0==t.length)return i.none;if(t instanceof i)return[t];var e=t.slice();return e.sort(function(t,e){return t.type.rank-e.type.rank}),e},e.Mark=i,i.none=[],n.exports}),t.registerDynamic("4c",["46","47","44"],!0,function(t,e,n){function r(t){for(var e=t.firstChild,n=null;e;e=e.nextSibling){var r=1==e.nodeType?e.nodeName.toLowerCase():null;r&&v.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):"li"==r?n=e:r&&(n=null)}}function o(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function i(t){for(var e,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];e=n.exec(t);)r.push(e[1],e[2].trim());return r}function s(t){var e={};for(var n in t)e[n]=t[n];return e}var a=t("46"),c=a.Fragment,l=t("47"),p=l.Slice,u=t("44"),f=u.Mark,h=function(t,e){var n=this;this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach(function(t){t.tag?n.tags.push(t):t.style&&n.styles.push(t)})};h.prototype.parse=function(t,e){void 0===e&&(e={});var n=new x(this,e,!1);return n.addAll(t,null,e.from,e.to),n.finish()},h.prototype.parseSlice=function(t,e){void 0===e&&(e={});var n=new x(this,e,!0);return n.addAll(t,null,e.from,e.to),p.maxOpen(n.finish())},h.prototype.matchTag=function(t){for(var e=this,n=0;n<this.tags.length;n++){var r=e.tags[n];if(o(t,r.tag)){if(r.getAttrs){var i=r.getAttrs(t);if(!1===i)continue;r.attrs=i}return r}}},h.prototype.matchStyle=function(t,e){for(var n=this,r=0;r<this.styles.length;r++){var o=n.styles[r];if(o.style==t){if(o.getAttrs){var i=o.getAttrs(e);if(!1===i)continue;o.attrs=i}return o}}},h.schemaRules=function(t){function e(t){for(var e=null==t.priority?50:t.priority,r=0;r<n.length;r++){var o=n[r];if((null==o.priority?50:o.priority)<e)break}n.splice(r,0,t)}var n=[],r=function(n){var r=t.marks[n].spec.parseDOM;r&&r.forEach(function(t){e(t=s(t)),t.mark=n})};for(var o in t.marks)r(o);var i=function(){var n=t.nodes[a].spec.parseDOM;n&&n.forEach(function(t){e(t=s(t)),t.node=a})};for(var a in t.nodes)i(o);return n},h.fromSchema=function(t){return t.cached.domParser||(t.cached.domParser=new h(t,h.schemaRules(t)))},e.DOMParser=h;var d={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},m={head:!0,noscript:!0,object:!0,
121
- script:!0,style:!0,title:!0},v={ol:!0,ul:!0},g=1,y=2,w=function(t,e,n,r,o){this.type=t,this.attrs=e,this.solid=n,this.match=r||(o&y?null:t.contentExpr.start(e)),this.options=o,this.content=[]};w.prototype.findWrapping=function(t,e){if(!this.match){if(!this.type)return[];var n=this.type.contentExpr.atType(this.attrs,t,e);if(!n){var r,o=this.type.contentExpr.start(this.attrs);if(r=o.findWrapping(t,e))return this.match=o,r}if(!n)return null;this.match=n}return this.match.findWrapping(t,e)},w.prototype.finish=function(t){if(!(this.options&g)){var e,n=this.content[this.content.length-1];n&&n.isText&&(e=/\s+$/.exec(n.text))&&(n.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length)))}var r=c.from(this.content);return!t&&this.match&&(r=r.append(this.match.fillBefore(c.empty,!0))),this.type?this.type.create(this.attrs,r):r};var x=function(t,e,n){this.parser=t,this.options=e,this.isOpen=n;var r,o=e.topNode,i=(e.preserveWhitespace?g:0)|(n?y:0);r=o?new w(o.type,o.attrs,!0,o.contentMatchAt(e.topStart||0),i):n?new w(null,null,!0,null,i):new w(t.schema.nodes.doc,null,!0,null,i),this.nodes=[r],this.marks=f.none,this.open=0,this.find=e.findPositions},b={top:{},currentPos:{}};return b.top.get=function(){return this.nodes[this.open]},x.prototype.addMark=function(t){var e=this.marks;return this.marks=t.addToSet(this.marks),e},x.prototype.addDOM=function(t){if(3==t.nodeType)this.addTextNode(t);else if(1==t.nodeType){var e=t.getAttribute("style");e?this.addElementWithStyles(i(e),t):this.addElement(t)}},x.prototype.addTextNode=function(t){var e=t.nodeValue,n=this.top;if(n.type&&n.type.isTextblock||/\S/.test(e)){if(!(n.options&g)&&(e=e.replace(/\s+/g," "),/^\s/.test(e))){var r=n.content[n.content.length-1];(!r||r.isText&&/\s$/.test(r.text))&&(e=e.slice(1))}e&&this.insertNode(this.parser.schema.text(e,this.marks)),this.findInText(t)}else this.findInside(t)},x.prototype.addElement=function(t){var e=t.nodeName.toLowerCase();v.hasOwnProperty(e)&&r(t);var n=this.options.ruleFromNode&&this.options.ruleFromNode(t)||this.parser.matchTag(t);if(n?n.ignore:m.hasOwnProperty(e))this.findInside(t);else if(!n||n.skip){n&&n.skip.nodeType&&(t=n.skip);var o=d.hasOwnProperty(e)&&this.top;this.addAll(t),o&&this.sync(o)}else this.addElementByRule(t,n)},x.prototype.addElementWithStyles=function(t,e){for(var n=this,r=this.marks,o=!1,i=0;i<t.length;i+=2){var s=n.parser.matchStyle(t[i],t[i+1]);if(s){if(s.ignore){o=!0;break}n.addMark(n.parser.schema.marks[s.mark].create(s.attrs))}}o||this.addElement(e),this.marks=r},x.prototype.addElementByRule=function(t,e){var n,r,o,i,s,a=this;if(e.node?(o=this.parser.schema.nodes[e.node],o.isLeaf?this.insertNode(o.create(e.attrs,null,this.marks)):n=this.enter(o,e.attrs,e.preserveWhitespace)&&this.top):(i=this.parser.schema.marks[e.mark],r=this.addMark(s=i.create(e.attrs))),o&&o.isLeaf)this.findInside(t);else if(e.getContent)this.findInside(t),e.getContent(t).forEach(function(t){return a.insertNode(s?t.mark(s.addToSet(t.marks)):t)});else{var c=e.contentElement;"string"==typeof c&&(c=t.querySelector(c)),c||(c=t),this.findAround(t,c,!0),this.addAll(c,n),n?(this.sync(n),this.open--):r&&(this.marks=r),this.findAround(t,c,!0)}return!0},x.prototype.addAll=function(t,e,n,r){for(var o=this,i=n||0,s=n?t.childNodes[n]:t.firstChild,a=null==r?null:t.childNodes[r];s!=a;s=s.nextSibling,++i)o.findAtPoint(t,i),o.addDOM(s),e&&d.hasOwnProperty(s.nodeName.toLowerCase())&&o.sync(e);this.findAtPoint(t,i)},x.prototype.findPlace=function(t,e){for(var n,r,o=this,i=this.open;i>=0;i--){var s=o.nodes[i],a=s.findWrapping(t,e);if(a&&(!n||n.length>a.length)&&(n=a,r=s,!a.length))break;if(s.solid)break}if(!n)return!1;this.sync(r);for(var c=0;c<n.length;c++)o.enterInner(n[c].type,n[c].attrs,!1);return!0},x.prototype.insertNode=function(t){if(this.findPlace(t.type,t.attrs)){this.closeExtra();var e=this.top;if(e.match){var n=e.match.matchNode(t);n||(t=t.mark(t.marks.filter(function(t){return e.match.allowsMark(t.type)})),n=e.match.matchNode(t)),e.match=n}e.content.push(t)}},x.prototype.enter=function(t,e,n){var r=this.findPlace(t,e);return r&&this.enterInner(t,e,!0,n),r},x.prototype.enterInner=function(t,e,n,r){this.closeExtra();var o=this.top;o.match=o.match&&o.match.matchType(t,e);var i=null==r?o.options&g:r?g:0;o.options&y&&0==o.content.length&&(i|=y),this.nodes.push(new w(t,e,n,null,i)),this.open++},x.prototype.closeExtra=function(t){var e=this,n=this.nodes.length-1;if(n>this.open){for(this.marks=f.none;n>this.open;n--)e.nodes[n-1].content.push(e.nodes[n].finish(t));this.nodes.length=this.open+1}},x.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},x.prototype.sync=function(t){for(var e=this,n=this.open;n>=0;n--)if(e.nodes[n]==t)return void(e.open=n)},b.currentPos.get=function(){var t=this;this.closeExtra();for(var e=0,n=this.open;n>=0;n--){for(var r=t.nodes[n].content,o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e},x.prototype.findAtPoint=function(t,e){var n=this;if(this.find)for(var r=0;r<this.find.length;r++)n.find[r].node==t&&n.find[r].offset==e&&(n.find[r].pos=n.currentPos)},x.prototype.findInside=function(t){var e=this;if(this.find)for(var n=0;n<this.find.length;n++)null==e.find[n].pos&&t.contains(e.find[n].node)&&(e.find[n].pos=e.currentPos)},x.prototype.findAround=function(t,e,n){var r=this;if(t!=e&&this.find)for(var o=0;o<this.find.length;o++)if(null==r.find[o].pos&&t.contains(r.find[o].node)){var i=e.compareDocumentPosition(r.find[o].node);i&(n?2:4)&&(r.find[o].pos=r.currentPos)}},x.prototype.findInText=function(t){var e=this;if(this.find)for(var n=0;n<this.find.length;n++)e.find[n].node==t&&(e.find[n].pos=e.currentPos-(t.nodeValue.length-e.find[n].offset))},Object.defineProperties(x.prototype,b),n.exports}),t.registerDynamic("4d",[],!0,function(t,e,n){function r(t){var e={};for(var n in t){var r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function o(t){return t.document||window.document}var i=function(t,e){this.nodes=t||{},this.marks=e||{}};return i.prototype.serializeFragment=function(t,e,n){var r=this;void 0===e&&(e={}),n||(n=o(e).createDocumentFragment());var i=n,s=null;return t.forEach(function(t){if(s||t.marks.length){s||(s=[]);for(var n=0;n<Math.min(s.length,t.marks.length)&&t.marks[n].eq(s[n]);++n);for(;n<s.length;)s.pop(),i=i.parentNode;for(;s.length<t.marks.length;){var o=t.marks[s.length];s.push(o),i=i.appendChild(r.serializeMark(o,e))}}i.appendChild(r.serializeNode(t,e))}),n},i.prototype.serializeNode=function(t,e){return void 0===e&&(e={}),this.renderStructure(this.nodes[t.type.name](t),t,e)},i.prototype.serializeNodeAndMarks=function(t,e){var n=this;void 0===e&&(e={});for(var r=this.serializeNode(t,e),o=t.marks.length-1;o>=0;o--){var i=n.serializeMark(t.marks[o],e);i.appendChild(r),r=i}return r},i.prototype.serializeMark=function(t,e){return void 0===e&&(e={}),this.renderStructure(this.marks[t.type.name](t),null,e)},i.renderSpec=function(t,e){if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};var n=t.createElement(e[0]),r=null,o=e[1],s=1;if(o&&"object"==typeof o&&null==o.nodeType&&!Array.isArray(o)){s=2;for(var a in o)"style"==a?n.style.cssText=o[a]:null!=o[a]&&n.setAttribute(a,o[a])}for(var c=s;c<e.length;c++){var l=e[c];if(0===l){if(c<e.length-1||c>s)throw new RangeError("Content hole must be the only child of its parent node");return{dom:n,contentDOM:n}}var p=i.renderSpec(t,l),u=p.dom,f=p.contentDOM;if(n.appendChild(u),f){if(r)throw new RangeError("Multiple content holes");r=f}}return{dom:n,contentDOM:r}},i.prototype.renderStructure=function(t,e,n){var r=i.renderSpec(o(n),t),s=r.dom,a=r.contentDOM;if(e&&!e.isLeaf){if(!a)throw new RangeError("No content hole in template for non-leaf node");n.onContent?n.onContent(e,a,n):this.serializeFragment(e.content,n,a)}else if(a)throw new RangeError("Content hole not allowed in a mark or leaf node spec");return s},i.fromSchema=function(t){return t.cached.domSerializer||(t.cached.domSerializer=new i(this.nodesFromSchema(t),this.marksFromSchema(t)))},i.nodesFromSchema=function(t){return r(t.nodes)},i.marksFromSchema=function(t){return r(t.marks)},e.DOMSerializer=i,n.exports}),t.registerDynamic("4e",["45","43","46","47","44","49","4a","4c","4d"],!0,function(t,e,n){e.Node=t("45").Node;var r;r=t("43"),e.ResolvedPos=r.ResolvedPos,e.NodeRange=r.NodeRange,e.Fragment=t("46").Fragment;var o;o=t("47"),e.Slice=o.Slice,e.ReplaceError=o.ReplaceError,e.Mark=t("44").Mark;var i;i=t("49"),e.Schema=i.Schema,e.NodeType=i.NodeType,e.MarkType=i.MarkType;var s;return s=t("4a"),e.ContentMatch=s.ContentMatch,e.DOMParser=t("4c").DOMParser,e.DOMSerializer=t("4d").DOMSerializer,n.exports}),t.registerDynamic("3",["4e"],!0,function(t,e,n){return n.exports=t("4e"),n.exports}),t.registerDynamic("4f",["9","3"],!0,function(t,e,n){function r(t,e){var n={};for(var r in t)n[r]=t[r];for(var o in e)n[o]=e[o];return n}function o(t,e,n){return t.append({ordered_list:r(w,{content:"list_item+",group:n}),bullet_list:r(x,{content:"list_item+",group:n}),list_item:r(b,{content:e})})}function i(t,e){return function(n,r){var o=n.selection,i=o.$from,a=o.$to,c=i.blockRange(a),l=!1,p=c;if(c.depth>=2&&i.node(c.depth-1).type.compatibleContent(t)&&0==c.startIndex){if(0==i.index(c.depth-1))return!1;var f=n.doc.resolve(c.start-2);p=new y(f,f,c.depth),c.endIndex<c.parent.childCount&&(c=new y(i,n.doc.resolve(a.end(c.depth)),c.depth)),l=!0}var h=u(p,t,e,c);return!!h&&(r&&r(s(n.tr,c,h,l,t).scrollIntoView()),!0)}}function s(t,e,n,r,o){for(var i=g.empty,s=n.length-1;s>=0;s--)i=g.from(n[s].type.create(n[s].attrs,i));t.step(new d(e.start-(r?2:0),e.end,e.start,e.end,new v(i,0,0),n.length,!0));for(var a=0,c=0;c<n.length;c++)n[c].type==o&&(a=c+1);for(var l=n.length-a,p=e.start+n.length-(r?2:0),u=e.parent,f=e.startIndex,m=e.endIndex,y=!0;f<m;f++,y=!1)!y&&h(t.doc,p,l)&&t.split(p,l),p+=u.child(f).nodeSize+(y?0:2*l);return t}function a(t){return function(e,n){var r=e.selection,o=r.$from,i=r.$to,s=r.node;if(s&&s.isBlock||!o.parent.content.size||o.depth<2||!o.sameParent(i))return!1;var a=o.node(-1);if(a.type!=t)return!1;var c=i.pos==o.end()?a.defaultContentType(o.indexAfter(-1)):null,l=e.tr["delete"](o.pos,i.pos),p=c&&[null,{type:c}];return!!h(l.doc,o.pos,2,p)&&(n&&n(l.split(o.pos,2,p).scrollIntoView()),!0)}}function c(t){return function(e,n){var r=e.selection,o=r.$from,i=r.$to,s=o.blockRange(i,function(e){return e.childCount&&e.firstChild.type==t});if(!s||s.depth<2||o.node(s.depth-1).type!=t)return!1;if(n){var a=e.tr,c=s.end,l=i.end(s.depth);c<l&&(a.step(new d(c-1,l,c,l,new v(g.from(t.create(null,s.parent.copy())),1,0),1,!0)),s=new y(a.doc.resolveNoCache(o.pos),a.doc.resolveNoCache(l),s.depth)),n(a.lift(s,f(s)).scrollIntoView())}return!0}}function l(t){return function(e,n){var r=e.selection,o=r.$from,i=r.$to,s=o.blockRange(i,function(e){return e.childCount&&e.firstChild.type==t});if(!s)return!1;var a=s.startIndex;if(0==a)return!1;var c=s.parent,l=c.child(a-1);if(l.type!=t)return!1;if(n){var p=l.lastChild&&l.lastChild.type==c.type,u=g.from(p?t.create():null),f=new v(g.from(t.create(null,g.from(c.copy(u)))),p?3:1,0),h=s.start,m=s.end;n(e.tr.step(new d(h-(p?3:1),m,h,m,f,1,!0)).scrollIntoView())}return!0}}var p=t("9"),u=p.findWrapping,f=p.liftTarget,h=p.canSplit,d=p.ReplaceAroundStep,m=t("3"),v=m.Slice,g=m.Fragment,y=m.NodeRange,w={attrs:{order:{"default":1}},parseDOM:[{tag:"ol",getAttrs:function(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1}}}],toDOM:function(t){return["ol",{start:1==t.attrs.order?null:t.attrs.order},0]}};e.orderedList=w;var x={parseDOM:[{tag:"ul"}],toDOM:function(){return["ul",0]}};e.bulletList=x;var b={parseDOM:[{tag:"li"}],toDOM:function(){return["li",0]},defining:!0};return e.listItem=b,e.addListNodes=o,e.wrapInList=i,e.splitListItem=a,e.liftListItem=c,e.sinkListItem=l,n.exports}),t.registerDynamic("2a",["4f"],!0,function(t,e,n){return n.exports=t("4f"),n.exports}),t.register("50",["3","4","7","26","37","2a"],function(t){"use strict";function e(t){return m[t]}function n(t){var e=m[t],n=s.fromSchema(d).serializeFragment(e.editor.state.doc.content),r=document.createElement("div");return r.appendChild(n),r.innerHTML}function r(t){var e=document.getElementById(t);return m[t]=new l(e,{floatingMenu:!0,state:c.create({doc:v(e),plugins:p({schema:d})}),onAction:function(e){m[t].updateState(m[t].editor.state.applyAction(e))}}),m[t]}var o,i,s,a,c,l,p,u,f,h,d,m,v;return t("getProseMirror",e),t("getPMContent",n),t("createProseMirror",r),{setters:[function(t){o=t.Schema,i=t.DOMParser,s=t.DOMSerializer},function(t){a=t.schema},function(t){c=t.EditorState},function(t){l=t.MenuBarEditorView},function(t){p=t.exampleSetup,u=t.buildMenuItems},function(t){f=t.EditorView,h=t.addListNodes}],execute:function(){d=new o({nodes:h(a.nodeSpec,"paragraph block*","block"),marks:a.markSpec}),m={},v=function(t){var e=$(t).find(".card-content").val(),n=document.createElement("div");return n.innerHTML=e,i.fromSchema(d).parse(n)}}}}),t.registerDynamic("1",["50"],!0,function(t,e,n){return pm=t("50"),createProseMirror=pm.createProseMirror,getProseMirror=pm.getProseMirror,getProseMirrorContent=pm.getPMContent,n.exports})})(function(t){t()});
115
+ !function(t){function e(t,e,o){return 4===arguments.length?n.apply(this,arguments):void r(t,{declarative:!0,deps:e,declare:o})}function n(t,e,n,o){r(t,{declarative:!1,deps:e,executingRequire:n,execute:o})}function r(t,e){e.name=t,t in m||(m[t]=e),e.normalizedDeps=e.deps}function o(t,e){if(e[t.groupIndex]=e[t.groupIndex]||[],-1==v.call(e[t.groupIndex],t)){e[t.groupIndex].push(t);for(var n=0,r=t.normalizedDeps.length;r>n;n++){var i=t.normalizedDeps[n],s=m[i];if(s&&!s.evaluated){var a=t.groupIndex+(s.declarative!=t.declarative);if(void 0===s.groupIndex||s.groupIndex<a){if(void 0!==s.groupIndex&&(e[s.groupIndex].splice(v.call(e[s.groupIndex],s),1),0==e[s.groupIndex].length))throw new TypeError("Mixed dependency cycle detected");s.groupIndex=a}o(s,e)}}}}function i(t){var e=m[t];e.groupIndex=0;var n=[];o(e,n);for(var r=!!e.declarative==n.length%2,i=n.length-1;i>=0;i--){for(var s=n[i],c=0;c<s.length;c++){var p=s[c];r?a(p):l(p)}r=!r}}function s(t){return w[t]||(w[t]={name:t,dependencies:[],exports:{},importers:[]})}function a(e){if(!e.module){var n=e.module=s(e.name),r=e.module.exports,o=e.declare.call(t,function(t,e){if(n.locked=!0,"object"==typeof t)for(var o in t)r[o]=t[o];else r[t]=e;for(var i=0,s=n.importers.length;s>i;i++){var a=n.importers[i];if(!a.locked)for(var c=0;c<a.dependencies.length;++c)a.dependencies[c]===n&&a.setters[c](r)}return n.locked=!1,e},e.name);n.setters=o.setters,n.execute=o.execute;for(var i=0,c=e.normalizedDeps.length;c>i;i++){var l,p=e.normalizedDeps[i],u=m[p],f=w[p];f?l=f.exports:u&&!u.declarative?l=u.esModule:u?(a(u),f=u.module,l=f.exports):l=d(p),f&&f.importers?(f.importers.push(n),n.dependencies.push(f)):n.dependencies.push(null),n.setters[i]&&n.setters[i](l)}}}function c(t){var e,n=m[t];if(n)n.declarative?h(t,[]):n.evaluated||l(n),e=n.module.exports;else if(!(e=d(t)))throw new Error("Unable to load dependency "+t+".");return(!n||n.declarative)&&e&&e.__useDefault?e["default"]:e}function l(e){if(!e.module){var n={},r=e.module={exports:n,id:e.name};if(!e.executingRequire)for(var o=0,i=e.normalizedDeps.length;i>o;o++){var s=e.normalizedDeps[o],a=m[s];a&&l(a)}e.evaluated=!0;var u=e.execute.call(t,function(t){for(var n=0,r=e.deps.length;r>n;n++)if(e.deps[n]==t)return c(e.normalizedDeps[n]);throw new TypeError("Module "+t+" not declared as a dependency.")},n,r);u&&(r.exports=u),n=r.exports,n&&n.__esModule?e.esModule=n:e.esModule=p(n)}}function p(t){var e={};if("object"==typeof t||"function"==typeof t){var n=t&&t.hasOwnProperty;if(g)for(var r in t)f(e,t,r)||u(e,t,r,n);else for(var r in t)u(e,t,r,n)}return e["default"]=t,y(e,"__useDefault",{value:!0}),e}function u(t,e,n,r){(!r||e.hasOwnProperty(n))&&(t[n]=e[n])}function f(t,e,n){try{var r;return(r=Object.getOwnPropertyDescriptor(e,n))&&y(t,n,r),!0}catch(t){return!1}}function h(e,n){var r=m[e];if(r&&!r.evaluated&&r.declarative){n.push(e);for(var o=0,i=r.normalizedDeps.length;i>o;o++){var s=r.normalizedDeps[o];-1==v.call(n,s)&&(m[s]?h(s,n):d(s))}r.evaluated||(r.evaluated=!0,r.module.execute.call(t))}}function d(t){if(b[t])return b[t];if("@node/"==t.substr(0,6))return x(t.substr(6));var e=m[t];if(!e)throw"Module "+t+" not present.";return i(t),h(t,[]),m[t]=void 0,e.declarative&&y(e.module.exports,"__esModule",{value:!0}),b[t]=e.declarative?e.module.exports:e.esModule}var m={},v=Array.prototype.indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(this[e]===t)return e;return-1},g=!0;try{Object.getOwnPropertyDescriptor({a:0},"a")}catch(t){g=!1}var y;!function(){try{Object.defineProperty({},"a",{})&&(y=Object.defineProperty)}catch(t){y=function(t,e,n){try{t[e]=n.value||n.get.call(t)}catch(t){}}}}();var w={},x="undefined"!=typeof System&&System._nodeRequire||"undefined"!=typeof require&&require.resolve&&"undefined"!=typeof process&&require,b={"@empty":{}};return function(t,r,o){return function(i){i(function(){for(var i={_nodeRequire:x,register:e,registerDynamic:n,get:d,set:function(t,e){b[t]=e},newModule:function(t){return t}},s=0;s<r.length;s++)!function(t,e){e&&e.__esModule?b[t]=e:b[t]=p(e)}(r[s],arguments[s]);o(i);var a=d(t[0]);if(t.length>1)for(var s=1;s<t.length;s++)d(t[s]);return a.__useDefault?a["default"]:a})}}}("undefined"!=typeof self?self:global)(["1"],[],function(t){this.require,this.exports,this.module;t.registerDynamic("2",["3"],!0,function(t,e,n){var r=t("3"),o=r.Schema,i={doc:{content:"block+"},paragraph:{content:"inline<_>*",group:"block",parseDOM:[{tag:"p"}],toDOM:function(){return["p",0]}},blockquote:{content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:function(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:function(){return["hr"]}},heading:{attrs:{level:{"default":1}},content:"inline<_>*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM:function(t){return["h"+t.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,parseDOM:[{tag:"pre",preserveWhitespace:!0}],toDOM:function(){return["pre",["code",0]]}},text:{group:"inline",toDOM:function(t){return t.text}},image:{inline:!0,attrs:{src:{},alt:{"default":null},title:{"default":null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs:function(t){return{src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")}}}],toDOM:function(t){return["img",t.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:function(){return["br"]}}};e.nodes=i;var s={em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style",getAttrs:function(t){return"italic"==t&&null}}],toDOM:function(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:function(t){return"normal"!=t.style.fontWeight&&null}},{style:"font-weight",getAttrs:function(t){return/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}}],toDOM:function(){return["strong"]}},link:{attrs:{href:{},title:{"default":null}},parseDOM:[{tag:"a[href]",getAttrs:function(t){return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM:function(t){return["a",t.attrs]}},code:{parseDOM:[{tag:"code"}],toDOM:function(){return["code"]}}};e.marks=s;var a=new o({nodes:i,marks:s});return e.schema=a,n.exports}),t.registerDynamic("4",["2"],!0,function(t,e,n){return n.exports=t("2"),n.exports}),t.registerDynamic("5",["6"],!0,function(t,e,n){var r=t("6"),o=r.InputRule,i=new o(/--$/,"\u2014");e.emDash=i;var s=new o(/\.\.\.$/,"\u2026");e.ellipsis=s;var a=new o(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"\u201c");e.openDoubleQuote=a;var c=new o(/"$/,"\u201d");e.closeDoubleQuote=c;var l=new o(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"\u2018");e.openSingleQuote=l;var p=new o(/'$/,"\u2019");e.closeSingleQuote=p;var u=[a,c,l,p];e.smartQuotes=u;var f=[i,s].concat(u);return e.allInputRules=f,n.exports}),t.registerDynamic("6",["7"],!0,function(t,e,n){function r(t){return function(e,n,r,o){var i=t;if(n[1]){var s=n[0].lastIndexOf(n[1]);i+=n[0].slice(s+n[1].length),r+=s;var a=r-o;a>0&&(i=n[0].slice(s-a,s)+i,r=o)}var c=e.doc.resolve(r).marks();return e.tr.replaceWith(r,o,e.schema.text(i,c))}}function o(t){var e=t.rules;return new a({state:{init:function(){return null},apply:function(t,e){var n=t.getMeta(u);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:function(t,n,r,o){for(var i=t.state,s=i.doc.resolve(n),a=s.parent.textBetween(Math.max(0,s.parentOffset-p),s.parentOffset,null,"\ufffc")+o,c=0;c<e.length;c++){var l=e[c].match.exec(a),f=l&&e[c].handler(i,l,n-(l[0].length-o.length),r);if(f)return t.dispatch(f.setMeta(u,{transform:f,from:n,to:r,text:o})),!0}return!1},handleKeyDown:function(t,e){return 8==e.keyCode&&i(t.state,t.dispatch,this.getState(t.state))}}})}function i(t,e,n){if(!n)return!1;for(var r=t.tr,o=n.transform,i=o.steps.length-1;i>=0;i--)r.step(o.steps[i].invert(o.docs[i]));var s=r.doc.resolve(n.from).marks();return e(r.replaceWith(n.from,n.to,t.schema.text(n.text,s))),!0}var s=t("7"),a=s.Plugin,c=s.PluginKey,l=function(t,e){this.match=t,this.handler="string"==typeof e?r(e):e};e.InputRule=l;var p=500,u=new c("fromInputRule");return e.inputRules=o,n.exports}),t.registerDynamic("8",["6","9"],!0,function(t,e,n){function r(t,e,n,r){return new u(t,function(t,o,i,s){var a=n instanceof Function?n(o):n,c=t.tr["delete"](i,s),l=c.doc.resolve(i),p=l.blockRange(),u=p&&h(p,e,a);if(!u)return null;c.wrap(p,u);var f=c.doc.resolve(i-1).nodeBefore;return f&&f.type==e&&d(c.doc,i-1)&&(!r||r(o,f))&&c.join(i-1),c})}function o(t,e,n){return new u(t,function(t,r,o,i){var s=t.doc.resolve(o),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),e,a)?t.tr["delete"](o,i).setBlockType(o,o,e,a):null})}function i(t){return r(/^\s*> $/,t)}function s(t){return r(/^(\d+)\. $/,t,function(t){return{order:+t[1]}},function(t,e){return e.childCount+e.attrs.order==+t[1]})}function a(t){return r(/^\s*([-+*]) $/,t)}function c(t){return o(/^```$/,t)}function l(t,e){return o(new RegExp("^(#{1,"+e+"}) $"),t,function(t){return{level:t[1].length}})}var p=t("6"),u=p.InputRule,f=t("9"),h=f.findWrapping,d=f.canJoin;return e.wrappingInputRule=r,e.textblockTypeInputRule=o,e.blockQuoteRule=i,e.orderedListRule=s,e.bulletListRule=a,e.codeBlockRule=c,e.headingRule=l,n.exports}),t.registerDynamic("a",["6","5","8"],!0,function(t,e,n){var r;r=t("6"),e.InputRule=r.InputRule,e.inputRules=r.inputRules;var o;o=t("5"),e.emDash=o.emDash,e.ellipsis=o.ellipsis,e.openDoubleQuote=o.openDoubleQuote,e.closeDoubleQuote=o.closeDoubleQuote,e.openSingleQuote=o.openSingleQuote,e.closeSingleQuote=o.closeSingleQuote,e.smartQuotes=o.smartQuotes,e.allInputRules=o.allInputRules;var i;return i=t("8"),e.wrappingInputRule=i.wrappingInputRule,e.textblockTypeInputRule=i.textblockTypeInputRule,e.blockQuoteRule=i.blockQuoteRule,e.orderedListRule=i.orderedListRule,e.bulletListRule=i.bulletListRule,e.codeBlockRule=i.codeBlockRule,e.headingRule=i.headingRule,n.exports}),t.registerDynamic("b",["a"],!0,function(t,e,n){return n.exports=t("a"),n.exports}),t.registerDynamic("c",[],!0,function(t,e,n){function r(t){var e=(!a||!t.ctrlKey&&!t.altKey&&!t.metaKey)&&t.key||(t.shiftKey?i:o)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}for(var o={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},i={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:";",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},s="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),a=s&&+s[1]<57,c=0;c<10;c++)o[48+c]=o[96+c]=String(c);for(var c=1;c<=24;c++)o[c+111]="F"+c;for(var c=65;c<=90;c++)o[c]=String.fromCharCode(c+32),i[c]=String.fromCharCode(c);for(var l in o)i.hasOwnProperty(l)||(i[l]=o[l]);return n.exports=r,r.base=o,r.shift=i,n.exports}),t.registerDynamic("d",["c"],!0,function(t,e,n){return n.exports=t("c"),n.exports}),t.registerDynamic("e",["d","7"],!0,function(t,e,n){function r(t){var e=t.split(/-(?!$)/),n=e[e.length-1];"Space"==n&&(n=" ");for(var r,o,i,s,a=0;a<e.length-1;a++){var c=e[a];if(/^(cmd|meta|m)$/i.test(c))s=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))i=!0;else{if(!/^mod$/i.test(c))throw new Error("Unrecognized modifier name: "+c);p?s=!0:o=!0}}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),s&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function o(t){var e=Object.create(null);for(var n in t)e[r(n)]=t[n];return e}function i(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==n&&e.shiftKey&&(t="Shift-"+t),t}function s(t){var e=o(t);return new l({props:{handleKeyDown:function(t,n){var r,o=a(n),s=1==o.length&&" "!=o,c=e[i(o,n,!s)];if(c&&c(t.state,t.dispatch,t))return!0;if(n.shiftKey&&s&&(r=a.base[n.keyCode])){var l=e[i(r,n,!0)];if(l&&l(t.state,t.dispatch,t))return!0}return!1}}})}var a=t("d"),c=t("7"),l=c.Plugin,p="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);return e.keymap=s,n.exports}),t.registerDynamic("f",["e"],!0,function(t,e,n){return n.exports=t("e"),n.exports}),t.registerDynamic("10",["7","11"],!0,function(t,e,n){function r(t){function e(t,e){t.dispatch(t.state.tr.setMeta(o,e))}function n(t){clearTimeout(r),r=setTimeout(function(){o.getState(t.state)&&e(t,{type:"remove"})},1e3)}var r=null,o=new a({state:{init:function(){return null},apply:function(e,n,r){if(u&&f)return null;var s=e.getMeta(o);return s?"set"==s.type?i(r,s.pos,t):null:n}},props:{handleDOMEvents:{dragover:function(t,r){var i=o.getState(t.state),s=t.posAtCoords({left:r.clientX,top:r.clientY});return!s||i&&i.pos==s.pos||e(t,{type:"set",pos:s.pos}),n(t),!1},dragend:function(t){return o.getState(t.state)&&e(t,{type:"remove"}),!1},drop:function(t){return o.getState(t.state)&&e(t,{type:"remove"}),!1},dragleave:function(t,n){return n.target==t.content&&e(t,{type:"remove"}),!1}},decorations:function(t){var e=o.getState(t);return e&&e.deco}}});return o}function o(t,e){var n=t&&t.width||1;return"border-"+e+": "+n+"px solid "+(t&&t.color||"black")+"; margin-"+e+": -"+n+"px"}function i(t,e,n){var r,i=t.doc.resolve(e);if(!i.parent.isTextblock){var s,a;(s=i.nodeBefore)?r=l.node(e-s.nodeSize,e,{nodeName:"div",style:o(n,"right")}):(a=i.nodeAfter)&&(r=l.node(e,e+a.nodeSize,{nodeName:"div",style:o(n,"left")}))}if(!r){var c=document.createElement("span");c.textContent="\u200b",c.style.cssText=o(n,"left")+"; display: inline-block; pointer-events: none",r=l.widget(e,c)}return{pos:e,deco:p.create(t.doc,[r])}}var s=t("7"),a=s.Plugin,c=t("11"),l=c.Decoration,p=c.DecorationSet,u="undefined"!=typeof navigator&&/gecko\/\d/i.test(navigator.userAgent),f="undefined"!=typeof navigator&&/linux/i.test(navigator.platform);return e.dropCursor=r,n.exports}),t.registerDynamic("12",["10"],!0,function(t,e,n){return n.exports=t("10"),n.exports}),t.registerDynamic("13",[],!0,function(t,e,n){function r(){return{left:0,right:window.innerWidth,top:0,bottom:window.innerHeight}}function o(t){var e=t.parentNode;return 11==e.nodeType?e.host:e}function i(t,e){var n=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin");null==i&&(i=5);for(var s=t.content;;s=o(s)){var a=s==document.body,c=a?r():s.getBoundingClientRect(),l=0,p=0;if(e.top<c.top+n?p=-(c.top-e.top+i):e.bottom>c.bottom-n&&(p=e.bottom-c.bottom+i),e.left<c.left+n?l=-(c.left-e.left+i):e.right>c.right-n&&(l=e.right-c.right+i),(l||p)&&(a?window.scrollBy(l,p):(p&&(s.scrollTop+=p),l&&(s.scrollLeft+=l))),a)break}}function s(t){for(var e,n,r=t.content.getBoundingClientRect(),i=Math.max(0,r.top),s=(r.left+r.right)/2,a=i+1;a<Math.min(innerHeight,r.bottom);a+=5){var c=t.root.elementFromPoint(s,a);if(c!=t.content&&t.content.contains(c)){var l=c.getBoundingClientRect();if(l.top>=i-20){e=c,n=l.top;break}}}for(var p=[],u=t.content;u&&(p.push({dom:u,top:u.scrollTop,left:u.scrollLeft}),u!=document.body);u=o(u));return{refDOM:e,refTop:n,stack:p}}function a(t){for(var e=t.refDOM,n=t.refTop,r=t.stack,o=e?e.getBoundingClientRect().top:0,i=0==o?0:o-n,s=0;s<r.length;s++){var a=r[s],c=a.dom,l=a.top,p=a.left;c.scrollTop!=l+i&&(c.scrollTop=l+i),c.scrollLeft!=p&&(c.scrollLeft=p)}}function c(t,e){for(var n,r,o=2e8,i=0,s=e.top,a=e.top,p=t.firstChild,u=0;p;p=p.nextSibling,u++){var h=void 0;if(1==p.nodeType)h=p.getClientRects();else{if(3!=p.nodeType)continue;h=f(p).getClientRects()}for(var d=0;d<h.length;d++){var m=h[d];if(m.top<=s&&m.bottom>=a){s=Math.max(m.bottom,s),a=Math.min(m.top,a);var v=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(v<o){n=p,o=v,r=v&&3==n.nodeType?{left:m.right<e.left?m.right:m.left,top:e.top}:e,1==p.nodeType&&v&&(i=u+(e.left>=(m.left+m.right)/2?1:0));continue}}!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(i=u+1)}}return n&&3==n.nodeType?l(n,r):!n||o&&1==n.nodeType?{node:t,offset:i}:c(n,r)}function l(t,e){for(var n=t.nodeValue.length,r=document.createRange(),o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);var i=h(r,1);if(i.top!=i.bottom&&(i.left-1<=e.left&&i.right+1>=e.left&&i.top-1<=e.top&&i.bottom+1>=e.top))return{node:t,offset:o+(e.left>=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}function p(t,e){if(/^[uo]l$/i.test(t.nodeName))for(var n=t.firstChild;n;n=n.nextSibling)if(n.pmViewDesc&&/^li$/i.test(n.nodeName)){var r=n.getBoundingClientRect();if(e.left>r.left-2)break;if(r.top<=e.top&&r.bottom>=e.top)return n}return t}function u(t,e){var n=p(t.root.elementFromPoint(e.left,e.top+1),e);if(!t.content.contains(3==n.nodeType?n.parentNode:n))return null;var r=c(n,e),o=r.node,i=r.offset,s=-1;if(1==o.nodeType&&!o.firstChild){var a=o.getBoundingClientRect();s=a.left!=a.right&&e.left>(a.left+a.right)/2?1:-1}var l=t.docView.nearestDesc(n,!0);return{pos:t.docView.posFromDOM(o,i,s),inside:l&&l.posAtStart-l.border}}function f(t,e,n){var r=document.createRange();return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r}function h(t,e){var n=t.getClientRects();return n.length?n[e<0?0:n.length-1]:t.getBoundingClientRect()}function d(t,e){var n,r,o=t.docView.domFromPos(e),i=o.node,s=o.offset;if(3==i.nodeType)s<i.nodeValue.length&&(r=h(f(i,s,s+1),-1),n="left"),r&&r.left!=r.right||!s||(r=h(f(i,s-1,s),1),n="right");else if(i.firstChild){if(s<i.childNodes.length){var a=i.childNodes[s];r=h(3==a.nodeType?f(a):a,-1),n="left"}if((!r||r.top==r.bottom)&&s){var c=i.childNodes[s-1];r=h(3==c.nodeType?f(c):c,1),n="right"}}else r=i.getBoundingClientRect(),n="left";var l=r[n];return{top:r.top,bottom:r.bottom,left:l,right:l}}function m(t,e,n){var r=t.state,o=t.root.activeElement;r==e&&t.inDOMChange||t.updateState(e),o!=t.content&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.content&&o.focus()}}function v(t,e,n){var r="up"==n?e.selection.$from:e.selection.$to;return!!r.depth&&m(t,e,function(){for(var e=t.docView.domAfterPos(r.before()),o=d(t,r.pos),i=e.firstChild;i;i=i.nextSibling){var s=void 0;if(1==i.nodeType)s=i.getClientRects();else{if(3!=i.nodeType)continue;s=f(i,0,i.nodeValue.length).getClientRects()}for(var a=0;a<s.length;a++){var c=s[a];if("up"==n?c.bottom<o.top+1:c.top>o.bottom-1)return!1}}return!0})}function g(t,e,n){var r=e.selection,o=r.$head;if(!r.empty||!o.parent.isTextblock||!o.depth)return!1;var i=o.parentOffset,s=!i,a=i==o.parent.content.size;if(!s&&!a&&!w.test(o.parent.textContent))return!1;var c=getSelection();return c.modify?m(t,e,function(){var e=c.getRangeAt(0);c.modify("move",n,"character");var r=t.docView.domAfterPos(o.before()),i=!r.contains(1==c.focusNode.nodeType?c.focusNode:c.focusNode.parentNode)||t.docView.posFromDOM(c.focusNode,c.focusOffset)==o.pos;return c.removeAllRanges(),c.addRange(e),i}):"left"==n||"backward"==n?s:a}function y(t,e,n){return x==e&&b==n?k:(x=e,b=n,k="up"==n||"down"==n?v(t,e,n):g(t,e,n))}e.scrollRectIntoView=i,e.storeScrollPos=s,e.resetScrollPos=a,e.posAtCoords=u,e.coordsAtPos=d;var w=/[\u0590-\u08ac]/,x=null,b=null,k=!1;return e.endOfTextblock=y,n.exports}),t.registerDynamic("14",["3","15"],!0,function(t,e,n){function r(t,e,n,r,o){return c(r,e,t,!0),new D(null,t,e,n,r,r,r,o)}function o(t,e){for(var n=t.firstChild,r=0;r<e.length;r++){var i=e[r],s=i.dom;if(s.parentNode==t){for(;s!=n;)n=p(n);n=n.nextSibling}else t.insertBefore(s,n);i instanceof C&&o(i.contentDOM,i.children)}for(;n;)n=p(n)}function i(t,e,n){if(0==t.length)return E;for(var r=n?E[0]:new N,o=[r],i=0;i<t.length;i++){var s=t[i].type.attrs,a=r;if(s){s.nodeName&&o.push(a=new N(s.nodeName));for(var c in s){var l=s[c];null!=l&&(n&&1==o.length&&o.push(a=r=new N(e.isInline?"span":"div")),"class"==c?a["class"]=(a["class"]?a["class"]+" ":"")+l:"style"==c?a.style=(a.style?a.style+";":"")+l:"nodeName"!=c&&(a[c]=l))}}}return o}function s(t,e,n,r){if(n==E&&r==E)return e;for(var o=e,i=0;i<r.length;i++){var s=r[i],c=n[i];if(i){var l=void 0;c&&c.nodeName==s.nodeName&&o!=t&&(l=e.parentNode)&&l.tagName.toLowerCase()==s.nodeName?o=l:(l=document.createElement(s.nodeName),l.appendChild(o),o=l)}a(o,c||E[0],s)}return o}function a(t,e,n){for(var r in e)"class"==r||"style"==r||"nodeName"==r||r in n||t.removeAttribute(r);for(var o in n)"class"!=o&&"style"!=o&&"nodeName"!=o&&n[o]!=e[o]&&t.setAttribute(o,n[o]);if(e["class"]!=n["class"]){for(var i=e["class"]?e["class"].split(" "):S,s=n["class"]?n["class"].split(" "):S,a=0;a<i.length;a++)-1==s.indexOf(i[a])&&t.classList.remove(i[a]);for(var c=0;c<s.length;c++)-1==i.indexOf(s[c])&&t.classList.add(s[c])}if(e.style!=n.style){var l,p=t.style.cssText;e.style&&(l=p.indexOf(e.style))>-1&&(p=p.slice(0,l)+p.slice(l+e.style.length)),t.style.cssText=p+(n.style||"")}}function c(t,e,n){return s(t,t,E,i(e,n,1!=t.nodeType))}function l(t,e){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function p(t){var e=t.nextSibling;return t.parentNode.removeChild(t),e}function u(t,e,n,r){var o=e.locals(t),i=0;if(0!=o.length)for(var s=0,a=[],c=null,l=0;;){for(;s<o.length&&o[s].to==i;)n(o[s++]);var p=void 0;if(c)p=c,c=null;else{if(!(l<t.childCount))break;p=t.child(l++)}for(var u=0;u<a.length;u++)a[u].to<=i&&a.splice(u--,1);for(;s<o.length&&o[s].from==i;)a.push(o[s++]);var f=i+p.nodeSize;if(p.isText){var h=f;s<o.length&&o[s].from<h&&(h=o[s].from);for(var d=0;d<a.length;d++)a[d].to<h&&(h=a[d].to);h<f&&(c=p.cut(h-i),p=p.cut(0,h-i),f=h)}r(p,a.length?a.slice():S,e.forChild(i,p),l-1),i=f}else for(var m=0;m<t.childCount;m++){var v=t.child(m);r(v,o,e.forChild(i,v),m),i+=v.nodeSize}}function f(t){return z==t.props?I:(z=t.props,I=h(t))}function h(t){var e={};return t.someProp("nodeViews",function(t){for(var n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])}),e}function d(t){if("UL"==t.nodeName||"OL"==t.nodeName){var e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}var m=t("3"),v=m.DOMSerializer,g=t("15"),y=0,w=2,x=3,b=function(t,e,n,r){this.parent=t,this.children=e,this.dom=n,n.pmViewDesc=this,this.contentDOM=r,this.dirty=y},k={size:{},border:{},posAtStart:{},posAtEnd:{},contentLost:{}};b.prototype.matchesWidget=function(){return!1},b.prototype.matchesMark=function(){return!1},b.prototype.matchesNode=function(){return!1},b.prototype.matchesHack=function(){return!1},b.prototype.parseRule=function(){return null},b.prototype.stopEvent=function(){return!1},k.size.get=function(){for(var t=this,e=0,n=0;n<this.children.length;n++)e+=t.children[n].size;return e},k.border.get=function(){return 0},b.prototype.destroy=function(){var t=this;this.parent=null,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=null);for(var e=0;e<this.children.length;e++)t.children[e].destroy()},b.prototype.posBeforeChild=function(t){for(var e=this,n=0,r=this.posAtStart;n<this.children.length;n++){var o=e.children[n];if(o==t)return r;r+=o.size}},k.posAtStart.get=function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0},k.posAtEnd.get=function(){return this.posAtStart+this.size-2*this.border},b.prototype.localPosFromDOM=function(t,e,n){var r=this;if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(n<0){var o,i;if(t==this.contentDOM)o=t.childNodes[e-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.previousSibling}for(;o&&(!(i=o.pmViewDesc)||i.parent!=this);)o=o.previousSibling;return o?this.posBeforeChild(i)+i.size:this.posAtStart}var s,a;if(t==this.contentDOM)s=t.childNodes[e];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;s=t.nextSibling}for(;s&&(!(a=s.pmViewDesc)||a.parent!=this);)s=s.nextSibling;return s?this.posBeforeChild(a):this.posAtEnd}var c;if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))c=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(var l=t;;l=l.parentNode){if(l==r.dom){c=!1;break}if(l.parentNode.firstChild!=l)break}if(null==c&&e==t.childNodes.length)for(var p=t;;p=p.parentNode){if(p==r.dom){c=!0;break}if(p.parentNode.lastChild!=p)break}}return(null==c?n>0:c)?this.posAtEnd:this.posAtStart},b.prototype.nearestDesc=function(t,e){for(var n=this,r=!0,o=t;o;o=o.parentNode){var i=n.getDesc(o);if(i&&(!e||i.node)){if(!r||!i.nodeDOM||1==i.nodeDOM.nodeType&&i.nodeDOM.contains(t))return i;r=!1}}},b.prototype.getDesc=function(t){for(var e=this,n=t.pmViewDesc,r=n;r;r=r.parent)if(r==e)return n},b.prototype.posFromDOM=function(t,e,n){for(var r=this,o=t;;o=o.parentNode){var i=r.getDesc(o);if(i)return i.localPosFromDOM(t,e,n)}},b.prototype.descAt=function(t){for(var e=this,n=0,r=0;n<this.children.length;n++){var o=e.children[n],i=r+o.size;if(r==t&&i!=r){for(;!o.border&&o.children.length;)o=o.children[0];return o}if(t<i)return o.descAt(t-r-o.border);r=i}},b.prototype.domFromPos=function(t,e){var n=this;if(!this.contentDOM)return{node:this.dom,offset:0};for(var r=0,o=0;;o++){if(r==t)return{node:n.contentDOM,offset:e?n.findDOMOffset(o,e):o};if(o==n.children.length)throw new Error("Invalid position "+t);var i=n.children[o],s=r+i.size;if(t<s)return i.domFromPos(t-r-i.border,e);r=s}},b.prototype.findDOMOffset=function(t,e){var n=this,r=this.contentDOM;if(e<0){for(var o=t-1;o>=0;o--){var i=n.children[o];if(i.size){var s=Array.prototype.indexOf.call(r.childNodes,i.dom);if(s>-1)return s+1}}return 0}for(var a=t;a<this.children.length;a++){var c=n.children[a];if(c.size){var l=Array.prototype.indexOf.call(r.childNodes,c.dom);if(l>-1)return l}}return r.childNodes.length},b.prototype.domAfterPos=function(t){var e=this.domFromPos(t),n=e.node,r=e.offset;if(1!=n.nodeType||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]},b.prototype.setSelection=function(t,e,n){for(var r=this,o=Math.min(t,e),i=Math.max(t,e),s=0,a=0;s<this.children.length;s++){var c=r.children[s],l=a+c.size;if(o>a&&i<l)return c.setSelection(t-a-c.border,e-a-c.border,n);a=l}var p=this.domFromPos(t),u=this.domFromPos(e),f=n.getSelection(),h=document.createRange();if(f.extend)h.setEnd(p.node,p.offset),h.collapse(!1);else{if(t>e){var d=p;p=u,u=d}h.setEnd(u.node,u.offset),h.setStart(p.node,p.offset)}f.removeAllRanges(),f.addRange(h),f.extend&&f.extend(u.node,u.offset)},b.prototype.ignoreMutation=function(){return!this.contentDOM},k.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},b.prototype.markDirty=function(t,e){for(var n=this,r=0,o=0;o<this.children.length;o++){var i=n.children[o],s=r+i.size;if(r==s?t<=s&&e>=r:t<s&&e>r){var a=r+i.border,c=s-i.border;if(t>=a&&e<=c)return n.dirty=t==r||e==s?w:1,void(t==a&&e==c&&i.contentLost?i.dirty=x:i.markDirty(t-a,e-a));i.dirty=x}r=s}this.dirty=w},Object.defineProperties(b.prototype,k);var S=[],M=function(t){function e(e,n){t.call(this,e,S,n.type.widget,null),this.widget=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.matchesWidget=function(t){return this.dirty==y&&t.type.eq(this.widget.type)},e.prototype.parseRule=function(){return{ignore:!0}},e.prototype.stopEvent=function(t){var e=this.widget.type.options.stopEvent;return!!e&&e(t)},e}(b),C=function(t){function e(e,n,r){t.call(this,e,[],r,r),this.mark=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t,n,r){var o=f(r)[n.type.name],i=o&&o(n,r);return new e(t,n,i&&i.dom||v.renderSpec(document,n.type.spec.toDOM(n)).dom)},e.prototype.parseRule=function(){return{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}},e.prototype.matchesMark=function(t){return this.dirty!=x&&this.mark.eq(t)},e}(b),D=function(t){function e(e,n,r,o,i,s,a,c){t.call(this,e,n.isLeaf?S:[],i,s),this.nodeDOM=a,this.node=n,this.outerDeco=r,this.innerDeco=o,s&&this.updateChildren(c)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={size:{},border:{}};return e.create=function(t,n,r,o,i){var s,a=f(i)[n.type.name],l=a&&a(n,i,function(){if(s&&s.parent)return s.parent.posBeforeChild(s)},r),p=l&&l.dom,u=l&&l.contentDOM;if(!p){var h;h=v.renderSpec(document,n.type.spec.toDOM(n)),p=h.dom,u=h.contentDOM}u||n.isText||(p.contentEditable=!1);var d=p;return p=c(p,r,n),l?s=new R(t,n,r,o,p,u,d,l,i):n.isText?new O(t,n,r,o,p,d,i):new e(t,n,r,o,p,u,d,i)},e.prototype.parseRule=function(){return{node:this.node.type.name,attrs:this.node.attrs,contentElement:this.contentLost?null:this.contentDOM}},e.prototype.matchesNode=function(t,e,n){return this.dirty==y&&t.eq(this.node)&&l(e,this.outerDeco)&&n.eq(this.innerDeco)},n.size.get=function(){return this.node.nodeSize},n.border.get=function(){return this.node.isLeaf?0:1},e.prototype.updateChildren=function(t){var e=this,n=new A(this);u(this.node,this.innerDeco,function(t){n.placeWidget(t)},function(r,o,i,s){n.syncToMarks(r.marks,t),n.findNodeMatch(r,o,i)||n.updateNextNode(r,o,i,t,e.node.content,s)||n.addNode(r,o,i,t)}),n.syncToMarks(S,t),this.node.isTextblock&&n.addTextblockHacks(),n.destroyRest(),(n.changed||this.dirty==w)&&this.renderChildren()},e.prototype.renderChildren=function(){o(this.contentDOM,this.children,e.is),g.ios&&d(this.dom)},e.prototype.update=function(t,e,n,r){return!(this.dirty==x||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),this.node=t,this.innerDeco=n,t.isLeaf||this.updateChildren(r),this.dirty=y,!0)},e.prototype.updateOuterDeco=function(t){if(!l(t,this.outerDeco)){var e=1!=this.nodeDOM.nodeType;this.dom=s(this.dom,this.nodeDOM,i(this.outerDeco,this.node,e),i(t,this.node,e)),this.outerDeco=t}},e.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode")},e.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode")},Object.defineProperties(e.prototype,n),e}(b);e.docViewDesc=r;var O=function(t){function e(e,n,r,o,i,s,a){t.call(this,e,n,r,o,i,null,s,a);for(var c=s;3!=c.nodeType;)if(!(c=c.firstChild))throw new RangeError("Text node rendered without text DOM");this.textDOM=c}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.parseRule=function(){return{skip:this.textDOM.parentNode}},e.prototype.update=function(t,e){return!(this.dirty==x||this.dirty!=y&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),this.dirty==y&&t.text==this.node.text||t.text==this.textDOM.nodeValue||(this.textDOM.nodeValue=t.text),this.node=t,this.dirty=y,!0)},e.prototype.inParent=function(){for(var t=this.parent.contentDOM,e=this.textDOM;e;e=e.parentNode)if(e==t)return!0;return!1},e.prototype.domFromPos=function(t,e){return{node:this.textDOM,offset:e?Math.max(t,this.textDOM.nodeValue.length):t}},e.prototype.localPosFromDOM=function(e,n,r){return e==this.textDOM?this.posAtStart+Math.min(n,this.node.text.length):t.prototype.localPosFromDOM.call(this,e,n,r)},e.prototype.ignoreMutation=function(t){return"characterData"!=t.type},e}(D),T=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.parseRule=function(){return{ignore:!0}},e.prototype.matchesHack=function(){return this.dirty==y},e}(b),R=function(t){function e(e,n,r,o,i,s,a,c,l){t.call(this,e,n,r,o,i,s,a,l),this.spec=c}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.update=function(e,n,r,o){if(this.dirty==x)return!1;if(this.spec.update){var i=this.spec.update(e,n);return i&&(this.node=e,this.contentDOM&&this.updateChildren(o)),i}return!(!this.contentDOM&&!e.isLeaf)&&t.prototype.update.call(this,e,n,this.contentDOM?this.innerDeco:r,o)},e.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():t.prototype.selectNode.call(this)},e.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():t.prototype.deselectNode.call(this)},e.prototype.setSelection=function(e,n,r){this.spec.setSelection?this.spec.setSelection(e,n,r):t.prototype.setSelection.call(this,e,n,r)},e.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),t.prototype.destroy.call(this)},e.prototype.stopEvent=function(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)},e.prototype.ignoreMutation=function(e){
116
+ return this.spec.ignoreMutation?this.spec.ignoreMutation(e):t.prototype.ignoreMutation.call(this,e)},e}(D),N=function(t){t&&(this.nodeName=t)};N.prototype=Object.create(null);var E=[new N],A=function(t){this.top=t,this.index=0,this.stack=[],this.changed=!1};A.prototype.destroyBetween=function(t,e){var n=this;if(t!=e){for(var r=t;r<e;r++)n.top.children[r].destroy();this.top.children.splice(t,e-t),this.changed=!0}},A.prototype.destroyRest=function(){this.destroyBetween(this.index,this.top.children.length)},A.prototype.syncToMarks=function(t,e){for(var n,r=this,o=0,i=this.stack.length>>1,s=Math.min(i,t.length);o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(t[o]);)o++;for(;o<i;)r.destroyRest(),r.top.dirty=y,r.index=r.stack.pop(),r.top=r.stack.pop(),i--;for(;i<t.length;){if(r.stack.push(r.top,r.index+1),r.index<r.top.children.length&&(n=r.top.children[r.index]).matchesMark(t[i]))r.top=n;else{var a=C.create(r.top,t[i],e);r.top.children.splice(r.index,0,a),r.top=a,r.changed=!0}r.index=0,i++}},A.prototype.findNodeMatch=function(t,e,n){for(var r=this,o=this.index,i=this.top.children,s=Math.min(i.length,o+5);o<s;o++)if(i[o].matchesNode(t,e,n))return r.destroyBetween(r.index,o),r.index++,!0;return!1},A.prototype.updateNextNode=function(t,e,n,r,o,i){if(this.index==this.top.children.length)return!1;var s=this.top.children[this.index];if(s instanceof D){for(var a=i+1,c=Math.min(o.childCount,a+5);a<c;a++)if(s.node==o.child(a))return!1;var l=s.dom;if(s.update(t,e,n,r))return s.dom!=l&&(this.changed=!0),this.index++,!0}return!1},A.prototype.addNode=function(t,e,n,r){this.top.children.splice(this.index++,0,D.create(this.top,t,e,n,r)),this.changed=!0},A.prototype.placeWidget=function(t){this.index<this.top.children.length&&this.top.children[this.index].matchesWidget(t)?this.index++:(this.top.children.splice(this.index++,0,new M(this.top,t)),this.changed=!0)},A.prototype.addTextblockHacks=function(){for(var t=this.top.children[this.index-1];t instanceof C;)t=t.children[t.children.length-1];if(!t||!(t instanceof O)||/\n$/.test(t.node.text))if(this.index<this.top.children.length&&this.top.children[this.index].matchesHack())this.index++;else{var e=document.createElement("br");this.top.children.splice(this.index++,0,new T(this.top,S,e,null)),this.changed=!0}};var I,z;return n.exports}),t.registerDynamic("15",[],!0,function(t,e,n){var r=n.exports={};if("undefined"!=typeof navigator){var o=/MSIE \d/.test(navigator.userAgent),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);r.mac=/Mac/.test(navigator.platform),r.ie=o||!!i,r.ie_version=o?document.documentMode||6:i&&+i[1],r.gecko=/gecko\/\d/i.test(navigator.userAgent),r.ios=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),r.webkit="WebkitAppearance"in document.documentElement.style}return n.exports}),t.registerDynamic("16",["7","15"],!0,function(t,e,n){function r(t,e){var n=t.selection,r=n.$from,o=n.$to,i=n.node,s=e>0?o:r,a=i&&i.isBlock?s:s.depth?t.doc.resolve(e>0?s.after():s.before()):null;return a&&g.findFrom(a,e)}function o(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function i(t,e){var n=t.state.selection,i=n.empty,s=n.node,a=n.$from,c=n.$to;if(!i&&!s)return!1;if(s&&s.isInline)return o(t,new w(e>0?c:a));if(!s&&!t.endOfTextblock(e>0?"right":"left")){var l=e>0?a.parent.childAfter(a.parentOffset):a.parent.childBefore(a.parentOffset),p=l.node,u=l.offset;return!(!p||!y.isSelectable(p)||u!=a.parentOffset-(e>0?0:p.nodeSize))&&o(t,new y(e<0?t.state.doc.resolve(a.pos-p.nodeSize):a))}var f=r(t.state,e);return!(!f||!(f instanceof y||s))&&o(t,f)}function s(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function a(t){var e=t.pmViewDesc;return e&&0==e.size}function c(t){for(var e,n,r=t.root.getSelection(),o=r.anchorNode,i=r.anchorOffset;;)if(i>0){if(1!=o.nodeType)break;var c=o.childNodes[i-1];if(!a(c))break;e=o,n=--i}else{if(p(o))break;for(var l=o.previousSibling;l&&a(l);)e=o.parentNode,n=Array.prototype.indexOf.call(e.childNodes,l),l=l.previousSibling;if(l)o=l,i=s(o);else{if((o=o.parentNode)==t.content)break;i=0}}e&&u(r,e,n)}function l(t){for(var e,n,r=t.root.getSelection(),o=r.anchorNode,i=r.anchorOffset,c=s(o);;)if(i<c){if(1!=o.nodeType)break;var l=o.childNodes[i];if(!a(l))break;e=o,n=++i}else{if(p(o))break;for(var f=o.nextSibling;f&&a(f);)e=f.parentNode,n=Array.prototype.indexOf.call(e.childNodes,f)+1,f=f.nextSibling;if(f)o=f,i=0,c=s(o);else{if((o=o.parentNode)==t.content)break;i=c=0}}e&&u(r,e,n)}function p(t){var e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function u(t,e,n){var r=document.createRange();r.setEnd(e,n),r.setStart(e,n),t.removeAllRanges(),t.addRange(r)}function f(t,e){var n=t.state.selection,i=n.empty,s=n.node,a=n.$from,c=n.$to;if(!i&&!s)return!1;var l=!0,p=e<0?a:c;if(s&&!s.isInline||(l=t.endOfTextblock(e<0?"up":"down")),l){var u=r(t.state,e);if(u&&u instanceof y)return o(t,u)}if(!s||s.isInline)return!1;var f=g.findFrom(p,e);return!f||o(t,f)}function h(t,e){var n=t.state.selection,r=n.$head,o=n.$anchor,i=n.empty;if(!r||!r.sameParent(o)||!r.parent.isTextblock)return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;var s=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(s&&!s.isText){var a=t.state.tr;return e<0?a["delete"](r.pos-s.nodeSize,r.pos):a["delete"](r.pos,r.pos+s.nodeSize),t.dispatch(a),!0}return!1}function d(t){var e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function m(t,e){var n=e.keyCode,r=d(e);return 8==n?h(t,-1)||c(t):46==n?h(t,1)||l(t):13==n||27==n||(37==n?i(t,-1)||c(t):39==n?i(t,1)||l(t):38==n?f(t,-1):40==n?f(t,1):r==(x.mac?"m":"c")&&(66==n||73==n||89==n||90==n)||!!(x.mac&&(68==n||72==n)&&"c"==r||68==n&&"a"==r)&&(h(t,68==n?1:-1)||l(t)))}var v=t("7"),g=v.Selection,y=v.NodeSelection,w=v.TextSelection,x=t("15");return e.captureKeyDown=m,n.exports}),t.registerDynamic("17",["3","7","18"],!0,function(t,e,n){function r(t,e,n,r){var i=t.docView.domFromPos(n,-1),s=i.node,a=i.offset,c=t.docView.domFromPos(r,1),l=c.node,p=c.offset;if(s!=l)return null;if(p==s.childNodes.length)for(var u=s;u!=t.content;){if(!u)return null;if(u.nextSibling){if(!u.nextSibling.pmViewDesc)return null;break}u=u.parentNode}var f=t.root.getSelection(),h=null,d=f.anchorNode;d&&t.content.contains(1==d.nodeType?d:d.parentNode)&&(h=[{node:d,offset:f.anchorOffset}],f.isCollapsed||h.push({node:f.focusNode,offset:f.focusOffset}));var m=e.doc,v=t.someProp("domParser")||g.fromSchema(t.state.schema),y=m.resolve(n),w=null,x=v.parse(s,{topNode:y.parent.copy(),topStart:y.index(),topOpen:!0,from:a,to:p,preserveWhitespace:!0,editableContent:!0,findPositions:h,ruleFromNode:o});if(h&&null!=h[0].pos){var b=h[0].pos,k=h[1]&&h[1].pos;null==k&&(k=b),w={anchor:b+n,head:k+n}}return{doc:x,sel:w}}function o(t){var e=t.pmViewDesc;return e?e.parseRule():"BR"==t.nodeName&&t.parentNode&&t.parentNode.lastChild==t?{ignore:!0}:void 0}function i(t,e){for(var n=e||0;n<t.depth;n++)if(t.index(n)+1<t.node(n).childCount)return!1;return t.parentOffset==t.parent.content.size}function s(t,e){for(var n=e||0;n<t.depth;n++)if(t.index(0)>0)return!1;return 0==t.parentOffset}function a(t){var e=t.$from,n=t.$to;if(e.sameParent(n)&&e.parent.isTextblock&&e.parentOffset&&n.parentOffset<n.parent.content.size){var r=Math.max(0,e.parentOffset),o=e.parent.content.size,a=Math.min(o,n.parentOffset);if(r>0&&(r=e.parent.childBefore(r).offset),a<o){var c=e.parent.childAfter(a);a=c.offset+c.node.nodeSize}var l=e.start();return{from:l+r,to:l+a}}for(var p=0;;p++){var u=s(e,p+1),f=i(n,p+1);if(u||f||e.index(p)!=n.index(p)||n.node(p).isTextblock){var h=e.before(p+1),d=n.after(p+1);return u&&e.index(p)>0&&(h-=e.node(p).child(e.index(p)-1).nodeSize),f&&n.index(p)+1<n.node(p).childCount&&(d+=n.node(p).child(n.index(p)+1).nodeSize),{from:h,to:d}}}}function c(t,e){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function l(t,e,n,o){for(var i,s=n.doc;!(i=r(t,n,o.from,o.to));){var a=s.resolve(o.from),l=s.resolve(o.to);o={from:a.depth?a.before():0,to:l.depth?l.after():s.content.size}}var h=i.doc,m=i.sel,v=s.slice(o.from,o.to),g=d(v.content,h.content,o.from,n.selection.from);if(g){var y,x=h.resolveNoCache(g.start-o.from),b=h.resolveNoCache(g.endB-o.from);if(!(!x.sameParent(b)&&x.pos<h.content.size&&(y=w.findFrom(h.resolve(x.pos+1),1,!0))&&y.head==b.pos&&t.someProp("handleKeyDown",function(e){return e(t,c(13,"Enter"))})||n.selection.anchor>g.start&&f(s,g.start,g.endA,x,b)&&t.someProp("handleKeyDown",function(e){return e(t,c(8,"Backspace"))}))){var k,S,M,C,D=e.map(g.start),O=e.map(g.endA,-1);if(x.sameParent(b)&&x.parent.isTextblock)if(x.pos==b.pos){k=t.state.tr["delete"](D,O);var T=s.resolve(g.start);T.parentOffset<T.parent.content.size&&(S=T.marks(!0))}else if(g.endA==g.endB&&(C=s.resolve(g.start))&&(M=u(x.parent.content.cut(x.parentOffset,b.parentOffset),C.parent.content.cut(C.parentOffset,g.endA-C.start()))))k=t.state.tr,"add"==M.type?k.addMark(D,O,M.mark):k.removeMark(D,O,M.mark);else if(x.parent.child(x.index()).isText&&x.index()==b.index()-(b.textOffset?0:1)){var R=x.parent.textBetween(x.parentOffset,b.parentOffset);if(t.someProp("handleTextInput",function(e){return e(t,D,O,R)}))return;k=t.state.tr.insertText(R,D,O)}if(k||(k=t.state.tr.replace(D,O,h.slice(g.start-o.from,g.endB-o.from))),m){var N=p(k.doc,e,m);N&&k.setSelection(N)}S&&k.setStoredMarks(S),t.dispatch(k.scrollIntoView())}}else if(m){var E=p(t.state.doc,e,m);E&&!E.eq(t.state.selection)&&t.dispatch(t.state.tr.setSelection(E))}}function p(t,e,n){return Math.max(n.anchor,n.head)>t.content.size?null:w.between(t.resolve(e.map(n.anchor)),t.resolve(e.map(n.head)))}function u(t,e){for(var n,r,o,i=t.firstChild.marks,s=e.firstChild.marks,a=i,c=s,l=0;l<s.length;l++)a=s[l].removeFromSet(a);for(var p=0;p<i.length;p++)c=i[p].removeFromSet(c);if(1==a.length&&0==c.length)r=a[0],n="add",o=function(t){return t.mark(r.addToSet(t.marks))};else{if(0!=a.length||1!=c.length)return null;r=c[0],n="remove",o=function(t){return t.mark(r.removeFromSet(t.marks))}}for(var u=[],f=0;f<e.childCount;f++)u.push(o(e.child(f)));if(v.from(u).eq(t))return{mark:r,type:n}}function f(t,e,n,r,o){if(!r.parent.isTextblock||n-e<=o.pos-r.pos||h(r,!0,!1)<o.pos)return!1;var i=t.resolve(e);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;var s=t.resolve(h(i,!0,!0));return!(!s.parent.isTextblock||s.pos>n||h(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function h(t,e,n){for(var r=t.depth,o=e?t.end():t.pos;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n)for(var i=t.node(r).maybeChild(t.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function d(t,e,n,r){var o=t.findDiffStart(e,n);if(null==o)return null;var i=t.findDiffEnd(e,n+t.size,n+e.size),s=i.a,a=i.b;if(s<o&&t.size<e.size){o-=r<=o&&r>=s?o-r:0,a=o+(a-s),s=o}else if(a<o){var c=r<=o&&r>=a?o-r:0;o-=c,s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}var m=t("3"),v=m.Fragment,g=m.DOMParser,y=t("7"),w=y.Selection,x=t("18"),b=x.TrackMappings,k=function(t,e,n){var r=this;this.view=t,this.id=e,this.state=t.state,this.composing=n,this.from=this.to=null,this.timeout=n?null:setTimeout(function(){return r.finish()},20),this.mappings=new b(t.state)};return k.prototype.addRange=function(t,e){null==this.from?(this.from=t,this.to=e):(this.from=Math.min(t,this.from),this.to=Math.max(e,this.to))},k.prototype.changedRange=function(){if(null==this.from)return a(this.state.selection);var t=this.state.doc.resolve(Math.min(this.from,this.state.selection.from)),e=this.state.doc.resolve(this.to),n=t.sharedDepth(this.to);return{from:t.before(n+1),to:e.after(n+1)}},k.prototype.finish=function(t){if(clearTimeout(this.timeout),!this.composing||t){var e=this.changedRange();null==this.from?this.view.docView.markDirty(e.from,e.to):this.view.docView.markDirty(this.from,this.to);var n=this.mappings.getMapping(this.view.state);this.destroy(),n&&l(this.view,n,this.state,e),this.view.docView.dirty&&this.view.updateState(this.view.state)}},k.prototype.destroy=function(){this.mappings.destroy(),this.view.inDOMChange=null},k.prototype.compositionEnd=function(){var t=this;this.composing&&(this.composing=!1,this.timeout=setTimeout(function(){return t.finish()},50))},k.start=function(t,e){if(t.inDOMChange)e&&(clearTimeout(t.inDOMChange.timeout),t.inDOMChange.composing=!0);else{var n=Math.floor(4294967295*Math.random());t.inDOMChange=new k(t,n,e)}return t.inDOMChange},e.DOMChange=k,n.exports}),t.registerDynamic("19",["3"],!0,function(t,e,n){function r(t,e,n){var r,o=t.state.doc,i=o.slice(e.from,e.to,!e.node),s=i;if(!e.node){var a=Math.max(0,e.$from.sharedDepth(e.to)-1);r=u(s,a);for(var c=s.content,l=0;l<a;l++)c=c.firstChild.content;s=new d(c,s.openLeft-a,s.openRight-a)}var p=t.someProp("clipboardSerializer")||g.fromSchema(t.state.schema),f=p.serializeFragment(s.content),h=document.createElement("div");h.appendChild(f);var m=1==h.firstChild.nodeType&&h.firstChild;return m&&(e.node?m.setAttribute("data-pm-node-selection",!0):m.setAttribute("data-pm-context",r)),n.clearData(),n.setData("text/html",h.innerHTML),n.setData("text/plain",s.content.textBetween(0,s.content.size,"\n\n")),i}function o(t){return null!=y?y:(t.setData("text/html","<hr>"),y="<hr>"==t.getData("text/html"))}function i(t,e,n,r){var o=e.getData("text/plain"),i=e.getData("text/html");if(!i&&!o)return null;var a,c=r.parent.type.spec.code;if((n||c||!i)&&o){if(t.someProp("transformPastedText",function(t){return o=t(o)}),c)return new d(m.from(t.state.schema.text(o)),0,0);a=document.createElement("div"),o.split(/(?:\r\n?|\n)+/).forEach(function(t){a.appendChild(document.createElement("p")).textContent=t})}else t.someProp("transformPastedHTML",function(t){return i=t(i)}),a=p(i);var l,u=t.someProp("clipboardParser")||t.someProp("domParser")||v.fromSchema(t.state.schema),h=u.parseSlice(a,{preserveWhitespace:!0});return h=a.querySelector("[data-pm-node-selection]")?new d(h.content,0,0):(l=a.querySelector("[data-pm-context]"))?f(h,l.getAttribute("data-pm-context")):s(h,r)}function s(t,e){if(t.content.childCount<2)return t;for(var n=function(n){var r=e.node(n),o=r.contentMatchAt(e.index(n)),i=void 0,s=[];if(t.content.forEach(function(t){if(s){var e,n=o.findWrappingFor(t);if(!n)return s=null;if(e=s.length&&i.length&&c(n,i,t,s[s.length-1],0))s[s.length-1]=e;else{s.length&&(s[s.length-1]=l(s[s.length-1],i.length));var r=a(t,n);s.push(r),o=o.matchType(r.type,r.attrs),i=n}}}),s)return{v:d.maxOpen(m.from(s))}},r=e.depth;r>=0;r--){var o=n(r);if(o)return o.v}return t}function a(t,e,n){void 0===n&&(n=0);for(var r=e.length-1;r>=n;r--)t=e[r].type.create(e[r].attrs,m.from(t));return t}function c(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o].type==e[o].type){var i=c(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));var s=r.contentMatchAt(r.childCount);if(o==t.length-1?s.matchNode(n):s.matchType(t[o+1].type,t[o+1].attrs))return r.copy(r.content.append(m.from(a(n,t,o+1))))}}function l(t,e){if(0==e)return t;var n=t.content.replaceChild(t.childCount-1,l(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(m.empty,!0);return t.copy(n.append(r))}function p(t){var e=/(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));var n,r=x||(x=document.implementation.createHTMLDocument("title")),o=r.createElement("div"),i=/(?:<meta [^>]*>)*<([a-z][^>\s]+)/i.exec(t),s=0;if(n=i&&w[i[1].toLowerCase()]){var a=n.split(" ");t=a.map(function(t){return"<"+t+">"}).join("")+t+a.map(function(t){return"</"+t+">"}).reverse().join(""),s=a.length}o.innerHTML=t;for(var c=0;c<s;c++)o=o.firstChild;return o}function u(t,e){for(var n=[],r=t.content,o=0;o<e;o++){var i=r.firstChild;n.push(i.type.name,i.type.hasRequiredAttrs()?i.attrs:null),r=i.content}return JSON.stringify(n)}function f(t,e){if(!t.size)return t;var n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(e){return t}for(var o=t.content,i=t.openLeft,s=t.openRight,a=n.length-2;a>=0;a-=2){var c=r.nodes[n[a]];if(!c||c.hasRequiredAttrs())break;o=m.from(c.create(n[a+1],o)),i++,s++}return new d(o,i,s)}var h=t("3"),d=h.Slice,m=h.Fragment,v=h.DOMParser,g=h.DOMSerializer;e.toClipboard=r;var y=null;e.canUpdateClipboard=o,e.fromClipboard=i;var w={thead:"table",colgroup:"table",col:"table colgroup",tr:"table tbody",td:"table tbody tr",th:"table tbody tr"},x=null;return n.exports}),t.registerDynamic("18",["7","9"],!0,function(t,e,n){var r=t("7"),o=r.EditorState,i=t("9"),s=i.Mapping,a=function(t,e,n){this.prev=t,this.mapping=e,this.state=n},c=function(t){this.seen=[new a(null,null,t)],o.addApplyListener(this.track=this.track.bind(this))};return c.prototype.destroy=function(){o.removeApplyListener(this.track)},c.prototype.find=function(t){for(var e=this,n=this.seen.length-1;n>=0;n--){var r=e.seen[n];if(r.state==t)return r}},c.prototype.track=function(t,e,n){var r=this.seen.length<200?this.find(t):null;r&&this.seen.push(new a(r,e.docChanged?e.mapping:null,n))},c.prototype.getMapping=function(t){var e=this.find(t);if(!e)return null;for(var n=[],r=e;r;r=r.prev)r.mapping&&n.push(r.mapping);for(var o=new s,i=n.length-1;i>=0;i--)o.appendMapping(n[i]);return o},e.TrackMappings=c,n.exports}),t.registerDynamic("1a",["7","15","16","17","19","18"],!0,function(t,e,n){function r(t){t.shiftKey=!1,t.mouseDown=null,t.dragging=null,t.inDOMChange=null,t.mutationObserver=window.MutationObserver&&new window.MutationObserver(function(e){return S(t,e)}),x(t);var e=function(e){var n=$[e];t.content.addEventListener(e,function(e){!a(t,e)||s(t,e)||!t.editable&&e.type in J||n(t,e)})};for(var n in $)e(n);t.extraHandlers=Object.create(null),i(t)}function o(t){k(t),t.inDOMChange&&t.inDOMChange.destroy(),t.dragging&&t.dragging.destroy()}function i(t){t.someProp("handleDOMEvents",function(e){for(var n in e)t.extraHandlers[n]||e.hasOwnProperty(n)||(t.extraHandlers[n]=!0,t.content.addEventListener(n,function(e){return s(t,e)}))})}function s(t,e){return t.someProp("handleDOMEvents",function(n){var r=n[e.type];return!!r&&r(t,e)})}function a(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(var n=e.target;n!=t.content;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function c(t,e){s(t,e)||!$[e.type]||!t.editable&&e.type in J||$[e.type](t,e)}function l(t){return{left:t.clientX,top:t.clientY}}function p(t,e){var n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function u(t,e,n,r,o){if(-1==r)return!1;for(var i=t.state.doc.resolve(r),s=function(r){if(t.someProp(e,function(e){return r>i.depth?e(t,n,i.nodeAfter,i.before(r),o,!0):e(t,n,i.node(r),i.before(r),o,!1)}))return{v:!0}},a=i.depth+1;a>0;a--){var c=s(a);if(c)return c.v}return!1}function f(t,e,n){t.focus();var r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function h(t,e){if(-1==e)return!1;var n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isLeaf&&N.isSelectable(r))&&(f(t,new N(n),"pointer"),!0)}function d(t,e){if(-1==e)return!1;for(var n,r=t.state.selection,o=r.node,i=r.$from,s=t.state.doc.resolve(e),a=s.depth+1;a>0;a--){var c=a>s.depth?s.nodeAfter:s.node(a);if(N.isSelectable(c)){n=o&&i.depth>0&&a>=i.depth&&s.before(i.depth+1)==i.pos?s.before(i.depth):s.before(a);break}}return null!=n&&(f(t,N.create(t.state.doc,n),"pointer"),!0)}function m(t,e,n,r,o){return u(t,"handleClickOn",e,n,r)||t.someProp("handleClick",function(n){return n(t,e,r)})||(o?d(t,n):h(t,n))}function v(t,e,n,r){return u(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",function(n){return n(t,e,r)})}function g(t,e,n,r){return u(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",function(n){return n(t,e,r)})||y(t,n)}function y(t,e){var n=t.state.doc;if(-1==e)return!!n.isTextblock&&(f(t,E.create(n,0,n.content.size),"pointer"),!0);for(var r=n.resolve(e),o=r.depth+1;o>0;o--){var i=o>r.depth?r.nodeAfter:r.node(o),s=r.before(o);if(i.isTextblock)f(t,E.create(n,s+1,s+1+i.content.size),"pointer");else{if(!N.isSelectable(i))continue;f(t,N.create(n,s),"pointer")}return!0}}function w(t){return!!t.inDOMChange&&(t.inDOMChange.finish(!0),!0)}function x(t){t.mutationObserver&&t.mutationObserver.observe(t.content,U),A.ie&&A.ie_version<=11&&t.content.addEventListener("DOMCharacterDataModified",t.onCharData||(t.onCharData=function(e){M(t,{target:e.target,type:"characterData"})}))}function b(t){t.mutationObserver&&S(t,t.mutationObserver.takeRecords())}function k(t){t.mutationObserver&&(b(t),t.mutationObserver.disconnect()),A.ie&&A.ie_version<=11&&t.content.removeEventListener("DOMCharacterDataModified",t.onCharData)}function S(t,e){if(t.editable)for(var n=0;n<e.length;n++)M(t,e[n])}function M(t,e){var n=t.docView.nearestDesc(e.target);if(("attributes"!=e.type||n!=t.docView&&"contenteditable"!=e.attributeName)&&n&&!n.ignoreMutation(e)){var r,o;if("childList"==e.type){var i=e.previousSibling&&e.previousSibling.parentNode==e.target?Array.prototype.indexOf.call(e.target.childNodes,e.previousSibling)+1:0;if(-1==i)return;r=n.localPosFromDOM(e.target,i,-1);var s=e.nextSibling&&e.nextSibling.parentNode==e.target?Array.prototype.indexOf.call(e.target.childNodes,e.nextSibling):e.target.childNodes.length;if(-1==s)return;o=n.localPosFromDOM(e.target,s,1)}else"attributes"==e.type?(r=n.posAtStart-n.border,o=n.posAtEnd+n.border):(r=n.posAtStart,o=n.posAtEnd);L.start(t).addRange(r,o)}}function C(t){return 0==t.openLeft&&0==t.openRight&&1==t.content.childCount?t.content.firstChild:null}function D(t){t.dragging&&(t.dragging.destroy(),t.dragging=null)}function O(t,e){if(!t||!t.content.size)return e.pos;for(var n=t.content,r=0;r<t.openLeft;r++)n=n.firstChild.content;for(var o=e.depth;o>=0;o--){var i=o==e.depth?0:e.pos<=(e.start(o+1)+e.end(o+1))/2?-1:1,s=e.index(o)+(i>0?1:0);if(e.node(o).canReplace(s,s,n))return 0==i?e.pos:i<0?e.before(o+1):e.after(o+1)}return e.pos}var T=t("7"),R=T.Selection,N=T.NodeSelection,E=T.TextSelection,A=t("15"),I=t("16"),z=I.captureKeyDown,P=t("17"),L=P.DOMChange,F=t("19"),B=F.fromClipboard,q=F.toClipboard,_=F.canUpdateClipboard,V=t("18"),j=V.TrackMappings,$={},J={};e.initInput=r,e.destroyInput=o,e.ensureListeners=i,e.dispatchEvent=c,J.keydown=function(t,e){16==e.keyCode&&(t.shiftKey=!0),t.inDOMChange||(t.someProp("handleKeyDown",function(n){return n(t,e)})||z(t,e)?e.preventDefault():t.selectionReader.poll())},J.keyup=function(t,e){16==e.keyCode&&(t.shiftKey=!1)},J.keypress=function(t,e){if(!(t.inDOMChange||!e.charCode||e.ctrlKey&&!e.altKey||A.mac&&e.metaKey)){if(t.someProp("handleKeyPress",function(n){return n(t,e)}))return void e.preventDefault();var n=t.state.selection,r=n.node,o=n.$from,i=n.$to;if(r||!o.sameParent(i)){var s=String.fromCharCode(e.charCode);t.someProp("handleTextInput",function(e){return e(t,o.pos,i.pos,s)})||t.dispatch(t.state.tr.insertText(s).scrollIntoView()),e.preventDefault()}}};var W={time:0,x:0,y:0},H=W,K=A.mac?"metaKey":"ctrlKey";$.mousedown=function(t,e){var n,r=w(t),o=Date.now();n=o-W.time>=500||!p(e,W)||e[K]?"singleClick":o-H.time>=600||!p(e,H)?"doubleClick":"tripleClick",H=W,W={time:o,x:e.clientX,y:e.clientY};var i=t.posAtCoords(l(e));i&&("singleClick"==n?t.mouseDown=new Q(t,i,e,r):("doubleClick"==n?v:g)(t,i.pos,i.inside,e)?e.preventDefault():t.selectionReader.poll("pointer"))};var Q=function(t,e,n,r){var o=this;this.view=t,this.pos=e,this.flushed=r,this.selectNode=n[K],this.allowDefault=n.shiftKey;var i,s;if(e.inside>-1)i=t.state.doc.nodeAt(e.inside),s=e.inside;else{var a=t.state.doc.resolve(e.pos);i=a.parent,s=a.depth?a.before():0}this.mightDrag=i.type.spec.draggable||i==t.state.selection.node?{node:i,pos:s}:null,this.target=r?null:n.target,this.target&&this.mightDrag&&(k(this.view),this.target.draggable=!0,A.gecko&&(this.setContentEditable=!this.target.hasAttribute("contentEditable"))&&setTimeout(function(){return o.target.setAttribute("contentEditable","false")},20),x(this.view)),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),t.selectionReader.poll("pointer")};Q.prototype.done=function(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(k(this.view),this.target.draggable=!1,A.gecko&&this.setContentEditable&&this.target.removeAttribute("contentEditable"),x(this.view))},Q.prototype.up=function(t){this.done(),this.view.content.contains(3==t.target.nodeType?t.target.parentNode:t.target)&&(this.allowDefault?this.view.selectionReader.poll("pointer"):m(this.view,this.pos.pos,this.pos.inside,t,this.selectNode)?t.preventDefault():this.flushed?(f(this.view,R.near(this.view.state.doc.resolve(this.pos.pos)),"pointer"),t.preventDefault()):this.view.selectionReader.poll("pointer"))},Q.prototype.move=function(t){!this.allowDefault&&(Math.abs(this.x-t.clientX)>4||Math.abs(this.y-t.clientY)>4)&&(this.allowDefault=!0),this.view.selectionReader.poll("pointer")},$.touchdown=function(t){w(t),t.selectionReader.poll("pointer")},$.contextmenu=function(t,e){w(t);var n=t.posAtCoords(l(e));n&&t.someProp("handleContextMenu",function(r){return r(t,n.pos,e)})&&e.preventDefault()},J.compositionstart=J.compositionupdate=function(t){L.start(t,!0),t.state.storedMarks&&t.inDOMChange.finish(!0)},J.compositionend=function(t,e){if(!t.inDOMChange){if(!e.data)return;L.start(t,!0)}t.inDOMChange.compositionEnd()};var U={childList:!0,characterData:!0,attributes:!0,subtree:!0};e.startObserving=x,e.flushObserver=b,e.stopObserving=k,J.input=function(t){return L.start(t)},$.copy=J.cut=function(t,e){var n=t.state.selection,r="cut"==e.type;if(!n.empty){if(!e.clipboardData||!_(e.clipboardData))return void(r&&A.ie&&A.ie_version<=11&&L.start(t));q(t,n,e.clipboardData),e.preventDefault(),r&&t.dispatch(t.state.tr.deleteRange(n.from,n.to).scrollIntoView())}},J.paste=function(t,e){if(!e.clipboardData)return void(A.ie&&A.ie_version<=11&&L.start(t));var n=B(t,e.clipboardData,t.shiftKey,t.state.selection.$from);if(n){e.preventDefault(),t.someProp("transformPasted",function(t){n=t(n)});var r=C(n),o=r?t.state.tr.replaceSelectionWith(r):t.state.tr.replaceSelection(n);t.dispatch(o.scrollIntoView())}};var G=function(t,e,n,r){this.slice=e,this.range=n,this.move=r&&new j(t)};G.prototype.destroy=function(){this.move&&this.move.destroy()},$.dragstart=function(t,e){var n=t.mouseDown;if(n&&n.done(),e.dataTransfer){var r,o=t.state.selection,i=o.empty?null:t.posAtCoords(l(e));if(null!=i&&i.pos>=o.from&&i.pos<=o.to?r=o:n&&n.mightDrag&&(r=N.create(t.state.doc,n.mightDrag.pos)),r){var s=q(t,r,e.dataTransfer);t.dragging=new G(t.state,s,r,!e.ctrlKey)}}},$.dragend=function(t){window.setTimeout(function(){return D(t)},50)},J.dragover=J.dragenter=function(t,e){return e.preventDefault()},J.drop=function(t,e){var n=t.dragging;if(D(t),e.dataTransfer){var r=t.state.doc.resolve(t.posAtCoords(l(e)).pos);if(r){var o=n&&n.slice||B(t,e.dataTransfer,!1,r);if(o){var i=O(o,t.state.doc.resolve(r.pos));e.preventDefault();var s=t.state.tr;if(n&&n.move){var a=n.range,c=a.from,p=a.to,u=n.move.getMapping(t.state);u&&s.deleteRange(u.map(c,1),u.map(p,-1))}t.someProp("transformPasted",function(t){o=t(o)});var f=s.mapping.map(i),h=0==o.openLeft&&0==o.openRight&&1==o.content.childCount;h?s.replaceRangeWith(f,f,o.content.firstChild):s.replaceRange(f,f,o);var d=s.doc.resolve(f);h&&N.isSelectable(o.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(o.content.firstChild)?s.setSelection(new N(d)):s.setSelection(R.between(d,s.doc.resolve(s.mapping.map(i)))),t.focus(),t.dispatch(s)}}}},$.focus=function(t,e){t.focused||(t.content.classList.add("ProseMirror-focused"),t.focused=!0),t.someProp("onFocus",function(n){n(t,e)})},$.blur=function(t,e){t.focused&&(t.content.classList.remove("ProseMirror-focused"),t.focused=!1),t.someProp("onBlur",function(n){n(t,e)})};for(var X in J)$[X]=J[X];return n.exports}),t.registerDynamic("1b",["7","15","1a"],!0,function(t,e,n){function r(t){return new("onselectionchange"in document?d:m)(t)}function o(t,e,n){if(i(t,e),!t.hasFocus()){if(!n)return;p.gecko&&t.editable&&t.content.focus()}var r=t.selectionReader;if(e!=r.lastSelection||r.domChanged()){var o,s=e.anchor,a=e.head;if(null==s&&(s=e.from,a=e.to,p.webkit&&e.node.isBlock)){var c=t.docView.descAt(e.from);c.contentDOM||"false"!=c.dom.contentEditable||(o=c.dom,c.dom.contentEditable="true")}t.docView.setSelection(s,a,t.root),o&&(o.contentEditable="false"),r.storeDOMState(e)}}function i(t,e){if(e instanceof l){var n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(s(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else s(t)}function s(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=null)}var a=t("7"),c=a.Selection,l=a.NodeSelection,p=t("15"),u=t("1a"),f=u.flushObserver,h=function(t){var e=this;this.view=t,this.lastAnchorNode=this.lastHeadNode=this.lastAnchorOffset=this.lastHeadOffset=null,this.lastSelection=t.state.selection,this.poller=r(this),t.content.addEventListener("focus",function(){return e.poller.start()}),t.content.addEventListener("blur",function(){return e.poller.stop()}),t.editable||this.poller.start()};h.prototype.destroy=function(){this.poller.stop()},h.prototype.poll=function(t){this.poller.poll(t)},h.prototype.editableChanged=function(){this.view.editable?this.view.hasFocus()||this.poller.stop():this.poller.start()},h.prototype.domChanged=function(){var t=this.view.root.getSelection();return t.anchorNode!=this.lastAnchorNode||t.anchorOffset!=this.lastAnchorOffset||t.focusNode!=this.lastHeadNode||t.focusOffset!=this.lastHeadOffset},h.prototype.storeDOMState=function(t){var e=this.view.root.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastHeadNode=e.focusNode,this.lastHeadOffset=e.focusOffset,this.lastSelection=t},h.prototype.readFromDOM=function(t){if(this.view.inDOMChange||f(this.view),this.view.hasFocus()&&!this.view.inDOMChange&&this.domChanged()){var e=this.view.root.getSelection(),n=this.view.state.doc,r=this.view.docView.nearestDesc(e.focusNode);if(!r.size)return void this.storeDOMState();var o,i,s=this.view.docView.posFromDOM(e.focusNode,e.focusOffset),a=n.resolve(s);if(e.isCollapsed){for(o=a;r&&!r.node;)r=r.parent;if(r&&r.node.isLeaf&&l.isSelectable(r.node)){var p=r.posAtStart;i=new l(s==p?a:n.resolve(p))}}else o=n.resolve(this.view.docView.posFromDOM(e.anchorNode,e.anchorOffset));if(!i){var u=null!=this.view.state.selection.head&&this.view.state.selection.head<a.pos?1:-1;i=c.between(o,a,u),-1==u&&i.node&&(i=c.between(o,a,1))}if(a.pos==i.head&&o.pos==i.anchor&&this.storeDOMState(i),!this.view.state.selection.eq(i)){var h=this.view.state.tr.setSelection(i);"pointer"==t&&h.setMeta("pointer",!0),this.view.dispatch(h)}}},e.SelectionReader=h;var d=function(t){var e=this;this.listening=!1,this.curOrigin=null,this.originTime=0,this.reader=t,this.readFunc=function(){return t.readFromDOM(e.originTime>Date.now()-50?e.curOrigin:null)}};d.prototype.poll=function(t){this.curOrigin=t,this.originTime=Date.now()},d.prototype.start=function(){this.listening||(document.addEventListener("selectionchange",this.readFunc),this.listening=!0,this.reader.view.hasFocus()&&this.readFunc())},d.prototype.stop=function(){this.listening&&(document.removeEventListener("selectionchange",this.readFunc),this.listening=!1)};var m=function(t){this.polling=null,this.reader=t,this.pollFunc=this.doPoll.bind(this,null)};return m.prototype.doPoll=function(t){var e=this.reader.view;e.focused||!e.editable?(this.reader.readFromDOM(t),this.polling=setTimeout(this.pollFunc,100)):this.polling=null},m.prototype.poll=function(t){clearTimeout(this.polling),this.polling=setTimeout(t?this.doPoll.bind(this,t):this.pollFunc,0)},m.prototype.start=function(){null==this.polling&&this.poll()},m.prototype.stop=function(){clearTimeout(this.polling),this.polling=null},e.selectionToDOM=o,n.exports}),t.registerDynamic("1c",[],!0,function(t,e,n){function r(t,e){if(t==e)return!0;for(var n in t)if(t[n]!==e[n])return!1;for(var r in e)if(!(r in t))return!1;return!0}function o(t,e,n,r,o,a,c){for(var u=t.slice(),f=function(t,e,n,r){for(var o=0;o<u.length;o+=3){var i=u[o+1],s=void 0;-1==i||t>i+a||(e>=u[o]+a?u[o+1]=-1:(s=r-n-(e-t))&&(u[o]+=s,u[o+1]+=s))}},h=0;h<n.maps.length;h++)n.maps[h].forEach(f);for(var d=!1,m=0;m<u.length;m+=3)if(-1==u[m+1]){var v=n.map(u[m]+a),g=v-o;if(g<0||g>=r.content.size){d=!0;continue}var y=n.map(t[m+1]+a,-1),w=y-o,x=r.content.findIndex(g),S=x.index,M=x.offset,C=r.maybeChild(S);if(C&&M==g&&M+C.nodeSize==w){var D=u[m+2].mapInner(n,C,v+1,u[m]+a+1,c);D!=k?(u[m]=g,u[m+1]=w,u[m+2]=D):(u.splice(m,3),m-=3)}else d=!0}if(d){var O=s(u,e?i(e,o):[],n,a,c),T=l(O,r,0,c);e=T.local;for(var R=0;R<u.length;R+=3)-1==u[R+1]&&(u.splice(R,3),R-=3);for(var N=0,E=0;N<T.children.length;N+=3){for(var A=T.children[N];E<u.length&&u[E]<A;)E+=3
117
+ ;u.splice(E,0,T.children[N],T.children[N+1],T.children[N+2])}}return new b(e&&e.sort(p),u)}function i(t,e){if(!e||!t.length)return t;for(var n=[],r=0;r<t.length;r++){var o=t[r];n.push(new g(o.from+e,o.to+e,o.type))}return n}function s(t,e,n,r,o){function i(t,r){for(var s=0;s<t.local.length;s++){var a=t.local[s].map(n,0,r);a?e.push(a):o.onRemove&&o.onRemove(t.local[s].options)}for(var c=0;c<t.children.length;c+=3)i(t.children[c+2],t.children[c]+r+1)}for(var s=0;s<t.length;s+=3)-1==t[s+1]&&i(t[s+2],t[s]+r+1);return e}function a(t,e,n){if(e.isLeaf)return null;for(var r=n+e.nodeSize,o=null,i=0,s=void 0;i<t.length;i++)(s=t[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),t[i]=null);return o}function c(t){for(var e=[],n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function l(t,e,n,r){var o=[],s=!1;e.forEach(function(e,i){var c=a(t,e,i+n);if(c){s=!0;var p=l(c,e,n+i+1,r);p!=k&&o.push(i,i+e.nodeSize,p)}});for(var u=i(s?c(t):t,-n).sort(p),f=0;f<u.length;f++)u[f].type.valid(e,u[f])||(r.onRemove&&r.onRemove(u[f].options),u.splice(f--,1));return u.length||o.length?new b(u,o):k}function p(t,e){return t.from-e.from||t.to-e.to}function u(t){for(var e=t,n=0;n<e.length-1;n++){var r=e[n];if(r.from!=r.to)for(var o=n+1;o<e.length;o++){var i=e[o];{if(i.from!=r.from){i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),f(e,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),f(e,o+1,i.copy(r.to,i.to)))}}}return e}function f(t,e,n){for(;e<t.length&&p(n,t[e])>0;)e++;t.splice(e,0,n)}function h(t){var e=[];return t.someProp("decorations",function(n){var r=n(t.state);r&&r!=k&&e.push(r)}),S.from(e)}var d=function(t,e){if(1!=t.nodeType){var n=document.createElement("span");n.appendChild(t),t=n}t.contentEditable=!1,t.classList.add("ProseMirror-widget"),this.widget=t,this.options=e||x};d.prototype.map=function(t,e,n,r){var o=t.mapResult(e.from+r,"left"==this.options.associative?-1:1),i=o.pos;return o.deleted?null:new g(i-n,i-n,this)},d.prototype.valid=function(){return!0},d.prototype.eq=function(t){return this==t||t instanceof d&&(this.widget==t.widget||this.options.key)&&r(this.options,t.options)};var m=function(t,e){this.options=e||x,this.attrs=t};m.prototype.map=function(t,e,n,r){var o=t.map(e.from+r,this.options.inclusiveLeft?-1:1)-n,i=t.map(e.to+r,this.options.inclusiveRight?1:-1)-n;return o>=i?null:new g(o,i,this)},m.prototype.valid=function(t,e){return e.from<e.to},m.prototype.eq=function(t){return this==t||t instanceof m&&r(this.attrs,t.attrs)&&r(this.options,t.options)},m.is=function(t){return t.type instanceof m};var v=function(t,e){this.attrs=t,this.options=e||x};v.prototype.map=function(t,e,n,r){var o=t.mapResult(e.from+r,1);if(o.deleted)return null;var i=t.mapResult(e.to+r,-1);return i.deleted||i.pos<=o.pos?null:new g(o.pos-n,i.pos-n,this)},v.prototype.valid=function(t,e){var n=t.content.findIndex(e.from),r=n.index,o=n.offset;return o==e.from&&o+t.child(r).nodeSize==e.to},v.prototype.eq=function(t){return this==t||t instanceof v&&r(this.attrs,t.attrs)&&r(this.options,t.options)};var g=function(t,e,n){this.from=t,this.to=e,this.type=n},y={options:{}};g.prototype.copy=function(t,e){return new g(t,e,this.type)},g.prototype.eq=function(t){return this.type.eq(t.type)&&this.from==t.from&&this.to==t.to},g.prototype.map=function(t,e,n){return this.type.map(t,this,e,n)},g.widget=function(t,e,n){return new g(t,t,new d(e,n))},g.inline=function(t,e,n,r){return new g(t,e,new m(n,r))},g.node=function(t,e,n,r){return new g(t,e,new v(n,r))},y.options.get=function(){return this.type.options},Object.defineProperties(g.prototype,y),e.Decoration=g;var w=[],x={},b=function(t,e){this.local=t&&t.length?t:w,this.children=e&&e.length?e:w};b.create=function(t,e){return e.length?l(e,t,0,x):k},b.prototype.find=function(t,e){var n=[];return this.findInner(null==t?0:t,null==e?1e9:e,n,0),n},b.prototype.findInner=function(t,e,n,r){for(var o=this,i=0;i<this.local.length;i++){var s=o.local[i];s.from<=e&&s.to>=t&&n.push(s.copy(s.from+r,s.to+r))}for(var a=0;a<this.children.length;a+=3)if(o.children[a]<e&&o.children[a+1]>t){var c=o.children[a]+1;o.children[a+2].findInner(t-c,e-c,n,r+c)}},b.prototype.map=function(t,e,n){return this==k||0==t.maps.length?this:this.mapInner(t,e,0,0,n||x)},b.prototype.mapInner=function(t,e,n,r,i){for(var s,a=this,c=0;c<this.local.length;c++){var l=a.local[c].map(t,n,r);l&&l.type.valid(e,l)?(s||(s=[])).push(l):i.onRemove&&i.onRemove(a.local[c].options)}return this.children.length?o(this.children,s,t,e,n,r,i):s?new b(s.sort(p)):k},b.prototype.add=function(t,e){return e.length?this==k?b.create(t,e):this.addInner(t,e,0):this},b.prototype.addInner=function(t,e,n){var r,o=this,s=0;t.forEach(function(t,i){var c,p=i+n;if(c=a(e,t,p)){for(r||(r=o.children.slice());s<r.length&&r[s]<i;)s+=3;r[s]==i?r[s+2]=r[s+2].addInner(t,c,p+1):r.splice(s,0,i,i+t.nodeSize,l(c,t,p+1,x)),s+=3}});var u=i(s?c(e):e,-n);return new b(u.length?this.local.concat(u).sort(p):this.local,r||this.children)},b.prototype.remove=function(t){return 0==t.length||this==k?this:this.removeInner(t,0)},b.prototype.removeInner=function(t,e){for(var n=this,r=this.children,o=this.local,i=0;i<r.length;i+=3){for(var s=void 0,a=r[i]+e,c=r[i+1]+e,l=0,p=void 0;l<t.length;l++)(p=t[l])&&p.from>a&&p.to<c&&(t[l]=null,(s||(s=[])).push(p));if(s){r==n.children&&(r=n.children.slice());var u=r[i+2].removeInner(s,a+1);u!=k?r[i+2]=u:(r.splice(i,3),i-=3)}}if(o.length)for(var f=0,h=void 0;f<t.length;f++)if(h=t[f])for(var d=0;d<o.length;d++)o[d].type==h.type&&(o==n.local&&(o=n.local.slice()),o.splice(d--,1));return r==this.children&&o==this.local?this:o.length||r.length?new b(o,r):k},b.prototype.forChild=function(t,e){var n=this;if(this==k)return this;if(e.isLeaf)return b.empty;for(var r,o,i=0;i<this.children.length;i+=3)if(n.children[i]>=t){n.children[i]==t&&(r=n.children[i+2]);break}for(var s=t+1,a=s+e.content.size,c=0;c<this.local.length;c++){var l=n.local[c];if(l.from<a&&l.to>s&&l.type instanceof m){var p=Math.max(s,l.from)-s,u=Math.min(a,l.to)-s;p<u&&(o||(o=[])).push(l.copy(p,u))}}if(o){var f=new b(o);return r?new S([f,r]):f}return r||k},b.prototype.eq=function(t){var e=this;if(this==t)return!0;if(!(t instanceof b)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(var n=0;n<this.local.length;n++)if(!e.local[n].eq(t.local[n]))return!1;for(var r=0;r<this.children.length;r+=3)if(e.children[r]!=t.children[r]||e.children[r+1]!=t.children[r+1]||!e.children[r+2].eq(t.children[r+2]))return!1;return!1},b.prototype.locals=function(t){return u(this.localsInner(t))},b.prototype.localsInner=function(t){var e=this;if(this==k)return w;if(t.isTextblock||!this.local.some(m.is))return this.local;for(var n=[],r=0;r<this.local.length;r++)e.local[r].type instanceof m||n.push(e.local[r]);return n},e.DecorationSet=b;var k=new b;b.empty=k;var S=function(t){this.members=t};return S.prototype.forChild=function(t,e){var n=this;if(e.isLeaf)return b.empty;for(var r=[],o=0;o<this.members.length;o++){var i=n.members[o].forChild(t,e);i!=k&&(i instanceof S?r=r.concat(i.members):r.push(i))}return S.from(r)},S.prototype.eq=function(t){var e=this;if(!(t instanceof S)||t.members.length!=this.members.length)return!1;for(var n=0;n<this.members.length;n++)if(!e.members[n].eq(t.members[n]))return!1;return!0},S.prototype.locals=function(t){for(var e,n=this,r=!0,o=0;o<this.members.length;o++){var i=n.members[o].localsInner(t);if(i.length)if(e){r&&(e=e.slice(),r=!1);for(var s=0;s<i.length;s++)e.push(i[s])}else e=i}return e?u(r?e:e.sort(p)):w},S.from=function(t){switch(t.length){case 0:return k;case 1:return t[0];default:return new S(t)}},e.removeOverlap=u,e.viewDecorations=h,n.exports}),t.registerDynamic("1d",["13","14","1a","1b","1c"],!0,function(t,e,n){function r(t){var e=Object.create(null);return e["class"]="ProseMirror"+(t.focused?" ProseMirror-focused":"")+(t.state.selection.node?" ProseMirror-nodeselection":""),e.contenteditable=String(t.editable),t.someProp("attributes",function(n){if("function"==typeof n&&(n=n(t.state)),n)for(var r in n)"class"==r?e["class"]+=" "+n[r]:e[r]||"contenteditable"==r||"nodeName"==r||(e[r]=String(n[r]))}),[O.node(0,t.state.doc.content.size,e)]}function o(t){return!t.someProp("editable",function(e){return!1===e(t.state)})}var i,s=t("13"),a=s.scrollRectIntoView,c=s.posAtCoords,l=s.coordsAtPos,p=s.endOfTextblock,u=s.storeScrollPos,f=s.resetScrollPos,h=t("14"),d=h.docViewDesc,m=t("1a"),v=m.initInput,g=m.destroyInput,y=m.dispatchEvent,w=m.startObserving,x=m.stopObserving,b=m.ensureListeners,k=t("1b"),S=k.SelectionReader,M=k.selectionToDOM,C=t("1c"),D=C.viewDecorations,O=C.Decoration;i=t("1c"),e.Decoration=i.Decoration,e.DecorationSet=i.DecorationSet;var T=function(t,e){this.props=e,this.state=e.state,this.dispatch=this.dispatch.bind(this),this._root=null,this.focused=!1,this.content=document.createElement("div"),t&&t.appendChild?t.appendChild(this.content):t&&t(this.content),this.editable=o(this),this.docView=d(this.state.doc,r(this),D(this),this.content,this),this.lastSelectedViewDesc=null,this.selectionReader=new S(this),v(this),this.pluginViews=[],this.updatePluginViews()},R={root:{}};return T.prototype.update=function(t){t.handleDOMEvents!=this.props.handleDOMEvents&&b(this),this.props=t,this.updateState(t.state)},T.prototype.updateState=function(t){var e=this.state;if(this.state=t,e.plugins!=t.plugins&&b(this),!this.inDOMChange){var n=this.editable;this.editable=o(this);var i=D(this),s=r(this),c=t.scrollToSelection>e.scrollToSelection||e.config!=t.config,l=!this.docView.matchesNode(t.doc,s,i),p=l||!t.selection.eq(e.selection)||this.selectionReader.domChanged(),h=!c&&p&&u(this);p&&(x(this),l&&this.docView.update(t.doc,s,i,this),M(this,t.selection),w(this)),n!=this.editable&&this.selectionReader.editableChanged(),this.updatePluginViews(e),c?t.selection.node?a(this,this.docView.domAfterPos(t.selection.from).getBoundingClientRect()):a(this,this.coordsAtPos(t.selection.head)):h&&f(h)}},T.prototype.destroyPluginViews=function(){for(var t;t=this.pluginViews.pop();)t.destroy&&t.destroy()},T.prototype.updatePluginViews=function(t){var e=this,n=this.state.plugins;if(t&&t.plugins==n)for(var r=0;r<this.pluginViews.length;r++){var o=e.pluginViews[r];o.update&&o.update(e)}else{this.destroyPluginViews();for(var i=0;i<n.length;i++){var s=n[i];s.options.view&&e.pluginViews.push(s.options.view(e))}}},T.prototype.hasFocus=function(){if(this.editable&&this.content.ownerDocument.activeElement!=this.content)return!1;var t=this.root.getSelection();return t.rangeCount&&this.content.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)},T.prototype.someProp=function(t,e){var n,r=this.props&&this.props[t];if(null!=r&&(n=e?e(r):r))return n;var o=this.state.plugins;if(o)for(var i=0;i<o.length;i++){var s=o[i].props[t];if(null!=s&&(n=e?e(s):s))return n}},T.prototype.focus=function(){x(this),M(this,this.state.selection,!0),w(this),this.editable&&this.content.focus()},R.root.get=function(){var t=this,e=this._root;if(null==e)for(var n=this.content.parentNode;n;n=n.parentNode)if(9==n.nodeType||11==n.nodeType&&n.host)return t._root=n;return e||document},T.prototype.posAtCoords=function(t){return c(this,t)},T.prototype.coordsAtPos=function(t){return l(this,t)},T.prototype.endOfTextblock=function(t,e){return p(this,e||this.state,t)},T.prototype.destroy=function(){g(this),this.destroyPluginViews(),this.docView.destroy(),this.selectionReader.destroy(),this.content.parentNode&&this.content.parentNode.removeChild(this.content)},T.prototype.dispatchEvent=function(t){return y(this,t)},T.prototype.dispatch=function(t){var e=this.props.dispatchTransaction;e?e(t):this.updateState(this.state.apply(t))},Object.defineProperties(T.prototype,R),e.EditorView=T,n.exports}),t.registerDynamic("11",["1d"],!0,function(t,e,n){return n.exports=t("1d"),n.exports}),t.registerDynamic("1e",[],!0,function(t,e,n){var r;return function(t,o){"object"==typeof e?n.exports=o():"function"==typeof r&&r.amd?r(o):t.crel=o()}(this,function(){function t(){var r,u=arguments,f=u[0],m=u[1],v=2,g=u.length,y=t[s];if(f=t[c](f)?f:l.createElement(f),1===g)return f;if((!p(m,n)||t[a](m)||h(m))&&(--v,m=null),g-v==1&&p(u[v],"string")&&f[o]!==undefined)f[o]=u[v];else for(;v<g;++v)if(null!=(r=u[v]))if(h(r))for(var w=0;w<r.length;++w)d(f,r[w]);else d(f,r);for(var x in m)if(y[x]){var b=y[x];typeof b===e?b(f,m[x]):f[i](b,m[x])}else p(m[x],e)?f[x]=m[x]:f[i](x,m[x]);return f}var e="function",n="object",r="nodeType",o="textContent",i="setAttribute",s="attrMap",a="isNode",c="isElement",l=typeof document===n?document:{},p=function(t,e){return typeof t===e},u=typeof Node===e?function(t){return t instanceof Node}:function(t){return t&&p(t,n)&&r in t&&p(t.ownerDocument,n)},f=function(e){return t[a](e)&&1===e[r]},h=function(t){return t instanceof Array},d=function(e,n){t[a](n)||(n=l.createTextNode(n)),e.appendChild(n)};return t[s]={},t[c]=f,t[a]=u,"undefined"!=typeof Proxy&&(t.proxy=new Proxy(t,{get:function(e,n){return!(n in t)&&(t[n]=t.bind(null,n)),t[n]}})),t}),n.exports}),t.registerDynamic("1f",["1e"],!0,function(t,e,n){return n.exports=t("1e"),n.exports}),t.registerDynamic("20",[],!0,function(t,e,n){function r(t){for(var e=0,n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n)|0;return e}function o(t){var e=document.createElement("div");if(e.className=c,t.path){var n="pm-icon-"+r(t.path).toString(16);document.getElementById(n)||i(n,t);var o=e.appendChild(document.createElementNS(s,"svg"));o.style.width=t.width/t.height+"em";o.appendChild(document.createElementNS(s,"use")).setAttributeNS(a,"href",/([^#]*)/.exec(document.location)[1]+"#"+n)}else t.dom?e.appendChild(t.dom.cloneNode(!0)):(e.appendChild(document.createElement("span")).textContent=t.text||"",t.css&&(e.firstChild.style.cssText=t.css));return e}function i(t,e){var n=document.getElementById(c+"-collection");n||(n=document.createElementNS(s,"svg"),n.id=c+"-collection",n.style.display="none",document.body.insertBefore(n,document.body.firstChild));var r=document.createElementNS(s,"symbol");r.id=t,r.setAttribute("viewBox","0 0 "+e.width+" "+e.height),r.appendChild(document.createElementNS(s,"path")).setAttribute("d",e.path),n.appendChild(r)}var s="http://www.w3.org/2000/svg",a="http://www.w3.org/1999/xlink",c="ProseMirror-icon";return e.getIcon=o,n.exports}),t.registerDynamic("21",["1f","22","23","20"],!0,function(t,e,n){function r(t,e){return t.props.translate?t.props.translate(e):e}function o(t){C.time=Date.now(),C.node=t.target}function i(t){return Date.now()-100<C.time&&C.node&&t.contains(C.node)}function s(t,e){for(var n=[],r=0;r<t.length;r++){var o=t[r].render(e);o&&n.push(u("div",{"class":S+"-dropdown-item"},o))}return n}function a(t,e){for(var n=document.createDocumentFragment(),r=!1,o=0;o<e.length;o++){for(var i=e[o],s=!1,a=0;a<i.length;a++){var l=i[a].render(t);l&&(!s&&r&&n.appendChild(c()),n.appendChild(u("span",{"class":S+"item"},l)),s=!0)}s&&(r=!0)}return n}function c(){return u("span",{"class":S+"separator"})}function l(t,e){var n={run:function(n,r){return v(t,e.attrs)(n,r)},select:function(n){return v(t,e.attrs instanceof Function?null:e.attrs)(n)}};for(var r in e)n[r]=e[r];return new M(n)}function p(t,e){var n=g(t,e.attrs),r={run:n,select:function(t){return n(t)},active:function(n){var r=n.selection,o=r.$from,i=r.to,s=r.node;return s?s.hasMarkup(t,e.attrs):i<=o.end()&&o.parent.hasMarkup(t,e.attrs)}};for(var o in e)r[o]=e[o];return new M(r)}var u=t("1f"),f=t("22"),h=f.lift,d=f.joinUp,m=f.selectParentNode,v=f.wrapIn,g=f.setBlockType,y=t("23"),w=y.undo,x=y.redo,b=t("20"),k=b.getIcon,S="ProseMirror-menu",M=function(t){this.spec=t};M.prototype.render=function(t){var e=!1,n=this.spec;if(n.select&&!n.select(t.state)){if("disable"!=n.onDeselected)return null;e=!0}var o,i=n.active&&!e&&n.active(t.state);if(n.render)o=n.render(t);else if(n.icon)o=k(n.icon),i&&o.classList.add(S+"-active");else{if(!n.label)throw new RangeError("MenuItem without render, icon, or label property");o=u("div",null,r(t,n.label))}return n.title&&o.setAttribute("title",r(t,n.title)),n["class"]&&o.classList.add(n["class"]),e&&o.classList.add(S+"-disabled"),n.css&&(o.style.cssText+=n.css),e||o.addEventListener(n.execEvent||"mousedown",function(e){e.preventDefault(),n.run(t.state,t.dispatch,t)}),o},e.MenuItem=M;var C={time:0,node:null},D=function(t,e){this.options=e||{},this.content=Array.isArray(t)?t:[t]};D.prototype.render=function(t){var e=this,n=s(this.content,t);if(!n.length)return null;var a=u("div",{"class":S+"-dropdown "+(this.options["class"]||""),style:this.options.css,title:this.options.title&&r(t,this.options.title)},r(t,this.options.label)),c=u("div",{"class":S+"-dropdown-wrap"},a),l=null,p=null,f=function(){l&&l.close()&&(l=null,window.removeEventListener("mousedown",p))};return a.addEventListener("mousedown",function(t){t.preventDefault(),o(t),l?f():(l=e.expand(c,n),window.addEventListener("mousedown",p=function(){i(c)||f()}))}),c},D.prototype.expand=function(t,e){function n(){if(!o)return o=!0,t.removeChild(r),!0}var r=u("div",{"class":S+"-dropdown-menu "+(this.options["class"]||"")},e),o=!1;return t.appendChild(r),{close:n,node:r}},e.Dropdown=D;var O=function(t,e){this.options=e||{},this.content=Array.isArray(t)?t:[t]};O.prototype.render=function(t){var e=s(this.content,t);if(!e.length)return null;var n=u("div",{"class":S+"-submenu-label"},r(t,this.options.label)),a=u("div",{"class":S+"-submenu-wrap"},n,u("div",{"class":S+"-submenu"},e)),c=null;return n.addEventListener("mousedown",function(t){t.preventDefault(),o(t),a.classList.toggle(S+"-submenu-wrap-active"),c||window.addEventListener("mousedown",c=function(){i(a)||(a.classList.remove(S+"-submenu-wrap-active"),window.removeEventListener("mousedown",c),c=null)})}),a},e.DropdownSubmenu=O,e.renderGrouped=a;var T={join:{width:800,height:900,path:"M0 75h800v125h-800z M0 825h800v-125h-800z M250 400h100v-100h100v100h100v100h-100v100h-100v-100h-100z"},lift:{width:1024,height:1024,path:"M219 310v329q0 7-5 12t-12 5q-8 0-13-5l-164-164q-5-5-5-13t5-13l164-164q5-5 13-5 7 0 12 5t5 12zM1024 749v109q0 7-5 12t-12 5h-987q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h987q7 0 12 5t5 12zM1024 530v109q0 7-5 12t-12 5h-621q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h621q7 0 12 5t5 12zM1024 310v109q0 7-5 12t-12 5h-621q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h621q7 0 12 5t5 12zM1024 91v109q0 7-5 12t-12 5h-987q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h987q7 0 12 5t5 12z"},selectParentNode:{text:"\u2b1a",css:"font-weight: bold"},undo:{width:1024,height:1024,path:"M761 1024c113-206 132-520-313-509v253l-384-384 384-384v248c534-13 594 472 313 775z"},redo:{width:1024,height:1024,path:"M576 248v-248l384 384-384 384v-253c-446-10-427 303-313 509-280-303-221-789 313-775z"},strong:{width:805,height:1024,path:"M317 869q42 18 80 18 214 0 214-191 0-65-23-102-15-25-35-42t-38-26-46-14-48-6-54-1q-41 0-57 5 0 30-0 90t-0 90q0 4-0 38t-0 55 2 47 6 38zM309 442q24 4 62 4 46 0 81-7t62-25 42-51 14-81q0-40-16-70t-45-46-61-24-70-8q-28 0-74 7 0 28 2 86t2 86q0 15-0 45t-0 45q0 26 0 39zM0 950l1-53q8-2 48-9t60-15q4-6 7-15t4-19 3-18 1-21 0-19v-37q0-561-12-585-2-4-12-8t-25-6-28-4-27-2-17-1l-2-47q56-1 194-6t213-5q13 0 39 0t38 0q40 0 78 7t73 24 61 40 42 59 16 78q0 29-9 54t-22 41-36 32-41 25-48 22q88 20 146 76t58 141q0 57-20 102t-53 74-78 48-93 27-100 8q-25 0-75-1t-75-1q-60 0-175 6t-132 6z"},em:{width:585,height:1024,path:"M0 949l9-48q3-1 46-12t63-21q16-20 23-57 0-4 35-165t65-310 29-169v-14q-13-7-31-10t-39-4-33-3l10-58q18 1 68 3t85 4 68 1q27 0 56-1t69-4 56-3q-2 22-10 50-17 5-58 16t-62 19q-4 10-8 24t-5 22-4 26-3 24q-15 84-50 239t-44 203q-1 5-7 33t-11 51-9 47-3 32l0 10q9 2 105 17-1 25-9 56-6 0-18 0t-18 0q-16 0-49-5t-49-5q-78-1-117-1-29 0-81 5t-69 6z"},code:{width:896,height:1024,path:"M608 192l-96 96 224 224-224 224 96 96 288-320-288-320zM288 192l-288 320 288 320 96-96-224-224 224-224-96-96z"},link:{width:951,height:1024,path:"M832 694q0-22-16-38l-118-118q-16-16-38-16-24 0-41 18 1 1 10 10t12 12 8 10 7 14 2 15q0 22-16 38t-38 16q-8 0-15-2t-14-7-10-8-12-12-10-10q-18 17-18 41 0 22 16 38l117 118q15 15 38 15 22 0 38-14l84-83q16-16 16-38zM430 292q0-22-16-38l-117-118q-16-16-38-16-22 0-38 15l-84 83q-16 16-16 38 0 22 16 38l118 118q15 15 38 15 24 0 41-17-1-1-10-10t-12-12-8-10-7-14-2-15q0-22 16-38t38-16q8 0 15 2t14 7 10 8 12 12 10 10q18-17 18-41zM941 694q0 68-48 116l-84 83q-47 47-116 47-69 0-116-48l-117-118q-47-47-47-116 0-70 50-119l-50-50q-49 50-118 50-68 0-116-48l-118-118q-48-48-48-116t48-116l84-83q47-47 116-47 69 0 116 48l117 118q47 47 47 116 0 70-50 119l50 50q49-50 118-50 68 0 116 48l118 118q48 48 48 116z"},bulletList:{width:768,height:896,path:"M0 512h128v-128h-128v128zM0 256h128v-128h-128v128zM0 768h128v-128h-128v128zM256 512h512v-128h-512v128zM256 256h512v-128h-512v128zM256 768h512v-128h-512v128z"},orderedList:{width:768,height:896,path:"M320 512h448v-128h-448v128zM320 768h448v-128h-448v128zM320 128v128h448v-128h-448zM79 384h78v-256h-36l-85 23v50l43-2v185zM189 590c0-36-12-78-96-78-33 0-64 6-83 16l1 66c21-10 42-15 67-15s32 11 32 28c0 26-30 58-110 112v50h192v-67l-91 2c49-30 87-66 87-113l1-1z"},blockquote:{width:640,height:896,path:"M0 448v256h256v-256h-128c0 0 0-128 128-128v-128c0 0-256 0-256 256zM640 320v-128c0 0-256 0-256 256v256h256v-256h-128c0 0 0-128 128-128z"}};e.icons=T;var R=new M({title:"Join with above block",run:d,select:function(t){return d(t)},icon:T.join});e.joinUpItem=R;var N=new M({title:"Lift out of enclosing block",run:h,select:function(t){return h(t)},icon:T.lift});e.liftItem=N;var E=new M({title:"Select parent node",run:m,select:function(t){return m(t)},icon:T.selectParentNode});e.selectParentNodeItem=E;var A=new M({title:"Undo last change",run:w,select:function(t){return w(t)},icon:T.undo});e.undoItem=A;var I=new M({title:"Redo last undone change",run:x,select:function(t){return x(t)},icon:T.redo});return e.redoItem=I,e.wrapItem=l,e.blockTypeItem=p,n.exports}),t.registerDynamic("24",["1f","11","21"],!0,function(t,e,n){function r(t){return t.anchorNode==t.focusNode?t.anchorOffset>t.focusOffset:t.anchorNode.compareDocumentPosition(t.focusNode)==Node.DOCUMENT_POSITION_FOLLOWING}function o(t){for(var e=t.parentNode;e;e=e.parentNode)if(e.scrollHeight>e.clientHeight)return e}var i=t("1f"),s=t("11"),a=s.EditorView,c=t("21"),l=c.renderGrouped,p="ProseMirror-menubar",u=function(t,e){var n=this;this.wrapper=i("div",{"class":p+"-wrapper"}),t&&t.appendChild?t.appendChild(this.wrapper):t&&t(this.wrapper),e.dispatchTransaction||(e.dispatchTransaction=function(t){return n.updateState(n.editor.state.apply(t))}),this.editor=new a(this.wrapper,e),this.menu=i("div",{"class":p}),this.menu.className=p,this.spacer=null,this.wrapper.insertBefore(this.menu,this.wrapper.firstChild),this.maxHeight=0,this.widthForMaxHeight=0,this.floating=!1,this.props=e,this.updateMenu(),this.editor.someProp("floatingMenu")&&(this.updateFloat(),this.scrollFunc=function(){var t=n.editor.root;(t.body||t).contains(n.wrapper)?n.updateFloat():window.removeEventListener("scroll",n.scrollFunc)},window.addEventListener("scroll",this.scrollFunc))};return u.prototype.update=function(t){this.props=t,this.editor.update(t),this.updateMenu()},u.prototype.updateState=function(t){this.editor.updateState(t),this.updateMenu()},u.prototype.updateMenu=function(){this.menu.textContent="",this.menu.appendChild(l(this.editor,this.editor.someProp("menuContent"))),this.floating?this.updateScrollCursor():(this.menu.offsetWidth!=this.widthForMaxHeight&&(this.widthForMaxHeight=this.menu.offsetWidth,this.maxHeight=0),this.menu.offsetHeight>this.maxHeight&&(this.maxHeight=this.menu.offsetHeight,this.menu.style.minHeight=this.maxHeight+"px"))},u.prototype.updateScrollCursor=function(){var t=this.editor.root.getSelection();if(t.focusNode){var e=t.getRangeAt(0).getClientRects(),n=e[r(t)?0:e.length-1];if(n){var i=this.menu.getBoundingClientRect();if(n.top<i.bottom&&n.bottom>i.top){var s=o(this.wrapper);s&&(s.scrollTop-=i.bottom-n.top)}}}},u.prototype.updateFloat=function(){var t=this.wrapper,e=t.getBoundingClientRect();if(this.floating)if(e.top>=0||e.bottom<this.menu.offsetHeight+10)this.floating=!1,this.menu.style.position=this.menu.style.left=this.menu.style.width="",this.menu.style.display="",this.spacer.parentNode.removeChild(this.spacer),this.spacer=null;else{var n=(t.offsetWidth-t.clientWidth)/2;this.menu.style.left=e.left+n+"px",this.menu.style.display=e.top>window.innerHeight?"none":""}else if(e.top<0&&e.bottom>=this.menu.offsetHeight+10){this.floating=!0;var r=this.menu.getBoundingClientRect();this.menu.style.left=r.left+"px",this.menu.style.width=r.width+"px",this.menu.style.position="fixed",this.spacer=i("div",{"class":p+"-spacer",style:"height: "+r.height+"px"}),t.insertBefore(this.spacer,this.menu)}},u.prototype.destroy=function(){this.editor.destroy()},e.MenuBarEditorView=u,n.exports}),t.registerDynamic("25",["21","24"],!0,function(t,e,n){var r;return r=t("21"),e.MenuItem=r.MenuItem,e.Dropdown=r.Dropdown,e.DropdownSubmenu=r.DropdownSubmenu,e.renderGrouped=r.renderGrouped,e.icons=r.icons,e.joinUpItem=r.joinUpItem,e.liftItem=r.liftItem,e.selectParentNodeItem=r.selectParentNodeItem,e.undoItem=r.undoItem,e.redoItem=r.redoItem,e.wrapItem=r.wrapItem,e.blockTypeItem=r.blockTypeItem,e.MenuBarEditorView=t("24").MenuBarEditorView,n.exports}),t.registerDynamic("26",["25"],!0,function(t,e,n){return n.exports=t("25"),n.exports}),t.registerDynamic("27",[],!0,function(t,e,n){function r(t){var e=document.body.appendChild(document.createElement("div"));e.className=s;var n=function(t){e.contains(t.target)||r()};setTimeout(function(){return window.addEventListener("mousedown",n)},50);var r=function(){window.removeEventListener("mousedown",n),e.parentNode&&e.parentNode.removeChild(e)},i=[];for(var a in t.fields)i.push(t.fields[a].render());var c=document.createElement("button");c.type="submit",c.className=s+"-submit",c.textContent="OK";var l=document.createElement("button");l.type="button",l.className=s+"-cancel",l.textContent="Cancel",l.addEventListener("click",r);var p=e.appendChild(document.createElement("form"));t.title&&(p.appendChild(document.createElement("h5")).textContent=t.title),i.forEach(function(t){p.appendChild(document.createElement("div")).appendChild(t)});var u=p.appendChild(document.createElement("div"));u.className=s+"-buttons",u.appendChild(c),u.appendChild(document.createTextNode(" ")),u.appendChild(l);var f=e.getBoundingClientRect();e.style.top=(window.innerHeight-f.height)/2+"px",e.style.left=(window.innerWidth-f.width)/2+"px";var h=function(){var e=o(t.fields,i);e&&(r(),t.callback(e))};p.addEventListener("submit",function(t){t.preventDefault(),h()}),p.addEventListener("keydown",function(t){27==t.keyCode?(t.preventDefault(),r()):13!=t.keyCode||t.ctrlKey||t.metaKey||t.shiftKey?9==t.keyCode&&window.setTimeout(function(){e.contains(document.activeElement)||r()},500):(t.preventDefault(),h())});var d=p.elements[0];d&&d.focus()}function o(t,e){var n=Object.create(null),r=0;for(var o in t){var s=t[o],a=e[r++],c=s.read(a),l=s.validate(c);if(l)return i(a,l),null;n[o]=s.clean(c)}return n}function i(t,e){var n=t.parentNode,r=n.appendChild(document.createElement("div"));r.style.left=t.offsetLeft+t.offsetWidth+2+"px",r.style.top=t.offsetTop-5+"px",r.className="ProseMirror-invalid",r.textContent=e,setTimeout(function(){return n.removeChild(r)},1500)}var s="ProseMirror-prompt";e.openPrompt=r;var a=function(t){this.options=t};a.prototype.read=function(t){return t.value},a.prototype.validateType=function(){},a.prototype.validate=function(t){return!t&&this.options.required?"Required field":this.validateType(t)||this.options.validate&&this.options.validate(t)},a.prototype.clean=function(t){return this.options.clean?this.options.clean(t):t},e.Field=a;var c=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){var t=document.createElement("input");return t.type="text",t.placeholder=this.options.label,t.value=this.options.value||"",t.autocomplete="off",t},e}(a);e.TextField=c;var l=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){var t=this,e=document.createElement("select");return this.options.options.forEach(function(n){var r=e.appendChild(document.createElement("option"));r.value=n.value,r.selected=n.value==t.options.value,r.label=n.label}),e},e}(a);return e.SelectField=l,n.exports}),t.registerDynamic("28",["26","29","7","22","2a","27"],!0,function(t,e,n){function r(t,e,n){for(var r=t.selection.$from,o=r.depth;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,e,n))return!0}return!1}function o(t){return new M({title:"Insert image",label:"Image",select:function(e){return r(e,t)},run:function(e,n,r){var o=e.selection,i=o.node,s=o.from,a=o.to,c=t&&i&&i.type==t&&i.attrs;V({title:"Insert image",fields:{src:new _({label:"Location",required:!0,value:c&&c.src}),title:new _({label:"Title",value:c&&c.title}),alt:new _({label:"Description",value:c?c.title:e.doc.textBetween(s,a," ")})},callback:function(e){r.dispatch(r.state.tr.replaceSelectionWith(t.createAndFill(e))),r.focus()}})}})}function i(t){if(!/^[1-9]\d*$/.test(t))return"Should be a positive integer"}function s(t){return new M({title:"Insert a table",run:function(e,n,r){V({title:"Insert table",fields:{rows:new _({label:"Rows",validate:i}),cols:new _({label:"Columns",validate:i})},callback:function(e){var n=e.rows,o=e.cols,i=r.state.tr.replaceSelectionWith(D(t,+n,+o));i.setSelection(z.near(i.doc.resolve(r.state.selection.from))),r.dispatch(i.scrollIntoView()),r.focus()}})},select:function(e){for(var n=e.selection.$from,r=n.depth;r>=0;r--){var o=n.index(r);if(n.node(r).canReplaceWith(o,o,t))return!0}return!1},label:"Table"})}function a(t,e){var n={label:e.title,run:t,select:function(e){return t(e)}};for(var r in e)n[r]=e[r];return new M(n)}function c(t,e){var n=t.selection,r=n.from,o=n.$from,i=n.to;return n.empty?e.isInSet(t.storedMarks||o.marks()):t.doc.rangeHasMark(r,i,e)}function l(t,e){var n={active:function(e){return c(e,t)}};for(var r in e)n[r]=e[r];return a(L(t),n)}function p(t){return l(t,{title:"Add or remove link",icon:S.link,run:function(e,n,r){if(c(e,t))return L(t)(e,n),!0;V({title:"Create a link",fields:{href:new _({label:"Link target",required:!0,clean:function(t){return/^https?:\/\//i.test(t)||(t="http://"+t),t}}),title:new _({label:"Title"})},callback:function(e){L(t,e)(r.state,r.dispatch),r.focus()}})}})}function u(t,e){return a(B(t,e.attrs),e)}function f(t){var e,n={};if((e=t.marks.strong)&&(n.toggleStrong=l(e,{title:"Toggle strong style",icon:S.strong})),(e=t.marks.em)&&(n.toggleEm=l(e,{title:"Toggle emphasis",icon:S.em})),(e=t.marks.code)&&(n.toggleCode=l(e,{title:"Toggle code font",icon:S.code})),(e=t.marks.link)&&(n.toggleLink=p(e)),(e=t.nodes.image)&&(n.insertImage=o(e)),(e=t.nodes.bullet_list)&&(n.wrapBulletList=u(e,{title:"Wrap in bullet list",icon:S.bulletList})),(e=t.nodes.ordered_list)&&(n.wrapOrderedList=u(e,{title:"Wrap in ordered list",icon:S.orderedList})),(e=t.nodes.blockquote)&&(n.wrapBlockQuote=d(e,{title:"Wrap in block quote",icon:S.blockquote})),(e=t.nodes.paragraph)&&(n.makeParagraph=m(e,{title:"Change to paragraph",label:"Plain"})),(e=t.nodes.code_block)&&(n.makeCodeBlock=m(e,{title:"Change to code block",label:"Code"})),e=t.nodes.heading)for(var i=1;i<=10;i++)n["makeHead"+i]=m(e,{title:"Change to heading "+i,label:"Level "+i,attrs:{level:i}});if(e=t.nodes.horizontal_rule){var c=e;n.insertHorizontalRule=new M({title:"Insert horizontal rule",label:"Horizontal rule",select:function(t){return r(t,c)},run:function(t,e){e(t.tr.replaceSelectionWith(c.create()))}})}(e=t.nodes.table)&&(n.insertTable=s(e)),(e=t.nodes.table_row)&&(n.addRowBefore=a(N,{title:"Add row before"}),n.addRowAfter=a(E,{title:"Add row after"}),n.removeRow=a(A,{title:"Remove row"}),n.addColumnBefore=a(O,{title:"Add column before"}),n.addColumnAfter=a(T,{title:"Add column after"}),n.removeColumn=a(R,{title:"Remove column"}));var f=function(t){return t.filter(function(t){return t})};n.insertMenu=new v(f([n.insertImage,n.insertHorizontalRule,n.insertTable]),{label:"Insert"}),n.typeMenu=new v(f([n.makeParagraph,n.makeCodeBlock,n.makeHead1&&new g(f([n.makeHead1,n.makeHead2,n.makeHead3,n.makeHead4,n.makeHead5,n.makeHead6]),{label:"Heading"})]),{label:"Type..."});var h=f([n.addRowBefore,n.addRowAfter,n.removeRow,n.addColumnBefore,n.addColumnAfter,n.removeColumn]);return h.length&&(n.tableMenu=new v(h,{label:"Table"})),n.inlineMenu=[f([n.toggleStrong,n.toggleEm,n.toggleCode,n.toggleLink]),[n.insertMenu]],n.blockMenu=[f([n.typeMenu,n.tableMenu,n.wrapBulletList,n.wrapOrderedList,n.wrapBlockQuote,y,w,x])],n.fullMenu=n.inlineMenu.concat(n.blockMenu).concat([[b,k]]),n}
118
+ var h=t("26"),d=h.wrapItem,m=h.blockTypeItem,v=h.Dropdown,g=h.DropdownSubmenu,y=h.joinUpItem,w=h.liftItem,x=h.selectParentNodeItem,b=h.undoItem,k=h.redoItem,S=h.icons,M=h.MenuItem,C=t("29"),D=C.createTable,O=C.addColumnBefore,T=C.addColumnAfter,R=C.removeColumn,N=C.addRowBefore,E=C.addRowAfter,A=C.removeRow,I=t("7"),z=I.Selection,P=t("22"),L=P.toggleMark,F=t("2a"),B=F.wrapInList,q=t("27"),_=q.TextField,V=q.openPrompt;return e.buildMenuItems=f,n.exports}),t.registerDynamic("2b",["9","3","7"],!0,function(t,e,n){function r(t,e){if(t.selection.empty)return!1;if(e){var n=t.selection,r=n.$from,o=n.$to,i=t.tr.deleteSelection().scrollIntoView();r.sameParent(o)&&r.parent.isTextblock&&i.setStoredMarks(r.marks(!0)),e(i)}return!0}function o(t,e,n){var r=t.selection,o=r.$head;if(!r.empty||(n?!n.endOfTextblock("backward",t):o.parentOffset>0))return!1;for(var i,s,a=o.depth-1;!i&&a>=0;a--)o.index(a)>0&&(s=o.before(a+1),i=o.node(a).child(o.index(a)-1));if(!i){var c=o.blockRange(),l=c&&N(c);return null!=l&&(e&&e(t.tr.lift(c,l).scrollIntoView()),!0)}if(i.isLeaf&&q.isSelectable(i)&&0==o.parent.content.size){if(e){var p=t.tr["delete"](s,s+o.parent.nodeSize);p.setSelection(q.create(p.doc,s-i.nodeSize)),e(p.scrollIntoView())}return!0}return i.isLeaf?(e&&e(t.tr["delete"](s-i.nodeSize,s).scrollIntoView()),!0):v(t,s,e)||g(t,s,-1,e)}function i(t,e,n){var r=t.selection,o=r.$head;if(!r.empty||(n?!n.endOfTextblock("forward",t):o.parentOffset<o.parent.content.size))return!1;for(var i,s,a=o.depth-1;!i&&a>=0;a--){var c=o.node(a);o.index(a)+1<c.childCount&&(i=c.child(o.index(a)+1),s=o.after(a+1))}return!!i&&(i.isLeaf?(e&&e(t.tr["delete"](s,s+i.nodeSize).scrollIntoView()),!0):v(t,s,e)||g(t,s,1,e))}function s(t,e){var n,r=t.selection,o=r.node,i=r.from;if(o){if(o.isTextblock||!T(t.doc,i))return!1;n=i}else if(null==(n=O(t.doc,i,-1)))return!1;if(e){var s=t.tr.join(n);t.selection.node&&s.setSelection(q.create(s.doc,n-t.doc.resolve(n).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0}function a(t,e){var n=t.selection.node,r=t.selection.from,o=y(t);if(!o)return!1;if(e){var i=t.tr.join(o);n&&i.setSelection(q.create(i.doc,r)),e(i.scrollIntoView())}return!0}function c(t,e){var n=t.selection,r=n.$from,o=n.$to,i=r.blockRange(o),s=i&&N(i);return null!=s&&(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)}function l(t,e){var n=t.selection,r=n.$head,o=n.anchor;return!(!r||!r.parent.type.spec.code||r.sharedDepth(o)!=r.depth)&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)}function p(t,e){var n=t.selection,r=n.$head,o=n.anchor;if(!r||!r.parent.type.spec.code||r.sharedDepth(o)!=r.depth)return!1;var i=r.node(-1),s=r.indexAfter(-1),a=i.defaultContentType(s);if(!i.canReplaceWith(s,s,a))return!1;if(e){var c=r.after(),l=t.tr.replaceWith(c,c,a.createAndFill());l.setSelection(F.near(l.doc.resolve(c),1)),e(l.scrollIntoView())}return!0}function u(t,e){var n=t.selection,r=n.$from,o=n.$to,i=n.node;if(!i||!i.isBlock)return!1;var s=r.parent.defaultContentType(o.indexAfter());if(!s||!s.isTextblock)return!1;if(e){var a=(r.parentOffset?o:r).pos,c=t.tr.insert(a,s.createAndFill());c.setSelection(B.create(c.doc,a+1)),e(c.scrollIntoView())}return!0}function f(t,e){var n=t.selection,r=n.$head;if(!n.empty||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){var o=r.before();if(E(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}var i=r.blockRange(),s=i&&N(i);return null!=s&&(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)}function h(t,e){var n=t.selection,r=n.$from,o=n.$to,i=n.node;if(i&&i.isBlock)return!(!r.parentOffset||!E(t.doc,r.pos))&&(e&&e(t.tr.split(r.pos).scrollIntoView()),!0);if(e){var s=o.parentOffset==o.parent.content.size,a=t.tr["delete"](r.pos,o.pos),c=0==r.depth?null:r.node(-1).defaultContentType(r.indexAfter(-1)),l=s?[{type:c}]:null,p=E(a.doc,r.pos,1,l);l||p||!E(a.doc,r.pos,1,[{type:c}])||(l=[{type:c}],p=!0),p&&(a.split(r.pos,1,l),s||r.parentOffset||r.parent.type==c||!r.node(-1).canReplace(r.index(-1),r.indexAfter(-1),P.from(c.create(),r.parent))||a.setNodeType(r.before(),c)),e(a.scrollIntoView())}return!0}function d(t,e){var n,r=t.selection;if(r.node){if(!r.$from.depth)return!1;n=r.$from.before()}else{var o=r.$head.sharedDepth(r.anchor);if(0==o)return!1;n=r.$head.before(o)}return e&&e(t.tr.setSelection(q.create(t.doc,n))),!0}function m(t,e,n){var r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!!(r&&o&&r.type.compatibleContent(o.type))&&(!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr["delete"](e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!!e.parent.canReplace(i,i+1)&&(n&&n(t.tr.clearNonMatching(e.pos,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0))}function v(t,e,n){var r,o,i=t.doc.resolve(e),s=i.nodeBefore,a=i.nodeAfter;if(m(t,i,n))return!0;if(a.isTextblock&&i.parent.canReplace(i.index(),i.index()+1)&&(r=(o=s.contentMatchAt(s.childCount)).findWrappingFor(a))&&o.matchType((r[0]||a).type,(r[0]||a).attrs).validEnd()){if(n){for(var c=e+a.nodeSize,l=P.empty,p=r.length-1;p>=0;p--)l=P.from(r[p].type.create(r[p].attrs,l));l=P.from(s.copy(l));var u=t.tr.step(new A(e-1,c,e,c,new z(l,1,0),r.length,!0)),f=c+2*r.length;T(u.doc,f)&&u.join(f),n(u.scrollIntoView())}return!0}var h=F.findFrom(i,1),d=h.$from.blockRange(h.$to),v=d&&N(d);return null!=v&&(n&&n(t.tr.lift(d,v).scrollIntoView()),!0)}function g(t,e,n,r){var o=t.doc.resolve(e),i=n>0?o.nodeAfter:o.nodeBefore;return!(!i||!q.isSelectable(i))&&(r&&r(t.tr.setSelection(q.create(t.doc,e-(n>0?0:i.nodeSize))).scrollIntoView()),!0)}function y(t){var e=t.selection,n=e.node,r=e.to;return n?T(t.doc,r)?r:null:O(t.doc,r,1)}function w(t,e){return function(n,r){var o=n.selection,i=o.$from,s=o.$to,a=i.blockRange(s),c=a&&R(a,t,e);return!!c&&(r&&r(n.tr.wrap(a,c).scrollIntoView()),!0)}}function x(t,e){return function(n,r){var o,i=n.selection,s=i.$from,a=i.$to,c=i.node;if(c)o=s.depth;else{if(!s.depth||a.pos>s.end())return!1;o=s.depth-1}var l=c||s.parent;if(!l.isTextblock||l.hasMarkup(t,e))return!1;var p=s.index(o);if(!s.node(o).canReplaceWith(p,p+1,t))return!1;if(r){var u=s.before(o+1);r(n.tr.clearNonMatching(u,t.contentExpr.start(e)).setNodeType(u,t,e).scrollIntoView())}return!0}}function b(t,e,n,r){var o=t.contentMatchAt(0).allowsMark(r);return t.nodesBetween(e,n,function(t){if(o)return!1;o=t.isTextblock&&t.contentMatchAt(0).allowsMark(r)}),o}function k(t,e){return function(n,r){var o=n.selection,i=o.empty,s=o.from,a=o.to,c=o.$from;return!!b(n.doc,s,a,t)&&(r&&r(i?t.isInSet(n.storedMarks||c.marks())?n.tr.removeStoredMark(t):n.tr.addStoredMark(t.create(e)):n.doc.rangeHasMark(s,a,t)?n.tr.removeMark(s,a,t).scrollIntoView():n.tr.addMark(s,a,t.create(e)).scrollIntoView()),!0)}}function S(t,e){return function(n){if(!n.isGeneric)return t(n);for(var r=[],o=0;o<n.mapping.maps.length;o++){for(var i=n.mapping.maps[o],s=0;s<r.length;s++)r[s]=i.map(r[s]);i.forEach(function(t,e,n,o){return r.push(n,o)})}for(var a=[],c=0;c<r.length;c+=2)for(var l=r[c],p=r[c+1],u=n.doc.resolve(l),f=u.sharedDepth(p),h=u.node(f),d=u.indexAfter(f),m=u.after(f+1);m<=p;++d){var v=h.maybeChild(d);if(!v)break;if(d&&-1==a.indexOf(m)){var g=h.child(d-1);g.type==v.type&&e(g,v)&&a.push(m)}m+=v.nodeSize}a.sort(function(t,e){return t-e});for(var y=a.length-1;y>=0;y--)T(n.doc,a[y])&&n.join(a[y]);t(n)}}function M(t,e){if(Array.isArray(e)){var n=e;e=function(t){return n.indexOf(t.type.name)>-1}}return function(n,r){return t(n,r&&S(r,e))}}function C(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return function(e,n,r){for(var o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}var D=t("9"),O=D.joinPoint,T=D.canJoin,R=D.findWrapping,N=D.liftTarget,E=D.canSplit,A=D.ReplaceAroundStep,I=t("3"),z=I.Slice,P=I.Fragment,L=t("7"),F=L.Selection,B=L.TextSelection,q=L.NodeSelection;e.deleteSelection=r,e.joinBackward=o,e.joinForward=i,e.joinUp=s,e.joinDown=a,e.lift=c,e.newlineInCode=l,e.exitCode=p,e.createParagraphNear=u,e.liftEmptyBlock=f,e.splitBlock=h,e.selectParentNode=d,e.wrapIn=w,e.setBlockType=x,e.toggleMark=k,e.autoJoin=M,e.chainCommands=C;var _={Enter:C(l,u,f,h),"Mod-Enter":p,Backspace:C(r,o),"Mod-Backspace":C(r,o),Delete:C(r,i),"Mod-Delete":C(r,i),"Alt-ArrowUp":s,"Alt-ArrowDown":a,"Mod-BracketLeft":c,Escape:d};if("undefined"!=typeof navigator?/Mac/.test(navigator.platform):"undefined"!=typeof os&&"darwin"==os.platform()){var V={"Ctrl-h":_.Backspace,"Alt-Backspace":_["Mod-Backspace"],"Ctrl-d":_.Delete,"Ctrl-Alt-Backspace":_["Mod-Delete"],"Alt-Delete":_["Mod-Delete"],"Alt-d":_["Mod-Delete"]};for(var j in V)_[j]=V[j]}return e.baseKeymap=_,n.exports}),t.registerDynamic("22",["2b"],!0,function(t,e,n){return n.exports=t("2b"),n.exports}),t.registerDynamic("2c",["3","9","7"],!0,function(t,e,n){function r(t,e){var n={};for(var r in t)n[r]=t[r];for(var o in e)n[o]=e[o];return n}function o(t,e,n){return t.append({table:r(R,{content:"table_row[columns=.columns]+",group:n}),table_row:r(N,{content:"table_cell{.columns}"}),table_cell:r(E,{content:e})})}function i(t,e,n,r){r=s(r,n);for(var o=t.contentExpr.elements[0].nodeTypes[0],i=o.contentExpr.elements[0].nodeTypes[0],a=i.createAndFill(),c=[],l=0;l<n;l++)c.push(a);for(var p=o.create({columns:n},x.from(c)),u=[],f=0;f<e;f++)u.push(p);return t.create(r,x.from(u))}function s(t,e){var n=Object.create(null);if(t)for(var r in t)n[r]=t[r];return n.columns=e,n}function a(t,e){return s(t,t.columns+e)}function c(t,e){for(var n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRow&&(!e||e(n)))return n;return-1}function l(t,e){var n,r=t.selection.$from,o=c(r,function(t){return n=t==r.depth?r.nodeBefore:r.node(t+1)});return-1!=o&&(e&&e(t.tr.step(A.create(t.doc,r.before(o-1),r.index(o),n.type,n.attrs))),!0)}function p(t,e){var n,r=t.selection.$from,o=c(r,function(t){return n=t==r.depth?r.nodeAfter:r.node(t+1)});return-1!=o&&(e&&e(t.tr.step(A.create(t.doc,r.before(o-1),r.indexAfter(o)+(o==r.depth?1:0),n.type,n.attrs))),!0)}function u(t,e){var n=t.selection.$from,r=c(n,function(t){return n.node(t).childCount>1});return-1!=r&&(e&&e(t.tr.step(I.create(t.doc,n.before(r-1),n.index(r)))),!0)}function f(t,e,n){var r=t.selection.$from,o=c(r);if(-1==o)return!1;if(e){var i=r.node(o),s=[],a=n<0?r.before(o):r.after(o);i.forEach(function(t){return s.push(t.type.createAndFill(t.attrs))});var l=i.copy(x.from(s));e(t.tr.step(new D(a,a,new b(x.from(l),0,0))))}return!0}function h(t,e){return f(t,e,-1)}function d(t,e){return f(t,e,1)}function m(t,e){var n=t.selection.$from,r=c(n,function(t){return n.node(t-1).childCount>1});return-1!=r&&(e&&e(t.tr.step(new D(n.before(r),n.after(r),b.empty))),!0)}function v(t,e,n){var r=t.selection,o=r.$from,i=c(o);if(-1==i)return!1;var s=o.node(i),a=o.index(i)+e;if(a>=0&&a<s.childCount){var l=t.doc.resolve(s.content.offsetAt(a)+o.start(i)),p=T.findFrom(l,1);return!(!p||p.from>=l.end())&&(n&&n(t.tr.setSelection(p).scrollIntoView()),!0)}var u=o.index(i-1)+e,f=o.node(i-1);if(u<0||u>=f.childCount)return!1;var h=e>0?o.after(i)+2:o.before(i)-2-f.child(u).lastChild.content.size,d=t.doc.resolve(h),m=T.findFrom(d,1);return!(!m||m.from>=d.end())&&(n&&n(t.tr.setSelection(m).scrollIntoView()),!0)}function g(t,e){return v(t,1,e)}function y(t,e){return v(t,-1,e)}var w=t("3"),x=w.Fragment,b=w.Slice,k=t("9"),S=k.Step,M=k.StepResult,C=k.StepMap,D=k.ReplaceStep,O=t("7"),T=O.Selection,R={attrs:{columns:{"default":1}},parseDOM:[{tag:"table",getAttrs:function(t){var e=t.querySelector("tr");return!(!e||!e.children.length)&&{columns:e.children.length}}}],toDOM:function(){return["table",["tbody",0]]}};e.table=R;var N={attrs:{columns:{"default":1}},parseDOM:[{tag:"tr",getAttrs:function(t){return!!t.children.length&&{columns:t.children.length}}}],toDOM:function(){return["tr",0]},tableRow:!0};e.tableRow=N;var E={parseDOM:[{tag:"td"}],toDOM:function(){return["td",0]}};e.tableCell=E,e.addTableNodes=o,e.createTable=i;var A=function(t){function e(e,n){t.call(this),this.positions=e,this.cells=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t,n,r,o,i){var s=o.createAndFill(i),a=[],c=[];return t.nodeAt(n).forEach(function(t,e){for(var o=n+2+e,i=0;i<r;i++)o+=t.child(i).nodeSize;a.push(o),c.push(s)}),new e(a,c)},e.prototype.apply=function(t){for(var e=this,n=null,r=null,o=null,i=0;i<this.positions.length;i++){var s=t.resolve(e.positions[i]);if(s.depth<2||s.index(-1)!=i)return M.fail("Invalid cell insert position");if(null==r){if(r=s.node(-1),r.childCount!=e.positions.length)return M.fail("Mismatch in number of rows");o=s.before(-1),n=s.index()}else if(s.before(-1)!=o||s.index()!=n)return M.fail("Column insert positions not consistent")}for(var c=[],l=0;l<r.childCount;l++){for(var p=r.child(l),u=n?[]:[e.cells[l]],f=0;f<p.childCount;f++)u.push(p.child(f)),f+1==n&&u.push(e.cells[l]);c.push(p.type.create(a(p.attrs,1),x.from(u)))}var h=r.type.create(a(r.attrs,1),x.from(c));return M.fromReplace(t,o,o+r.nodeSize,new b(x.from(h),0,0))},e.prototype.getMap=function(){for(var t=this,e=[],n=0;n<this.positions.length;n++)e.push(t.positions[n],0,t.cells[n].nodeSize);return new C(e)},e.prototype.invert=function(t){for(var e=this,n=t.resolve(this.positions[0]),r=n.node(-1),o=[],i=[],s=0,a=0;a<r.childCount;a++){var c=e.positions[a]+s,l=e.cells[a].nodeSize;o.push(c),i.push(c+l),s+=l}return new I(o,i)},e.prototype.map=function(t){return new e(this.positions.map(function(e){return t.map(e)}),this.cells)},e.prototype.toJSON=function(){return{stepType:this.jsonID,positions:this.positions,cells:this.cells.map(function(t){return t.toJSON()})}},e.fromJSON=function(t,n){return new e(n.positions,n.cells.map(t.nodeFromJSON))},e}(S);e.AddColumnStep=A,S.jsonID("addTableColumn",A);var I=function(t){function e(e,n){t.call(this),this.from=e,this.to=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t,n,r){var o=[],i=[];return t.nodeAt(n).forEach(function(t,e){for(var s=n+2+e,a=0;a<r;a++)s+=t.child(a).nodeSize;o.push(s),i.push(s+t.child(r).nodeSize)}),new e(o,i)},e.prototype.apply=function(t){for(var e=this,n=null,r=null,o=null,i=0;i<this.from.length;i++){var s=t.resolve(e.from[i]),c=s.nodeAfter;if(s.depth<2||s.index(-1)!=i||!c||e.from[i]+c.nodeSize!=e.to[i])return M.fail("Invalid cell delete positions");if(null==r){if(r=s.node(-1),r.childCount!=e.from.length)return M.fail("Mismatch in number of rows");o=s.before(-1),n=s.index()}else if(s.before(-1)!=o||s.index()!=n)return M.fail("Column delete positions not consistent")}for(var l=[],p=0;p<r.childCount;p++){for(var u=r.child(p),f=[],h=0;h<u.childCount;h++)h!=n&&f.push(u.child(h));l.push(u.type.create(a(u.attrs,-1),x.from(f)))}var d=r.type.create(a(r.attrs,-1),x.from(l));return M.fromReplace(t,o,o+r.nodeSize,new b(x.from(d),0,0))},e.prototype.getMap=function(){for(var t=this,e=[],n=0;n<this.from.length;n++)e.push(t.from[n],t.to[n]-t.from[n],0);return new C(e)},e.prototype.invert=function(t){for(var e=this,n=t.resolve(this.from[0]),r=n.node(-1),o=n.index(),i=[],s=[],a=0,c=0;c<r.childCount;c++){i.push(e.from[c]-a);var l=r.child(c).child(o);a+=l.nodeSize,s.push(l)}return new A(i,s)},e.prototype.map=function(t){for(var n=this,r=[],o=[],i=0;i<this.from.length;i++){var s=t.map(n.from[i],1),a=t.map(n.to[i],-1);if(a<=s)return null;r.push(s),o.push(a)}return new e(r,o)},e.fromJSON=function(t,n){return new e(n.from,n.to)},e}(S);return e.RemoveColumnStep=I,S.jsonID("removeTableColumn",I),e.addColumnBefore=l,e.addColumnAfter=p,e.removeColumn=u,e.addRowBefore=h,e.addRowAfter=d,e.removeRow=m,e.selectNextCell=g,e.selectPreviousCell=y,n.exports}),t.registerDynamic("29",["2c"],!0,function(t,e,n){return n.exports=t("2c"),n.exports}),t.registerDynamic("2d",[],!0,function(t,e,n){var r=200,o=function(){};o.prototype.append=function(t){return t.length?(t=o.from(t),!this.length&&t||t.length<r&&this.leafAppend(t)||this.length<r&&t.leafPrepend(this)||this.appendInner(t)):this},o.prototype.prepend=function(t){return t.length?o.from(t).append(this):this},o.prototype.appendInner=function(t){return new s(this,t)},o.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?o.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},o.prototype.get=function(t){return t<0||t>=this.length?undefined:this.getInner(t)},o.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},o.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(e,n){return r.push(t(e,n))},e,n),r},o.from=function(t){return t instanceof o?t:t&&t.length?new i(t):o.empty};var i=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{},depth:{}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var o=this,i=e;i<n;i++)if(!1===t(o.values[i],r+i))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var o=this,i=e-1;i>=n;i--)if(!1===t(o.values[i],r+i))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=r)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=r)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(o);o.empty=new i([]);var s=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var o=this.left.length;return!(e<o&&!1===this.left.forEachInner(t,e,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(t,Math.max(e-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var o=this.left.length;return!(e>o&&!1===this.right.forEachInvertedInner(t,e-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(t,Math.min(e,o),n,r))&&void 0)},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(o);return n.exports=o,n.exports}),t.registerDynamic("2e",["2d"],!0,function(t,e,n){return n.exports=t("2d"),n.exports}),t.registerDynamic("2f",[],!0,function(t,e,n){function r(t,e,n,o,i,c){if(e.isTextblock)return s.create(t,n);for(var l=o-(i>0?0:1);i>0?l<e.childCount:l>=0;l+=i){var p=e.child(l);if(p.isLeaf){if(!c&&a.isSelectable(p))return a.create(t,n-(i<0?p.nodeSize:0))}else{var u=r(t,p,n+i,i<0?p.childCount:0,i,c);if(u)return u}n+=p.nodeSize*i}}var o=function(t,e){this.$from=t,this.$to=e},i={from:{},to:{},empty:{}};i.from.get=function(){return this.$from.pos},i.to.get=function(){return this.$to.pos},i.empty.get=function(){return this.from==this.to},o.findFrom=function(t,e,n){var o=t.parent.isTextblock?new s(t):r(t.node(0),t.parent,t.pos,t.index(),e,n);if(o)return o;for(var i=t.depth-1;i>=0;i--){var a=e<0?r(t.node(0),t.node(i),t.before(i+1),t.index(i),e,n):r(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,e,n);if(a)return a}},o.near=function(t,e,n){void 0===e&&(e=1),void 0===n&&(n=!1);var r=this.findFrom(t,e,n)||this.findFrom(t,-e,n);if(!r)throw new RangeError("Searching for selection in invalid document "+t.node(0));return r},o.atStart=function(t,e){return r(t,t,0,0,1,e)},o.atEnd=function(t,e){return r(t,t,t.content.size,t.childCount,-1,e)},o.between=function(t,e,n){var r=o.near(e,n);if(r instanceof s){var i=o.findFrom(t,t.pos>r.to?-1:1,!0);r=new s(i.$anchor,r.$head)}else if(t.pos<r.from||t.pos>r.to){var a=t.pos>r.to,c=o.findFrom(t,a?-1:1,!0),l=o.findFrom(a?r.$from:r.$to,a?1:-1,!0);c&&l&&(r=new s(c.$anchor,l.$head))}return r},o.mapJSON=function(t,e){return null!=t.anchor?{head:e.map(t.head),anchor:e.map(t.anchor)}:{node:e.map(t.node),after:e.map(t.after,-1)}},o.fromJSON=function(t,e){if(null!=e.head){var n=t.resolve(e.anchor),r=t.resolve(e.head);return n.parent.isTextblock&&r.parent.isTextblock?new s(n,r):o.between(n,r)}var i=t.resolve(e.node),c=i.nodeAfter;return c&&e.after==e.pos+c.nodeSize&&a.isSelectable(c)?new a(i):o.near(i)},Object.defineProperties(o.prototype,i),e.Selection=o;var s=function(t){function e(e,n){void 0===n&&(n=e);var r=e.pos>n.pos;t.call(this,r?n:e,r?e:n),this.$anchor=e,this.$head=n}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={anchor:{},head:{},inverted:{}};return n.anchor.get=function(){return this.$anchor.pos},n.head.get=function(){return this.$head.pos},n.inverted.get=function(){return this.anchor>this.head},e.prototype.eq=function(t){return t instanceof e&&t.head==this.head&&t.anchor==this.anchor},e.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));if(!o.parent.isTextblock)return t.near(o);var i=n.resolve(r.map(this.anchor));return new e(i.parent.isTextblock?i:o,o)},e.prototype.toJSON=function(){return{head:this.head,anchor:this.anchor}},e.create=function(t,e,n){void 0===n&&(n=e);var r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))},Object.defineProperties(e.prototype,n),e}(o);e.TextSelection=s;var a=function(t){function e(e){var n=e.node(0).resolve(e.pos+e.nodeAfter.nodeSize);t.call(this,e,n),this.node=e.nodeAfter}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.eq=function(t){return t instanceof e&&this.from==t.from},e.prototype.map=function(n,r){var o=r.mapResult(this.from,1),i=r.mapResult(this.to,-1),s=n.resolve(o.pos),a=s.nodeAfter;return!o.deleted&&!i.deleted&&a&&i.pos==o.pos+a.nodeSize&&e.isSelectable(a)?new e(s):t.near(s)},e.prototype.toJSON=function(){return{node:this.from,after:this.to}},e.create=function(t,e){return new this(t.resolve(e))},e.isSelectable=function(t){return!t.isText&&!1!==t.type.spec.selectable},e}(o);return e.NodeSelection=a,n.exports}),t.registerDynamic("30",["9","3","2f"],!0,function(t,e,n){function r(t,e,n){if(t.steps.length!=e){var r,o=t.mapping.maps[t.mapping.maps.length-1];o.forEach(function(t,e,n,o){return r=o}),null!=r&&t.setSelection(p.near(t.doc.resolve(r),n))}}function o(t){return null==t.head?c.none:t.$head.marks()}var i=t("9"),s=i.Transform,a=t("3"),c=a.Mark,l=t("2f"),p=l.Selection,u=1,f=2,h=4,d=function(t){function e(e){t.call(this,e.doc),this.time=Date.now(),this.curSelection=e.selection,this.curSelectionFor=0,this.storedMarks=e.storedMarks,this.updated=0,this.meta=Object.create(null)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={docChanged:{},selection:{},selectionSet:{},storedMarksSet:{},isGeneric:{},scrolledIntoView:{}};return n.docChanged.get=function(){return this.steps.length>0},n.selection.get=function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection},e.prototype.setSelection=function(t){return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|u)&~f,this.storedMarks=null,this},n.selectionSet.get=function(){return(this.updated&u)>0},e.prototype.setStoredMarks=function(t){return this.storedMarks=t,this.updated|=f,this},n.storedMarksSet.get=function(){return(this.updated&f)>0},e.prototype.addStep=function(e,n){t.prototype.addStep.call(this,e,n),this.updated=this.updated&~f,this.storedMarks=null},e.prototype.setTime=function(t){return this.time=t,this},e.prototype.replaceSelection=function(t){var e=this.selection,n=e.from,o=e.to,i=this.steps.length;this.replaceRange(n,o,t);for(var s=t.content.lastChild,a=null,c=0;c<t.openRight;c++)a=s,s=s.lastChild;return r(this,i,(s?s.isInline:a&&a.isTextblock)?-1:1),this},e.prototype.replaceSelectionWith=function(t,e){var n=this.selection,o=n.$from,i=n.from,s=n.to,a=this.steps.length;return!1!==e&&(t=t.mark(this.storedMarks||o.marks(s>i))),this.replaceRangeWith(i,s,t),r(this,a,t.isInline?-1:1),this},e.prototype.deleteSelection=function(){var t=this.selection,e=t.from,n=t.to;return this.deleteRange(e,n)},e.prototype.insertText=function(t,e,n){void 0===n&&(n=e);var r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();if(!t)return this.deleteRange(e,n);var o=r.text(t,this.storedMarks||this.doc.resolve(e).marks(n>e));return this.replaceRangeWith(e,n,o)},e.prototype.setMeta=function(t,e){return this.meta["string"==typeof t?t:t.key]=e,this},e.prototype.getMeta=function(t){return this.meta["string"==typeof t?t:t.key]},n.isGeneric.get=function(){var t=this;for(var e in t.meta)return!1;return!0},e.prototype.scrollIntoView=function(){return this.updated|=h,this},n.scrolledIntoView.get=function(){return(this.updated&h)>0},e.prototype.addStoredMark=function(t){return this.storedMarks=t.addToSet(this.storedMarks||o(this.selection)),this},e.prototype.removeStoredMark=function(t){return this.storedMarks=t.removeFromSet(this.storedMarks||o(this.selection)),this},Object.defineProperties(e.prototype,n),e}(s);return e.Transaction=d,n.exports}),t.registerDynamic("31",["3","2f","30"],!0,function(t,e,n){function r(t,e){return e&&t?t.bind(e):t}var o=t("3"),i=o.Node,s=t("2f"),a=s.Selection,c=t("30"),l=c.Transaction,p=function(t,e,n){this.name=t,this.init=r(e.init,n),this.apply=r(e.apply,n)},u=[new p("doc",{init:function(t){return t.doc||t.schema.nodes.doc.createAndFill()},apply:function(t){return t.doc}}),new p("selection",{init:function(t,e){return t.selection||a.atStart(e.doc)},apply:function(t){return t.selection}}),new p("storedMarks",{init:function(){return null},apply:function(t,e,n,r){return r.selection.empty?t.storedMarks:null}}),new p("scrollToSelection",{init:function(){return 0},apply:function(t,e){return t.scrolledIntoView?e+1:e}})],f=function(t,e){var n=this;this.schema=t,this.fields=u.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),e&&e.forEach(function(t){if(n.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");n.plugins.push(t),n.pluginsByKey[t.key]=t,t.options.state&&n.fields.push(new p(t.key,t.options.state,t))})},h=function(t){this.config=t},d={schema:{},plugins:{},tr:{}};d.schema.get=function(){return this.config.schema},d.plugins.get=function(){return this.config.plugins},h.prototype.apply=function(t){return this.applyTransaction(t).state},h.prototype.filterTransaction=function(t,e){var n=this;void 0===e&&(e=-1);for(var r=0;r<this.config.plugins.length;r++)if(r!=e){var o=n.config.plugins[r];if(o.options.filterTransaction&&!o.options.filterTransaction.call(o,t,n))return!1}return!0},h.prototype.applyTransaction=function(t){var e=this;if(!this.filterTransaction(t))return{state:this,transactions:[]};for(var n=[t],r=this.applyInner(t),o=null;;){for(var i=!1,s=0;s<this.config.plugins.length;s++){var a=e.config.plugins[s];if(a.options.appendTransaction){var c=o?o[s].n:0,l=o?o[s].state:e,p=c<n.length&&a.options.appendTransaction.call(a,c?n.slice(c):n,l,r);if(p&&r.filterTransaction(p,s)){if(!o){o=[];for(var u=0;u<this.config.plugins.length;u++)o.push(u<s?{state:r,n:n.length}:{state:e,n:0})}n.push(p),r=r.applyInner(p),i=!0}o&&(o[s]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}},h.prototype.applyInner=function(t){var e=this;if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var n=new h(this.config),r=this.config.fields,o=0;o<r.length;o++){var i=r[o];n[i.name]=i.apply(t,e[i.name],e,n)}for(var s=0;s<m.length;s++)m[s](e,t,n);return n},d.tr.get=function(){return new l(this)},h.create=function(t){for(var e=new f(t.schema||t.doc.type.schema,t.plugins),n=new h(e),r=0;r<e.fields.length;r++)n[e.fields[r].name]=e.fields[r].init(t,n);return n},h.prototype.reconfigure=function(t){for(var e=this,n=new f(t.schema||this.schema,t.plugins),r=n.fields,o=new h(n),i=0;i<r.length;i++){var s=r[i].name;o[s]=e.hasOwnProperty(s)?e[s]:r[i].init(t,o)}return o},h.prototype.toJSON=function(t){var e=this,n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(t)for(var r in t){if("doc"==r||"selection"==r)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var o=t[r],i=o.options.state;i&&i.toJSON&&(n[r]=i.toJSON.call(o,e[o.key]))}return n},h.fromJSON=function(t,e,n){if(!t.schema)throw new RangeError("Required config field 'schema' missing");var r=new f(t.schema,t.plugins),o=new h(r);return r.fields.forEach(function(r){if("doc"==r.name)o.doc=i.fromJSON(t.schema,e.doc);else if("selection"==r.name)o.selection=a.fromJSON(o.doc,e.selection);else{if(n)for(var s in n){var c=n[s],l=c.options.state;if(c.key==r.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(e,s))return void(o[r.name]=l.fromJSON.call(c,t,e[s],o))}o[r.name]=r.init(t,o)}}),o},h.addApplyListener=function(t){m.push(t)},h.removeApplyListener=function(t){var e=m.indexOf(t);e>-1&&m.splice(e,1)},Object.defineProperties(h.prototype,d),e.EditorState=h;var m=[];return n.exports}),t.registerDynamic("32",[],!0,function(t,e,n){function r(t){return t in i?t+"$"+ ++i[t]:(i[t]=0,t+"$")}var o=function(t){var e=this;if(this.props={},t.props)for(var n in t.props){var o=t.props[n];o instanceof Function&&(o=o.bind(e)),e.props[n]=o}this.options=t,this.key=t.key?t.key.key:r("plugin")};o.prototype.getState=function(t){return t[this.key]},e.Plugin=o;var i=Object.create(null),s=function(t){void 0===t&&(t="key"),this.key=r(t)};return s.prototype.get=function(t){return t.config.pluginsByKey[this.key]},s.prototype.getState=function(t){return t[this.key]},e.PluginKey=s,n.exports}),t.registerDynamic("33",["2f","30","31","32"],!0,function(t,e,n){var r;r=t("2f"),e.Selection=r.Selection,e.TextSelection=r.TextSelection,e.NodeSelection=r.NodeSelection,e.Transaction=t("30").Transaction,e.EditorState=t("31").EditorState;var o;return o=t("32"),e.Plugin=o.Plugin,e.PluginKey=o.PluginKey,n.exports}),t.registerDynamic("7",["33"],!0,function(t,e,n){return n.exports=t("33"),n.exports}),t.registerDynamic("34",["2e","9","7"],!0,function(t,e,n){function r(t,e){var n;return t.forEach(function(t,r){if(t.selection&&0==e--)return n=r,!1}),t.slice(n)}function o(t,e,n,r){var o,s=n.getMeta(M);if(s)return s;if(0==n.steps.length)return n.getMeta(C)?new k(t.done,t.undone,null,0):t;if(!1!==n.getMeta("addToHistory")){var a=t.prevTime<(n.time||0)-r.newGroupDelay||!i(n,t.prevMap,t.done);return new k(t.done.addTransform(n,a?e.toJSON():null,r),x.empty,n.mapping.maps[n.steps.length-1],n.time)}return(o=n.getMeta("rebased"))?new k(t.done.rebased(n,o),t.undone.rebased(n,o),t.prevMap&&n.mapping.maps[n.steps.length-1],t.prevTime):new k(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),t.prevMap,t.prevTime)}function i(t,e,n){if(!e)return!1;var r=t.mapping.maps[0],o=!1;return!r||(r.forEach(function(t,r){n.items.forEach(function(n){if(n.step)return e.forEach(function(e,n,i,s){t<=s&&r>=i&&(o=!0)}),!1;t=n.map.invert().map(t,-1),r=n.map.invert().map(r,1)},n.items.length,0)}),o)}function s(t,e,n,r){var o=M.get(e).options.config,i=(r?t.undone:t.done).popEvent(e,o.preserveItems);if(i){var s=e.selection,a=g.fromJSON(i.transform.doc,i.selection),c=(r?t.done:t.undone).addTransform(i.transform,s.toJSON(),o),l=new k(r?c:i.remaining,r?i.remaining:c,null,0);n(i.transform.setSelection(a).setMeta(M,l).scrollIntoView())}}function a(t){return t.tr.setMeta(C,!0)}function c(t){return t={depth:t&&t.depth||100,preserveItems:!(!t||!t.preserveItems),newGroupDelay:t&&t.newGroupDelay||500},new y({key:M,state:{init:function(){return new k(x.empty,x.empty,null,0)},apply:function(e,n,r){return o(n,r.selection,e,t)}},config:t})}function l(t,e){var n=M.getState(t);return!(!n||0==n.done.eventCount)&&(e&&s(n,t,e,!1),!0)}function p(t,e){var n=M.getState(t);return!(!n||0==n.undone.eventCount)&&(e&&s(n,t,e,!0),!0)}function u(t){var e=M.getState(t);return e?e.done.eventCount:0}function f(t){var e=M.getState(t);return e?e.undone.eventCount:0}var h=t("2e"),d=t("9"),m=d.Mapping,v=t("7"),g=v.Selection,y=v.Plugin,w=v.PluginKey,x=function(t,e){this.items=t,this.eventCount=e}
119
+ ;x.prototype.popEvent=function(t,e){var n=this;if(0==this.eventCount)return null;for(var r=this.items.length;;r--)if(n.items.get(r-1).selection){--r;break}var o,i;e&&(o=this.remapping(r,this.items.length),i=o.maps.length);var s,a,c=t.tr,l=[],p=[];return this.items.forEach(function(t,e){if(!t.step)return o||(o=n.remapping(r,e+1),i=o.maps.length),i--,void p.push(t);if(o){p.push(new b(t.map));var u,f=t.step.map(o.slice(i));f&&c.maybeStep(f).doc&&(u=c.mapping.maps[c.mapping.maps.length-1],l.push(new b(u,null,null,l.length+p.length))),i--,u&&o.appendMap(u,i)}else c.maybeStep(t.step);return t.selection?(s=o?g.mapJSON(t.selection,o.slice(i)):t.selection,a=new x(n.items.slice(0,r).append(p.reverse().concat(l)),n.eventCount-1),!1):void 0},this.items.length,0),{remaining:a,transform:c,selection:s}},x.prototype.addTransform=function(t,e,n){for(var o=[],i=this.eventCount+(e?1:0),s=this.items,a=!n.preserveItems&&s.length?s.get(s.length-1):null,c=0;c<t.steps.length;c++){var l=t.steps[c].invert(t.docs[c]),p=new b(t.mapping.maps[c],l,e),u=void 0;(u=a&&a.merge(p))&&(p=u,c?o.pop():s=s.slice(0,s.length-1)),o.push(p),e=null,n.preserveItems||(a=p)}var f=i-n.depth;return f>S&&(s=r(s,f),i-=f),new x(s.append(o),i)},x.prototype.remapping=function(t,e){var n=[],r=[];return this.items.forEach(function(e,o){null!=e.mirrorOffset&&o-e.mirrorOffset>=t&&r.push(n.length-e.mirrorOffset,n.length),n.push(e.map)},t,e),new m(n,r)},x.prototype.addMaps=function(t){return 0==this.eventCount?this:new x(this.items.append(t.map(function(t){return new b(t)})),this.eventCount)},x.prototype.rebased=function(t,e){if(!this.eventCount)return this;var n=[],r=this.items.length-e,o=0;r<0&&(o=-r,r=0);var i=t.mapping,s=t.steps.length,a=this.eventCount,c=o;this.items.forEach(function(e){var r=i.getMirror(c++);if(null!=r){s=Math.min(s,r);var o=i.maps[r];if(e.step){var l=t.steps[r].invert(t.docs[r]),p=e.selection&&g.mapJSON(e.selection,i.slice(c-1,r));n.push(new b(o,l,p))}else e.selection&&a--,n.push(new b(o))}},r);for(var l=[],p=e;p<s;p++)l.push(new b(i.maps[p]));var u=this.items.slice(0,r).append(l).append(n),f=new x(u,a);return f.emptyItemCount()>500&&(f=f.compress(this.items.length-n.length)),f},x.prototype.emptyItemCount=function(){var t=0;return this.items.forEach(function(e){e.step||t++}),t},x.prototype.compress=function(t){void 0===t&&(t=this.items.length);var e=this.remapping(0,t),n=e.maps.length,r=[],o=0;return this.items.forEach(function(i,s){if(s>=t)r.push(i),i.selection&&o++;else if(i.step){var a=i.step.map(e.slice(n)),c=a&&a.getMap();if(n--,c&&e.appendMap(c,n),a){var l=i.selection&&g.mapJSON(i.selection,e.slice(n));l&&o++;var p,u=new b(c.invert(),a,l),f=r.length-1;(p=r.length&&r[f].merge(u))?r[f]=p:r.push(u)}}else i.map&&n--},this.items.length,0),new x(h.from(r.reverse()),o)},x.empty=new x(h.empty,0);var b=function(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r};b.prototype.merge=function(t){if(this.step&&t.step&&!t.selection){var e=t.step.merge(this.step);if(e)return new b(e.getMap().invert(),e,this.selection)}};var k=function(t,e,n,r){this.done=t,this.undone=e,this.prevMap=n,this.prevTime=r};e.HistoryState=k;var S=20;e.closeHistory=a;var M=new w("history"),C=new w("closeHistory");return e.history=c,e.undo=l,e.redo=p,e.undoDepth=u,e.redoDepth=f,n.exports}),t.registerDynamic("23",["34"],!0,function(t,e,n){return n.exports=t("34"),n.exports}),t.registerDynamic("35",["22","29","2a","23"],!0,function(t,e,n){function r(t,e){function n(t,n){if(e){var r=e[t];if(!1===r)return;r&&(t=r)}o[t]=n}var r,o={};if(n("Mod-z",w),n("Shift-Mod-z",x),b||n("Mod-y",x),(r=t.marks.strong)&&n("Mod-b",c(r)),(r=t.marks.em)&&n("Mod-i",c(r)),(r=t.marks.code)&&n("Mod-`",c(r)),(r=t.nodes.bullet_list)&&n("Shift-Ctrl-8",d(r)),(r=t.nodes.ordered_list)&&n("Shift-Ctrl-9",d(r)),(r=t.nodes.blockquote)&&n("Ctrl->",i(r)),r=t.nodes.hard_break){var p=r,h=a(l,function(t,e){return e(t.tr.replaceSelectionWith(p.create()).scrollIntoView()),!0});n("Mod-Enter",h),n("Shift-Enter",h),b&&n("Ctrl-Enter",h)}if((r=t.nodes.list_item)&&(n("Enter",m(r)),n("Mod-[",v(r)),n("Mod-]",g(r))),(r=t.nodes.paragraph)&&n("Shift-Ctrl-0",s(r)),(r=t.nodes.code_block)&&n("Shift-Ctrl-\\",s(r)),r=t.nodes.heading)for(var y=1;y<=6;y++)n("Shift-Ctrl-"+y,s(r,{level:y}));if(r=t.nodes.horizontal_rule){var k=r;n("Mod-_",function(t,e){return e(t.tr.replaceSelectionWith(k.create()).scrollIntoView()),!0})}return t.nodes.table_row&&(n("Tab",u),n("Shift-Tab",f)),o}var o=t("22"),i=o.wrapIn,s=o.setBlockType,a=o.chainCommands,c=o.toggleMark,l=o.exitCode,p=t("29"),u=p.selectNextCell,f=p.selectPreviousCell,h=t("2a"),d=h.wrapInList,m=h.splitListItem,v=h.liftListItem,g=h.sinkListItem,y=t("23"),w=y.undo,x=y.redo,b="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);return e.buildKeymap=r,n.exports}),t.registerDynamic("36",["b","f","23","22","7","12","28","35"],!0,function(t,e,n){function r(t){var e=[u({rules:f.concat(o(t.schema))}),d(D(t.schema,t.mapKeys)),d(y),k()];return!1!==t.history&&e.push(v()),e.concat(new x({props:{attributes:{"class":"ProseMirror-example-setup-style"},menuContent:M(t.schema).fullMenu,floatingMenu:!0}}))}function o(t){var e,n=[];return(e=t.nodes.blockquote)&&n.push(s(e)),(e=t.nodes.ordered_list)&&n.push(a(e)),(e=t.nodes.bullet_list)&&n.push(c(e)),(e=t.nodes.code_block)&&n.push(l(e)),(e=t.nodes.heading)&&n.push(p(e,6)),n}var i=t("b"),s=i.blockQuoteRule,a=i.orderedListRule,c=i.bulletListRule,l=i.codeBlockRule,p=i.headingRule,u=i.inputRules,f=i.allInputRules,h=t("f"),d=h.keymap,m=t("23"),v=m.history,g=t("22"),y=g.baseKeymap,w=t("7"),x=w.Plugin,b=t("12"),k=b.dropCursor,S=t("28"),M=S.buildMenuItems;e.buildMenuItems=M;var C=t("35"),D=C.buildKeymap;return e.buildKeymap=D,e.exampleSetup=r,e.buildInputRules=o,n.exports}),t.registerDynamic("37",["36"],!0,function(t,e,n){return n.exports=t("36"),n.exports}),t.registerDynamic("38",["3","39"],!0,function(t,e,n){function r(t,e,n){for(var o=[],s=0;s<t.childCount;s++){var a=t.child(s);a.content.size&&(a=a.copy(r(a.content,e,a))),a.isInline&&(a=e(a,n,s)),o.push(a)}return i.fromArray(o)}var o=t("3"),i=o.Fragment,s=o.Slice,a=t("39"),c=a.Step,l=a.StepResult,p=function(t){function e(e,n,r){t.call(this),this.from=e,this.to=n,this.mark=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),o=t.resolve(this.from),i=o.node(o.sharedDepth(this.to)),a=new s(r(n.content,function(t,n,r){return n.contentMatchAt(r+1).allowsMark(e.mark.type)?t.mark(e.mark.addToSet(t.marks)):t},i),n.openLeft,n.openRight);return l.fromReplace(t,this.from,this.to,a)},e.prototype.invert=function(){return new u(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.fromJSON=function(t,n){return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(c);e.AddMarkStep=p,c.jsonID("addMark",p);var u=function(t){function e(e,n,r){t.call(this),this.from=e,this.to=n,this.mark=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),o=new s(r(n.content,function(t){return t.mark(e.mark.removeFromSet(t.marks))}),n.openLeft,n.openRight);return l.fromReplace(t,this.from,this.to,o)},e.prototype.invert=function(){return new p(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.fromJSON=function(t,n){return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(c);return e.RemoveMarkStep=u,c.jsonID("removeMark",u),n.exports}),t.registerDynamic("3a",["3","3b","38","3c"],!0,function(t,e,n){var r=t("3"),o=r.MarkType,i=r.Slice,s=r.Fragment,a=t("3b"),c=a.Transform,l=t("38"),p=l.AddMarkStep,u=l.RemoveMarkStep,f=t("3c"),h=f.ReplaceStep;return c.prototype.addMark=function(t,e,n){var r=this,o=[],i=[],s=null,a=null;return this.doc.nodesBetween(t,e,function(r,c,l,f){if(r.isInline){var h=r.marks;if(n.isInSet(h)||!l.contentMatchAt(f+1).allowsMark(n.type))a=s=null;else{var d=Math.max(c,t),m=Math.min(c+r.nodeSize,e),v=n.type.isInSet(h);v?s&&s.mark.eq(v)?s.to=m:o.push(s=new u(d,m,v)):s=null,a?a.to=m:i.push(a=new p(d,m,n))}}}),o.forEach(function(t){return r.step(t)}),i.forEach(function(t){return r.step(t)}),this},c.prototype.removeMark=function(t,e,n){var r=this;void 0===n&&(n=null);var i=[],s=0;return this.doc.nodesBetween(t,e,function(r,a){if(r.isInline){s++;var c=null;if(n instanceof o){var l=n.isInSet(r.marks);l&&(c=[l])}else n?n.isInSet(r.marks)&&(c=[n]):c=r.marks;if(c&&c.length)for(var p=Math.min(a+r.nodeSize,e),u=0;u<c.length;u++){for(var f=c[u],h=void 0,d=0;d<i.length;d++){var m=i[d];m.step==s-1&&f.eq(i[d].style)&&(h=m)}h?(h.to=p,h.step=s):i.push({style:f,from:Math.max(a,t),to:p,step:s})}}}),i.forEach(function(t){return r.step(new u(t.from,t.to,t.style))}),this},c.prototype.clearMarkup=function(t,e){var n=this,r=[];this.doc.nodesBetween(t,e,function(o,s){if(o.isInline){if(!o.type.isText)return void r.push(new h(s,s+o.nodeSize,i.empty));for(var a=0;a<o.marks.length;a++)n.step(new u(Math.max(s,t),Math.min(s+o.nodeSize,e),o.marks[a]))}});for(var o=r.length-1;o>=0;o--)n.step(r[o]);return this},c.prototype.clearNonMatching=function(t,e){for(var n=this,r=this.doc.nodeAt(t),o=[],a=t+1,c=0;c<r.childCount;c++){var l=r.child(c),p=a+l.nodeSize,f=e.matchType(l.type,l.attrs);if(f){e=f;for(var d=0;d<l.marks.length;d++)e.allowsMark(l.marks[d])||n.step(new u(a,p,l.marks[d]))}else o.push(new h(a,p,i.empty));a=p}if(!e.validEnd()){var m=e.fillBefore(s.empty,!0);this.replace(a,a,new i(m,0,0))}for(var v=o.length-1;v>=0;v--)n.step(o[v]);return this},n.exports}),t.registerDynamic("3b",["3d"],!0,function(t,e,n){var r=t("3d"),o=r.Mapping,i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error);e.TransformError=i;var s=function(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new o},a={before:{}};return a.before.get=function(){return this.docs.length?this.docs[0]:this.doc},s.prototype.step=function(t){var e=this.maybeStep(t);if(e.failed)throw new i(e.failed);return this},s.prototype.maybeStep=function(t){var e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e},s.prototype.addStep=function(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e},Object.defineProperties(s.prototype,a),e.Transform=s,n.exports}),t.registerDynamic("39",["3","3d"],!0,function(t,e,n){function r(){throw new Error("Override me")}var o=t("3"),i=o.ReplaceError,s=t("3d"),a=s.StepMap,c=Object.create(null),l=function(){};l.prototype.apply=function(){return r()},l.prototype.getMap=function(){return a.empty},l.prototype.invert=function(){return r()},l.prototype.map=function(){return r()},l.prototype.merge=function(){return null},l.prototype.toJSON=function(){var t=this,e={stepType:this.jsonID};for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];e[n]=r&&r.toJSON?r.toJSON():r}return e},l.fromJSON=function(t,e){return c[e.stepType].fromJSON(t,e)},l.jsonID=function(t,e){if(t in c)throw new RangeError("Duplicate use of step JSON ID "+t);return c[t]=e,e.prototype.jsonID=t,e},e.Step=l;var p=function(t,e){this.doc=t,this.failed=e};return p.ok=function(t){return new p(t,null)},p.fail=function(t){return new p(null,t)},p.fromReplace=function(t,e,n,r){try{return p.ok(t.replace(e,n,r))}catch(t){if(t instanceof i)return p.fail(t.message);throw t}},e.StepResult=p,n.exports}),t.registerDynamic("3d",[],!0,function(t,e,n){function r(t,e){return t+e*a}function o(t){return t&s}function i(t){return(t-(t&s))/a}var s=65535,a=Math.pow(2,16),c=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=null),this.pos=t,this.deleted=e,this.recover=n};e.MapResult=c;var l=function(t,e){void 0===e&&(e=!1),this.ranges=t,this.inverted=e};l.prototype.recover=function(t){var e=this,n=0,r=o(t);if(!this.inverted)for(var s=0;s<r;s++)n+=e.ranges[3*s+2]-e.ranges[3*s+1];return this.ranges[3*r]+n+i(t)},l.prototype.mapResult=function(t,e){return this._map(t,e,!1)},l.prototype.map=function(t,e){return this._map(t,e,!0)},l.prototype._map=function(t,e,n){for(var o=this,i=0,s=this.inverted?2:1,a=this.inverted?1:2,l=0;l<this.ranges.length;l+=3){var p=o.ranges[l]-(o.inverted?i:0);if(p>t)break;var u=o.ranges[l+s],f=o.ranges[l+a],h=p+u;if(t<=h){var d=u?t==p?-1:t==h?1:e:e,m=p+i+(d<0?0:f);if(n)return m;var v=r(l/3,t-p);return new c(m,e<0?t!=p:t!=h,v)}i+=f-u}return n?t+i:new c(t+i)},l.prototype.touches=function(t,e){for(var n=this,r=0,i=o(e),s=this.inverted?2:1,a=this.inverted?1:2,c=0;c<this.ranges.length;c+=3){var l=n.ranges[c]-(n.inverted?r:0);if(l>t)break;var p=n.ranges[c+s];if(t<=l+p&&c==3*i)return!0;r+=n.ranges[c+a]-p}return!1},l.prototype.forEach=function(t){for(var e=this,n=this.inverted?2:1,r=this.inverted?1:2,o=0,i=0;o<this.ranges.length;o+=3){var s=e.ranges[o],a=s-(e.inverted?i:0),c=s+(e.inverted?0:i),l=e.ranges[o+n],p=e.ranges[o+r];t(a,a+l,c,c+p),i+=p-l}},l.prototype.invert=function(){return new l(this.ranges,!this.inverted)},l.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},e.StepMap=l,l.empty=new l([]);var p=function(t,e,n,r){this.maps=t||[],this.from=n||0,this.to=null==r?this.maps.length:r,this.mirror=e};return p.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.maps.length),new p(this.maps,this.mirror,t,e)},p.prototype.copy=function(){return new p(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},p.prototype.getMirror=function(t){var e=this;if(this.mirror)for(var n=0;n<this.mirror.length;n++)if(e.mirror[n]==t)return e.mirror[n+(n%2?-1:1)]},p.prototype.setMirror=function(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)},p.prototype.appendMap=function(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)},p.prototype.appendMapping=function(t){for(var e=this,n=0,r=this.maps.length;n<t.maps.length;n++){var o=t.getMirror(n);e.appendMap(t.maps[n],null!=o&&o<n?r+o:null)}},p.prototype.map=function(t,e){var n=this;if(this.mirror)return this._map(t,e,!0);for(var r=this.from;r<this.to;r++)t=n.maps[r].map(t,e);return t},p.prototype.mapResult=function(t,e){return this._map(t,e,!1)},p.prototype._map=function(t,e,n){for(var r=this,o=!1,i=null,s=this.from;s<this.to;s++){var a=r.maps[s],l=i&&i[s];if(null!=l&&a.touches(t,l))t=a.recover(l);else{var p=a.mapResult(t,e);if(null!=p.recover){var u=r.getMirror(s);if(null!=u&&u>s&&u<r.to){if(p.deleted){s=u,t=r.maps[u].recover(p.recover);continue}(i||(i=Object.create(null)))[u]=p.recover}}p.deleted&&(o=!0),t=p.pos}}return n?t:new c(t,o)},e.Mapping=p,n.exports}),t.registerDynamic("3c",["3","39","3d"],!0,function(t,e,n){function r(t,e,n){for(var r=t.resolve(e),o=n-e,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var s=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}return!1}var o=t("3"),i=o.Slice,s=t("39"),a=s.Step,c=s.StepResult,l=t("3d"),p=l.StepMap,u=function(t){function e(e,n,r,o){t.call(this),this.from=e,this.to=n,this.slice=r,this.structure=!!o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){return this.structure&&r(t,this.from,this.to)?c.fail("Structure replace would overwrite content"):c.fromReplace(t,this.from,this.to,this.slice)},e.prototype.getMap=function(){return new p([this.from,this.to-this.from,this.slice.size])},e.prototype.invert=function(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice)},e.prototype.merge=function(t){if(!(t instanceof e)||t.structure!=this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openRight||t.slice.openLeft){if(t.to!=this.from||this.slice.openLeft||t.slice.openRight)return null;var n=this.slice.size+t.slice.size==0?i.empty:new i(t.slice.content.append(this.slice.content),t.slice.openLeft,this.slice.openRight);return new e(t.from,this.to,n,this.structure)}var r=this.slice.size+t.slice.size==0?i.empty:new i(this.slice.content.append(t.slice.content),this.slice.openLeft,t.slice.openRight);return new e(this.from,this.to+(t.to-t.from),r,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){return new e(n.from,n.to,i.fromJSON(t,n.slice),!!n.structure)},e}(a);e.ReplaceStep=u,a.jsonID("replace",u);var f=function(t){function e(e,n,r,o,i,s,a){t.call(this),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=!!a}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){if(this.structure&&(r(t,this.from,this.gapFrom)||r(t,this.gapTo,this.to)))return c.fail("Structure gap-replace would overwrite content");var e=t.slice(this.gapFrom,this.gapTo);if(e.openLeft||e.openRight)return c.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,e.content);return n?c.fromReplace(t,this.from,this.to,n):c.fail("Content does not fit in gap")},e.prototype.getMap=function(){return new p([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},e.prototype.invert=function(t){var n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),o=t.map(this.gapFrom,-1),i=t.map(this.gapTo,1);return n.deleted&&r.deleted||o<n.pos||i>r.pos?null:new e(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)},e.toJSON=function(){var t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,slice:this.slice.toJSON()};return this.structure&&(t.structure=!0),!0},e.fromJSON=function(t,n){return new e(n.from,n.to,n.gapFrom,n.gapTo,i.fromJSON(t,n.slice),n.insert,!!n.structure)},e}(a);return e.ReplaceAroundStep=f,a.jsonID("replaceAround",f),n.exports}),t.registerDynamic("3e",["3","3b","3c"],!0,function(t,e,n){function r(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function o(t){for(var e=t.parent,n=e.content.cutByIndex(t.startIndex,t.endIndex),o=t.depth;;--o){var i=t.$from.node(o),s=t.$from.index(o),a=t.$to.indexAfter(o);if(o<t.depth&&i.canReplace(s,a,n))return o;if(0==o||!r(i,s,a))break}}function i(t,e,n,r){void 0===r&&(r=t);var o={type:e,attrs:n},i=s(t,o),c=i&&a(r,o);return c?i.concat(o).concat(c):null}function s(t,e){var n=t.parent,r=t.startIndex,o=t.endIndex,i=n.contentMatchAt(r).findWrapping(e.type,e.attrs);if(!i)return null;var s=i.length?i[0]:e;return n.canReplaceWith(r,o,s.type,s.attrs)?i:null}function a(t,e){var n=t.parent,r=t.startIndex,o=t.endIndex,i=n.child(r),s=e.type.contentExpr.start(e.attrs).findWrappingFor(i);if(!s)return null;for(var a=s.length?s[s.length-1]:e,c=a.type.contentExpr.start(a.attrs),l=r;l<o;l++)c=c&&c.matchNode(n.child(l));return c&&c.validEnd()?s:null}function c(t,e,n,r){void 0===n&&(n=1);var o=t.resolve(e),i=o.depth-n;if(i<0||!o.parent.canReplace(o.index(),o.parent.childCount)||!o.parent.canReplace(0,o.indexAfter()))return!1;for(var s=o.depth-1,a=n-1;s>i;s--,a--){var c=o.node(s),l=o.index(s),p=r&&r[a];if(!c.canReplace(0,l)||!c.canReplaceWith(l,c.childCount,p?p.type:o.node(s+1).type,p?p.attrs:o.node(s+1).attrs))return!1}var u=o.indexAfter(i),f=r&&r[0];return o.node(i).canReplaceWith(u,u,f?f.type:o.node(i+1).type,f?f.attrs:o.node(i+1).attrs)}function l(t,e){var n=t.resolve(e),r=n.index();return p(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function p(t,e){return t&&e&&!t.isLeaf&&t.canAppend(e)}function u(t,e,n){void 0===n&&(n=-1);for(var r=t.resolve(e),o=r.depth;;o--){var i=void 0,s=void 0;if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(o+1),s=r.node(o).maybeChild(r.index(o)+1)):(i=r.node(o).maybeChild(r.index(o)-1),s=r.node(o+1)),i&&!i.isTextblock&&p(i,s))return e;if(0==o)break;e=n<0?r.before(o):r.after(o)}}function f(t,e,n,r){var o=t.resolve(e);if(o.parent.canReplaceWith(o.index(),o.index(),n,r))return e;if(0==o.parentOffset)for(var i=o.depth-1;i>=0;i--){var s=o.index(i);if(o.node(i).canReplaceWith(s,s,n,r))return o.before(i+1);if(s>0)return null}if(o.parentOffset==o.parent.content.size)for(var a=o.depth-1;a>=0;a--){var c=o.indexAfter(a);if(o.node(a).canReplaceWith(c,c,n,r))return o.after(a+1);if(c<o.node(a).childCount)return null}}var h=t("3"),d=h.Slice,m=h.Fragment,v=t("3b"),g=v.Transform,y=t("3c"),w=y.ReplaceStep,x=y.ReplaceAroundStep;return e.liftTarget=o,g.prototype.lift=function(t,e){for(var n=t.$from,r=t.$to,o=t.depth,i=n.before(o+1),s=r.after(o+1),a=i,c=s,l=m.empty,p=0,u=o,f=!1;u>e;u--)f||n.index(u)>0?(f=!0,l=m.from(n.node(u).copy(l)),p++):a--;for(var h=m.empty,v=0,g=o,y=!1;g>e;g--)y||r.after(g+1)<r.end(g)?(y=!0,h=m.from(r.node(g).copy(h)),v++):c++;return this.step(new x(a,c,i,s,new d(l.append(h),p,v),l.size-p,!0))},e.findWrapping=i,g.prototype.wrap=function(t,e){for(var n=m.empty,r=e.length-1;r>=0;r--)n=m.from(e[r].type.create(e[r].attrs,n));var o=t.start,i=t.end;return this.step(new x(o,i,o,i,new d(n,0,0),e.length,!0))},g.prototype.setBlockType=function(t,e,n,r){var o=this;if(void 0===e&&(e=t),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var i=this.steps.length;return this.doc.nodesBetween(t,e,function(t,e){if(t.isTextblock&&!t.hasMarkup(n,r)){o.clearNonMatching(o.mapping.slice(i).map(e,1),n.contentExpr.start(r));var s=o.mapping.slice(i),a=s.map(e,1),c=s.map(e+t.nodeSize,1);return o.step(new x(a,c,a+1,c-1,new d(m.from(n.create(r)),0,0),1,!0)),!1}}),this},g.prototype.setNodeType=function(t,e,n){var r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at given position");if(e||(e=r.type),r.isLeaf)return this.replaceWith(t,t+r.nodeSize,e.create(n,null,r.marks));if(!e.validContent(r.content,n))throw new RangeError("Invalid content for node type "+e.name);return this.step(new x(t,t+r.nodeSize,t+1,t+r.nodeSize-1,new d(m.from(e.create(n)),0,0),1,!0))},e.canSplit=c,g.prototype.split=function(t,e,n){void 0===e&&(e=1);for(var r=this.doc.resolve(t),o=m.empty,i=m.empty,s=r.depth,a=r.depth-e,c=e-1;s>a;s--,c--){o=m.from(r.node(s).copy(o));var l=n&&n[c];i=m.from(l?l.type.create(l.attrs,i):r.node(s).copy(i))}return this.step(new w(t,t,new d(o.append(i),e,e,!0)))},e.canJoin=l,e.joinPoint=u,g.prototype.join=function(t,e){void 0===e&&(e=1);var n=new w(t-e,t+e,d.empty,!0);return this.step(n)},e.insertPoint=f,n.exports}),t.registerDynamic("3f",["3","3c","3b","3e"],!0,function(t,e,n){function r(t,e,n,o,i){if(e<n){var s=t.firstChild;t=t.replaceChild(0,s.copy(r(s.content,e+1,n,o,s)))}return e>o&&(t=i.contentMatchAt(0).fillBefore(t).append(t)),t}function o(t,e){for(var n=[],r=0;r<t.depth;r++){var o=t.depth-r;if(t.pos-r>t.start(o))break;e.depth>=o&&e.pos+(e.depth-o)==t.end(o)&&n.push(o)}return n}function i(t,e,n,r){if(void 0===n&&(n=e),void 0===r&&(r=S.empty),e==n&&!r.size)return null;var o=t.resolve(e),i=t.resolve(n);if(h(o,i,r))return new C(e,n,r);var s=g(o,r),c=a(o,s),l=f(o,i,c);if(!l)return null;if(c.size!=l.size&&d(o,i,c)){for(var p=i.depth,u=i.after(p);p>1&&u==i.end(--p);)++u;var m=f(o,t.resolve(u),c);if(m)return new D(e,u,n,i.end(),m,c.size)}return new C(e,n,l)}function s(t,e,n,r){var o=k.empty,i=0,a=n[e];if(t.depth>e){var c=s(t,e+1,n,r||a);i=c.openRight+1,o=k.from(t.node(e+1).copy(c.content))}return a&&(o=o.append(a.content),i=a.openRight),r&&(o=o.append(t.node(e).contentMatchAt(t.indexAfter(e)).fillBefore(k.empty,!0)),i=0),{content:o,openRight:i}}function a(t,e){var n=s(t,0,e,!1),r=n.content,o=n.openRight;return new S(r,t.depth,o||0)}function c(t,e,n,r,o,i,s){var a,u=t.childCount,f=u-(s>0?1:0);a=i<0?e.contentMatchAt(f):1==u&&s>0?n.node(o).contentMatchAt(i?n.index(o):n.indexAfter(o)):n.node(o).contentMatchAt(n.indexAfter(o)).matchFragment(t,u>0&&i?1:0,f);var h=r.node(o);if(s>0&&o<r.depth){var d=h.content.cutByIndex(r.indexAfter(o)).addToStart(t.lastChild),m=a.fillBefore(d,!0);if(m&&m.size&&i>0&&1==u&&(m=null),m){var v=c(t.lastChild.content,t.lastChild,n,r,o+1,1==u?i-1:-1,s-1);if(v){var g=t.lastChild.copy(v);return m.size?t.cutByIndex(0,u-1).append(m).addToEnd(g):t.replaceChild(u-1,g)}}}s>0&&(a=a.matchNode(1==u&&i>0?n.node(o+1):t.lastChild));var y=r.index(o);if(y==h.childCount&&!h.type.compatibleContent(e.type))return null;var w=a.fillBefore(h.content,!0,y);if(!w)return null;if(s>0){var x=l(t.lastChild,s-1,n,o+1,1==u?i-1:-1);t=t.replaceChild(u-1,x)}return t=t.append(w),r.depth>o&&(t=t.addToEnd(p(r,o+1))),t}function l(t,e,n,r,o){var i,s=t.content,a=s.childCount;if(i=o>=0?n.node(r).contentMatchAt(n.indexAfter(r)).matchFragment(s,o>0?1:0,a):t.contentMatchAt(a),e>0){var c=l(s.lastChild,e-1,n,r+1,1==a?o-1:-1);s=s.replaceChild(a-1,c)}return t.copy(s.append(i.fillBefore(k.empty,!0)))}function p(t,e){var n=t.node(e),r=n.contentMatchAt(0).fillBefore(n.content,!0,t.index(e));return t.depth>e&&(r=r.addToEnd(p(t,e+1))),n.copy(r)}function u(t,e,n){for(;e>0&&n>0&&1==t.childCount;)t=t.firstChild.content,e--,n--;return new S(t,e,n)}function f(t,e,n){var r=c(n.content,t.node(0),t,e,0,n.openLeft,n.openRight);return r?u(r,n.openLeft,e.depth):null}function h(t,e,n){return!n.openLeft&&!n.openRight&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}function d(t,e,n){if(!e.parent.isTextblock)return!1;var r;if(n.openRight){var o=v(n.content,n.openRight);if(!o.isTextblock)return!1;r=o.contentMatchAt(o.childCount)}else{var i=t.node(t.depth-(n.openLeft-n.openRight));if(!i.isTextblock)return!1;r=i.contentMatchAt(i.childCount),n.size&&(r=r.matchFragment(n.content,n.openLeft?1:0))}return(r=r.matchFragment(e.parent.content,e.index()))&&r.validEnd()}function m(t,e){for(var n=1;n<e;n++)t=t.firstChild.content;return t.firstChild}function v(t,e){for(var n=1;n<e;n++)t=t.lastChild.content;return t.lastChild}function g(t,e){for(var n=t.depth,r=null,o=[],i=null,s=e.openLeft;;--s){var a=void 0,c=void 0,l=void 0;if(s>=0){if(s>0){var p;p=m(e.content,s),a=p.type,c=p.attrs,l=p.content}else 0==s&&(l=e.content);s<e.openLeft&&(l=l.cut(l.firstChild.nodeSize))}else{l=k.empty;var u=i[i.length+s-1];a=u.type,c=u.attrs}if(r&&(l=l.addToStart(r)),0==l.size&&s<=0)break;var f=w(l,t,n,o);if(f){if(f.fragment.size>0&&(o[f.depth]={content:f.fragment,openRight:y(e,s)?e.openRight-s:0,depth:f.depth}),s<=0)break;r=null,n=f.depth-(a==t.node(f.depth).type?1:0)}else{if(0==s){var h=t.node(0),d=h.contentMatchAt(t.index(0)).findWrappingFor(l.firstChild);if(!d||0==d.length)break;var v=d[d.length-1];if(!v.type.contentExpr.matches(v.attrs,l))break;i=[{type:h.type,attrs:h.attrs}].concat(d);var g;g=v,a=g.type,c=g.attrs}l.size?(l=a.contentExpr.start(c).fillBefore(l,!0).append(l),r=a.create(c,l)):r=null}}return o}function y(t,e){for(var n=0,r=t.content;n<e;n++){if(r.childCount>1)return!1;r=r.firstChild.content}return!0}function w(t,e,n,r){for(var o=!1,i=0;i<t.childCount;i++)t.child(i).marks.length&&(o=!0);for(var s=n;s>=0;s--){var a=e.node(s).contentMatchAt(e.indexAfter(s)),c=r[s];c&&(a=a.matchFragment(c.content));var l=a.fillBefore(t);if(l)return{depth:s,fragment:(c?c.content.append(l):l).append(t)};if(o){var p=x(a,t);if(p)return{depth:s,fragment:c?c.content.append(p):p}}}}function x(t,e){for(var n=[],r=0;r<e.childCount;r++){var o=e.child(r),i=o.mark(o.marks.filter(function(e){return t.allowsMark(e.type)}));if(!(t=t.matchNode(i)))return null;n.push(i)}return k.from(n)}var b=t("3"),k=b.Fragment,S=b.Slice,M=t("3c"),C=M.ReplaceStep,D=M.ReplaceAroundStep,O=t("3b"),T=O.Transform,R=t("3e"),N=R.insertPoint;return T.prototype.replaceRange=function(t,e,n){var i=this;if(!n.size)return this.deleteRange(t,e);var s=this.doc.resolve(t);if(h(s,this.doc.resolve(e),n))return this.step(new C(t,e,n));var a=o(s,this.doc.resolve(e)),c=0;a.unshift(s.depth+1);for(var l=s.depth;l>0&&!s.node(l).type.spec.defining;l--){var p=a.indexOf(l,1);p>-1&&(c=p)}for(var u=[],f=n.openLeft,d=n.content,m=0;;m++){var v=d.firstChild;if(u.push(v),m==n.openLeft)break;d=v.content}f>0&&u[f-1].type.spec.defining?f-=1:f>=2&&u[f-1].isTextblock&&u[f-2].type.spec.defining&&(f-=2);for(var g=n.openLeft;g>=0;g--){var y=(g+f+1)%(n.openLeft+1),w=u[y];if(w)for(var x=0;x<a.length;x++){var b=a[(x+c)%a.length],k=s.node(b-1),M=s.index(b-1);if(k.canReplaceWith(M,M,w.type,w.attrs,w.marks))return i.replace(s.before(b),b>s.depth?e:s.after(b),new S(r(n.content,0,n.openLeft,y),y,n.openRight))}}return this.replace(t,e,n)},T.prototype.replaceRangeWith=function(t,e,n){if(!n.isInline&&t==e&&this.doc.resolve(t).parent.content.size){var r=N(this.doc,t,n.type,n.attrs);null!=r&&(t=e=r)}return this.replaceRange(t,e,new S(k.from(n),0,0))},T.prototype.deleteRange=function(t,e){for(var n=this.doc.resolve(t),r=o(n,this.doc.resolve(e)),i=!1,s=0;s<r.length;s++)if(n.node(r[s]).contentMatchAt(0).validEnd()){t=n.start(r[s]),e=n.end(r[s]),i=!0;break}if(!i&&r.length){var a=r[r.length-1];n.node(a-1).canReplace(n.index(a-1),n.indexAfter(a-1))&&(t=n.before(a),e=n.after(a))}return this["delete"](t,e)},T.prototype["delete"]=function(t,e){return this.replace(t,e,S.empty)},e.replaceStep=i,T.prototype.replace=function(t,e,n){void 0===e&&(e=t),void 0===n&&(n=S.empty);var r=i(this.doc,t,e,n);return r&&this.step(r),this},T.prototype.replaceWith=function(t,e,n){return this.replace(t,e,new S(k.from(n),0,0))},T.prototype.insert=function(t,e){return this.replaceWith(t,t,e)},n.exports}),t.registerDynamic("40",["3b","39","3e","3d","38","3c","3a","3f"],!0,function(t,e,n){var r;r=t("3b"),e.Transform=r.Transform,e.TransformError=r.TransformError;var o;o=t("39"),e.Step=o.Step,e.StepResult=o.StepResult;var i;i=t("3e"),e.joinPoint=i.joinPoint,e.canJoin=i.canJoin,e.canSplit=i.canSplit,e.insertPoint=i.insertPoint,e.liftTarget=i.liftTarget,e.findWrapping=i.findWrapping;var s;s=t("3d"),e.StepMap=s.StepMap,e.MapResult=s.MapResult,e.Mapping=s.Mapping;var a;a=t("38"),e.AddMarkStep=a.AddMarkStep,e.RemoveMarkStep=a.RemoveMarkStep;var c;c=t("3c"),e.ReplaceStep=c.ReplaceStep,e.ReplaceAroundStep=c.ReplaceAroundStep,t("3a");var l;return l=t("3f"),e.replaceStep=l.replaceStep,n.exports}),t.registerDynamic("9",["40"],!0,function(t,e,n){return n.exports=t("40"),n.exports}),t.registerDynamic("41",[],!0,function(t,e,n){function r(t){this.content=t}return r.prototype={constructor:r,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return-1==e?undefined:this.content[e+1]},update:function(t,e,n){var o=n&&n!=t?this.remove(n):this,i=o.find(t),s=o.content.slice();return-1==i?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new r(s)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new r(n)},addToStart:function(t,e){return new r([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new r(n)},addBefore:function(t,e,n){var o=this.remove(e),i=o.content.slice(),s=o.find(t);return i.splice(-1==s?i.length:s,0,e,n),new r(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=r.from(t),t.size?new r(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=r.from(t),t.size?new r(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=r.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},get size(){return this.content.length>>1}},r.from=function(t){if(t instanceof r)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new r(e)},n.exports=r,n.exports}),t.registerDynamic("42",["41"],!0,function(t,e,n){return n.exports=t("41"),n.exports}),t.registerDynamic("43",["44"],!0,function(t,e,n){var r=t("44"),o=r.Mark,i=function(t,e,n){this.pos=t,this.path=e,this.depth=e.length/3-1,this.parentOffset=n},s={parent:{},textOffset:{},nodeAfter:{},nodeBefore:{}};i.prototype.resolveDepth=function(t){
120
+ return null==t?this.depth:t<0?this.depth+t:t},s.parent.get=function(){return this.node(this.depth)},i.prototype.node=function(t){return this.path[3*this.resolveDepth(t)]},i.prototype.index=function(t){return this.path[3*this.resolveDepth(t)+1]},i.prototype.indexAfter=function(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)},i.prototype.start=function(t){return t=this.resolveDepth(t),0==t?0:this.path[3*t-1]+1},i.prototype.end=function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size},i.prototype.before=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]},i.prototype.after=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize},s.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},s.nodeAfter.get=function(){var t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r},s.nodeBefore.get=function(){var t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)},i.prototype.marks=function(t){var e=this.parent,n=this.index();if(0==e.content.size)return o.none;if(t&&n<e.childCount||0==n||this.textOffset)return e.child(n).marks;for(var r=e.child(n-1).marks,i=0;i<r.length;i++)!1===r[i].type.spec.inclusiveRight&&(r=r[i--].removeFromSet(r));return r},i.prototype.sharedDepth=function(t){for(var e=this,n=this.depth;n>0;n--)if(e.start(n)<=t&&e.end(n)>=t)return n;return 0},i.prototype.blockRange=function(t,e){var n=this;if(void 0===t&&(t=this),t.pos<this.pos)return t.blockRange(this);for(var r=this.depth-(this.parent.isTextblock||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=n.end(r)&&(!e||e(n.node(r))))return new p(n,t,r)},i.prototype.sameParent=function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset},i.prototype.toString=function(){for(var t=this,e="",n=1;n<=this.depth;n++)e+=(e?"/":"")+t.node(n).type.name+"_"+t.index(n-1);return e+":"+this.parentOffset},i.resolve=function(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");for(var n=[],r=0,o=e,s=t;;){var a=s.content.findIndex(o),c=a.index,l=a.offset,p=o-l;if(n.push(s,c,r+l),!p)break;if(s=s.child(c),s.isText)break;o=p-1,r+=l+1}return new i(e,n,o)},i.resolveCached=function(t,e){for(var n=0;n<a.length;n++){var r=a[n];if(r.pos==e&&r.node(0)==t)return r}var o=a[c]=i.resolve(t,e);return c=(c+1)%l,o},Object.defineProperties(i.prototype,s),e.ResolvedPos=i;var a=[],c=0,l=6,p=function(t,e,n){this.$from=t,this.$to=e,this.depth=n},u={start:{},end:{},parent:{},startIndex:{},endIndex:{}};return u.start.get=function(){return this.$from.before(this.depth+1)},u.end.get=function(){return this.$to.after(this.depth+1)},u.parent.get=function(){return this.$from.node(this.depth)},u.startIndex.get=function(){return this.$from.index(this.depth)},u.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(p.prototype,u),e.NodeRange=p,n.exports}),t.registerDynamic("45",["46","44","47","43","48"],!0,function(t,e,n){function r(t,e){for(var n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var o=t("46"),i=o.Fragment,s=t("44"),a=s.Mark,c=t("47"),l=c.Slice,p=c.replace,u=t("43"),f=u.ResolvedPos,h=t("48"),d=h.compareDeep,m=Object.create(null),v=!1,g=function(t,e,n,r){this.type=t,this.attrs=e,this.content=n||i.empty,this.marks=r||a.none},y={nodeSize:{},childCount:{},textContent:{},firstChild:{},lastChild:{},isBlock:{},isTextblock:{},isInline:{},isText:{},isLeaf:{}};y.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},y.childCount.get=function(){return this.content.childCount},g.prototype.child=function(t){return this.content.child(t)},g.prototype.maybeChild=function(t){return this.content.maybeChild(t)},g.prototype.forEach=function(t){this.content.forEach(t)},g.prototype.nodesBetween=function(t,e,n,r){void 0===r&&(r=0),this.content.nodesBetween(t,e,n,r,this)},g.prototype.descendants=function(t){this.nodesBetween(0,this.content.size,t)},y.textContent.get=function(){return this.textBetween(0,this.content.size,"")},g.prototype.textBetween=function(t,e,n,r){return this.content.textBetween(t,e,n,r)},y.firstChild.get=function(){return this.content.firstChild},y.lastChild.get=function(){return this.content.lastChild},g.prototype.eq=function(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)},g.prototype.sameMarkup=function(t){return this.hasMarkup(t.type,t.attrs,t.marks)},g.prototype.hasMarkup=function(t,e,n){return this.type==t&&d(this.attrs,e||t.defaultAttrs||m)&&a.sameSet(this.marks,n||a.none)},g.prototype.copy=function(t){return void 0===t&&(t=null),t==this.content?this:new this.constructor(this.type,this.attrs,t,this.marks)},g.prototype.mark=function(t){return t==this.marks?this:new this.constructor(this.type,this.attrs,this.content,t)},g.prototype.cut=function(t,e){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))},g.prototype.slice=function(t,e,n){if(void 0===e&&(e=this.content.size),void 0===n&&(n=!1),t==e)return l.empty;var r=this.resolve(t),o=this.resolve(e),i=n?0:r.sharedDepth(e),s=r.start(i),a=r.node(i),c=a.content.cut(r.pos-s,o.pos-s);return new l(c,r.depth-i,o.depth-i)},g.prototype.replace=function(t,e,n){return p(this.resolve(t),this.resolve(e),n)},g.prototype.nodeAt=function(t){for(var e=this;;){var n=e.content.findIndex(t),r=n.index,o=n.offset;if(!(e=e.maybeChild(r)))return null;if(o==t||e.isText)return e;t-=o+1}},g.prototype.childAfter=function(t){var e=this.content.findIndex(t),n=e.index,r=e.offset;return{node:this.content.maybeChild(n),index:n,offset:r}},g.prototype.childBefore=function(t){if(0==t)return{node:null,index:0,offset:0};var e=this.content.findIndex(t),n=e.index,r=e.offset;if(r<t)return{node:this.content.child(n),index:n,offset:r};var o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}},g.prototype.resolve=function(t){return f.resolveCached(this,t)},g.prototype.resolveNoCache=function(t){return f.resolve(this,t)},g.prototype.marksAt=function(t,e){return!v&&"undefined"!=typeof console&&console.warn&&(v=!0,console.warn("Node.marksAt is deprecated. Use ResolvedPos.marks instead.")),this.resolve(t).marks(e)},g.prototype.rangeHasMark=function(t,e,n){var r=!1;return this.nodesBetween(t,e,function(t){return n.isInSet(t.marks)&&(r=!0),!r}),r},y.isBlock.get=function(){return this.type.isBlock},y.isTextblock.get=function(){return this.type.isTextblock},y.isInline.get=function(){return this.type.isInline},y.isText.get=function(){return this.type.isText},y.isLeaf.get=function(){return this.type.isLeaf},g.prototype.toString=function(){var t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),r(this.marks,t)},g.prototype.contentMatchAt=function(t){return this.type.contentExpr.getMatchAt(this.attrs,this.content,t)},g.prototype.canReplace=function(t,e,n,r,o){return this.type.contentExpr.checkReplace(this.attrs,this.content,t,e,n,r,o)},g.prototype.canReplaceWith=function(t,e,n,r,o){return this.type.contentExpr.checkReplaceWith(this.attrs,this.content,t,e,n,r,o||a.none)},g.prototype.canAppend=function(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)},g.prototype.defaultContentType=function(t){var e=this.contentMatchAt(t).nextElement;return e&&e.defaultType()},g.prototype.toJSON=function(){var t=this,e={type:this.type.name};for(var n in t.attrs){e.attrs=t.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(function(t){return t.toJSON()})),e},g.fromJSON=function(t,e){var n=e.marks&&e.marks.map(t.markFromJSON);return"text"==e.type?t.text(e.text,n):t.nodeType(e.type).create(e.attrs,i.fromJSON(t,e.content),n)},Object.defineProperties(g.prototype,y),e.Node=g;var w=function(t){function e(e,n,r,o){if(t.call(this,e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={textContent:{},nodeSize:{}};return e.prototype.toString=function(){return r(this.marks,JSON.stringify(this.text))},n.textContent.get=function(){return this.text},e.prototype.textBetween=function(t,e){return this.text.slice(t,e)},n.nodeSize.get=function(){return this.text.length},e.prototype.mark=function(t){return new e(this.type,this.attrs,this.text,t)},e.prototype.withText=function(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)},e.prototype.cut=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.text.length),0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))},e.prototype.eq=function(t){return this.sameMarkup(t)&&this.text==t.text},e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.text=this.text,e},Object.defineProperties(e.prototype,n),e}(g);return e.TextNode=w,n.exports}),t.registerDynamic("49",["42","45","46","44","4a"],!0,function(t,e,n){function r(t){var e=Object.create(null);for(var n in t){var r=t[n];if(r["default"]===undefined)return null;e[n]=r["default"]}return e}function o(t,e){var n=Object.create(null);for(var r in t){var o=e&&e[r];if(null==o){var i=t[r];if(i["default"]!==undefined)o=i["default"];else{if(!i.compute)throw new RangeError("No value supplied for attribute "+r);o=i.compute()}}n[r]=o}return n}function i(t){var e=Object.create(null);if(t)for(var n in t)e[n]=new y(t[n]);return e}var s=t("42"),a=t("45"),c=a.Node,l=a.TextNode,p=t("46"),u=p.Fragment,f=t("44"),h=f.Mark,d=t("4a"),m=d.ContentExpr,v=function(t,e,n){this.name=t,this.schema=e,this.spec=n,this.attrs=i(n.attrs),this.defaultAttrs=r(this.attrs),this.contentExpr=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t},g={isInline:{},isTextblock:{},isLeaf:{}};g.isInline.get=function(){return!this.isBlock},g.isTextblock.get=function(){return this.isBlock&&this.contentExpr.inlineContent},g.isLeaf.get=function(){return this.contentExpr.isLeaf},v.prototype.hasRequiredAttrs=function(t){var e=this;for(var n in e.attrs)if(e.attrs[n].isRequired&&(!t||!(n in t)))return!0;return!1},v.prototype.compatibleContent=function(t){return this==t||this.contentExpr.compatible(t.contentExpr)},v.prototype.computeAttrs=function(t){return!t&&this.defaultAttrs?this.defaultAttrs:o(this.attrs,t)},v.prototype.create=function(t,e,n){if("string"==typeof e)throw new Error("Calling create with string");return new c(this,this.computeAttrs(t),u.from(e),h.setFrom(n))},v.prototype.createChecked=function(t,e,n){if(t=this.computeAttrs(t),e=u.from(e),!this.validContent(e,t))throw new RangeError("Invalid content for node "+this.name);return new c(this,t,e,h.setFrom(n))},v.prototype.createAndFill=function(t,e,n){if(t=this.computeAttrs(t),e=u.from(e),e.size){var r=this.contentExpr.start(t).fillBefore(e);if(!r)return null;e=r.append(e)}var o=this.contentExpr.getMatchAt(t,e).fillBefore(u.empty,!0);return o?new c(this,t,e.append(o),h.setFrom(n)):null},v.prototype.validContent=function(t,e){return this.contentExpr.matches(e,t)},v.compile=function(t,e){var n=Object.create(null);if(t.forEach(function(t,r){return n[t]=new v(t,e,r)}),!n.doc)throw new RangeError("Every schema needs a 'doc' type");if(!n.text)throw new RangeError("Every schema needs a 'text' type");return n},Object.defineProperties(v.prototype,g),e.NodeType=v;var y=function(t){this["default"]=t["default"],this.compute=t.compute},w={isRequired:{}};w.isRequired.get=function(){return this["default"]===undefined&&!this.compute},Object.defineProperties(y.prototype,w);var x=function(t,e,n,o){this.name=t,this.schema=n,this.spec=o,this.attrs=i(o.attrs),this.rank=e;var s=r(this.attrs);this.instance=s&&new h(this,s)};x.prototype.create=function(t){return!t&&this.instance?this.instance:new h(this,o(this.attrs,t))},x.compile=function(t,e){var n=Object.create(null),r=0;return t.forEach(function(t,o){return n[t]=new x(t,r++,e,o)}),n},x.prototype.removeFromSet=function(t){for(var e=this,n=0;n<t.length;n++)if(t[n].type==e)return t.slice(0,n).concat(t.slice(n+1));return t},x.prototype.isInSet=function(t){for(var e=this,n=0;n<t.length;n++)if(t[n].type==e)return t[n]},e.MarkType=x;var b=function(t){var e=this;this.nodeSpec=s.from(t.nodes),this.markSpec=s.from(t.marks),this.nodes=v.compile(this.nodeSpec,this),this.marks=x.compile(this.markSpec,this);for(var n in e.nodes){if(n in e.marks)throw new RangeError(n+" can not be both a node and a mark");var r=e.nodes[n];r.contentExpr=m.parse(r,e.nodeSpec.get(n).content||"",e.nodeSpec)}this.cached=Object.create(null),this.cached.wrappings=Object.create(null),this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this)};return b.prototype.node=function(t,e,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof v))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)},b.prototype.text=function(t,e){var n=this.nodes.text;return new l(n,n.defaultAttrs,t,h.setFrom(e))},b.prototype.mark=function(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)},b.prototype.nodeFromJSON=function(t){return c.fromJSON(this,t)},b.prototype.markFromJSON=function(t){return h.fromJSON(this,t)},b.prototype.nodeType=function(t){var e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e},e.Schema=b,n.exports}),t.registerDynamic("4a",["46","44"],!0,function(t,e,n){function r(t,e){if("."==e.charAt(0)){var n=e.slice(1);if(!t.attrs[n])throw new SyntaxError("Node type "+t.name+" has no attribute "+n);return new w(n)}return JSON.parse(e)}function o(t,e){for(var n=[],r=0;r<e.length;r++){var o=t.marks[e[r]];if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'");n.push(o)}return n}function i(t,e,n){if(!(t instanceof w))return t;var r=e&&e[t.attr];return r!==undefined?r:n.nodeType.defaultAttrs[t.attr]}function s(t,e,n,r){return e>=i(t.min,n,r)&&e<=i(t.max,n,r)}function a(t,e,n){var r=[];return n.forEach(function(n){var o=t.nodes[n];if(o?-1==r.indexOf(o)&&r.push(o):e.forEach(function(e,i){i.group&&i.group.split(" ").indexOf(n)>-1&&(o=t.nodes[e],-1==r.indexOf(o)&&r.push(o))}),!o)throw new SyntaxError("Node type or group '"+n+"' does not exist")}),r}function c(t,e){var n=1,o=1;if(e&&("+"==e[1]?o=x:"*"==e[1]?(n=0,o=x):"?"==e[1]?n=0:e[2]&&(n=r(t,e[2]),o=e[3]?e[4]?r(t,e[4]):x:n),0==o||n>o))throw new SyntaxError("Invalid repeat count in '"+e[0]+"'");return{min:n,max:o}}function l(t,e){for(var n=e.split(/\s*,\s*/),o=Object.create(null),i=0;i<n.length;i++){var s=/^(\w+)=(\w+|\"(?:\\.|[^\\])*\"|\.\w+)$/.exec(n[i]);if(!s)throw new SyntaxError("Invalid attribute syntax: "+n[i]);o[s[1]]=r(t,s[2])}return o}var p=t("46"),u=p.Fragment,f=t("44"),h=f.Mark,d=function(t,e,n){this.nodeType=t,this.elements=e,this.inlineContent=n},m={isLeaf:{}};m.isLeaf.get=function(){return 0==this.elements.length},d.prototype.start=function(t){return new g(this,t,0,0)},d.prototype.atType=function(t,e,n,r){var o=this;void 0===r&&(r=h.none);for(var i=0;i<this.elements.length;i++)if(o.elements[i].matchesType(e,n,r,t,o))return new g(o,t,i,0)},d.prototype.matches=function(t,e,n,r){return this.start(t).matchToEnd(e,n,r)},d.prototype.getMatchAt=function(t,e,n){return void 0===n&&(n=e.childCount),1==this.elements.length?new g(this,t,0,n):this.start(t).matchFragment(e,0,n)},d.prototype.checkReplace=function(t,e,n,r,o,i,a){var c=this;if(void 0===o&&(o=u.empty),void 0===i&&(i=0),void 0===a&&(a=o.childCount),1==this.elements.length){var l=this.elements[0];if(!s(l,e.childCount-(r-n)+(a-i),t,this))return!1;for(var p=i;p<a;p++)if(!l.matches(o.child(p),t,c))return!1;return!0}var f=this.getMatchAt(t,e,n).matchFragment(o,i,a);return!!f&&f.matchToEnd(e,r)},d.prototype.checkReplaceWith=function(t,e,n,r,o,i,a){if(1==this.elements.length){var c=this.elements[0];return!!s(c,e.childCount-(r-n)+1,t,this)&&c.matchesType(o,i,a,t,this)}var l=this.getMatchAt(t,e,n).matchType(o,i,a);return!!l&&l.matchToEnd(e,r)},d.prototype.compatible=function(t){for(var e=this,n=0;n<this.elements.length;n++)for(var r=e.elements[n],o=0;o<t.elements.length;o++)if(t.elements[o].compatible(r))return!0;return!1},d.prototype.generateContent=function(t){return this.start(t).fillBefore(u.empty,!0)},d.parse=function(t,e,n){for(var r=[],i=0,s=null;(i+=/^\s*/.exec(e.slice(i))[0].length)!=e.length;){var p=/^(?:(\w+)|\(\s*(\w+(?:\s*\|\s*\w+)*)\s*\))/.exec(e.slice(i));if(!p)throw new SyntaxError("Invalid content expression '"+e+"' at "+i);i+=p[0].length;var u=/^\[([^\]]+)\]/.exec(e.slice(i));u&&(i+=u[0].length);var f=/^<(?:(_)|\s*(\w+(?:\s+\w+)*)\s*)>/.exec(e.slice(i));f&&(i+=f[0].length);var h=/^(?:([+*?])|\{\s*(\d+|\.\w+)\s*(,\s*(\d+|\.\w+)?)?\s*\})/.exec(e.slice(i));h&&(i+=h[0].length);for(var m=a(t.schema,n,p[1]?[p[1]]:p[2].split(/\s*\|\s*/)),g=0;g<m.length;g++)if(null==s)s=m[g].isInline;else if(s!=m[g].isInline)throw new SyntaxError("Mixing inline and block content in a single node");var y=u?l(t,u[1]):null,w=!!f&&(!!f[1]||o(t.schema,f[2].split(/\s+/))),x=c(t,h),b=x.min,k=x.max;if(0!=b&&(m[0].hasRequiredAttrs(y)||m[0].isText))throw new SyntaxError("Node type "+p[0]+" in type "+t.name+" is required, but has non-optional attributes");for(var S=new v(m,y,w,b,k),M=r.length-1;M>=0;M--){var C=r[M];if(C.min!=C.max&&C.overlaps(S))throw new SyntaxError("Possibly ambiguous overlapping adjacent content expressions in '"+e+"'");if(0!=C.min)break}r.push(S)}return new d(t,r,!!s)},Object.defineProperties(d.prototype,m),e.ContentExpr=d;var v=function(t,e,n,r,o){this.nodeTypes=t,this.attrs=e,this.marks=n,this.min=r,this.max=o};v.prototype.matchesType=function(t,e,n,r,o){var s=this;if(-1==this.nodeTypes.indexOf(t))return!1;if(this.attrs){if(!e)return!1;for(var a in s.attrs)if(e[a]!=i(s.attrs[a],r,o))return!1}if(!0===this.marks)return!0;if(!1===this.marks)return 0==n.length;for(var c=0;c<n.length;c++)if(-1==s.marks.indexOf(n[c].type))return!1;return!0},v.prototype.matches=function(t,e,n){return this.matchesType(t.type,t.attrs,t.marks,e,n)},v.prototype.compatible=function(t){for(var e=this,n=0;n<this.nodeTypes.length;n++)if(-1!=t.nodeTypes.indexOf(e.nodeTypes[n]))return!0;return!1},v.prototype.constrainedAttrs=function(t,e){var n=this;if(!this.attrs)return null;var r=Object.create(null);for(var o in n.attrs)r[o]=i(n.attrs[o],t,e);return r},v.prototype.createFiller=function(t,e){var n=this.nodeTypes[0],r=n.computeAttrs(this.constrainedAttrs(t,e));return n.create(r,n.contentExpr.generateContent(r))},v.prototype.defaultType=function(){var t=this.nodeTypes[0];if(!t.hasRequiredAttrs()&&!t.isText)return t},v.prototype.overlaps=function(t){return this.nodeTypes.some(function(e){return t.nodeTypes.indexOf(e)>-1})},v.prototype.allowsMark=function(t){return!0===this.marks||this.marks&&this.marks.indexOf(t)>-1};var g=function(t,e,n,r){this.expr=t,this.attrs=e,this.index=n,this.count=r},y={element:{},nextElement:{}};y.element.get=function(){return this.expr.elements[this.index]},y.nextElement.get=function(){for(var t=this,e=this.index,n=this.count;e<this.expr.elements.length;e++){var r=t.expr.elements[e];if(t.resolveValue(r.max)>n)return r;n=0}},g.prototype.move=function(t,e){return new g(this.expr,this.attrs,t,e)},g.prototype.resolveValue=function(t){return t instanceof w?i(t,this.attrs,this.expr):t},g.prototype.matchNode=function(t){return this.matchType(t.type,t.attrs,t.marks)},g.prototype.matchType=function(t,e,n){var r=this;void 0===n&&(n=h.none);for(var o=this,i=o.index,s=o.count;i<this.expr.elements.length;i++,s=0){var a=r.expr.elements[i];if(s<r.resolveValue(a.max)&&a.matchesType(t,e,n,r.attrs,r.expr))return s++,r.move(i,s);if(s<r.resolveValue(a.min))return null}},g.prototype.matchFragment=function(t,e,n){var r=this;if(void 0===e&&(e=0),void 0===n&&(n=t.childCount),e==n)return this;for(var o=e,i=this.expr.elements.length,s=this,a=s.index,c=s.count;a<i;a++,c=0){for(var l=r.expr.elements[a],p=r.resolveValue(l.max);c<p&&o<n&&l.matches(t.child(o),r.attrs,r.expr);)if(c++,++o==n)return r.move(a,c);if(c<r.resolveValue(l.min))return null}return!1},g.prototype.matchToEnd=function(t,e,n){var r=this.matchFragment(t,e,n);return r&&r.validEnd()||!1},g.prototype.validEnd=function(){for(var t=this,e=this.index,n=this.count;e<this.expr.elements.length;e++,n=0)if(n<t.resolveValue(t.expr.elements[e].min))return!1;return!0},g.prototype.fillBefore=function(t,e,n){for(var r=this,o=[],i=this,s=n||0,a=this.expr.elements.length;;){var c=i.matchFragment(t,s);if(c&&(!e||c.validEnd()))return u.from(o);if(!1===c)return null;var l=i.element;if(i.count<r.resolveValue(l.min))o.push(l.createFiller(r.attrs,r.expr)),i=i.move(i.index,i.count+1);else{if(!(i.index<a))return t.childCount>s?null:u.from(o);i=i.move(i.index+1,0)}}},g.prototype.possibleContent=function(){for(var t=this,e=[],n=this.index,r=this.count;n<this.expr.elements.length;n++,r=0){var o=t.expr.elements[n],i=o.constrainedAttrs(t.attrs,t.expr);if(r<t.resolveValue(o.max))for(var s=0;s<o.nodeTypes.length;s++){var a=o.nodeTypes[s];a.hasRequiredAttrs(i)||a.isText||e.push({type:a,attrs:i})}if(t.resolveValue(o.min)>r)break}return e},g.prototype.allowsMark=function(t){return this.element.allowsMark(t)},g.prototype.findWrapping=function(t,e,n){for(var r=Object.create(null),o={match:this,via:null},i=[o];i.length;){var s=i.shift(),a=s.match;if(a.matchType(t,e,n)){for(var c=[],l=s;l!=o;l=l.via)c.push({type:l.match.expr.nodeType,attrs:l.match.attrs});return c.reverse()}for(var p=a.possibleContent(),u=0;u<p.length;u++){var f=p[u],h=f.type,d=f.attrs,m=h.computeAttrs(d);h.isLeaf||h.name in r||s!=o&&!a.matchType(h,m).validEnd()||(i.push({match:h.contentExpr.start(m),via:s}),r[h.name]=!0)}}},g.prototype.findWrappingFor=function(t){return this.findWrapping(t.type,t.attrs,t.marks)},Object.defineProperties(g.prototype,y),e.ContentMatch=g;var w=function(t){this.attr=t},x=2e9;return n.exports}),t.registerDynamic("4b",[],!0,function(t,e,n){function r(t,e,n){for(var o=0;;o++){if(o==t.childCount||o==e.childCount)return t.childCount==e.childCount?null:n;var i=t.child(o),s=e.child(o);if(i!=s){if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(var a=0;i.text[a]==s.text[a];a++)n++;return n}if(i.content.size||s.content.size){var c=r(i.content,s.content,n+1);if(null!=c)return c}n+=i.nodeSize}else n+=i.nodeSize}}function o(t,e,n,r){for(var i=t.childCount,s=e.childCount;;){if(0==i||0==s)return i==s?null:{a:n,b:r};var a=t.child(--i),c=e.child(--s),l=a.nodeSize;if(a!=c){if(!a.sameMarkup(c))return{a:n,b:r};if(a.isText&&a.text!=c.text){for(var p=0,u=Math.min(a.text.length,c.text.length);p<u&&a.text[a.text.length-p-1]==c.text[c.text.length-p-1];)p++,n--,r--;return{a:n,b:r}}if(a.content.size||c.content.size){var f=o(a.content,c.content,n-1,r-1);if(f)return f}n-=l,r-=l}else n-=l,r-=l}}return e.findDiffStart=r,e.findDiffEnd=o,n.exports}),t.registerDynamic("46",["4b"],!0,function(t,e,n){function r(t,e){return l.index=t,l.offset=e,l}var o=t("4b"),i=o.findDiffStart,s=o.findDiffEnd,a=function(t,e){var n=this;if(this.content=t,this.size=e||0,null==e)for(var r=0;r<t.length;r++)n.size+=t[r].nodeSize},c={firstChild:{},lastChild:{},childCount:{}};a.prototype.nodesBetween=function(t,e,n,r,o){for(var i=this,s=0,a=0;a<e;s++){var c=i.content[s],l=a+c.nodeSize;if(l>t&&!1!==n(c,r+a,o,s)&&c.content.size){var p=a+1;c.nodesBetween(Math.max(0,t-p),Math.min(c.content.size,e-p),n,r+p)}a=l}},a.prototype.textBetween=function(t,e,n,r){var o="",i=!0;return this.nodesBetween(t,e,function(s,a){s.isText?(o+=s.text.slice(Math.max(t,a)-a,e-a),i=!n):s.isLeaf&&r?(o+=r,i=!n):!i&&s.isBlock&&(o+=n,i=!0)},0),o},a.prototype.append=function(t){if(!t.size)return this;if(!this.size)return t;var e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);o<t.content.length;o++)r.push(t.content[o]);return new a(r,this.size+t.size)},a.prototype.cut=function(t,e){var n=this;if(null==e&&(e=this.size),0==t&&e==this.size)return this;var r=[],o=0;if(e>t)for(var i=0,s=0;s<e;i++){var c=n.content[i],l=s+c.nodeSize;l>t&&((s<t||l>e)&&(c=c.isText?c.cut(Math.max(0,t-s),Math.min(c.text.length,e-s)):c.cut(Math.max(0,t-s-1),Math.min(c.content.size,e-s-1))),r.push(c),o+=c.nodeSize),s=l}return new a(r,o)},a.prototype.cutByIndex=function(t,e){return t==e?a.empty:0==t&&e==this.content.length?this:new a(this.content.slice(t,e))},a.prototype.replaceChild=function(t,e){var n=this.content[t];if(n==e)return this;var r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new a(r,o)},a.prototype.addToStart=function(t){return new a([t].concat(this.content),this.size+t.nodeSize)},a.prototype.addToEnd=function(t){return new a(this.content.concat(t),this.size+t.nodeSize)},a.prototype.eq=function(t){var e=this;if(this.content.length!=t.content.length)return!1;for(var n=0;n<this.content.length;n++)if(!e.content[n].eq(t.content[n]))return!1;return!0},c.firstChild.get=function(){return this.content.length?this.content[0]:null},c.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},c.childCount.get=function(){return this.content.length},a.prototype.child=function(t){var e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e},a.prototype.offsetAt=function(t){for(var e=this,n=0,r=0;r<t;r++)n+=e.content[r].nodeSize;return n},a.prototype.maybeChild=function(t){return this.content[t]},a.prototype.forEach=function(t){for(var e=this,n=0,r=0;n<this.content.length;n++){var o=e.content[n];t(o,r,n),r+=o.nodeSize}},a.prototype.findDiffStart=function(t,e){return void 0===e&&(e=0),i(this,t,e)},a.prototype.findDiffEnd=function(t,e,n){return void 0===e&&(e=this.size),void 0===n&&(n=t.size),s(this,t,e,n)},a.prototype.findIndex=function(t,e){var n=this;if(void 0===e&&(e=-1),0==t)return r(0,t);if(t==this.size)return r(this.content.length,t);if(t>this.size||t<0)throw new RangeError("Position "+t+" outside of fragment ("+this+")");for(var o=0,i=0;;o++){var s=n.child(o),a=i+s.nodeSize;if(a>=t)return a==t||e>0?r(o+1,a):r(o,i);i=a}},a.prototype.toString=function(){return"<"+this.toStringInner()+">"},a.prototype.toStringInner=function(){return this.content.join(", ")},a.prototype.toJSON=function(){return this.content.length?this.content.map(function(t){return t.toJSON()}):null},a.fromJSON=function(t,e){return e?new a(e.map(t.nodeFromJSON)):a.empty},a.fromArray=function(t){if(!t.length)return a.empty;for(var e,n=0,r=0;r<t.length;r++){var o=t[r];n+=o.nodeSize,r&&o.isText&&t[r-1].sameMarkup(o)?(e||(e=t.slice(0,r)),e[e.length-1]=o.withText(e[e.length-1].text+o.text)):e&&e.push(o)}return new a(e||t,n)},a.from=function(t){return t?t instanceof a?t:Array.isArray(t)?this.fromArray(t):new a([t],t.nodeSize):a.empty},Object.defineProperties(a.prototype,c),e.Fragment=a;var l={index:0,offset:0};return a.empty=new a([],0),n.exports}),t.registerDynamic("47",["46"],!0,function(t,e,n){function r(t,e,n){var o=t.findIndex(e),i=o.index,s=o.offset,a=t.maybeChild(i),c=t.findIndex(n),l=c.index,p=c.offset;if(s==e||a.isText){if(p!=n&&!t.child(l).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(i!=l)throw new RangeError("Removing non-flat range");return t.replaceChild(i,a.copy(r(a.content,e-s-1,n-s-1)))}function o(t,e,n,r){var i=t.findIndex(e),s=i.index,a=i.offset,c=t.maybeChild(s);if(a==e||c.isText)return r&&!r.canReplace(s,s,n)?null:t.cut(0,e).append(n).append(t.cut(e));var l=o(c.content,e-a-1,n);return l&&t.replaceChild(s,c.copy(l))}function i(t,e,n){if(n.openLeft>t.depth)throw new g("Inserted content deeper than insertion position");if(t.depth-n.openLeft!=e.depth-n.openRight)throw new g("Inconsistent open depths");return s(t,e,n,0)}function s(t,e,n,r){var o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openLeft){var a=s(t,e,n,r+1);return i.copy(i.content.replaceChild(o,a))}if(n.content.size){if(n.openLeft||n.openRight||t.depth!=r||e.depth!=r){var c=d(n,t);return u(i,f(t,c.start,c.end,e,r))}var l=t.parent,p=l.content;return u(l,p.cut(0,t.parentOffset).append(n.content).append(p.cut(e.parentOffset)))}return u(i,h(t,e,r))}function a(t,e){if(!e.type.compatibleContent(t.type))throw new g("Cannot join "+e.type.name+" onto "+t.type.name)}function c(t,e,n){var r=t.node(n);return a(r,e.node(n)),r}function l(t,e){var n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function p(t,e,n,r){var o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(l(t.nodeAfter,r),i++));for(var a=i;a<s;a++)l(o.child(a),r);e&&e.depth==n&&e.textOffset&&l(e.nodeBefore,r)}function u(t,e){if(!t.type.validContent(e,t.attrs))throw new g("Invalid content for node "+t.type.name);return t.copy(e)}function f(t,e,n,r,o){var i=t.depth>o&&c(t,e,o+1),s=r.depth>o&&c(n,r,o+1),d=[];return p(null,t,o,d),i&&s&&e.index(o)==n.index(o)?(a(i,s),l(u(i,f(t,e,n,r,o+1)),d)):(i&&l(u(i,h(t,e,o+1)),d),p(e,n,o,d),s&&l(u(s,h(n,r,o+1)),d)),p(r,null,o,d),new v(d)}function h(t,e,n){var r=[];if(p(null,t,n,r),t.depth>n){l(u(c(t,e,n+1),h(t,e,n+1)),r)}return p(e,null,n,r),new v(r)}function d(t,e){for(var n=e.depth-t.openLeft,r=e.node(n),o=r.copy(t.content),i=n-1;i>=0;i--)o=e.node(i).copy(v.from(o));return{start:o.resolveNoCache(t.openLeft+n),end:o.resolveNoCache(o.content.size-t.openRight-n)}}var m=t("46"),v=m.Fragment,g=function(t){function e(e){t.call(this,e),this.message=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error);e.ReplaceError=g;var y=function(t,e,n){this.content=t,this.openLeft=e,this.openRight=n},w={size:{}};return w.size.get=function(){return this.content.size-this.openLeft-this.openRight},y.prototype.insertAt=function(t,e){var n=o(this.content,t+this.openLeft,e,null);return n&&new y(n,this.openLeft,this.openRight)},y.prototype.removeBetween=function(t,e){return new y(r(this.content,t+this.openLeft,e+this.openLeft),this.openLeft,this.openRight)},y.prototype.eq=function(t){return this.content.eq(t.content)&&this.openLeft==t.openLeft&&this.openRight==t.openRight},y.prototype.toString=function(){return this.content+"("+this.openLeft+","+this.openRight+")"},y.prototype.toJSON=function(){return this.content.size?{content:this.content.toJSON(),openLeft:this.openLeft,openRight:this.openRight}:null},y.fromJSON=function(t,e){return e?new y(v.fromJSON(t,e.content),e.openLeft,e.openRight):y.empty},y.maxOpen=function(t){for(var e=0,n=0,r=t.firstChild;r&&!r.isLeaf;r=r.firstChild)e++;for(var o=t.lastChild;o&&!o.isLeaf;o=o.lastChild)n++;return new y(t,e,n)},Object.defineProperties(y.prototype,w),e.Slice=y,y.empty=new y(v.empty,0,0),e.replace=i,n.exports}),t.registerDynamic("48",[],!0,function(t,e,n){function r(t,e){if(t===e)return!0;if(!t||"object"!=typeof t||!e||"object"!=typeof e)return!1;var n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(var o=0;o<t.length;o++)if(!r(t[o],e[o]))return!1}else{for(var i in t)if(!(i in e&&r(t[i],e[i])))return!1;for(var s in e)if(!(s in t))return!1}return!0}return e.compareDeep=r,n.exports}),t.registerDynamic("44",["48"],!0,function(t,e,n){var r=t("48"),o=r.compareDeep,i=function(t,e){this.type=t,this.attrs=e};return i.prototype.addToSet=function(t){for(var e=this,n=0;n<t.length;n++){var r=t[n];if(r.type==e.type){if(e.eq(r))return t;var o=t.slice();return o[n]=e,o}if(r.type.rank>e.type.rank)return t.slice(0,n).concat(e).concat(t.slice(n))}return t.concat(this)},i.prototype.removeFromSet=function(t){for(var e=this,n=0;n<t.length;n++)if(e.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t},i.prototype.isInSet=function(t){for(var e=this,n=0;n<t.length;n++)if(e.eq(t[n]))return!0;return!1},i.prototype.eq=function(t){return this==t||this.type==t.type&&!!o(t.attrs,this.attrs)},i.prototype.toJSON=function(){var t=this,e={type:this.type.name};for(var n in t.attrs){e.attrs=t.attrs;break}return e},i.fromJSON=function(t,e){return t.marks[e.type].create(e.attrs)},i.sameSet=function(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0},i.setFrom=function(t){if(!t||0==t.length)return i.none;if(t instanceof i)return[t];var e=t.slice();return e.sort(function(t,e){return t.type.rank-e.type.rank}),e},e.Mark=i,i.none=[],n.exports}),t.registerDynamic("4c",["46","47","44"],!0,function(t,e,n){function r(t){for(var e=t.firstChild,n=null;e;e=e.nextSibling){var r=1==e.nodeType?e.nodeName.toLowerCase():null
121
+ ;r&&v.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):"li"==r?n=e:r&&(n=null)}}function o(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function i(t){for(var e,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];e=n.exec(t);)r.push(e[1],e[2].trim());return r}function s(t){var e={};for(var n in t)e[n]=t[n];return e}var a=t("46"),c=a.Fragment,l=t("47"),p=l.Slice,u=t("44"),f=u.Mark,h=function(t,e){var n=this;this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach(function(t){t.tag?n.tags.push(t):t.style&&n.styles.push(t)})};h.prototype.parse=function(t,e){void 0===e&&(e={});var n=new x(this,e,!1);return n.addAll(t,null,e.from,e.to),n.finish()},h.prototype.parseSlice=function(t,e){void 0===e&&(e={});var n=new x(this,e,!0);return n.addAll(t,null,e.from,e.to),p.maxOpen(n.finish())},h.prototype.matchTag=function(t){for(var e=this,n=0;n<this.tags.length;n++){var r=e.tags[n];if(o(t,r.tag)){if(r.getAttrs){var i=r.getAttrs(t);if(!1===i)continue;r.attrs=i}return r}}},h.prototype.matchStyle=function(t,e){for(var n=this,r=0;r<this.styles.length;r++){var o=n.styles[r];if(o.style==t){if(o.getAttrs){var i=o.getAttrs(e);if(!1===i)continue;o.attrs=i}return o}}},h.schemaRules=function(t){function e(t){for(var e=null==t.priority?50:t.priority,r=0;r<n.length;r++){var o=n[r];if((null==o.priority?50:o.priority)<e)break}n.splice(r,0,t)}var n=[],r=function(n){var r=t.marks[n].spec.parseDOM;r&&r.forEach(function(t){e(t=s(t)),t.mark=n})};for(var o in t.marks)r(o);var i=function(){var n=t.nodes[a].spec.parseDOM;n&&n.forEach(function(t){e(t=s(t)),t.node=a})};for(var a in t.nodes)i(o);return n},h.fromSchema=function(t){return t.cached.domParser||(t.cached.domParser=new h(t,h.schemaRules(t)))},e.DOMParser=h;var d={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},m={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},v={ol:!0,ul:!0},g=1,y=2,w=function(t,e,n,r,o){this.type=t,this.attrs=e,this.solid=n,this.match=r||(o&y?null:t.contentExpr.start(e)),this.options=o,this.content=[]};w.prototype.findWrapping=function(t,e){if(!this.match){if(!this.type)return[];var n=this.type.contentExpr.atType(this.attrs,t,e);if(!n){var r,o=this.type.contentExpr.start(this.attrs);if(r=o.findWrapping(t,e))return this.match=o,r}if(!n)return null;this.match=n}return this.match.findWrapping(t,e)},w.prototype.finish=function(t){if(!(this.options&g)){var e,n=this.content[this.content.length-1];n&&n.isText&&(e=/\s+$/.exec(n.text))&&(n.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length)))}var r=c.from(this.content);return!t&&this.match&&(r=r.append(this.match.fillBefore(c.empty,!0))),this.type?this.type.create(this.attrs,r):r};var x=function(t,e,n){this.parser=t,this.options=e,this.isOpen=n;var r,o=e.topNode,i=(e.preserveWhitespace?g:0)|(n?y:0);r=o?new w(o.type,o.attrs,!0,o.contentMatchAt(e.topStart||0),i):n?new w(null,null,!0,null,i):new w(t.schema.nodes.doc,null,!0,null,i),this.nodes=[r],this.marks=f.none,this.open=0,this.find=e.findPositions},b={top:{},currentPos:{}};return b.top.get=function(){return this.nodes[this.open]},x.prototype.addMark=function(t){var e=this.marks;return this.marks=t.addToSet(this.marks),e},x.prototype.addDOM=function(t){if(3==t.nodeType)this.addTextNode(t);else if(1==t.nodeType){var e=t.getAttribute("style");e?this.addElementWithStyles(i(e),t):this.addElement(t)}},x.prototype.addTextNode=function(t){var e=t.nodeValue,n=this.top;if(n.type&&n.type.isTextblock||/\S/.test(e)){if(!(n.options&g)&&(e=e.replace(/\s+/g," "),/^\s/.test(e))){var r=n.content[n.content.length-1];(!r||r.isText&&/\s$/.test(r.text))&&(e=e.slice(1))}e&&this.insertNode(this.parser.schema.text(e,this.marks)),this.findInText(t)}else this.findInside(t)},x.prototype.addElement=function(t){var e=t.nodeName.toLowerCase();v.hasOwnProperty(e)&&r(t);var n=this.options.ruleFromNode&&this.options.ruleFromNode(t)||this.parser.matchTag(t);if(n?n.ignore:m.hasOwnProperty(e))this.findInside(t);else if(!n||n.skip){n&&n.skip.nodeType&&(t=n.skip);var o=d.hasOwnProperty(e)&&this.top;this.addAll(t),o&&this.sync(o)}else this.addElementByRule(t,n)},x.prototype.addElementWithStyles=function(t,e){for(var n=this,r=this.marks,o=!1,i=0;i<t.length;i+=2){var s=n.parser.matchStyle(t[i],t[i+1]);if(s){if(s.ignore){o=!0;break}n.addMark(n.parser.schema.marks[s.mark].create(s.attrs))}}o||this.addElement(e),this.marks=r},x.prototype.addElementByRule=function(t,e){var n,r,o,i,s,a=this;if(e.node?(o=this.parser.schema.nodes[e.node],o.isLeaf?this.insertNode(o.create(e.attrs,null,this.marks)):n=this.enter(o,e.attrs,e.preserveWhitespace)&&this.top):(i=this.parser.schema.marks[e.mark],r=this.addMark(s=i.create(e.attrs))),o&&o.isLeaf)this.findInside(t);else if(e.getContent)this.findInside(t),e.getContent(t).forEach(function(t){return a.insertNode(s?t.mark(s.addToSet(t.marks)):t)});else{var c=e.contentElement;"string"==typeof c&&(c=t.querySelector(c)),c||(c=t),this.findAround(t,c,!0),this.addAll(c,n),n?(this.sync(n),this.open--):r&&(this.marks=r),this.findAround(t,c,!0)}return!0},x.prototype.addAll=function(t,e,n,r){for(var o=this,i=n||0,s=n?t.childNodes[n]:t.firstChild,a=null==r?null:t.childNodes[r];s!=a;s=s.nextSibling,++i)o.findAtPoint(t,i),o.addDOM(s),e&&d.hasOwnProperty(s.nodeName.toLowerCase())&&o.sync(e);this.findAtPoint(t,i)},x.prototype.findPlace=function(t,e){for(var n,r,o=this,i=this.open;i>=0;i--){var s=o.nodes[i],a=s.findWrapping(t,e);if(a&&(!n||n.length>a.length)&&(n=a,r=s,!a.length))break;if(s.solid)break}if(!n)return!1;this.sync(r);for(var c=0;c<n.length;c++)o.enterInner(n[c].type,n[c].attrs,!1);return!0},x.prototype.insertNode=function(t){if(this.findPlace(t.type,t.attrs)){this.closeExtra();var e=this.top;if(e.match){var n=e.match.matchNode(t);n||(t=t.mark(t.marks.filter(function(t){return e.match.allowsMark(t.type)})),n=e.match.matchNode(t)),e.match=n}e.content.push(t)}},x.prototype.enter=function(t,e,n){var r=this.findPlace(t,e);return r&&this.enterInner(t,e,!0,n),r},x.prototype.enterInner=function(t,e,n,r){this.closeExtra();var o=this.top;o.match=o.match&&o.match.matchType(t,e);var i=null==r?o.options&g:r?g:0;o.options&y&&0==o.content.length&&(i|=y),this.nodes.push(new w(t,e,n,null,i)),this.open++},x.prototype.closeExtra=function(t){var e=this,n=this.nodes.length-1;if(n>this.open){for(this.marks=f.none;n>this.open;n--)e.nodes[n-1].content.push(e.nodes[n].finish(t));this.nodes.length=this.open+1}},x.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},x.prototype.sync=function(t){for(var e=this,n=this.open;n>=0;n--)if(e.nodes[n]==t)return void(e.open=n)},b.currentPos.get=function(){var t=this;this.closeExtra();for(var e=0,n=this.open;n>=0;n--){for(var r=t.nodes[n].content,o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e},x.prototype.findAtPoint=function(t,e){var n=this;if(this.find)for(var r=0;r<this.find.length;r++)n.find[r].node==t&&n.find[r].offset==e&&(n.find[r].pos=n.currentPos)},x.prototype.findInside=function(t){var e=this;if(this.find)for(var n=0;n<this.find.length;n++)null==e.find[n].pos&&t.contains(e.find[n].node)&&(e.find[n].pos=e.currentPos)},x.prototype.findAround=function(t,e,n){var r=this;if(t!=e&&this.find)for(var o=0;o<this.find.length;o++)if(null==r.find[o].pos&&t.contains(r.find[o].node)){var i=e.compareDocumentPosition(r.find[o].node);i&(n?2:4)&&(r.find[o].pos=r.currentPos)}},x.prototype.findInText=function(t){var e=this;if(this.find)for(var n=0;n<this.find.length;n++)e.find[n].node==t&&(e.find[n].pos=e.currentPos-(t.nodeValue.length-e.find[n].offset))},Object.defineProperties(x.prototype,b),n.exports}),t.registerDynamic("4d",[],!0,function(t,e,n){function r(t){var e={};for(var n in t){var r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function o(t){return t.document||window.document}var i=function(t,e){this.nodes=t||{},this.marks=e||{}};return i.prototype.serializeFragment=function(t,e,n){var r=this;void 0===e&&(e={}),n||(n=o(e).createDocumentFragment());var i=n,s=null;return t.forEach(function(t){if(s||t.marks.length){s||(s=[]);for(var n=0;n<Math.min(s.length,t.marks.length)&&t.marks[n].eq(s[n]);++n);for(;n<s.length;)s.pop(),i=i.parentNode;for(;s.length<t.marks.length;){var o=t.marks[s.length];s.push(o),i=i.appendChild(r.serializeMark(o,e))}}i.appendChild(r.serializeNode(t,e))}),n},i.prototype.serializeNode=function(t,e){return void 0===e&&(e={}),this.renderStructure(this.nodes[t.type.name](t),t,e)},i.prototype.serializeNodeAndMarks=function(t,e){var n=this;void 0===e&&(e={});for(var r=this.serializeNode(t,e),o=t.marks.length-1;o>=0;o--){var i=n.serializeMark(t.marks[o],e);i.appendChild(r),r=i}return r},i.prototype.serializeMark=function(t,e){return void 0===e&&(e={}),this.renderStructure(this.marks[t.type.name](t),null,e)},i.renderSpec=function(t,e){if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};var n=t.createElement(e[0]),r=null,o=e[1],s=1;if(o&&"object"==typeof o&&null==o.nodeType&&!Array.isArray(o)){s=2;for(var a in o)"style"==a?n.style.cssText=o[a]:null!=o[a]&&n.setAttribute(a,o[a])}for(var c=s;c<e.length;c++){var l=e[c];if(0===l){if(c<e.length-1||c>s)throw new RangeError("Content hole must be the only child of its parent node");return{dom:n,contentDOM:n}}var p=i.renderSpec(t,l),u=p.dom,f=p.contentDOM;if(n.appendChild(u),f){if(r)throw new RangeError("Multiple content holes");r=f}}return{dom:n,contentDOM:r}},i.prototype.renderStructure=function(t,e,n){var r=i.renderSpec(o(n),t),s=r.dom,a=r.contentDOM;if(e&&!e.isLeaf){if(!a)throw new RangeError("No content hole in template for non-leaf node");n.onContent?n.onContent(e,a,n):this.serializeFragment(e.content,n,a)}else if(a)throw new RangeError("Content hole not allowed in a mark or leaf node spec");return s},i.fromSchema=function(t){return t.cached.domSerializer||(t.cached.domSerializer=new i(this.nodesFromSchema(t),this.marksFromSchema(t)))},i.nodesFromSchema=function(t){return r(t.nodes)},i.marksFromSchema=function(t){return r(t.marks)},e.DOMSerializer=i,n.exports}),t.registerDynamic("4e",["45","43","46","47","44","49","4a","4c","4d"],!0,function(t,e,n){e.Node=t("45").Node;var r;r=t("43"),e.ResolvedPos=r.ResolvedPos,e.NodeRange=r.NodeRange,e.Fragment=t("46").Fragment;var o;o=t("47"),e.Slice=o.Slice,e.ReplaceError=o.ReplaceError,e.Mark=t("44").Mark;var i;i=t("49"),e.Schema=i.Schema,e.NodeType=i.NodeType,e.MarkType=i.MarkType;var s;return s=t("4a"),e.ContentMatch=s.ContentMatch,e.DOMParser=t("4c").DOMParser,e.DOMSerializer=t("4d").DOMSerializer,n.exports}),t.registerDynamic("3",["4e"],!0,function(t,e,n){return n.exports=t("4e"),n.exports}),t.registerDynamic("4f",["9","3"],!0,function(t,e,n){function r(t,e){var n={};for(var r in t)n[r]=t[r];for(var o in e)n[o]=e[o];return n}function o(t,e,n){return t.append({ordered_list:r(w,{content:"list_item+",group:n}),bullet_list:r(x,{content:"list_item+",group:n}),list_item:r(b,{content:e})})}function i(t,e){return function(n,r){var o=n.selection,i=o.$from,a=o.$to,c=i.blockRange(a),l=!1,p=c;if(c.depth>=2&&i.node(c.depth-1).type.compatibleContent(t)&&0==c.startIndex){if(0==i.index(c.depth-1))return!1;var f=n.doc.resolve(c.start-2);p=new y(f,f,c.depth),c.endIndex<c.parent.childCount&&(c=new y(i,n.doc.resolve(a.end(c.depth)),c.depth)),l=!0}var h=u(p,t,e,c);return!!h&&(r&&r(s(n.tr,c,h,l,t).scrollIntoView()),!0)}}function s(t,e,n,r,o){for(var i=g.empty,s=n.length-1;s>=0;s--)i=g.from(n[s].type.create(n[s].attrs,i));t.step(new d(e.start-(r?2:0),e.end,e.start,e.end,new v(i,0,0),n.length,!0));for(var a=0,c=0;c<n.length;c++)n[c].type==o&&(a=c+1);for(var l=n.length-a,p=e.start+n.length-(r?2:0),u=e.parent,f=e.startIndex,m=e.endIndex,y=!0;f<m;f++,y=!1)!y&&h(t.doc,p,l)&&t.split(p,l),p+=u.child(f).nodeSize+(y?0:2*l);return t}function a(t){return function(e,n){var r=e.selection,o=r.$from,i=r.$to,s=r.node;if(s&&s.isBlock||!o.parent.content.size||o.depth<2||!o.sameParent(i))return!1;var a=o.node(-1);if(a.type!=t)return!1;var c=i.pos==o.end()?a.defaultContentType(o.indexAfter(-1)):null,l=e.tr["delete"](o.pos,i.pos),p=c&&[null,{type:c}];return!!h(l.doc,o.pos,2,p)&&(n&&n(l.split(o.pos,2,p).scrollIntoView()),!0)}}function c(t){return function(e,n){var r=e.selection,o=r.$from,i=r.$to,s=o.blockRange(i,function(e){return e.childCount&&e.firstChild.type==t});if(!s||s.depth<2||o.node(s.depth-1).type!=t)return!1;if(n){var a=e.tr,c=s.end,l=i.end(s.depth);c<l&&(a.step(new d(c-1,l,c,l,new v(g.from(t.create(null,s.parent.copy())),1,0),1,!0)),s=new y(a.doc.resolveNoCache(o.pos),a.doc.resolveNoCache(l),s.depth)),n(a.lift(s,f(s)).scrollIntoView())}return!0}}function l(t){return function(e,n){var r=e.selection,o=r.$from,i=r.$to,s=o.blockRange(i,function(e){return e.childCount&&e.firstChild.type==t});if(!s)return!1;var a=s.startIndex;if(0==a)return!1;var c=s.parent,l=c.child(a-1);if(l.type!=t)return!1;if(n){var p=l.lastChild&&l.lastChild.type==c.type,u=g.from(p?t.create():null),f=new v(g.from(t.create(null,g.from(c.copy(u)))),p?3:1,0),h=s.start,m=s.end;n(e.tr.step(new d(h-(p?3:1),m,h,m,f,1,!0)).scrollIntoView())}return!0}}var p=t("9"),u=p.findWrapping,f=p.liftTarget,h=p.canSplit,d=p.ReplaceAroundStep,m=t("3"),v=m.Slice,g=m.Fragment,y=m.NodeRange,w={attrs:{order:{"default":1}},parseDOM:[{tag:"ol",getAttrs:function(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1}}}],toDOM:function(t){return["ol",{start:1==t.attrs.order?null:t.attrs.order},0]}};e.orderedList=w;var x={parseDOM:[{tag:"ul"}],toDOM:function(){return["ul",0]}};e.bulletList=x;var b={parseDOM:[{tag:"li"}],toDOM:function(){return["li",0]},defining:!0};return e.listItem=b,e.addListNodes=o,e.wrapInList=i,e.splitListItem=a,e.liftListItem=c,e.sinkListItem=l,n.exports}),t.registerDynamic("2a",["4f"],!0,function(t,e,n){return n.exports=t("4f"),n.exports}),t.register("50",["3","4","7","11","26","37","2a"],function(t){"use strict";function e(t){return m[t]}function n(t){var e=m[t],n=s.fromSchema(d).serializeFragment(e.editor.state.doc.content),r=document.createElement("div");return r.appendChild(n),r.innerHTML}function r(t){var e=document.getElementById(t);return m[t]=new p(e,{floatingMenu:!0,state:c.create({doc:v(e),plugins:u({schema:d})}),onAction:function(e){m[t].updateState(m[t].editor.state.applyAction(e))}}),m[t]}var o,i,s,a,c,l,p,u,f,h,d,m,v;return t("getProseMirror",e),t("getPMContent",n),t("createProseMirror",r),{setters:[function(t){o=t.Schema,i=t.DOMParser,s=t.DOMSerializer},function(t){a=t.schema},function(t){c=t.EditorState},function(t){l=t.EditorView},function(t){p=t.MenuBarEditorView},function(t){u=t.exampleSetup,f=t.buildMenuItems},function(t){h=t.addListNodes}],execute:function(){d=new o({nodes:h(a.nodeSpec,"paragraph block*","block"),marks:a.markSpec}),m={},v=function(t){var e=$(t).find(".d0-card-content").val(),n=document.createElement("div");return n.innerHTML=e,i.fromSchema(d).parse(n)}}}}),t.registerDynamic("1",["50"],!0,function(t,e,n){return pm=t("50"),createProseMirror=pm.createProseMirror,getProseMirror=pm.getProseMirror,getProseMirrorContent=pm.getPMContent,n.exports})})(function(t){t()});
122
122
  //script: tinymce
123
123
  window.tinyMCEPreInit=window.tinyMCEPreInit||{base:"/assets/tinymce",query:"3.5.9",suffix:""},function(e){var t,n=/^\s*|\s*$/g,o="$1"==="B".replace(/A(.)|B/,"$1"),r={majorVersion:"3",minorVersion:"5.9",releaseDate:"2013-10-10",_init:function(){function t(e){return e.src&&/tiny_mce(|_gzip|_jquery|_prototype|_full)(_dev|_src)?.js/.test(e.src)?(/_(src|dev)\.js/g.test(e.src)&&(c.suffix="_src"),-1!=(a=e.src.indexOf("?"))&&(c.query=e.src.substring(a+1)),c.baseURL=e.src.substring(0,e.src.lastIndexOf("/")),i&&-1==c.baseURL.indexOf("://")&&0!==c.baseURL.indexOf("/")&&(c.baseURL=i+c.baseURL),c.baseURL):null}var n,o,r,i,a,s,c=this,d=document,l=navigator,u=l.userAgent;if(c.isIE11=-1!=u.indexOf("Trident/")&&-1!=u.indexOf("rv:"),c.isOpera=e.opera&&opera.buildNumber,c.isWebKit=/WebKit/.test(u),c.isIE=!c.isWebKit&&!c.isOpera&&/MSIE/gi.test(u)&&/Explorer/gi.test(l.appName)||c.isIE11,c.isIE6=c.isIE&&/MSIE [56]/.test(u),c.isIE7=c.isIE&&/MSIE [7]/.test(u),c.isIE8=c.isIE&&/MSIE [8]/.test(u),c.isIE9=c.isIE&&/MSIE [9]/.test(u),c.isGecko=!c.isWebKit&&!c.isIE11&&/Gecko/.test(u),c.isMac=-1!=u.indexOf("Mac"),c.isAir=/adobeair/i.test(u),c.isIDevice=/(iPad|iPhone)/.test(u),c.isIOS5=c.isIDevice&&u.match(/AppleWebKit\/(\d*)/)[1]>=534,e.tinyMCEPreInit)return c.suffix=tinyMCEPreInit.suffix,c.baseURL=tinyMCEPreInit.base,void(c.query=tinyMCEPreInit.query);for(c.suffix="",o=d.getElementsByTagName("base"),n=0;n<o.length;n++)(s=o[n].href)&&(/^https?:\/\/[^\/]+$/.test(s)&&(s+="/"),i=s?s.match(/.*\//)[0]:"");for(o=d.getElementsByTagName("script"),n=0;n<o.length;n++)if(t(o[n]))return;if(r=d.getElementsByTagName("head")[0])for(o=r.getElementsByTagName("script"),n=0;n<o.length;n++)if(t(o[n]))return},is:function(e,n){return n?!("array"!=n||!r.isArray(e))||typeof e==n:e!==t},isArray:Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},makeMap:function(e,t,n){var o;for(e=e||[],t=t||",","string"==typeof e&&(e=e.split(t)),n=n||{},o=e.length;o--;)n[e[o]]={};return n},each:function(e,n,o){var r,i;if(!e)return 0;if(o=o||e,e.length!==t){for(r=0,i=e.length;i>r;r++)if(!1===n.call(o,e[r],r,e))return 0}else for(r in e)if(e.hasOwnProperty(r)&&!1===n.call(o,e[r],r,e))return 0;return 1},map:function(e,t){var n=[];return r.each(e,function(e){n.push(t(e))}),n},grep:function(e,t){var n=[];return r.each(e,function(e){(!t||t(e))&&n.push(e)}),n},inArray:function(e,t){var n,o;if(e)for(n=0,o=e.length;o>n;n++)if(e[n]===t)return n;return-1},extend:function(e,n){var o,r,i,a,s=arguments;for(o=1,r=s.length;r>o;o++){n=s[o];for(i in n)n.hasOwnProperty(i)&&(a=n[i])!==t&&(e[i]=a)}return e},trim:function(e){return(e?""+e:"").replace(n,"")},create:function(e,t,n){var o,r,i,a,s,c=this,d=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),i=e[3].match(/(^|\.)(\w+)$/i)[2],r=c.createNS(e[3].replace(/\.\w+$/,""),n),!r[i]){if("static"==e[2])return r[i]=t,void(this.onCreate&&this.onCreate(e[2],e[3],r[i]));t[i]||(t[i]=function(){},d=1),r[i]=t[i],c.extend(r[i].prototype,t),e[5]&&(o=c.resolve(e[5]).prototype,a=e[5].match(/\.(\w+)$/i)[1],s=r[i],r[i]=d?function(){return o[a].apply(this,arguments)}:function(){return this.parent=o[a],s.apply(this,arguments)},r[i].prototype[i]=r[i],c.each(o,function(e,t){r[i].prototype[t]=o[t]}),c.each(t,function(e,t){o[t]?r[i].prototype[t]=function(){return this.parent=o[t],e.apply(this,arguments)}:t!=i&&(r[i].prototype[t]=e)})),c.each(t["static"],function(e,t){r[i][t]=e}),this.onCreate&&this.onCreate(e[2],e[3],r[i].prototype)}},walk:function(e,t,n,o){o=o||this,e&&(n&&(e=e[n]),r.each(e,function(e,i){return!1!==t.call(o,e,i,n)&&void r.walk(e,t,n,o)}))},createNS:function(t,n){var o,r;for(n=n||e,t=t.split("."),o=0;o<t.length;o++)r=t[o],n[r]||(n[r]={}),n=n[r];return n},resolve:function(t,n){var o,r;for(n=n||e,t=t.split("."),o=0,r=t.length;r>o&&(n=n[t[o]]);o++);return n},addUnload:function(t,n){function o(){function t(){n.detachEvent("onstop",t),r&&r(),n=0}var n=document;"interactive"==n.readyState&&(n&&n.attachEvent("onstop",t),e.setTimeout(function(){n&&n.detachEvent("onstop",t)},0))}var r,i=this;return r=function(){var t,n,a=i.unloads;if(a){for(n in a)(t=a[n])&&t.func&&t.func.call(t.scope,1);e.detachEvent?(e.detachEvent("onbeforeunload",o),e.detachEvent("onunload",r)):e.removeEventListener&&e.removeEventListener("unload",r,!1),i.unloads=t=a=w=r=0,e.CollectGarbage&&CollectGarbage()}},t={func:t,scope:n||this},i.unloads?i.unloads.push(t):(e.attachEvent?(e.attachEvent("onunload",r),e.attachEvent("onbeforeunload",o)):e.addEventListener&&e.addEventListener("unload",r,!1),i.unloads=[t]),t},removeUnload:function(e){var t=this.unloads,n=null;return r.each(t,function(o,r){return o&&o.func==e?(t.splice(r,1),n=e,!1):void 0}),n},explode:function(e,t){return!e||r.is(e,"array")?e:r.map(e.split(t||","),r.trim)},_addVer:function(e){var t;return this.query?(t=(-1==e.indexOf("?")?"?":"&")+this.query,-1==e.indexOf("#")?e+t:e.replace("#",t+"#")):e},_replace:function(e,n,r){return o?r.replace(e,function(){var e,o=n,r=arguments;for(e=0;e<r.length-2;e++)o=r[e]===t?o.replace(new RegExp("\\$"+e,"g"),""):o.replace(new RegExp("\\$"+e,"g"),r[e]);return o}):r.replace(e,n)}};r._init(),e.tinymce=e.tinyMCE=r}(window),tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,inDispatch:!1,Dispatcher:function(e){this.scope=e||this,this.listeners=[]},add:function(e,t){return this.listeners.push({cb:e,scope:t||this.scope}),e},addToTop:function(e,t){var n=this,o={cb:e,scope:t||n.scope};return n.inDispatch?n.listeners=[o].concat(n.listeners):n.listeners.unshift(o),e},remove:function(e){var t=this.listeners,n=null;return tinymce.each(t,function(o,r){return e==o.cb?(n=o,t.splice(r,1),!1):void 0}),n},dispatch:function(){var e,t,n,o=this,r=arguments,i=o.listeners;for(o.inDispatch=!0,t=0;t<i.length&&(n=i[t],!1!==(e=n.cb.apply(n.scope,r.length>0?r:[n.scope])));t++);return o.inDispatch=!1,e}}),function(){var e=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(t,n){var o,r,i=this;return t=tinymce.trim(t),n=i.settings=n||{},/^([\w\-]+):([^\/]{2})/i.test(t)||/^\s*#/.test(t)?void(i.source=t):(0===t.indexOf("/")&&0!==t.indexOf("//")&&(t=(n.base_uri?n.base_uri.protocol||"http":"http")+"://mce_host"+t),/^[\w\-]*:?\/\//.test(t)||(r=n.base_uri?n.base_uri.path:new tinymce.util.URI(location.href).directory,t=(n.base_uri&&n.base_uri.protocol||"http")+"://mce_host"+i.toAbsPath(r,t)),t=t.replace(/@@/g,"(mce_at)"),t=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(t),e(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(e,n){var o=t[n];o&&(o=o.replace(/\(mce_at\)/g,"@@")),i[e]=o}),void((o=n.base_uri)&&(i.protocol||(i.protocol=o.protocol),i.userInfo||(i.userInfo=o.userInfo),i.port||"mce_host"!==i.host||(i.port=o.port),i.host&&"mce_host"!==i.host||(i.host=o.host),i.source="")))},setPath:function(e){var t=this;e=/^(.*?)\/?(\w+)?$/.exec(e),t.path=e[0],t.directory=e[1],t.file=e[2],t.source="",t.getURI()},toRelative:function(e){var t,n=this;if("./"===e)return e;if(e=new tinymce.util.URI(e,{base_uri:n}),"mce_host"!=e.host&&n.host!=e.host&&e.host||n.port!=e.port||n.protocol!=e.protocol)return e.getURI();var o=n.getURI(),r=e.getURI();return o==r||"/"==o.charAt(o.length-1)&&o.substr(0,o.length-1)==r?o:(t=n.toRelPath(n.path,e.path),e.query&&(t+="?"+e.query),e.anchor&&(t+="#"+e.anchor),t)},toAbsolute:function(e,t){return e=new tinymce.util.URI(e,{base_uri:this}),e.getURI(this.host==e.host&&this.protocol==e.protocol?t:0)},toRelPath:function(e,t){var n,o,r,i=0,a="";if(e=e.substring(0,e.lastIndexOf("/")),e=e.split("/"),n=t.split("/"),e.length>=n.length)for(o=0,r=e.length;r>o;o++)if(o>=n.length||e[o]!=n[o]){i=o+1;break}if(e.length<n.length)for(o=0,r=n.length;r>o;o++)if(o>=e.length||e[o]!=n[o]){i=o+1;break}if(1===i)return t;for(o=0,r=e.length-(i-1);r>o;o++)a+="../";for(o=i-1,r=n.length;r>o;o++)a+=o!=i-1?"/"+n[o]:n[o];return a},toAbsPath:function(t,n){var o,r,i,a=0,s=[];for(r=/\/$/.test(n)?"/":"",t=t.split("/"),n=n.split("/"),e(t,function(e){e&&s.push(e)}),t=s,o=n.length-1,s=[];o>=0;o--)0!==n[o].length&&"."!==n[o]&&(".."!==n[o]?a>0?a--:s.push(n[o]):a++);return o=t.length-a,i=0>=o?s.reverse().join("/"):t.slice(0,o).join("/")+"/"+s.reverse().join("/"),0!==i.indexOf("/")&&(i="/"+i),r&&i.lastIndexOf("/")!==i.length-1&&(i+=r),i},getURI:function(e){var t,n=this;return(!n.source||e)&&(t="",e||(n.protocol&&(t+=n.protocol+"://"),n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}})}(),function(){var e=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(t){var n,o=this.get(t);return o&&e(o.split("&"),function(e){e=e.split("="),n=n||{},n[unescape(e[0])]=unescape(e[1])}),n},setHash:function(t,n,o,r,i,a){var s="";e(n,function(e,t){s+=(s?"&":"")+escape(t)+"="+escape(e)}),this.set(t,s,o,r,i,a)},get:function(e){var t,n,o=document.cookie,r=e+"=";if(o){if(-1==(n=o.indexOf("; "+r))){if(0!==(n=o.indexOf(r)))return null}else n+=2;return t=o.indexOf(";",n),-1==t&&(t=o.length),unescape(o.substring(n+r.length,t))}},set:function(e,t,n,o,r,i){document.cookie=e+"="+escape(t)+(n?"; expires="+n.toGMTString():"")+(o?"; path="+escape(o):"")+(r?"; domain="+r:"")+(i?"; secure":"")},remove:function(e,t,n){var o=new Date;o.setTime(o.getTime()-1e3),this.set(e,"",o,t,n)}})}(),function(){function serialize(e,t){var n,o,r,i;if(t=t||'"',null==e)return"null";if("string"==(r=typeof e))return o="\bb\tt\nn\ff\rr\"\"''\\\\",t+e.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,r){return'"'===t&&"'"===e?e:(n=o.indexOf(r),n+1?"\\"+o.charAt(n+1):(e=r.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+t;if("object"==r){if(e.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(e)){for(n=0,o="[";n<e.length;n++)o+=(n>0?",":"")+serialize(e[n],t);return o+"]"}o="{";for(i in e)e.hasOwnProperty(i)&&(o+="function"!=typeof e[i]?(o.length>1?","+t:t)+i+t+":"+serialize(e[i],t):"");return o+"}"}return""+e}tinymce.util.JSON={serialize:serialize,parse:function(s){try{return eval("("+s+")")}catch(e){}}}}(),tinymce.create("static tinymce.util.XHR",{send:function(e){function t(){!e.async||4==o.readyState||i++>1e4?(e.success&&1e4>i&&200==o.status?e.success.call(e.success_scope,""+o.responseText,o,e):e.error&&e.error.call(e.error_scope,i>1e4?"TIMED_OUT":"GENERAL",o,e),o=null):r.setTimeout(t,10)}function n(e){o=0;try{o=new ActiveXObject(e)}catch(e){}return o}var o,r=window,i=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=!1!==e.async,e.data=e.data||"",o=r.XMLHttpRequest?new XMLHttpRequest:n("Microsoft.XMLHTTP")||n("Msxml2.XMLHTTP")){if(o.overrideMimeType&&o.overrideMimeType(e.content_type),o.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.content_type&&o.setRequestHeader("Content-Type",e.content_type),o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.send(e.data),!e.async)return t();r.setTimeout(t,10)}}}),function(){var e=tinymce.extend,t=tinymce.util.JSON,n=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(t){this.settings=e({},t),this.count=0},send:function(o){var r=o.error,i=o.success;o=e(this.settings,o),o.success=function(e,n){e=t.parse(e),void 0===e&&(e={error:"JSON Parse error."}),e.error?r.call(o.error_scope||o.scope,e.error,n):i.call(o.success_scope||o.scope,e.result)},o.error=function(e,t){r&&r.call(o.error_scope||o.scope,e,t)},o.data=t.serialize({id:o.id||"c"+this.count++,method:o.method,params:o.params}),o.content_type="application/json",n.send(o)},"static":{sendRPC:function(e){return(new tinymce.util.JSONRequest).send(e)}}})}(),function(e){e.VK={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey},metaKeyPressed:function(t){return e.isMac?t.metaKey:t.ctrlKey&&!t.altKey}}}(tinymce),tinymce.util.Quirks=function(e){function t(t,n){try{e.getDoc().execCommand(t,!1,n)}catch(e){}}function n(){var t=e.getDoc().documentMode;return t||6}function o(e){return e.isDefaultPrevented()}function r(){function t(t){function n(){if(3==s.nodeType){if(t&&c==s.length)return!0;if(!t&&0===c)return!0}}var o,r,i,a,s,c,d;o=R.getRng();var l=[o.startContainer,o.startOffset,o.endContainer,o.endOffset];if(o.collapsed||(t=!0),s=o[(t?"start":"end")+"Container"],c=o[(t?"start":"end")+"Offset"],3==s.nodeType&&(r=M.getParent(o.startContainer,M.isBlock),t&&(r=M.getNext(r,M.isBlock)),!r||!n()&&o.collapsed||(i=M.create("em",{id:"__mceDel"}),P(tinymce.grep(r.childNodes),function(e){i.appendChild(e)}),r.appendChild(i))),o=M.createRng(),o.setStart(l[0],l[1]),o.setEnd(l[2],l[3]),R.setRng(o),e.getDoc().execCommand(t?"ForwardDelete":"Delete",!1,null),i){for(a=R.getBookmark();d=M.get("__mceDel");)M.remove(d,!0);R.moveToBookmark(a)}}e.onKeyDown.add(function(e,n){var r;r=n.keyCode==B,o(n)||!r&&n.keyCode!=A||T.modifierPressed(n)||(n.preventDefault(),t(r))}),e.addCommand("Delete",function(){t()})}function i(){function t(e){var t=M.create("body"),n=e.cloneContents();return t.appendChild(n),R.serializer.serialize(t,{format:"html"})}function n(n){var o=t(n),r=M.createRng();return r.selectNode(e.getBody()),o===t(r)}e.onKeyDown.add(function(e,t){var r,i=t.keyCode;if(!o(t)&&(i==B||i==A)){if((r=e.selection.isCollapsed())&&!M.isEmpty(e.getBody()))return;if(tinymce.isIE&&!r)return;if(!r&&!n(e.selection.getRng()))return;e.setContent(""),e.selection.setCursorLocation(e.getBody(),0),e.nodeChanged()}})}function a(){e.onKeyDown.add(function(e,t){!o(t)&&65==t.keyCode&&T.metaKeyPressed(t)&&(t.preventDefault(),e.execCommand("SelectAll"))})}function s(){e.settings.content_editable||(M.bind(e.getDoc(),"focusin",function(){R.setRng(R.getRng())}),M.bind(e.getDoc(),"mousedown",function(t){t.target==e.getDoc().documentElement&&(e.getWin().focus(),R.setRng(R.getRng()))}))}function c(){e.onKeyDown.add(function(e,t){if(!o(t)&&t.keyCode===A&&R.isCollapsed()&&0===R.getRng(!0).startOffset){var n=R.getNode(),r=n.previousSibling;r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(M.remove(r),tinymce.dom.Event.cancel(t))}})}function d(){Range.prototype.getClientRects||e.onMouseDown.add(function(e,t){if(!o(t)&&"HTML"===t.target.nodeName){var n=e.getBody();n.blur(),setTimeout(function(){n.focus()},0)}})}function l(){e.onClick.add(function(e,t){t=t.target,/^(IMG|HR)$/.test(t.nodeName)&&R.getSel().setBaseAndExtent(t,0,t,1),"A"==t.nodeName&&M.hasClass(t,"mceItemAnchor")&&R.select(t),e.nodeChanged()})}function u(){function t(){var t=M.getAttribs(R.getStart().cloneNode(!1));return function(){var n=R.getStart();n!==e.getBody()&&(M.setAttrib(n,"style",null),P(t,function(e){n.setAttributeNode(e.cloneNode(!0))}))}}function n(){return!R.isCollapsed()&&M.getParent(R.getStart(),M.isBlock)!=M.getParent(R.getEnd(),M.isBlock)}function r(e,t){return t.preventDefault(),!1}e.onKeyPress.add(function(e,r){var i;return o(r)||8!=r.keyCode&&46!=r.keyCode||!n()?void 0:(i=t(),e.getDoc().execCommand("delete",!1,null),i(),r.preventDefault(),!1)}),M.bind(e.getDoc(),"cut",function(i){var a;!o(i)&&n()&&(a=t(),e.onKeyUp.addToTop(r),setTimeout(function(){a(),e.onKeyUp.remove(r)},0))})}function f(){var t,n;M.bind(e.getDoc(),"selectionchange",function(){n&&(clearTimeout(n),n=0),n=window.setTimeout(function(){var n=R.getRng();t&&tinymce.dom.RangeUtils.compareRanges(n,t)||(e.nodeChanged(),t=n)},50)})}function p(){document.body.setAttribute("role","application")}function m(){e.onKeyDown.add(function(e,t){if(!o(t)&&t.keyCode===A&&R.isCollapsed()&&0===R.getRng(!0).startOffset){var n=R.getNode().previousSibling;if(n&&n.nodeName&&"table"===n.nodeName.toLowerCase())return tinymce.dom.Event.cancel(t)}})}function h(){n()>7||(t("RespectVisibilityInDesign",!0),e.contentStyles.push(".mceHideBrInPre pre br {display: none}"),M.addClass(e.getBody(),"mceHideBrInPre"),I.addNodeFilter("pre",function(e){for(var t,n,o,r,i=e.length;i--;)for(t=e[i].getAll("br"),n=t.length;n--;)o=t[n],r=o.prev,r&&3===r.type&&"\n"!=r.value.charAt(r.value-1)?r.value+="\n":o.parent.insert(new tinymce.html.Node("#text",3),o,!0).value="\n"}),D.addNodeFilter("pre",function(e){for(var t,n,o,r,i=e.length;i--;)for(t=e[i].getAll("br"),n=t.length;n--;)o=t[n],(r=o.prev)&&3==r.type&&(r.value=r.value.replace(/\r?\n$/,""))}))}function g(){M.bind(e.getBody(),"mouseup",function(){var e,t=R.getNode();"IMG"==t.nodeName&&((e=M.getStyle(t,"width"))&&(M.setAttrib(t,"width",e.replace(/[^0-9%]+/g,"")),M.setStyle(t,"width","")),(e=M.getStyle(t,"height"))&&(M.setAttrib(t,"height",e.replace(/[^0-9%]+/g,"")),M.setStyle(t,"height","")))})}function v(){e.onKeyDown.add(function(e,t){var n,r,i,a,s,c,d;if(n=t.keyCode==B,!o(t)&&(n||t.keyCode==A)&&!T.modifierPressed(t)&&(r=R.getRng(),i=r.startContainer,a=r.startOffset,d=r.collapsed,3==i.nodeType&&i.nodeValue.length>0&&(0===a&&!d||d&&a===(n?0:1)))){if((c=i.previousSibling)&&"IMG"==c.nodeName)return;nonEmptyElements=e.schema.getNonEmptyElements(),t.preventDefault(),s=M.create("br",{id:"__tmp"}),i.parentNode.insertBefore(s,i),e.getDoc().execCommand(n?"ForwardDelete":"Delete",!1,null),i=R.getRng().startContainer,c=i.previousSibling,c&&1==c.nodeType&&!M.isBlock(c)&&M.isEmpty(c)&&!nonEmptyElements[c.nodeName.toLowerCase()]&&M.remove(c),M.remove("__tmp")}})}function y(){e.onKeyDown.add(function(e,t){var n,r,i,a,s;if(!o(t)&&t.keyCode==T.BACKSPACE&&(n=R.getRng(),r=n.startContainer,i=n.startOffset,a=M.getRoot(),s=r,n.collapsed&&0===i)){for(;s&&s.parentNode&&s.parentNode.firstChild==s&&s.parentNode!=a;)s=s.parentNode;"BLOCKQUOTE"===s.tagName&&(e.formatter.toggle("blockquote",null,s),n=M.createRng(),n.setStart(r,0),n.setEnd(r,0),R.setRng(n))}})}function b(){function n(){e._refreshContentEditable(),t("StyleWithCSS",!1),t("enableInlineTableEditing",!1),L.object_resizing||t("enableObjectResizing",!1)}L.readonly||(e.onBeforeExecCommand.add(n),e.onMouseDown.add(n))}function C(){function t(){P(M.select("a"),function(e){var t=e.parentNode,n=M.getRoot();if(t.lastChild===e){for(;t&&!M.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}M.add(t,"br",{"data-mce-bogus":1})}})}e.onExecCommand.add(function(e,n){"CreateLink"===n&&t(e)}),e.onSetContent.add(R.onSetContent.add(t))}function x(){L.forced_root_block&&e.onInit.add(function(){t("DefaultParagraphSeparator",L.forced_root_block)})}function _(){function t(t,n){t&&n.initial||e.execCommand("mceRepaint")}e.onUndo.add(t),e.onRedo.add(t),e.onSetContent.add(t)}function E(){e.onKeyDown.add(function(e,t){var n;o(t)||t.keyCode!=A||(n=e.getDoc().selection.createRange())&&n.item&&(t.preventDefault(),e.undoManager.beforeChange(),M.remove(n.item(0)),e.undoManager.add())})}function S(){var t;n()>=10&&(t="",P("p div h1 h2 h3 h4 h5 h6".split(" "),function(e,n){t+=(n>0?",":"")+e+":empty"}),e.contentStyles.push(t+"{padding-right: 1px !important}"))}function k(){function n(e){var t,n;t=e.screenX-f,n=e.screenY-p,y=t*u[2]+m,b=n*u[3]+h,y=5>y?5:y,b=5>b?5:b,(T.modifierPressed(e)||"IMG"==d.nodeName&&u[2]*u[3]!=0)&&(y=Math.round(b/g),b=Math.round(y*g)),M.setStyles(l,{width:y,height:b}),u[2]<0&&l.clientWidth<=y&&M.setStyle(l,"left",s+(m-y)),u[3]<0&&l.clientHeight<=b&&M.setStyle(l,"top",c+(h-b))}function o(){function t(t,n){n&&(d.style[t]||!e.schema.isValid(d.nodeName.toLowerCase(),t)?M.setStyle(d,t,n):M.setAttrib(d,t,n))}t("width",y),t("height",b),M.unbind(x,"mousemove",n),M.unbind(x,"mouseup",o),C!=x&&(M.unbind(C,"mousemove",n),M.unbind(C,"mouseup",o)),M.remove(l),r(d)}function r(e){var t,r,a;i(),t=M.getPos(e),s=t.x,c=t.y,r=e.offsetWidth,a=e.offsetHeight,d!=e&&(d=e,y=b=0),P(v,function(e,t){var i;i=M.get("mceResizeHandle"+t),i?M.show(i):(i=M.add(x.documentElement,"div",{id:"mceResizeHandle"+t,"class":"mceResizeHandle",style:"cursor:"+t+"-resize; margin:0; padding:0"}),M.bind(i,"mousedown",function(t){t.preventDefault(),o(),f=t.screenX,p=t.screenY,m=d.clientWidth,h=d.clientHeight,g=h/m,u=e,l=d.cloneNode(!0),M.addClass(l,"mceClonedResizable"),M.setStyles(l,{left:s,top:c,margin:0}),x.documentElement.appendChild(l),M.bind(x,"mousemove",n),M.bind(x,"mouseup",o),C!=x&&(M.bind(C,"mousemove",n),M.bind(C,"mouseup",o))})),M.setStyles(i,{left:r*e[0]+s-i.offsetWidth/2,top:a*e[1]+c-i.offsetHeight/2})}),tinymce.isOpera||"IMG"!=d.nodeName||d.setAttribute("data-mce-selected","1")}function i(){d&&d.removeAttribute("data-mce-selected");for(var e in v)M.hide("mceResizeHandle"+e)}function a(){var e=M.getParent(R.getNode(),"table,img");P(M.select("img[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),e?r(e):i()}var s,c,d,l,u,f,p,m,h,g,v,y,b,C=document,x=e.getDoc();L.object_resizing&&!1!==L.webkit_fake_resize&&(t("enableObjectResizing",!1),v={n:[.5,0,0,-1],e:[1,.5,1,0],s:[.5,1,0,1],w:[0,.5,-1,0],nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},e.contentStyles.push(".mceResizeHandle {position: absolute;border: 1px solid black;background: #FFF;width: 5px;height: 5px;z-index: 10000}.mceResizeHandle:hover {background: #000}img[data-mce-selected] {outline: 1px solid black}img.mceClonedResizable, table.mceClonedResizable {position: absolute;outline: 1px dashed black;opacity: .5;z-index: 10000}"),e.onNodeChange.add(a),M.bind(x,"selectionchange",a),e.serializer.addAttributeFilter("data-mce-selected",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}))}function w(){n()<9&&(I.addNodeFilter("noscript",function(e){for(var t,n,o=e.length;o--;)t=e[o],(n=t.firstChild)&&t.attr("data-mce-innertext",n.value)}),D.addNodeFilter("noscript",function(e){for(var t,n,o,r=e.length;r--;)t=e[r],n=e[r].firstChild,n?n.value=tinymce.html.Entities.decode(n.value):(o=t.attributes.map["data-mce-innertext"])&&(t.attr("data-mce-innertext",null),n=new tinymce.html.Node("#text",3),n.value=o,n.raw=!0,t.append(n))}))}function N(){e.contentStyles.push("body {min-height: 100px}"),e.onClick.add(function(t,n){"HTML"==n.target.nodeName&&(e.execCommand("SelectAll"),e.selection.collapse(!0),e.nodeChanged())})}var T=tinymce.VK,A=T.BACKSPACE,B=T.DELETE,M=e.dom,R=e.selection,L=e.settings,I=e.parser,D=e.serializer,P=tinymce.each;m(),y(),i(),tinymce.isWebKit&&(v(),r(),s(),l(),x(),tinymce.isIDevice?f():(k(),a())),tinymce.isIE&&!tinymce.isIE11&&(c(),p(),h(),g(),E(),S(),w()),tinymce.isIE11&&N(),tinymce.isGecko&&!tinymce.isIE11&&(c(),d(),u(),b(),C(),_()),tinymce.isOpera&&k()},function(e){function t(e){var t;return t=document.createElement("div"),t.innerHTML=e,t.textContent||t.innerText||e}function n(e,t){var n,o,i,a={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)o=String.fromCharCode(parseInt(e[n],t)),r[o]||(i="&"+e[n+1]+";",a[o]=i,a[i]=o);return a}}var o,r,i,a=/[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,s=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=/[<>&\"\']/g,d=/&(#x|#)?([\w]+);/g,l={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};r={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;"},i={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"},o=n("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),e.html=e.html||{},e.html.Entities={encodeRaw:function(e,t){return e.replace(t?a:s,function(e){return r[e]||e})},encodeAllRaw:function(e){return(""+e).replace(c,function(e){return r[e]||e})},encodeNumeric:function(e,t){return e.replace(t?a:s,function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":r[e]||"&#"+e.charCodeAt(0)+";"})},encodeNamed:function(e,t,n){return n=n||o,e.replace(t?a:s,function(e){return r[e]||n[e]||e})},getEncodeFunc:function(t,i){function c(e,t){return e.replace(t?a:s,function(e){return r[e]||i[e]||"&#"+e.charCodeAt(0)+";"||e})}function d(e,t){return l.encodeNamed(e,t,i)}var l=e.html.Entities;return i=n(i)||o,t=e.makeMap(t.replace(/\+/g,",")),t.named&&t.numeric?c:t.named?i?d:l.encodeNamed:t.numeric?l.encodeNumeric:l.encodeRaw},decode:function(e){return e.replace(d,function(e,n,r){return n?(r=parseInt(r,2===n.length?16:10),r>65535?(r-=65536,String.fromCharCode(55296+(r>>10),56320+(1023&r))):l[r]||String.fromCharCode(r)):i[e]||o[e]||t(e)})}}}(tinymce),tinymce.html.Styles=function(e,t){function n(e,t,n,o){function r(e){return e=parseInt(e).toString(16),e.length>1?e:"0"+e}return"#"+r(t)+r(n)+r(o)}var o,r,i,a=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,s=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,c=/\s*([^:]+):\s*([^;]+);?/g,d=/\s+$/,l={};for(e=e||{},i="\\\" \\' \\; \\: ; : \ufeff".split(" "),r=0;r<i.length;r++)l[i[r]]="\ufeff"+r,l["\ufeff"+r]=i[r];return{toHex:function(e){return e.replace(a,n)},parse:function(t){function o(e,t){var n,o,r,i;"none"===y["border-image"]&&delete y["border-image"],(n=y[e+"-top"+t])&&(o=y[e+"-right"+t],n==o&&(r=y[e+"-bottom"+t],o==r&&(i=y[e+"-left"+t],r==i&&(y[e+t]=i,delete y[e+"-top"+t],delete y[e+"-right"+t],delete y[e+"-bottom"+t],delete y[e+"-left"+t]))))}function r(e){var t,n=y[e];if(n&&!(n.indexOf(" ")<0)){for(n=n.split(" "),t=n.length;t--;)if(n[t]!==n[0])return!1;return y[e]=n[0],!0}}function i(e,t,n,o){r(t)&&r(n)&&r(o)&&(y[e]=y[t]+" "+y[n]+" "+y[o],delete y[t],delete y[n],delete y[o])}function u(e){return v=!0,l[e]}function f(e,t){return v&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return l[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e}function p(e,t,n,o,r,i){return(r=r||i)?(r=f(r),"'"+r.replace(/\'/g,"\\'")+"'"):(t=f(t||n||o),b&&(t=b.call(C,t,"style")),"url('"+t.replace(/\'/g,"\\'")+"')")}var m,h,g,v,y={},b=e.url_converter,C=e.url_converter_scope||this;if(t){for(t=t.replace(/\\[\"\';:\uFEFF]/g,u).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,u)});m=c.exec(t);)h=m[1].replace(d,"").toLowerCase(),g=m[2].replace(d,""),h&&g.length>0&&("font-weight"===h&&"700"===g?g="bold":("color"===h||"background-color"===h)&&(g=g.toLowerCase()),g=g.replace(a,n),g=g.replace(s,p),y[h]=v?f(g,!0):g),c.lastIndex=m.index+m[0].length;o("border",""),o("border","-width"),o("border","-color"),o("border","-style"),o("padding",""),o("margin",""),i("border","border-width","border-style","border-color"),"medium none"===y.border&&delete y.border}return y},serialize:function(e,n){function r(n){var r,i,a,c;if(r=t.styles[n])for(i=0,a=r.length;a>i;i++)n=r[i],(c=e[n])!==o&&c.length>0&&(s+=(s.length>0?" ":"")+n+": "+c+";")}var i,a,s="";if(n&&t&&t.styles)r("*"),r(n);else for(i in e)(a=e[i])!==o&&a.length>0&&(s+=(s.length>0?" ":"")+i+": "+a+";");return s}}},function(e){function t(e,t){return e.split(t||",")}function n(e,n){function o(t){return t.replace(/[A-Z]+/g,function(t){return o(e[t])})}var r,i={};for(r in e)e.hasOwnProperty(r)&&(e[r]=o(e[r]));return o(n).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g,function(e,n,o,r){o=t(o,"|"),i[n]={attributes:a(o),attributesOrder:o,children:a(r,"|",{"#comment":{}})}}),i}function o(){var e=i.html5;return e||(e=i.html5=n({A:"id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video|wbr",C:"#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video"
124
124
  },"html[A|manifest][body|head]head[A][base|command|link|meta|noscript|script|style|title]title[A][#]base[A|href|target][]link[A|href|rel|media|type|sizes][]meta[A|http-equiv|name|content|charset][]style[A|type|media|scoped][#]script[A|charset|type|src|defer|async][#]noscript[A][C]body[A][C]section[A][C]nav[A][C]article[A][C]aside[A][C]h1[A][B]h2[A][B]h3[A][B]h4[A][B]h5[A][B]h6[A][B]hgroup[A][h1|h2|h3|h4|h5|h6]header[A][C]footer[A][C]address[A][C]p[A][B]br[A][]pre[A][B]dialog[A][dd|dt]blockquote[A|cite][C]ol[A|start|reversed][li]ul[A][li]li[A|value][C]dl[A][dd|dt]dt[A][B]dd[A][C]a[A|href|target|ping|rel|media|type][B]em[A][B]strong[A][B]small[A][B]cite[A][B]q[A|cite][B]dfn[A][B]abbr[A][B]code[A][B]var[A][B]samp[A][B]kbd[A][B]sub[A][B]sup[A][B]i[A][B]b[A][B]mark[A][B]progress[A|value|max][B]meter[A|value|min|max|low|high|optimum][B]time[A|datetime][B]ruby[A][B|rt|rp]rt[A][B]rp[A][B]bdo[A][B]span[A][B]ins[A|cite|datetime][B]del[A|cite|datetime][B]figure[A][C|legend|figcaption]figcaption[A][C]img[A|alt|src|height|width|usemap|ismap][]iframe[A|name|src|height|width|sandbox|seamless][]embed[A|src|height|width|type][]object[A|data|type|height|width|usemap|name|form|classid][param]param[A|name|value][]details[A|open][C|legend]command[A|type|label|icon|disabled|checked|radiogroup][]menu[A|type|label][C|li]legend[A][C|B]div[A][C]source[A|src|type|media][]audio[A|src|autobuffer|autoplay|loop|controls][source]video[A|src|autobuffer|autoplay|loop|controls|width|height|poster][source]hr[A][]form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]fieldset[A|disabled|form|name][C|legend]label[A|form|for][B]input[A|type|accept|alt|autocomplete|autofocus|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value|name][]button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|value|type][B]select[A|autofocus|disabled|form|multiple|name|size][option|optgroup]datalist[A][B|option]optgroup[A|disabled|label][option]option[A|disabled|selected|label|value][]textarea[A|autofocus|disabled|form|maxlength|name|placeholder|readonly|required|rows|cols|wrap][]keygen[A|autofocus|challenge|disabled|form|keytype|name][]output[A|for|form|name][B]canvas[A|width|height][]map[A|name][B|C]area[A|shape|coords|href|alt|target|media|rel|ping|type][]mathml[A][]svg[A][]table[A|border][caption|colgroup|thead|tfoot|tbody|tr]caption[A][C]colgroup[A|span][col]col[A|span][]thead[A][tr]tfoot[A][tr]tbody[A][tr]tr[A][th|td]th[A|headers|rowspan|colspan|scope][B]td[A|headers|rowspan|colspan][C]wbr[A][]")),e}function r(){var e=i.html4;return e||(e=i.html4=n({Z:"H|K|N|O|P",Y:"X|form|R|Q",ZG:"E|span|width|align|char|charoff|valign",X:"p|T|div|U|W|isindex|fieldset|table",ZF:"E|align|char|charoff|valign",W:"pre|hr|blockquote|address|center|noframes",ZE:"abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",ZD:"[E][S]",U:"ul|ol|dl|menu|dir",ZC:"p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"X|S|Q",S:"R|P",ZA:"a|G|J|M|O|P",R:"a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe",E:"A|B|C",D:"accesskey|tabindex|onfocus|onblur",C:"onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"lang|xml:lang|dir",A:"id|class|style|title"},"script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]")),e}var i={},a=e.makeMap,s=e.each;e.html.Schema=function(n){function c(t,o,r){var s=n[t];return s?s=a(s,",",a(s.toUpperCase()," ")):(s=i[t])||(s=a(o," ",a(o.toUpperCase()," ")),s=e.extend(s,r),i[t]=s),s}function d(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")}function l(n){var o,r,i,s,c,l,u,f,p,m,h,g,v,y,b,C,x,_,E,k=/^([#+\-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,N=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,T=/[*?+]/;if(n)for(n=t(n),S["@"]&&(C=S["@"].attributes,x=S["@"].attributesOrder),o=0,r=n.length;r>o;o++)if(c=k.exec(n[o])){if(y=c[1],p=c[2],b=c[3],f=c[4],g={},v=[],l={attributes:g,attributesOrder:v},"#"===y&&(l.paddEmpty=!0),"-"===y&&(l.removeEmpty=!0),C){for(_ in C)g[_]=C[_];v.push.apply(v,x)}if(f)for(f=t(f,"|"),i=0,s=f.length;s>i;i++)if(c=N.exec(f[i])){if(u={},h=c[1],m=c[2].replace(/::/g,":"),y=c[3],E=c[4],"!"===h&&(l.attributesRequired=l.attributesRequired||[],l.attributesRequired.push(m),u.required=!0),"-"===h){delete g[m],v.splice(e.inArray(v,m),1);continue}y&&("="===y&&(l.attributesDefault=l.attributesDefault||[],l.attributesDefault.push({name:m,value:E}),u.defaultValue=E),":"===y&&(l.attributesForced=l.attributesForced||[],l.attributesForced.push({name:m,value:E}),u.forcedValue=E),"<"===y&&(u.validValues=a(E,"?"))),T.test(m)?(l.attributePatterns=l.attributePatterns||[],u.pattern=d(m),l.attributePatterns.push(u)):(g[m]||v.push(m),g[m]=u)}C||"@"!=p||(C=g,x=v),b&&(l.outputName=p,S[b]=l),T.test(p)?(l.pattern=d(p),w.push(l)):S[p]=l}}function u(e){S={},w=[],l(e),s(g,function(e,t){k[t]=e.children})}function f(e){var n=/^(~)?(.+)$/;e&&s(t(e),function(e){var t=n.exec(e),o="~"===t[1],r=o?"span":"div",i=t[2];k[i]=k[r],N[i]=r,o||(x[i.toUpperCase()]={},x[i]={}),S[i]||(S[i]=S[r]),s(k,function(e){e[r]&&(e[i]=e[r])})})}function p(e){var n=/^([+\-]?)(\w+)\[([^\]]+)\]$/;e&&s(t(e),function(e){var o,r,i=n.exec(e);i&&(r=i[1],o=r?k[i[2]]:k[i[2]]={"#comment":{}},o=k[i[2]],s(t(i[3],"|"),function(e){"-"===r?delete o[e]:o[e]={}}))})}function m(e){var t,n=S[e];if(n)return n;for(t=w.length;t--;)if(n=w[t],n.pattern.test(e))return n}var h,g,v,y,b,C,x,_,E=this,S={},k={},w=[],N={};n=n||{},g="html5"==n.schema?o():r(),!1===n.verify_html&&(n.valid_elements="*[*]"),n.valid_styles&&(h={},s(n.valid_styles,function(t,n){h[n]=e.explode(t)})),v=c("whitespace_elements","pre script noscript style textarea"),y=c("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),b=c("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr"),C=c("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),_=c("non_empty_elements","td th iframe video audio object script",b),textBlockElementsMap=c("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),x=c("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex samp option datalist select optgroup",textBlockElementsMap),n.valid_elements?u(n.valid_elements):(s(g,function(e,t){S[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},k[t]=e.children}),"html5"!=n.schema&&s(t("strong/b,em/i"),function(e){e=t(e,"/"),S[e[1]].outputName=e[0]}),S.img.attributesDefault=[{name:"alt",value:""}],s(t("ol,ul,sub,sup,blockquote,span,font,a,table,tbody,tr,strong,em,b,i"),function(e){S[e]&&(S[e].removeEmpty=!0)}),s(t("p,h1,h2,h3,h4,h5,h6,th,td,pre,div,address,caption"),function(e){S[e].paddEmpty=!0})),f(n.custom_elements),p(n.valid_children),l(n.extended_valid_elements),p("+ol[ul|ol],+ul[ul|ol]"),n.invalid_elements&&e.each(e.explode(n.invalid_elements),function(e){S[e]&&delete S[e]}),m("span")||l("span[!data-mce-type|*]"),E.children=k,E.styles=h,E.getBoolAttrs=function(){return C},E.getBlockElements=function(){return x},E.getTextBlockElements=function(){return textBlockElementsMap},E.getShortEndedElements=function(){return b},E.getSelfClosingElements=function(){return y},E.getNonEmptyElements=function(){return _},E.getWhiteSpaceElements=function(){return v},E.isValidChild=function(e,t){var n=k[e];return!(!n||!n[t])},E.isValid=function(e,t){var n,o,r=m(e);if(r){if(!t)return!0;if(r.attributes[t])return!0;if(n=r.attributePatterns)for(o=n.length;o--;)if(n[o].pattern.test(e))return!0}return!1},E.getElementRule=m,E.getCustomElements=function(){return N},E.addValidElements=l,E.setValidElements=u,E.addCustomElements=f,E.addValidChildren=p,E.elements=S}}(tinymce),function(e){e.html.SaxParser=function(t,n){var o=this,r=function(){};t=t||{},o.schema=n=n||new e.html.Schema,!1!==t.fix_self_closing&&(t.fix_self_closing=!0),e.each("comment cdata text start end pi doctype".split(" "),function(e){e&&(o[e]=t[e]||r)}),o.parse=function(o){function r(e){var t,n;for(t=H.length;t--&&H[t].name!==e;);if(t>=0){for(n=H.length-1;n>=t;n--)e=H[n],e.valid&&P.end(e.name);H.length=t}}function i(e,t,n,o,r){var i,a;if(t=t.toLowerCase(),n=t in g?t:U(n||o||r||""),y&&!p&&0!==t.indexOf("data-")){if(!(i=S[t])&&k){for(a=k.length;a--&&(i=k[a],!i.pattern.test(t)););-1===a&&(i=null)}if(!i)return;if(i.validValues&&!(n in i.validValues))return}d.map[t]=n,d.push({name:t,value:n})}var a,s,c,d,l,u,f,p,m,h,g,v,y,b,C,x,_,E,S,k,w,N,T,A,B,M,R,L,I,D,P=this,O=0,H=[],F=0,U=e.html.Entities.decode;for(B=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),M=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,R={script:/<\/script[^>]*>/gi,style:/<\/style[^>]*>/gi,noscript:/<\/noscript[^>]*>/gi},h=n.getShortEndedElements(),A=t.self_closing_elements||n.getSelfClosingElements(),g=n.getBoolAttrs(),y=t.validate,m=t.remove_internals,I=t.fix_self_closing,D=e.isIE,E=/^:/;a=B.exec(o);){if(O<a.index&&P.text(U(o.substr(O,a.index-O))),s=a[6])s=s.toLowerCase(),D&&E.test(s)&&(s=s.substr(1)),r(s);else if(s=a[7]){if(s=s.toLowerCase(),D&&E.test(s)&&(s=s.substr(1)),v=s in h,I&&A[s]&&H.length>0&&H[H.length-1].name===s&&r(s),!y||(b=n.getElementRule(s))){if(C=!0,y&&(S=b.attributes,k=b.attributePatterns),(_=a[8])?(p=-1!==_.indexOf("data-mce-type"),p&&m&&(C=!1),d=[],d.map={},_.replace(M,i)):(d=[],d.map={}),y&&!p){if(w=b.attributesRequired,N=b.attributesDefault,T=b.attributesForced)for(l=T.length;l--;)x=T[l],f=x.name,L=x.value,"{$uid}"===L&&(L="mce_"+F++),d.map[f]=L,d.push({name:f,value:L});if(N)for(l=N.length;l--;)x=N[l],(f=x.name)in d.map||(L=x.value,"{$uid}"===L&&(L="mce_"+F++),d.map[f]=L,d.push({name:f,value:L}));if(w){for(l=w.length;l--&&!(w[l]in d.map););-1===l&&(C=!1)}d.map["data-mce-bogus"]&&(C=!1)}C&&P.start(s,d,v)}else C=!1;if(c=R[s]){c.lastIndex=O=a.index+a[0].length,(a=c.exec(o))?(C&&(u=o.substr(O,a.index-O)),O=a.index+a[0].length):(u=o.substr(O),O=o.length),C&&u.length>0&&P.text(u,!0),C&&P.end(s),B.lastIndex=O;continue}v||(_&&_.indexOf("/")==_.length-1?C&&P.end(s):H.push({name:s,valid:C}))}else(s=a[1])?P.comment(s):(s=a[2])?P.cdata(s):(s=a[3])?P.doctype(s):(s=a[4])&&P.pi(s,a[5]);O=a.index+a[0].length}for(O<o.length&&P.text(U(o.substr(O))),l=H.length-1;l>=0;l--)s=H[l],s.valid&&P.end(s.name)}}}(tinymce),function(e){function t(e,t,n){var o,r,i=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[i])return e[i];if(e!==t){if(o=e[a])return o;for(r=e.parent;r&&r!==t;r=r.parent)if(o=r[a])return o}}function n(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}var o=/^[ \t\r\n]*$/,r={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};e.extend(n.prototype,{replace:function(e){var t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t},attr:function(e,t){var n,o,r,i=this;if("string"!=typeof e){for(o in e)i.attr(o,e[o]);return i}if(n=i.attributes){if(t!==r){if(null===t){if(e in n.map)for(delete n.map[e],o=n.length;o--;)if(n[o].name===e)return n=n.splice(o,1),i;return i}if(e in n.map){for(o=n.length;o--;)if(n[o].name===e){n[o].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,i}return n.map[e]}},clone:function(){var e,t,o,r,i,a=this,s=new n(a.name,a.type);if(o=a.attributes){for(i=[],i.map={},e=0,t=o.length;t>e;e++)r=o[e],"id"!==r.name&&(i[i.length]={name:r.name,value:r.value},i.map[r.name]=r.value);s.attributes=i}return s.value=a.value,s.shortEnded=a.shortEnded,s},wrap:function(e){var t=this;return t.parent.insert(e,t),e.append(t),t},unwrap:function(){var e,t,n=this;for(e=n.firstChild;e;)t=e.next,n.insert(e,n,!0),e=t;n.remove()},remove:function(){var e=this,t=e.parent,n=e.next,o=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):o.next=n,t.lastChild===e?(t.lastChild=o,o&&(o.next=null)):n.prev=o,e.parent=e.next=e.prev=null),e},append:function(e){var t,n=this;return e.parent&&e.remove(),t=n.lastChild,t?(t.next=e,e.prev=t,n.lastChild=e):n.lastChild=n.firstChild=e,e.parent=n,e},insert:function(e,t,n){var o;return e.parent&&e.remove(),o=t.parent||this,n?(t===o.firstChild?o.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===o.lastChild?o.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=o,e},getAll:function(e){var n,o=this,r=[];for(n=o.firstChild;n;n=t(n,o))n.name===e&&r.push(n);return r},empty:function(){var e,n,o,r=this;if(r.firstChild){for(e=[],o=r.firstChild;o;o=t(o,r))e.push(o);for(n=e.length;n--;)o=e[n],o.parent=o.firstChild=o.lastChild=o.next=o.prev=null}return r.firstChild=r.lastChild=null,r},isEmpty:function(e){var n,r,i=this,a=i.firstChild;if(a)do{if(1===a.type){if(a.attributes.map["data-mce-bogus"])continue;if(e[a.name])return!1;for(n=a.attributes.length;n--;)if("name"===(r=a.attributes[n].name)||0===r.indexOf("data-mce-"))return!1}if(8===a.type)return!1;if(3===a.type&&!o.test(a.value))return!1}while(a=t(a,i));return!0},walk:function(e){return t(this,null,e)}}),e.extend(n,{create:function(e,t){var o,i;if(o=new n(e,r[e]||1),t)for(i in t)o.attr(i,t[i]);return o}}),e.html.Node=n}(tinymce),function(e){var t=e.html.Node;e.html.DomParser=function(n,o){function r(n){var r,a,s,c,d,l,u,f,p,m,h,g,v,y;for(h=e.makeMap("tr,td,th,tbody,thead,tfoot,table"),m=o.getNonEmptyElements(),g=o.getTextBlockElements(),r=0;r<n.length;r++)if(a=n[r],a.parent&&!a.fixed)if(g[a.name]&&"li"==a.parent.name){for(v=a.next;v&&g[v.name];)v.name="li",v.fixed=!0,a.parent.insert(v,a.parent),v=v.next;a.unwrap(a)}else{for(c=[a],s=a.parent;s&&!o.isValidChild(s.name,a.name)&&!h[s.name];s=s.parent)c.push(s);if(s&&c.length>1){for(c.reverse(),d=l=i.filterNode(c[0].clone()),p=0;p<c.length-1;p++){for(o.isValidChild(l.name,c[p].name)?(u=i.filterNode(c[p].clone()),l.append(u)):u=l,f=c[p].firstChild;f&&f!=c[p+1];)y=f.next,u.append(f),f=y;l=u}d.isEmpty(m)?s.insert(a,c[0],!0):(s.insert(d,c[0],!0),s.insert(a,d)),s=c[0],(s.isEmpty(m)||s.firstChild===s.lastChild&&"br"===s.firstChild.name)&&s.empty().remove()}else if(a.parent){if("li"===a.name){if((v=a.prev)&&("ul"===v.name||"ul"===v.name)){v.append(a);continue}if((v=a.next)&&("ul"===v.name||"ul"===v.name)){v.insert(a,v.firstChild,!0);continue}a.wrap(i.filterNode(new t("ul",1)));continue}o.isValidChild(a.parent.name,"div")&&o.isValidChild("div",a.name)?a.wrap(i.filterNode(new t("div",1))):"style"===a.name||"script"===a.name?a.empty().remove():a.unwrap()}}}var i=this,a={},s=[],c={},d={};n=n||{},n.validate=!("validate"in n)||n.validate,n.root_name=n.root_name||"body",i.schema=o=o||new e.html.Schema,i.filterNode=function(e){var t,n,o;n in a&&(o=c[n],o?o.push(e):c[n]=[e]),t=s.length;for(;t--;)(n=s[t].name)in e.attributes.map&&(o=d[n],o?o.push(e):d[n]=[e]);return e},i.addNodeFilter=function(t,n){e.each(e.explode(t),function(e){var t=a[e];t||(a[e]=t=[]),t.push(n)})},i.addAttributeFilter=function(t,n){e.each(e.explode(t),function(e){var t;for(t=0;t<s.length;t++)if(s[t].name===e)return void s[t].callbacks.push(n);s.push({name:e,callbacks:[n]})})},i.parse=function(i,l){function u(){for(var e,t,n=g.firstChild;n;)e=n.next,3==n.type||1==n.type&&"p"!==n.name&&!w[n.name]&&!n.attr("data-mce-type")?t?t.append(n):(t=f(D,1),g.insert(t,n),t.append(n)):t=null,n=e}function f(e,n){var o,r=new t(e,n);return e in a&&(o=c[e],o?o.push(r):c[e]=[r]),r}function p(e){var t,n,o;for(t=e.prev;t&&3===t.type;)n=t.value.replace(A,""),n.length>0?(t.value=n,t=t.prev):(o=t.prev,t.remove(),t=o)}function m(e){var t,n={};for(t in e)"li"!==t&&"p"!=t&&(n[t]=e[t]);return n}var h,g,v,y,b,C,x,_,E,S,k,w,N,T,A,B,M,R,L,I,D,P=[];if(l=l||{},c={},d={},w=e.extend(e.makeMap("script,style,head,html,body,title,meta,param"),o.getBlockElements()),I=o.getNonEmptyElements(),L=o.children,k=n.validate,D="forced_root_block"in l?l.forced_root_block:n.forced_root_block,R=o.getWhiteSpaceElements(),N=/^[ \t\r\n]+/,A=/[ \t\r\n]+$/,B=/[ \t\r\n]+/g,M=/^[ \t\r\n]+$/,h=new e.html.SaxParser({validate:k,self_closing_elements:m(o.getSelfClosingElements()),cdata:function(e){v.append(f("#cdata",4)).value=e},text:function(e,t){var n;T||(e=e.replace(B," "),v.lastChild&&w[v.lastChild.name]&&(e=e.replace(N,""))),0!==e.length&&(n=f("#text",3),n.raw=!!t,v.append(n).value=e)},comment:function(e){v.append(f("#comment",8)).value=e},pi:function(e,t){v.append(f(e,7)).value=t,p(v)},doctype:function(e){var t;t=v.append(f("#doctype",10)),t.value=e,p(v)},start:function(e,t,n){var r,i,a,c,l;if(a=k?o.getElementRule(e):{}){for(r=f(a.outputName||e,1),r.attributes=t,r.shortEnded=n,v.append(r),l=L[v.name],l&&L[r.name]&&!l[r.name]&&P.push(r),i=s.length;i--;)(c=s[i].name)in t.map&&(E=d[c],E?E.push(r):d[c]=[r]);w[e]&&p(r),n||(v=r),!T&&R[e]&&(T=!0)}},end:function(e){var n,r,i,a,s;if(r=k?o.getElementRule(e):{}){if(w[e]&&!T){if((n=v.firstChild)&&3===n.type)for(i=n.value.replace(N,""),i.length>0?(n.value=i,n=n.next):(a=n.next,n.remove(),n=a);n&&3===n.type;)i=n.value,a=n.next,(0===i.length||M.test(i))&&(n.remove(),n=a),n=a;if((n=v.lastChild)&&3===n.type)for(i=n.value.replace(A,""),i.length>0?(n.value=i,n=n.prev):(a=n.prev,n.remove(),n=a);n&&3===n.type;)i=n.value,a=n.prev,(0===i.length||M.test(i))&&(n.remove(),n=a),n=a}if(T&&R[e]&&(T=!1),(r.removeEmpty||r.paddEmpty)&&v.isEmpty(I))if(r.paddEmpty)v.empty().append(new t("#text","3")).value="\xa0";else if(!v.attributes.map.name&&!v.attributes.map.id)return s=v.parent,v.empty().remove(),void(v=s);v=v.parent}}},o),g=v=new t(l.context||n.root_name,11),h.parse(i),k&&P.length&&(l.context?l.invalid=!0:r(P)),D&&"body"==g.name&&u(),!l.invalid){for(S in c){for(E=a[S],y=c[S],x=y.length;x--;)y[x].parent||y.splice(x,1);for(b=0,C=E.length;C>b;b++)E[b](y,S,l)}for(b=0,C=s.length;C>b;b++)if(E=s[b],E.name in d){for(y=d[E.name],x=y.length;x--;)y[x].parent||y.splice(x,1);for(x=0,_=E.callbacks.length;_>x;x++)E.callbacks[x](y,E.name,l)}}return g},n.remove_trailing_brs&&i.addNodeFilter("br",function(t){var n,r,i,a,s,c,d=t.length,l=e.extend({},o.getBlockElements()),u=o.getNonEmptyElements();for(l.body=1,n=0;d>n;n++)if(r=t[n],i=r.parent,l[r.parent.name]&&r===i.lastChild){for(s=r.prev;s;){if("span"!==(c=s.name)||"bookmark"!==s.attr("data-mce-type")){if("br"!==c)break;if("br"===c){r=null;break}}s=s.prev}r&&(r.remove(),i.isEmpty(u)&&(elementRule=o.getElementRule(i.name),elementRule&&(elementRule.removeEmpty?i.remove():elementRule.paddEmpty&&(i.empty().append(new e.html.Node("#text",3)).value="\xa0"))))}else{for(a=r;i.firstChild===a&&i.lastChild===a&&(a=i,!l[i.name]);)i=i.parent;a===i&&(textNode=new e.html.Node("#text",3),textNode.value="\xa0",r.replace(textNode))}}),n.allow_html_in_named_anchor||i.addAttributeFilter("id,name",function(e){for(var t,n,o,r,i=e.length;i--;)if(r=e[i],"a"===r.name&&r.firstChild&&!r.attr("href")){o=r.parent,t=r.lastChild;do{n=t.prev,o.insert(t,r),t=n}while(t)}})}}(tinymce),tinymce.html.Writer=function(e){var t,n,o,r,i,a=[];return e=e||{},t=e.indent,n=tinymce.makeMap(e.indent_before||""),o=tinymce.makeMap(e.indent_after||""),r=tinymce.html.Entities.getEncodeFunc(e.entity_encoding||"raw",e.entities),i="html"==e.element_format,{start:function(e,s,c){var d,l,u,f;if(t&&n[e]&&a.length>0&&(f=a[a.length-1],f.length>0&&"\n"!==f&&a.push("\n")),a.push("<",e),s)for(d=0,l=s.length;l>d;d++)u=s[d],a.push(" ",u.name,'="',r(u.value,!0),'"');a[a.length]=!c||i?">":" />",c&&t&&o[e]&&a.length>0&&(f=a[a.length-1],f.length>0&&"\n"!==f&&a.push("\n"))},end:function(e){var n;a.push("</",e,">"),t&&o[e]&&a.length>0&&(n=a[a.length-1],n.length>0&&"\n"!==n&&a.push("\n"))},text:function(e,t){e.length>0&&(a[a.length]=t?e:r(e))},cdata:function(e){a.push("<![CDATA[",e,"]]>")},comment:function(e){a.push("<!--",e,"-->")},pi:function(e,n){n?a.push("<?",e," ",n,"?>"):a.push("<?",e,"?>"),t&&a.push("\n")},doctype:function(e){a.push("<!DOCTYPE",e,">",t?"\n":"")},reset:function(){a.length=0},getContent:function(){return a.join("").replace(/\n$/,"")}}},function(e){e.html.Serializer=function(t,n){var o=this,r=new e.html.Writer(t);t=t||{},t.validate=!("validate"in t)||t.validate,o.schema=n=n||new e.html.Schema,o.writer=r,o.serialize=function(e){function o(e){var t,s,c,d,l,u,f,p,m,h=i[e.type];if(h)h(e);else{if(t=e.name,s=e.shortEnded,c=e.attributes,a&&c&&c.length>1){for(u=[],u.map={},m=n.getElementRule(e.name),f=0,p=m.attributesOrder.length;p>f;f++)(d=m.attributesOrder[f])in c.map&&(l=c.map[d],u.map[d]=l,u.push({name:d,value:l}));for(f=0,p=c.length;p>f;f++)(d=c[f].name)in u.map||(l=c.map[d],u.map[d]=l,u.push({name:d,value:l}));c=u}if(r.start(e.name,c,s),!s){if(e=e.firstChild)do{o(e)}while(e=e.next);r.end(t)}}}var i,a;return a=t.validate,i={3:function(e){r.text(e.value,e.raw)},8:function(e){r.comment(e.value)},7:function(e){r.pi(e.name,e.value)},10:function(e){r.doctype(e.value)},4:function(e){r.cdata(e.value)},11:function(e){if(e=e.firstChild)do{o(e)}while(e=e.next)}},r.reset(),1!=e.type||t.inner?i[11](e):o(e),r.getContent()}}}(tinymce),tinymce.dom={},function(e,t){function n(e,t,n,o){e.addEventListener?e.addEventListener(t,n,o||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function o(e,t,n,o){e.removeEventListener?e.removeEventListener(t,n,o||!1):e.detachEvent&&e.detachEvent("on"+t,n)}function r(e,t){function n(){return!1}function o(){return!0}var r,i=t||{};for(r in e)"layerX"!==r&&"layerY"!==r&&(i[r]=e[r]);return i.target||(i.target=i.srcElement||document),i.preventDefault=function(){i.isDefaultPrevented=o,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},i.stopPropagation=function(){i.isPropagationStopped=o,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=o,i.stopPropagation()},i.isDefaultPrevented||(i.isDefaultPrevented=n,i.isPropagationStopped=n,i.isImmediatePropagationStopped=n),i}function i(e,t,r){function i(){r.domLoaded||(r.domLoaded=!0,t(c))}var a=e.document,c={type:"ready"};return"complete"==a.readyState?void i():(s?n(e,"DOMContentLoaded",i):(n(a,"readystatechange",function(){"complete"===a.readyState&&(o(a,"readystatechange",arguments.callee),i())}),a.documentElement.doScroll&&e===e.top&&function(){try{a.documentElement.doScroll("left")}catch(e){return void setTimeout(arguments.callee,0)}i()}()),void n(e,"load",i))}function a(e){function a(e,t){var n,o,r,i;if(n=p[t][e.type])for(o=0,r=n.length;r>o;o++)if(i=n[o],i&&!1===i.func.call(i.scope,e)&&e.preventDefault(),e.isImmediatePropagationStopped())return}var c,d,l,u,f=this,p={};l="onmouseenter"in document.documentElement,d="onfocusin"in document.documentElement,u={mouseenter:"mouseover",mouseleave:"mouseout"},c=1,f.domLoaded=!1,f.events=p,f.bind=function(o,m,h,g){function v(e){a(r(e||k.event),y)}var y,b,C,x,_,E,S,k=window;if(o&&3!==o.nodeType&&8!==o.nodeType){for(o[t]?(y=o[t],p[y]||(p[y]={})):(y=c++,o[t]=y,p[y]={}),g=g||o,m=m.split(" "),C=m.length;C--;)x=m[C],E=v,_=S=!1,"DOMContentLoaded"===x&&(x="ready"),!f.domLoaded&&"complete"!=o.readyState||"ready"!==x?(l||(_=u[x])&&(E=function(e){var t,n;if(t=e.currentTarget,(n=e.relatedTarget)&&t.contains)n=t.contains(n);else for(;n&&n!==t;)n=n.parentNode;n||(e=r(e||k.event),e.type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,a(e,y))}),d||"focusin"!==x&&"focusout"!==x||(S=!0,_="focusin"===x?"focus":"blur",E=function(e){e=r(e||k.event),e.type="focus"===e.type?"focusin":"focusout",a(e,y)}),b=p[y][x],b?b.push({func:h,scope:g}):(p[y][x]=b=[{func:h,scope:g}],b.fakeName=_,b.capture=S,b.nativeHandler=E,s||(b.proxyHandler=e(y)),"ready"===x?i(o,E,f):n(o,_||x,s?E:b.proxyHandler,S))):(f.domLoaded=!0,h.call(g,r({type:x})));return o=b=0,h}},f.unbind=function(e,n,r){var i,a,c,d,l,u;if(!e||3===e.nodeType||8===e.nodeType)return f;if(i=e[t]){if(u=p[i],n){for(n=n.split(" "),c=n.length;c--;)if(l=n[c],a=u[l]){if(r)for(d=a.length;d--;)a[d].func===r&&a.splice(d,1);r&&0!==a.length||(delete u[l],o(e,a.fakeName||l,s?a.nativeHandler:a.proxyHandler,a.capture))}}else{for(l in u)a=u[l],o(e,a.fakeName||l,s?a.nativeHandler:a.proxyHandler,a.capture);u={}}for(l in u)return f;delete p[i];try{delete e[t]}catch(n){e[t]=null}}return f},f.fire=function(e,n,o){var i,s;if(!e||3===e.nodeType||8===e.nodeType)return f;s=r(null,o),s.type=n;do{i=e[t],i&&a(s,i),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow}while(e&&!s.isPropagationStopped());return f},f.clean=function(e){var n,o,r=f.unbind;if(!e||3===e.nodeType||8===e.nodeType)return f;if(e[t]&&r(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(r(e),o=e.getElementsByTagName("*"),n=o.length;n--;)e=o[n],e[t]&&r(e);return f},f.callNativeHandler=function(e,t){p&&p[e][t.type].nativeHandler(t)},f.destory=function(){p={}},f.add=function(e,t,n,o){if("string"==typeof e&&(e=document.getElementById(e)),!(e&&e instanceof Array))return"init"===t&&(t="ready"),f.bind(e,t instanceof Array?t.join(" "):t,n,o);for(var r=e.length;r--;)f.add(e[r],t,n,o)},f.remove=function(e,t,n,o){if(!e)return f;if("string"==typeof e&&(e=document.getElementById(e)),e instanceof Array){for(var r=e.length;r--;)f.remove(e[r],t,n,o);return f}return f.unbind(e,t instanceof Array?t.join(" "):t,n)},f.clear=function(e){return"string"==typeof e&&(e=document.getElementById(e)),f.clean(e)},f.cancel=function(e){return e&&(f.prevent(e),f.stop(e)),!1},f.prevent=function(e){return e.preventDefault||(e=r(e)),e.preventDefault(),!1},f.stop=function(e){return e.stopPropagation||(e=r(e)),e.stopPropagation(),!1}}var s=!!document.addEventListener;e.EventUtils=a,e.Event=new a(function(e){return function(t){tinymce.dom.Event.callNativeHandler(e,t)}}),e.Event.bind(window,"ready",function(){}),e=0}(tinymce.dom,"data-mce-expando"),tinymce.dom.TreeWalker=function(e,t){function n(e,n,o,r){var i,a;if(e){if(!r&&e[n])return e[n];if(e!=t){if(i=e[o])return i;for(a=e.parentNode;a&&a!=t;a=a.parentNode)if(i=a[o])return i}}}var o=e;this.current=function(){return o},this.next=function(e){return o=n(o,"firstChild","nextSibling",e)},this.prev=function(e){return o=n(o,"lastChild","previousSibling",e)}},function(e){var t=e.each,n=e.is,o=e.isWebKit,r=e.isIE,i=e.html.Entities,a=/^([a-z0-9],?)+$/i,s=/^[ \t\r\n]*$/;e.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(t,n){var o,r=this;if(r.doc=t,r.win=window,r.files={},r.cssFlicker=!1,r.counter=0,r.stdMode=!e.isIE||t.documentMode>=8,r.boxModel=!e.isIE||"CSS1Compat"==t.compatMode||r.stdMode,r.hasOuterHTML="outerHTML"in t.createElement("a"),r.settings=n=e.extend({keep_values:!1,hex_colors:1},n),r.schema=n.schema,r.styles=new e.html.Styles({url_converter:n.url_converter,url_converter_scope:n.url_converter_scope},n.schema),e.isIE6)try{t.execCommand("BackgroundImageCache",!1,!0)}catch(e){r.cssFlicker=!0}r.fixDoc(t),r.events=n.ownEvents?new e.dom.EventUtils(n.proxy):e.dom.Event,e.addUnload(r.destroy,r),o=n.schema?n.schema.getBlockElements():{},r.isBlock=function(e){if(!e)return!1;var t=e.nodeType;return t?!(1!==t||!o[e.nodeName]):!!o[e]}},fixDoc:function(t){var n,o=this.settings;if(r&&!e.isIE11&&o.schema){"abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video".replace(/\w+/g,function(e){t.createElement(e)});for(n in o.schema.getCustomElements())t.createElement(n)}},clone:function(n,o){var i,a,s=this;return!r||e.isIE11||1!==n.nodeType||o?n.cloneNode(o):(a=s.doc,o?i.firstChild:(i=a.createElement(n.nodeName),t(s.getAttribs(n),function(e){s.setAttrib(i,e.nodeName,s.getAttrib(n,e.nodeName))}),i))},getRoot:function(){var e=this,t=e.settings;return t&&e.get(t.root_element)||e.doc.body},getViewPort:function(e){var t,n;return e=e||this.win,t=e.document,n=this.boxModel?t.documentElement:t.body,{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop,w:e.innerWidth||n.clientWidth,h:e.innerHeight||n.clientHeight}},getRect:function(e){var t,n,o=this;return e=o.get(e),t=o.getPos(e),n=o.getSize(e),{x:t.x,y:t.y,w:n.w,h:n.h}},getSize:function(e){var t,n,o=this;return e=o.get(e),t=o.getStyle(e,"width"),n=o.getStyle(e,"height"),-1===t.indexOf("px")&&(t=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(t,10)||e.offsetWidth||e.clientWidth,h:parseInt(n,10)||e.offsetHeight||e.clientHeight}},getParent:function(e,t,n){return this.getParents(e,t,n,!1)},getParents:function(e,t,o,r){var i,a=this,s=a.settings,c=[];for(e=a.get(e),r=void 0===r,s.strict_root&&(o=o||a.getRoot()),n(t,"string")&&(i=t,t="*"===t?function(e){return 1==e.nodeType}:function(e){return a.is(e,i)});e&&e!=o&&e.nodeType&&9!==e.nodeType;){if(!t||t(e)){if(!r)return e;c.push(e)}e=e.parentNode}return r?c:null},get:function(e){var t;return e&&this.doc&&"string"==typeof e&&(t=e,(e=this.doc.getElementById(e))&&e.id!==t)?this.doc.getElementsByName(t)[1]:e},getNext:function(e,t){return this._findSib(e,t,"nextSibling")},getPrev:function(e,t){return this._findSib(e,t,"previousSibling")},select:function(t,n){var o=this;return e.dom.Sizzle(t,o.get(n)||o.get(o.settings.root_element)||o.doc,[])},is:function(t,n){var o;if(void 0===t.length){if("*"===n)return 1==t.nodeType;if(a.test(n)){for(n=n.toLowerCase().split(/,/),t=t.nodeName.toLowerCase(),o=n.length-1;o>=0;o--)if(n[o]==t)return!0;return!1}}return e.dom.Sizzle.matches(n,t.nodeType?[t]:t).length>0},add:function(e,t,o,r,i){var a=this;return this.run(e,function(e){var s;return s=n(t,"string")?a.doc.createElement(t):t,a.setAttribs(s,o),r&&(r.nodeType?s.appendChild(r):a.setHTML(s,r)),i?s:e.appendChild(s)})},create:function(e,t,n){return this.add(this.doc.createElement(e),e,t,n,1)},createHTML:function(e,t,n){var o,r="",i=this;r+="<"+e
@@ -139,6 +139,24 @@ n.href&&C.apply("link",n,o)},selectAll:function(){var e=g.getRoot(),t=g.createRn
139
139
  * Copyright 2011-2017 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
140
140
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
141
141
  */
142
- if(function(t,e){"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e(require,exports,module):t.Tether=e()}(this,function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t){var n=t.getBoundingClientRect(),i={};for(var o in n)i[o]=n[o];if(t.ownerDocument!==document){var r=t.ownerDocument.defaultView.frameElement;if(r){var s=e(r);i.top+=s.top,i.bottom+=s.top,i.left+=s.left,i.right+=s.left}}return i}function n(t){var e=getComputedStyle(t)||{},n=e.position,i=[];if("fixed"===n)return[t];for(var o=t;(o=o.parentNode)&&o&&1===o.nodeType;){var r=void 0;try{r=getComputedStyle(o)}catch(t){}if(void 0===r||null===r)return i.push(o),i;var s=r,a=s.overflow,l=s.overflowX,h=s.overflowY;/(auto|scroll|overlay)/.test(a+h+l)&&("absolute"!==n||["relative","absolute","fixed"].indexOf(r.position)>=0)&&i.push(o)}return i.push(t.ownerDocument.body),t.ownerDocument!==document&&i.push(t.ownerDocument.defaultView),i}function i(){C&&document.body.removeChild(C),C=null}function o(t){var n=void 0;t===document?(n=document,t=document.documentElement):n=t.ownerDocument;var i=n.documentElement,o=e(t),r=O();return o.top-=r.top,o.left-=r.left,"undefined"==typeof o.width&&(o.width=document.body.scrollWidth-o.left-o.right),"undefined"==typeof o.height&&(o.height=document.body.scrollHeight-o.top-o.bottom),o.top=o.top-i.clientTop,o.left=o.left-i.clientLeft,o.right=n.body.clientWidth-o.width-o.left,o.bottom=n.body.clientHeight-o.height-o.top,o}function r(t){return t.offsetParent||document.documentElement}function s(){if(I)return I;var t=document.createElement("div");t.style.width="100%",t.style.height="200px";var e=document.createElement("div");a(e.style,{position:"absolute",top:0,left:0,pointerEvents:"none",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),e.appendChild(t),document.body.appendChild(e);var n=t.offsetWidth;e.style.overflow="scroll";var i=t.offsetWidth;n===i&&(i=e.clientWidth),document.body.removeChild(e);var o=n-i;return I={width:o,height:o}}function a(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],e=[];return Array.prototype.push.apply(e,arguments),e.slice(1).forEach(function(e){if(e)for(var n in e)({}).hasOwnProperty.call(e,n)&&(t[n]=e[n])}),t}function l(t,e){if("undefined"!=typeof t.classList)e.split(" ").forEach(function(e){e.trim()&&t.classList.remove(e)});else{var n=new RegExp("(^| )"+e.split(" ").join("|")+"( |$)","gi"),i=c(t).replace(n," ");u(t,i)}}function h(t,e){if("undefined"!=typeof t.classList)e.split(" ").forEach(function(e){e.trim()&&t.classList.add(e)});else{l(t,e);var n=c(t)+" "+e;u(t,n)}}function f(t,e){if("undefined"!=typeof t.classList)return t.classList.contains(e);var n=c(t);return new RegExp("(^| )"+e+"( |$)","gi").test(n)}function c(t){return t.className instanceof t.ownerDocument.defaultView.SVGAnimatedString?t.className.baseVal:t.className}function u(t,e){t.setAttribute("class",e)}function d(t,e,n){n.forEach(function(n){-1===e.indexOf(n)&&f(t,n)&&l(t,n)}),e.forEach(function(e){f(t,e)||h(t,e)})}function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function g(t,e){var n=arguments.length<=2||void 0===arguments[2]?1:arguments[2];return t+n>=e&&e>=t-n}function m(){return"undefined"!=typeof performance&&"undefined"!=typeof performance.now?performance.now():+new Date}function _(){for(var t={top:0,left:0},e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return n.forEach(function(e){var n=e.top,i=e.left;"string"==typeof n&&(n=parseFloat(n,10)),"string"==typeof i&&(i=parseFloat(i,10)),t.top+=n,t.left+=i}),t}function v(t,e){return"string"==typeof t.left&&-1!==t.left.indexOf("%")&&(t.left=parseFloat(t.left,10)/100*e.width),"string"==typeof t.top&&-1!==t.top.indexOf("%")&&(t.top=parseFloat(t.top,10)/100*e.height),t}function E(t,e){return"scrollParent"===e?e=t.scrollParents[0]:"window"===e&&(e=[pageXOffset,pageYOffset,innerWidth+pageXOffset,innerHeight+pageYOffset]),e===document&&(e=e.documentElement),"undefined"!=typeof e.nodeType&&function(){var t=e,n=o(e),i=n,r=getComputedStyle(e);if(e=[i.left,i.top,n.width+i.left,n.height+i.top],t.ownerDocument!==document){var s=t.ownerDocument.defaultView;e[0]+=s.pageXOffset,e[1]+=s.pageYOffset,e[2]+=s.pageXOffset,e[3]+=s.pageYOffset}Q.forEach(function(t,n){t=t[0].toUpperCase()+t.substr(1),"Top"===t||"Left"===t?e[n]+=parseFloat(r["border"+t+"Width"]):e[n]-=parseFloat(r["border"+t+"Width"])})}(),e}var y=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),T=void 0;void 0===T&&(T={modules:[]});var C=null,A=function(){var t=0;return function(){return++t}}(),b={},O=function(){var t=C;t&&document.body.contains(t)||(t=document.createElement("div"),t.setAttribute("data-tether-id",A()),a(t.style,{top:0,left:0,position:"absolute"}),document.body.appendChild(t),C=t);var n=t.getAttribute("data-tether-id");return"undefined"==typeof b[n]&&(b[n]=e(t),D(function(){delete b[n]})),b[n]},I=null,S=[],D=function(t){S.push(t)},w=function(){for(var t=void 0;t=S.pop();)t()},N=function(){function e(){t(this,e)}return y(e,[{key:"on",value:function(t,e,n){var i=!(arguments.length<=3||void 0===arguments[3])&&arguments[3];"undefined"==typeof this.bindings&&(this.bindings={}),"undefined"==typeof this.bindings[t]&&(this.bindings[t]=[]),this.bindings[t].push({handler:e,ctx:n,once:i})}},{key:"once",value:function(t,e,n){this.on(t,e,n,!0)}},{key:"off",value:function(t,e){if("undefined"!=typeof this.bindings&&"undefined"!=typeof this.bindings[t])if(void 0===e)delete this.bindings[t];else for(var n=0;n<this.bindings[t].length;)this.bindings[t][n].handler===e?this.bindings[t].splice(n,1):++n}},{key:"trigger",value:function(t){if("undefined"!=typeof this.bindings&&this.bindings[t]){for(var e=0,n=arguments.length,i=Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];for(;e<this.bindings[t].length;){var r=this.bindings[t][e],s=r.handler,a=r.ctx,l=r.once,h=a;void 0===h&&(h=this),s.apply(h,i),l?this.bindings[t].splice(e,1):++e}}}}]),e}();T.Utils={getActualBoundingClientRect:e,getScrollParents:n,getBounds:o,getOffsetParent:r,extend:a,addClass:h,removeClass:l,hasClass:f,updateClasses:d,defer:D,flush:w,uniqueId:A,Evented:N,getScrollBarSize:s,removeUtilElements:i};var L=function(){function t(t,e){var n=[],i=!0,o=!1,r=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){o=!0,r=t}finally{try{!i&&a["return"]&&a["return"]()}finally{if(o)throw r}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),y=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),P=function(t,e,n){for(var i=!0;i;){var o=t,r=e,s=n;i=!1,null===o&&(o=Function.prototype);var a=Object.getOwnPropertyDescriptor(o,r);if(void 0!==a){if("value"in a)return a.value;var l=a.get;if(void 0===l)return;return l.call(s)}var h=Object.getPrototypeOf(o);if(null===h)return;t=h,e=r,n=s,i=!0,a=h=void 0}};if(void 0===T)throw new Error("You must include the utils.js file before tether.js");var H=T.Utils,n=H.getScrollParents,o=H.getBounds,r=H.getOffsetParent,a=H.extend,h=H.addClass,l=H.removeClass,d=H.updateClasses,D=H.defer,w=H.flush,s=H.getScrollBarSize,i=H.removeUtilElements,k=function(){if("undefined"==typeof document)return"";for(var t=document.createElement("div"),e=["transform","WebkitTransform","OTransform","MozTransform","msTransform"],n=0;n<e.length;++n){var i=e[n];if(void 0!==t.style[i])return i}}(),W=[],R=function(){W.forEach(function(t){t.position(!1)}),w()};!function(){var t=null,e=null,n=null,i=function i(){return void 0!==e&&e>16?(e=Math.min(e-16,250),void(n=setTimeout(i,250))):void(void 0!==t&&m()-t<10||(null!=n&&(clearTimeout(n),n=null),t=m(),R(),e=m()-t))};"undefined"!=typeof window&&"undefined"!=typeof window.addEventListener&&["resize","scroll","touchmove"].forEach(function(t){window.addEventListener(t,i)})}();var x={center:"center",left:"right",right:"left"},M={middle:"middle",top:"bottom",bottom:"top"},V={top:0,left:0,middle:"50%",center:"50%",bottom:"100%",right:"100%"},j=function(t,e){var n=t.left,i=t.top;return"auto"===n&&(n=x[e.left]),"auto"===i&&(i=M[e.top]),{left:n,top:i}},F=function(t){var e=t.left,n=t.top;return"undefined"!=typeof V[t.left]&&(e=V[t.left]),"undefined"!=typeof V[t.top]&&(n=V[t.top]),{left:e,top:n}},U=function(t){var e=t.split(" "),n=L(e,2);return{top:n[0],left:n[1]}},B=U,K=function(e){function f(e){var n=this;t(this,f),P(Object.getPrototypeOf(f.prototype),"constructor",this).call(this),this.position=this.position.bind(this),W.push(this),this.history=[],this.setOptions(e,!1),T.modules.forEach(function(t){"undefined"!=typeof t.initialize&&t.initialize.call(n)}),this.position()}return p(f,e),y(f,[{key:"getClass",value:function(){var t=arguments.length<=0||void 0===arguments[0]?"":arguments[0],e=this.options.classes;return void 0!==e&&e[t]?this.options.classes[t]:this.options.classPrefix?this.options.classPrefix+"-"+t:t}},{key:"setOptions",value:function(t){var e=this,i=arguments.length<=1||void 0===arguments[1]||arguments[1],o={offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether"};this.options=a(o,t);var r=this.options,s=r.element,l=r.target,f=r.targetModifier;if(this.element=s,this.target=l,this.targetModifier=f,"viewport"===this.target?(this.target=document.body,this.targetModifier="visible"):"scroll-handle"===this.target&&(this.target=document.body,this.targetModifier="scroll-handle"),["element","target"].forEach(function(t){if("undefined"==typeof e[t])throw new Error("Tether Error: Both element and target must be defined");"undefined"!=typeof e[t].jquery?e[t]=e[t][0]:"string"==typeof e[t]&&(e[t]=document.querySelector(e[t]))}),h(this.element,this.getClass("element")),!1!==this.options.addTargetClasses&&h(this.target,this.getClass("target")),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");this.targetAttachment=B(this.options.targetAttachment),this.attachment=B(this.options.attachment),this.offset=U(this.options.offset),this.targetOffset=U(this.options.targetOffset),"undefined"!=typeof this.scrollParents&&this.disable(),"scroll-handle"===this.targetModifier?this.scrollParents=[this.target]:this.scrollParents=n(this.target),!1!==this.options.enabled&&this.enable(i)}},{key:"getTargetBounds",value:function(){if("undefined"==typeof this.targetModifier)return o(this.target);if("visible"===this.targetModifier){if(this.target===document.body)return{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth};var t=o(this.target),e={height:t.height,width:t.width,top:t.top,left:t.left};return e.height=Math.min(e.height,t.height-(pageYOffset-t.top)),e.height=Math.min(e.height,t.height-(t.top+t.height-(pageYOffset+innerHeight))),e.height=Math.min(innerHeight,e.height),e.height-=2,e.width=Math.min(e.width,t.width-(pageXOffset-t.left)),e.width=Math.min(e.width,t.width-(t.left+t.width-(pageXOffset+innerWidth))),e.width=Math.min(innerWidth,e.width),e.width-=2,e.top<pageYOffset&&(e.top=pageYOffset),e.left<pageXOffset&&(e.left=pageXOffset),e}if("scroll-handle"===this.targetModifier){var t=void 0,n=this.target;n===document.body?(n=document.documentElement,t={left:pageXOffset,top:pageYOffset,height:innerHeight,width:innerWidth}):t=o(n);var i=getComputedStyle(n),r=n.scrollWidth>n.clientWidth||[i.overflow,i.overflowX].indexOf("scroll")>=0||this.target!==document.body,s=0;r&&(s=15);var a=t.height-parseFloat(i.borderTopWidth)-parseFloat(i.borderBottomWidth)-s,e={width:15,height:.975*a*(a/n.scrollHeight),left:t.left+t.width-parseFloat(i.borderLeftWidth)-15},l=0;a<408&&this.target===document.body&&(l=-11e-5*Math.pow(a,2)-.00727*a+22.58),this.target!==document.body&&(e.height=Math.max(e.height,24));var h=this.target.scrollTop/(n.scrollHeight-a);return e.top=h*(a-e.height-l)+t.top+parseFloat(i.borderTopWidth),this.target===document.body&&(e.height=Math.max(e.height,24)),e}}},{key:"clearCache",value:function(){this._cache={}}},{key:"cache",value:function(t,e){return"undefined"==typeof this._cache&&(this._cache={}),"undefined"==typeof this._cache[t]&&(this._cache[t]=e.call(this)),this._cache[t]}},{key:"enable",value:function(){var t=this,e=arguments.length<=0||void 0===arguments[0]||arguments[0];!1!==this.options.addTargetClasses&&h(this.target,this.getClass("enabled")),h(this.element,this.getClass("enabled")),this.enabled=!0,this.scrollParents.forEach(function(e){e!==t.target.ownerDocument&&e.addEventListener("scroll",t.position)}),e&&this.position()}},{key:"disable",value:function(){var t=this;l(this.target,this.getClass("enabled")),l(this.element,this.getClass("enabled")),this.enabled=!1,"undefined"!=typeof this.scrollParents&&this.scrollParents.forEach(function(e){e.removeEventListener("scroll",t.position)})}},{key:"destroy",value:function(){var t=this;this.disable(),W.forEach(function(e,n){e===t&&W.splice(n,1)}),0===W.length&&i()}},{key:"updateAttachClasses",value:function(t,e){var n=this;t=t||this.attachment,e=e||this.targetAttachment;var i=["left","top","bottom","right","middle","center"];"undefined"!=typeof this._addAttachClasses&&this._addAttachClasses.length&&this._addAttachClasses.splice(0,this._addAttachClasses.length),"undefined"==typeof this._addAttachClasses&&(this._addAttachClasses=[]);var o=this._addAttachClasses;t.top&&o.push(this.getClass("element-attached")+"-"+t.top),t.left&&o.push(this.getClass("element-attached")+"-"+t.left),e.top&&o.push(this.getClass("target-attached")+"-"+e.top),e.left&&o.push(this.getClass("target-attached")+"-"+e.left);var r=[];i.forEach(function(t){r.push(n.getClass("element-attached")+"-"+t),r.push(n.getClass("target-attached")+"-"+t)}),D(function(){"undefined"!=typeof n._addAttachClasses&&(d(n.element,n._addAttachClasses,r),!1!==n.options.addTargetClasses&&d(n.target,n._addAttachClasses,r),delete n._addAttachClasses)})}},{key:"position",value:function(){var t=this,e=arguments.length<=0||void 0===arguments[0]||arguments[0];if(this.enabled){this.clearCache();var n=j(this.targetAttachment,this.attachment);this.updateAttachClasses(this.attachment,n);var i=this.cache("element-bounds",function(){return o(t.element)}),a=i.width,l=i.height;if(0===a&&0===l&&"undefined"!=typeof this.lastSize){var h=this.lastSize;a=h.width,l=h.height}else this.lastSize={width:a,height:l};var f=this.cache("target-bounds",function(){return t.getTargetBounds()}),c=f,u=v(F(this.attachment),{width:a,height:l}),d=v(F(n),c),p=v(this.offset,{width:a,height:l}),g=v(this.targetOffset,c);u=_(u,p),d=_(d,g);for(var m=f.left+d.left-u.left,E=f.top+d.top-u.top,y=0;y<T.modules.length;++y){var C=T.modules[y],A=C.position.call(this,{left:m,top:E,targetAttachment:n,targetPos:f,elementPos:i,offset:u,targetOffset:d,manualOffset:p,manualTargetOffset:g,scrollbarSize:S,attachment:this.attachment});if(!1===A)return!1;void 0!==A&&"object"==typeof A&&(E=A.top,m=A.left)}var b={page:{top:E,left:m},viewport:{top:E-pageYOffset,bottom:pageYOffset-E-l+innerHeight,left:m-pageXOffset,right:pageXOffset-m-a+innerWidth}},O=this.target.ownerDocument,I=O.defaultView,S=void 0;return I.innerHeight>O.documentElement.clientHeight&&(S=this.cache("scrollbar-size",s),b.viewport.bottom-=S.height),I.innerWidth>O.documentElement.clientWidth&&(S=this.cache("scrollbar-size",s),b.viewport.right-=S.width),-1!==["","static"].indexOf(O.body.style.position)&&-1!==["","static"].indexOf(O.body.parentElement.style.position)||(b.page.bottom=O.body.scrollHeight-E-l,b.page.right=O.body.scrollWidth-m-a),"undefined"!=typeof this.options.optimizations&&!1!==this.options.optimizations.moveElement&&"undefined"==typeof this.targetModifier&&function(){var e=t.cache("target-offsetparent",function(){return r(t.target)}),n=t.cache("target-offsetparent-bounds",function(){return o(e)}),i=getComputedStyle(e),s=n,a={};if(["Top","Left","Bottom","Right"].forEach(function(t){a[t.toLowerCase()]=parseFloat(i["border"+t+"Width"])}),n.right=O.body.scrollWidth-n.left-s.width+a.right,n.bottom=O.body.scrollHeight-n.top-s.height+a.bottom,b.page.top>=n.top+a.top&&b.page.bottom>=n.bottom&&b.page.left>=n.left+a.left&&b.page.right>=n.right){var l=e.scrollTop,h=e.scrollLeft;b.offset={top:b.page.top-n.top+l-a.top,left:b.page.left-n.left+h-a.left}}}(),this.move(b),this.history.unshift(b),this.history.length>3&&this.history.pop(),e&&w(),!0}}},{key:"move",value:function(t){var e=this;if("undefined"!=typeof this.element.parentNode){var n={};for(var i in t){n[i]={};for(var o in t[i]){for(var s=!1,l=0;l<this.history.length;++l){var h=this.history[l];if("undefined"!=typeof h[i]&&!g(h[i][o],t[i][o])){s=!0;break}}s||(n[i][o]=!0)}}var f={top:"",left:"",right:"",bottom:""},c=function(t,n){if(!1!==("undefined"!=typeof e.options.optimizations?e.options.optimizations.gpu:null)){var i=void 0,o=void 0;t.top?(f.top=0,i=n.top):(f.bottom=0,i=-n.bottom),t.left?(f.left=0,o=n.left):(f.right=0,o=-n.right),window.matchMedia&&(window.matchMedia("only screen and (min-resolution: 1.3dppx)").matches||window.matchMedia("only screen and (-webkit-min-device-pixel-ratio: 1.3)").matches||(o=Math.round(o),i=Math.round(i))),f[k]="translateX("+o+"px) translateY("+i+"px)","msTransform"!==k&&(f[k]+=" translateZ(0)")}else t.top?f.top=n.top+"px":f.bottom=n.bottom+"px",t.left?f.left=n.left+"px":f.right=n.right+"px"},u=!1;if((n.page.top||n.page.bottom)&&(n.page.left||n.page.right)?(f.position="absolute",c(n.page,t.page)):(n.viewport.top||n.viewport.bottom)&&(n.viewport.left||n.viewport.right)?(f.position="fixed",c(n.viewport,t.viewport)):"undefined"!=typeof n.offset&&n.offset.top&&n.offset.left?function(){f.position="absolute";var i=e.cache("target-offsetparent",function(){return r(e.target)});r(e.element)!==i&&D(function(){e.element.parentNode.removeChild(e.element),i.appendChild(e.element)}),c(n.offset,t.offset),u=!0}():(f.position="absolute",c({top:!0,left:!0},t.page)),!u)if(this.options.bodyElement)this.options.bodyElement.appendChild(this.element);else{for(var d=!0,p=this.element.parentNode;p&&1===p.nodeType&&"BODY"!==p.tagName;){if("static"!==getComputedStyle(p).position){d=!1;break}p=p.parentNode}d||(this.element.parentNode.removeChild(this.element),this.element.ownerDocument.body.appendChild(this.element))}var m={},_=!1;for(var o in f){var v=f[o];this.element.style[o]!==v&&(_=!0,m[o]=v)}_&&D(function(){a(e.element.style,m),e.trigger("repositioned")})}}}]),f}(N);K.modules=[],T.position=R;var G=a(K,T),L=function(){function t(t,e){var n=[],i=!0,o=!1,r=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){o=!0,r=t}finally{try{!i&&a["return"]&&a["return"]()}finally{if(o)throw r}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),H=T.Utils,o=H.getBounds,a=H.extend,d=H.updateClasses,D=H.defer,Q=["left","top","right","bottom"];T.modules.push({position:function(t){var e=this,n=t.top,i=t.left,r=t.targetAttachment;if(!this.options.constraints)return!0;var s=this.cache("element-bounds",function(){return o(e.element)}),l=s.height,h=s.width;if(0===h&&0===l&&"undefined"!=typeof this.lastSize){var f=this.lastSize;h=f.width,l=f.height}var c=this.cache("target-bounds",function(){return e.getTargetBounds()}),u=c.height,p=c.width,g=[this.getClass("pinned"),this.getClass("out-of-bounds")];this.options.constraints.forEach(function(t){var e=t.outOfBoundsClass,n=t.pinnedClass;e&&g.push(e),n&&g.push(n)}),g.forEach(function(t){["left","top","right","bottom"].forEach(function(e){g.push(t+"-"+e)})});var m=[],_=a({},r),v=a({},this.attachment);return this.options.constraints.forEach(function(t){var o=t.to,s=t.attachment,a=t.pin;void 0===s&&(s="");var f=void 0,c=void 0;if(s.indexOf(" ")>=0){var d=s.split(" "),g=L(d,2);c=g[0],f=g[1]}else f=c=s;var y=E(e,o);"target"!==c&&"both"!==c||(n<y[1]&&"top"===_.top&&(n+=u,_.top="bottom"),n+l>y[3]&&"bottom"===_.top&&(n-=u,_.top="top")),"together"===c&&("top"===_.top&&("bottom"===v.top&&n<y[1]?(n+=u,_.top="bottom",n+=l,v.top="top"):"top"===v.top&&n+l>y[3]&&n-(l-u)>=y[1]&&(n-=l-u,_.top="bottom",v.top="bottom")),"bottom"===_.top&&("top"===v.top&&n+l>y[3]?(n-=u,_.top="top",n-=l,v.top="bottom"):"bottom"===v.top&&n<y[1]&&n+(2*l-u)<=y[3]&&(n+=l-u,_.top="top",v.top="top")),"middle"===_.top&&(n+l>y[3]&&"top"===v.top?(n-=l,v.top="bottom"):n<y[1]&&"bottom"===v.top&&(n+=l,v.top="top"))),"target"!==f&&"both"!==f||(i<y[0]&&"left"===_.left&&(i+=p,_.left="right"),i+h>y[2]&&"right"===_.left&&(i-=p,_.left="left")),"together"===f&&(i<y[0]&&"left"===_.left?"right"===v.left?(i+=p,_.left="right",i+=h,v.left="left"):"left"===v.left&&(i+=p,_.left="right",i-=h,v.left="right"):i+h>y[2]&&"right"===_.left?"left"===v.left?(i-=p,_.left="left",i-=h,v.left="right"):"right"===v.left&&(i-=p,_.left="left",i+=h,v.left="left"):"center"===_.left&&(i+h>y[2]&&"left"===v.left?(i-=h,v.left="right"):i<y[0]&&"right"===v.left&&(i+=h,v.left="left"))),"element"!==c&&"both"!==c||(n<y[1]&&"bottom"===v.top&&(n+=l,v.top="top"),n+l>y[3]&&"top"===v.top&&(n-=l,v.top="bottom")),"element"!==f&&"both"!==f||(i<y[0]&&("right"===v.left?(i+=h,v.left="left"):"center"===v.left&&(i+=h/2,v.left="left")),i+h>y[2]&&("left"===v.left?(i-=h,v.left="right"):"center"===v.left&&(i-=h/2,v.left="right"))),"string"==typeof a?a=a.split(",").map(function(t){return t.trim()}):!0===a&&(a=["top","left","right","bottom"]),a=a||[];var T=[],C=[];n<y[1]&&(a.indexOf("top")>=0?(n=y[1],T.push("top")):C.push("top")),n+l>y[3]&&(a.indexOf("bottom")>=0?(n=y[3]-l,T.push("bottom")):C.push("bottom")),i<y[0]&&(a.indexOf("left")>=0?(i=y[0],T.push("left")):C.push("left")),i+h>y[2]&&(a.indexOf("right")>=0?(i=y[2]-h,T.push("right")):C.push("right")),T.length&&function(){var t=void 0;t="undefined"!=typeof e.options.pinnedClass?e.options.pinnedClass:e.getClass("pinned"),m.push(t),T.forEach(function(e){m.push(t+"-"+e)})}(),C.length&&function(){var t=void 0;t="undefined"!=typeof e.options.outOfBoundsClass?e.options.outOfBoundsClass:e.getClass("out-of-bounds"),m.push(t),C.forEach(function(e){m.push(t+"-"+e)})}(),(T.indexOf("left")>=0||T.indexOf("right")>=0)&&(v.left=_.left=!1),(T.indexOf("top")>=0||T.indexOf("bottom")>=0)&&(v.top=_.top=!1),_.top===r.top&&_.left===r.left&&v.top===e.attachment.top&&v.left===e.attachment.left||(e.updateAttachClasses(v,_),e.trigger("update",{attachment:v,targetAttachment:_}))}),D(function(){!1!==e.options.addTargetClasses&&d(e.target,m,g),d(e.element,m,g)}),{top:n,left:i}}});var H=T.Utils,o=H.getBounds,d=H.updateClasses,D=H.defer;T.modules.push({position:function(t){var e=this,n=t.top,i=t.left,r=this.cache("element-bounds",function(){return o(e.element)}),s=r.height,a=r.width,l=this.getTargetBounds(),h=n+s,f=i+a,c=[];n<=l.bottom&&h>=l.top&&["left","right"].forEach(function(t){var e=l[t];e!==i&&e!==f||c.push(t)}),i<=l.right&&f>=l.left&&["top","bottom"].forEach(function(t){var e=l[t];e!==n&&e!==h||c.push(t)});var u=[],p=[],g=["left","top","right","bottom"];return u.push(this.getClass("abutted")),g.forEach(function(t){u.push(e.getClass("abutted")+"-"+t)}),c.length&&p.push(this.getClass("abutted")),c.forEach(function(t){p.push(e.getClass("abutted")+"-"+t)}),D(function(){!1!==e.options.addTargetClasses&&d(e.target,p,u),d(e.element,p,u)}),!0}});var L=function(){function t(t,e){var n=[],i=!0,o=!1,r=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){o=!0,r=t}finally{try{!i&&a["return"]&&a["return"]()}finally{if(o)throw r}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();return T.modules.push({position:function(t){var e=t.top,n=t.left;if(this.options.shift){var i=this.options.shift;"function"==typeof this.options.shift&&(i=this.options.shift.call(this,{top:e,left:n}));var o=void 0,r=void 0;if("string"==typeof i){i=i.split(" "),i[1]=i[1]||i[0];var s=i,a=L(s,2);o=a[0],r=a[1],o=parseFloat(o,10),r=parseFloat(r,10)}else o=i.top,r=i.left;return e+=o,n+=r,{top:e,left:n}}}}),G}),"undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");+function(t){var e=t.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||e[0]>=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}(jQuery),function(){function t(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function e(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=function(t){function e(t){return{}.toString.call(t).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}function n(t){return(t[0]||t).nodeType}function i(){return{bindType:a.end,delegateType:a.end,handle:function(e){return t(e.target).is(this)?e.handleObj.handler.apply(this,arguments):undefined}}}function o(){if(window.QUnit)return!1;var t=document.createElement("bootstrap");for(var e in h)if(t.style[e]!==undefined)return{end:h[e]};return!1}function r(e){var n=this,i=!1;return t(this).one(f.TRANSITION_END,function(){i=!0}),setTimeout(function(){i||f.triggerTransitionEnd(n)},e),this}function s(){a=o(),t.fn.emulateTransitionEnd=r,f.supportsTransitionEnd()&&(t.event.special[f.TRANSITION_END]=i())}var a=!1,l=1e6,h={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},f={TRANSITION_END:"bsTransitionEnd",getUID:function(t){do{t+=~~(Math.random()*l)}while(document.getElementById(t));return t},getSelectorFromElement:function(t){var e=t.getAttribute("data-target");return e||(e=t.getAttribute("href")||"",e=/^#[a-z]/i.test(e)?e:null),e},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(e){t(e).trigger(a.end)},supportsTransitionEnd:function(){return Boolean(a)},typeCheckConfig:function(t,i,o){for(var r in o)if(o.hasOwnProperty(r)){var s=o[r],a=i[r],l=a&&n(a)?"element":e(a);if(!new RegExp(s).test(l))throw new Error(t.toUpperCase()+': Option "'+r+'" provided type "'+l+'" but expected type "'+s+'".')}}};return s(),f}(jQuery),s=(function(t){var e="alert",i="4.0.0-alpha.6",s="bs.alert",a="."+s,l=".data-api",h=t.fn[e],f=150,c={DISMISS:'[data-dismiss="alert"]'},u={CLOSE:"close"+a,CLOSED:"closed"+a,CLICK_DATA_API:"click"+a+l},d={ALERT:"alert",FADE:"fade",SHOW:"show"},p=function(){function e(t){n(this,e),this._element=t}return e.prototype.close=function(t){t=t||this._element;var e=this._getRootElement(t);this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},e.prototype.dispose=function(){t.removeData(this._element,s),this._element=null},e.prototype._getRootElement=function(e){var n=r.getSelectorFromElement(e),i=!1;return n&&(i=t(n)[0]),i||(i=t(e).closest("."+d.ALERT)[0]),i},e.prototype._triggerCloseEvent=function(e){var n=t.Event(u.CLOSE);return t(e).trigger(n),n},e.prototype._removeElement=function(e){var n=this;if(t(e).removeClass(d.SHOW),!r.supportsTransitionEnd()||!t(e).hasClass(d.FADE))return void this._destroyElement(e);t(e).one(r.TRANSITION_END,function(t){return n._destroyElement(e,t)}).emulateTransitionEnd(f)},e.prototype._destroyElement=function(e){t(e).detach().trigger(u.CLOSED).remove()},e._jQueryInterface=function(n){return this.each(function(){var i=t(this),o=i.data(s);o||(o=new e(this),i.data(s,o)),"close"===n&&o[n](this)})},e._handleDismiss=function(t){return function(e){e&&e.preventDefault(),t.close(this)}},o(e,null,[{key:"VERSION",get:function(){return i}}]),e}();t(document).on(u.CLICK_DATA_API,c.DISMISS,p._handleDismiss(new p)),t.fn[e]=p._jQueryInterface,t.fn[e].Constructor=p,t.fn[e].noConflict=function(){return t.fn[e]=h,p._jQueryInterface}}(jQuery),function(t){var e="button",i="4.0.0-alpha.6",r="bs.button",s="."+r,a=".data-api",l=t.fn[e],h={ACTIVE:"active",BUTTON:"btn",FOCUS:"focus"},f={DATA_TOGGLE_CARROT:'[data-toggle^="button"]',DATA_TOGGLE:'[data-toggle="buttons"]',INPUT:"input",ACTIVE:".active",BUTTON:".btn"},c={CLICK_DATA_API:"click"+s+a,FOCUS_BLUR_DATA_API:"focus"+s+a+" blur"+s+a},u=function(){function e(t){n(this,e),this._element=t}return e.prototype.toggle=function(){var e=!0,n=t(this._element).closest(f.DATA_TOGGLE)[0];if(n){var i=t(this._element).find(f.INPUT)[0];if(i){if("radio"===i.type)if(i.checked&&t(this._element).hasClass(h.ACTIVE))e=!1;else{var o=t(n).find(f.ACTIVE)[0];o&&t(o).removeClass(h.ACTIVE)}e&&(i.checked=!t(this._element).hasClass(h.ACTIVE),t(i).trigger("change")),i.focus()}}this._element.setAttribute("aria-pressed",!t(this._element).hasClass(h.ACTIVE)),e&&t(this._element).toggleClass(h.ACTIVE)},e.prototype.dispose=function(){t.removeData(this._element,r),this._element=null},e._jQueryInterface=function(n){return this.each(function(){var i=t(this).data(r);i||(i=new e(this),t(this).data(r,i)),"toggle"===n&&i[n]()})},o(e,null,[{key:"VERSION",get:function(){return i}}]),e}();t(document).on(c.CLICK_DATA_API,f.DATA_TOGGLE_CARROT,function(e){e.preventDefault();var n=e.target;t(n).hasClass(h.BUTTON)||(n=t(n).closest(f.BUTTON)),u._jQueryInterface.call(t(n),"toggle")}).on(c.FOCUS_BLUR_DATA_API,f.DATA_TOGGLE_CARROT,function(e){var n=t(e.target).closest(f.BUTTON)[0];t(n).toggleClass(h.FOCUS,/^focus(in)?$/.test(e.type))}),t.fn[e]=u._jQueryInterface,t.fn[e].Constructor=u,t.fn[e].noConflict=function(){return t.fn[e]=l,u._jQueryInterface}}(jQuery),function(t){var e="carousel",s="4.0.0-alpha.6",a="bs.carousel",l="."+a,h=".data-api",f=t.fn[e],c=600,u=37,d=39,p={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0},g={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean"},m={NEXT:"next",PREV:"prev",LEFT:"left",RIGHT:"right"},_={SLIDE:"slide"+l,SLID:"slid"+l,KEYDOWN:"keydown"+l,MOUSEENTER:"mouseenter"+l,MOUSELEAVE:"mouseleave"+l,LOAD_DATA_API:"load"+l+h,CLICK_DATA_API:"click"+l+h},v={CAROUSEL:"carousel",ACTIVE:"active",SLIDE:"slide",RIGHT:"carousel-item-right",LEFT:"carousel-item-left",NEXT:"carousel-item-next",PREV:"carousel-item-prev",ITEM:"carousel-item"},E={ACTIVE:".active",ACTIVE_ITEM:".active.carousel-item",ITEM:".carousel-item",NEXT_PREV:".carousel-item-next, .carousel-item-prev",INDICATORS:".carousel-indicators",DATA_SLIDE:"[data-slide], [data-slide-to]",DATA_RIDE:'[data-ride="carousel"]'},y=function(){function h(e,i){n(this,h),this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this._config=this._getConfig(i),this._element=t(e)[0],this._indicatorsElement=t(this._element).find(E.INDICATORS)[0],this._addEventListeners()}return h.prototype.next=function(){if(this._isSliding)throw new Error("Carousel is sliding");this._slide(m.NEXT)},h.prototype.nextWhenVisible=function(){document.hidden||this.next()},h.prototype.prev=function(){if(this._isSliding)throw new Error("Carousel is sliding");this._slide(m.PREVIOUS)},h.prototype.pause=function(e){e||(this._isPaused=!0),t(this._element).find(E.NEXT_PREV)[0]&&r.supportsTransitionEnd()&&(r.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},h.prototype.cycle=function(t){
143
- t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},h.prototype.to=function(e){var n=this;this._activeElement=t(this._element).find(E.ACTIVE_ITEM)[0];var i=this._getItemIndex(this._activeElement);if(!(e>this._items.length-1||e<0)){if(this._isSliding)return void t(this._element).one(_.SLID,function(){return n.to(e)});if(i===e)return this.pause(),void this.cycle();var o=e>i?m.NEXT:m.PREVIOUS;this._slide(o,this._items[e])}},h.prototype.dispose=function(){t(this._element).off(l),t.removeData(this._element,a),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},h.prototype._getConfig=function(n){return n=t.extend({},p,n),r.typeCheckConfig(e,n,g),n},h.prototype._addEventListeners=function(){var e=this;this._config.keyboard&&t(this._element).on(_.KEYDOWN,function(t){return e._keydown(t)}),"hover"!==this._config.pause||"ontouchstart"in document.documentElement||t(this._element).on(_.MOUSEENTER,function(t){return e.pause(t)}).on(_.MOUSELEAVE,function(t){return e.cycle(t)})},h.prototype._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case u:t.preventDefault(),this.prev();break;case d:t.preventDefault(),this.next();break;default:return}},h.prototype._getItemIndex=function(e){return this._items=t.makeArray(t(e).parent().find(E.ITEM)),this._items.indexOf(e)},h.prototype._getItemByDirection=function(t,e){var n=t===m.NEXT,i=t===m.PREVIOUS,o=this._getItemIndex(e),r=this._items.length-1;if((i&&0===o||n&&o===r)&&!this._config.wrap)return e;var s=t===m.PREVIOUS?-1:1,a=(o+s)%this._items.length;return-1===a?this._items[this._items.length-1]:this._items[a]},h.prototype._triggerSlideEvent=function(e,n){var i=t.Event(_.SLIDE,{relatedTarget:e,direction:n});return t(this._element).trigger(i),i},h.prototype._setActiveIndicatorElement=function(e){if(this._indicatorsElement){t(this._indicatorsElement).find(E.ACTIVE).removeClass(v.ACTIVE);var n=this._indicatorsElement.children[this._getItemIndex(e)];n&&t(n).addClass(v.ACTIVE)}},h.prototype._slide=function(e,n){var i=this,o=t(this._element).find(E.ACTIVE_ITEM)[0],s=n||o&&this._getItemByDirection(e,o),a=Boolean(this._interval),l=void 0,h=void 0,f=void 0;if(e===m.NEXT?(l=v.LEFT,h=v.NEXT,f=m.LEFT):(l=v.RIGHT,h=v.PREV,f=m.RIGHT),s&&t(s).hasClass(v.ACTIVE))return void(this._isSliding=!1);if(!this._triggerSlideEvent(s,f).isDefaultPrevented()&&o&&s){this._isSliding=!0,a&&this.pause(),this._setActiveIndicatorElement(s);var u=t.Event(_.SLID,{relatedTarget:s,direction:f});r.supportsTransitionEnd()&&t(this._element).hasClass(v.SLIDE)?(t(s).addClass(h),r.reflow(s),t(o).addClass(l),t(s).addClass(l),t(o).one(r.TRANSITION_END,function(){t(s).removeClass(l+" "+h).addClass(v.ACTIVE),t(o).removeClass(v.ACTIVE+" "+h+" "+l),i._isSliding=!1,setTimeout(function(){return t(i._element).trigger(u)},0)}).emulateTransitionEnd(c)):(t(o).removeClass(v.ACTIVE),t(s).addClass(v.ACTIVE),this._isSliding=!1,t(this._element).trigger(u)),a&&this.cycle()}},h._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(a),o=t.extend({},p,t(this).data());"object"===(void 0===e?"undefined":i(e))&&t.extend(o,e);var r="string"==typeof e?e:o.slide;if(n||(n=new h(this,o),t(this).data(a,n)),"number"==typeof e)n.to(e);else if("string"==typeof r){if(n[r]===undefined)throw new Error('No method named "'+r+'"');n[r]()}else o.interval&&(n.pause(),n.cycle())})},h._dataApiClickHandler=function(e){var n=r.getSelectorFromElement(this);if(n){var i=t(n)[0];if(i&&t(i).hasClass(v.CAROUSEL)){var o=t.extend({},t(i).data(),t(this).data()),s=this.getAttribute("data-slide-to");s&&(o.interval=!1),h._jQueryInterface.call(t(i),o),s&&t(i).data(a).to(s),e.preventDefault()}}},o(h,null,[{key:"VERSION",get:function(){return s}},{key:"Default",get:function(){return p}}]),h}();t(document).on(_.CLICK_DATA_API,E.DATA_SLIDE,y._dataApiClickHandler),t(window).on(_.LOAD_DATA_API,function(){t(E.DATA_RIDE).each(function(){var e=t(this);y._jQueryInterface.call(e,e.data())})}),t.fn[e]=y._jQueryInterface,t.fn[e].Constructor=y,t.fn[e].noConflict=function(){return t.fn[e]=f,y._jQueryInterface}}(jQuery),function(t){var e="collapse",s="4.0.0-alpha.6",a="bs.collapse",l="."+a,h=".data-api",f=t.fn[e],c=600,u={toggle:!0,parent:""},d={toggle:"boolean",parent:"string"},p={SHOW:"show"+l,SHOWN:"shown"+l,HIDE:"hide"+l,HIDDEN:"hidden"+l,CLICK_DATA_API:"click"+l+h},g={SHOW:"show",COLLAPSE:"collapse",COLLAPSING:"collapsing",COLLAPSED:"collapsed"},m={WIDTH:"width",HEIGHT:"height"},_={ACTIVES:".card > .show, .card > .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},v=function(){function l(e,i){n(this,l),this._isTransitioning=!1,this._element=e,this._config=this._getConfig(i),this._triggerArray=t.makeArray(t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]')),this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}return l.prototype.toggle=function(){t(this._element).hasClass(g.SHOW)?this.hide():this.show()},l.prototype.show=function(){var e=this;if(this._isTransitioning)throw new Error("Collapse is transitioning");if(!t(this._element).hasClass(g.SHOW)){var n=void 0,i=void 0;if(this._parent&&(n=t.makeArray(t(this._parent).find(_.ACTIVES)),n.length||(n=null)),!(n&&(i=t(n).data(a))&&i._isTransitioning)){var o=t.Event(p.SHOW);if(t(this._element).trigger(o),!o.isDefaultPrevented()){n&&(l._jQueryInterface.call(t(n),"hide"),i||t(n).data(a,null));var s=this._getDimension();t(this._element).removeClass(g.COLLAPSE).addClass(g.COLLAPSING),this._element.style[s]=0,this._element.setAttribute("aria-expanded",!0),this._triggerArray.length&&t(this._triggerArray).removeClass(g.COLLAPSED).attr("aria-expanded",!0),this.setTransitioning(!0);var h=function(){t(e._element).removeClass(g.COLLAPSING).addClass(g.COLLAPSE).addClass(g.SHOW),e._element.style[s]="",e.setTransitioning(!1),t(e._element).trigger(p.SHOWN)};if(!r.supportsTransitionEnd())return void h();var f=s[0].toUpperCase()+s.slice(1),u="scroll"+f;t(this._element).one(r.TRANSITION_END,h).emulateTransitionEnd(c),this._element.style[s]=this._element[u]+"px"}}}},l.prototype.hide=function(){var e=this;if(this._isTransitioning)throw new Error("Collapse is transitioning");if(t(this._element).hasClass(g.SHOW)){var n=t.Event(p.HIDE);if(t(this._element).trigger(n),!n.isDefaultPrevented()){var i=this._getDimension(),o=i===m.WIDTH?"offsetWidth":"offsetHeight";this._element.style[i]=this._element[o]+"px",r.reflow(this._element),t(this._element).addClass(g.COLLAPSING).removeClass(g.COLLAPSE).removeClass(g.SHOW),this._element.setAttribute("aria-expanded",!1),this._triggerArray.length&&t(this._triggerArray).addClass(g.COLLAPSED).attr("aria-expanded",!1),this.setTransitioning(!0);var s=function(){e.setTransitioning(!1),t(e._element).removeClass(g.COLLAPSING).addClass(g.COLLAPSE).trigger(p.HIDDEN)};if(this._element.style[i]="",!r.supportsTransitionEnd())return void s();t(this._element).one(r.TRANSITION_END,s).emulateTransitionEnd(c)}}},l.prototype.setTransitioning=function(t){this._isTransitioning=t},l.prototype.dispose=function(){t.removeData(this._element,a),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null},l.prototype._getConfig=function(n){return n=t.extend({},u,n),n.toggle=Boolean(n.toggle),r.typeCheckConfig(e,n,d),n},l.prototype._getDimension=function(){return t(this._element).hasClass(m.WIDTH)?m.WIDTH:m.HEIGHT},l.prototype._getParent=function(){var e=this,n=t(this._config.parent)[0],i='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]';return t(n).find(i).each(function(t,n){e._addAriaAndCollapsedClass(l._getTargetFromElement(n),[n])}),n},l.prototype._addAriaAndCollapsedClass=function(e,n){if(e){var i=t(e).hasClass(g.SHOW);e.setAttribute("aria-expanded",i),n.length&&t(n).toggleClass(g.COLLAPSED,!i).attr("aria-expanded",i)}},l._getTargetFromElement=function(e){var n=r.getSelectorFromElement(e);return n?t(n)[0]:null},l._jQueryInterface=function(e){return this.each(function(){var n=t(this),o=n.data(a),r=t.extend({},u,n.data(),"object"===(void 0===e?"undefined":i(e))&&e);if(!o&&r.toggle&&/show|hide/.test(e)&&(r.toggle=!1),o||(o=new l(this,r),n.data(a,o)),"string"==typeof e){if(o[e]===undefined)throw new Error('No method named "'+e+'"');o[e]()}})},o(l,null,[{key:"VERSION",get:function(){return s}},{key:"Default",get:function(){return u}}]),l}();t(document).on(p.CLICK_DATA_API,_.DATA_TOGGLE,function(e){e.preventDefault();var n=v._getTargetFromElement(this),i=t(n).data(a),o=i?"toggle":t(this).data();v._jQueryInterface.call(t(n),o)}),t.fn[e]=v._jQueryInterface,t.fn[e].Constructor=v,t.fn[e].noConflict=function(){return t.fn[e]=f,v._jQueryInterface}}(jQuery),function(t){var e="dropdown",i="4.0.0-alpha.6",s="bs.dropdown",a="."+s,l=".data-api",h=t.fn[e],f=27,c=38,u=40,d=3,p={HIDE:"hide"+a,HIDDEN:"hidden"+a,SHOW:"show"+a,SHOWN:"shown"+a,CLICK:"click"+a,CLICK_DATA_API:"click"+a+l,FOCUSIN_DATA_API:"focusin"+a+l,KEYDOWN_DATA_API:"keydown"+a+l},g={BACKDROP:"dropdown-backdrop",DISABLED:"disabled",SHOW:"show"},m={BACKDROP:".dropdown-backdrop",DATA_TOGGLE:'[data-toggle="dropdown"]',FORM_CHILD:".dropdown form",ROLE_MENU:'[role="menu"]',ROLE_LISTBOX:'[role="listbox"]',NAVBAR_NAV:".navbar-nav",VISIBLE_ITEMS:'[role="menu"] li:not(.disabled) a, [role="listbox"] li:not(.disabled) a'},_=function(){function e(t){n(this,e),this._element=t,this._addEventListeners()}return e.prototype.toggle=function(){if(this.disabled||t(this).hasClass(g.DISABLED))return!1;var n=e._getParentFromElement(this),i=t(n).hasClass(g.SHOW);if(e._clearMenus(),i)return!1;if("ontouchstart"in document.documentElement&&!t(n).closest(m.NAVBAR_NAV).length){var o=document.createElement("div");o.className=g.BACKDROP,t(o).insertBefore(this),t(o).on("click",e._clearMenus)}var r={relatedTarget:this},s=t.Event(p.SHOW,r);return t(n).trigger(s),!s.isDefaultPrevented()&&(this.focus(),this.setAttribute("aria-expanded",!0),t(n).toggleClass(g.SHOW),t(n).trigger(t.Event(p.SHOWN,r)),!1)},e.prototype.dispose=function(){t.removeData(this._element,s),t(this._element).off(a),this._element=null},e.prototype._addEventListeners=function(){t(this._element).on(p.CLICK,this.toggle)},e._jQueryInterface=function(n){return this.each(function(){var i=t(this).data(s);if(i||(i=new e(this),t(this).data(s,i)),"string"==typeof n){if(i[n]===undefined)throw new Error('No method named "'+n+'"');i[n].call(this)}})},e._clearMenus=function(n){if(!n||n.which!==d){var i=t(m.BACKDROP)[0];i&&i.parentNode.removeChild(i);for(var o=t.makeArray(t(m.DATA_TOGGLE)),r=0;r<o.length;r++){var s=e._getParentFromElement(o[r]),a={relatedTarget:o[r]};if(t(s).hasClass(g.SHOW)&&!(n&&("click"===n.type&&/input|textarea/i.test(n.target.tagName)||"focusin"===n.type)&&t.contains(s,n.target))){var l=t.Event(p.HIDE,a);t(s).trigger(l),l.isDefaultPrevented()||(o[r].setAttribute("aria-expanded","false"),t(s).removeClass(g.SHOW).trigger(t.Event(p.HIDDEN,a)))}}}},e._getParentFromElement=function(e){var n=void 0,i=r.getSelectorFromElement(e);return i&&(n=t(i)[0]),n||e.parentNode},e._dataApiKeydownHandler=function(n){if(/(38|40|27|32)/.test(n.which)&&!/input|textarea/i.test(n.target.tagName)&&(n.preventDefault(),n.stopPropagation(),!this.disabled&&!t(this).hasClass(g.DISABLED))){var i=e._getParentFromElement(this),o=t(i).hasClass(g.SHOW);if(!o&&n.which!==f||o&&n.which===f){if(n.which===f){var r=t(i).find(m.DATA_TOGGLE)[0];t(r).trigger("focus")}return void t(this).trigger("click")}var s=t(i).find(m.VISIBLE_ITEMS).get();if(s.length){var a=s.indexOf(n.target);n.which===c&&a>0&&a--,n.which===u&&a<s.length-1&&a++,a<0&&(a=0),s[a].focus()}}},o(e,null,[{key:"VERSION",get:function(){return i}}]),e}();t(document).on(p.KEYDOWN_DATA_API,m.DATA_TOGGLE,_._dataApiKeydownHandler).on(p.KEYDOWN_DATA_API,m.ROLE_MENU,_._dataApiKeydownHandler).on(p.KEYDOWN_DATA_API,m.ROLE_LISTBOX,_._dataApiKeydownHandler).on(p.CLICK_DATA_API+" "+p.FOCUSIN_DATA_API,_._clearMenus).on(p.CLICK_DATA_API,m.DATA_TOGGLE,_.prototype.toggle).on(p.CLICK_DATA_API,m.FORM_CHILD,function(t){t.stopPropagation()}),t.fn[e]=_._jQueryInterface,t.fn[e].Constructor=_,t.fn[e].noConflict=function(){return t.fn[e]=h,_._jQueryInterface}}(jQuery),function(t){var e="modal",s="4.0.0-alpha.6",a="bs.modal",l="."+a,h=".data-api",f=t.fn[e],c=300,u=150,d=27,p={backdrop:!0,keyboard:!0,focus:!0,show:!0},g={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean",show:"boolean"},m={HIDE:"hide"+l,HIDDEN:"hidden"+l,SHOW:"show"+l,SHOWN:"shown"+l,FOCUSIN:"focusin"+l,RESIZE:"resize"+l,CLICK_DISMISS:"click.dismiss"+l,KEYDOWN_DISMISS:"keydown.dismiss"+l,MOUSEUP_DISMISS:"mouseup.dismiss"+l,MOUSEDOWN_DISMISS:"mousedown.dismiss"+l,CLICK_DATA_API:"click"+l+h},_={SCROLLBAR_MEASURER:"modal-scrollbar-measure",BACKDROP:"modal-backdrop",OPEN:"modal-open",FADE:"fade",SHOW:"show"},v={DIALOG:".modal-dialog",DATA_TOGGLE:'[data-toggle="modal"]',DATA_DISMISS:'[data-dismiss="modal"]',FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top"},E=function(){function h(e,i){n(this,h),this._config=this._getConfig(i),this._element=e,this._dialog=t(e).find(v.DIALOG)[0],this._backdrop=null,this._isShown=!1,this._isBodyOverflowing=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._originalBodyPadding=0,this._scrollbarWidth=0}return h.prototype.toggle=function(t){return this._isShown?this.hide():this.show(t)},h.prototype.show=function(e){var n=this;if(this._isTransitioning)throw new Error("Modal is transitioning");r.supportsTransitionEnd()&&t(this._element).hasClass(_.FADE)&&(this._isTransitioning=!0);var i=t.Event(m.SHOW,{relatedTarget:e});t(this._element).trigger(i),this._isShown||i.isDefaultPrevented()||(this._isShown=!0,this._checkScrollbar(),this._setScrollbar(),t(document.body).addClass(_.OPEN),this._setEscapeEvent(),this._setResizeEvent(),t(this._element).on(m.CLICK_DISMISS,v.DATA_DISMISS,function(t){return n.hide(t)}),t(this._dialog).on(m.MOUSEDOWN_DISMISS,function(){t(n._element).one(m.MOUSEUP_DISMISS,function(e){t(e.target).is(n._element)&&(n._ignoreBackdropClick=!0)})}),this._showBackdrop(function(){return n._showElement(e)}))},h.prototype.hide=function(e){var n=this;if(e&&e.preventDefault(),this._isTransitioning)throw new Error("Modal is transitioning");var i=r.supportsTransitionEnd()&&t(this._element).hasClass(_.FADE);i&&(this._isTransitioning=!0);var o=t.Event(m.HIDE);t(this._element).trigger(o),this._isShown&&!o.isDefaultPrevented()&&(this._isShown=!1,this._setEscapeEvent(),this._setResizeEvent(),t(document).off(m.FOCUSIN),t(this._element).removeClass(_.SHOW),t(this._element).off(m.CLICK_DISMISS),t(this._dialog).off(m.MOUSEDOWN_DISMISS),i?t(this._element).one(r.TRANSITION_END,function(t){return n._hideModal(t)}).emulateTransitionEnd(c):this._hideModal())},h.prototype.dispose=function(){t.removeData(this._element,a),t(window,document,this._element,this._backdrop).off(l),this._config=null,this._element=null,this._dialog=null,this._backdrop=null,this._isShown=null,this._isBodyOverflowing=null,this._ignoreBackdropClick=null,this._originalBodyPadding=null,this._scrollbarWidth=null},h.prototype._getConfig=function(n){return n=t.extend({},p,n),r.typeCheckConfig(e,n,g),n},h.prototype._showElement=function(e){var n=this,i=r.supportsTransitionEnd()&&t(this._element).hasClass(_.FADE);this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.scrollTop=0,i&&r.reflow(this._element),t(this._element).addClass(_.SHOW),this._config.focus&&this._enforceFocus();var o=t.Event(m.SHOWN,{relatedTarget:e}),s=function(){n._config.focus&&n._element.focus(),n._isTransitioning=!1,t(n._element).trigger(o)};i?t(this._dialog).one(r.TRANSITION_END,s).emulateTransitionEnd(c):s()},h.prototype._enforceFocus=function(){var e=this;t(document).off(m.FOCUSIN).on(m.FOCUSIN,function(n){document===n.target||e._element===n.target||t(e._element).has(n.target).length||e._element.focus()})},h.prototype._setEscapeEvent=function(){var e=this;this._isShown&&this._config.keyboard?t(this._element).on(m.KEYDOWN_DISMISS,function(t){t.which===d&&e.hide()}):this._isShown||t(this._element).off(m.KEYDOWN_DISMISS)},h.prototype._setResizeEvent=function(){var e=this;this._isShown?t(window).on(m.RESIZE,function(t){return e._handleUpdate(t)}):t(window).off(m.RESIZE)},h.prototype._hideModal=function(){var e=this;this._element.style.display="none",this._element.setAttribute("aria-hidden","true"),this._isTransitioning=!1,this._showBackdrop(function(){t(document.body).removeClass(_.OPEN),e._resetAdjustments(),e._resetScrollbar(),t(e._element).trigger(m.HIDDEN)})},h.prototype._removeBackdrop=function(){this._backdrop&&(t(this._backdrop).remove(),this._backdrop=null)},h.prototype._showBackdrop=function(e){var n=this,i=t(this._element).hasClass(_.FADE)?_.FADE:"";if(this._isShown&&this._config.backdrop){var o=r.supportsTransitionEnd()&&i;if(this._backdrop=document.createElement("div"),this._backdrop.className=_.BACKDROP,i&&t(this._backdrop).addClass(i),t(this._backdrop).appendTo(document.body),t(this._element).on(m.CLICK_DISMISS,function(t){if(n._ignoreBackdropClick)return void(n._ignoreBackdropClick=!1);t.target===t.currentTarget&&("static"===n._config.backdrop?n._element.focus():n.hide())}),o&&r.reflow(this._backdrop),t(this._backdrop).addClass(_.SHOW),!e)return;if(!o)return void e();t(this._backdrop).one(r.TRANSITION_END,e).emulateTransitionEnd(u)}else if(!this._isShown&&this._backdrop){t(this._backdrop).removeClass(_.SHOW);var s=function(){n._removeBackdrop(),e&&e()};r.supportsTransitionEnd()&&t(this._element).hasClass(_.FADE)?t(this._backdrop).one(r.TRANSITION_END,s).emulateTransitionEnd(u):s()}else e&&e()},h.prototype._handleUpdate=function(){this._adjustDialog()},h.prototype._adjustDialog=function(){var t=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},h.prototype._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},h.prototype._checkScrollbar=function(){this._isBodyOverflowing=document.body.clientWidth<window.innerWidth,this._scrollbarWidth=this._getScrollbarWidth()},h.prototype._setScrollbar=function(){var e=parseInt(t(v.FIXED_CONTENT).css("padding-right")||0,10);this._originalBodyPadding=document.body.style.paddingRight||"",this._isBodyOverflowing&&(document.body.style.paddingRight=e+this._scrollbarWidth+"px")},h.prototype._resetScrollbar=function(){document.body.style.paddingRight=this._originalBodyPadding},h.prototype._getScrollbarWidth=function(){var t=document.createElement("div");t.className=_.SCROLLBAR_MEASURER,document.body.appendChild(t);var e=t.offsetWidth-t.clientWidth;return document.body.removeChild(t),e},h._jQueryInterface=function(e,n){return this.each(function(){var o=t(this).data(a),r=t.extend({},h.Default,t(this).data(),"object"===(void 0===e?"undefined":i(e))&&e);if(o||(o=new h(this,r),t(this).data(a,o)),"string"==typeof e){if(o[e]===undefined)throw new Error('No method named "'+e+'"');o[e](n)}else r.show&&o.show(n)})},o(h,null,[{key:"VERSION",get:function(){return s}},{key:"Default",get:function(){return p}}]),h}();t(document).on(m.CLICK_DATA_API,v.DATA_TOGGLE,function(e){var n=this,i=void 0,o=r.getSelectorFromElement(this);o&&(i=t(o)[0]);var s=t(i).data(a)?"toggle":t.extend({},t(i).data(),t(this).data());"A"!==this.tagName&&"AREA"!==this.tagName||e.preventDefault();var l=t(i).one(m.SHOW,function(e){e.isDefaultPrevented()||l.one(m.HIDDEN,function(){t(n).is(":visible")&&n.focus()})});E._jQueryInterface.call(t(i),s,this)}),t.fn[e]=E._jQueryInterface,t.fn[e].Constructor=E,t.fn[e].noConflict=function(){return t.fn[e]=f,E._jQueryInterface}}(jQuery),function(t){var e="scrollspy",s="4.0.0-alpha.6",a="bs.scrollspy",l="."+a,h=".data-api",f=t.fn[e],c={offset:10,method:"auto",target:""},u={offset:"number",method:"string",target:"(string|element)"},d={ACTIVATE:"activate"+l,SCROLL:"scroll"+l,LOAD_DATA_API:"load"+l+h},p={DROPDOWN_ITEM:"dropdown-item",DROPDOWN_MENU:"dropdown-menu",NAV_LINK:"nav-link",NAV:"nav",ACTIVE:"active"},g={DATA_SPY:'[data-spy="scroll"]',ACTIVE:".active",LIST_ITEM:".list-item",LI:"li",LI_DROPDOWN:"li.dropdown",NAV_LINKS:".nav-link",DROPDOWN:".dropdown",DROPDOWN_ITEMS:".dropdown-item",DROPDOWN_TOGGLE:".dropdown-toggle"},m={OFFSET:"offset",POSITION:"position"},_=function(){function h(e,i){var o=this;n(this,h),this._element=e,this._scrollElement="BODY"===e.tagName?window:e,this._config=this._getConfig(i),this._selector=this._config.target+" "+g.NAV_LINKS+","+this._config.target+" "+g.DROPDOWN_ITEMS,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,t(this._scrollElement).on(d.SCROLL,function(t){return o._process(t)}),this.refresh(),this._process()}return h.prototype.refresh=function(){var e=this,n=this._scrollElement!==this._scrollElement.window?m.POSITION:m.OFFSET,i="auto"===this._config.method?n:this._config.method,o=i===m.POSITION?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),t.makeArray(t(this._selector)).map(function(e){var n=void 0,s=r.getSelectorFromElement(e);return s&&(n=t(s)[0]),n&&(n.offsetWidth||n.offsetHeight)?[t(n)[i]().top+o,s]:null}).filter(function(t){return t}).sort(function(t,e){return t[0]-e[0]}).forEach(function(t){e._offsets.push(t[0]),e._targets.push(t[1])})},h.prototype.dispose=function(){t.removeData(this._element,a),t(this._scrollElement).off(l),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},h.prototype._getConfig=function(n){if(n=t.extend({},c,n),"string"!=typeof n.target){var i=t(n.target).attr("id");i||(i=r.getUID(e),t(n.target).attr("id",i)),n.target="#"+i}return r.typeCheckConfig(e,n,u),n},h.prototype._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},h.prototype._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},h.prototype._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.offsetHeight},h.prototype._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=n){var i=this._targets[this._targets.length-1];return void(this._activeTarget!==i&&this._activate(i))}if(this._activeTarget&&t<this._offsets[0]&&this._offsets[0]>0)return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;){this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&(this._offsets[o+1]===undefined||t<this._offsets[o+1])&&this._activate(this._targets[o])}},h.prototype._activate=function(e){this._activeTarget=e,this._clear();var n=this._selector.split(",");n=n.map(function(t){return t+'[data-target="'+e+'"],'+t+'[href="'+e+'"]'});var i=t(n.join(","));i.hasClass(p.DROPDOWN_ITEM)?(i.closest(g.DROPDOWN).find(g.DROPDOWN_TOGGLE).addClass(p.ACTIVE),i.addClass(p.ACTIVE)):i.parents(g.LI).find("> "+g.NAV_LINKS).addClass(p.ACTIVE),t(this._scrollElement).trigger(d.ACTIVATE,{relatedTarget:e})},h.prototype._clear=function(){t(this._selector).filter(g.ACTIVE).removeClass(p.ACTIVE)},h._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(a),o="object"===(void 0===e?"undefined":i(e))&&e;if(n||(n=new h(this,o),t(this).data(a,n)),"string"==typeof e){if(n[e]===undefined)throw new Error('No method named "'+e+'"');n[e]()}})},o(h,null,[{key:"VERSION",get:function(){return s}},{key:"Default",get:function(){return c}}]),h}();t(window).on(d.LOAD_DATA_API,function(){for(var e=t.makeArray(t(g.DATA_SPY)),n=e.length;n--;){var i=t(e[n]);_._jQueryInterface.call(i,i.data())}}),t.fn[e]=_._jQueryInterface,t.fn[e].Constructor=_,t.fn[e].noConflict=function(){return t.fn[e]=f,_._jQueryInterface}}(jQuery),function(t){var e="tab",i="4.0.0-alpha.6",s="bs.tab",a="."+s,l=".data-api",h=t.fn[e],f=150,c={HIDE:"hide"+a,HIDDEN:"hidden"+a,SHOW:"show"+a,SHOWN:"shown"+a,CLICK_DATA_API:"click"+a+l},u={DROPDOWN_MENU:"dropdown-menu",ACTIVE:"active",DISABLED:"disabled",FADE:"fade",SHOW:"show"},d={A:"a",LI:"li",DROPDOWN:".dropdown",LIST:"ul:not(.dropdown-menu), ol:not(.dropdown-menu), nav:not(.dropdown-menu)",FADE_CHILD:"> .nav-item .fade, > .fade",ACTIVE:".active",ACTIVE_CHILD:"> .nav-item > .active, > .active",DATA_TOGGLE:'[data-toggle="tab"], [data-toggle="pill"]',DROPDOWN_TOGGLE:".dropdown-toggle",DROPDOWN_ACTIVE_CHILD:"> .dropdown-menu .active"},p=function(){function e(t){n(this,e),this._element=t}return e.prototype.show=function(){var e=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&t(this._element).hasClass(u.ACTIVE)||t(this._element).hasClass(u.DISABLED))){var n=void 0,i=void 0,o=t(this._element).closest(d.LIST)[0],s=r.getSelectorFromElement(this._element);o&&(i=t.makeArray(t(o).find(d.ACTIVE)),i=i[i.length-1]);var a=t.Event(c.HIDE,{relatedTarget:this._element}),l=t.Event(c.SHOW,{relatedTarget:i});if(i&&t(i).trigger(a),t(this._element).trigger(l),!l.isDefaultPrevented()&&!a.isDefaultPrevented()){s&&(n=t(s)[0]),this._activate(this._element,o);var h=function(){var n=t.Event(c.HIDDEN,{relatedTarget:e._element}),o=t.Event(c.SHOWN,{relatedTarget:i});t(i).trigger(n),t(e._element).trigger(o)};n?this._activate(n,n.parentNode,h):h()}}},e.prototype.dispose=function(){t.removeClass(this._element,s),this._element=null},e.prototype._activate=function(e,n,i){var o=this,s=t(n).find(d.ACTIVE_CHILD)[0],a=i&&r.supportsTransitionEnd()&&(s&&t(s).hasClass(u.FADE)||Boolean(t(n).find(d.FADE_CHILD)[0])),l=function(){return o._transitionComplete(e,s,a,i)};s&&a?t(s).one(r.TRANSITION_END,l).emulateTransitionEnd(f):l(),s&&t(s).removeClass(u.SHOW)},e.prototype._transitionComplete=function(e,n,i,o){if(n){t(n).removeClass(u.ACTIVE);var s=t(n.parentNode).find(d.DROPDOWN_ACTIVE_CHILD)[0];s&&t(s).removeClass(u.ACTIVE),n.setAttribute("aria-expanded",!1)}if(t(e).addClass(u.ACTIVE),e.setAttribute("aria-expanded",!0),i?(r.reflow(e),t(e).addClass(u.SHOW)):t(e).removeClass(u.FADE),e.parentNode&&t(e.parentNode).hasClass(u.DROPDOWN_MENU)){var a=t(e).closest(d.DROPDOWN)[0];a&&t(a).find(d.DROPDOWN_TOGGLE).addClass(u.ACTIVE),e.setAttribute("aria-expanded",!0)}o&&o()},e._jQueryInterface=function(n){return this.each(function(){var i=t(this),o=i.data(s);if(o||(o=new e(this),i.data(s,o)),"string"==typeof n){if(o[n]===undefined)throw new Error('No method named "'+n+'"');o[n]()}})},o(e,null,[{key:"VERSION",get:function(){return i}}]),e}();t(document).on(c.CLICK_DATA_API,d.DATA_TOGGLE,function(e){e.preventDefault(),p._jQueryInterface.call(t(this),"show")}),t.fn[e]=p._jQueryInterface,t.fn[e].Constructor=p,t.fn[e].noConflict=function(){return t.fn[e]=h,p._jQueryInterface}}(jQuery),function(t){if("undefined"==typeof Tether)throw new Error("Bootstrap tooltips require Tether (http://tether.io/)");var e="tooltip",s="4.0.0-alpha.6",a="bs.tooltip",l="."+a,h=t.fn[e],f=150,c="bs-tether",u={animation:!0,template:'<div class="tooltip" role="tooltip"><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:"0 0",constraints:[],container:!1},d={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"string",constraints:"array",container:"(string|element|boolean)"},p={TOP:"bottom center",RIGHT:"middle left",BOTTOM:"top center",LEFT:"middle right"},g={SHOW:"show",OUT:"out"},m={HIDE:"hide"+l,HIDDEN:"hidden"+l,SHOW:"show"+l,SHOWN:"shown"+l,INSERTED:"inserted"+l,CLICK:"click"+l,FOCUSIN:"focusin"+l,FOCUSOUT:"focusout"+l,MOUSEENTER:"mouseenter"+l,MOUSELEAVE:"mouseleave"+l},_={FADE:"fade",SHOW:"show"},v={TOOLTIP:".tooltip",TOOLTIP_INNER:".tooltip-inner"},E={element:!1,enabled:!1},y={HOVER:"hover",FOCUS:"focus",CLICK:"click",MANUAL:"manual"},T=function(){function h(t,e){n(this,h),this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._isTransitioning=!1,this._tether=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}return h.prototype.enable=function(){this._isEnabled=!0},h.prototype.disable=function(){this._isEnabled=!1},h.prototype.toggleEnabled=function(){this._isEnabled=!this._isEnabled},h.prototype.toggle=function(e){if(e){var n=this.constructor.DATA_KEY,i=t(e.currentTarget).data(n);i||(i=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(n,i)),i._activeTrigger.click=!i._activeTrigger.click,i._isWithActiveTrigger()?i._enter(null,i):i._leave(null,i)}else{if(t(this.getTipElement()).hasClass(_.SHOW))return void this._leave(null,this);this._enter(null,this)}},h.prototype.dispose=function(){clearTimeout(this._timeout),this.cleanupTether(),t.removeData(this.element,this.constructor.DATA_KEY),t(this.element).off(this.constructor.EVENT_KEY),t(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&t(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._tether=null,this.element=null,this.config=null,this.tip=null},h.prototype.show=function(){var e=this;if("none"===t(this.element).css("display"))throw new Error("Please use show on visible elements");var n=t.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){if(this._isTransitioning)throw new Error("Tooltip is transitioning");t(this.element).trigger(n);var i=t.contains(this.element.ownerDocument.documentElement,this.element);if(n.isDefaultPrevented()||!i)return;var o=this.getTipElement(),s=r.getUID(this.constructor.NAME);o.setAttribute("id",s),this.element.setAttribute("aria-describedby",s),this.setContent(),this.config.animation&&t(o).addClass(_.FADE);var a="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,l=this._getAttachment(a),f=!1===this.config.container?document.body:t(this.config.container);t(o).data(this.constructor.DATA_KEY,this).appendTo(f),t(this.element).trigger(this.constructor.Event.INSERTED),this._tether=new Tether({attachment:l,element:o,target:this.element,classes:E,classPrefix:c,offset:this.config.offset,constraints:this.config.constraints,addTargetClasses:!1}),r.reflow(o),this._tether.position(),t(o).addClass(_.SHOW);var u=function(){var n=e._hoverState;e._hoverState=null,e._isTransitioning=!1,t(e.element).trigger(e.constructor.Event.SHOWN),n===g.OUT&&e._leave(null,e)};if(r.supportsTransitionEnd()&&t(this.tip).hasClass(_.FADE))return this._isTransitioning=!0,void t(this.tip).one(r.TRANSITION_END,u).emulateTransitionEnd(h._TRANSITION_DURATION);u()}},h.prototype.hide=function(e){var n=this,i=this.getTipElement(),o=t.Event(this.constructor.Event.HIDE);if(this._isTransitioning)throw new Error("Tooltip is transitioning");var s=function(){n._hoverState!==g.SHOW&&i.parentNode&&i.parentNode.removeChild(i),n.element.removeAttribute("aria-describedby"),t(n.element).trigger(n.constructor.Event.HIDDEN),n._isTransitioning=!1,n.cleanupTether(),e&&e()};t(this.element).trigger(o),o.isDefaultPrevented()||(t(i).removeClass(_.SHOW),this._activeTrigger[y.CLICK]=!1,this._activeTrigger[y.FOCUS]=!1,this._activeTrigger[y.HOVER]=!1,r.supportsTransitionEnd()&&t(this.tip).hasClass(_.FADE)?(this._isTransitioning=!0,t(i).one(r.TRANSITION_END,s).emulateTransitionEnd(f)):s(),this._hoverState="")},h.prototype.isWithContent=function(){return Boolean(this.getTitle())},h.prototype.getTipElement=function(){return this.tip=this.tip||t(this.config.template)[0]},h.prototype.setContent=function(){var e=t(this.getTipElement());this.setElementContent(e.find(v.TOOLTIP_INNER),this.getTitle()),e.removeClass(_.FADE+" "+_.SHOW),this.cleanupTether()},h.prototype.setElementContent=function(e,n){var o=this.config.html;"object"===(void 0===n?"undefined":i(n))&&(n.nodeType||n.jquery)?o?t(n).parent().is(e)||e.empty().append(n):e.text(t(n).text()):e[o?"html":"text"](n)},h.prototype.getTitle=function(){var t=this.element.getAttribute("data-original-title")
144
- ;return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},h.prototype.cleanupTether=function(){this._tether&&this._tether.destroy()},h.prototype._getAttachment=function(t){return p[t.toUpperCase()]},h.prototype._setListeners=function(){var e=this;this.config.trigger.split(" ").forEach(function(n){if("click"===n)t(e.element).on(e.constructor.Event.CLICK,e.config.selector,function(t){return e.toggle(t)});else if(n!==y.MANUAL){var i=n===y.HOVER?e.constructor.Event.MOUSEENTER:e.constructor.Event.FOCUSIN,o=n===y.HOVER?e.constructor.Event.MOUSELEAVE:e.constructor.Event.FOCUSOUT;t(e.element).on(i,e.config.selector,function(t){return e._enter(t)}).on(o,e.config.selector,function(t){return e._leave(t)})}t(e.element).closest(".modal").on("hide.bs.modal",function(){return e.hide()})}),this.config.selector?this.config=t.extend({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},h.prototype._fixTitle=function(){var t=i(this.element.getAttribute("data-original-title"));(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},h.prototype._enter=function(e,n){var i=this.constructor.DATA_KEY;return n=n||t(e.currentTarget).data(i),n||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusin"===e.type?y.FOCUS:y.HOVER]=!0),t(n.getTipElement()).hasClass(_.SHOW)||n._hoverState===g.SHOW?void(n._hoverState=g.SHOW):(clearTimeout(n._timeout),n._hoverState=g.SHOW,n.config.delay&&n.config.delay.show?void(n._timeout=setTimeout(function(){n._hoverState===g.SHOW&&n.show()},n.config.delay.show)):void n.show())},h.prototype._leave=function(e,n){var i=this.constructor.DATA_KEY;if(n=n||t(e.currentTarget).data(i),n||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusout"===e.type?y.FOCUS:y.HOVER]=!1),!n._isWithActiveTrigger()){if(clearTimeout(n._timeout),n._hoverState=g.OUT,!n.config.delay||!n.config.delay.hide)return void n.hide();n._timeout=setTimeout(function(){n._hoverState===g.OUT&&n.hide()},n.config.delay.hide)}},h.prototype._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},h.prototype._getConfig=function(n){return n=t.extend({},this.constructor.Default,t(this.element).data(),n),n.delay&&"number"==typeof n.delay&&(n.delay={show:n.delay,hide:n.delay}),r.typeCheckConfig(e,n,this.constructor.DefaultType),n},h.prototype._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},h._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(a),o="object"===(void 0===e?"undefined":i(e))&&e;if((n||!/dispose|hide/.test(e))&&(n||(n=new h(this,o),t(this).data(a,n)),"string"==typeof e)){if(n[e]===undefined)throw new Error('No method named "'+e+'"');n[e]()}})},o(h,null,[{key:"VERSION",get:function(){return s}},{key:"Default",get:function(){return u}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return a}},{key:"Event",get:function(){return m}},{key:"EVENT_KEY",get:function(){return l}},{key:"DefaultType",get:function(){return d}}]),h}();return t.fn[e]=T._jQueryInterface,t.fn[e].Constructor=T,t.fn[e].noConflict=function(){return t.fn[e]=h,T._jQueryInterface},T}(jQuery));!function(r){var a="popover",l="4.0.0-alpha.6",h="bs.popover",f="."+h,c=r.fn[a],u=r.extend({},s.Default,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),d=r.extend({},s.DefaultType,{content:"(string|element|function)"}),p={FADE:"fade",SHOW:"show"},g={TITLE:".popover-title",CONTENT:".popover-content"},m={HIDE:"hide"+f,HIDDEN:"hidden"+f,SHOW:"show"+f,SHOWN:"shown"+f,INSERTED:"inserted"+f,CLICK:"click"+f,FOCUSIN:"focusin"+f,FOCUSOUT:"focusout"+f,MOUSEENTER:"mouseenter"+f,MOUSELEAVE:"mouseleave"+f},_=function(s){function c(){return n(this,c),t(this,s.apply(this,arguments))}return e(c,s),c.prototype.isWithContent=function(){return this.getTitle()||this._getContent()},c.prototype.getTipElement=function(){return this.tip=this.tip||r(this.config.template)[0]},c.prototype.setContent=function(){var t=r(this.getTipElement());this.setElementContent(t.find(g.TITLE),this.getTitle()),this.setElementContent(t.find(g.CONTENT),this._getContent()),t.removeClass(p.FADE+" "+p.SHOW),this.cleanupTether()},c.prototype._getContent=function(){return this.element.getAttribute("data-content")||("function"==typeof this.config.content?this.config.content.call(this.element):this.config.content)},c._jQueryInterface=function(t){return this.each(function(){var e=r(this).data(h),n="object"===(void 0===t?"undefined":i(t))?t:null;if((e||!/destroy|hide/.test(t))&&(e||(e=new c(this,n),r(this).data(h,e)),"string"==typeof t)){if(e[t]===undefined)throw new Error('No method named "'+t+'"');e[t]()}})},o(c,null,[{key:"VERSION",get:function(){return l}},{key:"Default",get:function(){return u}},{key:"NAME",get:function(){return a}},{key:"DATA_KEY",get:function(){return h}},{key:"Event",get:function(){return m}},{key:"EVENT_KEY",get:function(){return f}},{key:"DefaultType",get:function(){return d}}]),c}(s);r.fn[a]=_._jQueryInterface,r.fn[a].Constructor=_,r.fn[a].noConflict=function(){return r.fn[a]=c,_._jQueryInterface}}(jQuery)}(),wagn.slotReady(function(t){t.find(".modal.fade").on("loaded.bs.modal",function(){$(this).trigger("slotReady")}),t.find("[data-toggle='modal']").off("click").on("click",function(t){var e,n,i;return t.preventDefault(),t.stopPropagation(),e=$(this),n=e.attr("href"),i=e.data("target"),$(i).modal("show"),$.ajax({url:n,type:"GET",success:function(t){return $(i+" .modal-content").html(t),$(i).trigger("loaded.bs.modal")},error:function(t){return $(i+" .modal-content").html(t.responseText),$(i).trigger("loaded.bs.modal")}}),!1})});
142
+ if(function(t,e){"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e(require,exports,module):t.Tether=e()}(this,function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t){var n=t.getBoundingClientRect(),i={};for(var o in n)i[o]=n[o];if(t.ownerDocument!==document){var r=t.ownerDocument.defaultView.frameElement;if(r){var s=e(r);i.top+=s.top,i.bottom+=s.top,i.left+=s.left,i.right+=s.left}}return i}function n(t){var e=getComputedStyle(t)||{},n=e.position,i=[];if("fixed"===n)return[t];for(var o=t;(o=o.parentNode)&&o&&1===o.nodeType;){var r=void 0;try{r=getComputedStyle(o)}catch(t){}if(void 0===r||null===r)return i.push(o),i;var s=r,a=s.overflow,l=s.overflowX,h=s.overflowY;/(auto|scroll|overlay)/.test(a+h+l)&&("absolute"!==n||["relative","absolute","fixed"].indexOf(r.position)>=0)&&i.push(o)}return i.push(t.ownerDocument.body),t.ownerDocument!==document&&i.push(t.ownerDocument.defaultView),i}function i(){C&&document.body.removeChild(C),C=null}function o(t){var n=void 0;t===document?(n=document,t=document.documentElement):n=t.ownerDocument;var i=n.documentElement,o=e(t),r=O();return o.top-=r.top,o.left-=r.left,"undefined"==typeof o.width&&(o.width=document.body.scrollWidth-o.left-o.right),"undefined"==typeof o.height&&(o.height=document.body.scrollHeight-o.top-o.bottom),o.top=o.top-i.clientTop,o.left=o.left-i.clientLeft,o.right=n.body.clientWidth-o.width-o.left,o.bottom=n.body.clientHeight-o.height-o.top,o}function r(t){return t.offsetParent||document.documentElement}function s(){if(I)return I;var t=document.createElement("div");t.style.width="100%",t.style.height="200px";var e=document.createElement("div");a(e.style,{position:"absolute",top:0,left:0,pointerEvents:"none",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),e.appendChild(t),document.body.appendChild(e);var n=t.offsetWidth;e.style.overflow="scroll";var i=t.offsetWidth;n===i&&(i=e.clientWidth),document.body.removeChild(e);var o=n-i;return I={width:o,height:o}}function a(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],e=[];return Array.prototype.push.apply(e,arguments),e.slice(1).forEach(function(e){if(e)for(var n in e)({}).hasOwnProperty.call(e,n)&&(t[n]=e[n])}),t}function l(t,e){if("undefined"!=typeof t.classList)e.split(" ").forEach(function(e){e.trim()&&t.classList.remove(e)});else{var n=new RegExp("(^| )"+e.split(" ").join("|")+"( |$)","gi"),i=c(t).replace(n," ");d(t,i)}}function h(t,e){if("undefined"!=typeof t.classList)e.split(" ").forEach(function(e){e.trim()&&t.classList.add(e)});else{l(t,e);var n=c(t)+" "+e;d(t,n)}}function f(t,e){if("undefined"!=typeof t.classList)return t.classList.contains(e);var n=c(t);return new RegExp("(^| )"+e+"( |$)","gi").test(n)}function c(t){return t.className instanceof t.ownerDocument.defaultView.SVGAnimatedString?t.className.baseVal:t.className}function d(t,e){t.setAttribute("class",e)}function u(t,e,n){n.forEach(function(n){-1===e.indexOf(n)&&f(t,n)&&l(t,n)}),e.forEach(function(e){f(t,e)||h(t,e)})}function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function g(t,e){var n=arguments.length<=2||void 0===arguments[2]?1:arguments[2];return t+n>=e&&e>=t-n}function m(){return"undefined"!=typeof performance&&"undefined"!=typeof performance.now?performance.now():+new Date}function _(){for(var t={top:0,left:0},e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return n.forEach(function(e){var n=e.top,i=e.left;"string"==typeof n&&(n=parseFloat(n,10)),"string"==typeof i&&(i=parseFloat(i,10)),t.top+=n,t.left+=i}),t}function v(t,e){return"string"==typeof t.left&&-1!==t.left.indexOf("%")&&(t.left=parseFloat(t.left,10)/100*e.width),"string"==typeof t.top&&-1!==t.top.indexOf("%")&&(t.top=parseFloat(t.top,10)/100*e.height),t}function E(t,e){return"scrollParent"===e?e=t.scrollParents[0]:"window"===e&&(e=[pageXOffset,pageYOffset,innerWidth+pageXOffset,innerHeight+pageYOffset]),e===document&&(e=e.documentElement),"undefined"!=typeof e.nodeType&&function(){var t=e,n=o(e),i=n,r=getComputedStyle(e);if(e=[i.left,i.top,n.width+i.left,n.height+i.top],t.ownerDocument!==document){var s=t.ownerDocument.defaultView;e[0]+=s.pageXOffset,e[1]+=s.pageYOffset,e[2]+=s.pageXOffset,e[3]+=s.pageYOffset}Q.forEach(function(t,n){t=t[0].toUpperCase()+t.substr(1),"Top"===t||"Left"===t?e[n]+=parseFloat(r["border"+t+"Width"]):e[n]-=parseFloat(r["border"+t+"Width"])})}(),e}var y=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),T=void 0;void 0===T&&(T={modules:[]});var C=null,A=function(){var t=0;return function(){return++t}}(),b={},O=function(){var t=C;t&&document.body.contains(t)||(t=document.createElement("div"),t.setAttribute("data-tether-id",A()),a(t.style,{top:0,left:0,position:"absolute"}),document.body.appendChild(t),C=t);var n=t.getAttribute("data-tether-id");return"undefined"==typeof b[n]&&(b[n]=e(t),D(function(){delete b[n]})),b[n]},I=null,S=[],D=function(t){S.push(t)},w=function(){for(var t=void 0;t=S.pop();)t()},N=function(){function e(){t(this,e)}return y(e,[{key:"on",value:function(t,e,n){var i=!(arguments.length<=3||void 0===arguments[3])&&arguments[3];"undefined"==typeof this.bindings&&(this.bindings={}),"undefined"==typeof this.bindings[t]&&(this.bindings[t]=[]),this.bindings[t].push({handler:e,ctx:n,once:i})}},{key:"once",value:function(t,e,n){this.on(t,e,n,!0)}},{key:"off",value:function(t,e){if("undefined"!=typeof this.bindings&&"undefined"!=typeof this.bindings[t])if(void 0===e)delete this.bindings[t];else for(var n=0;n<this.bindings[t].length;)this.bindings[t][n].handler===e?this.bindings[t].splice(n,1):++n}},{key:"trigger",value:function(t){if("undefined"!=typeof this.bindings&&this.bindings[t]){for(var e=0,n=arguments.length,i=Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];for(;e<this.bindings[t].length;){var r=this.bindings[t][e],s=r.handler,a=r.ctx,l=r.once,h=a;void 0===h&&(h=this),s.apply(h,i),l?this.bindings[t].splice(e,1):++e}}}}]),e}();T.Utils={getActualBoundingClientRect:e,getScrollParents:n,getBounds:o,getOffsetParent:r,extend:a,addClass:h,removeClass:l,hasClass:f,updateClasses:u,defer:D,flush:w,uniqueId:A,Evented:N,getScrollBarSize:s,removeUtilElements:i};var L=function(){function t(t,e){var n=[],i=!0,o=!1,r=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){o=!0,r=t}finally{try{!i&&a["return"]&&a["return"]()}finally{if(o)throw r}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),y=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),P=function(t,e,n){for(var i=!0;i;){var o=t,r=e,s=n;i=!1,null===o&&(o=Function.prototype);var a=Object.getOwnPropertyDescriptor(o,r);if(void 0!==a){if("value"in a)return a.value;var l=a.get;if(void 0===l)return;return l.call(s)}var h=Object.getPrototypeOf(o);if(null===h)return;t=h,e=r,n=s,i=!0,a=h=void 0}};if(void 0===T)throw new Error("You must include the utils.js file before tether.js");var H=T.Utils,n=H.getScrollParents,o=H.getBounds,r=H.getOffsetParent,a=H.extend,h=H.addClass,l=H.removeClass,u=H.updateClasses,D=H.defer,w=H.flush,s=H.getScrollBarSize,i=H.removeUtilElements,k=function(){if("undefined"==typeof document)return"";for(var t=document.createElement("div"),e=["transform","WebkitTransform","OTransform","MozTransform","msTransform"],n=0;n<e.length;++n){var i=e[n];if(void 0!==t.style[i])return i}}(),W=[],R=function(){W.forEach(function(t){t.position(!1)}),w()};!function(){var t=null,e=null,n=null,i=function i(){return void 0!==e&&e>16?(e=Math.min(e-16,250),void(n=setTimeout(i,250))):void(void 0!==t&&m()-t<10||(null!=n&&(clearTimeout(n),n=null),t=m(),R(),e=m()-t))};"undefined"!=typeof window&&"undefined"!=typeof window.addEventListener&&["resize","scroll","touchmove"].forEach(function(t){window.addEventListener(t,i)})}();var x={center:"center",left:"right",right:"left"},M={middle:"middle",top:"bottom",bottom:"top"},V={top:0,left:0,middle:"50%",center:"50%",bottom:"100%",right:"100%"},j=function(t,e){var n=t.left,i=t.top;return"auto"===n&&(n=x[e.left]),"auto"===i&&(i=M[e.top]),{left:n,top:i}},F=function(t){var e=t.left,n=t.top;return"undefined"!=typeof V[t.left]&&(e=V[t.left]),"undefined"!=typeof V[t.top]&&(n=V[t.top]),{left:e,top:n}},U=function(t){var e=t.split(" "),n=L(e,2);return{top:n[0],left:n[1]}},B=U,K=function(e){function f(e){var n=this;t(this,f),P(Object.getPrototypeOf(f.prototype),"constructor",this).call(this),this.position=this.position.bind(this),W.push(this),this.history=[],this.setOptions(e,!1),T.modules.forEach(function(t){"undefined"!=typeof t.initialize&&t.initialize.call(n)}),this.position()}return p(f,e),y(f,[{key:"getClass",value:function(){var t=arguments.length<=0||void 0===arguments[0]?"":arguments[0],e=this.options.classes;return void 0!==e&&e[t]?this.options.classes[t]:this.options.classPrefix?this.options.classPrefix+"-"+t:t}},{key:"setOptions",value:function(t){var e=this,i=arguments.length<=1||void 0===arguments[1]||arguments[1],o={offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether"};this.options=a(o,t);var r=this.options,s=r.element,l=r.target,f=r.targetModifier;if(this.element=s,this.target=l,this.targetModifier=f,"viewport"===this.target?(this.target=document.body,this.targetModifier="visible"):"scroll-handle"===this.target&&(this.target=document.body,this.targetModifier="scroll-handle"),["element","target"].forEach(function(t){if("undefined"==typeof e[t])throw new Error("Tether Error: Both element and target must be defined");"undefined"!=typeof e[t].jquery?e[t]=e[t][0]:"string"==typeof e[t]&&(e[t]=document.querySelector(e[t]))}),h(this.element,this.getClass("element")),!1!==this.options.addTargetClasses&&h(this.target,this.getClass("target")),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");this.targetAttachment=B(this.options.targetAttachment),this.attachment=B(this.options.attachment),this.offset=U(this.options.offset),this.targetOffset=U(this.options.targetOffset),"undefined"!=typeof this.scrollParents&&this.disable(),"scroll-handle"===this.targetModifier?this.scrollParents=[this.target]:this.scrollParents=n(this.target),!1!==this.options.enabled&&this.enable(i)}},{key:"getTargetBounds",value:function(){if("undefined"==typeof this.targetModifier)return o(this.target);if("visible"===this.targetModifier){if(this.target===document.body)return{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth};var t=o(this.target),e={height:t.height,width:t.width,top:t.top,left:t.left};return e.height=Math.min(e.height,t.height-(pageYOffset-t.top)),e.height=Math.min(e.height,t.height-(t.top+t.height-(pageYOffset+innerHeight))),e.height=Math.min(innerHeight,e.height),e.height-=2,e.width=Math.min(e.width,t.width-(pageXOffset-t.left)),e.width=Math.min(e.width,t.width-(t.left+t.width-(pageXOffset+innerWidth))),e.width=Math.min(innerWidth,e.width),e.width-=2,e.top<pageYOffset&&(e.top=pageYOffset),e.left<pageXOffset&&(e.left=pageXOffset),e}if("scroll-handle"===this.targetModifier){var t=void 0,n=this.target;n===document.body?(n=document.documentElement,t={left:pageXOffset,top:pageYOffset,height:innerHeight,width:innerWidth}):t=o(n);var i=getComputedStyle(n),r=n.scrollWidth>n.clientWidth||[i.overflow,i.overflowX].indexOf("scroll")>=0||this.target!==document.body,s=0;r&&(s=15);var a=t.height-parseFloat(i.borderTopWidth)-parseFloat(i.borderBottomWidth)-s,e={width:15,height:.975*a*(a/n.scrollHeight),left:t.left+t.width-parseFloat(i.borderLeftWidth)-15},l=0;a<408&&this.target===document.body&&(l=-11e-5*Math.pow(a,2)-.00727*a+22.58),this.target!==document.body&&(e.height=Math.max(e.height,24));var h=this.target.scrollTop/(n.scrollHeight-a);return e.top=h*(a-e.height-l)+t.top+parseFloat(i.borderTopWidth),this.target===document.body&&(e.height=Math.max(e.height,24)),e}}},{key:"clearCache",value:function(){this._cache={}}},{key:"cache",value:function(t,e){return"undefined"==typeof this._cache&&(this._cache={}),"undefined"==typeof this._cache[t]&&(this._cache[t]=e.call(this)),this._cache[t]}},{key:"enable",value:function(){var t=this,e=arguments.length<=0||void 0===arguments[0]||arguments[0];!1!==this.options.addTargetClasses&&h(this.target,this.getClass("enabled")),h(this.element,this.getClass("enabled")),this.enabled=!0,this.scrollParents.forEach(function(e){e!==t.target.ownerDocument&&e.addEventListener("scroll",t.position)}),e&&this.position()}},{key:"disable",value:function(){var t=this;l(this.target,this.getClass("enabled")),l(this.element,this.getClass("enabled")),this.enabled=!1,"undefined"!=typeof this.scrollParents&&this.scrollParents.forEach(function(e){e.removeEventListener("scroll",t.position)})}},{key:"destroy",value:function(){var t=this;this.disable(),W.forEach(function(e,n){e===t&&W.splice(n,1)}),0===W.length&&i()}},{key:"updateAttachClasses",value:function(t,e){var n=this;t=t||this.attachment,e=e||this.targetAttachment;var i=["left","top","bottom","right","middle","center"];"undefined"!=typeof this._addAttachClasses&&this._addAttachClasses.length&&this._addAttachClasses.splice(0,this._addAttachClasses.length),"undefined"==typeof this._addAttachClasses&&(this._addAttachClasses=[]);var o=this._addAttachClasses;t.top&&o.push(this.getClass("element-attached")+"-"+t.top),t.left&&o.push(this.getClass("element-attached")+"-"+t.left),e.top&&o.push(this.getClass("target-attached")+"-"+e.top),e.left&&o.push(this.getClass("target-attached")+"-"+e.left);var r=[];i.forEach(function(t){r.push(n.getClass("element-attached")+"-"+t),r.push(n.getClass("target-attached")+"-"+t)}),D(function(){"undefined"!=typeof n._addAttachClasses&&(u(n.element,n._addAttachClasses,r),!1!==n.options.addTargetClasses&&u(n.target,n._addAttachClasses,r),delete n._addAttachClasses)})}},{key:"position",value:function(){var t=this,e=arguments.length<=0||void 0===arguments[0]||arguments[0];if(this.enabled){this.clearCache();var n=j(this.targetAttachment,this.attachment);this.updateAttachClasses(this.attachment,n);var i=this.cache("element-bounds",function(){return o(t.element)}),a=i.width,l=i.height;if(0===a&&0===l&&"undefined"!=typeof this.lastSize){var h=this.lastSize;a=h.width,l=h.height}else this.lastSize={width:a,height:l};var f=this.cache("target-bounds",function(){return t.getTargetBounds()}),c=f,d=v(F(this.attachment),{width:a,height:l}),u=v(F(n),c),p=v(this.offset,{width:a,height:l}),g=v(this.targetOffset,c);d=_(d,p),u=_(u,g);for(var m=f.left+u.left-d.left,E=f.top+u.top-d.top,y=0;y<T.modules.length;++y){var C=T.modules[y],A=C.position.call(this,{left:m,top:E,targetAttachment:n,targetPos:f,elementPos:i,offset:d,targetOffset:u,manualOffset:p,manualTargetOffset:g,scrollbarSize:S,attachment:this.attachment});if(!1===A)return!1;void 0!==A&&"object"==typeof A&&(E=A.top,m=A.left)}var b={page:{top:E,left:m},viewport:{top:E-pageYOffset,bottom:pageYOffset-E-l+innerHeight,left:m-pageXOffset,right:pageXOffset-m-a+innerWidth}},O=this.target.ownerDocument,I=O.defaultView,S=void 0;return I.innerHeight>O.documentElement.clientHeight&&(S=this.cache("scrollbar-size",s),b.viewport.bottom-=S.height),I.innerWidth>O.documentElement.clientWidth&&(S=this.cache("scrollbar-size",s),b.viewport.right-=S.width),-1!==["","static"].indexOf(O.body.style.position)&&-1!==["","static"].indexOf(O.body.parentElement.style.position)||(b.page.bottom=O.body.scrollHeight-E-l,b.page.right=O.body.scrollWidth-m-a),"undefined"!=typeof this.options.optimizations&&!1!==this.options.optimizations.moveElement&&"undefined"==typeof this.targetModifier&&function(){var e=t.cache("target-offsetparent",function(){return r(t.target)}),n=t.cache("target-offsetparent-bounds",function(){return o(e)}),i=getComputedStyle(e),s=n,a={};if(["Top","Left","Bottom","Right"].forEach(function(t){a[t.toLowerCase()]=parseFloat(i["border"+t+"Width"])}),n.right=O.body.scrollWidth-n.left-s.width+a.right,n.bottom=O.body.scrollHeight-n.top-s.height+a.bottom,b.page.top>=n.top+a.top&&b.page.bottom>=n.bottom&&b.page.left>=n.left+a.left&&b.page.right>=n.right){var l=e.scrollTop,h=e.scrollLeft;b.offset={top:b.page.top-n.top+l-a.top,left:b.page.left-n.left+h-a.left}}}(),this.move(b),this.history.unshift(b),this.history.length>3&&this.history.pop(),e&&w(),!0}}},{key:"move",value:function(t){var e=this;if("undefined"!=typeof this.element.parentNode){var n={};for(var i in t){n[i]={};for(var o in t[i]){for(var s=!1,l=0;l<this.history.length;++l){var h=this.history[l];if("undefined"!=typeof h[i]&&!g(h[i][o],t[i][o])){s=!0;break}}s||(n[i][o]=!0)}}var f={top:"",left:"",right:"",bottom:""},c=function(t,n){if(!1!==("undefined"!=typeof e.options.optimizations?e.options.optimizations.gpu:null)){var i=void 0,o=void 0;t.top?(f.top=0,i=n.top):(f.bottom=0,i=-n.bottom),t.left?(f.left=0,o=n.left):(f.right=0,o=-n.right),window.matchMedia&&(window.matchMedia("only screen and (min-resolution: 1.3dppx)").matches||window.matchMedia("only screen and (-webkit-min-device-pixel-ratio: 1.3)").matches||(o=Math.round(o),i=Math.round(i))),f[k]="translateX("+o+"px) translateY("+i+"px)","msTransform"!==k&&(f[k]+=" translateZ(0)")}else t.top?f.top=n.top+"px":f.bottom=n.bottom+"px",t.left?f.left=n.left+"px":f.right=n.right+"px"},d=!1;if((n.page.top||n.page.bottom)&&(n.page.left||n.page.right)?(f.position="absolute",c(n.page,t.page)):(n.viewport.top||n.viewport.bottom)&&(n.viewport.left||n.viewport.right)?(f.position="fixed",c(n.viewport,t.viewport)):"undefined"!=typeof n.offset&&n.offset.top&&n.offset.left?function(){f.position="absolute";var i=e.cache("target-offsetparent",function(){return r(e.target)});r(e.element)!==i&&D(function(){e.element.parentNode.removeChild(e.element),i.appendChild(e.element)}),c(n.offset,t.offset),d=!0}():(f.position="absolute",c({top:!0,left:!0},t.page)),!d)if(this.options.bodyElement)this.options.bodyElement.appendChild(this.element);else{for(var u=!0,p=this.element.parentNode;p&&1===p.nodeType&&"BODY"!==p.tagName;){if("static"!==getComputedStyle(p).position){u=!1;break}p=p.parentNode}u||(this.element.parentNode.removeChild(this.element),this.element.ownerDocument.body.appendChild(this.element))}var m={},_=!1;for(var o in f){var v=f[o];this.element.style[o]!==v&&(_=!0,m[o]=v)}_&&D(function(){a(e.element.style,m),e.trigger("repositioned")})}}}]),f}(N);K.modules=[],T.position=R;var G=a(K,T),L=function(){function t(t,e){var n=[],i=!0,o=!1,r=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){o=!0,r=t}finally{try{!i&&a["return"]&&a["return"]()}finally{if(o)throw r}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),H=T.Utils,o=H.getBounds,a=H.extend,u=H.updateClasses,D=H.defer,Q=["left","top","right","bottom"];T.modules.push({position:function(t){var e=this,n=t.top,i=t.left,r=t.targetAttachment;if(!this.options.constraints)return!0;var s=this.cache("element-bounds",function(){return o(e.element)}),l=s.height,h=s.width;if(0===h&&0===l&&"undefined"!=typeof this.lastSize){var f=this.lastSize;h=f.width,l=f.height}var c=this.cache("target-bounds",function(){return e.getTargetBounds()}),d=c.height,p=c.width,g=[this.getClass("pinned"),this.getClass("out-of-bounds")];this.options.constraints.forEach(function(t){var e=t.outOfBoundsClass,n=t.pinnedClass;e&&g.push(e),n&&g.push(n)}),g.forEach(function(t){["left","top","right","bottom"].forEach(function(e){g.push(t+"-"+e)})});var m=[],_=a({},r),v=a({},this.attachment);return this.options.constraints.forEach(function(t){var o=t.to,s=t.attachment,a=t.pin;void 0===s&&(s="");var f=void 0,c=void 0;if(s.indexOf(" ")>=0){var u=s.split(" "),g=L(u,2);c=g[0],f=g[1]}else f=c=s;var y=E(e,o);"target"!==c&&"both"!==c||(n<y[1]&&"top"===_.top&&(n+=d,_.top="bottom"),n+l>y[3]&&"bottom"===_.top&&(n-=d,_.top="top")),"together"===c&&("top"===_.top&&("bottom"===v.top&&n<y[1]?(n+=d,_.top="bottom",n+=l,v.top="top"):"top"===v.top&&n+l>y[3]&&n-(l-d)>=y[1]&&(n-=l-d,_.top="bottom",v.top="bottom")),"bottom"===_.top&&("top"===v.top&&n+l>y[3]?(n-=d,_.top="top",n-=l,v.top="bottom"):"bottom"===v.top&&n<y[1]&&n+(2*l-d)<=y[3]&&(n+=l-d,_.top="top",v.top="top")),"middle"===_.top&&(n+l>y[3]&&"top"===v.top?(n-=l,v.top="bottom"):n<y[1]&&"bottom"===v.top&&(n+=l,v.top="top"))),"target"!==f&&"both"!==f||(i<y[0]&&"left"===_.left&&(i+=p,_.left="right"),i+h>y[2]&&"right"===_.left&&(i-=p,_.left="left")),"together"===f&&(i<y[0]&&"left"===_.left?"right"===v.left?(i+=p,_.left="right",i+=h,v.left="left"):"left"===v.left&&(i+=p,_.left="right",i-=h,v.left="right"):i+h>y[2]&&"right"===_.left?"left"===v.left?(i-=p,_.left="left",i-=h,v.left="right"):"right"===v.left&&(i-=p,_.left="left",i+=h,v.left="left"):"center"===_.left&&(i+h>y[2]&&"left"===v.left?(i-=h,v.left="right"):i<y[0]&&"right"===v.left&&(i+=h,v.left="left"))),"element"!==c&&"both"!==c||(n<y[1]&&"bottom"===v.top&&(n+=l,v.top="top"),n+l>y[3]&&"top"===v.top&&(n-=l,v.top="bottom")),"element"!==f&&"both"!==f||(i<y[0]&&("right"===v.left?(i+=h,v.left="left"):"center"===v.left&&(i+=h/2,v.left="left")),i+h>y[2]&&("left"===v.left?(i-=h,v.left="right"):"center"===v.left&&(i-=h/2,v.left="right"))),"string"==typeof a?a=a.split(",").map(function(t){return t.trim()}):!0===a&&(a=["top","left","right","bottom"]),a=a||[];var T=[],C=[];n<y[1]&&(a.indexOf("top")>=0?(n=y[1],T.push("top")):C.push("top")),n+l>y[3]&&(a.indexOf("bottom")>=0?(n=y[3]-l,T.push("bottom")):C.push("bottom")),i<y[0]&&(a.indexOf("left")>=0?(i=y[0],T.push("left")):C.push("left")),i+h>y[2]&&(a.indexOf("right")>=0?(i=y[2]-h,T.push("right")):C.push("right")),T.length&&function(){var t=void 0;t="undefined"!=typeof e.options.pinnedClass?e.options.pinnedClass:e.getClass("pinned"),m.push(t),T.forEach(function(e){m.push(t+"-"+e)})}(),C.length&&function(){var t=void 0;t="undefined"!=typeof e.options.outOfBoundsClass?e.options.outOfBoundsClass:e.getClass("out-of-bounds"),m.push(t),C.forEach(function(e){m.push(t+"-"+e)})}(),(T.indexOf("left")>=0||T.indexOf("right")>=0)&&(v.left=_.left=!1),(T.indexOf("top")>=0||T.indexOf("bottom")>=0)&&(v.top=_.top=!1),_.top===r.top&&_.left===r.left&&v.top===e.attachment.top&&v.left===e.attachment.left||(e.updateAttachClasses(v,_),e.trigger("update",{attachment:v,targetAttachment:_}))}),D(function(){!1!==e.options.addTargetClasses&&u(e.target,m,g),u(e.element,m,g)}),{top:n,left:i}}});var H=T.Utils,o=H.getBounds,u=H.updateClasses,D=H.defer;T.modules.push({position:function(t){var e=this,n=t.top,i=t.left,r=this.cache("element-bounds",function(){return o(e.element)}),s=r.height,a=r.width,l=this.getTargetBounds(),h=n+s,f=i+a,c=[];n<=l.bottom&&h>=l.top&&["left","right"].forEach(function(t){var e=l[t];e!==i&&e!==f||c.push(t)}),i<=l.right&&f>=l.left&&["top","bottom"].forEach(function(t){var e=l[t];e!==n&&e!==h||c.push(t)});var d=[],p=[],g=["left","top","right","bottom"];return d.push(this.getClass("abutted")),g.forEach(function(t){d.push(e.getClass("abutted")+"-"+t)}),c.length&&p.push(this.getClass("abutted")),c.forEach(function(t){p.push(e.getClass("abutted")+"-"+t)}),D(function(){!1!==e.options.addTargetClasses&&u(e.target,p,d),u(e.element,p,d)}),!0}});var L=function(){function t(t,e){var n=[],i=!0,o=!1,r=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){o=!0,r=t}finally{try{!i&&a["return"]&&a["return"]()}finally{if(o)throw r}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();return T.modules.push({position:function(t){var e=t.top,n=t.left;if(this.options.shift){var i=this.options.shift;"function"==typeof this.options.shift&&(i=this.options.shift.call(this,{top:e,left:n}));var o=void 0,r=void 0;if("string"==typeof i){i=i.split(" "),i[1]=i[1]||i[0];var s=i,a=L(s,2);o=a[0],r=a[1],o=parseFloat(o,10),r=parseFloat(r,10)}else o=i.top,r=i.left;return e+=o,n+=r,{top:e,left:n}}}}),G}),"undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");+function(t){var e=t.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||e[0]>=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}(jQuery),function(){function t(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function e(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=function(t){function e(t){return{}.toString.call(t).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}function n(t){return(t[0]||t).nodeType}function i(){return{bindType:a.end,delegateType:a.end,handle:function(e){return t(e.target).is(this)?e.handleObj.handler.apply(this,arguments):undefined}}}function o(){if(window.QUnit)return!1;var t=document.createElement("bootstrap");for(var e in h)if(t.style[e]!==undefined)return{end:h[e]};return!1}function r(e){var n=this,i=!1;return t(this).one(f.TRANSITION_END,function(){i=!0}),setTimeout(function(){i||f.triggerTransitionEnd(n)},e),this}function s(){a=o(),t.fn.emulateTransitionEnd=r,f.supportsTransitionEnd()&&(t.event.special[f.TRANSITION_END]=i())}var a=!1,l=1e6,h={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},f={TRANSITION_END:"bsTransitionEnd",getUID:function(t){do{t+=~~(Math.random()*l)}while(document.getElementById(t));return t},getSelectorFromElement:function(t){var e=t.getAttribute("data-target");return e||(e=t.getAttribute("href")||"",e=/^#[a-z]/i.test(e)?e:null),e},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(e){t(e).trigger(a.end)},supportsTransitionEnd:function(){return Boolean(a)},typeCheckConfig:function(t,i,o){for(var r in o)if(o.hasOwnProperty(r)){var s=o[r],a=i[r],l=a&&n(a)?"element":e(a);if(!new RegExp(s).test(l))throw new Error(t.toUpperCase()+': Option "'+r+'" provided type "'+l+'" but expected type "'+s+'".')}}};return s(),f}(jQuery),s=(function(t){var e="alert",i="4.0.0-alpha.6",s="bs.alert",a="."+s,l=".data-api",h=t.fn[e],f=150,c={DISMISS:'[data-dismiss="alert"]'},d={CLOSE:"close"+a,CLOSED:"closed"+a,CLICK_DATA_API:"click"+a+l},u={ALERT:"alert",FADE:"fade",SHOW:"show"},p=function(){function e(t){n(this,e),this._element=t}return e.prototype.close=function(t){t=t||this._element;var e=this._getRootElement(t);this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},e.prototype.dispose=function(){t.removeData(this._element,s),this._element=null},e.prototype._getRootElement=function(e){var n=r.getSelectorFromElement(e),i=!1;return n&&(i=t(n)[0]),i||(i=t(e).closest("."+u.ALERT)[0]),i},e.prototype._triggerCloseEvent=function(e){var n=t.Event(d.CLOSE);return t(e).trigger(n),n},e.prototype._removeElement=function(e){var n=this;if(t(e).removeClass(u.SHOW),!r.supportsTransitionEnd()||!t(e).hasClass(u.FADE))return void this._destroyElement(e);t(e).one(r.TRANSITION_END,function(t){return n._destroyElement(e,t)}).emulateTransitionEnd(f)},e.prototype._destroyElement=function(e){t(e).detach().trigger(d.CLOSED).remove()},e._jQueryInterface=function(n){return this.each(function(){var i=t(this),o=i.data(s);o||(o=new e(this),i.data(s,o)),"close"===n&&o[n](this)})},e._handleDismiss=function(t){return function(e){e&&e.preventDefault(),t.close(this)}},o(e,null,[{key:"VERSION",get:function(){return i}}]),e}();t(document).on(d.CLICK_DATA_API,c.DISMISS,p._handleDismiss(new p)),t.fn[e]=p._jQueryInterface,t.fn[e].Constructor=p,t.fn[e].noConflict=function(){return t.fn[e]=h,p._jQueryInterface}}(jQuery),function(t){var e="button",i="4.0.0-alpha.6",r="bs.button",s="."+r,a=".data-api",l=t.fn[e],h={ACTIVE:"active",BUTTON:"btn",FOCUS:"focus"},f={DATA_TOGGLE_CARROT:'[data-toggle^="button"]',DATA_TOGGLE:'[data-toggle="buttons"]',INPUT:"input",ACTIVE:".active",BUTTON:".btn"},c={CLICK_DATA_API:"click"+s+a,FOCUS_BLUR_DATA_API:"focus"+s+a+" blur"+s+a},d=function(){function e(t){n(this,e),this._element=t}return e.prototype.toggle=function(){var e=!0,n=t(this._element).closest(f.DATA_TOGGLE)[0];if(n){var i=t(this._element).find(f.INPUT)[0];if(i){if("radio"===i.type)if(i.checked&&t(this._element).hasClass(h.ACTIVE))e=!1;else{var o=t(n).find(f.ACTIVE)[0];o&&t(o).removeClass(h.ACTIVE)}e&&(i.checked=!t(this._element).hasClass(h.ACTIVE),t(i).trigger("change")),i.focus()}}this._element.setAttribute("aria-pressed",!t(this._element).hasClass(h.ACTIVE)),e&&t(this._element).toggleClass(h.ACTIVE)},e.prototype.dispose=function(){t.removeData(this._element,r),this._element=null},e._jQueryInterface=function(n){return this.each(function(){var i=t(this).data(r);i||(i=new e(this),t(this).data(r,i)),"toggle"===n&&i[n]()})},o(e,null,[{key:"VERSION",get:function(){return i}}]),e}();t(document).on(c.CLICK_DATA_API,f.DATA_TOGGLE_CARROT,function(e){e.preventDefault();var n=e.target;t(n).hasClass(h.BUTTON)||(n=t(n).closest(f.BUTTON)),d._jQueryInterface.call(t(n),"toggle")}).on(c.FOCUS_BLUR_DATA_API,f.DATA_TOGGLE_CARROT,function(e){var n=t(e.target).closest(f.BUTTON)[0];t(n).toggleClass(h.FOCUS,/^focus(in)?$/.test(e.type))}),t.fn[e]=d._jQueryInterface,t.fn[e].Constructor=d,t.fn[e].noConflict=function(){return t.fn[e]=l,d._jQueryInterface}}(jQuery),function(t){var e="carousel",s="4.0.0-alpha.6",a="bs.carousel",l="."+a,h=".data-api",f=t.fn[e],c=600,d=37,u=39,p={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0},g={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean"},m={NEXT:"next",PREV:"prev",LEFT:"left",RIGHT:"right"},_={SLIDE:"slide"+l,SLID:"slid"+l,KEYDOWN:"keydown"+l,MOUSEENTER:"mouseenter"+l,MOUSELEAVE:"mouseleave"+l,LOAD_DATA_API:"load"+l+h,CLICK_DATA_API:"click"+l+h},v={CAROUSEL:"carousel",ACTIVE:"active",SLIDE:"slide",RIGHT:"carousel-item-right",LEFT:"carousel-item-left",NEXT:"carousel-item-next",PREV:"carousel-item-prev",ITEM:"carousel-item"},E={ACTIVE:".active",ACTIVE_ITEM:".active.carousel-item",ITEM:".carousel-item",NEXT_PREV:".carousel-item-next, .carousel-item-prev",INDICATORS:".carousel-indicators",DATA_SLIDE:"[data-slide], [data-slide-to]",DATA_RIDE:'[data-ride="carousel"]'},y=function(){function h(e,i){n(this,h),this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this._config=this._getConfig(i),this._element=t(e)[0],this._indicatorsElement=t(this._element).find(E.INDICATORS)[0],this._addEventListeners()}return h.prototype.next=function(){if(this._isSliding)throw new Error("Carousel is sliding");this._slide(m.NEXT)},h.prototype.nextWhenVisible=function(){document.hidden||this.next()},h.prototype.prev=function(){if(this._isSliding)throw new Error("Carousel is sliding");this._slide(m.PREVIOUS)},h.prototype.pause=function(e){e||(this._isPaused=!0),t(this._element).find(E.NEXT_PREV)[0]&&r.supportsTransitionEnd()&&(r.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},h.prototype.cycle=function(t){
143
+ t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},h.prototype.to=function(e){var n=this;this._activeElement=t(this._element).find(E.ACTIVE_ITEM)[0];var i=this._getItemIndex(this._activeElement);if(!(e>this._items.length-1||e<0)){if(this._isSliding)return void t(this._element).one(_.SLID,function(){return n.to(e)});if(i===e)return this.pause(),void this.cycle();var o=e>i?m.NEXT:m.PREVIOUS;this._slide(o,this._items[e])}},h.prototype.dispose=function(){t(this._element).off(l),t.removeData(this._element,a),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},h.prototype._getConfig=function(n){return n=t.extend({},p,n),r.typeCheckConfig(e,n,g),n},h.prototype._addEventListeners=function(){var e=this;this._config.keyboard&&t(this._element).on(_.KEYDOWN,function(t){return e._keydown(t)}),"hover"!==this._config.pause||"ontouchstart"in document.documentElement||t(this._element).on(_.MOUSEENTER,function(t){return e.pause(t)}).on(_.MOUSELEAVE,function(t){return e.cycle(t)})},h.prototype._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case d:t.preventDefault(),this.prev();break;case u:t.preventDefault(),this.next();break;default:return}},h.prototype._getItemIndex=function(e){return this._items=t.makeArray(t(e).parent().find(E.ITEM)),this._items.indexOf(e)},h.prototype._getItemByDirection=function(t,e){var n=t===m.NEXT,i=t===m.PREVIOUS,o=this._getItemIndex(e),r=this._items.length-1;if((i&&0===o||n&&o===r)&&!this._config.wrap)return e;var s=t===m.PREVIOUS?-1:1,a=(o+s)%this._items.length;return-1===a?this._items[this._items.length-1]:this._items[a]},h.prototype._triggerSlideEvent=function(e,n){var i=t.Event(_.SLIDE,{relatedTarget:e,direction:n});return t(this._element).trigger(i),i},h.prototype._setActiveIndicatorElement=function(e){if(this._indicatorsElement){t(this._indicatorsElement).find(E.ACTIVE).removeClass(v.ACTIVE);var n=this._indicatorsElement.children[this._getItemIndex(e)];n&&t(n).addClass(v.ACTIVE)}},h.prototype._slide=function(e,n){var i=this,o=t(this._element).find(E.ACTIVE_ITEM)[0],s=n||o&&this._getItemByDirection(e,o),a=Boolean(this._interval),l=void 0,h=void 0,f=void 0;if(e===m.NEXT?(l=v.LEFT,h=v.NEXT,f=m.LEFT):(l=v.RIGHT,h=v.PREV,f=m.RIGHT),s&&t(s).hasClass(v.ACTIVE))return void(this._isSliding=!1);if(!this._triggerSlideEvent(s,f).isDefaultPrevented()&&o&&s){this._isSliding=!0,a&&this.pause(),this._setActiveIndicatorElement(s);var d=t.Event(_.SLID,{relatedTarget:s,direction:f});r.supportsTransitionEnd()&&t(this._element).hasClass(v.SLIDE)?(t(s).addClass(h),r.reflow(s),t(o).addClass(l),t(s).addClass(l),t(o).one(r.TRANSITION_END,function(){t(s).removeClass(l+" "+h).addClass(v.ACTIVE),t(o).removeClass(v.ACTIVE+" "+h+" "+l),i._isSliding=!1,setTimeout(function(){return t(i._element).trigger(d)},0)}).emulateTransitionEnd(c)):(t(o).removeClass(v.ACTIVE),t(s).addClass(v.ACTIVE),this._isSliding=!1,t(this._element).trigger(d)),a&&this.cycle()}},h._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(a),o=t.extend({},p,t(this).data());"object"===(void 0===e?"undefined":i(e))&&t.extend(o,e);var r="string"==typeof e?e:o.slide;if(n||(n=new h(this,o),t(this).data(a,n)),"number"==typeof e)n.to(e);else if("string"==typeof r){if(n[r]===undefined)throw new Error('No method named "'+r+'"');n[r]()}else o.interval&&(n.pause(),n.cycle())})},h._dataApiClickHandler=function(e){var n=r.getSelectorFromElement(this);if(n){var i=t(n)[0];if(i&&t(i).hasClass(v.CAROUSEL)){var o=t.extend({},t(i).data(),t(this).data()),s=this.getAttribute("data-slide-to");s&&(o.interval=!1),h._jQueryInterface.call(t(i),o),s&&t(i).data(a).to(s),e.preventDefault()}}},o(h,null,[{key:"VERSION",get:function(){return s}},{key:"Default",get:function(){return p}}]),h}();t(document).on(_.CLICK_DATA_API,E.DATA_SLIDE,y._dataApiClickHandler),t(window).on(_.LOAD_DATA_API,function(){t(E.DATA_RIDE).each(function(){var e=t(this);y._jQueryInterface.call(e,e.data())})}),t.fn[e]=y._jQueryInterface,t.fn[e].Constructor=y,t.fn[e].noConflict=function(){return t.fn[e]=f,y._jQueryInterface}}(jQuery),function(t){var e="collapse",s="4.0.0-alpha.6",a="bs.collapse",l="."+a,h=".data-api",f=t.fn[e],c=600,d={toggle:!0,parent:""},u={toggle:"boolean",parent:"string"},p={SHOW:"show"+l,SHOWN:"shown"+l,HIDE:"hide"+l,HIDDEN:"hidden"+l,CLICK_DATA_API:"click"+l+h},g={SHOW:"show",COLLAPSE:"collapse",COLLAPSING:"collapsing",COLLAPSED:"collapsed"},m={WIDTH:"width",HEIGHT:"height"},_={ACTIVES:".card > .show, .card > .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},v=function(){function l(e,i){n(this,l),this._isTransitioning=!1,this._element=e,this._config=this._getConfig(i),this._triggerArray=t.makeArray(t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]')),this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}return l.prototype.toggle=function(){t(this._element).hasClass(g.SHOW)?this.hide():this.show()},l.prototype.show=function(){var e=this;if(this._isTransitioning)throw new Error("Collapse is transitioning");if(!t(this._element).hasClass(g.SHOW)){var n=void 0,i=void 0;if(this._parent&&(n=t.makeArray(t(this._parent).find(_.ACTIVES)),n.length||(n=null)),!(n&&(i=t(n).data(a))&&i._isTransitioning)){var o=t.Event(p.SHOW);if(t(this._element).trigger(o),!o.isDefaultPrevented()){n&&(l._jQueryInterface.call(t(n),"hide"),i||t(n).data(a,null));var s=this._getDimension();t(this._element).removeClass(g.COLLAPSE).addClass(g.COLLAPSING),this._element.style[s]=0,this._element.setAttribute("aria-expanded",!0),this._triggerArray.length&&t(this._triggerArray).removeClass(g.COLLAPSED).attr("aria-expanded",!0),this.setTransitioning(!0);var h=function(){t(e._element).removeClass(g.COLLAPSING).addClass(g.COLLAPSE).addClass(g.SHOW),e._element.style[s]="",e.setTransitioning(!1),t(e._element).trigger(p.SHOWN)};if(!r.supportsTransitionEnd())return void h();var f=s[0].toUpperCase()+s.slice(1),d="scroll"+f;t(this._element).one(r.TRANSITION_END,h).emulateTransitionEnd(c),this._element.style[s]=this._element[d]+"px"}}}},l.prototype.hide=function(){var e=this;if(this._isTransitioning)throw new Error("Collapse is transitioning");if(t(this._element).hasClass(g.SHOW)){var n=t.Event(p.HIDE);if(t(this._element).trigger(n),!n.isDefaultPrevented()){var i=this._getDimension(),o=i===m.WIDTH?"offsetWidth":"offsetHeight";this._element.style[i]=this._element[o]+"px",r.reflow(this._element),t(this._element).addClass(g.COLLAPSING).removeClass(g.COLLAPSE).removeClass(g.SHOW),this._element.setAttribute("aria-expanded",!1),this._triggerArray.length&&t(this._triggerArray).addClass(g.COLLAPSED).attr("aria-expanded",!1),this.setTransitioning(!0);var s=function(){e.setTransitioning(!1),t(e._element).removeClass(g.COLLAPSING).addClass(g.COLLAPSE).trigger(p.HIDDEN)};if(this._element.style[i]="",!r.supportsTransitionEnd())return void s();t(this._element).one(r.TRANSITION_END,s).emulateTransitionEnd(c)}}},l.prototype.setTransitioning=function(t){this._isTransitioning=t},l.prototype.dispose=function(){t.removeData(this._element,a),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null},l.prototype._getConfig=function(n){return n=t.extend({},d,n),n.toggle=Boolean(n.toggle),r.typeCheckConfig(e,n,u),n},l.prototype._getDimension=function(){return t(this._element).hasClass(m.WIDTH)?m.WIDTH:m.HEIGHT},l.prototype._getParent=function(){var e=this,n=t(this._config.parent)[0],i='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]';return t(n).find(i).each(function(t,n){e._addAriaAndCollapsedClass(l._getTargetFromElement(n),[n])}),n},l.prototype._addAriaAndCollapsedClass=function(e,n){if(e){var i=t(e).hasClass(g.SHOW);e.setAttribute("aria-expanded",i),n.length&&t(n).toggleClass(g.COLLAPSED,!i).attr("aria-expanded",i)}},l._getTargetFromElement=function(e){var n=r.getSelectorFromElement(e);return n?t(n)[0]:null},l._jQueryInterface=function(e){return this.each(function(){var n=t(this),o=n.data(a),r=t.extend({},d,n.data(),"object"===(void 0===e?"undefined":i(e))&&e);if(!o&&r.toggle&&/show|hide/.test(e)&&(r.toggle=!1),o||(o=new l(this,r),n.data(a,o)),"string"==typeof e){if(o[e]===undefined)throw new Error('No method named "'+e+'"');o[e]()}})},o(l,null,[{key:"VERSION",get:function(){return s}},{key:"Default",get:function(){return d}}]),l}();t(document).on(p.CLICK_DATA_API,_.DATA_TOGGLE,function(e){e.preventDefault();var n=v._getTargetFromElement(this),i=t(n).data(a),o=i?"toggle":t(this).data();v._jQueryInterface.call(t(n),o)}),t.fn[e]=v._jQueryInterface,t.fn[e].Constructor=v,t.fn[e].noConflict=function(){return t.fn[e]=f,v._jQueryInterface}}(jQuery),function(t){var e="dropdown",i="4.0.0-alpha.6",s="bs.dropdown",a="."+s,l=".data-api",h=t.fn[e],f=27,c=38,d=40,u=3,p={HIDE:"hide"+a,HIDDEN:"hidden"+a,SHOW:"show"+a,SHOWN:"shown"+a,CLICK:"click"+a,CLICK_DATA_API:"click"+a+l,FOCUSIN_DATA_API:"focusin"+a+l,KEYDOWN_DATA_API:"keydown"+a+l},g={BACKDROP:"dropdown-backdrop",DISABLED:"disabled",SHOW:"show"},m={BACKDROP:".dropdown-backdrop",DATA_TOGGLE:'[data-toggle="dropdown"]',FORM_CHILD:".dropdown form",ROLE_MENU:'[role="menu"]',ROLE_LISTBOX:'[role="listbox"]',NAVBAR_NAV:".navbar-nav",VISIBLE_ITEMS:'[role="menu"] li:not(.disabled) a, [role="listbox"] li:not(.disabled) a'},_=function(){function e(t){n(this,e),this._element=t,this._addEventListeners()}return e.prototype.toggle=function(){if(this.disabled||t(this).hasClass(g.DISABLED))return!1;var n=e._getParentFromElement(this),i=t(n).hasClass(g.SHOW);if(e._clearMenus(),i)return!1;if("ontouchstart"in document.documentElement&&!t(n).closest(m.NAVBAR_NAV).length){var o=document.createElement("div");o.className=g.BACKDROP,t(o).insertBefore(this),t(o).on("click",e._clearMenus)}var r={relatedTarget:this},s=t.Event(p.SHOW,r);return t(n).trigger(s),!s.isDefaultPrevented()&&(this.focus(),this.setAttribute("aria-expanded",!0),t(n).toggleClass(g.SHOW),t(n).trigger(t.Event(p.SHOWN,r)),!1)},e.prototype.dispose=function(){t.removeData(this._element,s),t(this._element).off(a),this._element=null},e.prototype._addEventListeners=function(){t(this._element).on(p.CLICK,this.toggle)},e._jQueryInterface=function(n){return this.each(function(){var i=t(this).data(s);if(i||(i=new e(this),t(this).data(s,i)),"string"==typeof n){if(i[n]===undefined)throw new Error('No method named "'+n+'"');i[n].call(this)}})},e._clearMenus=function(n){if(!n||n.which!==u){var i=t(m.BACKDROP)[0];i&&i.parentNode.removeChild(i);for(var o=t.makeArray(t(m.DATA_TOGGLE)),r=0;r<o.length;r++){var s=e._getParentFromElement(o[r]),a={relatedTarget:o[r]};if(t(s).hasClass(g.SHOW)&&!(n&&("click"===n.type&&/input|textarea/i.test(n.target.tagName)||"focusin"===n.type)&&t.contains(s,n.target))){var l=t.Event(p.HIDE,a);t(s).trigger(l),l.isDefaultPrevented()||(o[r].setAttribute("aria-expanded","false"),t(s).removeClass(g.SHOW).trigger(t.Event(p.HIDDEN,a)))}}}},e._getParentFromElement=function(e){var n=void 0,i=r.getSelectorFromElement(e);return i&&(n=t(i)[0]),n||e.parentNode},e._dataApiKeydownHandler=function(n){if(/(38|40|27|32)/.test(n.which)&&!/input|textarea/i.test(n.target.tagName)&&(n.preventDefault(),n.stopPropagation(),!this.disabled&&!t(this).hasClass(g.DISABLED))){var i=e._getParentFromElement(this),o=t(i).hasClass(g.SHOW);if(!o&&n.which!==f||o&&n.which===f){if(n.which===f){var r=t(i).find(m.DATA_TOGGLE)[0];t(r).trigger("focus")}return void t(this).trigger("click")}var s=t(i).find(m.VISIBLE_ITEMS).get();if(s.length){var a=s.indexOf(n.target);n.which===c&&a>0&&a--,n.which===d&&a<s.length-1&&a++,a<0&&(a=0),s[a].focus()}}},o(e,null,[{key:"VERSION",get:function(){return i}}]),e}();t(document).on(p.KEYDOWN_DATA_API,m.DATA_TOGGLE,_._dataApiKeydownHandler).on(p.KEYDOWN_DATA_API,m.ROLE_MENU,_._dataApiKeydownHandler).on(p.KEYDOWN_DATA_API,m.ROLE_LISTBOX,_._dataApiKeydownHandler).on(p.CLICK_DATA_API+" "+p.FOCUSIN_DATA_API,_._clearMenus).on(p.CLICK_DATA_API,m.DATA_TOGGLE,_.prototype.toggle).on(p.CLICK_DATA_API,m.FORM_CHILD,function(t){t.stopPropagation()}),t.fn[e]=_._jQueryInterface,t.fn[e].Constructor=_,t.fn[e].noConflict=function(){return t.fn[e]=h,_._jQueryInterface}}(jQuery),function(t){var e="modal",s="4.0.0-alpha.6",a="bs.modal",l="."+a,h=".data-api",f=t.fn[e],c=300,d=150,u=27,p={backdrop:!0,keyboard:!0,focus:!0,show:!0},g={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean",show:"boolean"},m={HIDE:"hide"+l,HIDDEN:"hidden"+l,SHOW:"show"+l,SHOWN:"shown"+l,FOCUSIN:"focusin"+l,RESIZE:"resize"+l,CLICK_DISMISS:"click.dismiss"+l,KEYDOWN_DISMISS:"keydown.dismiss"+l,MOUSEUP_DISMISS:"mouseup.dismiss"+l,MOUSEDOWN_DISMISS:"mousedown.dismiss"+l,CLICK_DATA_API:"click"+l+h},_={SCROLLBAR_MEASURER:"modal-scrollbar-measure",BACKDROP:"modal-backdrop",OPEN:"modal-open",FADE:"fade",SHOW:"show"},v={DIALOG:".modal-dialog",DATA_TOGGLE:'[data-toggle="modal"]',DATA_DISMISS:'[data-dismiss="modal"]',FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top"},E=function(){function h(e,i){n(this,h),this._config=this._getConfig(i),this._element=e,this._dialog=t(e).find(v.DIALOG)[0],this._backdrop=null,this._isShown=!1,this._isBodyOverflowing=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._originalBodyPadding=0,this._scrollbarWidth=0}return h.prototype.toggle=function(t){return this._isShown?this.hide():this.show(t)},h.prototype.show=function(e){var n=this;if(this._isTransitioning)throw new Error("Modal is transitioning");r.supportsTransitionEnd()&&t(this._element).hasClass(_.FADE)&&(this._isTransitioning=!0);var i=t.Event(m.SHOW,{relatedTarget:e});t(this._element).trigger(i),this._isShown||i.isDefaultPrevented()||(this._isShown=!0,this._checkScrollbar(),this._setScrollbar(),t(document.body).addClass(_.OPEN),this._setEscapeEvent(),this._setResizeEvent(),t(this._element).on(m.CLICK_DISMISS,v.DATA_DISMISS,function(t){return n.hide(t)}),t(this._dialog).on(m.MOUSEDOWN_DISMISS,function(){t(n._element).one(m.MOUSEUP_DISMISS,function(e){t(e.target).is(n._element)&&(n._ignoreBackdropClick=!0)})}),this._showBackdrop(function(){return n._showElement(e)}))},h.prototype.hide=function(e){var n=this;if(e&&e.preventDefault(),this._isTransitioning)throw new Error("Modal is transitioning");var i=r.supportsTransitionEnd()&&t(this._element).hasClass(_.FADE);i&&(this._isTransitioning=!0);var o=t.Event(m.HIDE);t(this._element).trigger(o),this._isShown&&!o.isDefaultPrevented()&&(this._isShown=!1,this._setEscapeEvent(),this._setResizeEvent(),t(document).off(m.FOCUSIN),t(this._element).removeClass(_.SHOW),t(this._element).off(m.CLICK_DISMISS),t(this._dialog).off(m.MOUSEDOWN_DISMISS),i?t(this._element).one(r.TRANSITION_END,function(t){return n._hideModal(t)}).emulateTransitionEnd(c):this._hideModal())},h.prototype.dispose=function(){t.removeData(this._element,a),t(window,document,this._element,this._backdrop).off(l),this._config=null,this._element=null,this._dialog=null,this._backdrop=null,this._isShown=null,this._isBodyOverflowing=null,this._ignoreBackdropClick=null,this._originalBodyPadding=null,this._scrollbarWidth=null},h.prototype._getConfig=function(n){return n=t.extend({},p,n),r.typeCheckConfig(e,n,g),n},h.prototype._showElement=function(e){var n=this,i=r.supportsTransitionEnd()&&t(this._element).hasClass(_.FADE);this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.scrollTop=0,i&&r.reflow(this._element),t(this._element).addClass(_.SHOW),this._config.focus&&this._enforceFocus();var o=t.Event(m.SHOWN,{relatedTarget:e}),s=function(){n._config.focus&&n._element.focus(),n._isTransitioning=!1,t(n._element).trigger(o)};i?t(this._dialog).one(r.TRANSITION_END,s).emulateTransitionEnd(c):s()},h.prototype._enforceFocus=function(){var e=this;t(document).off(m.FOCUSIN).on(m.FOCUSIN,function(n){document===n.target||e._element===n.target||t(e._element).has(n.target).length||e._element.focus()})},h.prototype._setEscapeEvent=function(){var e=this;this._isShown&&this._config.keyboard?t(this._element).on(m.KEYDOWN_DISMISS,function(t){t.which===u&&e.hide()}):this._isShown||t(this._element).off(m.KEYDOWN_DISMISS)},h.prototype._setResizeEvent=function(){var e=this;this._isShown?t(window).on(m.RESIZE,function(t){return e._handleUpdate(t)}):t(window).off(m.RESIZE)},h.prototype._hideModal=function(){var e=this;this._element.style.display="none",this._element.setAttribute("aria-hidden","true"),this._isTransitioning=!1,this._showBackdrop(function(){t(document.body).removeClass(_.OPEN),e._resetAdjustments(),e._resetScrollbar(),t(e._element).trigger(m.HIDDEN)})},h.prototype._removeBackdrop=function(){this._backdrop&&(t(this._backdrop).remove(),this._backdrop=null)},h.prototype._showBackdrop=function(e){var n=this,i=t(this._element).hasClass(_.FADE)?_.FADE:"";if(this._isShown&&this._config.backdrop){var o=r.supportsTransitionEnd()&&i;if(this._backdrop=document.createElement("div"),this._backdrop.className=_.BACKDROP,i&&t(this._backdrop).addClass(i),t(this._backdrop).appendTo(document.body),t(this._element).on(m.CLICK_DISMISS,function(t){if(n._ignoreBackdropClick)return void(n._ignoreBackdropClick=!1);t.target===t.currentTarget&&("static"===n._config.backdrop?n._element.focus():n.hide())}),o&&r.reflow(this._backdrop),t(this._backdrop).addClass(_.SHOW),!e)return;if(!o)return void e();t(this._backdrop).one(r.TRANSITION_END,e).emulateTransitionEnd(d)}else if(!this._isShown&&this._backdrop){t(this._backdrop).removeClass(_.SHOW);var s=function(){n._removeBackdrop(),e&&e()};r.supportsTransitionEnd()&&t(this._element).hasClass(_.FADE)?t(this._backdrop).one(r.TRANSITION_END,s).emulateTransitionEnd(d):s()}else e&&e()},h.prototype._handleUpdate=function(){this._adjustDialog()},h.prototype._adjustDialog=function(){var t=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},h.prototype._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},h.prototype._checkScrollbar=function(){this._isBodyOverflowing=document.body.clientWidth<window.innerWidth,this._scrollbarWidth=this._getScrollbarWidth()},h.prototype._setScrollbar=function(){var e=parseInt(t(v.FIXED_CONTENT).css("padding-right")||0,10);this._originalBodyPadding=document.body.style.paddingRight||"",this._isBodyOverflowing&&(document.body.style.paddingRight=e+this._scrollbarWidth+"px")},h.prototype._resetScrollbar=function(){document.body.style.paddingRight=this._originalBodyPadding},h.prototype._getScrollbarWidth=function(){var t=document.createElement("div");t.className=_.SCROLLBAR_MEASURER,document.body.appendChild(t);var e=t.offsetWidth-t.clientWidth;return document.body.removeChild(t),e},h._jQueryInterface=function(e,n){return this.each(function(){var o=t(this).data(a),r=t.extend({},h.Default,t(this).data(),"object"===(void 0===e?"undefined":i(e))&&e);if(o||(o=new h(this,r),t(this).data(a,o)),"string"==typeof e){if(o[e]===undefined)throw new Error('No method named "'+e+'"');o[e](n)}else r.show&&o.show(n)})},o(h,null,[{key:"VERSION",get:function(){return s}},{key:"Default",get:function(){return p}}]),h}();t(document).on(m.CLICK_DATA_API,v.DATA_TOGGLE,function(e){var n=this,i=void 0,o=r.getSelectorFromElement(this);o&&(i=t(o)[0]);var s=t(i).data(a)?"toggle":t.extend({},t(i).data(),t(this).data());"A"!==this.tagName&&"AREA"!==this.tagName||e.preventDefault();var l=t(i).one(m.SHOW,function(e){e.isDefaultPrevented()||l.one(m.HIDDEN,function(){t(n).is(":visible")&&n.focus()})});E._jQueryInterface.call(t(i),s,this)}),t.fn[e]=E._jQueryInterface,t.fn[e].Constructor=E,t.fn[e].noConflict=function(){return t.fn[e]=f,E._jQueryInterface}}(jQuery),function(t){var e="scrollspy",s="4.0.0-alpha.6",a="bs.scrollspy",l="."+a,h=".data-api",f=t.fn[e],c={offset:10,method:"auto",target:""},d={offset:"number",method:"string",target:"(string|element)"},u={ACTIVATE:"activate"+l,SCROLL:"scroll"+l,LOAD_DATA_API:"load"+l+h},p={DROPDOWN_ITEM:"dropdown-item",DROPDOWN_MENU:"dropdown-menu",NAV_LINK:"nav-link",NAV:"nav",ACTIVE:"active"},g={DATA_SPY:'[data-spy="scroll"]',ACTIVE:".active",LIST_ITEM:".list-item",LI:"li",LI_DROPDOWN:"li.dropdown",NAV_LINKS:".nav-link",DROPDOWN:".dropdown",DROPDOWN_ITEMS:".dropdown-item",DROPDOWN_TOGGLE:".dropdown-toggle"},m={OFFSET:"offset",POSITION:"position"},_=function(){function h(e,i){var o=this;n(this,h),this._element=e,this._scrollElement="BODY"===e.tagName?window:e,this._config=this._getConfig(i),this._selector=this._config.target+" "+g.NAV_LINKS+","+this._config.target+" "+g.DROPDOWN_ITEMS,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,t(this._scrollElement).on(u.SCROLL,function(t){return o._process(t)}),this.refresh(),this._process()}return h.prototype.refresh=function(){var e=this,n=this._scrollElement!==this._scrollElement.window?m.POSITION:m.OFFSET,i="auto"===this._config.method?n:this._config.method,o=i===m.POSITION?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),t.makeArray(t(this._selector)).map(function(e){var n=void 0,s=r.getSelectorFromElement(e);return s&&(n=t(s)[0]),n&&(n.offsetWidth||n.offsetHeight)?[t(n)[i]().top+o,s]:null}).filter(function(t){return t}).sort(function(t,e){return t[0]-e[0]}).forEach(function(t){e._offsets.push(t[0]),e._targets.push(t[1])})},h.prototype.dispose=function(){t.removeData(this._element,a),t(this._scrollElement).off(l),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},h.prototype._getConfig=function(n){if(n=t.extend({},c,n),"string"!=typeof n.target){var i=t(n.target).attr("id");i||(i=r.getUID(e),t(n.target).attr("id",i)),n.target="#"+i}return r.typeCheckConfig(e,n,d),n},h.prototype._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},h.prototype._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},h.prototype._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.offsetHeight},h.prototype._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=n){var i=this._targets[this._targets.length-1];return void(this._activeTarget!==i&&this._activate(i))}if(this._activeTarget&&t<this._offsets[0]&&this._offsets[0]>0)return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;){this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&(this._offsets[o+1]===undefined||t<this._offsets[o+1])&&this._activate(this._targets[o])}},h.prototype._activate=function(e){this._activeTarget=e,this._clear();var n=this._selector.split(",");n=n.map(function(t){return t+'[data-target="'+e+'"],'+t+'[href="'+e+'"]'});var i=t(n.join(","));i.hasClass(p.DROPDOWN_ITEM)?(i.closest(g.DROPDOWN).find(g.DROPDOWN_TOGGLE).addClass(p.ACTIVE),i.addClass(p.ACTIVE)):i.parents(g.LI).find("> "+g.NAV_LINKS).addClass(p.ACTIVE),t(this._scrollElement).trigger(u.ACTIVATE,{relatedTarget:e})},h.prototype._clear=function(){t(this._selector).filter(g.ACTIVE).removeClass(p.ACTIVE)},h._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(a),o="object"===(void 0===e?"undefined":i(e))&&e;if(n||(n=new h(this,o),t(this).data(a,n)),"string"==typeof e){if(n[e]===undefined)throw new Error('No method named "'+e+'"');n[e]()}})},o(h,null,[{key:"VERSION",get:function(){return s}},{key:"Default",get:function(){return c}}]),h}();t(window).on(u.LOAD_DATA_API,function(){for(var e=t.makeArray(t(g.DATA_SPY)),n=e.length;n--;){var i=t(e[n]);_._jQueryInterface.call(i,i.data())}}),t.fn[e]=_._jQueryInterface,t.fn[e].Constructor=_,t.fn[e].noConflict=function(){return t.fn[e]=f,_._jQueryInterface}}(jQuery),function(t){var e="tab",i="4.0.0-alpha.6",s="bs.tab",a="."+s,l=".data-api",h=t.fn[e],f=150,c={HIDE:"hide"+a,HIDDEN:"hidden"+a,SHOW:"show"+a,SHOWN:"shown"+a,CLICK_DATA_API:"click"+a+l},d={DROPDOWN_MENU:"dropdown-menu",ACTIVE:"active",DISABLED:"disabled",FADE:"fade",SHOW:"show"},u={A:"a",LI:"li",DROPDOWN:".dropdown",LIST:"ul:not(.dropdown-menu), ol:not(.dropdown-menu), nav:not(.dropdown-menu)",FADE_CHILD:"> .nav-item .fade, > .fade",ACTIVE:".active",ACTIVE_CHILD:"> .nav-item > .active, > .active",DATA_TOGGLE:'[data-toggle="tab"], [data-toggle="pill"]',DROPDOWN_TOGGLE:".dropdown-toggle",DROPDOWN_ACTIVE_CHILD:"> .dropdown-menu .active"},p=function(){function e(t){n(this,e),this._element=t}return e.prototype.show=function(){var e=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&t(this._element).hasClass(d.ACTIVE)||t(this._element).hasClass(d.DISABLED))){var n=void 0,i=void 0,o=t(this._element).closest(u.LIST)[0],s=r.getSelectorFromElement(this._element);o&&(i=t.makeArray(t(o).find(u.ACTIVE)),i=i[i.length-1]);var a=t.Event(c.HIDE,{relatedTarget:this._element}),l=t.Event(c.SHOW,{relatedTarget:i});if(i&&t(i).trigger(a),t(this._element).trigger(l),!l.isDefaultPrevented()&&!a.isDefaultPrevented()){s&&(n=t(s)[0]),this._activate(this._element,o);var h=function(){var n=t.Event(c.HIDDEN,{relatedTarget:e._element}),o=t.Event(c.SHOWN,{relatedTarget:i});t(i).trigger(n),t(e._element).trigger(o)};n?this._activate(n,n.parentNode,h):h()}}},e.prototype.dispose=function(){t.removeClass(this._element,s),this._element=null},e.prototype._activate=function(e,n,i){var o=this,s=t(n).find(u.ACTIVE_CHILD)[0],a=i&&r.supportsTransitionEnd()&&(s&&t(s).hasClass(d.FADE)||Boolean(t(n).find(u.FADE_CHILD)[0])),l=function(){return o._transitionComplete(e,s,a,i)};s&&a?t(s).one(r.TRANSITION_END,l).emulateTransitionEnd(f):l(),s&&t(s).removeClass(d.SHOW)},e.prototype._transitionComplete=function(e,n,i,o){if(n){t(n).removeClass(d.ACTIVE);var s=t(n.parentNode).find(u.DROPDOWN_ACTIVE_CHILD)[0];s&&t(s).removeClass(d.ACTIVE),n.setAttribute("aria-expanded",!1)}if(t(e).addClass(d.ACTIVE),e.setAttribute("aria-expanded",!0),i?(r.reflow(e),t(e).addClass(d.SHOW)):t(e).removeClass(d.FADE),e.parentNode&&t(e.parentNode).hasClass(d.DROPDOWN_MENU)){var a=t(e).closest(u.DROPDOWN)[0];a&&t(a).find(u.DROPDOWN_TOGGLE).addClass(d.ACTIVE),e.setAttribute("aria-expanded",!0)}o&&o()},e._jQueryInterface=function(n){return this.each(function(){var i=t(this),o=i.data(s);if(o||(o=new e(this),i.data(s,o)),"string"==typeof n){if(o[n]===undefined)throw new Error('No method named "'+n+'"');o[n]()}})},o(e,null,[{key:"VERSION",get:function(){return i}}]),e}();t(document).on(c.CLICK_DATA_API,u.DATA_TOGGLE,function(e){e.preventDefault(),p._jQueryInterface.call(t(this),"show")}),t.fn[e]=p._jQueryInterface,t.fn[e].Constructor=p,t.fn[e].noConflict=function(){return t.fn[e]=h,p._jQueryInterface}}(jQuery),function(t){if("undefined"==typeof Tether)throw new Error("Bootstrap tooltips require Tether (http://tether.io/)");var e="tooltip",s="4.0.0-alpha.6",a="bs.tooltip",l="."+a,h=t.fn[e],f=150,c="bs-tether",d={animation:!0,template:'<div class="tooltip" role="tooltip"><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:"0 0",constraints:[],container:!1},u={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"string",constraints:"array",container:"(string|element|boolean)"},p={TOP:"bottom center",RIGHT:"middle left",BOTTOM:"top center",LEFT:"middle right"},g={SHOW:"show",OUT:"out"},m={HIDE:"hide"+l,HIDDEN:"hidden"+l,SHOW:"show"+l,SHOWN:"shown"+l,INSERTED:"inserted"+l,CLICK:"click"+l,FOCUSIN:"focusin"+l,FOCUSOUT:"focusout"+l,MOUSEENTER:"mouseenter"+l,MOUSELEAVE:"mouseleave"+l},_={FADE:"fade",SHOW:"show"},v={TOOLTIP:".tooltip",TOOLTIP_INNER:".tooltip-inner"},E={element:!1,enabled:!1},y={HOVER:"hover",FOCUS:"focus",CLICK:"click",MANUAL:"manual"},T=function(){function h(t,e){n(this,h),this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._isTransitioning=!1,this._tether=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}return h.prototype.enable=function(){this._isEnabled=!0},h.prototype.disable=function(){this._isEnabled=!1},h.prototype.toggleEnabled=function(){this._isEnabled=!this._isEnabled},h.prototype.toggle=function(e){if(e){var n=this.constructor.DATA_KEY,i=t(e.currentTarget).data(n);i||(i=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(n,i)),i._activeTrigger.click=!i._activeTrigger.click,i._isWithActiveTrigger()?i._enter(null,i):i._leave(null,i)}else{if(t(this.getTipElement()).hasClass(_.SHOW))return void this._leave(null,this);this._enter(null,this)}},h.prototype.dispose=function(){clearTimeout(this._timeout),this.cleanupTether(),t.removeData(this.element,this.constructor.DATA_KEY),t(this.element).off(this.constructor.EVENT_KEY),t(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&t(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._tether=null,this.element=null,this.config=null,this.tip=null},h.prototype.show=function(){var e=this;if("none"===t(this.element).css("display"))throw new Error("Please use show on visible elements");var n=t.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){if(this._isTransitioning)throw new Error("Tooltip is transitioning");t(this.element).trigger(n);var i=t.contains(this.element.ownerDocument.documentElement,this.element);if(n.isDefaultPrevented()||!i)return;var o=this.getTipElement(),s=r.getUID(this.constructor.NAME);o.setAttribute("id",s),this.element.setAttribute("aria-describedby",s),this.setContent(),this.config.animation&&t(o).addClass(_.FADE);var a="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,l=this._getAttachment(a),f=!1===this.config.container?document.body:t(this.config.container);t(o).data(this.constructor.DATA_KEY,this).appendTo(f),t(this.element).trigger(this.constructor.Event.INSERTED),this._tether=new Tether({attachment:l,element:o,target:this.element,classes:E,classPrefix:c,offset:this.config.offset,constraints:this.config.constraints,addTargetClasses:!1}),r.reflow(o),this._tether.position(),t(o).addClass(_.SHOW);var d=function(){var n=e._hoverState;e._hoverState=null,e._isTransitioning=!1,t(e.element).trigger(e.constructor.Event.SHOWN),n===g.OUT&&e._leave(null,e)};if(r.supportsTransitionEnd()&&t(this.tip).hasClass(_.FADE))return this._isTransitioning=!0,void t(this.tip).one(r.TRANSITION_END,d).emulateTransitionEnd(h._TRANSITION_DURATION);d()}},h.prototype.hide=function(e){var n=this,i=this.getTipElement(),o=t.Event(this.constructor.Event.HIDE);if(this._isTransitioning)throw new Error("Tooltip is transitioning");var s=function(){n._hoverState!==g.SHOW&&i.parentNode&&i.parentNode.removeChild(i),n.element.removeAttribute("aria-describedby"),t(n.element).trigger(n.constructor.Event.HIDDEN),n._isTransitioning=!1,n.cleanupTether(),e&&e()};t(this.element).trigger(o),o.isDefaultPrevented()||(t(i).removeClass(_.SHOW),this._activeTrigger[y.CLICK]=!1,this._activeTrigger[y.FOCUS]=!1,this._activeTrigger[y.HOVER]=!1,r.supportsTransitionEnd()&&t(this.tip).hasClass(_.FADE)?(this._isTransitioning=!0,t(i).one(r.TRANSITION_END,s).emulateTransitionEnd(f)):s(),this._hoverState="")},h.prototype.isWithContent=function(){return Boolean(this.getTitle())},h.prototype.getTipElement=function(){return this.tip=this.tip||t(this.config.template)[0]},h.prototype.setContent=function(){var e=t(this.getTipElement());this.setElementContent(e.find(v.TOOLTIP_INNER),this.getTitle()),e.removeClass(_.FADE+" "+_.SHOW),this.cleanupTether()},h.prototype.setElementContent=function(e,n){var o=this.config.html;"object"===(void 0===n?"undefined":i(n))&&(n.nodeType||n.jquery)?o?t(n).parent().is(e)||e.empty().append(n):e.text(t(n).text()):e[o?"html":"text"](n)},h.prototype.getTitle=function(){var t=this.element.getAttribute("data-original-title")
144
+ ;return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},h.prototype.cleanupTether=function(){this._tether&&this._tether.destroy()},h.prototype._getAttachment=function(t){return p[t.toUpperCase()]},h.prototype._setListeners=function(){var e=this;this.config.trigger.split(" ").forEach(function(n){if("click"===n)t(e.element).on(e.constructor.Event.CLICK,e.config.selector,function(t){return e.toggle(t)});else if(n!==y.MANUAL){var i=n===y.HOVER?e.constructor.Event.MOUSEENTER:e.constructor.Event.FOCUSIN,o=n===y.HOVER?e.constructor.Event.MOUSELEAVE:e.constructor.Event.FOCUSOUT;t(e.element).on(i,e.config.selector,function(t){return e._enter(t)}).on(o,e.config.selector,function(t){return e._leave(t)})}t(e.element).closest(".modal").on("hide.bs.modal",function(){return e.hide()})}),this.config.selector?this.config=t.extend({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},h.prototype._fixTitle=function(){var t=i(this.element.getAttribute("data-original-title"));(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},h.prototype._enter=function(e,n){var i=this.constructor.DATA_KEY;return n=n||t(e.currentTarget).data(i),n||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusin"===e.type?y.FOCUS:y.HOVER]=!0),t(n.getTipElement()).hasClass(_.SHOW)||n._hoverState===g.SHOW?void(n._hoverState=g.SHOW):(clearTimeout(n._timeout),n._hoverState=g.SHOW,n.config.delay&&n.config.delay.show?void(n._timeout=setTimeout(function(){n._hoverState===g.SHOW&&n.show()},n.config.delay.show)):void n.show())},h.prototype._leave=function(e,n){var i=this.constructor.DATA_KEY;if(n=n||t(e.currentTarget).data(i),n||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusout"===e.type?y.FOCUS:y.HOVER]=!1),!n._isWithActiveTrigger()){if(clearTimeout(n._timeout),n._hoverState=g.OUT,!n.config.delay||!n.config.delay.hide)return void n.hide();n._timeout=setTimeout(function(){n._hoverState===g.OUT&&n.hide()},n.config.delay.hide)}},h.prototype._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},h.prototype._getConfig=function(n){return n=t.extend({},this.constructor.Default,t(this.element).data(),n),n.delay&&"number"==typeof n.delay&&(n.delay={show:n.delay,hide:n.delay}),r.typeCheckConfig(e,n,this.constructor.DefaultType),n},h.prototype._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},h._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(a),o="object"===(void 0===e?"undefined":i(e))&&e;if((n||!/dispose|hide/.test(e))&&(n||(n=new h(this,o),t(this).data(a,n)),"string"==typeof e)){if(n[e]===undefined)throw new Error('No method named "'+e+'"');n[e]()}})},o(h,null,[{key:"VERSION",get:function(){return s}},{key:"Default",get:function(){return d}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return a}},{key:"Event",get:function(){return m}},{key:"EVENT_KEY",get:function(){return l}},{key:"DefaultType",get:function(){return u}}]),h}();return t.fn[e]=T._jQueryInterface,t.fn[e].Constructor=T,t.fn[e].noConflict=function(){return t.fn[e]=h,T._jQueryInterface},T}(jQuery));!function(r){var a="popover",l="4.0.0-alpha.6",h="bs.popover",f="."+h,c=r.fn[a],d=r.extend({},s.Default,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),u=r.extend({},s.DefaultType,{content:"(string|element|function)"}),p={FADE:"fade",SHOW:"show"},g={TITLE:".popover-title",CONTENT:".popover-content"},m={HIDE:"hide"+f,HIDDEN:"hidden"+f,SHOW:"show"+f,SHOWN:"shown"+f,INSERTED:"inserted"+f,CLICK:"click"+f,FOCUSIN:"focusin"+f,FOCUSOUT:"focusout"+f,MOUSEENTER:"mouseenter"+f,MOUSELEAVE:"mouseleave"+f},_=function(s){function c(){return n(this,c),t(this,s.apply(this,arguments))}return e(c,s),c.prototype.isWithContent=function(){return this.getTitle()||this._getContent()},c.prototype.getTipElement=function(){return this.tip=this.tip||r(this.config.template)[0]},c.prototype.setContent=function(){var t=r(this.getTipElement());this.setElementContent(t.find(g.TITLE),this.getTitle()),this.setElementContent(t.find(g.CONTENT),this._getContent()),t.removeClass(p.FADE+" "+p.SHOW),this.cleanupTether()},c.prototype._getContent=function(){return this.element.getAttribute("data-content")||("function"==typeof this.config.content?this.config.content.call(this.element):this.config.content)},c._jQueryInterface=function(t){return this.each(function(){var e=r(this).data(h),n="object"===(void 0===t?"undefined":i(t))?t:null;if((e||!/destroy|hide/.test(t))&&(e||(e=new c(this,n),r(this).data(h,e)),"string"==typeof t)){if(e[t]===undefined)throw new Error('No method named "'+t+'"');e[t]()}})},o(c,null,[{key:"VERSION",get:function(){return l}},{key:"Default",get:function(){return d}},{key:"NAME",get:function(){return a}},{key:"DATA_KEY",get:function(){return h}},{key:"Event",get:function(){return m}},{key:"EVENT_KEY",get:function(){return f}},{key:"DefaultType",get:function(){return u}}]),c}(s);r.fn[a]=_._jQueryInterface,r.fn[a].Constructor=_,r.fn[a].noConflict=function(){return r.fn[a]=c,_._jQueryInterface}}(jQuery)}(),decko.slotReady(function(t){t.find(".modal.fade").on("loaded.bs.modal",function(){$(this).trigger("slotReady")}),t.find("[data-toggle='modal']").off("click").on("click",function(t){var e,n,i;return t.preventDefault(),t.stopPropagation(),e=$(this),n=e.attr("href"),i=e.data("target"),$(i).modal("show"),$.ajax({url:n,type:"GET",success:function(t){return $(i+" .modal-content").html(t),$(i).trigger("loaded.bs.modal")},error:function(t){return $(i+" .modal-content").html(t.responseText),$(i).trigger("loaded.bs.modal")}}),!1})});
145
+ //script: select2
146
+ /*!
147
+ * Select2 4.0.3
148
+ * https://select2.github.io
149
+ *
150
+ * Released under the MIT license
151
+ * https://github.com/select2/select2/blob/master/LICENSE.md
152
+ */
153
+ !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){var t=function(){if(e&&e.fn&&e.fn.select2&&e.fn.select2.amd)var t=e.fn.select2.amd;var t;return function(){if(!t||!t.requirejs){t?n=t:t={};/**
154
+ * @license almond 0.3.1 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
155
+ * Available via the MIT or new BSD license.
156
+ * see: http://github.com/jrburke/almond for details
157
+ */
158
+ var e,n,i;!function(t){function r(e,t){return $.call(e,t)}function o(e,t){var n,i,r,o,s,a,l,c,u,d,p,h=t&&t.split("/"),f=y.map,g=f&&f["*"]||{};if(e&&"."===e.charAt(0))if(t){for(e=e.split("/"),s=e.length-1,y.nodeIdCompat&&b.test(e[s])&&(e[s]=e[s].replace(b,"")),e=h.slice(0,h.length-1).concat(e),u=0;u<e.length;u+=1)if("."===(p=e[u]))e.splice(u,1),u-=1;else if(".."===p){if(1===u&&(".."===e[2]||".."===e[0]))break;u>0&&(e.splice(u-1,2),u-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((h||g)&&f){for(n=e.split("/"),u=n.length;u>0;u-=1){if(i=n.slice(0,u).join("/"),h)for(d=h.length;d>0;d-=1)if((r=f[h.slice(0,d).join("/")])&&(r=r[i])){o=r,a=u;break}if(o)break;!l&&g&&g[i]&&(l=g[i],c=u)}!o&&l&&(o=l,a=c),o&&(n.splice(0,a,o),e=n.join("/"))}return e}function s(e,n){return function(){var i=w.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),h.apply(t,i.concat([e,n]))}}function a(e){return function(t){return o(t,e)}}function l(e){return function(t){m[e]=t}}function c(e){if(r(v,e)){var n=v[e];delete v[e],_[e]=!0,p.apply(t,n)}if(!r(m,e)&&!r(_,e))throw new Error("No "+e);return m[e]}function u(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function d(e){return function(){return y&&y.config&&y.config[e]||{}}}var p,h,f,g,m={},v={},y={},_={},$=Object.prototype.hasOwnProperty,w=[].slice,b=/\.js$/;f=function(e,t){var n,i=u(e),r=i[0];return e=i[1],r&&(r=o(r,t),n=c(r)),r?e=n&&n.normalize?n.normalize(e,a(t)):o(e,t):(e=o(e,t),i=u(e),r=i[0],e=i[1],r&&(n=c(r))),{f:r?r+"!"+e:e,n:e,pr:r,p:n}},g={require:function(e){return s(e)},exports:function(e){var t=m[e];return void 0!==t?t:m[e]={}},module:function(e){return{id:e,uri:"",exports:m[e],config:d(e)}}},p=function(e,n,i,o){var a,u,d,p,h,y,$=[],w=typeof i;if(o=o||e,"undefined"===w||"function"===w){for(n=!n.length&&i.length?["require","exports","module"]:n,h=0;h<n.length;h+=1)if(p=f(n[h],o),"require"===(u=p.f))$[h]=g.require(e);else if("exports"===u)$[h]=g.exports(e),y=!0;else if("module"===u)a=$[h]=g.module(e);else if(r(m,u)||r(v,u)||r(_,u))$[h]=c(u);else{if(!p.p)throw new Error(e+" missing "+u);p.p.load(p.n,s(o,!0),l(u),{}),$[h]=m[u]}d=i?i.apply(m[e],$):undefined,e&&(a&&a.exports!==t&&a.exports!==m[e]?m[e]=a.exports:d===t&&y||(m[e]=d))}else e&&(m[e]=i)},e=n=h=function(e,n,i,r,o){if("string"==typeof e)return g[e]?g[e](n):c(f(e,n).f);if(!e.splice){if(y=e,y.deps&&h(y.deps,y.callback),!n)return;n.splice?(e=n,n=i,i=null):e=t}return n=n||function(){},"function"==typeof i&&(i=r,r=o),r?p(t,e,n,i):setTimeout(function(){p(t,e,n,i)},4),h},h.config=function(e){return h(e)},e._defined=m,i=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),r(m,e)||r(v,e)||(v[e]=[e,t,n])},i.amd={jQuery:!0}}(),t.requirejs=e,t.require=n,t.define=i}}(),t.define("almond",function(){}),t.define("jquery",[],function(){var t=e||$;return null==t&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),t}),t.define("select2/utils",["jquery"],function(e){function t(e){var t=e.prototype,n=[];for(var i in t){"function"==typeof t[i]&&("constructor"!==i&&n.push(i))}return n}var n={};n.Extend=function(e,t){function n(){this.constructor=e}var i={}.hasOwnProperty;for(var r in t)i.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},n.Decorate=function(e,n){function i(){var t=Array.prototype.unshift,i=n.prototype.constructor.length,r=e.prototype.constructor;i>0&&(t.call(arguments,e.prototype.constructor),r=n.prototype.constructor),r.apply(this,arguments)}function r(){this.constructor=i}var o=t(n),s=t(e);n.displayName=e.displayName,i.prototype=new r;for(var a=0;a<s.length;a++){var l=s[a];i.prototype[l]=e.prototype[l]}for(var c=(function(e){var t=function(){};e in i.prototype&&(t=i.prototype[e]);var r=n.prototype[e];return function(){return Array.prototype.unshift.call(arguments,t),r.apply(this,arguments)}}),u=0;u<o.length;u++){var d=o[u];i.prototype[d]=c(d)}return i};var i=function(){this.listeners={}};return i.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},i.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),n[0]._type=e,e in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},i.prototype.invoke=function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].apply(this,t)},n.Observable=i,n.generateChars=function(e){for(var t="",n=0;n<e;n++){t+=Math.floor(36*Math.random()).toString(36)}return t},n.bind=function(e,t){return function(){e.apply(t,arguments)}},n._convertData=function(e){for(var t in e){var n=t.split("-"),i=e;if(1!==n.length){for(var r=0;r<n.length;r++){var o=n[r];o=o.substring(0,1).toLowerCase()+o.substring(1),o in i||(i[o]={}),r==n.length-1&&(i[o]=e[t]),i=i[o]}delete e[t]}}return e},n.hasScroll=function(t,n){var i=e(n),r=n.style.overflowX,o=n.style.overflowY;return(r!==o||"hidden"!==o&&"visible"!==o)&&("scroll"===r||"scroll"===o||(i.innerHeight()<n.scrollHeight||i.innerWidth()<n.scrollWidth))},n.escapeMarkup=function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},n.appendMany=function(t,n){if("1.7"===e.fn.jquery.substr(0,3)){var i=e();e.map(n,function(e){i=i.add(e)}),n=i}t.append(n)},n}),t.define("select2/results",["jquery","./utils"],function(e,t){function n(e,t,i){this.$element=e,this.data=i,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&t.attr("aria-multiselectable","true"),this.$results=t,t},n.prototype.clear=function(){this.$results.empty()},n.prototype.displayMessage=function(t){var n=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var i=e('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),r=this.options.get("translations").get(t.message);i.append(n(r(t.args))),i[0].className+=" select2-results__message",this.$results.append(i)},n.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},n.prototype.append=function(e){this.hideLoading();var t=[];if(null==e.results||0===e.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var i=e.results[n],r=this.option(i);t.push(r)}this.$results.append(t)},n.prototype.position=function(e,t){t.find(".select2-results").append(e)},n.prototype.sort=function(e){return this.options.get("sorter")(e)},n.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2-results__option[aria-selected]"),t=e.filter("[aria-selected=true]");t.length>0?t.first().trigger("mouseenter"):e.first().trigger("mouseenter"),this.ensureHighlightVisible()},n.prototype.setClasses=function(){var t=this;this.data.current(function(n){var i=e.map(n,function(e){return e.id.toString()});t.$results.find(".select2-results__option[aria-selected]").each(function(){var t=e(this),n=e.data(this,"data"),r=""+n.id;null!=n.element&&n.element.selected||null==n.element&&e.inArray(r,i)>-1?t.attr("aria-selected","true"):t.attr("aria-selected","false")})})},n.prototype.showLoading=function(e){this.hideLoading();var t=this.options.get("translations").get("searching"),n={disabled:!0,loading:!0,text:t(e)},i=this.option(n);i.className+=" loading-results",this.$results.prepend(i)},n.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},n.prototype.option=function(t){var n=document.createElement("li");n.className="select2-results__option";var i={role:"treeitem","aria-selected":"false"};t.disabled&&(delete i["aria-selected"],i["aria-disabled"]="true"),null==t.id&&delete i["aria-selected"],null!=t._resultId&&(n.id=t._resultId),t.title&&(n.title=t.title),t.children&&(i.role="group",i["aria-label"]=t.text,delete i["aria-selected"]);for(var r in i){var o=i[r];n.setAttribute(r,o)}if(t.children){var s=e(n),a=document.createElement("strong");a.className="select2-results__group";e(a);this.template(t,a);for(var l=[],c=0;c<t.children.length;c++){var u=t.children[c],d=this.option(u);l.push(d)}var p=e("<ul></ul>",{"class":"select2-results__options select2-results__options--nested"});p.append(l),s.append(a),s.append(p)}else this.template(t,n);return e.data(n,"data",t),n},n.prototype.bind=function(t){var n=this,i=t.id+"-results";this.$results.attr("id",i),t.on("results:all",function(e){n.clear(),n.append(e.data),t.isOpen()&&(n.setClasses(),n.highlightFirstItem())}),t.on("results:append",function(e){n.append(e.data),t.isOpen()&&n.setClasses()}),t.on("query",function(e){n.hideMessages(),n.showLoading(e)}),t.on("select",function(){t.isOpen()&&(n.setClasses(),n.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(n.setClasses(),n.highlightFirstItem())}),t.on("open",function(){n.$results.attr("aria-expanded","true"),n.$results.attr("aria-hidden","false"),n.setClasses(),n.ensureHighlightVisible()}),t.on("close",function(){n.$results.attr("aria-expanded","false"),n.$results.attr("aria-hidden","true"),n.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=n.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=n.getHighlightedResults();if(0!==e.length){var t=e.data("data");"true"==e.attr("aria-selected")?n.trigger("close",{}):n.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=n.getHighlightedResults(),t=n.$results.find("[aria-selected]"),i=t.index(e);if(0!==i){var r=i-1;0===e.length&&(r=0);var o=t.eq(r);o.trigger("mouseenter");var s=n.$results.offset().top,a=o.offset().top,l=n.$results.scrollTop()+(a-s);0===r?n.$results.scrollTop(0):a-s<0&&n.$results.scrollTop(l)}}),t.on("results:next",function(){var e=n.getHighlightedResults(),t=n.$results.find("[aria-selected]"),i=t.index(e),r=i+1;if(!(r>=t.length)){var o=t.eq(r);o.trigger("mouseenter");var s=n.$results.offset().top+n.$results.outerHeight(!1),a=o.offset().top+o.outerHeight(!1),l=n.$results.scrollTop()+a-s;0===r?n.$results.scrollTop(0):a>s&&n.$results.scrollTop(l)}}),t.on("results:focus",function(e){e.element.addClass("select2-results__option--highlighted")}),t.on("results:message",function(e){n.displayMessage(e)}),e.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=n.$results.scrollTop(),i=n.$results.get(0).scrollHeight-t+e.deltaY,r=e.deltaY>0&&t-e.deltaY<=0,o=e.deltaY<0&&i<=n.$results.height();r?(n.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):o&&(n.$results.scrollTop(n.$results.get(0).scrollHeight-n.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(t){var i=e(this),r=i.data("data");if("true"===i.attr("aria-selected"))return void(n.options.get("multiple")?n.trigger("unselect",{originalEvent:t,data:r}):n.trigger("close",{}));n.trigger("select",{originalEvent:t,data:r})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(){var t=e(this).data("data");n.getHighlightedResults().removeClass("select2-results__option--highlighted"),n.trigger("results:focus",{data:t,element:e(this)})})},n.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},n.prototype.destroy=function(){this.$results.remove()},n.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find("[aria-selected]"),n=t.index(e),i=this.$results.offset().top,r=e.offset().top,o=this.$results.scrollTop()+(r-i),s=r-i;o-=2*e.outerHeight(!1),n<=2?this.$results.scrollTop(0):(s>this.$results.outerHeight()||s<0)&&this.$results.scrollTop(o)}},n.prototype.template=function(t,n){var i=this.options.get("templateResult"),r=this.options.get("escapeMarkup"),o=i(t,n);null==o?n.style.display="none":"string"==typeof o?n.innerHTML=r(o):e(n).append(o)},n}),t.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),t.define("select2/selection/base",["jquery","../utils","../keys"],function(e,t,n){function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,t.Observable),i.prototype.render=function(){var t=e('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),t.attr("title",this.$element.attr("title")),t.attr("tabindex",this._tabindex),this.$selection=t,t},i.prototype.bind=function(e){var t=this,i=(e.id,e.id+"-results");this.container=e,this.$selection.on("focus",function(e){t.trigger("focus",e)}),this.$selection.on("blur",function(e){t._handleBlur(e)}),this.$selection.on("keydown",function(e){t.trigger("keypress",e),e.which===n.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){t.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){t.update(e.data)}),e.on("open",function(){t.$selection.attr("aria-expanded","true"),t.$selection.attr("aria-owns",i),t._attachCloseHandler(e)}),e.on("close",function(){t.$selection.attr("aria-expanded","false"),t.$selection.removeAttr("aria-activedescendant"),t.$selection.removeAttr("aria-owns"),t.$selection.focus(),t._detachCloseHandler(e)}),e.on("enable",function(){t.$selection.attr("tabindex",t._tabindex)}),e.on("disable",function(){t.$selection.attr("tabindex","-1")})},i.prototype._handleBlur=function(t){var n=this;window.setTimeout(function(){document.activeElement==n.$selection[0]||e.contains(n.$selection[0],document.activeElement)||n.trigger("blur",t)},1)},i.prototype._attachCloseHandler=function(t){e(document.body).on("mousedown.select2."+t.id,function(t){var n=e(t.target),i=n.closest(".select2");e(".select2.select2-container--open").each(function(){var t=e(this);this!=i[0]&&t.data("element").select2("close")})})},i.prototype._detachCloseHandler=function(t){e(document.body).off("mousedown.select2."+t.id)},i.prototype.position=function(e,t){t.find(".selection").append(e)},i.prototype.destroy=function(){this._detachCloseHandler(this.container)},i.prototype.update=function(){throw new Error("The `update` method must be defined in child classes.")},i}),t.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n){function i(){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},i.prototype.bind=function(e){var t=this;i.__super__.bind.apply(this,arguments);var n=e.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",n),this.$selection.attr("aria-labelledby",n),this.$selection.on("mousedown",function(e){1===e.which&&t.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(){}),this.$selection.on("blur",function(){}),e.on("focus",function(){e.isOpen()||t.$selection.focus()}),e.on("selection:update",function(e){t.update(e.data)})},i.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},i.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},i.prototype.selectionContainer=function(){return e("<span></span>")},i.prototype.update=function(e){if(0===e.length)return void this.clear();var t=e[0],n=this.$selection.find(".select2-selection__rendered"),i=this.display(t,n);n.empty().append(i),n.prop("title",t.title||t.text)},i}),t.define("select2/selection/multiple",["jquery","./base","../utils"],function(e,t,n){function i(){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('<ul class="select2-selection__rendered"></ul>'),e},i.prototype.bind=function(){var t=this;i.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){t.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(n){if(!t.options.get("disabled")){var i=e(this),r=i.parent(),o=r.data("data");t.trigger("unselect",{originalEvent:n,data:o})}})},i.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},i.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},i.prototype.selectionContainer=function(){return e('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>')},i.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],i=0;i<e.length;i++){var r=e[i],o=this.selectionContainer(),s=this.display(r,o);o.append(s),o.prop("title",r.title||r.text),o.data("data",r),t.push(o)}var a=this.$selection.find(".select2-selection__rendered");n.appendMany(a,t)}},i}),t.define("select2/selection/placeholder",["../utils"],function(){function e(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();return n.html(this.display(t)),n.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),n},e.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id;if(t.length>1||n)return e.call(this,t);this.clear();var i=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(i)},e}),t.define("select2/selection/allowClear",["jquery","../keys"],function(e,t){function n(){}return n.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(e){i._handleClear(e)}),t.on("keypress",function(e){i._handleKeyboardClear(e,t)})},n.prototype._handleClear=function(e,t){if(!this.options.get("disabled")){var n=this.$selection.find(".select2-selection__clear");if(0!==n.length){t.stopPropagation();for(var i=n.data("data"),r=0;r<i.length;r++){var o={data:i[r]};if(this.trigger("unselect",o),o.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},n.prototype._handleKeyboardClear=function(e,n,i){i.isOpen()||n.which!=t.DELETE&&n.which!=t.BACKSPACE||this._handleClear(n)},n.prototype.update=function(t,n){if(t.call(this,n),!(this.$selection.find(".select2-selection__placeholder").length>0||0===n.length)){var i=e('<span class="select2-selection__clear">&times;</span>');i.data("data",n),this.$selection.find(".select2-selection__rendered").prepend(i)}},n}),t.define("select2/selection/search",["jquery","../utils","../keys"],function(e,t,n){function i(e,t,n){e.call(this,t,n)}return i.prototype.render=function(t){var n=e('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=n,this.$search=n.find("input");var i=t.call(this);return this._transferTabIndex(),i},i.prototype.bind=function(e,t,i){var r=this;e.call(this,t,i),t.on("open",function(){r.$search.trigger("focus")}),t.on("close",function(){r.$search.val(""),r.$search.removeAttr("aria-activedescendant"),r.$search.trigger("focus")}),t.on("enable",function(){r.$search.prop("disabled",!1),r._transferTabIndex()}),t.on("disable",function(){r.$search.prop("disabled",!0)}),t.on("focus",function(){r.$search.trigger("focus")}),t.on("results:focus",function(e){r.$search.attr("aria-activedescendant",e.id)}),this.$selection.on("focusin",".select2-search--inline",function(e){r.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){r._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented(),e.which===n.BACKSPACE&&""===r.$search.val()){var t=r.$searchContainer.prev(".select2-selection__choice");if(t.length>0){var i=t.data("data");r.searchRemoveChoice(i),e.preventDefault()}}});var o=document.documentMode,s=o&&o<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(){if(s)return void r.$selection.off("input.search input.searchcheck");r.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(e){if(s&&"input"===e.type)return void r.$selection.off("input.search input.searchcheck");var t=e.which;t!=n.SHIFT&&t!=n.CTRL&&t!=n.ALT&&t!=n.TAB&&r.handleSearch(e)})},i.prototype._transferTabIndex=function(){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},i.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},i.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.focus()},i.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},i.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},i.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="";if(""!==this.$search.attr("placeholder"))e=this.$selection.find(".select2-selection__rendered").innerWidth();else{e=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",e)},i}),t.define("select2/selection/eventRelay",["jquery"],function(e){function t(){}return t.prototype.bind=function(t,n,i){var r=this,o=["open","opening","close","closing","select","selecting","unselect","unselecting"],s=["opening","closing","selecting","unselecting"];t.call(this,n,i),n.on("*",function(t,n){if(-1!==e.inArray(t,o)){n=n||{};var i=e.Event("select2:"+t,{params:n});r.$element.trigger(i),-1!==e.inArray(t,s)&&(n.prevented=i.isDefaultPrevented())}})},t}),t.define("select2/translation",["jquery","require"],function(e,t){function n(e){this.dict=e||{}}return n.prototype.all=function(){return this.dict},n.prototype.get=function(e){return this.dict[e]},n.prototype.extend=function(t){this.dict=e.extend({},t.all(),this.dict)},n._cache={},n.loadPath=function(e){if(!(e in n._cache)){var i=t(e);n._cache[e]=i}return new n(n._cache[e])},n}),t.define("select2/diacritics",[],function(){return{"\u24b6":"A","\uff21":"A","\xc0":"A","\xc1":"A","\xc2":"A","\u1ea6":"A","\u1ea4":"A","\u1eaa":"A","\u1ea8":"A","\xc3":"A","\u0100":"A","\u0102":"A","\u1eb0":"A","\u1eae":"A","\u1eb4":"A","\u1eb2":"A","\u0226":"A","\u01e0":"A","\xc4":"A","\u01de":"A","\u1ea2":"A","\xc5":"A","\u01fa":"A","\u01cd":"A","\u0200":"A","\u0202":"A","\u1ea0":"A","\u1eac":"A","\u1eb6":"A","\u1e00":"A","\u0104":"A","\u023a":"A","\u2c6f":"A","\ua732":"AA","\xc6":"AE","\u01fc":"AE","\u01e2":"AE","\ua734":"AO","\ua736":"AU","\ua738":"AV","\ua73a":"AV","\ua73c":"AY","\u24b7":"B","\uff22":"B","\u1e02":"B","\u1e04":"B","\u1e06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24b8":"C","\uff23":"C","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\xc7":"C","\u1e08":"C","\u0187":"C","\u023b":"C","\ua73e":"C","\u24b9":"D","\uff24":"D","\u1e0a":"D","\u010e":"D","\u1e0c":"D","\u1e10":"D","\u1e12":"D","\u1e0e":"D","\u0110":"D","\u018b":"D","\u018a":"D","\u0189":"D","\ua779":"D","\u01f1":"DZ","\u01c4":"DZ","\u01f2":"Dz","\u01c5":"Dz","\u24ba":"E","\uff25":"E","\xc8":"E","\xc9":"E","\xca":"E","\u1ec0":"E","\u1ebe":"E","\u1ec4":"E","\u1ec2":"E","\u1ebc":"E","\u0112":"E","\u1e14":"E","\u1e16":"E","\u0114":"E","\u0116":"E","\xcb":"E","\u1eba":"E","\u011a":"E","\u0204":"E","\u0206":"E","\u1eb8":"E","\u1ec6":"E","\u0228":"E","\u1e1c":"E","\u0118":"E","\u1e18":"E","\u1e1a":"E","\u0190":"E","\u018e":"E","\u24bb":"F","\uff26":"F","\u1e1e":"F","\u0191":"F","\ua77b":"F","\u24bc":"G","\uff27":"G","\u01f4":"G","\u011c":"G","\u1e20":"G","\u011e":"G","\u0120":"G","\u01e6":"G","\u0122":"G","\u01e4":"G","\u0193":"G","\ua7a0":"G","\ua77d":"G","\ua77e":"G","\u24bd":"H","\uff28":"H","\u0124":"H","\u1e22":"H","\u1e26":"H","\u021e":"H","\u1e24":"H","\u1e28":"H","\u1e2a":"H","\u0126":"H","\u2c67":"H","\u2c75":"H","\ua78d":"H","\u24be":"I","\uff29":"I","\xcc":"I","\xcd":"I","\xce":"I","\u0128":"I","\u012a":"I","\u012c":"I","\u0130":"I","\xcf":"I","\u1e2e":"I","\u1ec8":"I","\u01cf":"I","\u0208":"I","\u020a":"I","\u1eca":"I","\u012e":"I","\u1e2c":"I","\u0197":"I","\u24bf":"J","\uff2a":"J","\u0134":"J","\u0248":"J","\u24c0":"K","\uff2b":"K","\u1e30":"K","\u01e8":"K","\u1e32":"K","\u0136":"K","\u1e34":"K","\u0198":"K","\u2c69":"K","\ua740":"K","\ua742":"K","\ua744":"K","\ua7a2":"K","\u24c1":"L","\uff2c":"L","\u013f":"L","\u0139":"L","\u013d":"L","\u1e36":"L","\u1e38":"L","\u013b":"L","\u1e3c":"L","\u1e3a":"L","\u0141":"L","\u023d":"L","\u2c62":"L","\u2c60":"L","\ua748":"L","\ua746":"L","\ua780":"L","\u01c7":"LJ","\u01c8":"Lj","\u24c2":"M","\uff2d":"M","\u1e3e":"M","\u1e40":"M","\u1e42":"M","\u2c6e":"M","\u019c":"M","\u24c3":"N","\uff2e":"N","\u01f8":"N","\u0143":"N","\xd1":"N","\u1e44":"N","\u0147":"N","\u1e46":"N","\u0145":"N","\u1e4a":"N","\u1e48":"N","\u0220":"N","\u019d":"N","\ua790":"N","\ua7a4":"N","\u01ca":"NJ","\u01cb":"Nj","\u24c4":"O","\uff2f":"O","\xd2":"O","\xd3":"O","\xd4":"O","\u1ed2":"O","\u1ed0":"O","\u1ed6":"O","\u1ed4":"O","\xd5":"O","\u1e4c":"O","\u022c":"O","\u1e4e":"O","\u014c":"O","\u1e50":"O","\u1e52":"O","\u014e":"O","\u022e":"O","\u0230":"O","\xd6":"O","\u022a":"O","\u1ece":"O","\u0150":"O","\u01d1":"O","\u020c":"O","\u020e":"O","\u01a0":"O","\u1edc":"O","\u1eda":"O","\u1ee0":"O","\u1ede":"O","\u1ee2":"O","\u1ecc":"O","\u1ed8":"O","\u01ea":"O","\u01ec":"O","\xd8":"O","\u01fe":"O","\u0186":"O","\u019f":"O","\ua74a":"O","\ua74c":"O","\u01a2":"OI","\ua74e":"OO","\u0222":"OU","\u24c5":"P","\uff30":"P","\u1e54":"P","\u1e56":"P","\u01a4":"P","\u2c63":"P","\ua750":"P","\ua752":"P","\ua754":"P","\u24c6":"Q","\uff31":"Q","\ua756":"Q","\ua758":"Q","\u024a":"Q","\u24c7":"R","\uff32":"R","\u0154":"R","\u1e58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1e5a":"R","\u1e5c":"R","\u0156":"R","\u1e5e":"R","\u024c":"R","\u2c64":"R","\ua75a":"R","\ua7a6":"R","\ua782":"R","\u24c8":"S","\uff33":"S","\u1e9e":"S","\u015a":"S","\u1e64":"S","\u015c":"S","\u1e60":"S","\u0160":"S","\u1e66":"S","\u1e62":"S","\u1e68":"S","\u0218":"S","\u015e":"S","\u2c7e":"S","\ua7a8":"S","\ua784":"S","\u24c9":"T","\uff34":"T","\u1e6a":"T","\u0164":"T","\u1e6c":"T","\u021a":"T","\u0162":"T","\u1e70":"T","\u1e6e":"T","\u0166":"T","\u01ac":"T","\u01ae":"T","\u023e":"T","\ua786":"T","\ua728":"TZ","\u24ca":"U","\uff35":"U","\xd9":"U","\xda":"U","\xdb":"U","\u0168":"U","\u1e78":"U","\u016a":"U","\u1e7a":"U","\u016c":"U","\xdc":"U","\u01db":"U","\u01d7":"U","\u01d5":"U","\u01d9":"U","\u1ee6":"U","\u016e":"U","\u0170":"U","\u01d3":"U","\u0214":"U","\u0216":"U","\u01af":"U","\u1eea":"U","\u1ee8":"U","\u1eee":"U","\u1eec":"U","\u1ef0":"U","\u1ee4":"U","\u1e72":"U","\u0172":"U","\u1e76":"U","\u1e74":"U","\u0244":"U","\u24cb":"V","\uff36":"V","\u1e7c":"V","\u1e7e":"V","\u01b2":"V","\ua75e":"V","\u0245":"V","\ua760":"VY","\u24cc":"W","\uff37":"W","\u1e80":"W","\u1e82":"W","\u0174":"W","\u1e86":"W","\u1e84":"W","\u1e88":"W","\u2c72":"W","\u24cd":"X","\uff38":"X","\u1e8a":"X","\u1e8c":"X","\u24ce":"Y","\uff39":"Y","\u1ef2":"Y","\xdd":"Y","\u0176":"Y","\u1ef8":"Y","\u0232":"Y","\u1e8e":"Y","\u0178":"Y","\u1ef6":"Y","\u1ef4":"Y","\u01b3":"Y","\u024e":"Y","\u1efe":"Y","\u24cf":"Z","\uff3a":"Z","\u0179":"Z","\u1e90":"Z","\u017b":"Z","\u017d":"Z","\u1e92":"Z","\u1e94":"Z","\u01b5":"Z","\u0224":"Z","\u2c7f":"Z","\u2c6b":"Z","\ua762":"Z","\u24d0":"a","\uff41":"a","\u1e9a":"a","\xe0":"a","\xe1":"a","\xe2":"a","\u1ea7":"a","\u1ea5":"a","\u1eab":"a","\u1ea9":"a","\xe3":"a","\u0101":"a","\u0103":"a","\u1eb1":"a","\u1eaf":"a","\u1eb5":"a","\u1eb3":"a","\u0227":"a","\u01e1":"a","\xe4":"a","\u01df":"a","\u1ea3":"a","\xe5":"a","\u01fb":"a","\u01ce":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1ead":"a","\u1eb7":"a","\u1e01":"a","\u0105":"a","\u2c65":"a","\u0250":"a","\ua733":"aa","\xe6":"ae","\u01fd":"ae","\u01e3":"ae","\ua735":"ao","\ua737":"au","\ua739":"av","\ua73b":"av","\ua73d":"ay","\u24d1":"b","\uff42":"b","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24d2":"c","\uff43":"c","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\xe7":"c","\u1e09":"c","\u0188":"c","\u023c":"c","\ua73f":"c","\u2184":"c","\u24d3":"d","\uff44":"d","\u1e0b":"d","\u010f":"d","\u1e0d":"d","\u1e11":"d","\u1e13":"d","\u1e0f":"d","\u0111":"d","\u018c":"d","\u0256":"d","\u0257":"d","\ua77a":"d","\u01f3":"dz","\u01c6":"dz","\u24d4":"e","\uff45":"e","\xe8":"e","\xe9":"e","\xea":"e","\u1ec1":"e","\u1ebf":"e","\u1ec5":"e","\u1ec3":"e","\u1ebd":"e","\u0113":"e","\u1e15":"e","\u1e17":"e","\u0115":"e","\u0117":"e","\xeb":"e","\u1ebb":"e","\u011b":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u1e19":"e","\u1e1b":"e","\u0247":"e","\u025b":"e","\u01dd":"e","\u24d5":"f","\uff46":"f","\u1e1f":"f","\u0192":"f","\ua77c":"f","\u24d6":"g","\uff47":"g","\u01f5":"g","\u011d":"g","\u1e21":"g","\u011f":"g","\u0121":"g","\u01e7":"g","\u0123":"g","\u01e5":"g","\u0260":"g","\ua7a1":"g","\u1d79":"g","\ua77f":"g","\u24d7":"h","\uff48":"h","\u0125":"h","\u1e23":"h","\u1e27":"h","\u021f":"h","\u1e25":"h","\u1e29":"h","\u1e2b":"h","\u1e96":"h","\u0127":"h","\u2c68":"h","\u2c76":"h","\u0265":"h","\u0195":"hv","\u24d8":"i","\uff49":"i","\xec":"i","\xed":"i","\xee":"i","\u0129":"i","\u012b":"i","\u012d":"i","\xef":"i","\u1e2f":"i","\u1ec9":"i","\u01d0":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u012f":"i","\u1e2d":"i","\u0268":"i","\u0131":"i","\u24d9":"j","\uff4a":"j","\u0135":"j","\u01f0":"j","\u0249":"j","\u24da":"k","\uff4b":"k","\u1e31":"k","\u01e9":"k","\u1e33":"k","\u0137":"k","\u1e35":"k","\u0199":"k","\u2c6a":"k","\ua741":"k","\ua743":"k","\ua745":"k","\ua7a3":"k","\u24db":"l","\uff4c":"l","\u0140":"l","\u013a":"l","\u013e":"l","\u1e37":"l","\u1e39":"l","\u013c":"l","\u1e3d":"l","\u1e3b":"l","\u017f":"l","\u0142":"l","\u019a":"l","\u026b":"l","\u2c61":"l","\ua749":"l","\ua781":"l","\ua747":"l","\u01c9":"lj","\u24dc":"m","\uff4d":"m","\u1e3f":"m","\u1e41":"m","\u1e43":"m","\u0271":"m","\u026f":"m","\u24dd":"n","\uff4e":"n","\u01f9":"n","\u0144":"n","\xf1":"n","\u1e45":"n","\u0148":"n","\u1e47":"n","\u0146":"n","\u1e4b":"n","\u1e49":"n","\u019e":"n","\u0272":"n","\u0149":"n","\ua791":"n","\ua7a5":"n","\u01cc":"nj","\u24de":"o","\uff4f":"o","\xf2":"o","\xf3":"o","\xf4":"o","\u1ed3":"o","\u1ed1":"o","\u1ed7":"o","\u1ed5":"o","\xf5":"o","\u1e4d":"o","\u022d":"o","\u1e4f":"o","\u014d":"o","\u1e51":"o","\u1e53":"o","\u014f":"o","\u022f":"o","\u0231":"o","\xf6":"o","\u022b":"o","\u1ecf":"o","\u0151":"o","\u01d2":"o","\u020d":"o","\u020f":"o","\u01a1":"o","\u1edd":"o","\u1edb":"o","\u1ee1":"o","\u1edf":"o","\u1ee3":"o","\u1ecd":"o","\u1ed9":"o","\u01eb":"o","\u01ed":"o","\xf8":"o","\u01ff":"o","\u0254":"o","\ua74b":"o","\ua74d":"o","\u0275":"o","\u01a3":"oi","\u0223":"ou","\ua74f":"oo","\u24df":"p","\uff50":"p","\u1e55":"p","\u1e57":"p","\u01a5":"p","\u1d7d":"p","\ua751":"p","\ua753":"p","\ua755":"p","\u24e0":"q","\uff51":"q","\u024b":"q","\ua757":"q","\ua759":"q","\u24e1":"r","\uff52":"r","\u0155":"r","\u1e59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1e5b":"r","\u1e5d":"r","\u0157":"r","\u1e5f":"r",
159
+ "\u024d":"r","\u027d":"r","\ua75b":"r","\ua7a7":"r","\ua783":"r","\u24e2":"s","\uff53":"s","\xdf":"s","\u015b":"s","\u1e65":"s","\u015d":"s","\u1e61":"s","\u0161":"s","\u1e67":"s","\u1e63":"s","\u1e69":"s","\u0219":"s","\u015f":"s","\u023f":"s","\ua7a9":"s","\ua785":"s","\u1e9b":"s","\u24e3":"t","\uff54":"t","\u1e6b":"t","\u1e97":"t","\u0165":"t","\u1e6d":"t","\u021b":"t","\u0163":"t","\u1e71":"t","\u1e6f":"t","\u0167":"t","\u01ad":"t","\u0288":"t","\u2c66":"t","\ua787":"t","\ua729":"tz","\u24e4":"u","\uff55":"u","\xf9":"u","\xfa":"u","\xfb":"u","\u0169":"u","\u1e79":"u","\u016b":"u","\u1e7b":"u","\u016d":"u","\xfc":"u","\u01dc":"u","\u01d8":"u","\u01d6":"u","\u01da":"u","\u1ee7":"u","\u016f":"u","\u0171":"u","\u01d4":"u","\u0215":"u","\u0217":"u","\u01b0":"u","\u1eeb":"u","\u1ee9":"u","\u1eef":"u","\u1eed":"u","\u1ef1":"u","\u1ee5":"u","\u1e73":"u","\u0173":"u","\u1e77":"u","\u1e75":"u","\u0289":"u","\u24e5":"v","\uff56":"v","\u1e7d":"v","\u1e7f":"v","\u028b":"v","\ua75f":"v","\u028c":"v","\ua761":"vy","\u24e6":"w","\uff57":"w","\u1e81":"w","\u1e83":"w","\u0175":"w","\u1e87":"w","\u1e85":"w","\u1e98":"w","\u1e89":"w","\u2c73":"w","\u24e7":"x","\uff58":"x","\u1e8b":"x","\u1e8d":"x","\u24e8":"y","\uff59":"y","\u1ef3":"y","\xfd":"y","\u0177":"y","\u1ef9":"y","\u0233":"y","\u1e8f":"y","\xff":"y","\u1ef7":"y","\u1e99":"y","\u1ef5":"y","\u01b4":"y","\u024f":"y","\u1eff":"y","\u24e9":"z","\uff5a":"z","\u017a":"z","\u1e91":"z","\u017c":"z","\u017e":"z","\u1e93":"z","\u1e95":"z","\u01b6":"z","\u0225":"z","\u0240":"z","\u2c6c":"z","\ua763":"z","\u0386":"\u0391","\u0388":"\u0395","\u0389":"\u0397","\u038a":"\u0399","\u03aa":"\u0399","\u038c":"\u039f","\u038e":"\u03a5","\u03ab":"\u03a5","\u038f":"\u03a9","\u03ac":"\u03b1","\u03ad":"\u03b5","\u03ae":"\u03b7","\u03af":"\u03b9","\u03ca":"\u03b9","\u0390":"\u03b9","\u03cc":"\u03bf","\u03cd":"\u03c5","\u03cb":"\u03c5","\u03b0":"\u03c5","\u03c9":"\u03c9","\u03c2":"\u03c3"}}),t.define("select2/data/base",["../utils"],function(e){function t(){t.__super__.constructor.call(this)}return e.Extend(t,e.Observable),t.prototype.current=function(){throw new Error("The `current` method must be defined in child classes.")},t.prototype.query=function(){throw new Error("The `query` method must be defined in child classes.")},t.prototype.bind=function(){},t.prototype.destroy=function(){},t.prototype.generateResultId=function(t,n){var i=t.id+"-result-";return i+=e.generateChars(4),null!=n.id?i+="-"+n.id.toString():i+="-"+e.generateChars(4),i},t}),t.define("select2/data/select",["./base","../utils","jquery"],function(e,t,n){function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,e),i.prototype.current=function(e){var t=[],i=this;this.$element.find(":selected").each(function(){var e=n(this),r=i.item(e);t.push(r)}),e(t)},i.prototype.select=function(e){var t=this;if(e.selected=!0,n(e.element).is("option"))return e.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(i){var r=[];e=[e],e.push.apply(e,i);for(var o=0;o<e.length;o++){var s=e[o].id;-1===n.inArray(s,r)&&r.push(s)}t.$element.val(r),t.$element.trigger("change")});else{var i=e.id;this.$element.val(i),this.$element.trigger("change")}},i.prototype.unselect=function(e){var t=this;if(this.$element.prop("multiple")){if(e.selected=!1,n(e.element).is("option"))return e.element.selected=!1,void this.$element.trigger("change");this.current(function(i){for(var r=[],o=0;o<i.length;o++){var s=i[o].id;s!==e.id&&-1===n.inArray(s,r)&&r.push(s)}t.$element.val(r),t.$element.trigger("change")})}},i.prototype.bind=function(e){var t=this;this.container=e,e.on("select",function(e){t.select(e.data)}),e.on("unselect",function(e){t.unselect(e.data)})},i.prototype.destroy=function(){this.$element.find("*").each(function(){n.removeData(this,"data")})},i.prototype.query=function(e,t){var i=[],r=this;this.$element.children().each(function(){var t=n(this);if(t.is("option")||t.is("optgroup")){var o=r.item(t),s=r.matches(e,o);null!==s&&i.push(s)}}),t({results:i})},i.prototype.addOptions=function(e){t.appendMany(this.$element,e)},i.prototype.option=function(e){var t;e.children?(t=document.createElement("optgroup"),t.label=e.text):(t=document.createElement("option"),t.textContent!==undefined?t.textContent=e.text:t.innerText=e.text),e.id&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);var i=n(t),r=this._normalizeItem(e);return r.element=t,n.data(t,"data",r),i},i.prototype.item=function(e){var t={};if(null!=(t=n.data(e[0],"data")))return t;if(e.is("option"))t={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){t={text:e.prop("label"),children:[],title:e.prop("title")};for(var i=e.children("option"),r=[],o=0;o<i.length;o++){var s=n(i[o]),a=this.item(s);r.push(a)}t.children=r}return t=this._normalizeItem(t),t.element=e[0],n.data(e[0],"data",t),t},i.prototype._normalizeItem=function(e){n.isPlainObject(e)||(e={id:e,text:e}),e=n.extend({},{text:""},e);var t={selected:!1,disabled:!1};return null!=e.id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),n.extend({},t,e)},i.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},i}),t.define("select2/data/array",["./select","../utils","jquery"],function(e,t,n){function i(e,t){var n=t.get("data")||[];i.__super__.constructor.call(this,e,t),this.addOptions(this.convertToOptions(n))}return t.Extend(i,e),i.prototype.select=function(e){var t=this.$element.find("option").filter(function(t,n){return n.value==e.id.toString()});0===t.length&&(t=this.option(e),this.addOptions(t)),i.__super__.select.call(this,e)},i.prototype.convertToOptions=function(e){function i(e){return function(){return n(this).val()==e.id}}for(var r=this,o=this.$element.find("option"),s=o.map(function(){return r.item(n(this)).id}).get(),a=[],l=0;l<e.length;l++){var c=this._normalizeItem(e[l]);if(n.inArray(c.id,s)>=0){var u=o.filter(i(c)),d=this.item(u),p=n.extend(!0,{},c,d),h=this.option(p);u.replaceWith(h)}else{var f=this.option(c);if(c.children){var g=this.convertToOptions(c.children);t.appendMany(f,g)}a.push(f)}}return a},i}),t.define("select2/data/ajax",["./array","../utils","jquery"],function(e,t,n){function i(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),i.__super__.constructor.call(this,e,t)}return t.Extend(i,e),i.prototype._applyDefaults=function(e){var t={data:function(e){return n.extend({},e,{q:e.term})},transport:function(e,t,i){var r=n.ajax(e);return r.then(t),r.fail(i),r}};return n.extend({},t,e,!0)},i.prototype.processResults=function(e){return e},i.prototype.query=function(e,t){function i(){var i=o.transport(o,function(i){var o=r.processResults(i,e);r.options.get("debug")&&window.console&&console.error&&(o&&o.results&&n.isArray(o.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),t(o)},function(){i.status&&"0"===i.status||r.trigger("results:message",{message:"errorLoading"})});r._request=i}var r=this;null!=this._request&&(n.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var o=n.extend({type:"GET"},this.ajaxOptions);"function"==typeof o.url&&(o.url=o.url.call(this.$element,e)),"function"==typeof o.data&&(o.data=o.data.call(this.$element,e)),this.ajaxOptions.delay&&null!=e.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(i,this.ajaxOptions.delay)):i()},i}),t.define("select2/data/tags",["jquery"],function(e){function t(t,n,i){var r=i.get("tags"),o=i.get("createTag");o!==undefined&&(this.createTag=o);var s=i.get("insertTag");if(s!==undefined&&(this.insertTag=s),t.call(this,n,i),e.isArray(r))for(var a=0;a<r.length;a++){var l=r[a],c=this._normalizeItem(l),u=this.option(c);this.$element.append(u)}}return t.prototype.query=function(e,t,n){function i(e,o){for(var s=e.results,a=0;a<s.length;a++){var l=s[a],c=null!=l.children&&!i({results:l.children},!0);if(l.text===t.term||c)return!o&&(e.data=s,void n(e))}if(o)return!0;var u=r.createTag(t);if(null!=u){var d=r.option(u);d.attr("data-select2-tag",!0),r.addOptions([d]),r.insertTag(s,u)}e.results=s,n(e)}var r=this;if(this._removeOldTags(),null==t.term||null!=t.page)return void e.call(this,t,n);e.call(this,t,i)},t.prototype.createTag=function(t,n){var i=e.trim(n.term);return""===i?null:{id:i,text:i}},t.prototype.insertTag=function(e,t,n){t.unshift(n)},t.prototype._removeOldTags=function(){this._lastTag;this.$element.find("option[data-select2-tag]").each(function(){this.selected||e(this).remove()})},t}),t.define("select2/data/tokenizer",["jquery"],function(e){function t(e,t,n){var i=n.get("tokenizer");i!==undefined&&(this.tokenizer=i),e.call(this,t,n)}return t.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".select2-search__field")},t.prototype.query=function(t,n,i){function r(t){var n=s._normalizeItem(t);if(!s.$element.find("option").filter(function(){return e(this).val()===n.id}).length){var i=s.option(n);i.attr("data-select2-tag",!0),s._removeOldTags(),s.addOptions([i])}o(n)}function o(e){s.trigger("select",{data:e})}var s=this;n.term=n.term||"";var a=this.tokenizer(n,this.options,r);a.term!==n.term&&(this.$search.length&&(this.$search.val(a.term),this.$search.focus()),n.term=a.term),t.call(this,n,i)},t.prototype.tokenizer=function(t,n,i,r){for(var o=i.get("tokenSeparators")||[],s=n.term,a=0,l=this.createTag||function(e){return{id:e.term,text:e.term}};a<s.length;){var c=s[a];if(-1!==e.inArray(c,o)){var u=s.substr(0,a),d=e.extend({},n,{term:u}),p=l(d);null!=p?(r(p),s=s.substr(a+1)||"",a=0):a++}else a++}return{term:s}},t}),t.define("select2/data/minimumInputLength",[],function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){if(t.term=t.term||"",t.term.length<this.minimumInputLength)return void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}});e.call(this,t,n)},e}),t.define("select2/data/maximumInputLength",[],function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){if(t.term=t.term||"",this.maximumInputLength>0&&t.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}});e.call(this,t,n)},e}),t.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){var i=this;this.current(function(r){var o=null!=r?r.length:0;if(i.maximumSelectionLength>0&&o>=i.maximumSelectionLength)return void i.trigger("results:message",{message:"maximumSelected",args:{maximum:i.maximumSelectionLength}});e.call(i,t,n)})},e}),t.define("select2/dropdown",["jquery","./utils"],function(e,t){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<span class="select2-dropdown"><span class="select2-results"></span></span>');return t.attr("dir",this.options.get("dir")),this.$dropdown=t,t},n.prototype.bind=function(){},n.prototype.position=function(){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),t.define("select2/dropdown/search",["jquery","../utils"],function(e){function t(){}return t.prototype.render=function(t){var n=t.call(this),i=e('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=i,this.$search=i.find("input"),n.prepend(i),n},t.prototype.bind=function(t,n,i){var r=this;t.call(this,n,i),this.$search.on("keydown",function(e){r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(){e(this).off("keyup")}),this.$search.on("keyup input",function(e){r.handleSearch(e)}),n.on("open",function(){r.$search.attr("tabindex",0),r.$search.focus(),window.setTimeout(function(){r.$search.focus()},0)}),n.on("close",function(){r.$search.attr("tabindex",-1),r.$search.val("")}),n.on("focus",function(){n.isOpen()&&r.$search.focus()}),n.on("results:all",function(e){if(null==e.query.term||""===e.query.term){r.showSearch(e)?r.$searchContainer.removeClass("select2-search--hide"):r.$searchContainer.addClass("select2-search--hide")}})},t.prototype.handleSearch=function(){if(!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},t.prototype.showSearch=function(){return!0},t}),t.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;i>=0;i--){var r=t[i];this.placeholder.id===r.id&&n.splice(i,1)}return n},e}),t.define("select2/dropdown/infiniteScroll",["jquery"],function(e){function t(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return t.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&this.$results.append(this.$loadingMore)},t.prototype.bind=function(t,n,i){var r=this;t.call(this,n,i),n.on("query",function(e){r.lastParams=e,r.loading=!0}),n.on("query:append",function(e){r.lastParams=e,r.loading=!0}),this.$results.on("scroll",function(){var t=e.contains(document.documentElement,r.$loadingMore[0]);if(!r.loading&&t){r.$results.offset().top+r.$results.outerHeight(!1)+50>=r.$loadingMore.offset().top+r.$loadingMore.outerHeight(!1)&&r.loadMore()}})},t.prototype.loadMore=function(){this.loading=!0;var t=e.extend({},{page:1},this.lastParams);t.page++,this.trigger("query:append",t)},t.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},t.prototype.createLoadingMore=function(){var t=e('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),n=this.options.get("translations").get("loadingMore");return t.html(n(this.lastParams)),t},t}),t.define("select2/dropdown/attachBody",["jquery","../utils"],function(e,t){function n(t,n,i){this.$dropdownParent=i.get("dropdownParent")||e(document.body),t.call(this,n,i)}return n.prototype.bind=function(e,t,n){var i=this,r=!1;e.call(this,t,n),t.on("open",function(){i._showDropdown(),i._attachPositioningHandler(t),r||(r=!0,t.on("results:all",function(){i._positionDropdown(),i._resizeDropdown()}),t.on("results:append",function(){i._positionDropdown(),i._resizeDropdown()}))}),t.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},n.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},n.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},n.prototype.render=function(t){var n=e("<span></span>"),i=t.call(this);return n.append(i),this.$dropdownContainer=n,n},n.prototype._hideDropdown=function(){this.$dropdownContainer.detach()},n.prototype._attachPositioningHandler=function(n,i){var r=this,o="scroll.select2."+i.id,s="resize.select2."+i.id,a="orientationchange.select2."+i.id,l=this.$container.parents().filter(t.hasScroll);l.each(function(){e(this).data("select2-scroll-position",{x:e(this).scrollLeft(),y:e(this).scrollTop()})}),l.on(o,function(){var t=e(this).data("select2-scroll-position");e(this).scrollTop(t.y)}),e(window).on(o+" "+s+" "+a,function(){r._positionDropdown(),r._resizeDropdown()})},n.prototype._detachPositioningHandler=function(n,i){var r="scroll.select2."+i.id,o="resize.select2."+i.id,s="orientationchange.select2."+i.id;this.$container.parents().filter(t.hasScroll).off(r),e(window).off(r+" "+o+" "+s)},n.prototype._positionDropdown=function(){var t=e(window),n=this.$dropdown.hasClass("select2-dropdown--above"),i=this.$dropdown.hasClass("select2-dropdown--below"),r=null,o=this.$container.offset();o.bottom=o.top+this.$container.outerHeight(!1);var s={height:this.$container.outerHeight(!1)};s.top=o.top,s.bottom=o.top+s.height;var a={height:this.$dropdown.outerHeight(!1)},l={top:t.scrollTop(),bottom:t.scrollTop()+t.height()},c=l.top<o.top-a.height,u=l.bottom>o.bottom+a.height,d={left:o.left,top:s.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h=p.offset();d.top-=h.top,d.left-=h.left,n||i||(r="below"),u||!c||n?!c&&u&&n&&(r="below"):r="above",("above"==r||n&&"below"!==r)&&(d.top=s.top-h.top-a.height),null!=r&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+r),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+r)),this.$dropdownContainer.css(d)},n.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},n.prototype._showDropdown=function(){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},n}),t.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(t){for(var n=0,i=0;i<t.length;i++){var r=t[i];r.children?n+=e(r.children):n++}return n}function t(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=Infinity),e.call(this,t,n,i)}return t.prototype.showSearch=function(t,n){return!(e(n.data.results)<this.minimumResultsForSearch)&&t.call(this,n)},t}),t.define("select2/dropdown/selectOnClose",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("close",function(e){i._handleSelectOnClose(e)})},e.prototype._handleSelectOnClose=function(e,t){if(t&&null!=t.originalSelect2Event){var n=t.originalSelect2Event;if("select"===n._type||"unselect"===n._type)return}var i=this.getHighlightedResults();if(!(i.length<1)){var r=i.data("data");null!=r.element&&r.element.selected||null==r.element&&r.selected||this.trigger("select",{data:r})}},e}),t.define("select2/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",function(e){i._selectTriggered(e)}),t.on("unselect",function(e){i._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&n.ctrlKey||this.trigger("close",{originalEvent:n,originalSelect2Event:t})},e}),t.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return 1!=t&&(n+="s"),n},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results\u2026"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching\u2026"}}}),t.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(e,t,n,i,r,o,s,a,l,c,u,d,p,h,f,g,m,v,y,_,$,w,b,A,x,E,C,O,S){function T(){this.reset()}return T.prototype.apply=function(d){if(d=e.extend(!0,{},this.defaults,d),null==d.dataAdapter){if(null!=d.ajax?d.dataAdapter=f:null!=d.data?d.dataAdapter=h:d.dataAdapter=p,d.minimumInputLength>0&&(d.dataAdapter=c.Decorate(d.dataAdapter,v)),d.maximumInputLength>0&&(d.dataAdapter=c.Decorate(d.dataAdapter,y)),d.maximumSelectionLength>0&&(d.dataAdapter=c.Decorate(d.dataAdapter,_)),d.tags&&(d.dataAdapter=c.Decorate(d.dataAdapter,g)),null==d.tokenSeparators&&null==d.tokenizer||(d.dataAdapter=c.Decorate(d.dataAdapter,m)),null!=d.query){var S=t(d.amdBase+"compat/query");d.dataAdapter=c.Decorate(d.dataAdapter,S)}if(null!=d.initSelection){var T=t(d.amdBase+"compat/initSelection");d.dataAdapter=c.Decorate(d.dataAdapter,T)}}if(null==d.resultsAdapter&&(d.resultsAdapter=n,null!=d.ajax&&(d.resultsAdapter=c.Decorate(d.resultsAdapter,A)),null!=d.placeholder&&(d.resultsAdapter=c.Decorate(d.resultsAdapter,b)),d.selectOnClose&&(d.resultsAdapter=c.Decorate(d.resultsAdapter,C))),null==d.dropdownAdapter){if(d.multiple)d.dropdownAdapter=$;else{var D=c.Decorate($,w);d.dropdownAdapter=D}if(0!==d.minimumResultsForSearch&&(d.dropdownAdapter=c.Decorate(d.dropdownAdapter,E)),d.closeOnSelect&&(d.dropdownAdapter=c.Decorate(d.dropdownAdapter,O)),null!=d.dropdownCssClass||null!=d.dropdownCss||null!=d.adaptDropdownCssClass){var q=t(d.amdBase+"compat/dropdownCss");d.dropdownAdapter=c.Decorate(d.dropdownAdapter,q)}d.dropdownAdapter=c.Decorate(d.dropdownAdapter,x)}if(null==d.selectionAdapter){if(d.multiple?d.selectionAdapter=r:d.selectionAdapter=i,null!=d.placeholder&&(d.selectionAdapter=c.Decorate(d.selectionAdapter,o)),d.allowClear&&(d.selectionAdapter=c.Decorate(d.selectionAdapter,s)),d.multiple&&(d.selectionAdapter=c.Decorate(d.selectionAdapter,a)),null!=d.containerCssClass||null!=d.containerCss||null!=d.adaptContainerCssClass){var L=t(d.amdBase+"compat/containerCss");d.selectionAdapter=c.Decorate(d.selectionAdapter,L)}d.selectionAdapter=c.Decorate(d.selectionAdapter,l)}if("string"==typeof d.language)if(d.language.indexOf("-")>0){var j=d.language.split("-"),P=j[0];d.language=[d.language,P]}else d.language=[d.language];if(e.isArray(d.language)){var k=new u;d.language.push("en");for(var I=d.language,R=0;R<I.length;R++){var M=I[R],U={};try{U=u.loadPath(M)}catch(e){try{M=this.defaults.amdLanguageBase+M,U=u.loadPath(M)}catch(e){d.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}k.extend(U)}d.translations=k}else{var H=u.loadPath(this.defaults.amdLanguageBase+"en"),z=new u(d.language);z.extend(H),d.translations=z}return d},T.prototype.reset=function(){function t(e){function t(e){return d[e]||e}return e.replace(/[^\u0000-\u007E]/g,t)}function n(i,r){if(""===e.trim(i.term))return r;if(r.children&&r.children.length>0){for(var o=e.extend(!0,{},r),s=r.children.length-1;s>=0;s--){null==n(i,r.children[s])&&o.children.splice(s,1)}return o.children.length>0?o:n(i,o)}var a=t(r.text).toUpperCase(),l=t(i.term).toUpperCase();return a.indexOf(l)>-1?r:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:c.escapeMarkup,language:S,matcher:n,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},T.prototype.set=function(t,n){var i=e.camelCase(t),r={};r[i]=n;var o=c._convertData(r);e.extend(this.defaults,o)},new T}),t.define("select2/options",["require","jquery","./defaults","./utils"],function(e,t,n,i){function r(t,r){if(this.options=t,null!=r&&this.fromElement(r),this.options=n.apply(this.options),r&&r.is("input")){var o=e(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=i.Decorate(this.options.dataAdapter,o)}}return r.prototype.fromElement=function(e){var n=["select2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.language&&(e.prop("lang")?this.options.language=e.prop("lang").toLowerCase():e.closest("[lang]").prop("lang")&&(this.options.language=e.closest("[lang]").prop("lang"))),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),e.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),e.data("data",e.data("select2Tags")),e.data("tags",!0)),e.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",e.data("ajaxUrl")),e.data("ajax--url",e.data("ajaxUrl")));var r={};r=t.fn.jquery&&"1."==t.fn.jquery.substr(0,2)&&e[0].dataset?t.extend(!0,{},e[0].dataset,e.data()):e.data();var o=t.extend(!0,{},r);o=i._convertData(o);for(var s in o)t.inArray(s,n)>-1||(t.isPlainObject(this.options[s])?t.extend(this.options[s],o[s]):this.options[s]=o[s]);return this},r.prototype.get=function(e){return this.options[e]},r.prototype.set=function(e,t){this.options[e]=t},r}),t.define("select2/core",["jquery","./options","./utils","./keys"],function(e,t,n,i){var r=function(e,n){null!=e.data("select2")&&e.data("select2").destroy(),this.$element=e,this.id=this._generateId(e),n=n||{},this.options=new t(n,e),r.__super__.constructor.call(this);var i=e.attr("tabindex")||0;e.data("old-tabindex",i),e.attr("tabindex","-1");var o=this.options.get("dataAdapter");this.dataAdapter=new o(e,this.options);var s=this.render();this._placeContainer(s);var a=this.options.get("selectionAdapter");this.selection=new a(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,s);var l=this.options.get("dropdownAdapter");this.dropdown=new l(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,s);var c=this.options.get("resultsAdapter");this.results=new c(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var u=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){u.trigger("selection:update",{data:e})}),e.addClass("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),e.data("select2",this)};return n.Extend(r,n.Observable),r.prototype._generateId=function(e){var t="";return t=null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+n.generateChars(2):n.generateChars(4),t=t.replace(/(:|\.|\[|\]|,)/g,""),t="select2-"+t},r.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},r.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var i=this._resolveWidth(e,"style");return null!=i?i:this._resolveWidth(e,"element")}if("element"==t){var r=e.outerWidth(!1);return r<=0?"auto":r+"px"}if("style"==t){var o=e.attr("style");if("string"!=typeof o)return null;for(var s=o.split(";"),a=0,l=s.length;a<l;a+=1){var c=s[a].replace(/\s/g,""),u=c.match(n);if(null!==u&&u.length>=1)return u[1]}return null}return t},r.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},r.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.select2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this.$element.on("focus.select2",function(e){t.trigger("focus",e)}),this._syncA=n.bind(this._syncAttributes,this),this._syncS=n.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var i=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=i?(this._observer=new i(function(n){e.each(n,t._syncA),e.each(n,t._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",t._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",t._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",t._syncS,!1))},r.prototype._registerDataEvents=function(){var e=this;this.dataAdapter.on("*",function(t,n){e.trigger(t,n)})},r.prototype._registerSelectionEvents=function(){var t=this,n=["toggle","focus"];this.selection.on("toggle",function(){t.toggleDropdown()}),this.selection.on("focus",function(e){t.focus(e)}),this.selection.on("*",function(i,r){-1===e.inArray(i,n)&&t.trigger(i,r)})},r.prototype._registerDropdownEvents=function(){var e=this;this.dropdown.on("*",function(t,n){e.trigger(t,n)})},r.prototype._registerResultsEvents=function(){var e=this;this.results.on("*",function(t,n){e.trigger(t,n)})},r.prototype._registerEvents=function(){var e=this;this.on("open",function(){e.$container.addClass("select2-container--open")}),this.on("close",function(){e.$container.removeClass("select2-container--open")}),this.on("enable",function(){e.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){e.$container.addClass("select2-container--disabled")}),this.on("blur",function(){e.$container.removeClass("select2-container--focus")}),this.on("query",function(t){e.isOpen()||e.trigger("open",{}),this.dataAdapter.query(t,function(n){e.trigger("results:all",{data:n,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(n){e.trigger("results:append",{data:n,query:t})})}),this.on("keypress",function(t){var n=t.which;e.isOpen()?n===i.ESC||n===i.TAB||n===i.UP&&t.altKey?(e.close(),t.preventDefault()):n===i.ENTER?(e.trigger("results:select",{}),t.preventDefault()):n===i.SPACE&&t.ctrlKey?(e.trigger("results:toggle",{}),t.preventDefault()):n===i.UP?(e.trigger("results:previous",{}),t.preventDefault()):n===i.DOWN&&(e.trigger("results:next",{}),t.preventDefault()):(n===i.ENTER||n===i.SPACE||n===i.DOWN&&t.altKey)&&(e.open(),t.preventDefault())})},r.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},r.prototype._syncSubtree=function(e,t){var n=!1,i=this;if(!e||!e.target||"OPTION"===e.target.nodeName||"OPTGROUP"===e.target.nodeName){if(t)if(t.addedNodes&&t.addedNodes.length>0)for(var r=0;r<t.addedNodes.length;r++){var o=t.addedNodes[r];o.selected&&(n=!0)}else t.removedNodes&&t.removedNodes.length>0&&(n=!0);else n=!0;n&&this.dataAdapter.current(function(e){i.trigger("selection:update",{data:e})})}},r.prototype.trigger=function(e,t){var n=r.__super__.trigger,i={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(t===undefined&&(t={}),e in i){var o=i[e],s={prevented:!1,name:e,args:t};if(n.call(this,o,s),s.prevented)return void(t.prevented=!0)}n.call(this,e,t)},r.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},r.prototype.open=function(){this.isOpen()||this.trigger("query",{})},r.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},r.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},r.prototype.hasFocus=function(){
160
+ return this.$container.hasClass("select2-container--focus")},r.prototype.focus=function(){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},r.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},r.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var e=[];return this.dataAdapter.current(function(t){e=t}),e},r.prototype.val=function(t){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==t||0===t.length)return this.$element.val();var n=t[0];e.isArray(n)&&(n=e.map(n,function(e){return e.toString()})),this.$element.val(n).trigger("change")},r.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},r.prototype.render=function(){var t=e('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return t.attr("dir",this.options.get("dir")),this.$container=t,this.$container.addClass("select2-container--"+this.options.get("theme")),t.data("element",this.$element),t},r}),t.define("jquery-mousewheel",["jquery"],function(e){return e}),t.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(e,t,n,i){if(null==e.fn.select2){var r=["open","close","destroy"];e.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var i=e.extend(!0,{},t);new n(e(this),i)}),this;if("string"==typeof t){var i,o=Array.prototype.slice.call(arguments,1);return this.each(function(){var n=e(this).data("select2");null==n&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),i=n[t].apply(n,o)}),e.inArray(t,r)>-1?this:i}throw new Error("Invalid arguments for Select2: "+t)}}return null==e.fn.select2.defaults&&(e.fn.select2.defaults=i),n}),{define:t.define,require:t.require}}(),n=t.require("jquery.select2");return e.fn.select2.amd=t,n});
161
+ //script: load select2
162
+ (function(){decko.slotReady(function(t){return t.find("select:not(._no-select2)").each(function(){return $(this).select2()})})}).call(this);
@@ -0,0 +1,2 @@
1
+ //script: html5shiv printshiv
2
+ !function(e,t){function n(e,t){var n=e.createElement("p"),r=e.getElementsByTagName("head")[0]||e.documentElement;return n.innerHTML="x<style>"+t+"</style>",r.insertBefore(n.lastChild,r.firstChild)}function r(){var e=T.elements;return"string"==typeof e?e.split(" "):e}function a(e){var t=N[e[b]];return t||(t={},S++,e[b]=S,N[S]=t),t}function o(e,n,r){if(n||(n=t),p)return n.createElement(e);r||(r=a(n));var o;return o=r.cache[e]?r.cache[e].cloneNode():E.test(e)?(r.cache[e]=r.createElem(e)).cloneNode():r.createElem(e),o.canHaveChildren&&!y.test(e)?r.frag.appendChild(o):o}function i(e,n){if(e||(e=t),p)return e.createDocumentFragment();n=n||a(e);for(var o=n.frag.cloneNode(),i=0,c=r(),l=c.length;l>i;i++)o.createElement(c[i]);return o}function c(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag()),e.createElement=function(n){return T.shivMethods?o(n,e,t):t.createElem(n)},e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+r().join().replace(/\w+/g,function(e){return t.createElem(e),t.frag.createElement(e),'c("'+e+'")'})+");return n}")(T,t.frag)}function l(e){e||(e=t);var r=a(e);return!T.shivCSS||h||r.hasCSS||(r.hasCSS=!!n(e,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),p||c(e,r),e}function u(e){for(var t,n=e.getElementsByTagName("*"),a=n.length,o=RegExp("^(?:"+r().join("|")+")$","i"),i=[];a--;)t=n[a],o.test(t.nodeName)&&i.push(t.applyElement(s(t)));return i}function s(e){for(var t,n=e.attributes,r=n.length,a=e.ownerDocument.createElement(x+":"+e.nodeName);r--;)t=n[r],t.specified&&a.setAttribute(t.nodeName,t.nodeValue);return a.style.cssText=e.style.cssText,a}function m(e){for(var t,n=e.split("{"),a=n.length,o=RegExp("(^|[\\s,>+~])("+r().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),i="$1"+x+"\\:$2";a--;)t=n[a]=n[a].split("}"),t[t.length-1]=t[t.length-1].replace(o,i),n[a]=t.join("}");return n.join("{")}function d(e){for(var t=e.length;t--;)e[t].removeNode()}function f(e){function t(){clearTimeout(i._removeSheetTimer),r&&r.removeNode(!0),r=null}var r,o,i=a(e),c=e.namespaces,l=e.parentWindow;return!C||e.printShived?e:("undefined"==typeof c[x]&&c.add(x),l.attachEvent("onbeforeprint",function(){t();for(var a,i,c,l=e.styleSheets,s=[],d=l.length,f=Array(d);d--;)f[d]=l[d];for(;c=f.pop();)if(!c.disabled&&F.test(c.media)){try{a=c.imports,i=a.length}catch(e){i=0}for(d=0;i>d;d++)f.push(a[d]);try{s.push(c.cssText)}catch(e){}}s=m(s.reverse().join("")),o=u(e),r=n(e,s)}),l.attachEvent("onafterprint",function(){d(o),clearTimeout(i._removeSheetTimer),i._removeSheetTimer=setTimeout(t,500)}),e.printShived=!0,e)}var h,p,v="3.6.2",g=e.html5||{},y=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,E=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,b="_html5shiv",S=0,N={};!function(){try{var e=t.createElement("a");e.innerHTML="<xyz></xyz>",h="hidden"in e,p=1==e.childNodes.length||function(){t.createElement("a");var e=t.createDocumentFragment();return"undefined"==typeof e.cloneNode||"undefined"==typeof e.createDocumentFragment||"undefined"==typeof e.createElement}()}catch(e){h=!0,p=!0}}();var T={elements:g.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:v,shivCSS:!1!==g.shivCSS,supportsUnknownElements:p,shivMethods:!1!==g.shivMethods,type:"default",shivDocument:l,createElement:o,createDocumentFragment:i};e.html5=T,l(t);var F=/^$|\b(?:all|print)\b/,x="html5shiv",C=!p&&function(){var n=t.documentElement;return!("undefined"==typeof t.namespaces||"undefined"==typeof t.parentWindow||"undefined"==typeof n.applyElement||"undefined"==typeof n.removeNode||"undefined"==typeof e.attachEvent)}();T.type+=" print",T.shivPrint=f,f(t)}(this,document);
@@ -0,0 +1,49 @@
1
+ class Card
2
+ module Machine
3
+ class << self
4
+ def refresh_script_and_style
5
+ update_if_source_file_changed Card[:all, :script]
6
+ update_if_source_file_changed Card[:all, :style]
7
+ end
8
+
9
+ private
10
+
11
+ # regenerates the machine output if a source file of a input card
12
+ # has been changed
13
+ def update_if_source_file_changed machine_card
14
+ return unless machine_card
15
+ mtime_output = machine_card.machine_output_card.updated_at
16
+ return unless mtime_output
17
+ regenerate = false
18
+ input_cards_with_source_files(machine_card) do |i_card, files|
19
+ files.each do |path|
20
+ next unless File.mtime(path) > mtime_output
21
+ i_card.expire_machine_cache
22
+ regenerate = true
23
+ break
24
+ end
25
+ end
26
+ return unless regenerate
27
+ machine_card.regenerate_machine_output
28
+ end
29
+
30
+ def input_cards_with_source_files card
31
+ card.machine_input_card.extended_item_cards.each do |i_card|
32
+ next unless i_card.codename
33
+ next unless i_card.respond_to?(:existing_source_paths)
34
+ yield i_card, i_card.existing_source_paths
35
+ end
36
+ end
37
+
38
+ def source_files card
39
+ files = []
40
+ card.machine_input_card.extended_item_cards.each do |i_card|
41
+ next unless i_card.codename
42
+ next unless i_card.respond_to?(:existing_source_paths)
43
+ files << i_card.existing_source_paths
44
+ end
45
+ files.flatten
46
+ end
47
+ end
48
+ end
49
+ end