diff --git a/.gitmodules b/.gitmodules index e4fbbd12c1..6c10f92ce2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -19,11 +19,11 @@ [submodule "card/mod/machines/vendor/jquery_rails"] path = card/mod/machines/vendor/jquery_rails url = https://github.com/rails/jquery-rails -[submodule "card/mod/date/vendor/moment"] - path = card/mod/date/vendor/moment +[submodule "card/gem_mods/date/vendor/moment"] + path = card/gem_mods/date/vendor/moment url = https://github.com/moment/moment -[submodule "card/mod/date/vendor/tempusdominus"] - path = card/mod/date/vendor/tempusdominus +[submodule "card/gem_mods/date/vendor/tempusdominus"] + path = card/gem_mods/date/vendor/tempusdominus url = https://github.com/tempusdominus/bootstrap-4 [submodule "card/mod/machines/vendor/jquery_file_upload"] path = card/mod/machines/vendor/jquery_file_upload diff --git a/card/card.gemspec b/card/card.gemspec index 67d56f8982..91511f8792 100644 --- a/card/card.gemspec +++ b/card/card.gemspec @@ -37,6 +37,14 @@ Gem::Specification.new do |s| [ ["cardname", version], + + # card modules in decko core gems: + ["card-mod-date", "~>0.1"], + ["card-mod-edit", "~>0.1"], + ["card-mod-ace_editor", "~>0.1"], + ["card-mod-prosemirror_editor", "~>0.1"], + ["card-mod-tinymce_editor", "~>0.1"], + ["haml", "~> 5.0"], # markup language used in view API ["jwt", "~> 2.2"], # used in token.rb ["uuid", "~> 2.3"], # universally unique identifier. diff --git a/card/gem_mods/ace_editor/card-mod-ace_editor.gemspec b/card/gem_mods/ace_editor/card-mod-ace_editor.gemspec new file mode 100644 index 0000000000..122e534dab --- /dev/null +++ b/card/gem_mods/ace_editor/card-mod-ace_editor.gemspec @@ -0,0 +1,21 @@ +# -*- encoding : utf-8 -*- + +Gem::Specification.new do |s| + s.name = "card-mod-ace_editor" + s.version = "0.1" + + s.authors = ["Ethan McCutchen", "Philipp Kühl"] + s.email = ["info@decko.org"] + + s.summary = "Calendar editor" + s.description = "" + s.homepage = "http://decko.org" + s.licenses = ["GPL-2.0", "GPL-3.0"] + + s.files = Dir["VERSION", "README.rdoc", "LICENSE", "GPL", ".yardopts", + "{config,db,lib,set}/**/*"] + + s.required_ruby_version = ">= 2.3.0" + s.metadata = { "card-mod" => "ace_editor" } + s.add_runtime_dependency "card-mod-edit", "~> 0.1" +end diff --git a/card/mod/ace_editor/db/migrate_core_cards/20160804112538_add_ace_cards.rb b/card/gem_mods/ace_editor/db/migrate_core_cards/20160804112538_add_ace_cards.rb similarity index 100% rename from card/mod/ace_editor/db/migrate_core_cards/20160804112538_add_ace_cards.rb rename to card/gem_mods/ace_editor/db/migrate_core_cards/20160804112538_add_ace_cards.rb diff --git a/card/mod/ace_editor/db/migrate_core_cards/20180805112548_delete_ace_help_card.rb b/card/gem_mods/ace_editor/db/migrate_core_cards/20180805112548_delete_ace_help_card.rb similarity index 100% rename from card/mod/ace_editor/db/migrate_core_cards/20180805112548_delete_ace_help_card.rb rename to card/gem_mods/ace_editor/db/migrate_core_cards/20180805112548_delete_ace_help_card.rb diff --git a/card/mod/ace_editor/lib/javascript/script_ace.js b/card/gem_mods/ace_editor/lib/javascript/script_ace.js similarity index 100% rename from card/mod/ace_editor/lib/javascript/script_ace.js rename to card/gem_mods/ace_editor/lib/javascript/script_ace.js diff --git a/card/mod/ace_editor/lib/javascript/script_ace_config.js.coffee b/card/gem_mods/ace_editor/lib/javascript/script_ace_config.js.coffee similarity index 100% rename from card/mod/ace_editor/lib/javascript/script_ace_config.js.coffee rename to card/gem_mods/ace_editor/lib/javascript/script_ace_config.js.coffee diff --git a/card/mod/ace_editor/public/assets/ace/ext-beautify.js b/card/gem_mods/ace_editor/public/assets/ace/ext-beautify.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/ext-beautify.js rename to card/gem_mods/ace_editor/public/assets/ace/ext-beautify.js diff --git a/card/mod/ace_editor/public/assets/ace/ext-elastic_tabstops_lite.js b/card/gem_mods/ace_editor/public/assets/ace/ext-elastic_tabstops_lite.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/ext-elastic_tabstops_lite.js rename to card/gem_mods/ace_editor/public/assets/ace/ext-elastic_tabstops_lite.js diff --git a/card/mod/ace_editor/public/assets/ace/ext-emmet.js b/card/gem_mods/ace_editor/public/assets/ace/ext-emmet.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/ext-emmet.js rename to card/gem_mods/ace_editor/public/assets/ace/ext-emmet.js diff --git a/card/mod/ace_editor/public/assets/ace/ext-error_marker.js b/card/gem_mods/ace_editor/public/assets/ace/ext-error_marker.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/ext-error_marker.js rename to card/gem_mods/ace_editor/public/assets/ace/ext-error_marker.js diff --git a/card/mod/ace_editor/public/assets/ace/ext-keybinding_menu.js b/card/gem_mods/ace_editor/public/assets/ace/ext-keybinding_menu.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/ext-keybinding_menu.js rename to card/gem_mods/ace_editor/public/assets/ace/ext-keybinding_menu.js diff --git a/card/mod/ace_editor/public/assets/ace/ext-language_tools.js b/card/gem_mods/ace_editor/public/assets/ace/ext-language_tools.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/ext-language_tools.js rename to card/gem_mods/ace_editor/public/assets/ace/ext-language_tools.js diff --git a/card/mod/ace_editor/public/assets/ace/ext-linking.js b/card/gem_mods/ace_editor/public/assets/ace/ext-linking.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/ext-linking.js rename to card/gem_mods/ace_editor/public/assets/ace/ext-linking.js diff --git a/card/mod/ace_editor/public/assets/ace/ext-modelist.js b/card/gem_mods/ace_editor/public/assets/ace/ext-modelist.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/ext-modelist.js rename to card/gem_mods/ace_editor/public/assets/ace/ext-modelist.js diff --git a/card/mod/ace_editor/public/assets/ace/ext-options.js b/card/gem_mods/ace_editor/public/assets/ace/ext-options.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/ext-options.js rename to card/gem_mods/ace_editor/public/assets/ace/ext-options.js diff --git a/card/mod/ace_editor/public/assets/ace/ext-searchbox.js b/card/gem_mods/ace_editor/public/assets/ace/ext-searchbox.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/ext-searchbox.js rename to card/gem_mods/ace_editor/public/assets/ace/ext-searchbox.js diff --git a/card/mod/ace_editor/public/assets/ace/ext-settings_menu.js b/card/gem_mods/ace_editor/public/assets/ace/ext-settings_menu.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/ext-settings_menu.js rename to card/gem_mods/ace_editor/public/assets/ace/ext-settings_menu.js diff --git a/card/mod/ace_editor/public/assets/ace/ext-spellcheck.js b/card/gem_mods/ace_editor/public/assets/ace/ext-spellcheck.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/ext-spellcheck.js rename to card/gem_mods/ace_editor/public/assets/ace/ext-spellcheck.js diff --git a/card/mod/ace_editor/public/assets/ace/ext-split.js b/card/gem_mods/ace_editor/public/assets/ace/ext-split.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/ext-split.js rename to card/gem_mods/ace_editor/public/assets/ace/ext-split.js diff --git a/card/mod/ace_editor/public/assets/ace/ext-static_highlight.js b/card/gem_mods/ace_editor/public/assets/ace/ext-static_highlight.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/ext-static_highlight.js rename to card/gem_mods/ace_editor/public/assets/ace/ext-static_highlight.js diff --git a/card/mod/ace_editor/public/assets/ace/ext-statusbar.js b/card/gem_mods/ace_editor/public/assets/ace/ext-statusbar.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/ext-statusbar.js rename to card/gem_mods/ace_editor/public/assets/ace/ext-statusbar.js diff --git a/card/mod/ace_editor/public/assets/ace/ext-textarea.js b/card/gem_mods/ace_editor/public/assets/ace/ext-textarea.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/ext-textarea.js rename to card/gem_mods/ace_editor/public/assets/ace/ext-textarea.js diff --git a/card/mod/ace_editor/public/assets/ace/ext-themelist.js b/card/gem_mods/ace_editor/public/assets/ace/ext-themelist.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/ext-themelist.js rename to card/gem_mods/ace_editor/public/assets/ace/ext-themelist.js diff --git a/card/mod/ace_editor/public/assets/ace/ext-whitespace.js b/card/gem_mods/ace_editor/public/assets/ace/ext-whitespace.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/ext-whitespace.js rename to card/gem_mods/ace_editor/public/assets/ace/ext-whitespace.js diff --git a/card/mod/ace_editor/public/assets/ace/keybinding-emacs.js b/card/gem_mods/ace_editor/public/assets/ace/keybinding-emacs.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/keybinding-emacs.js rename to card/gem_mods/ace_editor/public/assets/ace/keybinding-emacs.js diff --git a/card/mod/ace_editor/public/assets/ace/keybinding-vim.js b/card/gem_mods/ace_editor/public/assets/ace/keybinding-vim.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/keybinding-vim.js rename to card/gem_mods/ace_editor/public/assets/ace/keybinding-vim.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-abap.js b/card/gem_mods/ace_editor/public/assets/ace/mode-abap.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-abap.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-abap.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-abc.js b/card/gem_mods/ace_editor/public/assets/ace/mode-abc.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-abc.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-abc.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-actionscript.js b/card/gem_mods/ace_editor/public/assets/ace/mode-actionscript.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-actionscript.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-actionscript.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-ada.js b/card/gem_mods/ace_editor/public/assets/ace/mode-ada.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-ada.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-ada.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-apache_conf.js b/card/gem_mods/ace_editor/public/assets/ace/mode-apache_conf.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-apache_conf.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-apache_conf.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-applescript.js b/card/gem_mods/ace_editor/public/assets/ace/mode-applescript.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-applescript.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-applescript.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-asciidoc.js b/card/gem_mods/ace_editor/public/assets/ace/mode-asciidoc.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-asciidoc.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-asciidoc.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-asl.js b/card/gem_mods/ace_editor/public/assets/ace/mode-asl.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-asl.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-asl.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-assembly_x86.js b/card/gem_mods/ace_editor/public/assets/ace/mode-assembly_x86.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-assembly_x86.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-assembly_x86.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-autohotkey.js b/card/gem_mods/ace_editor/public/assets/ace/mode-autohotkey.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-autohotkey.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-autohotkey.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-batchfile.js b/card/gem_mods/ace_editor/public/assets/ace/mode-batchfile.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-batchfile.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-batchfile.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-bro.js b/card/gem_mods/ace_editor/public/assets/ace/mode-bro.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-bro.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-bro.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-c9search.js b/card/gem_mods/ace_editor/public/assets/ace/mode-c9search.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-c9search.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-c9search.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-c_cpp.js b/card/gem_mods/ace_editor/public/assets/ace/mode-c_cpp.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-c_cpp.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-c_cpp.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-cirru.js b/card/gem_mods/ace_editor/public/assets/ace/mode-cirru.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-cirru.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-cirru.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-clojure.js b/card/gem_mods/ace_editor/public/assets/ace/mode-clojure.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-clojure.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-clojure.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-cobol.js b/card/gem_mods/ace_editor/public/assets/ace/mode-cobol.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-cobol.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-cobol.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-coffee.js b/card/gem_mods/ace_editor/public/assets/ace/mode-coffee.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-coffee.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-coffee.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-coldfusion.js b/card/gem_mods/ace_editor/public/assets/ace/mode-coldfusion.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-coldfusion.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-coldfusion.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-csharp.js b/card/gem_mods/ace_editor/public/assets/ace/mode-csharp.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-csharp.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-csharp.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-csound_document.js b/card/gem_mods/ace_editor/public/assets/ace/mode-csound_document.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-csound_document.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-csound_document.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-csound_orchestra.js b/card/gem_mods/ace_editor/public/assets/ace/mode-csound_orchestra.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-csound_orchestra.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-csound_orchestra.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-csound_score.js b/card/gem_mods/ace_editor/public/assets/ace/mode-csound_score.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-csound_score.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-csound_score.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-csp.js b/card/gem_mods/ace_editor/public/assets/ace/mode-csp.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-csp.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-csp.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-css.js b/card/gem_mods/ace_editor/public/assets/ace/mode-css.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-css.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-css.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-curly.js b/card/gem_mods/ace_editor/public/assets/ace/mode-curly.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-curly.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-curly.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-d.js b/card/gem_mods/ace_editor/public/assets/ace/mode-d.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-d.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-d.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-dart.js b/card/gem_mods/ace_editor/public/assets/ace/mode-dart.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-dart.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-dart.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-diff.js b/card/gem_mods/ace_editor/public/assets/ace/mode-diff.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-diff.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-diff.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-django.js b/card/gem_mods/ace_editor/public/assets/ace/mode-django.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-django.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-django.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-dockerfile.js b/card/gem_mods/ace_editor/public/assets/ace/mode-dockerfile.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-dockerfile.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-dockerfile.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-dot.js b/card/gem_mods/ace_editor/public/assets/ace/mode-dot.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-dot.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-dot.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-drools.js b/card/gem_mods/ace_editor/public/assets/ace/mode-drools.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-drools.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-drools.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-edifact.js b/card/gem_mods/ace_editor/public/assets/ace/mode-edifact.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-edifact.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-edifact.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-eiffel.js b/card/gem_mods/ace_editor/public/assets/ace/mode-eiffel.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-eiffel.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-eiffel.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-ejs.js b/card/gem_mods/ace_editor/public/assets/ace/mode-ejs.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-ejs.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-ejs.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-elixir.js b/card/gem_mods/ace_editor/public/assets/ace/mode-elixir.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-elixir.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-elixir.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-elm.js b/card/gem_mods/ace_editor/public/assets/ace/mode-elm.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-elm.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-elm.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-erlang.js b/card/gem_mods/ace_editor/public/assets/ace/mode-erlang.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-erlang.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-erlang.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-forth.js b/card/gem_mods/ace_editor/public/assets/ace/mode-forth.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-forth.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-forth.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-fortran.js b/card/gem_mods/ace_editor/public/assets/ace/mode-fortran.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-fortran.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-fortran.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-ftl.js b/card/gem_mods/ace_editor/public/assets/ace/mode-ftl.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-ftl.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-ftl.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-gcode.js b/card/gem_mods/ace_editor/public/assets/ace/mode-gcode.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-gcode.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-gcode.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-gherkin.js b/card/gem_mods/ace_editor/public/assets/ace/mode-gherkin.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-gherkin.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-gherkin.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-gitignore.js b/card/gem_mods/ace_editor/public/assets/ace/mode-gitignore.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-gitignore.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-gitignore.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-glsl.js b/card/gem_mods/ace_editor/public/assets/ace/mode-glsl.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-glsl.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-glsl.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-gobstones.js b/card/gem_mods/ace_editor/public/assets/ace/mode-gobstones.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-gobstones.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-gobstones.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-golang.js b/card/gem_mods/ace_editor/public/assets/ace/mode-golang.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-golang.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-golang.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-graphqlschema.js b/card/gem_mods/ace_editor/public/assets/ace/mode-graphqlschema.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-graphqlschema.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-graphqlschema.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-groovy.js b/card/gem_mods/ace_editor/public/assets/ace/mode-groovy.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-groovy.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-groovy.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-haml.js b/card/gem_mods/ace_editor/public/assets/ace/mode-haml.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-haml.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-haml.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-handlebars.js b/card/gem_mods/ace_editor/public/assets/ace/mode-handlebars.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-handlebars.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-handlebars.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-haskell.js b/card/gem_mods/ace_editor/public/assets/ace/mode-haskell.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-haskell.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-haskell.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-haskell_cabal.js b/card/gem_mods/ace_editor/public/assets/ace/mode-haskell_cabal.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-haskell_cabal.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-haskell_cabal.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-haxe.js b/card/gem_mods/ace_editor/public/assets/ace/mode-haxe.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-haxe.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-haxe.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-hjson.js b/card/gem_mods/ace_editor/public/assets/ace/mode-hjson.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-hjson.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-hjson.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-html.js b/card/gem_mods/ace_editor/public/assets/ace/mode-html.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-html.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-html.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-html_elixir.js b/card/gem_mods/ace_editor/public/assets/ace/mode-html_elixir.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-html_elixir.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-html_elixir.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-html_ruby.js b/card/gem_mods/ace_editor/public/assets/ace/mode-html_ruby.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-html_ruby.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-html_ruby.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-ini.js b/card/gem_mods/ace_editor/public/assets/ace/mode-ini.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-ini.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-ini.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-io.js b/card/gem_mods/ace_editor/public/assets/ace/mode-io.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-io.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-io.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-jack.js b/card/gem_mods/ace_editor/public/assets/ace/mode-jack.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-jack.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-jack.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-jade.js b/card/gem_mods/ace_editor/public/assets/ace/mode-jade.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-jade.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-jade.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-java.js b/card/gem_mods/ace_editor/public/assets/ace/mode-java.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-java.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-java.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-javascript.js b/card/gem_mods/ace_editor/public/assets/ace/mode-javascript.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-javascript.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-javascript.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-json.js b/card/gem_mods/ace_editor/public/assets/ace/mode-json.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-json.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-json.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-jsoniq.js b/card/gem_mods/ace_editor/public/assets/ace/mode-jsoniq.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-jsoniq.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-jsoniq.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-jsp.js b/card/gem_mods/ace_editor/public/assets/ace/mode-jsp.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-jsp.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-jsp.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-jssm.js b/card/gem_mods/ace_editor/public/assets/ace/mode-jssm.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-jssm.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-jssm.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-jsx.js b/card/gem_mods/ace_editor/public/assets/ace/mode-jsx.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-jsx.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-jsx.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-julia.js b/card/gem_mods/ace_editor/public/assets/ace/mode-julia.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-julia.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-julia.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-kotlin.js b/card/gem_mods/ace_editor/public/assets/ace/mode-kotlin.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-kotlin.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-kotlin.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-latex.js b/card/gem_mods/ace_editor/public/assets/ace/mode-latex.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-latex.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-latex.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-less.js b/card/gem_mods/ace_editor/public/assets/ace/mode-less.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-less.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-less.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-liquid.js b/card/gem_mods/ace_editor/public/assets/ace/mode-liquid.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-liquid.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-liquid.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-lisp.js b/card/gem_mods/ace_editor/public/assets/ace/mode-lisp.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-lisp.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-lisp.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-livescript.js b/card/gem_mods/ace_editor/public/assets/ace/mode-livescript.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-livescript.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-livescript.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-logiql.js b/card/gem_mods/ace_editor/public/assets/ace/mode-logiql.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-logiql.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-logiql.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-lsl.js b/card/gem_mods/ace_editor/public/assets/ace/mode-lsl.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-lsl.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-lsl.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-lua.js b/card/gem_mods/ace_editor/public/assets/ace/mode-lua.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-lua.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-lua.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-luapage.js b/card/gem_mods/ace_editor/public/assets/ace/mode-luapage.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-luapage.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-luapage.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-lucene.js b/card/gem_mods/ace_editor/public/assets/ace/mode-lucene.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-lucene.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-lucene.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-makefile.js b/card/gem_mods/ace_editor/public/assets/ace/mode-makefile.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-makefile.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-makefile.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-markdown.js b/card/gem_mods/ace_editor/public/assets/ace/mode-markdown.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-markdown.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-markdown.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-mask.js b/card/gem_mods/ace_editor/public/assets/ace/mode-mask.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-mask.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-mask.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-matlab.js b/card/gem_mods/ace_editor/public/assets/ace/mode-matlab.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-matlab.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-matlab.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-maze.js b/card/gem_mods/ace_editor/public/assets/ace/mode-maze.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-maze.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-maze.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-mel.js b/card/gem_mods/ace_editor/public/assets/ace/mode-mel.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-mel.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-mel.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-mixal.js b/card/gem_mods/ace_editor/public/assets/ace/mode-mixal.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-mixal.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-mixal.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-mushcode.js b/card/gem_mods/ace_editor/public/assets/ace/mode-mushcode.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-mushcode.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-mushcode.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-mysql.js b/card/gem_mods/ace_editor/public/assets/ace/mode-mysql.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-mysql.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-mysql.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-nix.js b/card/gem_mods/ace_editor/public/assets/ace/mode-nix.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-nix.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-nix.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-nsis.js b/card/gem_mods/ace_editor/public/assets/ace/mode-nsis.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-nsis.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-nsis.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-objectivec.js b/card/gem_mods/ace_editor/public/assets/ace/mode-objectivec.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-objectivec.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-objectivec.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-ocaml.js b/card/gem_mods/ace_editor/public/assets/ace/mode-ocaml.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-ocaml.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-ocaml.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-pascal.js b/card/gem_mods/ace_editor/public/assets/ace/mode-pascal.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-pascal.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-pascal.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-perl.js b/card/gem_mods/ace_editor/public/assets/ace/mode-perl.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-perl.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-perl.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-pgsql.js b/card/gem_mods/ace_editor/public/assets/ace/mode-pgsql.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-pgsql.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-pgsql.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-php.js b/card/gem_mods/ace_editor/public/assets/ace/mode-php.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-php.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-php.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-pig.js b/card/gem_mods/ace_editor/public/assets/ace/mode-pig.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-pig.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-pig.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-plain_text.js b/card/gem_mods/ace_editor/public/assets/ace/mode-plain_text.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-plain_text.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-plain_text.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-powershell.js b/card/gem_mods/ace_editor/public/assets/ace/mode-powershell.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-powershell.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-powershell.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-praat.js b/card/gem_mods/ace_editor/public/assets/ace/mode-praat.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-praat.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-praat.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-prolog.js b/card/gem_mods/ace_editor/public/assets/ace/mode-prolog.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-prolog.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-prolog.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-properties.js b/card/gem_mods/ace_editor/public/assets/ace/mode-properties.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-properties.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-properties.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-protobuf.js b/card/gem_mods/ace_editor/public/assets/ace/mode-protobuf.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-protobuf.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-protobuf.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-python.js b/card/gem_mods/ace_editor/public/assets/ace/mode-python.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-python.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-python.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-r.js b/card/gem_mods/ace_editor/public/assets/ace/mode-r.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-r.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-r.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-razor.js b/card/gem_mods/ace_editor/public/assets/ace/mode-razor.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-razor.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-razor.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-rdoc.js b/card/gem_mods/ace_editor/public/assets/ace/mode-rdoc.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-rdoc.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-rdoc.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-red.js b/card/gem_mods/ace_editor/public/assets/ace/mode-red.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-red.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-red.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-redshift.js b/card/gem_mods/ace_editor/public/assets/ace/mode-redshift.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-redshift.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-redshift.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-rhtml.js b/card/gem_mods/ace_editor/public/assets/ace/mode-rhtml.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-rhtml.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-rhtml.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-rst.js b/card/gem_mods/ace_editor/public/assets/ace/mode-rst.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-rst.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-rst.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-ruby.js b/card/gem_mods/ace_editor/public/assets/ace/mode-ruby.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-ruby.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-ruby.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-rust.js b/card/gem_mods/ace_editor/public/assets/ace/mode-rust.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-rust.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-rust.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-sass.js b/card/gem_mods/ace_editor/public/assets/ace/mode-sass.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-sass.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-sass.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-scad.js b/card/gem_mods/ace_editor/public/assets/ace/mode-scad.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-scad.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-scad.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-scala.js b/card/gem_mods/ace_editor/public/assets/ace/mode-scala.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-scala.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-scala.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-scheme.js b/card/gem_mods/ace_editor/public/assets/ace/mode-scheme.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-scheme.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-scheme.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-scss.js b/card/gem_mods/ace_editor/public/assets/ace/mode-scss.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-scss.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-scss.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-sh.js b/card/gem_mods/ace_editor/public/assets/ace/mode-sh.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-sh.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-sh.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-sjs.js b/card/gem_mods/ace_editor/public/assets/ace/mode-sjs.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-sjs.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-sjs.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-smarty.js b/card/gem_mods/ace_editor/public/assets/ace/mode-smarty.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-smarty.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-smarty.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-snippets.js b/card/gem_mods/ace_editor/public/assets/ace/mode-snippets.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-snippets.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-snippets.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-soy_template.js b/card/gem_mods/ace_editor/public/assets/ace/mode-soy_template.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-soy_template.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-soy_template.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-space.js b/card/gem_mods/ace_editor/public/assets/ace/mode-space.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-space.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-space.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-sparql.js b/card/gem_mods/ace_editor/public/assets/ace/mode-sparql.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-sparql.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-sparql.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-sql.js b/card/gem_mods/ace_editor/public/assets/ace/mode-sql.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-sql.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-sql.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-sqlserver.js b/card/gem_mods/ace_editor/public/assets/ace/mode-sqlserver.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-sqlserver.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-sqlserver.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-stylus.js b/card/gem_mods/ace_editor/public/assets/ace/mode-stylus.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-stylus.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-stylus.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-svg.js b/card/gem_mods/ace_editor/public/assets/ace/mode-svg.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-svg.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-svg.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-swift.js b/card/gem_mods/ace_editor/public/assets/ace/mode-swift.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-swift.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-swift.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-tcl.js b/card/gem_mods/ace_editor/public/assets/ace/mode-tcl.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-tcl.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-tcl.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-tex.js b/card/gem_mods/ace_editor/public/assets/ace/mode-tex.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-tex.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-tex.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-text.js b/card/gem_mods/ace_editor/public/assets/ace/mode-text.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-text.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-text.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-textile.js b/card/gem_mods/ace_editor/public/assets/ace/mode-textile.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-textile.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-textile.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-toml.js b/card/gem_mods/ace_editor/public/assets/ace/mode-toml.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-toml.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-toml.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-tsx.js b/card/gem_mods/ace_editor/public/assets/ace/mode-tsx.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-tsx.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-tsx.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-turtle.js b/card/gem_mods/ace_editor/public/assets/ace/mode-turtle.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-turtle.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-turtle.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-twig.js b/card/gem_mods/ace_editor/public/assets/ace/mode-twig.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-twig.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-twig.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-typescript.js b/card/gem_mods/ace_editor/public/assets/ace/mode-typescript.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-typescript.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-typescript.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-vala.js b/card/gem_mods/ace_editor/public/assets/ace/mode-vala.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-vala.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-vala.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-vbscript.js b/card/gem_mods/ace_editor/public/assets/ace/mode-vbscript.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-vbscript.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-vbscript.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-velocity.js b/card/gem_mods/ace_editor/public/assets/ace/mode-velocity.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-velocity.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-velocity.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-verilog.js b/card/gem_mods/ace_editor/public/assets/ace/mode-verilog.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-verilog.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-verilog.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-vhdl.js b/card/gem_mods/ace_editor/public/assets/ace/mode-vhdl.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-vhdl.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-vhdl.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-wollok.js b/card/gem_mods/ace_editor/public/assets/ace/mode-wollok.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-wollok.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-wollok.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-xml.js b/card/gem_mods/ace_editor/public/assets/ace/mode-xml.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-xml.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-xml.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-xquery.js b/card/gem_mods/ace_editor/public/assets/ace/mode-xquery.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-xquery.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-xquery.js diff --git a/card/mod/ace_editor/public/assets/ace/mode-yaml.js b/card/gem_mods/ace_editor/public/assets/ace/mode-yaml.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/mode-yaml.js rename to card/gem_mods/ace_editor/public/assets/ace/mode-yaml.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/abap.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/abap.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/abap.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/abap.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/abc.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/abc.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/abc.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/abc.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/actionscript.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/actionscript.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/actionscript.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/actionscript.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/ada.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/ada.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/ada.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/ada.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/apache_conf.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/apache_conf.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/apache_conf.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/apache_conf.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/applescript.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/applescript.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/applescript.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/applescript.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/asciidoc.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/asciidoc.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/asciidoc.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/asciidoc.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/asl.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/asl.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/asl.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/asl.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/assembly_x86.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/assembly_x86.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/assembly_x86.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/assembly_x86.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/autohotkey.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/autohotkey.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/autohotkey.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/autohotkey.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/batchfile.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/batchfile.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/batchfile.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/batchfile.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/bro.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/bro.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/bro.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/bro.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/c9search.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/c9search.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/c9search.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/c9search.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/c_cpp.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/c_cpp.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/c_cpp.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/c_cpp.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/cirru.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/cirru.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/cirru.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/cirru.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/clojure.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/clojure.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/clojure.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/clojure.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/cobol.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/cobol.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/cobol.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/cobol.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/coffee.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/coffee.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/coffee.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/coffee.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/coldfusion.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/coldfusion.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/coldfusion.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/coldfusion.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/csharp.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/csharp.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/csharp.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/csharp.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/csound_document.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/csound_document.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/csound_document.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/csound_document.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/csound_orchestra.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/csound_orchestra.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/csound_orchestra.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/csound_orchestra.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/csound_score.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/csound_score.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/csound_score.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/csound_score.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/csp.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/csp.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/csp.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/csp.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/css.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/css.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/css.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/css.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/curly.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/curly.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/curly.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/curly.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/d.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/d.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/d.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/d.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/dart.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/dart.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/dart.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/dart.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/diff.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/diff.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/diff.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/diff.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/django.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/django.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/django.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/django.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/dockerfile.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/dockerfile.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/dockerfile.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/dockerfile.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/dot.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/dot.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/dot.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/dot.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/drools.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/drools.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/drools.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/drools.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/edifact.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/edifact.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/edifact.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/edifact.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/eiffel.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/eiffel.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/eiffel.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/eiffel.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/ejs.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/ejs.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/ejs.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/ejs.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/elixir.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/elixir.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/elixir.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/elixir.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/elm.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/elm.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/elm.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/elm.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/erlang.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/erlang.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/erlang.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/erlang.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/forth.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/forth.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/forth.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/forth.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/fortran.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/fortran.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/fortran.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/fortran.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/ftl.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/ftl.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/ftl.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/ftl.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/gcode.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/gcode.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/gcode.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/gcode.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/gherkin.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/gherkin.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/gherkin.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/gherkin.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/gitignore.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/gitignore.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/gitignore.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/gitignore.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/glsl.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/glsl.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/glsl.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/glsl.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/gobstones.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/gobstones.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/gobstones.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/gobstones.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/golang.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/golang.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/golang.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/golang.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/graphqlschema.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/graphqlschema.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/graphqlschema.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/graphqlschema.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/groovy.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/groovy.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/groovy.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/groovy.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/haml.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/haml.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/haml.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/haml.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/handlebars.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/handlebars.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/handlebars.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/handlebars.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/haskell.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/haskell.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/haskell.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/haskell.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/haskell_cabal.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/haskell_cabal.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/haskell_cabal.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/haskell_cabal.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/haxe.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/haxe.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/haxe.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/haxe.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/hjson.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/hjson.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/hjson.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/hjson.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/html.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/html.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/html.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/html.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/html_elixir.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/html_elixir.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/html_elixir.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/html_elixir.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/html_ruby.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/html_ruby.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/html_ruby.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/html_ruby.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/ini.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/ini.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/ini.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/ini.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/io.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/io.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/io.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/io.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/jack.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/jack.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/jack.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/jack.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/jade.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/jade.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/jade.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/jade.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/java.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/java.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/java.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/java.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/javascript.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/javascript.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/javascript.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/javascript.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/json.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/json.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/json.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/json.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/jsoniq.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/jsoniq.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/jsoniq.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/jsoniq.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/jsp.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/jsp.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/jsp.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/jsp.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/jssm.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/jssm.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/jssm.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/jssm.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/jsx.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/jsx.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/jsx.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/jsx.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/julia.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/julia.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/julia.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/julia.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/kotlin.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/kotlin.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/kotlin.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/kotlin.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/latex.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/latex.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/latex.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/latex.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/less.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/less.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/less.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/less.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/liquid.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/liquid.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/liquid.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/liquid.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/lisp.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/lisp.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/lisp.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/lisp.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/livescript.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/livescript.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/livescript.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/livescript.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/logiql.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/logiql.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/logiql.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/logiql.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/lsl.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/lsl.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/lsl.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/lsl.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/lua.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/lua.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/lua.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/lua.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/luapage.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/luapage.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/luapage.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/luapage.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/lucene.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/lucene.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/lucene.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/lucene.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/makefile.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/makefile.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/makefile.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/makefile.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/markdown.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/markdown.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/markdown.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/markdown.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/mask.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/mask.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/mask.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/mask.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/matlab.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/matlab.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/matlab.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/matlab.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/maze.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/maze.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/maze.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/maze.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/mel.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/mel.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/mel.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/mel.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/mixal.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/mixal.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/mixal.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/mixal.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/mushcode.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/mushcode.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/mushcode.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/mushcode.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/mysql.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/mysql.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/mysql.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/mysql.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/nix.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/nix.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/nix.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/nix.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/nsis.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/nsis.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/nsis.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/nsis.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/objectivec.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/objectivec.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/objectivec.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/objectivec.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/ocaml.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/ocaml.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/ocaml.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/ocaml.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/pascal.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/pascal.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/pascal.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/pascal.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/perl.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/perl.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/perl.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/perl.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/pgsql.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/pgsql.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/pgsql.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/pgsql.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/php.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/php.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/php.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/php.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/pig.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/pig.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/pig.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/pig.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/plain_text.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/plain_text.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/plain_text.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/plain_text.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/powershell.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/powershell.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/powershell.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/powershell.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/praat.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/praat.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/praat.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/praat.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/prolog.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/prolog.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/prolog.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/prolog.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/properties.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/properties.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/properties.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/properties.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/protobuf.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/protobuf.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/protobuf.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/protobuf.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/python.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/python.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/python.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/python.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/r.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/r.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/r.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/r.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/razor.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/razor.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/razor.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/razor.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/rdoc.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/rdoc.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/rdoc.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/rdoc.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/red.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/red.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/red.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/red.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/redshift.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/redshift.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/redshift.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/redshift.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/rhtml.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/rhtml.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/rhtml.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/rhtml.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/rst.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/rst.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/rst.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/rst.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/ruby.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/ruby.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/ruby.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/ruby.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/rust.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/rust.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/rust.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/rust.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/sass.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/sass.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/sass.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/sass.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/scad.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/scad.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/scad.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/scad.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/scala.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/scala.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/scala.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/scala.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/scheme.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/scheme.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/scheme.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/scheme.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/scss.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/scss.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/scss.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/scss.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/sh.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/sh.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/sh.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/sh.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/sjs.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/sjs.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/sjs.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/sjs.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/smarty.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/smarty.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/smarty.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/smarty.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/snippets.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/snippets.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/snippets.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/snippets.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/soy_template.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/soy_template.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/soy_template.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/soy_template.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/space.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/space.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/space.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/space.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/sparql.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/sparql.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/sparql.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/sparql.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/sql.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/sql.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/sql.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/sql.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/sqlserver.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/sqlserver.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/sqlserver.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/sqlserver.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/stylus.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/stylus.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/stylus.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/stylus.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/svg.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/svg.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/svg.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/svg.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/swift.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/swift.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/swift.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/swift.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/tcl.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/tcl.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/tcl.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/tcl.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/tex.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/tex.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/tex.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/tex.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/text.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/text.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/text.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/text.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/textile.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/textile.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/textile.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/textile.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/toml.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/toml.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/toml.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/toml.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/tsx.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/tsx.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/tsx.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/tsx.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/turtle.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/turtle.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/turtle.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/turtle.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/twig.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/twig.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/twig.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/twig.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/typescript.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/typescript.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/typescript.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/typescript.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/vala.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/vala.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/vala.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/vala.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/vbscript.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/vbscript.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/vbscript.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/vbscript.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/velocity.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/velocity.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/velocity.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/velocity.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/verilog.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/verilog.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/verilog.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/verilog.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/vhdl.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/vhdl.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/vhdl.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/vhdl.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/wollok.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/wollok.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/wollok.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/wollok.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/xml.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/xml.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/xml.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/xml.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/xquery.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/xquery.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/xquery.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/xquery.js diff --git a/card/mod/ace_editor/public/assets/ace/snippets/yaml.js b/card/gem_mods/ace_editor/public/assets/ace/snippets/yaml.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/snippets/yaml.js rename to card/gem_mods/ace_editor/public/assets/ace/snippets/yaml.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-ambiance.js b/card/gem_mods/ace_editor/public/assets/ace/theme-ambiance.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-ambiance.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-ambiance.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-chaos.js b/card/gem_mods/ace_editor/public/assets/ace/theme-chaos.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-chaos.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-chaos.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-chrome.js b/card/gem_mods/ace_editor/public/assets/ace/theme-chrome.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-chrome.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-chrome.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-clouds.js b/card/gem_mods/ace_editor/public/assets/ace/theme-clouds.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-clouds.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-clouds.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-clouds_midnight.js b/card/gem_mods/ace_editor/public/assets/ace/theme-clouds_midnight.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-clouds_midnight.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-clouds_midnight.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-cobalt.js b/card/gem_mods/ace_editor/public/assets/ace/theme-cobalt.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-cobalt.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-cobalt.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-crimson_editor.js b/card/gem_mods/ace_editor/public/assets/ace/theme-crimson_editor.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-crimson_editor.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-crimson_editor.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-dawn.js b/card/gem_mods/ace_editor/public/assets/ace/theme-dawn.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-dawn.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-dawn.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-dracula.js b/card/gem_mods/ace_editor/public/assets/ace/theme-dracula.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-dracula.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-dracula.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-dreamweaver.js b/card/gem_mods/ace_editor/public/assets/ace/theme-dreamweaver.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-dreamweaver.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-dreamweaver.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-eclipse.js b/card/gem_mods/ace_editor/public/assets/ace/theme-eclipse.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-eclipse.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-eclipse.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-github.js b/card/gem_mods/ace_editor/public/assets/ace/theme-github.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-github.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-github.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-gob.js b/card/gem_mods/ace_editor/public/assets/ace/theme-gob.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-gob.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-gob.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-gruvbox.js b/card/gem_mods/ace_editor/public/assets/ace/theme-gruvbox.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-gruvbox.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-gruvbox.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-idle_fingers.js b/card/gem_mods/ace_editor/public/assets/ace/theme-idle_fingers.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-idle_fingers.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-idle_fingers.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-iplastic.js b/card/gem_mods/ace_editor/public/assets/ace/theme-iplastic.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-iplastic.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-iplastic.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-katzenmilch.js b/card/gem_mods/ace_editor/public/assets/ace/theme-katzenmilch.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-katzenmilch.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-katzenmilch.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-kr_theme.js b/card/gem_mods/ace_editor/public/assets/ace/theme-kr_theme.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-kr_theme.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-kr_theme.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-kuroir.js b/card/gem_mods/ace_editor/public/assets/ace/theme-kuroir.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-kuroir.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-kuroir.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-merbivore.js b/card/gem_mods/ace_editor/public/assets/ace/theme-merbivore.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-merbivore.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-merbivore.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-merbivore_soft.js b/card/gem_mods/ace_editor/public/assets/ace/theme-merbivore_soft.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-merbivore_soft.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-merbivore_soft.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-mono_industrial.js b/card/gem_mods/ace_editor/public/assets/ace/theme-mono_industrial.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-mono_industrial.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-mono_industrial.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-monokai.js b/card/gem_mods/ace_editor/public/assets/ace/theme-monokai.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-monokai.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-monokai.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-pastel_on_dark.js b/card/gem_mods/ace_editor/public/assets/ace/theme-pastel_on_dark.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-pastel_on_dark.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-pastel_on_dark.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-solarized_dark.js b/card/gem_mods/ace_editor/public/assets/ace/theme-solarized_dark.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-solarized_dark.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-solarized_dark.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-solarized_light.js b/card/gem_mods/ace_editor/public/assets/ace/theme-solarized_light.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-solarized_light.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-solarized_light.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-sqlserver.js b/card/gem_mods/ace_editor/public/assets/ace/theme-sqlserver.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-sqlserver.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-sqlserver.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-terminal.js b/card/gem_mods/ace_editor/public/assets/ace/theme-terminal.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-terminal.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-terminal.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-textmate.js b/card/gem_mods/ace_editor/public/assets/ace/theme-textmate.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-textmate.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-textmate.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-tomorrow.js b/card/gem_mods/ace_editor/public/assets/ace/theme-tomorrow.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-tomorrow.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-tomorrow.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-tomorrow_night.js b/card/gem_mods/ace_editor/public/assets/ace/theme-tomorrow_night.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-tomorrow_night.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-tomorrow_night.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-tomorrow_night_blue.js b/card/gem_mods/ace_editor/public/assets/ace/theme-tomorrow_night_blue.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-tomorrow_night_blue.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-tomorrow_night_blue.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-tomorrow_night_bright.js b/card/gem_mods/ace_editor/public/assets/ace/theme-tomorrow_night_bright.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-tomorrow_night_bright.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-tomorrow_night_bright.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-tomorrow_night_eighties.js b/card/gem_mods/ace_editor/public/assets/ace/theme-tomorrow_night_eighties.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-tomorrow_night_eighties.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-tomorrow_night_eighties.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-twilight.js b/card/gem_mods/ace_editor/public/assets/ace/theme-twilight.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-twilight.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-twilight.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-vibrant_ink.js b/card/gem_mods/ace_editor/public/assets/ace/theme-vibrant_ink.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-vibrant_ink.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-vibrant_ink.js diff --git a/card/mod/ace_editor/public/assets/ace/theme-xcode.js b/card/gem_mods/ace_editor/public/assets/ace/theme-xcode.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/theme-xcode.js rename to card/gem_mods/ace_editor/public/assets/ace/theme-xcode.js diff --git a/card/mod/ace_editor/public/assets/ace/worker-coffee.js b/card/gem_mods/ace_editor/public/assets/ace/worker-coffee.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/worker-coffee.js rename to card/gem_mods/ace_editor/public/assets/ace/worker-coffee.js diff --git a/card/mod/ace_editor/public/assets/ace/worker-css.js b/card/gem_mods/ace_editor/public/assets/ace/worker-css.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/worker-css.js rename to card/gem_mods/ace_editor/public/assets/ace/worker-css.js diff --git a/card/mod/ace_editor/public/assets/ace/worker-html.js b/card/gem_mods/ace_editor/public/assets/ace/worker-html.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/worker-html.js rename to card/gem_mods/ace_editor/public/assets/ace/worker-html.js diff --git a/card/mod/ace_editor/public/assets/ace/worker-javascript.js b/card/gem_mods/ace_editor/public/assets/ace/worker-javascript.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/worker-javascript.js rename to card/gem_mods/ace_editor/public/assets/ace/worker-javascript.js diff --git a/card/mod/ace_editor/public/assets/ace/worker-json.js b/card/gem_mods/ace_editor/public/assets/ace/worker-json.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/worker-json.js rename to card/gem_mods/ace_editor/public/assets/ace/worker-json.js diff --git a/card/mod/ace_editor/public/assets/ace/worker-lua.js b/card/gem_mods/ace_editor/public/assets/ace/worker-lua.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/worker-lua.js rename to card/gem_mods/ace_editor/public/assets/ace/worker-lua.js diff --git a/card/mod/ace_editor/public/assets/ace/worker-php.js b/card/gem_mods/ace_editor/public/assets/ace/worker-php.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/worker-php.js rename to card/gem_mods/ace_editor/public/assets/ace/worker-php.js diff --git a/card/mod/ace_editor/public/assets/ace/worker-xml.js b/card/gem_mods/ace_editor/public/assets/ace/worker-xml.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/worker-xml.js rename to card/gem_mods/ace_editor/public/assets/ace/worker-xml.js diff --git a/card/mod/ace_editor/public/assets/ace/worker-xquery.js b/card/gem_mods/ace_editor/public/assets/ace/worker-xquery.js similarity index 100% rename from card/mod/ace_editor/public/assets/ace/worker-xquery.js rename to card/gem_mods/ace_editor/public/assets/ace/worker-xquery.js diff --git a/card/mod/ace_editor/set/abstract/ace_editor.rb b/card/gem_mods/ace_editor/set/abstract/ace_editor.rb similarity index 86% rename from card/mod/ace_editor/set/abstract/ace_editor.rb rename to card/gem_mods/ace_editor/set/abstract/ace_editor.rb index fc1d809458..e2bc77b20f 100644 --- a/card/mod/ace_editor/set/abstract/ace_editor.rb +++ b/card/gem_mods/ace_editor/set/abstract/ace_editor.rb @@ -1,3 +1,6 @@ + +register_abstract_set :editor, self + format :html do def ace_editor_input text_area :content, rows: 5, diff --git a/card/mod/ace_editor/set/self/ace.rb b/card/gem_mods/ace_editor/set/self/ace.rb similarity index 100% rename from card/mod/ace_editor/set/self/ace.rb rename to card/gem_mods/ace_editor/set/self/ace.rb diff --git a/card/mod/ace_editor/set/self/script_ace.rb b/card/gem_mods/ace_editor/set/self/script_ace.rb similarity index 100% rename from card/mod/ace_editor/set/self/script_ace.rb rename to card/gem_mods/ace_editor/set/self/script_ace.rb diff --git a/card/mod/ace_editor/set/self/script_ace_config.rb b/card/gem_mods/ace_editor/set/self/script_ace_config.rb similarity index 100% rename from card/mod/ace_editor/set/self/script_ace_config.rb rename to card/gem_mods/ace_editor/set/self/script_ace_config.rb diff --git a/card/gem_mods/date/card-mod-date.gemspec b/card/gem_mods/date/card-mod-date.gemspec new file mode 100644 index 0000000000..3d77924a35 --- /dev/null +++ b/card/gem_mods/date/card-mod-date.gemspec @@ -0,0 +1,20 @@ +# -*- encoding : utf-8 -*- + +Gem::Specification.new do |s| + s.name = "card-mod-date" + s.version = "0.1" + + s.authors = ["Ethan McCutchen", "Philipp Kühl"] + s.email = ["info@decko.org"] + + s.summary = "Calendar editor" + s.description = "" + s.homepage = "http://decko.org" + s.licenses = ["GPL-2.0", "GPL-3.0"] + + s.files = Dir["VERSION", "README.rdoc", "LICENSE", "GPL", ".yardopts", + "{config,db,lib,set}/**/*"] + + s.required_ruby_version = ">= 2.3.0" + s.metadata = { "card-mod" => "date" } +end diff --git a/card/mod/date/db/migrate_core_cards/20180509141814_add_datepicker.rb b/card/gem_mods/date/db/migrate_core_cards/20180509141814_add_datepicker.rb similarity index 100% rename from card/mod/date/db/migrate_core_cards/20180509141814_add_datepicker.rb rename to card/gem_mods/date/db/migrate_core_cards/20180509141814_add_datepicker.rb diff --git a/card/mod/date/lib/javascript/script_datepicker_config.js.coffee b/card/gem_mods/date/lib/javascript/script_datepicker_config.js.coffee similarity index 100% rename from card/mod/date/lib/javascript/script_datepicker_config.js.coffee rename to card/gem_mods/date/lib/javascript/script_datepicker_config.js.coffee diff --git a/card/mod/date/lib/stylesheets/tempusdominus.scss b/card/gem_mods/date/lib/stylesheets/tempusdominus.scss similarity index 100% rename from card/mod/date/lib/stylesheets/tempusdominus.scss rename to card/gem_mods/date/lib/stylesheets/tempusdominus.scss diff --git a/card/mod/date/set/all/calendar.rb b/card/gem_mods/date/set/all/calendar.rb similarity index 100% rename from card/mod/date/set/all/calendar.rb rename to card/gem_mods/date/set/all/calendar.rb diff --git a/card/mod/date/set/self/datepicker.rb b/card/gem_mods/date/set/self/datepicker.rb similarity index 100% rename from card/mod/date/set/self/datepicker.rb rename to card/gem_mods/date/set/self/datepicker.rb diff --git a/card/mod/date/set/self/script_datepicker.rb b/card/gem_mods/date/set/self/script_datepicker.rb similarity index 100% rename from card/mod/date/set/self/script_datepicker.rb rename to card/gem_mods/date/set/self/script_datepicker.rb diff --git a/card/mod/date/set/self/script_datepicker_config.rb b/card/gem_mods/date/set/self/script_datepicker_config.rb similarity index 100% rename from card/mod/date/set/self/script_datepicker_config.rb rename to card/gem_mods/date/set/self/script_datepicker_config.rb diff --git a/card/mod/date/set/self/style_datepicker.rb b/card/gem_mods/date/set/self/style_datepicker.rb similarity index 100% rename from card/mod/date/set/self/style_datepicker.rb rename to card/gem_mods/date/set/self/style_datepicker.rb diff --git a/card/mod/date/set/type/date.rb b/card/gem_mods/date/set/type/date.rb similarity index 100% rename from card/mod/date/set/type/date.rb rename to card/gem_mods/date/set/type/date.rb diff --git a/card/mod/date/spec/set/type/date_spec.rb b/card/gem_mods/date/spec/set/type/date_spec.rb similarity index 100% rename from card/mod/date/spec/set/type/date_spec.rb rename to card/gem_mods/date/spec/set/type/date_spec.rb diff --git a/card/gem_mods/date/vendor/moment b/card/gem_mods/date/vendor/moment new file mode 160000 index 0000000000..2c0b063b3b --- /dev/null +++ b/card/gem_mods/date/vendor/moment @@ -0,0 +1 @@ +Subproject commit 2c0b063b3bf95a285f9b38c173e262b6416c2e7f diff --git a/card/mod/date/vendor/tempusdominus b/card/gem_mods/date/vendor/tempusdominus similarity index 100% rename from card/mod/date/vendor/tempusdominus rename to card/gem_mods/date/vendor/tempusdominus diff --git a/card/gem_mods/edit/card-mod-edit.gemspec b/card/gem_mods/edit/card-mod-edit.gemspec new file mode 100644 index 0000000000..bda3386616 --- /dev/null +++ b/card/gem_mods/edit/card-mod-edit.gemspec @@ -0,0 +1,20 @@ +# -*- encoding : utf-8 -*- + +Gem::Specification.new do |s| + s.name = "card-mod-edit" + s.version = "0.1" + + s.authors = ["Ethan McCutchen", "Philipp Kühl"] + s.email = ["info@decko.org"] + + s.summary = "Calendar editor" + s.description = "" + s.homepage = "http://decko.org" + s.licenses = ["GPL-2.0", "GPL-3.0"] + + s.files = Dir["VERSION", "README.rdoc", "LICENSE", "GPL", ".yardopts", + "{config,db,lib,set}/**/*"] + + s.required_ruby_version = ">= 2.3.0" + s.metadata = { "card-mod" => "edit" } +end diff --git a/card/mod/edit/set/all/bridge.rb b/card/gem_mods/edit/set/all/bridge.rb similarity index 100% rename from card/mod/edit/set/all/bridge.rb rename to card/gem_mods/edit/set/all/bridge.rb diff --git a/card/mod/edit/set/all/bridge/bridge.haml b/card/gem_mods/edit/set/all/bridge/bridge.haml similarity index 100% rename from card/mod/edit/set/all/bridge/bridge.haml rename to card/gem_mods/edit/set/all/bridge/bridge.haml diff --git a/card/mod/edit/set/all/bridge/bridge_pills.rb b/card/gem_mods/edit/set/all/bridge/bridge_pills.rb similarity index 100% rename from card/mod/edit/set/all/bridge/bridge_pills.rb rename to card/gem_mods/edit/set/all/bridge/bridge_pills.rb diff --git a/card/mod/edit/set/all/bridge/follow_section.rb b/card/gem_mods/edit/set/all/bridge/follow_section.rb similarity index 100% rename from card/mod/edit/set/all/bridge/follow_section.rb rename to card/gem_mods/edit/set/all/bridge/follow_section.rb diff --git a/card/mod/edit/set/all/bridge/related_section.rb b/card/gem_mods/edit/set/all/bridge/related_section.rb similarity index 100% rename from card/mod/edit/set/all/bridge/related_section.rb rename to card/gem_mods/edit/set/all/bridge/related_section.rb diff --git a/card/mod/edit/set/all/bridge/tab_views.rb b/card/gem_mods/edit/set/all/bridge/tab_views.rb similarity index 100% rename from card/mod/edit/set/all/bridge/tab_views.rb rename to card/gem_mods/edit/set/all/bridge/tab_views.rb diff --git a/card/mod/edit/set/all/bridge/tab_visibility.rb b/card/gem_mods/edit/set/all/bridge/tab_visibility.rb similarity index 100% rename from card/mod/edit/set/all/bridge/tab_visibility.rb rename to card/gem_mods/edit/set/all/bridge/tab_visibility.rb diff --git a/card/mod/edit/set/all/edit_content.rb b/card/gem_mods/edit/set/all/edit_content.rb similarity index 100% rename from card/mod/edit/set/all/edit_content.rb rename to card/gem_mods/edit/set/all/edit_content.rb diff --git a/card/mod/edit/set/all/edit_inline.rb b/card/gem_mods/edit/set/all/edit_inline.rb similarity index 100% rename from card/mod/edit/set/all/edit_inline.rb rename to card/gem_mods/edit/set/all/edit_inline.rb diff --git a/card/mod/edit/set/all/edit_name.rb b/card/gem_mods/edit/set/all/edit_name.rb similarity index 100% rename from card/mod/edit/set/all/edit_name.rb rename to card/gem_mods/edit/set/all/edit_name.rb diff --git a/card/mod/edit/set/all/edit_type.rb b/card/gem_mods/edit/set/all/edit_type.rb similarity index 100% rename from card/mod/edit/set/all/edit_type.rb rename to card/gem_mods/edit/set/all/edit_type.rb diff --git a/card/mod/edit/set/all/editing.rb b/card/gem_mods/edit/set/all/editing.rb similarity index 100% rename from card/mod/edit/set/all/editing.rb rename to card/gem_mods/edit/set/all/editing.rb diff --git a/card/mod/edit/set/all/editor.rb b/card/gem_mods/edit/set/all/editor.rb similarity index 92% rename from card/mod/edit/set/all/editor.rb rename to card/gem_mods/edit/set/all/editor.rb index 6ae1f146d4..145b43cecd 100644 --- a/card/mod/edit/set/all/editor.rb +++ b/card/gem_mods/edit/set/all/editor.rb @@ -1,6 +1,4 @@ -include_set Abstract::ProsemirrorEditor -include_set Abstract::TinymceEditor -include_set Abstract::AceEditor +include_abstract_set :editor Self::InputOptions.add_to_basket :options, "text area" Self::InputOptions.add_to_basket :options, "text field" @@ -46,6 +44,7 @@ def default_input_type # overridden by mods that provide rich text editors def rich_text_input + #FIXME: should select default differently, don't depend on an editor send "#{Cardio.config.rich_text_editor || :tinymce}_editor_input" end diff --git a/card/mod/edit/set/all/form.rb b/card/gem_mods/edit/set/all/form.rb similarity index 100% rename from card/mod/edit/set/all/form.rb rename to card/gem_mods/edit/set/all/form.rb diff --git a/card/mod/edit/set/all/form_buttons.rb b/card/gem_mods/edit/set/all/form_buttons.rb similarity index 100% rename from card/mod/edit/set/all/form_buttons.rb rename to card/gem_mods/edit/set/all/form_buttons.rb diff --git a/card/mod/edit/set/all/form_elements.rb b/card/gem_mods/edit/set/all/form_elements.rb similarity index 100% rename from card/mod/edit/set/all/form_elements.rb rename to card/gem_mods/edit/set/all/form_elements.rb diff --git a/card/mod/edit/set/all/formgroup.rb b/card/gem_mods/edit/set/all/formgroup.rb similarity index 100% rename from card/mod/edit/set/all/formgroup.rb rename to card/gem_mods/edit/set/all/formgroup.rb diff --git a/card/mod/edit/set/all/new.rb b/card/gem_mods/edit/set/all/new.rb similarity index 100% rename from card/mod/edit/set/all/new.rb rename to card/gem_mods/edit/set/all/new.rb diff --git a/card/mod/edit/set/all/overlay_guide.haml b/card/gem_mods/edit/set/all/overlay_guide.haml similarity index 100% rename from card/mod/edit/set/all/overlay_guide.haml rename to card/gem_mods/edit/set/all/overlay_guide.haml diff --git a/card/mod/edit/set/all/overlay_guide.rb b/card/gem_mods/edit/set/all/overlay_guide.rb similarity index 100% rename from card/mod/edit/set/all/overlay_guide.rb rename to card/gem_mods/edit/set/all/overlay_guide.rb diff --git a/card/mod/edit/set/all/template_nest.rb b/card/gem_mods/edit/set/all/template_nest.rb similarity index 100% rename from card/mod/edit/set/all/template_nest.rb rename to card/gem_mods/edit/set/all/template_nest.rb diff --git a/card/mod/edit/set/type/list.rb b/card/gem_mods/edit/set/type/list.rb similarity index 100% rename from card/mod/edit/set/type/list.rb rename to card/gem_mods/edit/set/type/list.rb diff --git a/card/mod/edit/set/type/plain_text.rb b/card/gem_mods/edit/set/type/plain_text.rb similarity index 100% rename from card/mod/edit/set/type/plain_text.rb rename to card/gem_mods/edit/set/type/plain_text.rb diff --git a/card/mod/edit/set/type/pointer.rb b/card/gem_mods/edit/set/type/pointer.rb similarity index 100% rename from card/mod/edit/set/type/pointer.rb rename to card/gem_mods/edit/set/type/pointer.rb diff --git a/card/mod/edit/spec/set/all/bridge/tab_views_spec.rb b/card/gem_mods/edit/spec/set/all/bridge/tab_views_spec.rb similarity index 100% rename from card/mod/edit/spec/set/all/bridge/tab_views_spec.rb rename to card/gem_mods/edit/spec/set/all/bridge/tab_views_spec.rb diff --git a/card/mod/edit/spec/set/all/bridge_spec.rb b/card/gem_mods/edit/spec/set/all/bridge_spec.rb similarity index 100% rename from card/mod/edit/spec/set/all/bridge_spec.rb rename to card/gem_mods/edit/spec/set/all/bridge_spec.rb diff --git a/card/mod/edit/spec/set/all/editing_spec.rb b/card/gem_mods/edit/spec/set/all/editing_spec.rb similarity index 100% rename from card/mod/edit/spec/set/all/editing_spec.rb rename to card/gem_mods/edit/spec/set/all/editing_spec.rb diff --git a/card/mod/edit/spec/set/all/form_elements_spec.rb b/card/gem_mods/edit/spec/set/all/form_elements_spec.rb similarity index 100% rename from card/mod/edit/spec/set/all/form_elements_spec.rb rename to card/gem_mods/edit/spec/set/all/form_elements_spec.rb diff --git a/card/mod/edit/spec/set/all/form_spec.rb b/card/gem_mods/edit/spec/set/all/form_spec.rb similarity index 100% rename from card/mod/edit/spec/set/all/form_spec.rb rename to card/gem_mods/edit/spec/set/all/form_spec.rb diff --git a/card/gem_mods/prosemirror_editor/card-mod-prosemirror_editor.gemspec b/card/gem_mods/prosemirror_editor/card-mod-prosemirror_editor.gemspec new file mode 100644 index 0000000000..48333c1a82 --- /dev/null +++ b/card/gem_mods/prosemirror_editor/card-mod-prosemirror_editor.gemspec @@ -0,0 +1,21 @@ +# -*- encoding : utf-8 -*- + +Gem::Specification.new do |s| + s.name = "card-mod-prosemirror_editor" + s.version = "0.1" + + s.authors = ["Ethan McCutchen", "Philipp Kühl"] + s.email = ["info@decko.org"] + + s.summary = "Calendar editor" + s.description = "" + s.homepage = "http://decko.org" + s.licenses = ["GPL-2.0", "GPL-3.0"] + + s.files = Dir["VERSION", "README.rdoc", "LICENSE", "GPL", ".yardopts", + "{config,db,lib,set}/**/*"] + + s.required_ruby_version = ">= 2.3.0" + s.metadata = { "card-mod" => "prosemirror_editor" } + s.add_runtime_dependency "card-mod-edit", "~> 0.1" +end diff --git a/card/mod/prosemirror_editor/db/migrate_core_cards/20160804112548_add_prosemirror_cards.rb b/card/gem_mods/prosemirror_editor/db/migrate_core_cards/20160804112548_add_prosemirror_cards.rb similarity index 100% rename from card/mod/prosemirror_editor/db/migrate_core_cards/20160804112548_add_prosemirror_cards.rb rename to card/gem_mods/prosemirror_editor/db/migrate_core_cards/20160804112548_add_prosemirror_cards.rb diff --git a/card/mod/prosemirror_editor/lib/javascript/script_prosemirror.js b/card/gem_mods/prosemirror_editor/lib/javascript/script_prosemirror.js similarity index 100% rename from card/mod/prosemirror_editor/lib/javascript/script_prosemirror.js rename to card/gem_mods/prosemirror_editor/lib/javascript/script_prosemirror.js diff --git a/card/mod/prosemirror_editor/lib/javascript/script_prosemirror_config.js.coffee b/card/gem_mods/prosemirror_editor/lib/javascript/script_prosemirror_config.js.coffee similarity index 100% rename from card/mod/prosemirror_editor/lib/javascript/script_prosemirror_config.js.coffee rename to card/gem_mods/prosemirror_editor/lib/javascript/script_prosemirror_config.js.coffee diff --git a/card/mod/prosemirror_editor/lib/stylesheets/style_prosemirror.scss b/card/gem_mods/prosemirror_editor/lib/stylesheets/style_prosemirror.scss similarity index 100% rename from card/mod/prosemirror_editor/lib/stylesheets/style_prosemirror.scss rename to card/gem_mods/prosemirror_editor/lib/stylesheets/style_prosemirror.scss diff --git a/card/mod/prosemirror_editor/set/abstract/prosemirror_editor.rb b/card/gem_mods/prosemirror_editor/set/abstract/prosemirror_editor.rb similarity index 84% rename from card/mod/prosemirror_editor/set/abstract/prosemirror_editor.rb rename to card/gem_mods/prosemirror_editor/set/abstract/prosemirror_editor.rb index 2f91bdd856..fc86198030 100644 --- a/card/mod/prosemirror_editor/set/abstract/prosemirror_editor.rb +++ b/card/gem_mods/prosemirror_editor/set/abstract/prosemirror_editor.rb @@ -1,3 +1,6 @@ + +register_abstract_set :editor, self + format :html do def prosemirror_editor_input wrap_with :div, id: unique_id, class: "prosemirror-editor" do diff --git a/card/mod/prosemirror_editor/set/self/script_prosemirror.rb b/card/gem_mods/prosemirror_editor/set/self/script_prosemirror.rb similarity index 100% rename from card/mod/prosemirror_editor/set/self/script_prosemirror.rb rename to card/gem_mods/prosemirror_editor/set/self/script_prosemirror.rb diff --git a/card/mod/prosemirror_editor/set/self/script_prosemirror_config.rb b/card/gem_mods/prosemirror_editor/set/self/script_prosemirror_config.rb similarity index 100% rename from card/mod/prosemirror_editor/set/self/script_prosemirror_config.rb rename to card/gem_mods/prosemirror_editor/set/self/script_prosemirror_config.rb diff --git a/card/mod/prosemirror_editor/set/self/style_prosemirror.rb b/card/gem_mods/prosemirror_editor/set/self/style_prosemirror.rb similarity index 100% rename from card/mod/prosemirror_editor/set/self/style_prosemirror.rb rename to card/gem_mods/prosemirror_editor/set/self/style_prosemirror.rb diff --git a/card/gem_mods/tinymce_editor/card-mod-tinymce_editor.gemspec b/card/gem_mods/tinymce_editor/card-mod-tinymce_editor.gemspec new file mode 100644 index 0000000000..f86c6041f2 --- /dev/null +++ b/card/gem_mods/tinymce_editor/card-mod-tinymce_editor.gemspec @@ -0,0 +1,20 @@ +# -*- encoding : utf-8 -*- + +Gem::Specification.new do |s| + s.name = "card-mod-tinymce_editor" + s.version = "0.1" + + s.authors = ["Ethan McCutchen", "Philipp Kühl"] + s.email = ["info@decko.org"] + + s.summary = "Calendar editor" + s.description = "" + s.homepage = "http://decko.org" + s.licenses = ["GPL-2.0", "GPL-3.0"] + + s.files = Dir["VERSION", "README.rdoc", "LICENSE", "GPL", ".yardopts", + "{config,db,lib,set}/**/*"] + + s.required_ruby_version = ">= 2.3.0" + s.add_runtime_dependency "card-mod-edit", "~> 0.1" +end diff --git a/card/mod/tinymce_editor/db/migrate_core_cards/20160804112560_add_tinymce_cards.rb b/card/gem_mods/tinymce_editor/db/migrate_core_cards/20160804112560_add_tinymce_cards.rb similarity index 100% rename from card/mod/tinymce_editor/db/migrate_core_cards/20160804112560_add_tinymce_cards.rb rename to card/gem_mods/tinymce_editor/db/migrate_core_cards/20160804112560_add_tinymce_cards.rb diff --git a/card/mod/tinymce_editor/db/migrate_core_cards/20171113233151_update_tinymce_config.rb b/card/gem_mods/tinymce_editor/db/migrate_core_cards/20171113233151_update_tinymce_config.rb similarity index 100% rename from card/mod/tinymce_editor/db/migrate_core_cards/20171113233151_update_tinymce_config.rb rename to card/gem_mods/tinymce_editor/db/migrate_core_cards/20171113233151_update_tinymce_config.rb diff --git a/card/mod/tinymce_editor/db/migrate_core_cards/20190306172623_update_tinymce_config_to_v5.rb b/card/gem_mods/tinymce_editor/db/migrate_core_cards/20190306172623_update_tinymce_config_to_v5.rb similarity index 100% rename from card/mod/tinymce_editor/db/migrate_core_cards/20190306172623_update_tinymce_config_to_v5.rb rename to card/gem_mods/tinymce_editor/db/migrate_core_cards/20190306172623_update_tinymce_config_to_v5.rb diff --git a/card/mod/tinymce_editor/db/migrate_core_cards/20190306172890_tinymce_add_nest_to_toolbar.rb b/card/gem_mods/tinymce_editor/db/migrate_core_cards/20190306172890_tinymce_add_nest_to_toolbar.rb similarity index 100% rename from card/mod/tinymce_editor/db/migrate_core_cards/20190306172890_tinymce_add_nest_to_toolbar.rb rename to card/gem_mods/tinymce_editor/db/migrate_core_cards/20190306172890_tinymce_add_nest_to_toolbar.rb diff --git a/card/mod/tinymce_editor/lib/javascript/script_tinymce.js b/card/gem_mods/tinymce_editor/lib/javascript/script_tinymce.js similarity index 100% rename from card/mod/tinymce_editor/lib/javascript/script_tinymce.js rename to card/gem_mods/tinymce_editor/lib/javascript/script_tinymce.js diff --git a/card/mod/tinymce_editor/lib/javascript/script_tinymce_config.js.coffee b/card/gem_mods/tinymce_editor/lib/javascript/script_tinymce_config.js.coffee similarity index 100% rename from card/mod/tinymce_editor/lib/javascript/script_tinymce_config.js.coffee rename to card/gem_mods/tinymce_editor/lib/javascript/script_tinymce_config.js.coffee diff --git a/card/mod/tinymce_editor/public/assets/tinymce/jquery.tinymce.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/jquery.tinymce.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/jquery.tinymce.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/jquery.tinymce.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/langs/readme.md b/card/gem_mods/tinymce_editor/public/assets/tinymce/langs/readme.md similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/langs/readme.md rename to card/gem_mods/tinymce_editor/public/assets/tinymce/langs/readme.md diff --git a/card/mod/tinymce_editor/public/assets/tinymce/license.txt b/card/gem_mods/tinymce_editor/public/assets/tinymce/license.txt similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/license.txt rename to card/gem_mods/tinymce_editor/public/assets/tinymce/license.txt diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/advlist/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/advlist/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/advlist/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/advlist/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/anchor/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/anchor/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/anchor/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/anchor/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/autolink/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/autolink/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/autolink/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/autolink/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/autoresize/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/autoresize/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/autoresize/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/autoresize/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/autosave/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/autosave/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/autosave/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/autosave/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/bbcode/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/bbcode/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/bbcode/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/bbcode/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/charmap/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/charmap/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/charmap/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/charmap/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/code/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/code/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/code/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/code/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/codesample/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/codesample/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/codesample/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/codesample/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/colorpicker/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/colorpicker/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/colorpicker/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/colorpicker/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/contextmenu/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/contextmenu/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/contextmenu/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/contextmenu/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/directionality/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/directionality/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/directionality/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/directionality/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/emoticons/js/emojis.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/emoticons/js/emojis.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/emoticons/js/emojis.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/emoticons/js/emojis.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/emoticons/js/emojis.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/emoticons/js/emojis.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/emoticons/js/emojis.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/emoticons/js/emojis.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/emoticons/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/emoticons/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/emoticons/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/emoticons/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/fullpage/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/fullpage/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/fullpage/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/fullpage/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/fullscreen/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/fullscreen/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/fullscreen/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/fullscreen/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/help/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/help/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/help/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/help/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/hr/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/hr/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/hr/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/hr/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/image/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/image/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/image/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/image/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/imagetools/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/imagetools/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/imagetools/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/imagetools/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/importcss/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/importcss/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/importcss/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/importcss/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/insertdatetime/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/insertdatetime/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/insertdatetime/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/insertdatetime/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/legacyoutput/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/legacyoutput/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/legacyoutput/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/legacyoutput/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/link/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/link/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/link/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/link/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/lists/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/lists/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/lists/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/lists/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/media/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/media/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/media/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/media/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/nest/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/nest/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/nest/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/nest/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/nonbreaking/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/nonbreaking/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/nonbreaking/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/nonbreaking/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/noneditable/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/noneditable/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/noneditable/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/noneditable/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/pagebreak/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/pagebreak/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/pagebreak/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/pagebreak/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/paste/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/paste/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/paste/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/paste/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/preview/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/preview/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/preview/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/preview/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/print/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/print/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/print/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/print/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/quickbars/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/quickbars/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/quickbars/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/quickbars/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/save/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/save/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/save/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/save/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/searchreplace/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/searchreplace/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/searchreplace/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/searchreplace/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/spellchecker/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/spellchecker/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/spellchecker/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/spellchecker/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/tabfocus/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/tabfocus/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/tabfocus/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/tabfocus/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/table/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/table/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/table/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/table/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/template/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/template/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/template/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/template/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/textcolor/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/textcolor/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/textcolor/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/textcolor/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/textpattern/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/textpattern/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/textpattern/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/textpattern/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/toc/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/toc/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/toc/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/toc/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/visualblocks/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/visualblocks/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/visualblocks/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/visualblocks/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/visualchars/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/visualchars/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/visualchars/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/visualchars/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/plugins/wordcount/plugin.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/wordcount/plugin.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/plugins/wordcount/plugin.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/plugins/wordcount/plugin.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/skins/content/default/content.min.css b/card/gem_mods/tinymce_editor/public/assets/tinymce/skins/content/default/content.min.css similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/skins/content/default/content.min.css rename to card/gem_mods/tinymce_editor/public/assets/tinymce/skins/content/default/content.min.css diff --git a/card/mod/tinymce_editor/public/assets/tinymce/skins/content/document/content.min.css b/card/gem_mods/tinymce_editor/public/assets/tinymce/skins/content/document/content.min.css similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/skins/content/document/content.min.css rename to card/gem_mods/tinymce_editor/public/assets/tinymce/skins/content/document/content.min.css diff --git a/card/mod/tinymce_editor/public/assets/tinymce/skins/content/writer/content.min.css b/card/gem_mods/tinymce_editor/public/assets/tinymce/skins/content/writer/content.min.css similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/skins/content/writer/content.min.css rename to card/gem_mods/tinymce_editor/public/assets/tinymce/skins/content/writer/content.min.css diff --git a/card/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/content.inline.min.css b/card/gem_mods/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/content.inline.min.css similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/content.inline.min.css rename to card/gem_mods/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/content.inline.min.css diff --git a/card/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/content.min.css b/card/gem_mods/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/content.min.css similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/content.min.css rename to card/gem_mods/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/content.min.css diff --git a/card/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/content.mobile.min.css b/card/gem_mods/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/content.mobile.min.css similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/content.mobile.min.css rename to card/gem_mods/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/content.mobile.min.css diff --git a/card/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff b/card/gem_mods/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff rename to card/gem_mods/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff diff --git a/card/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/skin.min.css b/card/gem_mods/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/skin.min.css similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/skin.min.css rename to card/gem_mods/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/skin.min.css diff --git a/card/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/skin.mobile.min.css b/card/gem_mods/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/skin.mobile.min.css similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/skin.mobile.min.css rename to card/gem_mods/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/skin.mobile.min.css diff --git a/card/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/content.inline.min.css b/card/gem_mods/tinymce_editor/public/assets/tinymce/skins/ui/oxide/content.inline.min.css similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/content.inline.min.css rename to card/gem_mods/tinymce_editor/public/assets/tinymce/skins/ui/oxide/content.inline.min.css diff --git a/card/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/content.min.css b/card/gem_mods/tinymce_editor/public/assets/tinymce/skins/ui/oxide/content.min.css similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/content.min.css rename to card/gem_mods/tinymce_editor/public/assets/tinymce/skins/ui/oxide/content.min.css diff --git a/card/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/content.mobile.min.css b/card/gem_mods/tinymce_editor/public/assets/tinymce/skins/ui/oxide/content.mobile.min.css similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/content.mobile.min.css rename to card/gem_mods/tinymce_editor/public/assets/tinymce/skins/ui/oxide/content.mobile.min.css diff --git a/card/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff b/card/gem_mods/tinymce_editor/public/assets/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff rename to card/gem_mods/tinymce_editor/public/assets/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff diff --git a/card/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/skin.min.css b/card/gem_mods/tinymce_editor/public/assets/tinymce/skins/ui/oxide/skin.min.css similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/skin.min.css rename to card/gem_mods/tinymce_editor/public/assets/tinymce/skins/ui/oxide/skin.min.css diff --git a/card/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/skin.mobile.min.css b/card/gem_mods/tinymce_editor/public/assets/tinymce/skins/ui/oxide/skin.mobile.min.css similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/skin.mobile.min.css rename to card/gem_mods/tinymce_editor/public/assets/tinymce/skins/ui/oxide/skin.mobile.min.css diff --git a/card/mod/tinymce_editor/public/assets/tinymce/themes/mobile/theme.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/themes/mobile/theme.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/themes/mobile/theme.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/themes/mobile/theme.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/themes/silver/theme.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/themes/silver/theme.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/themes/silver/theme.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/themes/silver/theme.min.js diff --git a/card/mod/tinymce_editor/public/assets/tinymce/tinymce.min.js b/card/gem_mods/tinymce_editor/public/assets/tinymce/tinymce.min.js similarity index 100% rename from card/mod/tinymce_editor/public/assets/tinymce/tinymce.min.js rename to card/gem_mods/tinymce_editor/public/assets/tinymce/tinymce.min.js diff --git a/card/mod/tinymce_editor/set/abstract/tinymce_editor.rb b/card/gem_mods/tinymce_editor/set/abstract/tinymce_editor.rb similarity index 81% rename from card/mod/tinymce_editor/set/abstract/tinymce_editor.rb rename to card/gem_mods/tinymce_editor/set/abstract/tinymce_editor.rb index 30d7a0f79e..db6ec70331 100644 --- a/card/mod/tinymce_editor/set/abstract/tinymce_editor.rb +++ b/card/gem_mods/tinymce_editor/set/abstract/tinymce_editor.rb @@ -1,3 +1,6 @@ + +register_abstract_set :editor, self + format :html do def tinymce_editor_input text_area :content, rows: 3, class: "tinymce-textarea d0-card-content", diff --git a/card/mod/tinymce_editor/set/all/reference_editor.rb b/card/gem_mods/tinymce_editor/set/all/reference_editor.rb similarity index 100% rename from card/mod/tinymce_editor/set/all/reference_editor.rb rename to card/gem_mods/tinymce_editor/set/all/reference_editor.rb diff --git a/card/mod/tinymce_editor/set/all/reference_editor/_link_editor.haml b/card/gem_mods/tinymce_editor/set/all/reference_editor/_link_editor.haml similarity index 100% rename from card/mod/tinymce_editor/set/all/reference_editor/_link_editor.haml rename to card/gem_mods/tinymce_editor/set/all/reference_editor/_link_editor.haml diff --git a/card/mod/tinymce_editor/set/all/reference_editor/_nest_editor.haml b/card/gem_mods/tinymce_editor/set/all/reference_editor/_nest_editor.haml similarity index 100% rename from card/mod/tinymce_editor/set/all/reference_editor/_nest_editor.haml rename to card/gem_mods/tinymce_editor/set/all/reference_editor/_nest_editor.haml diff --git a/card/mod/tinymce_editor/set/all/reference_editor/link_editor.rb b/card/gem_mods/tinymce_editor/set/all/reference_editor/link_editor.rb similarity index 100% rename from card/mod/tinymce_editor/set/all/reference_editor/link_editor.rb rename to card/gem_mods/tinymce_editor/set/all/reference_editor/link_editor.rb diff --git a/card/mod/tinymce_editor/set/all/reference_editor/link_editor/link_parser.rb b/card/gem_mods/tinymce_editor/set/all/reference_editor/link_editor/link_parser.rb similarity index 100% rename from card/mod/tinymce_editor/set/all/reference_editor/link_editor/link_parser.rb rename to card/gem_mods/tinymce_editor/set/all/reference_editor/link_editor/link_parser.rb diff --git a/card/mod/tinymce_editor/set/all/reference_editor/nest_editor.rb b/card/gem_mods/tinymce_editor/set/all/reference_editor/nest_editor.rb similarity index 100% rename from card/mod/tinymce_editor/set/all/reference_editor/nest_editor.rb rename to card/gem_mods/tinymce_editor/set/all/reference_editor/nest_editor.rb diff --git a/card/mod/tinymce_editor/set/all/reference_editor/nest_editor/_help.haml b/card/gem_mods/tinymce_editor/set/all/reference_editor/nest_editor/_help.haml similarity index 100% rename from card/mod/tinymce_editor/set/all/reference_editor/nest_editor/_help.haml rename to card/gem_mods/tinymce_editor/set/all/reference_editor/nest_editor/_help.haml diff --git a/card/mod/tinymce_editor/set/all/reference_editor/nest_editor/_options.haml b/card/gem_mods/tinymce_editor/set/all/reference_editor/nest_editor/_options.haml similarity index 100% rename from card/mod/tinymce_editor/set/all/reference_editor/nest_editor/_options.haml rename to card/gem_mods/tinymce_editor/set/all/reference_editor/nest_editor/_options.haml diff --git a/card/mod/tinymce_editor/set/all/reference_editor/nest_editor/_options_select.haml b/card/gem_mods/tinymce_editor/set/all/reference_editor/nest_editor/_options_select.haml similarity index 100% rename from card/mod/tinymce_editor/set/all/reference_editor/nest_editor/_options_select.haml rename to card/gem_mods/tinymce_editor/set/all/reference_editor/nest_editor/_options_select.haml diff --git a/card/mod/tinymce_editor/set/all/reference_editor/nest_editor/_options_select_row.haml b/card/gem_mods/tinymce_editor/set/all/reference_editor/nest_editor/_options_select_row.haml similarity index 100% rename from card/mod/tinymce_editor/set/all/reference_editor/nest_editor/_options_select_row.haml rename to card/gem_mods/tinymce_editor/set/all/reference_editor/nest_editor/_options_select_row.haml diff --git a/card/mod/tinymce_editor/set/all/reference_editor/nest_editor/nest_parser.rb b/card/gem_mods/tinymce_editor/set/all/reference_editor/nest_editor/nest_parser.rb similarity index 100% rename from card/mod/tinymce_editor/set/all/reference_editor/nest_editor/nest_parser.rb rename to card/gem_mods/tinymce_editor/set/all/reference_editor/nest_editor/nest_parser.rb diff --git a/card/mod/tinymce_editor/set/all/reference_editor/nest_image.rb b/card/gem_mods/tinymce_editor/set/all/reference_editor/nest_image.rb similarity index 100% rename from card/mod/tinymce_editor/set/all/reference_editor/nest_image.rb rename to card/gem_mods/tinymce_editor/set/all/reference_editor/nest_image.rb diff --git a/card/mod/tinymce_editor/set/all/reference_editor/reference_editor.haml b/card/gem_mods/tinymce_editor/set/all/reference_editor/reference_editor.haml similarity index 100% rename from card/mod/tinymce_editor/set/all/reference_editor/reference_editor.haml rename to card/gem_mods/tinymce_editor/set/all/reference_editor/reference_editor.haml diff --git a/card/mod/tinymce_editor/set/self/script_tinymce.rb b/card/gem_mods/tinymce_editor/set/self/script_tinymce.rb similarity index 100% rename from card/mod/tinymce_editor/set/self/script_tinymce.rb rename to card/gem_mods/tinymce_editor/set/self/script_tinymce.rb diff --git a/card/mod/tinymce_editor/set/self/script_tinymce_config.rb b/card/gem_mods/tinymce_editor/set/self/script_tinymce_config.rb similarity index 100% rename from card/mod/tinymce_editor/set/self/script_tinymce_config.rb rename to card/gem_mods/tinymce_editor/set/self/script_tinymce_config.rb diff --git a/card/mod/tinymce_editor/set/self/tiny_mce.rb b/card/gem_mods/tinymce_editor/set/self/tiny_mce.rb similarity index 100% rename from card/mod/tinymce_editor/set/self/tiny_mce.rb rename to card/gem_mods/tinymce_editor/set/self/tiny_mce.rb diff --git a/card/mod/edit/spec/set/all/reference_editor/nest_editor/nest_parser_spec.rb b/card/gem_mods/tinymce_editor/spec/set/all/reference_editor/nest_editor/nest_parser_spec.rb similarity index 100% rename from card/mod/edit/spec/set/all/reference_editor/nest_editor/nest_parser_spec.rb rename to card/gem_mods/tinymce_editor/spec/set/all/reference_editor/nest_editor/nest_parser_spec.rb diff --git a/card/mod/edit/spec/set/all/reference_editor/nest_editor_spec.rb b/card/gem_mods/tinymce_editor/spec/set/all/reference_editor/nest_editor_spec.rb similarity index 100% rename from card/mod/edit/spec/set/all/reference_editor/nest_editor_spec.rb rename to card/gem_mods/tinymce_editor/spec/set/all/reference_editor/nest_editor_spec.rb diff --git a/card/mod/edit/spec/set/all/reference_editor/nest_image_spec.rb b/card/gem_mods/tinymce_editor/spec/set/all/reference_editor/nest_image_spec.rb similarity index 100% rename from card/mod/edit/spec/set/all/reference_editor/nest_image_spec.rb rename to card/gem_mods/tinymce_editor/spec/set/all/reference_editor/nest_image_spec.rb diff --git a/card/lib/card/content/chunk/abstract.rb b/card/lib/card/content/chunk/abstract.rb index 0cf8c57b18..9a00da2f6b 100644 --- a/card/lib/card/content/chunk/abstract.rb +++ b/card/lib/card/content/chunk/abstract.rb @@ -7,7 +7,7 @@ class Content < SimpleDelegator # match by its pattern. # module Chunk - class Abstract + class Abstract < SimpleDelegator class_attribute :config attr_reader :text, :process_chunk @@ -36,6 +36,11 @@ def initialize match, content @processed = nil @content = content interpret match, content + super(self.ref_object) + end + + def ref_object + @text end def interpret _match_string, _content diff --git a/card/lib/card/content/parser.rb b/card/lib/card/content/parser.rb index ceef2b1153..5894dbc090 100644 --- a/card/lib/card/content/parser.rb +++ b/card/lib/card/content/parser.rb @@ -28,7 +28,7 @@ def parse content @chunks end - private + private def parse_chunks prefix_regexp = Chunk.prefix_regexp @chunk_list diff --git a/card/lib/card/set/inheritance.rb b/card/lib/card/set/inheritance.rb index 251a9a03c6..a90d10690b 100644 --- a/card/lib/card/set/inheritance.rb +++ b/card/lib/card/set/inheritance.rb @@ -1,7 +1,13 @@ class Card module Set # API to inherit other sets and their formats + module Inheritance + + mattr_reader :registered_set_mods + # support registering abstract modules for generic inclusion + @@registered_set_mods = { editor: [] } + # include a set module and all its format modules # @param [Module] set # @param [Hash] opts choose the formats you want to include. You can also @@ -40,6 +46,20 @@ def include_set set, opts={} include_set_formats set, opts end + def register_abstract_set symbol, mod + mods = Inheritance.registered_set_mods[symbol] + return if mods.nil? + mods.concat([mod]) + end + + def include_abstract_set symbol, opts={} + mods = Inheritance.registered_set_mods[symbol] + return unless mods + mods.each do |mod| + include_set mod, opts + end + end + # include format modules of a set # @param [Module] set # @param [Hash] opts choose the formats you want to include diff --git a/card/mod/Modfile b/card/mod/Modfile index 5ccae39184..6e394b7cb8 100644 --- a/card/mod/Modfile +++ b/card/mod/Modfile @@ -6,9 +6,6 @@ mod 'history' mod 'basic_formats' mod 'item' mod 'pointer' -mod 'ace_editor' -mod 'prosemirror_editor' -mod 'tinymce_editor' mod 'solid_cache' mod 'basic_types' mod 'machines' @@ -21,8 +18,6 @@ mod 'media' mod 'search' mod 'standard' mod 'rules' -mod 'edit' -mod 'date' mod 'account' mod 'navbar' mod 'bootstrap' diff --git a/card/mod/core/chunk/link.rb b/card/mod/core/chunk/link.rb index d709c96113..9edda97fee 100644 --- a/card/mod/core/chunk/link.rb +++ b/card/mod/core/chunk/link.rb @@ -21,6 +21,10 @@ def reference_code CODE end + def ref_object + [:link, @name, @link_text] + end + def interpret match, _content target, @link_text = if (raw_syntax = match[1]) diff --git a/card/mod/core/chunk/nest.rb b/card/mod/core/chunk/nest.rb index 6faf2b0f6b..eb2b8348e2 100644 --- a/card/mod/core/chunk/nest.rb +++ b/card/mod/core/chunk/nest.rb @@ -14,6 +14,10 @@ class Nest < Reference full_re: /\A\{\{([^\{\}]*)\}\}/, idx_char: "{") + def ref_object + [:nest, @name, @options] + end + def interpret match, _content in_brackets = strip_tags match[1] name, @opt_lists = in_brackets.split "|", 2 diff --git a/card/mod/core/set/abstract/code_file.rb b/card/mod/core/set/abstract/code_file.rb index c5ac189a2e..f44a890246 100644 --- a/card/mod/core/set/abstract/code_file.rb +++ b/card/mod/core/set/abstract/code_file.rb @@ -26,7 +26,9 @@ def source_dir end def find_file filename - mod_path = Card::Mod.dirs.path file_content_mod_name + modname = file_content_mod_name + modname = $1 if modname =~ /card-mod-(\w*)-\S/ + mod_path = Card::Mod.dirs.path modname file_path = File.join(mod_path, source_dir, filename) unless File.exist?(file_path) Rails.logger.info "couldn't locate file #{filename} at #{file_path}" diff --git a/card/mod/date/vendor/moment b/card/mod/date/vendor/moment deleted file mode 160000 index 2e2a5b3543..0000000000 --- a/card/mod/date/vendor/moment +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2e2a5b35439665d4b0200143d808a7c26d6cd30f diff --git a/card/mod/machines/file/all_script_machine_output/file.js b/card/mod/machines/file/all_script_machine_output/file.js index fc99dc386f..ab693989b0 100644 --- a/card/mod/machines/file/all_script_machine_output/file.js +++ b/card/mod/machines/file/all_script_machine_output/file.js @@ -28,24 +28,12 @@ e.crossDomain&&(e.type="GET")}),Te.ajaxTransport("script",function(e){if(e.cross //script: decko (function(){var t,e,n,i,o,r,a,s,l,d,c,u,f,h,p,m,v,g,b,y,w,_,k,C,x,S,F,O,R,T,P,I,N,M,A,D,j,L,E,z,V,q;window.decko||(window.decko={}),$(window).ready(function(){var t;return $("body").on("click","._stop_propagation",function(t){return t.stopPropagation()}),$("body").on("click","._prevent_default",function(t){return t.preventDefault()}),$("body").on("mouseenter","a[data-hover-text]",function(){var t;return t=$(this).text(),$(this).data("original-text",t),$(this).text($(this).data("hover-text"))}),$("body").on("mouseleave","a[data-hover-text]",function(){return $(this).text($(this).data("original-text"))}),$("body").on("click",".shade-view h1",function(){var t;if(t=$(this).slot().find(".shade-content").is(":hidden"),decko.toggleShade($(this).closest(".pointer-list").find(".shade-content:visible").parent()),t)return decko.toggleShade($(this).slot())}),(t=$(".shade-view h1")[0])&&$(t).trigger("click"),$("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()})}),$.extend(decko,{toggleShade:function(t){return t.find(".shade-content").slideToggle(1e3),t.find(".glyphicon").toggleClass("glyphicon-triangle-right glpyphicon-triangle-bottom")}}),$.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))})})},editorContentFunctionMap:{},editorInitFunctionMap:{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,i;if(e=this.closest(".card-editor").find(".d0-card-content"),n=e.val(),i=t.call(this),e.val(i),n!==i)return e.change()}}),$(window).ready(function(){return setTimeout(function(){return decko.initializeEditors($("body > :not(.modal)"))},10),$("body").on("submit",".card-form",function(){return $(this).setContentFieldsFromMap(),$(this).find(".d0-card-content").attr("no-autosave","true"),!0})}),setInterval(function(){return $(".card-form").setContentFieldsFromMap()},2e4),r=null,$(window).ready(function(){return $("body").on("click",".renamer-updater",function(){return $(this).closest("form").find("#card_update_referers").val("true")}),$("body").on("submit",".edit_name-view .card-form, .name_form-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("keyup",".name-editor input",function(t){var e;return r&&clearTimeout(r),e=$(this),13===t.which?(o(e),r=null):r=setTimeout(function(){return o(e),r=null},400)})}),o=function(t){var e;return e=t.val(),decko.pingName(e,function(n){var i,o,r,a,s,l,d;return t.val()!==e?null:(d=n.status,d?(i=t.parent(),r=t.closest("fieldset").find("legend"),a=r.find(".name-messages"),a[0]||(a=$(''),r.append(null!=a)),i.removeClass("real-name virtual-name known-name"),l=t.slot().data("cardId"),"unknown"===d||l&&parseInt(l)===n.id?a.html(""):(i.addClass(d+"-name known-name"),s="virtual"===d?"in virtual":"already in",o=decko.path(n.url_key),a.html("\""+e+'" '+s+" use"))):void 0)})},jQuery.fn.extend({autosave:function(){var t,e,n,i,o;if(i=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=i.data("cardId"),"";if(e)return o=decko.path("update/~"+e),t=$("#edit_card_"+e).serializeArray().reduce(function(t,e){return t[e.name]=e.value,t},{draft:"true","success[view]":"blank"}),$.ajax(o,{data:t,type:"POST"})}}}),$(window).ready(function(){return $("body").on("change",".autosave .d0-card-content",function(){var t;return t=$(this),setTimeout(function(){return t.autosave()},500)})}),c={off:!1,on:!0,signed_in:decko.currentUserId},d=function(){return c[decko.doubleClick]},u=function(t){return![".nodblclick",".d0-card-header",".card-editor"].some(function(e){return t.closest(e)[0]})&&null==t.slot().find(".card-editor")[0]},D=function(t){var e,n,i,o;return i=t.slot(),e=decko.slotEditLink(i),e?e.click():(n=decko.slotEditView(i),o=decko.path("~"+i.data("cardId")+"?view="+n),i.reloadSlot(o))},$(window).ready(function(){if(d())return $("body").on("dblclick","div",function(){return u($(this))&&D($(this)),!1})}),V=function(){var t;if(t=$("body > footer").first(),$("body > article, body > aside").wrapAll("
"),$("body > div > article, body > div > aside").wrapAll('
'),t)return $("body").append(t)},q=function(t,e){return"
"+t+"
"},a=function(){return $("body").hasClass("fluid")?"container-fluid":"container"},M=function(t){var e;return e="left"===t?"right":"left",""},T=function(t){return"both"===t?q(M("left")+M("right"),"flex-row justify-content-between"):"left"===t?q(M("left"),"flex-row"):q(M("right"),"flex-row-reverse")},P=function(t){var e,n;return e=$("body > article").first(),n=$("body > aside").first(),e.addClass("col-xs-12 col-sm-9"),n.addClass("col-xs-6 col-sm-3 sidebar-offcanvas sidebar-offcanvas-"+t),"left"===t?$("body").append(n).append(e):$("body").append(e).append(n),V(),e.prepend(T(t))},f=function(){var t,e,n,i,o;return t=$("body > article").first(),e=$("body > aside").first(),n=$($("body > aside")[1]),t.addClass("col-xs-12 col-sm-6"),i="col-xs-6 col-sm-3 sidebar-offcanvas",e.addClass(i+" sidebar-offcanvas-left"),n.addClass(i+" sidebar-offcanvas-right"),$("body").append(e).append(t).append(n),V(),o=T("both"),t.prepend(o)},$.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"):P("right");break;case!$("body").hasClass("left-sidebar"):P("left");break;case!$("body").hasClass("two-sidebar"):f()}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(){var t;return t=$("._navbox"),t.select2({placeholder:t.attr("placeholder"),escapeMarkup:function(t){return t},minimumInputLength:1,maximumSelectionSize:1,ajax:{delay:200,url:decko.path(":search.json"),data:function(t){return{query:{keyword:t.term},view:"complete"}},processResults:function(t){return{results:b(t)}},cache:!0},templateResult:p,templateSelection:m,multiple:!0,containerCssClass:"select2-navbox-autocomplete",dropdownCssClass:"select2-navbox-dropdown",width:"100%!important"}),t.on("select2:select",function(t){return g(t)})}),p=function(t){return t.loading?t.text:''+t.icon+''+t.prefix+': '+t.label+""},m=function(t){return t.icon?''+t.icon+''+t.label+"":t.text},b=function(t){var e,n;return e=[],n=t.term,t.search&&e.push(v({prefix:"search",id:n,text:n})),$.each(["add","new"],function(n,i){var o;if(o=t[i])return e.push(v({prefix:i,icon:"add",text:o[0],href:o[1]}))}),$.each(t["goto"],function(t,n){var i;return i=v({prefix:"go to",id:t,icon:"arrow_forward",text:n[0],href:n[1],label:n[2]}),e.push(i)}),e},v=function(t){return t.id||(t.id=t.prefix),t.icon||(t.icon=t.prefix),t.label||(t.label=''+t.text+""),t},g=function(t){var e;return e=t.params.data,e.href?window.location=decko.path(e.href):$(t.target).closest("form").submit(),$(t.target).attr("disabled","disabled")},$.extend(decko,{upload_file:function(t){var e,n;return $(t).on("fileuploadsubmit",function(t,e){var n,i,o;return n=$(this),i=n.siblings(".attachment_card_name:first").attr("name"),o=n.siblings("#attachment_type_id").val(),e.formData={"card[type_id]":o,attachment_upload:i}}),e=$(t),n=e.closest("form").attr("action").indexOf("update")>-1?"card/update/"+$(t).siblings("#file_card_name").val():"card/create",$(t).fileupload({url:decko.path(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(''),n.append(''),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,{slotPath:function(t,e){var n;return n=decko.slotData(e),decko.path(t)+(t.match(/\?/)?"&":"?")+$.param(n)},slotData:function(t){var e,n,i;return i={},e=$("#main").children(".card-slot").data("cardName"),null!=e&&(i.main=e),t&&(t.isMain()&&(i.is_main=!0),null!=(n=t.data("slot"))&&(decko.slotParams(n,i,"slot"),n.type&&(i.type=n.type))),i},slotEditView:function(t){var e;switch(e=decko.slotData(t),e["slot[edit]"]){case"inline":return"edit_inline";case"full":return"bridge";default:return"edit"}},slotEditLink:function(t){var e;return e=t.find(".edit-link").filter(function(e,n){return $(n).slot().data("slotId")===t.data("slotId")}),!!e[0]&&$(e[0])},slotParams:function(t,e,n){return $.each(t,function(t,i){var o;return o=n+"["+I(t)+"]","items"===t?decko.slotParams(i,e,o):e[o]=i})},contentLoaded:function(t,e){var n;return decko.initializeEditors(t),n=e.attr("notify-success"),null!=n&&t.notify(n,"success"),t.triggerSlotReady(e)},slotReady:function(t){return $("document").ready(function(){return $("body").on("slotReady",".card-slot",function(e,n){return e.stopPropagation(),null!=n?t.call(this,$(this),$(n)):t.call(this,$(this))})})},slotDestroy:function(t){return $("document").ready(function(){return $("body").on("slotDestroy",".card-slot, ._modal-slot",function(e){return e.stopPropagation(),t.call(this,$(this))})})}}),jQuery.fn.extend({slot:function(t,e){return null==t&&(t="success"),null==e&&(e="replace"),"modal"===e?this.modalSlot():this.selectSlot("slot-"+t+"-selector")||this.selectSlot("slot-selector")||this.closest(".card-slot")},selectSlot:function(t){var e,n;if(e=this.data(t))return(n=this.findSlot(e))&&n[0]&&n},isSlot:function(){return $(this).hasClass("card-slot")},isMain:function(){return this.slot().parent("#main")[0]},findSlot:function(t){var e,n;if("modal-origin"===t)return this.findOriginSlot("modal");if("overlay-origin"===t)return this.findOriginSlot("overlay");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},findOriginSlot:function(t){var e,n,i;return i=this.closest("[data-"+t+"-origin-slot-id]"),n=i.data(t+"-origin-slot-id"),e=$("[data-slot-id="+n+"]"),null!=e[0]?e:console.log("couldn't find origin with slot id "+n)},reloadSlot:function(t){var e;return e=$(this),e.length>1?void e.each(function(){return $(this).reloadSlot(t)}):(e.isSlot||(e=e.slot()),e[0]?(null==t&&(t=e.slotUrl()),e.addClass("slotter"),e.attr("href",t),e.data("url",t),this[0].href=t,e.data("remote",!0),$.rails.handleRemote(e)):void 0)},clearSlot:function(){return this.triggerSlotDestroy(),this.empty()},slotUrl:function(){return decko.slotPath(this.slotMark()+"?view="+this.data("slot").view)},slotMark:function(){return this.data("cardId")?"~"+this.data("cardId"):this.data("cardName")},setSlotContent:function(t,e,n){var i;return i=$(t)[0]&&$(t)||t,"string"==typeof i?this.slot("success",e).replaceWith(i):(i.hasClass("_overlay")?e="overlay":i.hasClass("_modal")&&(e="modal"),this.slot("success",e).setSlotContentFromElement(i,e,n)),i},setSlotContentFromElement:function(t,e,n){var i;return"overlay"===e?this.addOverlay(t,n):t.hasClass("_modal-slot")||"modal"===e?t.showAsModal(n):(i=this.data("slot-id"),i&&t.attr("data-slot-id",i),this.triggerSlotDestroy(),this.replaceWith(t),decko.contentLoaded(t,n))},triggerSlotReady:function(t){return this.isSlot()&&this.trigger("slotReady",t),this.find(".card-slot").trigger("slotReady",t)},triggerSlotDestroy:function(){return this.trigger("slotDestroy")}}),$(window).ready(function(){return $("body").on("hidden.bs.modal",function(){return decko.removeModal()}),$("body").on("show.bs.modal","._modal-slot",function(e){var n;return n=$(e.relatedTarget),t($(this),n),$(this).modal("handleUpdate"),decko.contentLoaded($(e.target),n)}),$("._modal-slot").each(function(){return _($(this)),t($(this))}),$("body").on("click",".submit-modal",function(){return $(this).closest(".modal-content").find("form").submit()})}),_=function(t){var e;if(e=t.find(".modal-content"),e.length>0&&e.html().length>0)return $("#main > .card-slot").registerAsOrigin("modal",t),t.modal("show")},t=function(t,e){var n,i;if(i=t.find(".modal-dialog"),null!=(n=null!=e?e.data("modal-class"):t.data("modal-class"))&&null!=i)return i.addClass(n)},jQuery.fn.extend({showAsModal:function(t){var e;return null!=t&&(e=this.modalify(t)),$("body > ._modal-slot").is(":visible")?this.addModal(e,t):($("body > ._modal-slot")[0]?($("._modal-slot").trigger("slotDestroy"),$("body > ._modal-slot").replaceWith(e)):$("body").append(e),t.registerAsOrigin("modal",e),e.modal("show",t))},addModal:function(t,e){var n;return"modal-replace"===e.data("slotter-mode")?(n=t.find(".modal-dialog"),t.adoptModalOrigin(),$("._modal-slot").trigger("slotDestroy"),$("body > ._modal-slot > .modal-dialog").replaceWith(n),decko.contentLoaded(n,e)):(decko.pushModal(t),e.registerAsOrigin("modal",t),t.modal("show",e))},adoptModalOrigin:function(){var t;return t=$("body > ._modal-slot .card-slot[data-modal-origin-slot-id]").data("modal-origin-slot-id"),this.find(".modal-body .card-slot").attr("data-modal-origin-slot-id",t)},modalSlot:function(){var t;return t=$("#modal-container"),t.length>0?t:decko.createModalSlot()},modalify:function(t){var e;return null!=t.data("modal-body")&&this.find(".modal-body").append(t.data("modal-body")),this.hasClass("_modal-slot")?this:(e=$("
",{id:"modal-container","class":"modal fade _modal-slot"}),e.append($("
",{"class":"modal-dialog"}).append($("
",{"class":"modal-content"}).append(this))),e)}}),$.extend(decko,{createModalSlot:function(){var t;return t=$("
",{id:"modal-container","class":"modal fade _modal-slot"}),$("body").append(t),t},removeModal:function(){return $("._modal-stack")[0]?decko.popModal():($("._modal-slot").trigger("slotDestroy"),$(".modal-dialog").empty())},pushModal:function(t){var e;return e=$("body > ._modal-slot"),e.removeAttr("id"),e.removeClass("_modal-slot").addClass("_modal-stack").removeClass("modal").addClass("background-modal"),t.insertBefore(e),$(".modal-backdrop").removeClass("show")},popModal:function(){var t;return $(".modal-backdrop").addClass("show"),$("body > ._modal-slot").trigger("slotDestroy"),$("body > ._modal-slot").remove(),t=$($("._modal-stack")[0]),t.addClass("_modal-slot").removeClass("_modal-stack").attr("id","modal-container").addClass("modal").removeClass("background-modal"),$(document.body).addClass("modal-open")}}),jQuery.fn.extend({overlaySlot:function(){var t;return t=this.closest(".card-slot._overlay"),null!=t[0]?t:(t=this.closest(".overlay-container").find("._overlay"),null!=t[0]&&$(t[0]))},addOverlay:function(t,e){return this.parent().hasClass("overlay-container")?$(t).hasClass("_stack-overlay")?this.before(t):($("._overlay-origin").removeClass("_overlay-origin"),this.replaceOverlay(t)):(this.parent().hasClass("_overlay-container-placeholder")?this.parent().addClass("overlay-container"):this.wrapAll('
'),this.addClass("_bottomlay-slot"),this.before(t)),e.registerAsOrigin("overlay",t),decko.contentLoaded(t,e)},replaceOverlay:function(t){return this.overlaySlot().trigger("slotDestroy"),this.overlaySlot().replaceWith(t),$(".bridge-sidebar .tab-pane:not(.active) .bridge-pills > .nav-item > .nav-link.active").removeClass("active")},isInOverlay:function(){return this.closest(".card-slot._overlay").length},removeOverlay:function(){var t;if(t=this.overlaySlot())return t.removeOverlaySlot()},removeOverlaySlot:function(){var t;return this.trigger("slotDestroy"),1===this.siblings().length&&(t=$(this.siblings()[0]),t.hasClass("_bottomlay-slot")&&(t.parent().hasClass("_overlay-container-placeholder")?t.parent().removeClass("overlay-container"):t.unwrap(),t.removeClass("_bottomlay-slot").updateBridge(!0,t))),this.remove()}}),jQuery.fn.extend({updateRecaptchaToken:function(t){var e,n;return n=this.find("input._recaptcha-token"),null==n[0]?n.val("recaptcha-token-field-missing"):"undefined"==typeof grecaptcha||null===grecaptcha?n.val("grecaptcha-undefined"):(e=$(this),t&&t.stopPropagation(),grecaptcha.execute(n.data("site-key"),{action:n.data("action")}).then(function(i){if(n.val(i),n.addClass("_token-updated"),t)return e.submit()}),!1)}}),$(window).ready(function(){return $("body").on("ajax:success",".slotter",function(t,e){return $(this).slotterSuccess(t,e)}),$("body").on("ajax:error",".slotter",function(t,e){return $(this).showErrorResponse(e.status,e.responseText)}),$("body").on("click","button.slotter",function(){return!!$.rails.allowAction($(this))&&$.rails.handleRemote($(this))}),$("body").on("click","._clickable.slotter",function(){return $(this)[0].href=$(this).attr("href"),$.rails.handleRemote($(this))}),$("body").on("click",'[data-dismiss="overlay"]',function(){return $(this).findSlot(".card-slot._overlay").removeOverlay()}),$("body").on("click","._close-overlay-on-success",function(){return $(this).closeOnSuccess("overlay")}),$("body").on("click","._close-modal-on-success",function(){return $(this).closeOnSuccess("modal")}),$("body").on("click","._close-on-success",function(){return $(this).closeOnSuccess()}),$("body").on("click","._update-origin",function(){return $(this).closest(".slotter").data("slotter-mode","update-origin")}),$("body").on("submit","form.slotter",function(t){var e,n;if((n=$(this).attr("main-success"))&&$(this).isMain()&&(e=$(this).find("[name=success]"))&&e.val()&&!e.val().match(/^REDIRECT/)&&e.val("REDIRECT"===n?n+": "+e.val():n),"on"===$(this).data("recaptcha"))return $(this).handleRecaptchaBeforeSubmit(t)}),$("body").on("ajax:beforeSend",".slotter",function(t,e,n){return $(this).slotterBeforeSend(n)})}),jQuery.fn.extend({slotterSuccess:function(t,e){var n,i,o,r;if(!this.hasClass("slotter"))return void console.log("warning: slotterSuccess called on non-slotter element "+this);if(!t.slotSuccessful)return this.data("reload")&&window.location.reload(!0),this.data("update-modal-origin")&&this.updateModalOrigin(),this.data("update-origin")&&this.updateOrigin(),this.data("original-slotter-mode")&&this.attr("data-slotter-mode",this.data("original-slotter-mode")),i=this.data("slotter-mode"),this.showSuccessResponse(e,i),this.hasClass("_close-overlay")&&this.removeOverlay(),this.hasClass("_close-modal")&&this.closest(".modal").modal("hide"),this.hasClass("card-paging-link")&&(r=this.slot().offset().top,$("body").scrollTop(r)),this.data("update-foreign-slot")&&(n=this.findSlot(this.data("update-foreign-slot")),o=this.data("update-foreign-slot-url"),n.reloadSlot(o)),t.slotSuccessful=!0},showSuccessResponse:function(t,e){if("silent-success"!==e)return"update-modal-origin"===e?this.updateModalOrigin():"update-origin"===e?this.updateOrigin():t.redirect?window.location=t.redirect:t.reload?window.location.reload(!0):this.updateSlot(t,e)},showErrorResponse:function(t,e){return 403===t?$(e).showAsModal($(this)):900===t?$(e).showAsModal($(this)):(this.notify(e,"error"),409===t?this.slot().find(".current_revision_id").val(this.slot().find(".new-current-revision-id").text()):void 0)},updateModalOrigin:function(){var t;return this.overlaySlot()?(t=this.findOriginSlot("overlay"),t.updateOrigin()):this.closest("#modal-container")[0]?this.updateOrigin():void 0},updateOrigin:function(){var t,e;if(null!=(e=this.overlaySlot()?"overlay":this.closest("#modal-container")[0]?"modal":void 0))return t=this.findOriginSlot(e),t&&null!=t[0]?t.reloadSlot():void 0},registerAsOrigin:function(t,e){return e.hasClass("_modal-slot")&&(e=e.find(".modal-body .card-slot")),e.attr("data-"+t+"-origin-slot-id",this.closest(".card-slot").data("slot-id"))},updateSlot:function(t,e){return e||(e="replace"),this.setSlotContent(t,e,$(this))},closeOnSuccess:function(t){var e;return e=this.closest(".slotter"),null==t&&(t=this.isInOverlay()?"overlay":"modal"),e.addClass("_close-"+t)},slotterBeforeSend:function(t){var e;if(!t.skip_before_send)return t.url.match(/home_view/)||"modal"===this.data("slotter-mode")||(t.url=decko.slotPath(t.url,this.slot())),this.is("form")&&(e=this.data("file-data"))?(this.uploadWithBlueimp(e,t),!1):void 0},uploadWithBlueimp:function(t,e){var n,i,o,r;return o=this.find(".file-upload"),o[1]?(this.notify("Decko does not yet support multiple files in a single form.","error"),!1):(r=o.data("blueimpFileupload"),r._isXHRUpload(r.options)||(this.find("[name=success]").val("_self"),e.url+="&simulate_xhr=true",i=function(t){return t.find("body").html()},e.dataFilter=i),n=$.extend(e,r._getAJAXSettings(t),{url:e.url}),n.skip_before_send=!0,$.ajax(n))},handleRecaptchaBeforeSubmit:function(t){var e;return e=this.find("input._recaptcha-token"),null==e[0]?e.val("recaptcha-token-field-missing"):e.hasClass("_token-updated")?e.removeClass("_token-updated"):"undefined"==typeof grecaptcha||null===grecaptcha?e.val("grecaptcha-undefined"):this.updateRecaptchaToken(t)}}),decko.slotReady(function(t,e){var n;if(t.updateBridge(!1,e),n=t.find("ul._auto-single-select > li.nav-item > a.nav-link"),1===n.length)return $(n[0]).click()}),jQuery.fn.extend({updateBridge:function(t,e){if(null==t&&(t=!1),this.closest(".bridge").length>0)return this.data("breadcrumb")?this.updateBreadcrumb():e&&$(e).data("breadcrumb")&&$(e).updateBreadcrumb(),t?$(".bridge-pills > .nav-item > .nav-link.active").removeClass("active"):void 0},updateBreadcrumb:function(){var t;return t=$(".modal-header ._bridge-breadcrumb li:last-child"),t.text(this.data("breadcrumb")),t.attr("class","breadcrumb-item active "+this.data("breadcrumb-class"))}}),$(window).ready(function(){return $("body").on("select2:select","._close-rule-overlay-on-select",function(){return $(".overlay-container > ._overlay.card-slot.overlay_rule-view.RULE").removeOverlay()}),$("body").on("click","._update-history-pills",function(){return $(this).closest(".slotter").data("update-foreign-slot",".card-slot.history_tab-view")})}),$(document).ready(function(){return $("body").on("click","button._nest-apply",function(){return nest.applyNest($(this).data("tinymce-id"),$(this).data("tm-snippet-start"),$(this).data("tm-snippet-size"))}),$("body").on("click","button._change-create-to-update",function(){var t;return t=$(this).closest("form").find("#success_tinymce_id").val(),nest.changeCreateToUpdate(t)})}),window.nest||(window.nest={}),$.extend(nest,{openNestEditor:function(t,e){var n,i;return null==e&&(e=nest.editParams(t)),i=$("#"+t.id).closest(".card-slot"),n=i[0]?$(i[0]).attr("data-card-name"):":update",nest.tmRequest(t,n,"nest_editor","modal_nest_editor",e)},openImageEditor:function(t){var e,n,i;return void 0!==n&&null!==n||(n=nest.editParams(t,"{{","}}",!1)),i=$("#"+t.id).closest(".card-slot"),e=i.data("card-name"),nest.tmRequest(t,e,"nest_image","modal_nest_image",n)},changeCreateToUpdate:function(t){var e,n;return e=$("#"+t).closest("form"),n=e.attr("action").replace("card/create","card/update"),e.attr("action",n)},insertNest:function(t,e){return t.insertContent(e)},tmRequest:function(t,e,n,i,o){var r,a,s;return a=$(".bridge-sidebar > ._overlay-container-placeholder > .card-slot"),a[0]?(s=n,r="overlay"):(a=$($(".card-slot")[0]),s=i,r="modal"),nest.sendTmRequest(t,a,r,e,s,o)},sendTmRequest:function(t,e,n,i,o,r){var a,s;return a=$("#"+t.id),null==r&&(r=""),s="/"+i+"?view="+o+"&tinymce_id="+t.id+r,$.ajax({url:s,type:"GET",success:function(t){return e.setSlotContent(t,n,a)}})},editParams:function(t,e,n,i){var o,r,a,s,l,d,c,u,f;return null==e&&(e="{{"),null==n&&(n="}}"),null==i&&(i=!0),null==(u=t.selection.getSel())||null==u.anchorNode?nest.paramsStr(0):(f=u.anchorNode.data)?(c=u.anchorOffset,r=f.substr(0,c),o=f.substr(c),a={before:{close:r.lastIndexOf(n),open:r.lastIndexOf(e)},after:{close:o.indexOf(n),open:o.indexOf(e)}},a.before.open>a.before.close&&-1!==a.after.close&&(-1===a.after.open||a.after.close0&&(n+="&tm_snippet_raw="+encodeURIComponent(e)),n},offsetAfterInsert:function(t,e){return t.selection.getSel().anchorOffset-e.length},applyNest:function(t,e,n){return nest.applySnippet("nest",t,e,n)},applySnippet:function(t,e,n,i){var o,r,a;return o=$("._"+t+"-preview").val(),r=tinymce.get(e),null!=n?nest.replaceSnippet(r,n,i,o):(r.insertContent(o),a=nest.offsetAfterInsert(r,o),$("button._"+t+"-apply").attr("data-tm-snippet-start",a)),$("button._"+t+"-apply").attr("data-tm-snippet-size",o.length)},replaceSnippet:function(t,e,n,i){var o,r;return o=t.selection.getSel(),null!=o&&null!=o.anchorNode&&null!=o.anchorNode.data?(r=o.anchorNode.data,null==n&&(n=0),r=""+r.substr(0,e)+i+r.substr(e+n),o.anchorNode.data=r):t.insertContent(i)},updatePreview:function(t){return null==t&&(t="{{"+nest.name()+"|"+nest.options()+"}}"),$("._nest-preview").val(t)}}),$(document).ready(function(){return $("body").on("keyup","input._nest-option-value",function(){return nest.updatePreview()}),$("body").on("select2:select","._nest-option-name",function(){return nest.toggleOptionName($(this).closest("._options-select"),$(this).val(),!0),nest.updatePreview()}),$("body").on("select2:selecting","._nest-option-name",function(){return nest.toggleOptionName($(this).closest("._options-select"),$(this).val(),!1)}),$("body").on("select2:select","._nest-option-name._new-row",function(){var t,e;return $(this).closest(".input-group").find(".input-group-prepend").removeClass("d-none"),t=$(this).closest("._nest-option-row"),t.find("._nest-option-value").removeAttr("disabled"),e=t.parent().find("._nest-option-row._template"),$(this).removeClass("_new-row"),nest.addRow(e)}),$("body").on("click","._configure-items-button",function(){return nest.addItemsOptions($(this))}),$("body").on("click","button._nest-delete-option",function(){return nest.removeRow($(this).closest("._nest-option-row"))})}),$.extend(nest,{showTemplate:function(t){return t.removeClass("_template")},addRow:function(t){var e,n;return n=t.find("select"),n.select2("destroy"),n.removeAttr("data-select2-id"),e=t.clone(),decko.initSelect2(n),nest.showTemplate(t),t.after(e),decko.initSelect2(e.find("select"))},removeRow:function(t){var e;return e=t.find("._nest-option-name").val(),nest.toggleOptionName(t.closest("._options-select"),e,!1),t.remove(),nest.updatePreview()},addItemsOptions:function(t){var e,n,i;return e=t.closest("._configure-items"),n=e.cloneSelect2(!0),i=t.text(),t.replaceWith($("
"+i.substr(9)+"
")),nest.showTemplate(e.find("._options-select._template")),n.find("._configure-items-button").text(i.replace("items","subitems")),e.after(n),nest.updatePreview()},options:function(){var t,e,n,i,o,r;for(o=[],r=$("._options-select:not(._template"),e=0,n=r.length;e0)return n=e.find("._nest-option-name").val(),null!=t[n]?t[n].push(i):t[n]=[i]},toggleOptionName:function(t,e,n){var i,o,r,a,s;if("show"===e||"hide"===e)return!0;for(r=t.find("._nest-option-name"),a=[],i=0,o=r.length;i .card-slot")},contentTabSlot:function(){return $("._nest-editor .tab-pane-content > .card-slot")},emptyNameAlert:function(t){return t?$("._empty-nest-name-alert").removeClass("d-none"):$("._empty-nest-name-alert:not(.d-none)").addClass("d-none")},updateNameRelatedTabs:function(){return nest.updateRulesTab(),nest.updateContentTab()},updateContentTab:function(){var t,e;if(t=nest.contentTabSlot(),t.length>0)return e=decko.path(nest.fullName()+"?view=nest_content"),nest.updateNameDependentSlot(t,e)},updateRulesTab:function(){var t,e;return t=nest.rulesTabSlot(),e=decko.path(nest.setNameForRules()+"?view=nest_rules"),nest.updateNameDependentSlot(t,e)},updateNameDependentSlot:function(t,e){var n ;return n=$("input._nest-name").val(),null!=n&&n.length>0?(nest.emptyNameAlert(!1),t.reloadSlot(e)):(t.clearSlot(),nest.emptyNameAlert(!0))},fullName:function(){var t,e;return t=$("input._nest-name"),e=t.val(),nest.isField()&&t.attr("data-left-name")?t.attr("data-left-name")+"+"+e:e},setNameForRules:function(){var t,e;return t=$("input._nest-name"),e=t.val(),nest.isField()?t.attr("data-left-type")?t.attr("data-left-type")+"+"+e+"+*type plus right":e+"+*right":e+"+*self"}}),$(document).ready(function(){return $("body").on("click","button._link-apply",function(){return link.applyLink($(this).data("tinymce-id"),$(this).data("tm-snippet-start"),$(this).data("tm-snippet-size"))})}),window.link||(window.link={}),$(document).ready(function(){return $("body").on("click","._link-field-toggle",function(){return $(this).is(":checked")?link.addPlus():link.removePlus()}),$("body").on("input","input._link-target",function(){return link.targetChanged()}),$("body").on("input","input._link-title",function(){return link.titleChanged()})}),$.extend(link,{openLinkEditor:function(t){var e,n,i;return void 0!==n&&null!==n||(n=nest.editParams(t,"[[","]]")),i=$("#"+t.id).closest(".card-slot"),e=i[0]?$(i[0]).attr("data-card-name"):":update",nest.tmRequest(t,e,"link_editor","modal_link_editor",n)},applyLink:function(t,e,n){return nest.applySnippet("link",t,e,n)},target:function(){return link.evalFieldOption($("input._link-target").val())},title:function(){return $("input._link-title").val()},titleChanged:function(){var t;return t=$("._link-preview").val().replace(/^\[\[[^\]]*/,"[["+link.target()+"|"+link.title()),link.updatePreview(t)},targetChanged:function(){var t;return t=$("._link-preview").val().replace(/^\[\[[^\]|]*/,"[["+link.target()),link.updatePreview(t)},evalFieldOption:function(t){return link.isField()?"+"+t:t},isField:function(){return $("._link-field-toggle").is(":checked")},addPlus:function(){var t;return t=$("._link-preview").val().replace(/^\[\[\+?/,"[[+"),link.updatePreview(t),$(".input-group.hide-prefix").removeClass("hide-prefix").addClass("show-prefix")},removePlus:function(){var t;return t=$("._link-preview").val().replace(/^\[\[\+?/,"[["),link.updatePreview(t),$(".input-group.show-prefix").removeClass("show-prefix").addClass("hide-prefix")},updatePreview:function(t){return null==t&&(t="[["+link.target()+"|"+link.title()+"]]"),$("._link-preview").val(t)}}),decko.slotReady(function(){return $('[data-toggle="popover"]').popover({html:!0}),$(".colorpicker-component").colorpicker()}),N=null,$(window).ready(function(){return $("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"),$.ajax({url:n,type:"GET",success:function(t){return $(e).append(t),decko.contentLoaded($(e),$(this))}})}),$("body").on("input","._submit-after-typing",function(t){var e;return e=$(t.target).closest("form"),e.slot().find(".autosubmit-success-notification").remove(),N&&clearTimeout(N),N=setTimeout(function(){return $(t.target).closest("form").submit(),N=null},1e3)}),$("body").on("keydown","._submit-after-typing",function(t){if(13===t.which)return N&&clearTimeout(N),N=null,$(t.target).closest("form").submit(),!1}),$("body").on("change","._submit-on-change",function(t){return $(t.target).closest("form").submit(),!1}),$("body").on("change","._edit-item",function(t){var e;return e=$(t.target),e.is(":checked")?e.attr("name","add_item"):e.attr("name","drop_item"),$(t.target).closest("form").submit(),!1})}),$.extend(decko,{path:function(t){return t.match(/^\/|:\/\//)?t:decko.rootUrl+t},pingName:function(t,e){return $.getJSON(decko.path(""),{format:"json",view:"status","card[name]":t},e)}}),jQuery.fn.extend({notify:function(t,e){var n,i,o;return o=this.slot(e),i=o.find(".card-notice"),i[0]||(i=$('
'),n=o.find(".card-form"),n[0]?$(n[0]).append(i):o.append(i)),i.html(t),i.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))}}),$(window).ready(function(){return $.ajaxSetup({cache:!1}),$("body").on("click",".submitter",function(){return $(this).closest("form").submit()}),$("body").on("click","button.redirecter",function(){return window.location=$(this).attr("href")}),$("body").on("change",".live-type-field",function(){var t;return t=$(this),R(t),t.data("params",$(this).closest("form").serialize()),t.data("url",$(this).attr("href"))}),$("body").on("change",".edit-type-field",function(){return $(this).closest("form").submit()}),$("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("click",".render-error-link",function(t){var e;return e=$(this).closest(".render-error").find(".render-error-message"),e.show(),t.preventDefault()})}),decko.slotReady(function(t){return t.find("card-view-placeholder").each(function(){var t;if(t=$(this),!t.data("loading"))return t.data("loading",!0),$.get(t.data("url"),function(e){return t.replaceWith(e)})})}),R=function(t,e){var n;if(null==e&&(e=null),n=t.closest(".slotter"),n.length&&n.attr("data-slotter-mode"))return n.attr("data-original-slotter-mode",n.attr("slotter-mode")),n.attr("data-slotter-mode",e)},I=function(t){return t.replace(/([a-z])([A-Z])/g,function(t){return t[0]+"_"+t[1].toLowerCase()})},$(window).ready(function(){return $("body").on("click",".btn-item",function(){return $(this).find("i").html("hourglass_full")}),$("body").on("mouseenter",".btn-item-delete",function(){return $(this).find("i").html("remove"),$(this).addClass("btn-danger").removeClass("btn-primary")}),$("body").on("mouseleave",".btn-item-delete",function(){return $(this).find("i").html("check"),$(this).addClass("btn-primary").removeClass("btn-danger")}),$("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})}),decko.isTouchDevice=function(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)||l()},l=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))},decko.slotReady(function(t){if(decko.isTouchDevice())return t.find("._show-on-hover").removeClass("_show-on-hover")}),$(window).ready(function(){return $("body").on("show.bs.popover","._card-menu-popover",function(){return $(this).closest(".card-menu._show-on-hover").removeClass("_show-on-hover").addClass("_show-on-hover-disabled")}),$("body").on("hide.bs.popover","._card-menu-popover",function(){return $(this).closest(".card-menu._show-on-hover-disabled").removeClass("_show-on-hover-disabled").addClass("_show-on-hover")})}),decko.slotReady(function(t){if(t.find("._disappear").delay(5e3).animate({height:0},1e3,function(){return $(this).hide()}),t.hasClass("_refresh-timer"))return setTimeout(function(){return t.reloadSlot(t.data("refresh-url"))},2e3)}),decko.filter=function(t){var e;return e=$(t).closest("._filter-widget"),this.widget=e.length?e:$(t).closest("._filtered-content").find("._filter-widget"),this.activeContainer=this.widget.find("._filter-container"),this.dropdown=this.widget.find("._add-filter-dropdown"),this.dropdownItems=this.widget.find("._filter-category-select"),this.form=this.widget.find("._filter-form"),this.quickFilter=this.widget.find("._quick-filter"),this.showWithStatus=function(t){var e;return e=this,$.each(this.dropdownItems,function(){var n;if(n=$(this),n.data(t))return e.activate(n.data("category"))})},this.reset=function(){return this.clear(),this.dropdownItems.show(),this.showWithStatus("default")},this.clear=function(){return this.activeContainer.find(".input-group").remove()},this.activate=function(t,e){return this.activateField(t,e),this.hideOption(t)},this.showOption=function(t){return this.dropdown.show(),this.option(t).show()},this.hideOption=function(t){if(this.option(t).hide(),this.dropdownItems.length<=this.activeFields().length)return this.dropdown.hide()},this.activeFields=function(){return this.activeContainer.find("._filter-input")},this.option=function(t){return this.dropdownItems.filter("[data-category='"+t+"']")},this.findPrototype=function(t){return this.widget.find("._filter-input-field-prototypes ._filter-input-"+t)},this.activateField=function(t,e){var n;return n=this.findPrototype(t).clone(),this.fieldValue(n,e),this.dropdown.before(n),this.initField(n),n.find("input, select").first().focus()},this.fieldValue=function(t,e){return"object"==typeof e?this.compoundFieldValue(t,e):this.simpleFieldValue(t,e)},this.simpleFieldValue=function(t,e){var n;if(n=t.find("input, select"),e)return n.val(e)},this.compoundFieldValue=function(t,e){var n,i,o;o=[];for(i in e)n=t.find("#filter_value_"+i),o.push(n.val(e[i]));return o},this.removeField=function(t){return this.activeField(t).remove(),this.showOption(t)},this.initField=function(t){return this.initSelectField(t),decko.initAutoCardPlete(t.find("input"))},this.initSelectField=function(t){return t.find("select").select2({containerCssClass:":all:",width:"auto",dropdownAutoWidth:"true"})},this.activeField=function(t){return this.activeContainer.find("._filter-input-"+t)},this.isActive=function(t){return this.activeField(t).length},this.restrict=function(t){var e;this.clear();for(e in t)this.activateField(e,t[e]);return this.update()},this.addRestrictions=function(t){var e;for(e in t)this.removeField(e),this.activate(e,t[e]);return this.update()},this.removeRestrictions=function(t){var e;for(e in t)this.removeField(e);return this.update()},this.setInputVal=function(t,e){var n;return n=t.find("select"),n.length?this.setSelect2Val(n,e):this.setTextInputVal(t.find("input"),e)},this.setSelect2Val=function(t,e){return t.attr("multiple")&&!Array.isArray(e)&&(e=[e]),t.select2("val",e)},this.setTextInputVal=function(t,e){return t.val(e),this.update()},this.updateLastVals=function(){return this.activeFields().find("input, select").each(function(){return $(this).data("lastVal",$(this).val())})},this.updateUrlBar=function(){if(!this.widget.closest("._noFilterUrlUpdates")[0])return window.history.pushState("filter","filter","?"+this.form.serialize())},this.update=function(){return this.updateLastVals(),this.updateQuickLinks(),this.form.submit(),this.updateUrlBar()},this.updateQuickLinks=function(){var t,e;return e=this,t=this.quickFilter.find("._filter-link"),t.addClass("active"),t.each(function(){var t,n,i,o;n=$(this),i=n.data("filter"),o=[];for(t in i)o.push(e.deactivateQuickLink(n,t,i[t]));return o})},this.deactivateQuickLink=function(t,e,n){var i;return i="._filter-input-"+e,$.map([this.form.find(i+" input, "+i+" select").val()],function(e){if(e=[e].flat(),$.inArray(n,e)>-1)return t.removeClass("active")})},this.updateIfChanged=function(){if(this.changedSinceLastVal())return this.update()},this.changedSinceLastVal=function(){var t;return t=!1,this.activeFields().find("input, select").each(function(){if($(this).val()!==$(this).data("lastVal"))return t=!0}),t},this},decko.slotReady(function(t){return t.find("._filter-widget").each(function(){var e;if(t[0]===$(this).slot()[0])return e=new decko.filter(this),e.showWithStatus("active"),e.updateLastVals(),e.updateQuickLinks()})}),$(window).ready(function(){var t,e,n,i,o,r,a;return t=function(t){return new decko.filter(t)},a=function(t){return $(t).hasClass("select2-search__field")},e=function(t){var e;return e=$(t),e.data("filter")||e.find("._filterable").data("filter")},r=function(e){var n;return n=$(e).closest("._filtering").data("filter-selector"),t(n||this)},$("body").on("click","._filter-category-select",function(e){return e.preventDefault(),t(this).activate($(this).data("category"))}),o="._filter-input input:not(.simple-text), ._filter-input select, ._filter-sort",$("body").on("change",o,function(){if(!a(this))return t(this).update()}),i=null,$("body").on("keyup","._filter-input input.simple-text",function(){var e;return clearTimeout(i),e=t(this),i=setTimeout(function(){return e.updateIfChanged()},333)}),$("body").on("click","._delete-filter-input",function(){var e;return e=t(this),e.removeField($(this).closest("._filter-input").data("category")),e.update()}),$("body").on("click","._reset-filter",function(){var e;return e=t(this),e.reset(),e.update()}),$("body").on("click","._filtering ._filterable",function(t){var n;return n=r(this),n.widget.length&&n.restrict(e(this)),t.preventDefault(),t.stopPropagation()}),$("body").on("click","._filter-link",function(e){var i,o,r;return i=t(this),r=$(this),o=r.data("filter"),n(r)?i.removeRestrictions(o):i.addRestrictions(o),e.preventDefault(),e.stopPropagation()}),n=function(t){return!t.hasClass("active")&&t.closest(".quick-filter").length>0}}),$(window).ready(function(){return $("body").on("click","._filter-items ._add-selected",function(){var t,e;return t=$(this),e=w(t),t.attr("href",n(t,e))}),$("body").on("click","._select-all",function(){return h($(this)).find("._unselected input._checkbox-list-checkbox").each(function(){return x($(this))}),$(this).prop("checked",!1),j($(this))}),$("body").on("click","._deselect-all",function(){return h($(this)).find("._selected input._checkbox-list-checkbox").each(function(){return $(this).slot().remove()}),$(this).prop("checked",!0),j($(this))}),$("body").on("click","._filter-items ._unselected input._checkbox-list-checkbox",function(){return x($(this)),j($(this))}),$("body").on("click","._filter-items ._selected input._checkbox-list-checkbox",function(){var t;return t=S($(this)),$(this).slot().remove(),j(t)}),$("body").on("click","._filtered-list-item-delete",function(){return $(this).closest("li").remove()})}),w=function(t){return $.map(C(t).concat(O(t)),function(t){return"~"+t}).join("\n")},n=function(t,e){var n,i,o,r;return r=t.slot().data("slot").view,n={content:e,type:"Pointer"},o={assign:!0,view:r,card:n},i=t.attr("href")+"&"+$.param(o),decko.slotPath(i,t.slot())},j=function(t){var e;return A(t),e=new decko.filter(h(t).find("._filter-widget")),e.update(),L(t),z(t)},L=function(t){var n;return n=S(t).children().length,h(t).find("._selected-items").html(n),s(t).attr("disabled",0===n),n>0?e(t).removeClass("disabled"):e(t).addClass("disabled"),E(t,n>0)},E=function(t,e){var n,i,o;return n=h(t),o=n.find("._selected-item-list"),i=n.find("._filter-help"),e?(o.show(),i.hide()):(o.hide(),i.show())},z=function(t){var e,n;return e=h(t),n=e.find("._search-checkbox-list").children().length,e.find("._unselected-items").html(n),e.find("._select-all").attr("disabled",n>0)},x=function(t){return t.prop("checked",!0),S(t).append(t.slot())},S=function(t){return h(t).find("._selected-bin")},h=function(t){return t.closest("._filter-items")},e=function(t){return h(t).find("._add-selected")},s=function(t){return h(t).find("._deselect-all")},O=function(t){return F(t,"cardId")},C=function(t){return k(t,"cardId")},k=function(t,n){var o,r;return o=e(t),r=o.data("itemSelector"),i(o.slot().find(r),n)},F=function(t,e){return i(S(t).children(),e)},i=function(t,e){return t.map(function(){return $(this).data(e)}).toArray()},A=function(t){var e,n;return n=C(t).concat(O(t)),e=h(t),e.find("._not-ids").val(n.toString())},$(window).ready(function(){return $("body").on("click","._selectable-filtered-content .bar-body",function(t){var e,n,i,o;return i=$(this),o=i.slot().data("card-name"),e=i.closest("._selectable-filtered-content"),n=$(e.data("input-selector")),n.val(o),i.closest(".modal").modal("hide"),t.preventDefault(),t.stopPropagation()})})}).call(this); -//script: ace -(function(){function e(e){var t=i;e&&(i[e]||(i[e]={}),t=i[e]),t.define&&t.define.packaged||(n.original=t.define,t.define=n,t.define.packaged=!0),t.require&&t.require.packaged||(o.original=t.require,t.require=o,t.require.packaged=!0)}var t="ace",i=function(){return this}();if(!i&&"undefined"!=typeof window&&(i=window),t||"undefined"==typeof requirejs){var n=function(e,t,i){if("string"!=typeof e)return void(n.original?n.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace()));2==arguments.length&&(i=t),n.modules[e]||(n.payloads[e]=i,n.modules[e]=null)};n.modules={},n.payloads={};var s=function(e,t,i){if("string"==typeof t){var n=a(e,t);if(n!=undefined)return i&&i(),n}else if("[object Array]"===Object.prototype.toString.call(t)){for(var s=[],r=0,l=t.length;r1&&t(l,"")>-1&&(a=RegExp(this.source,i.replace.call(e(this),"g","")),i.replace.call(o.slice(l.index),a,function(){for(var e=1;el.index&&this.lastIndex--}return l},s||(RegExp.prototype.test=function(e){var t=i.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t}))}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(){function e(){}function t(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(e){}}function i(e){return e=+e,e!==e?e=0:0!==e&&e!==1/0&&e!==-1/0&&(e=(e>0||-1)*Math.floor(Math.abs(e))),e}Function.prototype.bind||(Function.prototype.bind=function(t){var i=this;if("function"!=typeof i)throw new TypeError("Function.prototype.bind called on incompatible "+i);var n=u.call(arguments,1),s=function(){if(this instanceof s){var e=i.apply(this,n.concat(u.call(arguments)));return Object(e)===e?e:this}return i.apply(t,n.concat(u.call(arguments)))};return i.prototype&&(e.prototype=i.prototype,s.prototype=new e,e.prototype=null),s});var n,s,o,r,a,l=Function.prototype.call,h=Array.prototype,c=Object.prototype,u=h.slice,d=l.bind(c.toString),g=l.bind(c.hasOwnProperty);if((a=g(c,"__defineGetter__"))&&(n=l.bind(c.__defineGetter__),s=l.bind(c.__defineSetter__),o=l.bind(c.__lookupGetter__),r=l.bind(c.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t,i=[];if(i.splice.apply(i,e(20)),i.splice.apply(i,e(26)),t=i.length,i.splice(5,0,"XXX"),i.length,t+1==i.length)return!0}()){var f=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?f.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(u.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var i=this.length;e>0?e>i&&(e=i):void 0==e?e=0:e<0&&(e=Math.max(i+e,0)),e+ta)for(d=h;d--;)this[l+d]=this[a+d];if(o&&e===c)this.length=c,this.push.apply(this,s);else for(this.length=c+o,d=0;d>>0;if("[object Function]"!=d(e))throw new TypeError;for(;++s>>0,s=Array(n),o=arguments[1];if("[object Function]"!=d(e))throw new TypeError(e+" is not a function");for(var r=0;r>>0,o=[],r=arguments[1];if("[object Function]"!=d(e))throw new TypeError(e+" is not a function");for(var a=0;a>>0,s=arguments[1];if("[object Function]"!=d(e))throw new TypeError(e+" is not a function");for(var o=0;o>>0,s=arguments[1];if("[object Function]"!=d(e))throw new TypeError(e+" is not a function");for(var o=0;o>>0;if("[object Function]"!=d(e))throw new TypeError(e+" is not a function");if(!n&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var s,o=0;if(arguments.length>=2)s=arguments[1];else for(;;){if(o in i){s=i[o++];break}if(++o>=n)throw new TypeError("reduce of empty array with no initial value")}for(;o>>0;if("[object Function]"!=d(e))throw new TypeError(e+" is not a function");if(!n&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var s,o=n-1;if(arguments.length>=2)s=arguments[1];else for(;;){if(o in i){s=i[o--];break}if(--o<0)throw new TypeError("reduceRight of empty array with no initial value")}do{o in this&&(s=e.call(void 0,s,i[o],o,t))}while(o--);return s}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=p&&"[object String]"==d(this)?this.split(""):R(this),n=t.length>>>0;if(!n)return-1;var s=0;for(arguments.length>1&&(s=i(arguments[1])),s=s>=0?s:Math.max(0,n+s);s>>0;if(!n)return-1;var s=n-1;for(arguments.length>1&&(s=Math.min(s,i(arguments[1]))),s=s>=0?s:n-Math.abs(s);s>=0;s--)if(s in t&&e===t[s])return s;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:c)}),!Object.getOwnPropertyDescriptor){Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+e);if(g(e,t)){var i,n,s;if(i={enumerable:!0,configurable:!0},a){var l=e.__proto__;e.__proto__=c;var n=o(e,t),s=r(e,t);if(e.__proto__=l,n||s)return n&&(i.get=n),s&&(i.set=s),i}return i.value=e[t],i}}}if(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),!Object.create){var v;v=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(e,t){var i;if(null===e)i=v();else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var n=function(){};n.prototype=e,i=new n,i.__proto__=e}return void 0!==t&&Object.defineProperties(i,t),i}}if(Object.defineProperty){var w=t({}),b="undefined"==typeof document||t(document.createElement("div"));if(!w||!b)var $=Object.defineProperty}if(!Object.defineProperty||$){Object.defineProperty=function(e,t,i){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.defineProperty called on non-object: "+e);if("object"!=typeof i&&"function"!=typeof i||null===i)throw new TypeError("Property description must be an object: "+i);if($)try{return $.call(Object,e,t,i)}catch(e){}if(g(i,"value"))if(a&&(o(e,t)||r(e,t))){var l=e.__proto__;e.__proto__=c,delete e[t],e[t]=i.value,e.__proto__=l}else e[t]=i.value;else{if(!a)throw new TypeError("getters & setters can not be defined on this javascript engine");g(i,"get")&&n(e,t,i.get),g(i,"set")&&s(e,t,i.set)}return e}}Object.defineProperties||(Object.defineProperties=function(e,t){for(var i in t)g(t,i)&&Object.defineProperty(e,i,t[i]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze(function(){})}catch(e){Object.freeze=function(e){return function(t){return"function"==typeof t?t:e(t)}}(Object.freeze)}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(){return!1}),Object.isFrozen||(Object.isFrozen=function(){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;for(var t="";g(e,t);)t+="?";e[t]=!0;var i=g(e,t);return delete e[t],i}),!Object.keys){var y=!0,C=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],S=C.length;for(var A in{toString:null})y=!1;Object.keys=function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var t=[];for(var i in e)g(e,i)&&t.push(i);if(y)for(var n=0,s=S;n=0?parseFloat((n.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((n.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=n.match(/ Gecko\/\d+/),t.isOpera=window.opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(n.split("WebKit/")[1])||undefined,t.isChrome=parseFloat(n.split(" Chrome/")[1])||undefined,t.isAIR=n.indexOf("AdobeAIR")>=0,t.isIPad=n.indexOf("iPad")>=0,t.isChromeOS=n.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(n)&&!window.MSStream,t.isIOS&&(t.isMac=!0)}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t){"use strict";function i(e,t,i){var n=l(t);if(!o.isMac&&r){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(n|=8),r.altGr){if(3==(3&n))return;r.altGr=0}if(18===i||17===i){var h="location"in t?t.location:t.keyLocation;if(17===i&&1===h)1==r[i]&&(a=t.timeStamp);else if(18===i&&3===n&&2===h){var c=t.timeStamp-a;c<50&&(r.altGr=!0)}}}if(i in s.MODIFIER_KEYS&&(i=-1),8&n&&i>=91&&i<=93&&(i=-1),!n&&13===i){var h="location"in t?t.location:t.keyLocation;if(3===h&&(e(t,n,-i),t.defaultPrevented))return}if(o.isChromeOS&&8&n){if(e(t,n,i),t.defaultPrevented)return;n&=-9}return!!(n||i in s.FUNCTION_KEYS||i in s.PRINTABLE_KEYS)&&e(t,n,i)}function n(){r=Object.create(null)}var s=e("./keys"),o=e("./useragent"),r=null,a=0;t.addListener=function(e,t,i){if(e.addEventListener)return e.addEventListener(t,i,!1);if(e.attachEvent){var n=function(){i.call(e,window.event)};i._wrapper=n,e.attachEvent("on"+t,n)}},t.removeListener=function(e,t,i){if(e.removeEventListener)return e.removeEventListener(t,i,!1);e.detachEvent&&e.detachEvent("on"+t,i._wrapper||i)},t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||o.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},t.capture=function(e,i,n){function s(e){i&&i(e),n&&n(e),t.removeListener(document,"mousemove",i,!0),t.removeListener(document,"mouseup",s,!0),t.removeListener(document,"dragstart",s,!0)}return t.addListener(document,"mousemove",i,!0),t.addListener(document,"mouseup",s,!0),t.addListener(document,"dragstart",s,!0),s},t.addTouchMoveListener=function(e,i){var n,s;t.addListener(e,"touchstart",function(e){var t=e.touches,i=t[0];n=i.clientX,s=i.clientY}),t.addListener(e,"touchmove",function(e){var t=e.touches;if(!(t.length>1)){var o=t[0];e.wheelX=n-o.clientX,e.wheelY=s-o.clientY,n=o.clientX,s=o.clientY,i(e)}})},t.addMouseWheelListener=function(e,i){"onmousewheel"in e?t.addListener(e,"mousewheel",function(e){var t=8;e.wheelDeltaX!==undefined?(e.wheelX=-e.wheelDeltaX/t,e.wheelY=-e.wheelDeltaY/t):(e.wheelX=0,e.wheelY=-e.wheelDelta/t),i(e)}):"onwheel"in e?t.addListener(e,"wheel",function(e){var t=.35;switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=e.deltaX*t||0,e.wheelY=e.deltaY*t||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}i(e)}):t.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),i(e)})},t.addMultiMouseDownListener=function(e,i,n,s){function r(e){if(0!==t.getButton(e)?u=0:e.detail>1?++u>4&&(u=1):u=1,o.isIE){var r=Math.abs(e.clientX-l)>5||Math.abs(e.clientY-h)>5;c&&!r||(u=1),c&&clearTimeout(c),c=setTimeout(function(){c=null},i[u-1]||600),1==u&&(l=e.clientX,h=e.clientY)}if(e._clicks=u,n[s]("mousedown",e),u>4)u=0;else if(u>1)return n[s](d[u],e)}function a(e){u=2,c&&clearTimeout(c),c=setTimeout(function(){c=null},i[u-1]||600),n[s]("mousedown",e),n[s](d[u],e)}var l,h,c,u=0,d={2:"dblclick",3:"tripleclick",4:"quadclick"};Array.isArray(e)||(e=[e]),e.forEach(function(e){t.addListener(e,"mousedown",r),o.isOldIE&&t.addListener(e,"dblclick",a)})};var l=!o.isMac||!o.isOpera||"KeyboardEvent"in window?function(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)}:function(e){return 0|(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)};if(t.getModifierString=function(e){return s.KEY_MODS[l(e)]},t.addCommandKeyListener=function(e,s){var a=t.addListener;if(o.isOldGecko||o.isOpera&&!("KeyboardEvent"in window)){var l=null;a(e,"keydown",function(e){l=e.keyCode}),a(e,"keypress",function(e){return i(s,e,l)})}else{var h=null;a(e,"keydown",function(e){r[e.keyCode]=(r[e.keyCode]||0)+1;var t=i(s,e,e.keyCode);return h=e.defaultPrevented,t}),a(e,"keypress",function(e){h&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),h=null)}),a(e,"keyup",function(e){r[e.keyCode]=null}),r||(n(),a(window,"focus",n))}},"object"==typeof window&&window.postMessage&&!o.isOldIE){t.nextTick=function(e,i){i=i||window;var n="zero-timeout-message-"+1;t.addListener(i,"message",function s(o){o.data==n&&(t.stopPropagation(o),t.removeListener(i,"message",s),e())}),i.postMessage(n,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,i){return setTimeout(function i(){t.$idleBlocked?setTimeout(i,100):e()},i)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout(function(){t.$idleBlocked=!1},e||100)},t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),ace.define("ace/range",["require","exports","module"],function(e,t){"use strict";var i=function(e,t){return e.row-t.row||e.column-t.column},n=function(e,t,i,n){this.start={row:e,column:t},this.end={row:i,column:n}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t,i=e.end,n=e.start;return t=this.compare(i.row,i.column),1==t?(t=this.compare(n.row,n.column),1==t?2:0==t?1:0):-1==t?-2:(t=this.compare(n.row,n.column),-1==t?-1:1==t?42:0)},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&(!this.isEnd(e,t)&&!this.isStart(e,t))},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:tthis.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var i={row:t+1,column:0};else if(this.end.rowt)var s={row:t+1,column:0};else if(this.start.row0;)1&t&&(i+=e),(t>>=1)&&(e+=e);return i};var i=/^\s\s*/,n=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(i,"")},t.stringTrimRight=function(e){return e.replace(n,"")},t.copyObject=function(e){var t={};for(var i in e)t[i]=e[i];return t},t.copyArray=function(e){for(var t=[],i=0,n=e.length;if.length?e=e.substr(9):e.substr(0,4)==f.substr(0,4)?e=e.substr(4,e.length-f.length+1):e.charAt(e.length-1)==f.charAt(0)&&(e=e.slice(0,-1)),e!=f.charAt(0)&&e.charAt(e.length-1)==f.charAt(0)&&(e=e.slice(0,-1)),e&&t.onTextInput(e)),m&&(m=!1),L&&(L=!1))},E=function(){if(!w){var e=g.value;R(e),u()}},M=function(e,t,i){var n=e.clipboardData||window.clipboardData;if(n&&!l){var s=h||i?"Text":"text/plain";try{return t?!1!==n.setData(s,t):n.getData(s)}catch(e){if(!i)return M(e,t,!0)}}},T=function(e,s){var o=t.getCopyText();if(!o)return i.preventDefault(e);M(e,o)?(n.isIOS&&(p=s,g.value="\n aa"+o+"a a\n",g.setSelectionRange(4,4+o.length),m={value:o}),s?t.onCut():t.onCopy(),n.isIOS||i.preventDefault(e)):(m=!0,g.value=o,g.select(),setTimeout(function(){m=!1,u(),c(),s?t.onCut():t.onCopy()}))},_=function(e){T(e,!0)},O=function(e){T(e,!1)},F=function(e){var s=M(e);"string"==typeof s?(s&&t.onPaste(s,e),n.isIE&&setTimeout(c),i.preventDefault(e)):(g.value="",v=!0)};i.addCommandKeyListener(g,t.onCommandKey.bind(t)),i.addListener(g,"select",x),i.addListener(g,"input",E),i.addListener(g,"cut",_),i.addListener(g,"copy",O),i.addListener(g,"paste",F);var I=function(){w||!t.onCompositionStart||t.$readOnly||(w={},w.canUndo=t.session.$undoManager,t.onCompositionStart(),setTimeout(W,0),t.on("mousedown",B),w.canUndo&&!t.selection.isEmpty()&&(t.insert(""),t.session.markUndoGroup(),t.selection.clearSelection()),t.session.markUndoGroup())},W=function(){if(w&&t.onCompositionUpdate&&!t.$readOnly){var e=g.value.replace(/\x01/g,"");if(w.lastValue!==e&&(t.onCompositionUpdate(e),w.lastValue&&t.undo(),w.canUndo&&(w.lastValue=e),w.lastValue)){var i=t.selection.getRange();t.insert(w.lastValue),t.session.markUndoGroup(),w.range=t.selection.getRange(),t.selection.setRange(i),t.selection.clearSelection()}}},B=function(e){if(t.onCompositionEnd&&!t.$readOnly){var i=w;w=!1;var s=setTimeout(function(){s=null;var e=g.value.replace(/\x01/g,"");w||(e==i.lastValue?u():!i.lastValue&&e&&(u(),R(e)))});k=function(e){return s&&clearTimeout(s), -e=e.replace(/\x01/g,""),e==i.lastValue?"":(i.lastValue&&s&&t.undo(),e)},t.onCompositionEnd(),t.removeListener("mousedown",B),"compositionend"==e.type&&i.range&&t.selection.setRange(i.range);(!!n.isChrome&&n.isChrome>=53||!!n.isWebKit&&n.isWebKit>=603)&&E()}},D=o.delayedCall(W,50);i.addListener(g,"compositionstart",I),i.addListener(g,"compositionupdate",function(){D.schedule()}),i.addListener(g,"keyup",function(){D.schedule()}),i.addListener(g,"keydown",function(){D.schedule()}),i.addListener(g,"compositionend",B),this.getElement=function(){return g},this.setReadOnly=function(e){g.readOnly=e},this.onContextMenu=function(e){L=!0,c(t.selection.isEmpty()),t._emit("nativecontextmenu",{target:t,domEvent:e}),this.moveToMouse(e,!0)},this.moveToMouse=function(e,o){b||(b=g.style.cssText),g.style.cssText=(o?"z-index:100000;":"")+"height:"+g.style.height+";"+(n.isIE?"opacity:0.1;":"");var r=t.container.getBoundingClientRect(),a=s.computedStyle(t.container),l=r.top+(parseInt(a.borderTopWidth)||0),h=r.left+(parseInt(r.borderLeftWidth)||0),c=r.bottom-l-g.clientHeight-2,u=function(e){g.style.left=e.clientX-h-2+"px",g.style.top=Math.min(e.clientY-l-2,c)+"px"};u(e),"mousedown"==e.type&&(t.renderer.$keepTextAreaAtCursor&&(t.renderer.$keepTextAreaAtCursor=null),clearTimeout(H),n.isWin&&i.capture(t.container,u,d))},this.onContextMenuClose=d;var H,P=function(e){t.textInput.onContextMenu(e),d()};if(i.addListener(g,"mouseup",P),i.addListener(g,"mousedown",function(e){e.preventDefault(),d()}),i.addListener(t.renderer.scroller,"contextmenu",P),i.addListener(g,"contextmenu",P),n.isIOS){var N=null,z=!1;e.addEventListener("keydown",function(){N&&clearTimeout(N),z=!0}),e.addEventListener("keyup",function(){N=setTimeout(function(){z=!1},100)});var V=function(){if(document.activeElement===g&&!z){if(p)return setTimeout(function(){p=!1},100);var e=g.selectionStart,i=g.selectionEnd;if(g.setSelectionRange(4,5),e==i)switch(e){case 0:t.onCommandKey(null,0,r.up);break;case 1:t.onCommandKey(null,0,r.home);break;case 2:t.onCommandKey(null,a.option,r.left);break;case 4:t.onCommandKey(null,0,r.left);break;case 5:t.onCommandKey(null,0,r.right);break;case 7:t.onCommandKey(null,a.option,r.right);break;case 8:t.onCommandKey(null,0,r.end);break;case 9:t.onCommandKey(null,0,r.down)}else{switch(i){case 6:t.onCommandKey(null,a.shift,r.right);break;case 7:t.onCommandKey(null,a.shift|a.option,r.right);break;case 8:t.onCommandKey(null,a.shift,r.end);break;case 9:t.onCommandKey(null,a.shift,r.down)}switch(e){case 0:t.onCommandKey(null,a.shift,r.up);break;case 1:t.onCommandKey(null,a.shift,r.home);break;case 2:t.onCommandKey(null,a.shift|a.option,r.left);break;case 3:t.onCommandKey(null,a.shift,r.left)}}}};document.addEventListener("selectionchange",V),t.on("destroy",function(){document.removeEventListener("selectionchange",V)})}};t.TextInput=c}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/keyboard/textinput_ios"],function(e,t){"use strict";var i=e("../lib/event"),n=e("../lib/useragent"),s=e("../lib/dom"),o=e("../lib/lang"),r=n.isChrome<18,a=n.isIE,l=n.isChrome>63,h=e("./textinput_ios").TextInput,c=function(e,t){function c(e){if(e=!y&&e,!w){if(w=!0,R)var t=0,i=e?0:g.value.length-1;else var t=e?2:1,i=2;try{g.setSelectionRange(t,i)}catch(e){}w=!1}}function u(){w||(g.value=f,n.isWebKit&&x.schedule())}function d(){clearTimeout(N),N=setTimeout(function(){b&&(g.style.cssText=b,b=""),null==t.renderer.$keepTextAreaAtCursor&&(t.renderer.$keepTextAreaAtCursor=!0,t.renderer.$moveTextAreaToCursor())},0)}if(n.isIOS)return h.call(this,e,t);var g=s.createElement("textarea");g.className="ace_text-input",g.setAttribute("wrap","off"),g.setAttribute("autocorrect","off"),g.setAttribute("autocapitalize","off"),g.setAttribute("spellcheck",!1),g.style.opacity="0",e.insertBefore(g,e.firstChild);var f=n.isIE?"\x01\x01":"\u2028\u2028",m=n.isIE?/\x01/g:/\u2028/g,p=!1,v=!1,w=!1,b="",$=!0,y=!1,C=!1;try{var S=document.activeElement===g}catch(e){}i.addListener(g,"blur",function(e){t.onBlur(e),S=!1}),i.addListener(g,"focus",function(e){S=!0,t.onFocus(e),c()}),this.$focusScroll=!1,this.focus=function(){if(b||l||"browser"==this.$focusScroll)return g.focus({preventScroll:!0});var e=g.style.top;g.style.position="fixed",g.style.top="0px";var t=0!=g.getBoundingClientRect().top,i=[];if(t)for(var n=g.parentElement;n&&1==n.nodeType;)i.push(n),n.setAttribute("ace_nocontext",!0),n=!n.parentElement&&n.getRootNode?n.getRootNode().host:n.parentElement;g.focus({preventScroll:!0}),t&&i.forEach(function(e){e.removeAttribute("ace_nocontext")}),setTimeout(function(){g.style.position="","0px"==g.style.top&&(g.style.top=e)},0)},this.blur=function(){g.blur()},this.isFocused=function(){return S};var A=o.delayedCall(function(){S&&c($)}),x=o.delayedCall(function(){w||(g.value=f,S&&c())});n.isWebKit||t.addEventListener("changeSelection",function(){t.selection.isEmpty()!=$&&($=!$,A.schedule())}),u(),S&&t.onFocus();var k=function(e){return 0===e.selectionStart&&e.selectionEnd===e.value.length},L=function(){p?p=!1:k(g)?(t.selectAll(),c()):R&&c(t.selection.isEmpty())},R=null;this.setInputHandler=function(e){R=e},this.getInputHandler=function(){return R};var E=!1,M=function(e){R&&(e=R(e),R=null),v?(c(),e&&t.onPaste(e),v=!1):e==f.charAt(0)?E?t.execCommand("del",{source:"ace"}):t.execCommand("backspace",{source:"ace"}):(e.substring(0,2)==f?e=e.substr(2):e.charAt(0)==f.charAt(0)?e=e.substr(1):e.charAt(e.length-1)==f.charAt(0)&&(e=e.slice(0,-1)),e.charAt(e.length-1)==f.charAt(0)&&(e=e.slice(0,-1)),e&&t.onTextInput(e)),E&&(E=!1)},T=function(){if(!w){var e=g.value;M(e),u()}},_=function(e,t,i){var n=e.clipboardData||window.clipboardData;if(n&&!r){var s=a||i?"Text":"text/plain";try{return t?!1!==n.setData(s,t):n.getData(s)}catch(e){if(!i)return _(e,t,!0)}}},O=function(e,n){var s=t.getCopyText();if(!s)return i.preventDefault(e);_(e,s)?(n?t.onCut():t.onCopy(),i.preventDefault(e)):(p=!0,g.value=s,g.select(),setTimeout(function(){p=!1,u(),c(),n?t.onCut():t.onCopy()}))},F=function(e){O(e,!0)},I=function(e){O(e,!1)},W=function(e){var s=_(e);"string"==typeof s?(s&&t.onPaste(s,e),n.isIE&&setTimeout(c),i.preventDefault(e)):(g.value="",v=!0)};i.addCommandKeyListener(g,t.onCommandKey.bind(t)),i.addListener(g,"select",L),i.addListener(g,"input",T),i.addListener(g,"cut",F),i.addListener(g,"copy",I),i.addListener(g,"paste",W),(!("oncut"in g)||!("oncopy"in g)||!("onpaste"in g))&&i.addListener(e,"keydown",function(e){if((!n.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:I(e);break;case 86:W(e);break;case 88:F(e)}});var B=function(){w||!t.onCompositionStart||t.$readOnly||(w={},w.canUndo=t.session.$undoManager,t.onCompositionStart(),setTimeout(D,0),t.on("mousedown",H),w.canUndo&&!t.selection.isEmpty()&&(t.insert(""),t.session.markUndoGroup(),t.selection.clearSelection()),t.session.markUndoGroup())},D=function(){if(w&&t.onCompositionUpdate&&!t.$readOnly){var e=g.value.replace(m,"");if(w.lastValue!==e&&(t.onCompositionUpdate(e),w.lastValue&&t.undo(),w.canUndo&&(w.lastValue=e),w.lastValue)){var i=t.selection.getRange();t.insert(w.lastValue),t.session.markUndoGroup(),w.range=t.selection.getRange(),t.selection.setRange(i),t.selection.clearSelection()}}},H=function(e){if(t.onCompositionEnd&&!t.$readOnly){var i=w;w=!1;var s=setTimeout(function(){s=null;var e=g.value.replace(m,"");w||(e==i.lastValue?u():!i.lastValue&&e&&(u(),M(e)))});R=function(e){return s&&clearTimeout(s),e=e.replace(m,""),e==i.lastValue?"":(i.lastValue&&s&&t.undo(),e)},t.onCompositionEnd(),t.removeListener("mousedown",H),"compositionend"==e.type&&i.range&&t.selection.setRange(i.range);(n.isIE||n.isChrome&&n.isChrome>=53||n.isWebKit&&n.isWebKit>=603)&&T()}},P=o.delayedCall(D,50);i.addListener(g,"compositionstart",B),i.addListener(g,"compositionupdate",function(){P.schedule()}),i.addListener(g,"keyup",function(){P.schedule()}),i.addListener(g,"keydown",function(){P.schedule()}),i.addListener(g,"compositionend",H),this.getElement=function(){return g},this.setCommandMode=function(e){C=e,g.readOnly=!1},this.setReadOnly=function(e){C||(g.readOnly=e)},this.setCopyWithEmptySelection=function(e){y=e},this.onContextMenu=function(e){E=!0,c(t.selection.isEmpty()),t._emit("nativecontextmenu",{target:t,domEvent:e}),this.moveToMouse(e,!0)},this.moveToMouse=function(e,o){b||(b=g.style.cssText),g.style.cssText=(o?"z-index:100000;":"")+"height:"+g.style.height+";"+(n.isIE?"opacity:0.1;":"");var r=t.container.getBoundingClientRect(),a=s.computedStyle(t.container),l=r.top+(parseInt(a.borderTopWidth)||0),h=r.left+(parseInt(r.borderLeftWidth)||0),c=r.bottom-l-g.clientHeight-2,u=function(e){g.style.left=e.clientX-h-2+"px",g.style.top=Math.min(e.clientY-l-2,c)+"px"};u(e),"mousedown"==e.type&&(t.renderer.$keepTextAreaAtCursor&&(t.renderer.$keepTextAreaAtCursor=null),clearTimeout(N),n.isWin&&i.capture(t.container,u,d))},this.onContextMenuClose=d;var N,z=function(e){t.textInput.onContextMenu(e),d()};i.addListener(g,"mouseup",z),i.addListener(g,"mousedown",function(e){e.preventDefault(),d()}),i.addListener(t.renderer.scroller,"contextmenu",z),i.addListener(g,"contextmenu",z)};t.TextInput=c}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t){"use strict";function i(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e)),t.setDefaultHandler("touchmove",this.onTouchMove.bind(e)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function n(e,t,i,n){return Math.sqrt(Math.pow(i-e,2)+Math.pow(n-t,2))}function s(e,t){if(e.start.row==e.end.row)var i=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)var i=2*t.row-e.start.row-e.end.row;else var i=t.column-4;return i<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}var o=(e("../lib/dom"),e("../lib/event"),e("../lib/useragent")),r=250;(function(){this.onMouseDown=function(e){var t=e.inSelection(),i=e.getDocumentPosition();this.mousedownEvent=e;var n=this.editor,s=e.getButton();return 0!==s?((n.getSelectionRange().isEmpty()||1==s)&&n.selection.moveToPosition(i),void(2==s&&(n.textInput.onContextMenu(e.domEvent),o.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||n.isFocused()||(n.focus(),!this.$focusTimeout||this.$clickSelection||n.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(i,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var i=this.editor;this.mousedownEvent.getShiftKey()?i.selection.selectToPosition(e):t||i.selection.moveToPosition(e),t||this.select(),i.renderer.scroller.setCapture&&i.renderer.scroller.setCapture(),i.setStyle("ace_selecting"),this.setState("select")},this.select=function(){var e,t=this.editor,i=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var n=this.$clickSelection.comparePoint(i);if(-1==n)e=this.$clickSelection.end;else if(1==n)e=this.$clickSelection.start;else{var o=s(this.$clickSelection,i);i=o.cursor,e=o.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(i),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,i=this.editor,n=i.renderer.screenToTextCoordinates(this.x,this.y),o=i.selection[e](n.row,n.column);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(o.start),a=this.$clickSelection.comparePoint(o.end);if(-1==r&&a<=0)t=this.$clickSelection.end,o.end.row==n.row&&o.end.column==n.column||(n=o.start);else if(1==a&&r>=0)t=this.$clickSelection.start,o.start.row==n.row&&o.start.column==n.column||(n=o.end);else if(-1==r&&1==a)n=o.end,t=o.start;else{var l=s(this.$clickSelection,n);n=l.cursor,t=l.anchor}i.selection.setSelectionAnchor(t.row,t.column)}i.selection.selectToPosition(n),i.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e=n(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),t=Date.now();(e>0||t-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),i=this.editor,n=i.session,s=n.getBracketRange(t);s?(s.isEmpty()&&(s.start.column--,s.end.column++),this.setState("select")):(s=i.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=s,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),i=this.editor;this.setState("selectByLines");var n=i.getSelectionRange();n.isMultiLine()&&n.contains(t.row,t.column)?(this.$clickSelection=i.selection.getLineRange(n.start.row),this.$clickSelection.end=i.selection.getLineRange(n.end.row).end):this.$clickSelection=i.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(){var e=this.editor;e.selectAll(),this.$clickSelection=e.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var i=this.$lastScroll,n=e.domEvent.timeStamp,s=n-i.t,o=s?e.wheelX/s:i.vx,a=s?e.wheelY/s:i.vy;s=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(h=!0),l<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(h=!0),h)i.allowed=n;else if(n-i.alloweda.session.documentToScreenRow(r.row,r.column))return i()}if(d!=n)if(d=n.text.join("
"),h.setHtml(d),h.show(),a._signal("showGutterTooltip",h),a.on("mousewheel",i),e.$tooltipFollowsMouse)o(u);else{var c=u.domEvent.target,g=c.getBoundingClientRect(),f=h.getElement().style;f.left=g.right+"px",f.top=g.bottom+"px"}}function i(){c&&(c=clearTimeout(c)),d&&(h.hide(),d=null,a._signal("hideGutterTooltip",h),a.removeEventListener("mousewheel",i))}function o(e){h.setPosition(e.x,e.y)}var a=e.editor,l=a.renderer.$gutterLayer,h=new n(a.container);e.editor.setDefaultHandler("guttermousedown",function(t){if(a.isFocused()&&0==t.getButton()){if("foldWidgets"!=l.getRegion(t)){var i=t.getDocumentPosition().row,n=a.session.selection;if(t.getShiftKey())n.selectTo(i,0);else{if(2==t.domEvent.detail)return a.selectAll(),t.preventDefault();e.$clickSelection=a.selection.getLineRange(i)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}}});var c,u,d;e.editor.setDefaultHandler("guttermousemove",function(n){var r=n.domEvent.target||n.domEvent.srcElement;if(s.hasCssClass(r,"ace_fold-widget"))return i();d&&e.$tooltipFollowsMouse&&o(n),u=n,c||(c=setTimeout(function(){c=null,u&&!e.isMousePressed?t():i()},50))}),r.addListener(a.renderer.$gutter,"mouseout",function(){u=null,d&&!c&&(c=setTimeout(function(){c=null,i()},50))}),a.on("changeSession",i)}function n(e){a.call(this,e)}var s=e("../lib/dom"),o=e("../lib/oop"),r=e("../lib/event"),a=e("../tooltip").Tooltip;o.inherits(n,a),function(){this.setPosition=function(e,t){var i=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,s=this.getWidth(),o=this.getHeight();e+=15,t+=15,e+s>i&&(e-=e+s-i),t+o>n&&(t-=20+o),a.prototype.setPosition.call(this,e,t)}}.call(n.prototype),t.GutterHandler=i}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t){"use strict";var i=e("../lib/event"),n=e("../lib/useragent"),s=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){i.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){i.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor,t=e.getSelectionRange();if(t.isEmpty())this.$inSelection=!1;else{var i=this.getDocumentPosition();this.$inSelection=t.contains(i.row,i.column)}return this.$inSelection},this.getButton=function(){return i.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=n.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t){"use strict";function i(e){function t(e,t){var i=Date.now(),s=!t||e.row!=t.row,o=!t||e.column!=t.column;if(!L||s||o)p.moveCursorToPosition(e),L=i,R={x:b,y:$};else{n(R.x,R.y,b,$)>h?L=null:i-L>=l&&(p.renderer.scrollCursorIntoView(),L=null)}}function i(e,t){var i=Date.now(),n=p.renderer.layerConfig.lineHeight,s=p.renderer.layerConfig.characterWidth,o=p.renderer.scroller.getBoundingClientRect(),r={x:{left:b-o.left,right:o.right-b},y:{top:$-o.top,bottom:o.bottom-$}},l=Math.min(r.x.left,r.x.right),h=Math.min(r.y.top,r.y.bottom),c={row:e.row,column:e.column};l/s<=2&&(c.column+=r.x.left=a&&p.renderer.scrollCursorIntoView(c):k=i:k=null}function c(){var e=S;S=p.renderer.screenToTextCoordinates(b,$),t(S,e),i(S,e)}function u(){C=p.selection.toOrientedRange(),w=p.session.addMarker(C,"ace_selection",p.getSelectionStyle()),p.clearSelection(),p.isFocused()&&p.renderer.$cursorLayer.setBlinking(!1),clearInterval(y),c(),y=setInterval(c,20),M=0,o.addListener(document,"mousemove",g)}function d(){clearInterval(y),p.session.removeMarker(w),w=null,p.selection.fromOrientedRange(C),p.isFocused()&&!x&&p.renderer.$cursorLayer.setBlinking(!p.getReadOnly()),C=null,S=null,M=0,k=null,L=null,o.removeListener(document,"mousemove",g)}function g(){null==T&&(T=setTimeout(function(){null!=T&&w&&d()},20))}function f(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return"text/plain"==e||"Text"==e})}function m(e){var t=["copy","copymove","all","uninitialized"],i=["move","copymove","linkmove","all","uninitialized"],n=r.isMac?e.altKey:e.ctrlKey,s="uninitialized";try{s=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var o="none";return n&&t.indexOf(s)>=0?o="copy":i.indexOf(s)>=0?o="move":t.indexOf(s)>=0&&(o="copy"),o}var p=e.editor,v=s.createElement("img");v.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",r.isOpera&&(v.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(t){e[t]=this[t]},this),p.addEventListener("mousedown",this.onMouseDown.bind(e));var w,b,$,y,C,S,A,x,k,L,R,E=p.container,M=0;this.onDragStart=function(e){if(this.cancelDrag||!E.draggable){var t=this;return setTimeout(function(){t.startSelect(),t.captureMouse(e)},0),e.preventDefault()}C=p.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=p.getReadOnly()?"copy":"copyMove",r.isOpera&&(p.container.appendChild(v),v.scrollTop=0),i.setDragImage&&i.setDragImage(v,0,0),r.isOpera&&p.container.removeChild(v),i.clearData(),i.setData("Text",p.session.getTextRange()),x=!0,this.setState("drag")},this.onDragEnd=function(e){if(E.draggable=!1,x=!1,this.setState(null),!p.getReadOnly()){var t=e.dataTransfer.dropEffect;!A&&"move"==t&&p.session.remove(p.getSelectionRange()),p.renderer.$cursorLayer.setBlinking(!0)}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!p.getReadOnly()&&f(e.dataTransfer))return b=e.clientX,$=e.clientY,w||u(),M++,e.dataTransfer.dropEffect=A=m(e),o.preventDefault(e)},this.onDragOver=function(e){if(!p.getReadOnly()&&f(e.dataTransfer))return b=e.clientX,$=e.clientY,w||(u(),M++),null!==T&&(T=null),e.dataTransfer.dropEffect=A=m(e),o.preventDefault(e)},this.onDragLeave=function(e){if(--M<=0&&w)return d(),A=null,o.preventDefault(e)},this.onDrop=function(e){if(S){var t=e.dataTransfer;if(x)switch(A){case"move":C=C.contains(S.row,S.column)?{start:S,end:S}:p.moveText(C,S);break;case"copy":C=p.moveText(C,S,!0)}else{var i=t.getData("Text");C={start:S,end:p.session.insert(S,i)},p.focus(),A=null}return d(),o.preventDefault(e)}},o.addListener(E,"dragstart",this.onDragStart.bind(e)),o.addListener(E,"dragend",this.onDragEnd.bind(e)),o.addListener(E,"dragenter",this.onDragEnter.bind(e)),o.addListener(E,"dragover",this.onDragOver.bind(e)),o.addListener(E,"dragleave",this.onDragLeave.bind(e)),o.addListener(E,"drop",this.onDrop.bind(e));var T=null}function n(e,t,i,n){return Math.sqrt(Math.pow(i-e,2)+Math.pow(n-t,2))}var s=e("../lib/dom"),o=e("../lib/event"),r=e("../lib/useragent"),a=200,l=200,h=5;(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(){this.editor.renderer.$cursorLayer.setBlinking(!this.editor.getReadOnly()),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=r.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(){var e=this.editor.container;if(r.isIE&&"dragReady"==this.state){var t=n(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);t>3&&e.dragDrop()}if("dragWait"===this.state){var t=n(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);t>0&&(e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,i=e.inSelection(),n=e.getButton();if(1===(e.domEvent.detail||1)&&0===n&&i){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var s=e.domEvent.target||e.domEvent.srcElement;if("unselectable"in s&&(s.unselectable="on"),t.getDragDelay()){if(r.isWebKit){this.cancelDrag=!0;t.container.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(i.prototype),t.DragdropHandler=i}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(e,t){"use strict";var i=e("./dom");t.get=function(e,t){var i=new XMLHttpRequest;i.open("GET",e,!0),i.onreadystatechange=function(){4===i.readyState&&t(i.responseText)},i.send(null)},t.loadScript=function(e,t){var n=i.getDocumentHead(),s=document.createElement("script");s.src=e,n.appendChild(s),s.onload=s.onreadystatechange=function(e,i){!i&&s.readyState&&"loaded"!=s.readyState&&"complete"!=s.readyState||(s=s.onload=s.onreadystatechange=null,i||t())}},t.qualifyURL=function(e){var t=document.createElement("a");return t.href=e,t.href}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(e,t){"use strict";var i={},n=function(){this.propagationStopped=!0},s=function(){this.defaultPrevented=!0};i._emit=i._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var i=this._eventRegistry[e]||[],o=this._defaultHandlers[e];if(i.length||o){"object"==typeof t&&t||(t={}),t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=n),t.preventDefault||(t.preventDefault=s),i=i.slice();for(var r=0;r1&&(s=i[i.length-2]);var r=h[t+"Path"];return null==r?r=h.basePath:"/"==n&&(t=n=""),r&&"/"!=r.slice(-1)&&(r+="/"),r+t+n+s+this.get("suffix")},t.setModuleUrl=function(e,t){return h.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(i,n){var s,o;Array.isArray(i)&&(o=i[0],i=i[1]);try{s=e(i)}catch(e){}if(s&&!t.$loading[i])return n&&n(s);if(t.$loading[i]||(t.$loading[i]=[]),t.$loading[i].push(n),!(t.$loading[i].length>1)){var a=function(){e([i],function(e){t._emit("load.module",{name:i,module:e});var n=t.$loading[i];t.$loading[i]=null,n.forEach(function(t){t&&t(e)})})};if(!t.get("packaged"))return a();r.loadScript(t.moduleUrl(i,o),a)}},t.init=n}),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/config"],function(e,t){"use strict";var i=e("../lib/event"),n=e("../lib/useragent"),s=e("./default_handlers").DefaultHandlers,o=e("./default_gutter_handler").GutterHandler,r=e("./mouse_event").MouseEvent,a=e("./dragdrop_handler").DragdropHandler,l=e("../config"),h=function(e){var t=this;this.editor=e,new s(this),new o(this), -new a(this);var r=function(){(!document.hasFocus||!document.hasFocus()||!e.isFocused()&&document.activeElement==(e.textInput&&e.textInput.getElement()))&&window.focus(),e.focus()},l=e.renderer.getMouseEventTarget();i.addListener(l,"click",this.onMouseEvent.bind(this,"click")),i.addListener(l,"mousemove",this.onMouseMove.bind(this,"mousemove")),i.addMultiMouseDownListener([l,e.renderer.scrollBarV&&e.renderer.scrollBarV.inner,e.renderer.scrollBarH&&e.renderer.scrollBarH.inner,e.textInput&&e.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent"),i.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,"mousewheel")),i.addTouchMoveListener(e.container,this.onTouchMove.bind(this,"touchmove"));var h=e.renderer.$gutter;i.addListener(h,"mousedown",this.onMouseEvent.bind(this,"guttermousedown")),i.addListener(h,"click",this.onMouseEvent.bind(this,"gutterclick")),i.addListener(h,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick")),i.addListener(h,"mousemove",this.onMouseEvent.bind(this,"guttermousemove")),i.addListener(l,"mousedown",r),i.addListener(h,"mousedown",r),n.isIE&&e.renderer.scrollBarV&&(i.addListener(e.renderer.scrollBarV.element,"mousedown",r),i.addListener(e.renderer.scrollBarH.element,"mousedown",r)),e.on("mousemove",function(i){if(!t.state&&!t.$dragDelay&&t.$dragEnabled){var n=e.renderer.screenToTextCoordinates(i.x,i.y),s=e.session.selection.getRange(),o=e.renderer;!s.isEmpty()&&s.insideStart(n.row,n.column)?o.setCursorStyle("default"):o.setCursorStyle("")}})};(function(){this.onMouseEvent=function(e,t){this.editor._emit(e,new r(t,this.editor))},this.onMouseMove=function(e,t){var i=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;i&&i.length&&this.editor._emit(e,new r(t,this.editor))},this.onMouseWheel=function(e,t){var i=new r(t,this.editor);i.speed=2*this.$scrollSpeed,i.wheelX=t.wheelX,i.wheelY=t.wheelY,this.editor._emit(e,i)},this.onTouchMove=function(e,t){var i=new r(t,this.editor);i.speed=1,i.wheelX=t.wheelX,i.wheelY=t.wheelY,this.editor._emit(e,i)},this.setState=function(e){this.state=e},this.captureMouse=function(e,t){this.x=e.x,this.y=e.y,this.isMousePressed=!0;var s=this.editor,o=this.editor.renderer;o.$keepTextAreaAtCursor&&(o.$keepTextAreaAtCursor=null);var a=this,l=function(e){if(e)return n.isWebKit&&!e.which&&a.releaseMouse?a.releaseMouse():(a.x=e.clientX,a.y=e.clientY,t&&t(e),a.mouseEvent=new r(e,a.editor),a.$mouseMoved=!0,void 0)},h=function(e){s.off("beforeEndOperation",u),clearInterval(d),c(),a[a.state+"End"]&&a[a.state+"End"](e),a.state="",null==o.$keepTextAreaAtCursor&&(o.$keepTextAreaAtCursor=!0,o.$moveTextAreaToCursor()),a.isMousePressed=!1,a.$onCaptureMouseMove=a.releaseMouse=null,e&&a.onMouseEvent("mouseup",e)},c=function(){a[a.state]&&a[a.state](),a.$mouseMoved=!1};if(n.isOldIE&&"dblclick"==e.domEvent.type)return setTimeout(function(){h(e)});var u=function(){s.curOp.command.name&&s.curOp.selectionChanged&&(a[a.state+"End"]&&a[a.state+"End"](),a.state="",a.releaseMouse())};s.on("beforeEndOperation",u),a.$onCaptureMouseMove=l,a.releaseMouse=i.capture(this.editor.container,l,h);var d=setInterval(c,20)},this.releaseMouse=null,this.cancelContextMenu=function(){var e=function(t){t&&t.domEvent&&"contextmenu"!=t.domEvent.type||(this.editor.off("nativecontextmenu",e),t&&t.domEvent&&i.stopEvent(t.domEvent))}.bind(this);setTimeout(e,10),this.editor.on("nativecontextmenu",e)}}).call(h.prototype),l.defineOptions(h.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:n.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),t.MouseHandler=h}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(e,t){"use strict";function i(e){e.on("click",function(t){var i=t.getDocumentPosition(),s=e.session,o=s.getFoldAt(i.row,i.column,1);o&&(t.getAccelKey()?s.removeFold(o):s.expandFold(o),t.stop());var r=t.domEvent&&t.domEvent.target;r&&n.hasCssClass(r,"ace_inline_button")&&n.hasCssClass(r,"ace_toggle_wrap")&&(s.setOption("wrap",!0),e.renderer.scrollCursorIntoView())}),e.on("gutterclick",function(t){if("foldWidgets"==e.renderer.$gutterLayer.getRegion(t)){var i=t.getDocumentPosition().row,n=e.session;n.foldWidgets&&n.foldWidgets[i]&&e.session.onFoldWidgetClick(i,t),e.isFocused()||e.focus(),t.stop()}}),e.on("gutterdblclick",function(t){if("foldWidgets"==e.renderer.$gutterLayer.getRegion(t)){var i=t.getDocumentPosition().row,n=e.session,s=n.getParentFoldRangeData(i,!0),o=s.range||s.firstRange;if(o){i=o.start.row;var r=n.getFoldAt(i,n.getLine(i).length,1);r?n.removeFold(r):(n.addFold("...",o),e.renderer.scrollCursorIntoView({row:o.start.row,column:0}))}t.stop()}})}var n=e("../lib/dom");t.FoldHandler=i}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(e,t){"use strict";var i=e("../lib/keys"),n=e("../lib/event"),s=function(e){this.$editor=e,this.$data={editor:e},this.$handlers=[],this.setDefaultHandler(e.commands)};(function(){this.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0)},this.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]!=e){for(;t[t.length-1]&&t[t.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)}},this.addKeyboardHandler=function(e,t){if(e){"function"==typeof e&&!e.handleKeyboard&&(e.handleKeyboard=e);var i=this.$handlers.indexOf(e);-1!=i&&this.$handlers.splice(i,1),t==undefined?this.$handlers.push(e):this.$handlers.splice(t,0,e),-1==i&&e.attach&&e.attach(this.$editor)}},this.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return-1!=t&&(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},this.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},this.getStatusText=function(){var e=this.$data,t=e.editor;return this.$handlers.map(function(i){return i.getStatusText&&i.getStatusText(t,e)||""}).filter(Boolean).join(" ")},this.$callKeyboardHandlers=function(e,t,i,s){for(var o,r=!1,a=this.$editor.commands,l=this.$handlers.length;l--&&!((o=this.$handlers[l].handleKeyboard(this.$data,e,t,i,s))&&o.command&&((r="null"==o.command||a.exec(o.command,this.$editor,o.args,s))&&s&&-1!=e&&1!=o.passEvent&&1!=o.command.passEvent&&n.stopEvent(s),r)););return!r&&-1==e&&(o={command:"insertstring"},r=a.exec("insertstring",this.$editor,t)),r&&this.$editor._signal&&this.$editor._signal("keyboardActivity",o),r},this.onCommandKey=function(e,t,n){var s=i.keyCodeToString(n);this.$callKeyboardHandlers(t,s,n,e)},this.onTextInput=function(e){this.$callKeyboardHandlers(-1,e)}}).call(s.prototype),t.KeyBinding=s}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(e,t){"use strict";function i(e,t,i,n){var f=r?g:d,m=null,p=null,v=null,w=0,b=null,C=-1,A=null,x=null,k=[];if(!n)for(A=0,n=[];A0)if(16==b){for(A=C;A-1){for(A=C;A=0&&n[L]==S;L--)t[L]=r}}function n(e,t,i){if(!(a=e){for(n=u+1;n=e;)n++;for(s=u,o=n-1;s=t.length||(s=i[n-1])!=v&&s!=w||(o=t[n+1])!=v&&o!=w?b:(l&&(o=w),o==s?o:b);case x:return s=n>0?i[n-1]:$,s==v&&n+10&&i[n-1]==v)return v;if(l)return b;for(d=n+1,a=t.length;d=1425&&f<=2303||64286==f;if(s=t[d],F&&(s==p||s==C))return p}return n<1||(s=t[n-1])==$?b:i[n-1];case $:return l=!1,c=!0,r;case y:return u=!0,b;case R:case E:case T:case _:case M:l=!1;case O:return b}}function o(e){var t=e.charCodeAt(0),i=t>>8;return 0==i?t>191?m:F[t]:5==i?/[\u0591-\u05f4]/.test(e)?p:m:6==i?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?L:/[\u0660-\u0669\u066b-\u066c]/.test(e)?w:1642==t?k:/[\u06f0-\u06f9]/.test(e)?v:C:32==i&&t<=8287?I[255&t]:254==i&&t>=65136?C:b}var r=0,a=0,l=!1,h=!1,c=!1,u=!1,d=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],g=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],f=1,m=0,p=1,v=2,w=3,b=4,$=5,y=6,C=7,S=8,A=9,x=10,k=11,L=12,R=13,E=14,M=15,T=16,_=17,O=18,F=[O,O,O,O,O,O,O,O,O,y,$,y,S,$,O,O,O,O,O,O,O,O,O,O,O,O,O,O,$,$,$,y,S,b,b,k,k,k,b,b,b,b,b,x,A,x,A,A,v,v,v,v,v,v,v,v,v,v,A,b,b,b,b,b,b,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,b,b,b,b,b,b,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,b,b,b,b,O,O,O,O,O,O,$,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,A,b,k,k,k,k,b,b,b,b,m,b,b,O,b,b,k,k,v,v,b,m,b,b,b,v,m,b,b,b,b,b],I=[S,S,S,S,S,S,S,S,S,S,S,O,O,O,m,p,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,S,$,R,E,M,T,_,A,k,k,k,k,k,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,A,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,S];t.L=m,t.R=p,t.EN=v,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.DOT="\xb7",t.doBidiReorder=function(e,s,o){if(e.length<2)return{};var a=e.split(""),l=new Array(a.length),h=new Array(a.length),c=[];r=o?f:0,i(a,c,a.length,s);for(var u=0;uC&&s[u]0&&"\u0644"===a[u-1]&&/\u0622|\u0623|\u0625|\u0627/.test(a[u])&&(c[u-1]=c[u]=t.R_H,u++);a[a.length-1]===t.DOT&&(c[a.length-1]=t.B);for(var u=0;u=0&&(e=this.session.$docRowCache[i])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var i,n=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(i=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===n;)n=i,e++;return e},this.updateRowLine=function(e,t){if(e===undefined&&(e=this.getDocumentRow()),this.wrapIndent=0,this.isLastRow=e===this.session.getLength()-1,this.line=this.session.getLine(e),this.session.$useWrapMode){var s=this.session.$wrapData[e];s&&(t===undefined&&(t=this.getSplitIndex()),t>0&&s.length?(this.wrapIndent=s.indent,this.line=t0?e-1:0,this.bidiMap),n=this.bidiMap.bidiLevels,s=0;0===e&&n[t]%2!=0&&t++;for(var o=0;o=h&&sn+r/2;){if(n+=r,s===o.length-1){r=0;break}r=this.charWidths[o[++s]]}return s>0&&o[s-1]%2!=0&&o[s]%2==0?(e0&&o[s-1]%2==0&&o[s]%2!=0?t=1+(e>n?this.bidiMap.logicalFromVisual[s]:this.bidiMap.logicalFromVisual[s-1]):this.isRtlDir&&s===o.length-1&&0===r&&o[s-1]%2==0||!this.isRtlDir&&0===s&&o[s]%2!=0?t=1+this.bidiMap.logicalFromVisual[s]:(s>0&&o[s-1]%2!=0&&0!==r&&s--,t=this.bidiMap.logicalFromVisual[s]),t+this.wrapIndent}}).call(r.prototype),t.BidiHandler=r}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t){"use strict";var i=e("./lib/oop"),n=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,r=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),!t.$isEmpty&&!t.$silent&&t._emit("changeSelection"),!t.$keepDesiredColumnOnChange&&e.old.column!=e.value.column&&(t.$desiredColumn=null)}),this.anchor.on("change",function(){t.$anchorChanged=!0,!t.$isEmpty&&!t.$silent&&t._emit("changeSelection")})};(function(){i.implement(this,s),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var i=t?e.end:e.start,n=t?e.start:e.end;this.$setSelection(i.row,i.column,n.row,n.column)},this.$setSelection=function(e,t,i,n){var s=this.$isEmpty,r=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(i,n),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||s!=this.$isEmpty||r)&&this._emit("changeSelection")},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(void 0===t){var i=e||this.lead;e=i.row,t=i.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var i,n="number"==typeof e?e:this.lead.row,s=this.session.getFoldLine(n);return s?(n=s.start.row,i=s.end.row):i=n,!0===t?new o(n,0,i,this.session.getLine(i).length):new o(n,0,i+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,i){var n=e.column,s=e.column+t;return i<0&&(n=e.column-t,s=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(n,s).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var i=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,i,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-i):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=n)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,i=this.doc.getLine(e),n=i.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var s=this.session.getFoldAt(e,t,1);return s?void this.moveCursorTo(s.end.row,s.end.column):(this.session.nonTokenRe.exec(n)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,n=i.substring(t)),t>=i.length?(this.moveCursorTo(e,i.length),this.moveCursorRight(),e0&&this.moveCursorWordLeft(),void 0;this.session.tokenRe.exec(o)&&(i-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,i)},this.$shortWordEndIndex=function(e){var t,i=0,n=/\s/,s=this.session.tokenRe;if(s.lastIndex=0,this.session.tokenRe.exec(e))i=this.session.tokenRe.lastIndex;else{for(;(t=e[i])&&n.test(t);)i++;if(i<1)for(s.lastIndex=0;(t=e[i])&&!s.test(t);)if(s.lastIndex=0,i++,n.test(t)){if(i>2){i--;break}for(;(t=e[i])&&n.test(t);)i++;if(i>2)break}}return s.lastIndex=0,i},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,i=this.doc.getLine(e),n=i.substring(t),s=this.session.getFoldAt(e,t,1);if(s)return this.moveCursorTo(s.end.row,s.end.column);if(t==i.length){var o=this.doc.getLength();do{e++,n=this.doc.getLine(e)}while(e0&&/^\s*$/.test(s));i=s.length,/\s+$/.test(s)||(s="")}var o=n.stringReverse(s),r=this.$shortWordEndIndex(o);return this.moveCursorTo(t,i-r)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var i,n=this.session.documentToScreenPosition(this.lead.row,this.lead.column);0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(n.row,this.lead.row)?(i=this.session.$bidiHandler.getPosLeft(n.column),n.column=Math.round(i/this.session.$bidiHandler.charWidths[0])):i=n.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?n.column=this.$desiredColumn:this.$desiredColumn=n.column);var s=this.session.screenToDocumentPosition(n.row+e,n.column,i);0!==e&&0===t&&s.row===this.lead.row&&s.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[s.row]&&(s.row>0||e>0)&&s.row++,this.moveCursorTo(s.row,s.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,i){var n=this.session.getFoldAt(e,t,1);n&&(e=n.start.row,t=n.start.column),this.$keepDesiredColumnOnChange=!0;var s=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(s.charAt(t))&&s.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,i||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,i){var n=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(n.row,n.column,i)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var i=this.getCursor();return o.fromPoints(t,i)}catch(e){return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else{var e=this.getRange();e.isBackwards=this.isBackwards()}return e},this.fromJSON=function(e){if(e.start==undefined){if(this.rangeList){this.toSingleRange(e[0]);for(var t=e.length;t--;){var i=o.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(i.cursor=i.start),this.addRange(i,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(r.prototype),t.Selection=r}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t){"use strict";var i=e("./config"),n=2e3,s=function(e){this.states=e,this.regExps={},this.matchMappings={};for(var t in this.states){for(var i=this.states[t],n=[],s=0,o=this.matchMappings[t]={defaultToken:"text"},r="g",a=[],l=0;l1?this.$applyToken:h.token),u>1&&(/\\\d/.test(h.regex)?c=h.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+s+1)}):(u=1,c=this.removeCapturingGroups(h.regex)),!h.splitRegex&&"string"!=typeof h.token&&a.push(h)),o[s]=l,s+=u,n.push(c),h.onMatch||(h.onMatch=null)}}n.length||(o[0]=0,n.push("$")),a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,r)},this),this.regExps[t]=new RegExp("("+n.join(")|(")+")|($)",r)}};(function(){this.$setMaxTokenCount=function(e){n=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),i=this.token.apply(this,t);if("string"==typeof i)return[{type:i,value:e}];for(var n=[],s=0,o=i.length;sc){var v=e.substring(c,p-m.length);d.type==g?d.value+=v:(d.type&&h.push(d),d={type:g,value:v})}for(var w=0;wn){for(u>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});c1&&i[0]!==s&&i.unshift("#tmp",s),{tokens:h,state:i.length?i:s}},this.reportError=i.reportError}).call(s.prototype),t.Tokenizer=s}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t){"use strict";var i=e("../lib/lang"),n=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var i in e){for(var n=e[i],s=0;s=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,i=e[t].start;if(i!==undefined)return i;for(i=0;t>0;)t-=1,i+=e[t].value.length;return i},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new i(this.$row,t,this.$row,t+e.value.length)}}).call(n.prototype),t.TokenIterator=n}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t){"use strict";var i,n=e("../../lib/oop"),s=e("../behaviour").Behaviour,o=e("../../token_iterator").TokenIterator,r=e("../../lib/lang"),a=["text","paren.rparen","punctuation.operator"],l=["text","paren.rparen","punctuation.operator","comment"],h={},c={'"':'"',"'":"'"},u=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,h.rangeCount!=e.multiSelect.rangeCount&&(h={rangeCount:e.multiSelect.rangeCount})),h[t])return i=h[t];i=h[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},d=function(e,t,i,n){var s=e.end.row-e.start.row;return{text:i+t+n,selection:[0,e.start.column+1,s,e.end.column+(s?0:1)]}},g=function(e){this.add("braces","insertion",function(t,n,s,o,a){var l=s.getCursorPosition(),h=o.doc.getLine(l.row);if("{"==a){u(s);var c=s.getSelectionRange(),f=o.doc.getTextRange(c);if(""!==f&&"{"!==f&&s.getWrapBehavioursEnabled())return d(c,f,"{","}");if(g.isSaneInsertion(s,o))return/[\]\}\)]/.test(h[l.column])||s.inMultiSelectMode||e&&e.braces?(g.recordAutoInsert(s,o,"}"),{text:"{}",selection:[1,1]}):(g.recordMaybeInsert(s,o,"{"),{text:"{",selection:[1,1]})}else if("}"==a){u(s);var m=h.substring(l.column,l.column+1);if("}"==m){var p=o.$findOpeningBracket("}",{column:l.column+1,row:l.row});if(null!==p&&g.isAutoInsertedClosing(l,h,a))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if("\n"==a||"\r\n"==a){u(s);var v="";g.isMaybeInsertedClosing(l,h)&&(v=r.stringRepeat("}",i.maybeInsertedBrackets),g.clearMaybeInsertedClosing());var m=h.substring(l.column,l.column+1);if("}"===m){var w=o.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!w)return null;var b=this.$getIndent(o.getLine(w.row))}else{if(!v)return void g.clearMaybeInsertedClosing();var b=this.$getIndent(h)}var $=b+o.getTabString();return{text:"\n"+$+"\n"+b+v,selection:[1,$.length,1,$.length]}}g.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,s,o){var r=s.doc.getTextRange(o);if(!o.isMultiLine()&&"{"==r){u(n);if("}"==s.doc.getLine(o.start.row).substring(o.end.column,o.end.column+1))return o.end.column++,o;i.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,i,n,s){if("("==s){u(i);var o=i.getSelectionRange(),r=n.doc.getTextRange(o);if(""!==r&&i.getWrapBehavioursEnabled())return d(o,r,"(",")");if(g.isSaneInsertion(i,n))return g.recordAutoInsert(i,n,")"),{text:"()",selection:[1,1]}}else if(")"==s){u(i);var a=i.getCursorPosition(),l=n.doc.getLine(a.row),h=l.substring(a.column,a.column+1);if(")"==h){var c=n.$findOpeningBracket(")",{column:a.column+1,row:a.row});if(null!==c&&g.isAutoInsertedClosing(a,l,s))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,i,n,s){var o=n.doc.getTextRange(s);if(!s.isMultiLine()&&"("==o){u(i);if(")"==n.doc.getLine(s.start.row).substring(s.start.column+1,s.start.column+2))return s.end.column++,s}}),this.add("brackets","insertion",function(e,t,i,n,s){if("["==s){u(i);var o=i.getSelectionRange(),r=n.doc.getTextRange(o);if(""!==r&&i.getWrapBehavioursEnabled())return d(o,r,"[","]");if(g.isSaneInsertion(i,n))return g.recordAutoInsert(i,n,"]"),{text:"[]",selection:[1,1]}}else if("]"==s){u(i);var a=i.getCursorPosition(),l=n.doc.getLine(a.row),h=l.substring(a.column,a.column+1);if("]"==h){var c=n.$findOpeningBracket("]",{column:a.column+1,row:a.row});if(null!==c&&g.isAutoInsertedClosing(a,l,s))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,i,n,s){var o=n.doc.getTextRange(s);if(!s.isMultiLine()&&"["==o){u(i);if("]"==n.doc.getLine(s.start.row).substring(s.start.column+1,s.start.column+2))return s.end.column++,s}}),this.add("string_dquotes","insertion",function(e,t,i,n,s){var o=n.$mode.$quotes||c;if(1==s.length&&o[s]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(s))return;u(i);var r=s,a=i.getSelectionRange(),l=n.doc.getTextRange(a);if(""!==l&&(1!=l.length||!o[l])&&i.getWrapBehavioursEnabled())return d(a,l,r,r);if(!l){var h=i.getCursorPosition(),g=n.doc.getLine(h.row),f=g.substring(h.column-1,h.column),m=g.substring(h.column,h.column+1),p=n.getTokenAt(h.row,h.column),v=n.getTokenAt(h.row,h.column+1);if("\\"==f&&p&&/escape/.test(p.type))return null;var w,b=p&&/string|escape/.test(p.type),$=!v||/string|escape/.test(v.type);if(m==r)(w=b!==$)&&/string\.end/.test(v.type)&&(w=!1);else{if(b&&!$)return null;if(b&&$)return null;var y=n.$mode.tokenRe;y.lastIndex=0;var C=y.test(f);y.lastIndex=0;var S=y.test(f);if(C||S)return null;if(m&&!/[\s;,.})\]\\]/.test(m))return null;w=!0}return{text:w?r+r:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,i,n,s){var o=n.doc.getTextRange(s);if(!s.isMultiLine()&&('"'==o||"'"==o)){u(i);if(n.doc.getLine(s.start.row).substring(s.start.column+1,s.start.column+2)==o)return s.end.column++,s}})};g.isSaneInsertion=function(e,t){var i=e.getCursorPosition(),n=new o(t,i.row,i.column);if(!this.$matchTokenType(n.getCurrentToken()||"text",a)){var s=new o(t,i.row,i.column+1);if(!this.$matchTokenType(s.getCurrentToken()||"text",a))return!1}return n.stepForward(),n.getCurrentTokenRow()!==i.row||this.$matchTokenType(n.getCurrentToken()||"text",l)},g.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},g.recordAutoInsert=function(e,t,n){var s=e.getCursorPosition(),o=t.doc.getLine(s.row);this.isAutoInsertedClosing(s,o,i.autoInsertedLineEnd[0])||(i.autoInsertedBrackets=0),i.autoInsertedRow=s.row,i.autoInsertedLineEnd=n+o.substr(s.column),i.autoInsertedBrackets++},g.recordMaybeInsert=function(e,t,n){var s=e.getCursorPosition(),o=t.doc.getLine(s.row);this.isMaybeInsertedClosing(s,o)||(i.maybeInsertedBrackets=0),i.maybeInsertedRow=s.row,i.maybeInsertedLineStart=o.substr(0,s.column)+n,i.maybeInsertedLineEnd=o.substr(s.column),i.maybeInsertedBrackets++},g.isAutoInsertedClosing=function(e,t,n){return i.autoInsertedBrackets>0&&e.row===i.autoInsertedRow&&n===i.autoInsertedLineEnd[0]&&t.substr(e.column)===i.autoInsertedLineEnd},g.isMaybeInsertedClosing=function(e,t){return i.maybeInsertedBrackets>0&&e.row===i.maybeInsertedRow&&t.substr(e.column)===i.maybeInsertedLineEnd&&t.substr(0,e.column)==i.maybeInsertedLineStart},g.popAutoInsertedClosing=function(){i.autoInsertedLineEnd=i.autoInsertedLineEnd.substr(1),i.autoInsertedBrackets--},g.clearMaybeInsertedClosing=function(){i&&(i.maybeInsertedBrackets=0,i.maybeInsertedRow=-1)},n.inherits(g,s),t.CstyleBehaviour=g}),ace.define("ace/unicode",["require","exports","module"],function(e,t){"use strict";for(var i=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],n=0,s=[],o=0;o2?n%c!=c-1:n%c==0}}else{if(!this.blockComment)return!1;var g=this.blockComment.start,b=this.blockComment.end,d=new RegExp("^(\\s*)(?:"+r.escapeRegExp(g)+")"),$=new RegExp("(?:"+r.escapeRegExp(b)+")\\s*$"),p=function(e,t){v(e,t)||a&&!/\S/.test(e)||(o.insertInLine({row:t,column:e.length},b),o.insertInLine({row:t,column:h},g))},f=function(e,t){var i;(i=e.match($))&&o.removeInLine(t,e.length-i[0].length,e.length),(i=e.match(d))&&o.removeInLine(t,i[1].length,i[0].length)},v=function(e,i){if(d.test(e))return!0;for(var n=t.getTokens(i),s=0;se.length&&(y=e.length)}),h==Infinity&&(h=y,a=!1,l=!1),u&&h%c!=0&&(h=Math.floor(h/c)*c),s(l?f:p)},this.toggleBlockComment=function(e,t,i,n){var s=this.blockComment;if(s){!s.start&&s[0]&&(s=s[0]);var o,r,h=new a(t,n.row,n.column),c=h.getCurrentToken(),u=(t.selection,t.selection.toOrientedRange());if(c&&/comment/.test(c.type)){for(var d,g;c&&/comment/.test(c.type);){var f=c.value.indexOf(s.start);if(-1!=f){var m=h.getCurrentTokenRow(),p=h.getCurrentTokenColumn()+f;d=new l(m,p,m,p+s.start.length);break}c=h.stepBackward()}for(var h=new a(t,n.row,n.column),c=h.getCurrentToken();c&&/comment/.test(c.type);){var f=c.value.indexOf(s.end);if(-1!=f){var m=h.getCurrentTokenRow(),p=h.getCurrentTokenColumn()+f;g=new l(m,p,m,p+s.end.length);break}c=h.stepForward()}g&&t.remove(g),d&&(t.remove(d),o=d.start.row,r=-s.start.length)}else r=s.start.length,o=i.start.row,t.insert(i.end,s.end),t.insert(i.start,s.start);u.start.row==o&&(u.start.column+=r),u.end.row==o&&(u.end.column+=r),t.selection.fromOrientedRange(u)}},this.getNextLineIndent=function(e,t){return this.$getIndent(t)},this.checkOutdent=function(){return!1},this.autoOutdent=function(){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(){return null},this.createModeDelegates=function(e){this.$embeds=[],this.$modes={};for(var t in e)e[t]&&(this.$embeds.push(t),this.$modes[t]=new e[t]);for(var i=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],t=0;t=0&&t.row=0&&t.column<=e[t.row].length}t.applyDelta=function(e,t){var i=t.start.row,n=t.start.column,s=e[i]||"";switch(t.action){case"insert":if(1===t.lines.length)e[i]=s.substring(0,n)+t.lines[0]+s.substring(n);else{var o=[i,1].concat(t.lines);e.splice.apply(e,o),e[i]=s.substring(0,n)+e[i],e[i+t.lines.length-1]+=s.substring(n)}break;case"remove":var r=t.end.column,a=t.end.row;i===a?e[i]=s.substring(0,n)+s.substring(r):e.splice(i,a-i+1,s.substring(0,n)+e[a].substring(r))}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t){"use strict";var i=e("./lib/oop"),n=e("./lib/event_emitter").EventEmitter,s=t.Anchor=function(e,t,i){this.$onChange=this.onChange.bind(this),this.attach(e),void 0===i?this.setPosition(t.row,t.column):this.setPosition(t,i)};(function(){function e(e,t,i){var n=i?e.column<=t.column:e.columnthis.row)){var i=t(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(i.row,i.column,!0)}},this.setPosition=function(e,t,i){var n;if(n=i?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=n.row||this.column!=n.column){var s={row:this.row,column:this.column};this.row=n.row,this.column=n.column,this._signal("change",{old:s,value:n})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var i={};return e>=this.document.getLength()?(i.row=Math.max(0,this.document.getLength()-1),i.column=this.document.getLine(i.row).length):e<0?(i.row=0,i.column=0):(i.row=e,i.column=Math.min(this.document.getLine(i.row).length,Math.max(0,t))),t<0&&(i.column=0),i}}).call(s.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t){"use strict";var i=e("./lib/oop"),n=e("./apply_delta").applyDelta,s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,r=e("./anchor").Anchor,a=function(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){i.implement(this,s),this.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new r(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{t=this.getLines(e.start.row,e.end.row),t[0]=(t[0]||"").substring(e.start.column);var i=t.length-1;e.end.row-e.start.row==i&&(t[i]=t[i].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var i=this.clippedPos(e.row,e.column),n=this.pos(e.row,e.column+t.length);return this.applyDelta({start:i,end:n,action:"insert",lines:[t]},!0),this.clonePos(n)},this.clippedPos=function(e,t){var i=this.getLength();e===undefined?e=i:e<0?e=0:e>=i&&(e=i-1,t=undefined);var n=this.getLine(e);return t==undefined&&(t=n.length),t=Math.min(Math.max(t,0),n.length),{row:e,column:t}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){e=Math.min(Math.max(e,0),this.getLength());var i=0;e0,n=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){if(e instanceof o||(e=o.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;this.remove(e);return t?this.insert(e.start,t):e.start},this.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var i="insert"==e.action;(i?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))||(i&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(n(this.$lines,e,t),this._signal("change",e)))},this.$splitAndapplyLargeDelta=function(e,t){for(var i=e.lines,n=i.length-t+1,s=e.start.row,o=e.start.column,r=0,a=0;r20){t.running=setTimeout(t.$worker,20);break}}t.currentLine=i,-1==n&&(n=i),o<=n&&t.fireUpdateEvent(o,n)}}};(function(){i.implement(this,n),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var i={first:e,last:t};this._signal("update",{data:i})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,i=e.end.row-t;if(0===i)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,i+1,null),this.states.splice(t,i+1,null);else{var n=Array(i+1);n.unshift(t,1),this.lines.splice.apply(this.lines,n),this.states.splice.apply(this.states,n)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),i=this.states[e-1],n=this.tokenizer.getLineTokens(t,i,e);return this.states[e]+""!=n.state+""?(this.states[e]=n.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=n.tokens}}).call(s.prototype),t.BackgroundTokenizer=s}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t){"use strict";var i=e("./lib/lang"),n=(e("./lib/oop"),e("./range").Range),s=function(e,t,i){this.setRegexp(e),this.clazz=t,this.type=i||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,s,o){if(this.regExp)for(var r=o.firstRow,a=o.lastRow,l=r;l<=a;l++){var h=this.cache[l];null==h&&(h=i.getMatchOffsets(s.getLine(l),this.regExp),h.length>this.MAX_RANGES&&(h=h.slice(0,this.MAX_RANGES)),h=h.map(function(e){return new n(l,e.offset,l,e.offset+e.length)}),this.cache[l]=h.length?h:"");for(var c=h.length;c--;)t.drawSingleLineMarker(e,h[c].toScreenRange(s),this.clazz,o)}}}).call(s.prototype),t.SearchHighlight=s}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t){"use strict";function i(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var i=t[t.length-1];this.range=new n(t[0].start.row,t[0].start.column,i.end.row,i.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}var n=e("../range").Range;(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},this.addFold=function(e){if(e.sameRow){if(e.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,i){var n,s,o,r=0,a=this.folds,l=!0;null==t&&(t=this.end.row,i=this.end.column);for(var h=0;h0)){var l=n(e,r.start);return 0===a?t&&0!==l?-o-2:o:l>0||0===l&&!t?o:-o-1}}return-o-1},this.add=function(e){var t=!e.isEmpty(),i=this.pointIndex(e.start,t);i<0&&(i=-i-1);var n=this.pointIndex(e.end,t,i);return n<0?n=-n-1:n++,this.ranges.splice(i,n-i,e)},this.addList=function(e){for(var t=[],i=e.length;i--;)t.push.apply(t,this.add(e[i]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){var e=[],t=this.ranges;t=t.sort(function(e,t){return n(e.start,t.start)});for(var i,s=t[0],o=1;o=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},this.clipRows=function(e,t){var i=this.ranges;if(i[0].start.row>t||i[i.length-1].start.row=n)break}if("insert"==e.action)for(var h=s-n,c=-t.column+i.column;rn)break;if(l.start.row==n&&l.start.column>=t.column&&(l.start.column!=t.column||!this.$insertRight)&&(l.start.column+=c,l.start.row+=h),l.end.row==n&&l.end.column>=t.column){if(l.end.column==t.column&&this.$insertRight)continue;l.end.column==t.column&&c>0&&rl.start.column&&l.end.column==o[r+1].start.column&&(l.end.column-=c),l.end.column+=c,l.end.row+=h}}else for(var h=n-s,c=t.column-i.column;rs)break;l.end.rowt.column)&&(l.end.column=t.column,l.end.row=t.row):(l.end.column+=c,l.end.row+=h)),l.start.row==s&&(l.start.column<=i.column?(h||l.start.column>t.column)&&(l.start.column=t.column,l.start.row=t.row):(l.start.column+=c,l.start.row+=h))}if(0!=h&&r=e)return s;if(s.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var i=this.$foldData,n=0;for(t&&(n=i.indexOf(t)),-1==n&&(n=0),n;n=e)return s}return null},this.getFoldedRowCount=function(e,t){for(var i=this.$foldData,n=t-e+1,s=0;s=t){a=e?n-=t-a:n=0);break}r>=e&&(n-=a>=e?r-a:r-e+1)}return n},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var i,n=this.$foldData,r=!1;e instanceof o?i=e:(i=new o(t,e),i.collapseChildren=t.collapseChildren),this.$clipRangeToDocument(i.range);var a=i.start.row,l=i.start.column,h=i.end.row,c=i.end.column;if(a0&&(this.removeFolds(g),g.forEach(function(e){i.addSubFold(e)}));for(var f=0;f0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var i,s;if(null==e?(i=new n(0,0,this.getLength(),0),t=!0):i="number"==typeof e?new n(e,0,e,this.getLine(e).length):"row"in e?n.fromPoints(e,e):e,s=this.getFoldsInRangeList(i),t)this.removeFolds(s);else for(var o=s;o.length;)this.expandFolds(o),o=this.getFoldsInRangeList(i);if(s.length)return s},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var i=this.getFoldLine(e,t);return i?i.end.row:e},this.getRowFoldStart=function(e,t){var i=this.getFoldLine(e,t);return i?i.start.row:e},this.getFoldDisplayLine=function(e,t,i,n,s){null==n&&(n=e.start.row),null==s&&(s=0),null==t&&(t=e.end.row),null==i&&(i=this.getLine(t).length);var o=this.doc,r="";return e.walk(function(e,t,i,a){if(!(tc)break}while(o&&l.test(o.type));o=s.stepBackward()}else o=s.getCurrentToken();return h.end.row=s.getCurrentTokenRow(),h.end.column=s.getCurrentTokenColumn()+o.value.length-2,h}},this.foldAll=function(e,t,i){i==undefined&&(i=1e5);var n=this.foldWidgets;if(n){t=t||this.getLength(),e=e||0;for(var s=e;s=e){s=o.end.row;try{var r=this.addFold("...",o);r&&(r.collapseChildren=i)}catch(e){}}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=e){this.$foldStyle=e,"manual"==e&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){if(this.$foldMode!=e){if(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),!e||"manual"==this.$foldStyle)return void(this.foldWidgets=null);this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)}},this.getParentFoldRangeData=function(e,t){var i=this.foldWidgets;if(!i||t&&i[e])return{};for(var n,s=e-1;s>=0;){var o=i[s];if(null==o&&(o=i[s]=this.getFoldWidget(s)),"start"==o){var r=this.getFoldWidgetRange(s);if(n||(n=r),r&&r.end.row>=e)break}s--}return{range:-1!==s&&r,firstRange:n}},this.onFoldWidgetClick=function(e,t){t=t.domEvent;var i={children:t.shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,i)){var n=t.target||t.srcElement;n&&/ace_fold-widget/.test(n.className)&&(n.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var i=this.getFoldWidget(e),n=this.getLine(e),s="end"===i?-1:1,o=this.getFoldAt(e,-1===s?0:n.length,s);if(o)return t.children||t.all?this.removeFold(o):this.expandFold(o),o;var r=this.getFoldWidgetRange(e,!0);if(r&&!r.isMultiLine()&&(o=this.getFoldAt(r.start.row,r.start.column,1))&&r.isEqual(o.range))return this.removeFold(o),o;if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range)var l=a.range.start.row+1,h=a.range.end.row;this.foldAll(l,h,t.all?1e4:0)}else t.children?(h=r?r.end.row:this.getLength(),this.foldAll(e+1,h,t.all?1e4:0)):r&&(t.all&&(r.collapseChildren=1e4),this.addFold("...",r));return r}},this.toggleFoldWidget=function(){var e=this.selection.getCursor().row;e=this.getRowFoldStart(e);var t=this.$toggleFoldWidget(e,{});if(!t){var i=this.getParentFoldRangeData(e,!0);if(t=i.range||i.firstRange){e=t.start.row;var n=this.getFoldAt(e,this.getLine(e).length,1);n?this.removeFold(n):this.addFold("...",t)}}},this.updateFoldWidgets=function(e){var t=e.start.row,i=e.end.row-t;if(0===i)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,i+1,null);else{var n=Array(i+1);n.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,n)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}var n=e("../range").Range,s=e("./fold_line").FoldLine,o=e("./fold").Fold,r=e("../token_iterator").TokenIterator;t.Folding=i}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t){"use strict";function i(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var i=t||this.getLine(e.row).charAt(e.column-1);if(""==i)return null;var n=i.match(/([\(\[\{])|([\)\]\}])/);return n?n[1]?this.$findClosingBracket(n[1],e):this.$findOpeningBracket(n[2],e):null},this.getBracketRange=function(e){var t,i=this.getLine(e.row),n=!0,o=i.charAt(e.column-1),r=o&&o.match(/([\(\[\{])|([\)\]\}])/);if(r||(o=i.charAt(e.column),e={row:e.row,column:e.column+1},r=o&&o.match(/([\(\[\{])|([\)\]\}])/),n=!1),!r)return null;if(r[1]){var a=this.$findClosingBracket(r[1],e);if(!a)return null;t=s.fromPoints(e,a),n||(t.end.column++,t.start.column--),t.cursor=t.end}else{var a=this.$findOpeningBracket(r[2],e);if(!a)return null;t=s.fromPoints(a,e),n||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{"},this.$findOpeningBracket=function(e,t,i){var s=this.$brackets[e],o=1,r=new n(this,t.row,t.column),a=r.getCurrentToken();if(a||(a=r.stepForward()),a){i||(i=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-r.getCurrentTokenColumn()-2,h=a.value;;){for(;l>=0;){var c=h.charAt(l);if(c==s){if(0==(o-=1))return{row:r.getCurrentTokenRow(),column:l+r.getCurrentTokenColumn()}}else c==e&&(o+=1);l-=1}do{a=r.stepBackward()}while(a&&!i.test(a.type));if(null==a)break;h=a.value,l=h.length-1}return null}},this.$findClosingBracket=function(e,t,i){var s=this.$brackets[e],o=1,r=new n(this,t.row,t.column),a=r.getCurrentToken();if(a||(a=r.stepForward()),a){i||(i=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-r.getCurrentTokenColumn();;){for(var h=a.value,c=h.length;l=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510)}i.implement(this,r),this.setDocument=function(e){this.doc&&this.doc.removeListener("change",this.$onChange),this.doc=e,e.on("change",this.$onChange),this.bgTokenizer&&this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},this.getDocument=function(){return this.doc},this.$resetRowCache=function(e){if(!e)return this.$docRowCache=[],void(this.$screenRowCache=[]);var t=this.$docRowCache.length,i=this.$getRowCacheIndex(this.$docRowCache,e)+1;t>i&&(this.$docRowCache.splice(i,t),this.$screenRowCache.splice(i,t))},this.$getRowCacheIndex=function(e,t){for(var i=0,n=e.length-1;i<=n;){var s=i+n>>1,o=e[s];if(t>o)i=s+1;else{if(!(t=t);o++);return i=n[o],i?(i.index=o,i.start=s-i.value.length,i):null},this.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=n.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?n.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize==0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t0&&(n=!!i.charAt(t-1).match(this.tokenRe)),n||(n=!!i.charAt(t).match(this.tokenRe)),n)var s=this.tokenRe;else if(/^\s+$/.test(i.slice(t-1,t+1)))var s=/\s/;else var s=this.nonTokenRe;var o=t;if(o>0){do{o--}while(o>=0&&i.charAt(o).match(s));o++}for(var r=t;re&&(e=t.screenWidth)}),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),i=this.$rowLengthCache,n=0,s=0,o=this.$foldData[s],r=o?o.start.row:Infinity,a=t.length,l=0;lr){if((l=o.end.row+1)>=a)break;o=this.$foldData[s++],r=o?o.start.row:Infinity}null==i[l]&&(i[l]=this.$getStringScreenWidth(t[l])[0]),i[l]>n&&(n=i[l])}this.screenWidth=n}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var i=e.length-1;-1!=i;i--){var n=e[i];"insert"==n.action||"remove"==n.action?this.doc.revertDelta(n):n.folds&&this.addFolds(n.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var i=0;ie.end.column&&(o.start.column+=a),o.end.row==e.end.row&&o.end.column>e.end.column&&(o.end.column+=a)),r&&o.start.row>=e.end.row&&(o.start.row+=r,o.end.row+=r)}if(o.end=this.insert(o.start,n),s.length){var l=e.start,c=o.start,r=c.row-l.row,a=c.column-l.column;this.addFolds(s.map(function(e){return e=e.clone(),e.start.row==l.row&&(e.start.column+=a),e.end.row==l.row&&(e.end.column+=a),e.start.row+=r,e.end.row+=r,e}))}return o},this.indentRows=function(e,t,i){i=i.replace(/\t/g,this.getTabString());for(var n=e;n<=t;n++)this.doc.insertInLine({row:n,column:0},i)},this.outdentRows=function(e){for(var t=e.collapseRows(),i=new h(0,0,0,0),n=this.getTabSize(),s=t.start.row;s<=t.end.row;++s){var o=this.getLine(s);i.start.row=s,i.end.row=s;for(var r=0;r0){var n=this.getRowFoldEnd(t+i);if(n>this.doc.getLength()-1)return 0;var s=n-t}else{e=this.$clipRowToDocument(e),t=this.$clipRowToDocument(t);var s=t-e+1}var o=new h(e,0,t,Number.MAX_VALUE),r=this.getFoldsInRange(o).map(function(e){return e=e.clone(),e.start.row+=s,e.end.row+=s,e}),a=0==i?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+s,a),r.length&&this.addFolds(r),s},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var i=this.doc.getLength();e>=i?(e=i-1,t=this.doc.getLine(i-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){ -this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(e,t){var i=this.$wrapLimitRange;i.max<0&&(i={min:t,max:t});var n=this.$constrainWrapLimit(e,i.min,i.max);return n!=this.$wrapLimit&&n>1&&(this.$wrapLimit=n,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(e,t,i){return t&&(e=Math.max(t,e)),i&&(e=Math.min(i,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,i=e.action,n=e.start,s=e.end,o=n.row,r=s.row,a=r-o,l=null;if(this.$updating=!0,0!=a)if("remove"===i){this[t?"$wrapData":"$rowLengthCache"].splice(o,a);var h=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var c=this.getFoldLine(s.row),u=0;if(c){c.addRemoveChars(s.row,s.column,n.column-s.column),c.shiftRow(-a);var d=this.getFoldLine(o);d&&d!==c&&(d.merge(c),c=d),u=h.indexOf(c)+1}for(u;u=s.row&&c.shiftRow(-a)}r=o}else{var g=Array(a);g.unshift(o,0);var f=t?this.$wrapData:this.$rowLengthCache;f.splice.apply(f,g);var h=this.$foldData,c=this.getFoldLine(o),u=0;if(c){var m=c.range.compareInside(n.row,n.column);0==m?(c=c.split(n.row,n.column))&&(c.shiftRow(a),c.addRemoveChars(r,0,s.column-n.column)):-1==m&&(c.addRemoveChars(o,0,s.column-n.column),c.shiftRow(a)),u=h.indexOf(c)+1}for(u;u=o&&c.shiftRow(a)}}else{a=Math.abs(e.start.column-e.end.column),"remove"===i&&(l=this.getFoldsInRange(e),this.removeFolds(l),a=-a);var c=this.getFoldLine(o);c&&c.addRemoveChars(o,n.column,a)}return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(o,r):this.$updateRowLengthCache(o,r),l},this.$updateRowLengthCache=function(e,t){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(e,t){var i,n,s=this.doc.getAllLines(),o=this.getTabSize(),r=this.$wrapData,l=this.$wrapLimit,h=e;for(t=Math.min(t,s.length-1);h<=t;)n=this.getFoldLine(h,n),n?(i=[],n.walk(function(e,t,n,o){var r;if(null!=e){r=this.$getDisplayTokens(e,i.length),r[0]=a;for(var l=1;lt-b;){var $=h+t-b;if(e[$-1]>=f&&e[$]>=f)o($);else if(e[$]!=a&&e[$]!=c){for(var y=Math.max($-(t-(t>>2)),h-1);$>y&&e[$]y&&e[$]y&&e[$]==g;)$--}else for(;$>y&&e[$]y?o(++$):($=h+t,e[$]==s&&$--,o($-b))}else{for($;$!=h-1&&e[$]!=a;$--);if($>h){o($);continue}for($=h+t;$39&&l<48||l>57&&l<64?r.push(g):l>=4352&&e(l)?r.push(t,s):r.push(t)}return r},this.$getStringScreenWidth=function(t,i,n){if(0==i)return[0,0];null==i&&(i=Infinity),n=n||0;var s,o;for(o=0;o=4352&&e(s)?n+=2:n+=1,!(n>i));o++);return[n,o]},this.lineWidgets=null,this.getRowLength=function(e){if(this.lineWidgets)var t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;else t=0;return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),i=this.$wrapData[t.row];return i.length&&i[0]=0)var a=h[c],o=this.$docRowCache[c],d=e>h[u-1];else var d=!u;for(var g=this.getLength()-1,f=this.getNextFoldLine(o),m=f?f.start.row:Infinity;a<=e&&(l=this.getRowLength(o),!(a+l>e||o>=g));)a+=l,o++,o>m&&(o=f.end.row+1,f=this.getNextFoldLine(o,f),m=f?f.start.row:Infinity),d&&(this.$docRowCache.push(o),this.$screenRowCache.push(a));if(f&&f.start.row<=o)n=this.getFoldDisplayLine(f),o=f.start.row;else{if(a+l<=e||o>g)return{row:g,column:this.getLine(g).length};n=this.getLine(o),f=null}var p=0,v=Math.floor(e-a);if(this.$useWrapMode){var w=this.$wrapData[o];w&&(s=w[v],v>0&&w.length&&(p=w.indent,r=w[v-1]||w[w.length-1],n=n.substring(r)))}return i!==undefined&&this.$bidiHandler.isBidiRow(a+v,o,v)&&(t=this.$bidiHandler.offsetToCol(i)),r+=this.$getStringScreenWidth(n,t-p)[1],this.$useWrapMode&&r>=s&&(r=s-1),f?f.idxToPosition(r):{row:o,column:r}},this.documentToScreenPosition=function(e,t){if(void 0===t)var i=this.$clipPositionToDocument(e.row,e.column);else i=this.$clipPositionToDocument(e,t);e=i.row,t=i.column;var n=0,s=null,o=null;(o=this.getFoldAt(e,t,1))&&(e=o.start.row,t=o.start.column);var r,a=0,l=this.$docRowCache,h=this.$getRowCacheIndex(l,e),c=l.length;if(c&&h>=0)var a=l[h],n=this.$screenRowCache[h],u=e>l[c-1];else var u=!c;for(var d=this.getNextFoldLine(a),g=d?d.start.row:Infinity;a=g){if((r=d.end.row+1)>e)break;d=this.getNextFoldLine(r,d),g=d?d.start.row:Infinity}else r=a+1;n+=this.getRowLength(a),a=r,u&&(this.$docRowCache.push(a),this.$screenRowCache.push(n))}var f="";d&&a>=g?(f=this.getFoldDisplayLine(d,e,t),s=d.start.row):(f=this.getLine(e).substring(0,t),s=e);var m=0;if(this.$useWrapMode){var p=this.$wrapData[s];if(p){for(var v=0;f.length>=p[v];)n++,v++;f=f.substring(p[v-1]||0,f.length),m=v>0?p.indent:0}}return{row:n,column:m+this.$getStringScreenWidth(f)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var i=this.$wrapData.length,n=0,s=0,t=this.$foldData[s++],o=t?t.start.row:Infinity;no&&(n=t.end.row+1,t=this.$foldData[s++],o=t?t.start.row:Infinity)}else{e=this.getLength();for(var a=this.$foldData,s=0;si));o++);return[n,o]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker()},this.isFullWidth=e}.call(g.prototype),e("./edit_session/folding").Folding.call(g.prototype),e("./edit_session/bracket_match").BracketMatch.call(g.prototype),o.defineOptions(g.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e,e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$modified=!0,this.$resetRowCache(0),this.$updateWrapData(0,this.getLength()-1)))},initialValue:"auto"},indentedSoftWrap:{initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){isNaN(e)||this.$tabSize===e||(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=g}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t){"use strict";function i(e,t){function i(e){return/\w/.test(e)||t.regExp?"\\b":""}return i(e[0])+e+i(e[e.length-1])}var n=e("./lib/lang"),s=e("./lib/oop"),o=e("./range").Range,r=function(){this.$options={}};(function(){this.set=function(e){return s.mixin(this.$options,e),this},this.getOptions=function(){return n.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$options,i=this.$matchIterator(e,t);if(!i)return!1;var n=null;return i.forEach(function(e,i,s,r){return n=new o(e,i,s,r),!(i==r&&t.start&&t.start.start&&0!=t.skipCurrent&&n.isEqual(t.start))||(n=null,!1)}),n},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var i=t.range,s=i?e.getLines(i.start.row,i.end.row):e.doc.getAllLines(),r=[],a=t.re;if(t.$isMultiLine){var l,h=a.length,c=s.length-h;e:for(var u=a.offset||0;u<=c;u++){for(var d=0;dm||(r.push(l=new o(u,m,u+h-1,p)),h>2&&(u=u+h-2))}}else for(var v=0;vy&&r[d].end.row==i.end.row;)d--;for(r=r.slice(v,d+1),v=0,d=r.length;v=a;i--)if(u(i,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(i=l,a=r.row;i>=a;i--)if(u(i,Number.MAX_VALUE,e))return}};else var h=function(e){var i=r.row;if(!u(i,r.column,e)){for(i+=1;i<=l;i++)if(u(i,0,e))return;if(0!=t.wrap)for(i=a,l=r.row;i<=l;i++)if(u(i,0,e))return}};if(t.$isMultiLine)var c=i.length,u=function(t,s,o){var r=n?t-c+1:t;if(!(r<0)){var a=e.getLine(r),l=a.search(i[0]);if(!(!n&&ls))return!!o(r,l,r+c-1,u)||void 0}}};else if(n)var u=function(t,n,s){var o,r=e.getLine(t),a=[],l=0;for(i.lastIndex=0;o=i.exec(r);){var h=o[0].length;if(l=o.index,!h){if(l>=r.length)break;i.lastIndex=l+=1}if(o.index+h>n)break;a.push(o.index,h)}for(var c=a.length-1;c>=0;c-=2){var u=a[c-1],h=a[c];if(s(t,u,t,u+h))return!0}};else var u=function(t,n,s){var o,r,a=e.getLine(t);for(i.lastIndex=n;r=i.exec(a);){var l=r[0].length;if(o=r.index,s(t,o,t,o+l))return!0;if(!l&&(i.lastIndex=o+=1,o>=a.length))return!1}};return{forEach:h}}}).call(r.prototype),t.Search=r}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t){"use strict";function i(e,t){this.platform=t||(o.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function n(e,t){i.call(this,e,t),this.$singleCommand=!1}var s=e("../lib/keys"),o=e("../lib/useragent"),r=s.KEY_MODS;n.prototype=i.prototype,function(){function e(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var i=e&&("string"==typeof e?e:e.name);e=this.commands[i],t||delete this.commands[i];var n=this.commandKeyBinding;for(var s in n){var o=n[s];if(o==e)delete n[s];else if(Array.isArray(o)){var r=o.indexOf(e);-1!=r&&(o.splice(r,1),1==o.length&&(n[s]=o[0]))}}},this.bindKey=function(e,t,i){if("object"==typeof e&&e&&(i==undefined&&(i=e.position),e=e[this.platform]),e)return"function"==typeof t?this.addCommand({exec:t,bindKey:e,name:t.name||e}):void e.split("|").forEach(function(e){var n="";if(-1!=e.indexOf(" ")){var s=e.split(/\s+/);e=s.pop(),s.forEach(function(e){var t=this.parseKeys(e),i=r[t.hashId]+t.key;n+=(n?" ":"")+i,this._addCommandToBinding(n,"chainKeys")},this),n+=" "}var o=this.parseKeys(e),a=r[o.hashId]+o.key;this._addCommandToBinding(n+a,t,i)},this)},this._addCommandToBinding=function(t,i,n){var s,o=this.commandKeyBinding;if(i)if(!o[t]||this.$singleCommand)o[t]=i;else{Array.isArray(o[t])?-1!=(s=o[t].indexOf(i))&&o[t].splice(s,1):o[t]=[o[t]],"number"!=typeof n&&(n=e(i));var r=o[t];for(s=0;sn)break}r.splice(s,0,i)}else delete o[t]},this.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var i=e[t];if(i){if("string"==typeof i)return this.bindKey(i,t);"function"==typeof i&&(i={exec:i}),"object"==typeof i&&(i.name||(i.name=t),this.addCommand(i))}},this)},this.removeCommands=function(e){Object.keys(e).forEach(function(t){this.removeCommand(e[t])},this)},this.bindKeys=function(e){Object.keys(e).forEach(function(t){this.bindKey(t,e[t])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),i=t.pop(),n=s[i];if(s.FUNCTION_KEYS[n])i=s.FUNCTION_KEYS[n].toLowerCase();else{if(!t.length)return{key:i,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:i.toUpperCase(),hashId:-1}}for(var o=0,r=t.length;r--;){var a=s.KEY_MODS[t[r]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+t[r]+" in "+e),!1;o|=a}return{key:i,hashId:o}},this.findKeyCommand=function(e,t){var i=r[e]+t;return this.commandKeyBinding[i]},this.handleKeyboard=function(e,t,i,n){if(!(n<0)){var s=r[t]+i,o=this.commandKeyBinding[s];return e.$keyChain&&(e.$keyChain+=" "+s,o=this.commandKeyBinding[e.$keyChain]||o),!o||"chainKeys"!=o&&"chainKeys"!=o[o.length-1]?(e.$keyChain&&(t&&4!=t||1!=i.length?(-1==t||n>0)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-s.length-1)),{command:o}):(e.$keyChain=e.$keyChain||s,{command:"null"})}},this.getStatusText=function(e,t){return t.$keyChain||""}}.call(i.prototype),t.HashHandler=i,t.MultiHashHandler=n}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t){"use strict";var i=e("../lib/oop"),n=e("../keyboard/hash_handler").MultiHashHandler,s=e("../lib/event_emitter").EventEmitter,o=function(e,t){n.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};i.inherits(o,n),function(){i.implement(this,s),this.exec=function(e,t,i){if(Array.isArray(e)){for(var n=e.length;n--;)if(this.exec(e[n],t,i))return!0;return!1}if("string"==typeof e&&(e=this.commands[e]),!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(e.isAvailable&&!e.isAvailable(t))return!1;var s={editor:t,command:e,args:i};return s.returnValue=this._emit("exec",s),this._signal("afterExec",s),!1!==s.returnValue},this.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.removeEventListener("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(e){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach(function(t){"string"==typeof t?this.exec(t,e):this.exec(t[0],e,t[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(e){return e.map(function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e})}}.call(o.prototype),t.CommandManager=o}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t){"use strict";function i(e,t){return{win:e,mac:t}}var n=e("../lib/lang"),s=e("../config"),o=e("../range").Range;t.commands=[{name:"showSettingsMenu",bindKey:i("Ctrl-,","Command-,"),exec:function(e){s.loadModule("ace/ext/settings_menu",function(t){t.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:i("Alt-E","F4"),exec:function(e){s.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:i("Alt-Shift-E","Shift-F4"),exec:function(e){s.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",bindKey:i("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",bindKey:i(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",bindKey:i("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t&&(t=parseInt(prompt("Enter line number:"),10)),isNaN(t)||e.gotoLine(t)},readOnly:!0},{name:"fold",bindKey:i("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:i("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:i("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:i("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",bindKey:i(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",bindKey:i("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",bindKey:i("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",bindKey:i("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",bindKey:i("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",bindKey:i("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",bindKey:i("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",bindKey:i("Ctrl-F","Command-F"),exec:function(e){s.loadModule("ace/ext/searchbox",function(t){t.Search(e)})},readOnly:!0},{name:"overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",bindKey:i("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",bindKey:i("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",bindKey:i("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",bindKey:i("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",bindKey:i("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",bindKey:i("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",bindKey:i("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",bindKey:i("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",bindKey:i("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",bindKey:i("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",bindKey:i("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",bindKey:i("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",bindKey:i("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",bindKey:i("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",bindKey:i("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",bindKey:i("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",bindKey:i("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",bindKey:i("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",bindKey:i("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",bindKey:i("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",bindKey:i(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",bindKey:i("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",bindKey:i(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",bindKey:i("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",bindKey:i("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",bindKey:i("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",bindKey:i("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",bindKey:i("Ctrl-P","Ctrl-P"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",bindKey:i("Ctrl-Shift-P","Ctrl-Shift-P"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",bindKey:i("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",bindKey:i(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",exec:function(){},readOnly:!0},{name:"cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty(),i=t?e.selection.getLineRange():e.selection.getRange();e._emit("cut",i),i.isEmpty()||e.session.remove(i),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",bindKey:i("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",bindKey:i("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",bindKey:i("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",bindKey:i("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",bindKey:i("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",bindKey:i("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",bindKey:i("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",bindKey:i("Ctrl-H","Command-Option-F"),exec:function(e){s.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"undo",bindKey:i("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",bindKey:i("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",bindKey:i("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",bindKey:i("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",bindKey:i("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",bindKey:i("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",bindKey:i("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",bindKey:i("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",bindKey:i("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",bindKey:i("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",bindKey:i("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",bindKey:i("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",bindKey:i("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",bindKey:i("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",bindKey:i("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",bindKey:i("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",bindKey:i("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",bindKey:i("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",bindKey:i("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",exec:function(e,t){e.insert(n.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach", -scrollIntoView:"cursor"},{name:"splitline",bindKey:i(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",bindKey:i("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",bindKey:i("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",bindKey:i("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"expandtoline",bindKey:i("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",bindKey:i(null,null),exec:function(e){for(var t=e.selection.isBackwards(),i=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),s=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),r=e.session.doc.getLine(i.row).length,a=e.session.doc.getTextRange(e.selection.getRange()),l=a.replace(/\n\s*/," ").length,h=e.session.doc.getLine(i.row),c=i.row+1;c<=s.row+1;c++){var u=n.stringTrimLeft(n.stringTrimRight(e.session.doc.getLine(c)));0!==u.length&&(u=" "+u),h+=u}s.row+10?(e.selection.moveCursorTo(i.row,i.column),e.selection.selectTo(i.row,i.column+l)):(r=e.session.doc.getLine(i.row).length>r?r+1:r,e.selection.moveCursorTo(i.row,r))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",bindKey:i(null,null),exec:function(e){var t=e.session.doc.getLength()-1,i=e.session.doc.getLine(t).length,n=e.selection.rangeList.ranges,s=[];n.length<1&&(n=[e.selection.getRange()]);for(var r=0;r=s.lastRow||n.end.row<=s.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==i&&this.renderer.animateScrolling(this.curOp.scrollTop)}var o=this.selection.toJSON();this.curOp.selectionAfter=o,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(o),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,i=this.$mergeableCommands,n=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var s=e.args;this.mergeNextCommand===undefined&&(this.mergeNextCommand=!0),n=n&&this.mergeNextCommand&&(!/\s/.test(s)||/\s/.test(t.args)),this.mergeNextCommand=!0}else n=n&&-1!==i.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(n=!1),n?this.session.mergeUndoDeltas=!0:-1!==i.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(e,t){if(e&&"string"==typeof e&&"ace"!=e){this.$keybindingId=e;var i=this;p.loadModule(["keybinding",e],function(n){i.$keybindingId==e&&i.keyBinding.setKeyboardHandler(n&&n.handler),t&&t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session!=e){this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var i=this.session.getSelection();i.off("changeCursor",this.$onCursorChange),i.off("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&e.bgTokenizer&&e.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||n.computedStyle(this.container).fontSize},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){if(this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null),!this.$highlightPending){var e=this;this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1;var t=e.session;if(t&&t.bgTokenizer){var i=t.findMatchingBracket(e.getCursorPosition());if(i)var n=new d(i.row,i.column,i.row,i.column+1);else if(t.$mode.getMatching)var n=t.$mode.getMatching(e.session);n&&(t.$bracketHighlight=t.addMarker(n,"ace_bracket","text"))}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var e=this;this.$highlightTagPending=!0,setTimeout(function(){e.$highlightTagPending=!1;var t=e.session;if(t&&t.bgTokenizer){var i=e.getCursorPosition(),n=new v(e.session,i.row,i.column),s=n.getCurrentToken();if(!s||!/\b(?:tag-open|tag-name)/.test(s.type))return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);if(-1==s.type.indexOf("tag-open")||(s=n.stepForward())){var o=s.value,r=0,a=n.stepBackward();if("<"==a.value){do{a=s,(s=n.stepForward())&&s.value===o&&-1!==s.type.indexOf("tag-name")&&("<"===a.value?r++:"=0)}else{do{s=a,a=n.stepBackward(),s&&s.value===o&&-1!==s.type.indexOf("tag-name")&&("<"===a.value?r++:"1)&&(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var i=new d(e.row,e.column,e.row,Infinity);i.id=t.addMarker(i,"ace_active-line","screenLine"),t.$highlightLineMarker=i}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},this.onSelectionChange=function(){var e=this.session;if(e.$selectionMarker&&e.removeMarker(e.$selectionMarker),e.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var t=this.selection.getRange(),i=this.getSelectionStyle();e.$selectionMarker=e.addMarker(t,"ace_selection",i)}var n=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(n),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var i=t.start.column,n=t.end.column,s=e.getLine(t.start.row),o=s.substring(i,n);if(!(o.length>5e3)&&/[\w\d]/.test(o)){var r=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:o}),a=s.substring(i-1,n+1);if(r.test(a))return r}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),i=!1;if(!e&&this.$copyWithEmptySelection){i=!0;for(var n=this.selection.getAllRanges(),s=0;so.length||s.length<2||!s[1])return this.commands.exec("insertstring",this,t);for(var r=o.length;r--;){var a=o[r];a.isEmpty()||n.remove(a),n.insert(a.start,s[r])}}},this.execCommand=function(e,t){return this.commands.exec(e,this,t)},this.insert=function(e,t){var i=this.session,n=i.getMode(),s=this.getCursorPosition();if(this.getBehavioursEnabled()&&!t){var o=n.transformAction(i.getState(s.row),"insertion",this,i,e);o&&(e!==o.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),e=o.text)}if("\t"==e&&(e=this.session.getTabString()),this.selection.isEmpty()){if(this.session.getOverwrite()&&-1==e.indexOf("\n")){var r=new d.fromPoints(s,s);r.end.column+=e.length,this.session.remove(r)}}else{var r=this.getSelectionRange();s=this.session.remove(r),this.clearSelection()}if("\n"==e||"\r\n"==e){var a=i.getLine(s.row);if(s.column>a.search(/\S|$/)){var l=a.substr(s.column).search(/\S|$/);i.doc.removeInLine(s.row,s.column,s.column+l)}}this.clearSelection();var h=s.column,c=i.getState(s.row),a=i.getLine(s.row),u=n.checkOutdent(c,a,e);i.insert(s,e);if(o&&o.selection&&(2==o.selection.length?this.selection.setSelectionRange(new d(s.row,h+o.selection[0],s.row,h+o.selection[1])):this.selection.setSelectionRange(new d(s.row+o.selection[0],o.selection[1],s.row+o.selection[2],o.selection[3]))),i.getDocument().isNewLine(e)){var g=n.getNextLineIndent(c,a.slice(0,s.column),i.getTabString());i.insert({row:s.row+1,column:0},g)}u&&n.autoOutdent(c,i,s.row)},this.onTextInput=function(e){this.keyBinding.onTextInput(e)},this.onCommandKey=function(e,t,i){this.keyBinding.onCommandKey(e,t,i)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var i=this.session,n=i.getState(t.start.row),s=i.getMode().transformAction(n,"deletion",this,i,t);if(0===t.end.column){var o=i.getTextRange(t);if("\n"==o[o.length-1]){var r=i.getLine(t.end.row);/^\s+$/.test(r)&&(t.end.column=r.length)}}s&&(t=s)}this.session.remove(t),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){if(this.selection.isEmpty()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var i,n,s=this.session.getLine(e.row);tt.toLowerCase()?1:0});for(var s=new d(0,0,0,0),n=e.first;n<=e.last;n++){var o=t.getLine(n);s.start.row=n,s.end.row=n,s.end.column=o.length,t.replace(s,i[n-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),i=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,i,e)},this.getNumberAt=function(e,t){var i=/[\-]?[0-9]+(?:\.[0-9]+)?/g;i.lastIndex=0;for(var n=this.session.getLine(e);i.lastIndex=t){return{value:s[0],start:s.index,end:s.index+s[0].length}}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,i=this.selection.getCursor().column,n=new d(t,i-1,t,i),s=this.session.getTextRange(n);if(!isNaN(parseFloat(s))&&isFinite(s)){var o=this.getNumberAt(t,i);if(o){var r=o.value.indexOf(".")>=0?o.start+o.value.indexOf(".")+1:o.end,a=o.start+o.value.length-r,l=parseFloat(o.value);l*=Math.pow(10,a),r!==o.end&&ig+1)break;g=f.last}for(c--,a=this.session.$moveLines(d,g,t?0:e),t&&-1==e&&(u=c+1);u<=c;)r[u].moveBy(a,0),u++;t||(a=0),l+=a}s.fromOrientedRange(s.ranges[0]),s.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(){this.renderer.showComposition(this.getCursorPosition())},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var i=this.renderer,n=this.renderer.layerConfig,s=e*Math.floor(n.height/n.lineHeight);!0===t?this.selection.$moveSelection(function(){this.moveCursorBy(s,0)}):!1===t&&(this.selection.moveCursorBy(s,0),this.selection.clearSelection());var o=i.scrollTop;i.scrollBy(0,s*n.lineHeight),null!=t&&i.scrollCursorIntoView(null,.5),i.animateScrolling(o)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,i,n){this.renderer.scrollToLine(e,t,i,n)},this.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e,t){var i=this.getCursorPosition(),n=new v(this.session,i.row,i.column),s=n.getCurrentToken(),o=s||n.stepForward();if(o){var r,a,l=!1,h={},c=i.column-o.start,u={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(o.value.match(/[{}()\[\]]/g)){for(;c=0;--o)this.$tryReplace(i[o],e)&&n++;return this.selection.setSelectionRange(s),n},this.$tryReplace=function(e,t){var i=this.session.getTextRange(e);return t=this.$search.replace(i,t),null!==t?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,n){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&i.mixin(t,e);var s=this.selection.getRange();null==t.needle&&(e=this.session.getTextRange(s)||this.$search.$options.needle,e||(s=this.session.getWordRange(s.start.row,s.start.column),e=this.session.getTextRange(s)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:s});var o=this.$search.find(this.session);return t.preventScroll?o:o?(this.revealRange(o,n),o):(t.backwards?s.start=s.end:s.end=s.start,void this.selection.setRange(s))},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var i=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(i)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy()},this.setAutoScrollEditorIntoView=function(e){if(e){var t,i=this,n=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var s=this.$scrollAnchor;s.style.cssText="position:absolute",this.container.insertBefore(s,this.container.firstChild);var o=this.on("changeSelection",function(){n=!0}),r=this.renderer.on("beforeRender",function(){n&&(t=i.renderer.container.getBoundingClientRect())}),a=this.renderer.on("afterRender",function(){if(n&&t&&(i.isFocused()||i.searchBox&&i.searchBox.isFocused())){var e=i.renderer,o=e.$cursorLayer.$pixelPos,r=e.layerConfig,a=o.top-r.offset;n=o.top>=0&&a+t.top<0||!(o.topwindow.innerHeight)&&null,null!=n&&(s.style.top=a+"px",s.style.left=o.left+"px",s.style.height=r.lineHeight+"px",s.scrollIntoView(n)),n=t=null}});this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",o),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",r))}}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,n.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))}}.call(b.prototype),p.defineOptions(b.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",showLineNumbers:"renderer",showGutter:"renderer",displayIndentGuides:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"}),t.Editor=b}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(e,t){"use strict";function i(e,t){for(var i=t;i--;){var n=e[i];if(n&&!n[0].ignore){for(;i"+e.end.row+":"+e.end.column}function a(e,t){var i="insert"==e.action,n="insert"==t.action;if(i&&n)if(v(t.start,e.end)>=0)c(t,e,-1);else{if(!(v(t.start,e.start)<=0))return null;c(e,t,1)}else if(i&&!n)if(v(t.start,e.end)>=0)c(t,e,-1);else{if(!(v(t.end,e.start)<=0))return null;c(e,t,-1)}else if(!i&&n)if(v(t.start,e.start)>=0)c(t,e,1);else{if(!(v(t.start,e.start)<=0))return null;c(e,t,1)}else if(!i&&!n)if(v(t.start,e.start)>=0)c(t,e,1);else{if(!(v(t.end,e.start)<=0))return null;c(e,t,-1)}return[t,e]}function l(e,t){for(var i=e.length;i--;)for(var n=0;n=0?c(e,t,-1):v(e.start,t.start)<=0?c(t,e,1):(c(e,p.fromPoints(t.start,e.start),-1),c(t,e,1));else if(!i&&n)v(t.start,e.end)>=0?c(t,e,-1):v(t.start,e.start)<=0?c(e,t,1):(c(t,p.fromPoints(e.start,t.start),-1),c(e,t,1));else if(!i&&!n)if(v(t.start,e.end)>=0)c(t,e,-1);else{if(!(v(t.end,e.start)<=0)){var s,o;return v(e.start,t.start)<0&&(s=e,e=d(e,t.start)),v(e.end,t.end)>0&&(o=d(e,t.end)),u(t.end,e.start,e.end,-1),o&&!s&&(e.lines=o.lines,e.start=o.start,e.end=o.end,o=e),[t,s,o].filter(Boolean)}c(e,t,-1)}return[t,e]}function c(e,t,i){u(e.start,t.start,t.end,i),u(e.end,t.start,t.end,i)}function u(e,t,i,n){e.row==(1==n?t:i).row&&(e.column+=n*(i.column-t.column)),e.row+=n*(i.row-t.row)}function d(e,t){var i=e.lines,s=e.end;e.end=n(t);var o=e.end.row-e.start.row,r=i.splice(o,i.length),a=o?t.column:t.column-e.start.column;return i.push(r[0].substring(0,a)),r[0]=r[0].substr(a),{start:n(t),end:s,lines:r,action:e.action}}function g(e,t){t=s(t);for(var i=e.length;i--;){for(var n=e[i],o=0;o0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(e){e==undefined&&(e=this.$rev),this.mark=e},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(e){return e?o(e):o(this.$undoStack)+"\n---\n"+o(this.$redoStack)}}).call(m.prototype);var p=e("./range").Range,v=p.comparePoints;p.comparePoints;t.UndoManager=m}),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter"],function(e,t){"use strict";var i=e("../lib/dom"),n=e("../lib/oop"),s=e("../lib/lang"),o=e("../lib/event_emitter").EventEmitter,r=function(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_gutter-layer",e.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$cells=[]};(function(){n.implement(this,o),this.setSession=function(e){this.session&&this.session.removeEventListener("change",this.$updateAnnotations),this.session=e,e&&e.on("change",this.$updateAnnotations)},this.addGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(e,t)},this.setAnnotations=function(e){this.$annotations=[];for(var t=0;tr&&(m=o.end.row+1,o=t.getNextFoldLine(m,o),r=o?o.start.row:Infinity),m>s){for(;this.$cells.length>f+1;)g=this.$cells.pop(),this.element.removeChild(g.element);break}(g=this.$cells[++f])||(g={element:null,textNode:null,foldWidget:null},g.element=i.createElement("div"),g.textNode=document.createTextNode(""),g.element.appendChild(g.textNode),this.element.appendChild(g.element),this.$cells[f]=g);var p="ace_gutter-cell ";l[m]&&(p+=l[m]),h[m]&&(p+=h[m]),this.$annotations[m]&&(p+=this.$annotations[m].className),g.element.className!=p&&(g.element.className=p);var v=t.getRowLength(m)*e.lineHeight+"px";if(v!=g.element.style.height&&(g.element.style.height=v),a){var w=a[m];null==w&&(w=a[m]=t.getFoldWidget(m))}if(w){g.foldWidget||(g.foldWidget=i.createElement("span"),g.element.appendChild(g.foldWidget));var p="ace_fold-widget ace_"+w;"start"==w&&m==r&&mi.right-t.right?"foldWidgets":void 0}}).call(r.prototype),t.Gutter=r}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t){"use strict";var i=e("../range").Range,n=e("../lib/dom"),s=function(e){this.element=n.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)};(function(){function e(e,t,i,n){return(e?1:0)|(t?2:0)|(i?4:0)|(n?8:0)}this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.update=function(e){if(e){this.config=e;var t=[];for(var i in this.markers){var n=this.markers[i];if(n.range){var s=n.range.clipRows(e.firstRow,e.lastRow);if(!s.isEmpty())if(s=s.toScreenRange(this.session),n.renderer){var o=this.$getTop(s.start.row,e),r=this.$padding+(this.session.$bidiHandler.isBidiRow(s.start.row)?this.session.$bidiHandler.getPosLeft(s.start.column):s.start.column*e.characterWidth);n.renderer(t,s,r,o,e)}else"fullLine"==n.type?this.drawFullLineMarker(t,s,n.clazz,e):"screenLine"==n.type?this.drawScreenLineMarker(t,s,n.clazz,e):s.isMultiLine()?"text"==n.type?this.drawTextMarker(t,s,n.clazz,e):this.drawMultiLineMarker(t,s,n.clazz,e):this.session.$bidiHandler.isBidiRow(s.start.row)?this.drawBidiSingleLineMarker(t,s,n.clazz+" ace_start ace_br15",e):this.drawSingleLineMarker(t,s,n.clazz+" ace_start ace_br15",e)}else n.update(t,this,this.session,e)}this.element.innerHTML=t.join("")}},this.$getTop=function(e,t){return(e-t.firstRowScreen)*t.lineHeight},this.drawTextMarker=function(t,n,s,o,r){for(var a=this.session,l=n.start.row,h=n.end.row,c=l,u=0,d=0,g=a.getScreenLastRowColumn(c),f=null,m=new i(c,n.start.column,c,d);c<=h;c++)m.start.row=m.end.row=c,m.start.column=c==l?n.start.column:a.getRowWrapIndent(c),m.end.column=g,u=d,d=g,g=c+1g,c==h),this.session.$bidiHandler.isBidiRow(c)?this.drawBidiSingleLineMarker(t,m,f,o,c==h?0:1,r):this.drawSingleLineMarker(t,m,f,o,c==h?0:1,r)},this.drawMultiLineMarker=function(e,t,i,n,s){var o,r,a,l=this.$padding;if(s=s||"",this.session.$bidiHandler.isBidiRow(t.start.row)){var h=t.clone();h.end.row=h.start.row,h.end.column=this.session.getLine(h.start.row).length,this.drawBidiSingleLineMarker(e,h,i+" ace_br1 ace_start",n,null,s)}else o=n.lineHeight,r=this.$getTop(t.start.row,n),a=l+t.start.column*n.characterWidth,e.push("
");if(this.session.$bidiHandler.isBidiRow(t.end.row)){var h=t.clone();h.start.row=h.end.row,h.start.column=0,this.drawBidiSingleLineMarker(e,h,i+" ace_br12",n,null,s)}else{var c=t.end.column*n.characterWidth;o=n.lineHeight,r=this.$getTop(t.end.row,n),e.push("
")}if(!((o=(t.end.row-t.start.row-1)*n.lineHeight)<=0)){r=this.$getTop(t.start.row+1,n);var u=(t.start.column?1:0)|(t.end.column?0:8);e.push("
")}},this.drawSingleLineMarker=function(e,t,i,n,s,o){var r=n.lineHeight,a=(t.end.column+(s||0)-t.start.column)*n.characterWidth,l=this.$getTop(t.start.row,n),h=this.$padding+t.start.column*n.characterWidth;e.push("
")},this.drawBidiSingleLineMarker=function(e,t,i,n,s,o){var r=n.lineHeight,a=this.$getTop(t.start.row,n),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach(function(t){e.push("
")})},this.drawFullLineMarker=function(e,t,i,n,s){var o=this.$getTop(t.start.row,n),r=n.lineHeight;t.start.row!=t.end.row&&(r+=this.$getTop(t.end.row,n)-o),e.push("
")},this.drawScreenLineMarker=function(e,t,i,n,s){var o=this.$getTop(t.start.row,n),r=n.lineHeight;e.push("
")}}).call(s.prototype),t.Marker=s}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/lib/event_emitter"],function(e,t){"use strict";var i=e("../lib/oop"),n=e("../lib/dom"),s=e("../lib/lang"),o=(e("../lib/useragent"),e("../lib/event_emitter").EventEmitter),r=function(e){this.element=n.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this)};(function(){i.implement(this,o),this.EOF_CHAR="\xb6",this.EOL_CHAR_LF="\xac",this.EOL_CHAR_CRLF="\xa4",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="\u2014",this.SPACE_CHAR="\xb7",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e="\n"==this.session.doc.getNewLineCharacter()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=e)return this.EOL_CHAR=e,!0},this.setPadding=function(e){this.$padding=e,this.element.style.padding="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){this.session=e,e&&this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(e){return this.showInvisibles!=e&&(this.showInvisibles=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],i=1;i"+s.stringRepeat(this.TAB_CHAR,i)+""):t.push(s.stringRepeat(" ",i));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var n="ace_indent-guide",o="",r="";if(this.showInvisibles){n+=" ace_invisible",o=" ace_invisible_space",r=" ace_invisible_tab";var a=s.stringRepeat(this.SPACE_CHAR,this.tabSize),l=s.stringRepeat(this.TAB_CHAR,this.tabSize)}else var a=s.stringRepeat(" ",this.tabSize),l=a;this.$tabStrings[" "]=""+a+"",this.$tabStrings["\t"]=""+l+""}},this.updateLines=function(e,t,i){(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow)&&this.scrollLines(e),this.config=e;for(var n=Math.max(t,e.firstRow),s=Math.min(i,e.lastRow),o=this.element.childNodes,r=0,a=e.firstRow;ah&&(a=l.end.row+1,l=this.session.getNextFoldLine(a,l),h=l?l.start.row:Infinity),!(a>s);){var c=o[r++];if(c){var u=[];this.$renderLine(u,a,!this.$useLineGroups(),a==h&&l),c.style.height=e.lineHeight*this.session.getRowLength(a)+"px",c.innerHTML=u.join("")}a++}},this.scrollLines=function(e){var t=this.config;if(this.config=e,!t||t.lastRow0;n--)i.removeChild(i.firstChild);if(t.lastRow>e.lastRow)for(var n=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);n>0;n--)i.removeChild(i.lastChild);if(e.firstRowt.lastRow){var s=this.$renderLinesFragment(e,t.lastRow+1,e.lastRow);i.appendChild(s)}},this.$renderLinesFragment=function(e,t,i){for(var s=this.element.ownerDocument.createDocumentFragment(),o=t,r=this.session.getNextFoldLine(o),a=r?r.start.row:Infinity;o>a&&(o=r.end.row+1,r=this.session.getNextFoldLine(o,r),a=r?r.start.row:Infinity),!(o>i);){var l=n.createElement("div"),h=[];if(this.$renderLine(h,o,!1,o==a&&r),l.innerHTML=h.join(""),this.$useLineGroups())l.className="ace_line_group",s.appendChild(l),l.style.height=e.lineHeight*this.session.getRowLength(o)+"px";else for(;l.firstChild;)s.appendChild(l.firstChild);o++}return s},this.update=function(e){this.config=e;for(var t=[],i=e.firstRow,n=e.lastRow,s=i,o=this.session.getNextFoldLine(s),r=o?o.start.row:Infinity;s>r&&(s=o.end.row+1,o=this.session.getNextFoldLine(s,o),r=o?o.start.row:Infinity),!(s>n);)this.$useLineGroups()&&t.push("
"),this.$renderLine(t,s,!1,s==r&&o),this.$useLineGroups()&&t.push("
"),s++;this.element.innerHTML=t.join("")},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,i,n){var o=this,r=/\t|&|<|>|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\u3000\uFEFF\uFFF9-\uFFFC])|[\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,a=function(e,i,n,r){if(i)return o.showInvisibles?""+s.stringRepeat(o.SPACE_CHAR,e.length)+"":e;if("&"==e)return"&";if("<"==e)return"<";if(">"==e)return">";if("\t"==e){var a=o.session.getScreenTabSize(t+r);return t+=a-1,o.$tabStrings[a]}if("\u3000"==e){var l=o.showInvisibles?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",h=o.showInvisibles?o.SPACE_CHAR:"";return t+=1,""+h+""}return n?""+o.SPACE_CHAR+"":(t+=1,""+e+"")},l=n.replace(r,a);if(this.$textToken[i.type])e.push(l);else{var h="ace_"+i.type.replace(/\./g," ace_"),c="";"fold"==i.type&&(c=" style='width:"+i.value.length*this.config.characterWidth+"px;' "),e.push("",l,"")}return t+n.length},this.renderIndentGuide=function(e,t,i){var n=t.search(this.$indentGuideRe);return n<=0||n>=i?t:" "==t[0]?(n-=n%this.tabSize,e.push(s.stringRepeat(this.$tabStrings[" "],n/this.tabSize)),t.substr(n)):"\t"==t[0]?(e.push(s.stringRepeat(this.$tabStrings["\t"],n)),t.substr(n)):t},this.$renderWrappedLine=function(e,t,i,n){for(var o=0,r=0,a=i[0],l=0,h=0;h=a;)l=this.$renderToken(e,l,c,u.substring(0,a-o)),u=u.substring(a-o),o=a,n||e.push("
","
"),e.push(s.stringRepeat("\xa0",i.indent)),r++,l=0,a=i[r]||Number.MAX_VALUE;0!=u.length&&(o+=u.length,l=this.$renderToken(e,l,c,u))}}},this.$renderSimpleLine=function(e,t){var i=0,n=t[0],s=n.value;this.displayIndentGuides&&(s=this.renderIndentGuide(e,s)),s&&(i=this.$renderToken(e,i,n,s));for(var o=1;othis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,i,n,s);i=this.$renderToken(e,i,n,s)}},this.$renderOverflowMessage=function(e,t,i,n){this.$renderToken(e,t,i,n.slice(0,this.MAX_LINE_LENGTH-t)),e.push("<click to see more...>")},this.$renderLine=function(e,t,i,n){if(!n&&0!=n&&(n=this.session.getFoldLine(t)),n)var s=this.$getFoldLineTokens(t,n);else var s=this.session.getTokens(t);if(i||e.push("
"),s.length){var o=this.session.getRowSplitData(t);o&&o.length?this.$renderWrappedLine(e,s,o,i):this.$renderSimpleLine(e,s)}this.showInvisibles&&(n&&(t=n.end.row),e.push("",t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,"")),i||e.push("
")},this.$getFoldLineTokens=function(e,t){function i(e,t,i){for(var n=0,o=0;o+e[n].value.lengthi-t&&(r=r.substring(0,i-t)),s.push({type:e[n].type,value:r}),o=t+r.length,n+=1}for(;oi?s.push({type:e[n].type,value:r.substring(0,i-o)}):s.push(e[n]),o+=r.length,n+=1}}var n=this.session,s=[],o=n.getTokens(e);return t.walk(function(e,t,r,a,l){null!=e?s.push({type:"fold",value:e}):(l&&(o=n.getTokens(t)),o.length&&i(o,a,r))},t.end.row,this.session.getLine(t.end.row).length),s},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$measureNode&&this.$measureNode.parentNode.removeChild(this.$measureNode),delete this.$measureNode}}).call(r.prototype),t.Text=r}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t){"use strict";var i,n=e("../lib/dom"),s=function(e){this.element=n.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),i===undefined&&(i=!("opacity"in this.element.style)),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),n.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=(i?this.$updateVisibility:this.$updateOpacity).bind(this)};(function(){this.$updateVisibility=function(e){for(var t=this.cursors,i=t.length;i--;)t[i].style.visibility=e?"":"hidden"},this.$updateOpacity=function(e){for(var t=this.cursors,i=t.length;i--;)t[i].style.opacity=e?"":"0"},this.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";setTimeout(function(){n.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){n.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e!=this.smoothBlinking&&!i&&(this.smoothBlinking=e,n.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.$updateCursors=this.$updateOpacity.bind(this),this.restartTimer())},this.addCursor=function(){var e=n.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},this.hideCursor=function(){this.isVisible=!1, -n.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,n.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&n.removeCssClass(this.element,"ace_smooth-blinking"),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&setTimeout(function(){n.addCssClass(this.element,"ace_smooth-blinking")}.bind(this)),n.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()}},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var i=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(i.row,e.row)?this.session.$bidiHandler.getPosLeft(i.column):i.column*this.config.characterWidth),top:(i.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},this.update=function(e){this.config=e;var t=this.session.$selectionMarkers,i=0,n=0;t!==undefined&&0!==t.length||(t=[{cursor:null}]);for(var i=0,s=t.length;ie.height+e.offset||o.top<0)&&i>1)){var r=(this.cursors[n++]||this.addCursor()).style;this.drawCursor?this.drawCursor(r,o,e,t[i],this.session):(r.left=o.left+"px",r.top=o.top+"px",r.width=e.characterWidth+"px",r.height=e.lineHeight+"px")}}for(;this.cursors.length>n;)this.removeCursor();var a=this.session.getOverwrite();this.$setOverwrite(a),this.$pixelPos=o,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?n.addCssClass(this.element,"ace_overwrite-cursors"):n.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(s.prototype),t.Cursor=s}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t){"use strict";var i=e("./lib/oop"),n=e("./lib/dom"),s=e("./lib/event"),o=e("./lib/event_emitter").EventEmitter,r=32768,a=function(e){this.element=n.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=n.createElement("div"),this.inner.className="ace_scrollbar-inner",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)};(function(){i.implement(this,o),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1}}).call(a.prototype);var l=function(e,t){a.call(this,e),this.scrollTop=0,this.scrollHeight=0,t.$scrollbarWidth=this.width=n.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};i.inherits(l,a),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=this.setScrollHeight=function(e){this.scrollHeight=e,e>r?(this.coeff=r/e,e=r):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)}}.call(l.prototype);var h=function(e,t){a.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};i.inherits(h,a),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(h.prototype),t.ScrollBar=l,t.ScrollBarV=l,t.ScrollBarH=h,t.VScrollBar=l,t.HScrollBar=h}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t){"use strict";var i=e("./lib/event"),n=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.window=t||window};(function(){this.schedule=function(e){if(this.changes=this.changes|e,this.changes){var t=this;i.nextFrame(function(){var e=t.changes;e&&(i.blockIdle(100),t.changes=0,t.onRender(e)),t.changes&&t.schedule()})}}}).call(n.prototype),t.RenderLoop=n}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(e,t){var i=e("../lib/oop"),n=e("../lib/dom"),s=e("../lib/lang"),o=e("../lib/event"),r=e("../lib/useragent"),a=e("../lib/event_emitter").EventEmitter,l=256,h="function"==typeof ResizeObserver,c=200,u=t.FontMetrics=function(e){this.el=n.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=n.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=n.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.innerHTML=s.stringRepeat("X",l),this.$characterSize={width:0,height:0},h?this.$addObserver():this.checkForSizeChanges()};(function(){i.implement(this,a),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",r.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(e){if(e===undefined&&(e=this.$measureSizes()),e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},this.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver(function(t){var i=t[0].contentRect;e.checkForSizeChanges({height:i.height,width:i.width/l})}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=o.onIdle(function t(){e.checkForSizeChanges(),o.onIdle(t,500)},500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/l};return 0===t.width||0===t.height?null:t},this.$measureCharWidth=function(e){return this.$main.innerHTML=s.stringRepeat(e,l),this.$main.getBoundingClientRect().width/l},this.getCharacterWidth=function(e){var t=this.charSizes[e];return t===undefined&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(t){return t?(window.getComputedStyle(t).zoom||1)*e(t.parentElement):1},this.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=n.buildDom([e(0,0),e(c,0),e(0,c),e(c,c)],this.el)},this.transformCoordinates=function(e,t){function i(e,t,i){var n=e[1]*t[0]-e[0]*t[1];return[(-t[1]*i[0]+t[0]*i[1])/n,(+e[1]*i[0]-e[0]*i[1])/n]}function n(e,t){return[e[0]-t[0],e[1]-t[1]]}function s(e,t){return[e[0]+t[0],e[1]+t[1]]}function o(e,t){return[e*t[0],e*t[1]]}function r(e){var t=e.getBoundingClientRect();return[t.left,t.top]}if(e){e=o(1/this.$getZoom(this.el),e)}this.els||this.$initTransformMeasureNodes();var a=r(this.els[0]),l=r(this.els[1]),h=r(this.els[2]),u=r(this.els[3]),d=i(n(u,l),n(u,h),n(s(l,h),s(u,a))),g=o(1+d[0],n(l,a)),f=o(1+d[1],n(h,a));if(t){var m=t,p=d[0]*m[0]/c+d[1]*m[1]/c+1,v=s(o(m[0],g),o(m[1],f));return s(o(1/p/c,v),a)}var w=n(e,a),b=i(n(g,o(d[0],w)),n(f,o(d[1],w)),w);return o(c,b)}}).call(u.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/lib/useragent","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter"],function(e,t){"use strict";var i=e("./lib/oop"),n=e("./lib/dom"),s=e("./config"),o=(e("./lib/useragent"),e("./layer/gutter").Gutter),r=e("./layer/marker").Marker,a=e("./layer/text").Text,l=e("./layer/cursor").Cursor,h=e("./scrollbar").HScrollBar,c=e("./scrollbar").VScrollBar,u=e("./renderloop").RenderLoop,d=e("./layer/font_metrics").FontMetrics,g=e("./lib/event_emitter").EventEmitter,f='.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;text-indent: -1em;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: inherit;color: inherit;z-index: 1000;opacity: 1;text-indent: 0;}[ace_nocontext=true] {transform: none!important;filter: none!important;perspective: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;}.ace_text-layer {font: inherit !important;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_text-input-ios {position: absolute !important;top: -100000px !important;left: -100000px !important;}';n.importCssString(f,"ace_editor.css");var m=function(e,t){var i=this;this.container=e||n.createElement("div"),n.addCssClass(this.container,"ace_editor"),this.setTheme(t),this.$gutter=n.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=n.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=n.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new o(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new r(this.content);var g=this.$textLayer=new a(this.content);this.canvas=g.element,this.$markerFront=new r(this.content),this.$cursorLayer=new l(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new c(this.container,this),this.scrollBarH=new h(this.container,this),this.scrollBarV.addEventListener("scroll",function(e){i.$scrollAnimation||i.session.setScrollTop(e.data-i.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(e){i.$scrollAnimation||i.session.setScrollLeft(e.data-i.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new d(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener("changeCharacterSize",function(e){i.updateCharacterSize(),i.onResize(!0,i.gutterWidth,i.$size.width,i.$size.height),i._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$loop=new u(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._emit("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,i.implement(this,g),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin()},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(e,t,i){if(t===undefined&&(t=Infinity),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,i,n){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=e?1:0;var s=this.container;n||(n=s.clientHeight||s.scrollHeight),i||(i=s.clientWidth||s.scrollWidth);var o=this.$updateCachedSize(e,t,i,n);if(!this.$size.scrollerHeight||!i&&!n)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(o|this.$changes,!0):this.$loop.schedule(o|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(e,t,i,n){n-=this.$extraHeight||0;var s=0,o=this.$size,r={width:o.width,height:o.height,scrollerHeight:o.scrollerHeight,scrollerWidth:o.scrollerWidth};return n&&(e||o.height!=n)&&(o.height=n,s|=this.CHANGE_SIZE,o.scrollerHeight=o.height,this.$horizScroll&&(o.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",s|=this.CHANGE_SCROLL),i&&(e||o.width!=i)&&(s|=this.CHANGE_SIZE,o.width=i,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,this.scrollBarH.element.style.left=this.scroller.style.left=t+"px",o.scrollerWidth=Math.max(0,i-t-this.scrollBarV.getWidth()),this.scrollBarH.element.style.right=this.scroller.style.right=this.scrollBarV.getWidth()+"px",this.scroller.style.bottom=this.scrollBarH.getHeight()+"px",(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(s|=this.CHANGE_FULL)),o.$dirty=!i||!n,s&&this._signal("resize",r),s},this.onGutterResize=function(){var e=this.$showGutter?this.$gutter.offsetWidth:0;e!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,e,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()?this.$loop.schedule(this.CHANGE_FULL):this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):(this.$computeLayerConfig(),this.$loop.schedule(this.CHANGE_MARKER))},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updateGutterLineHighlight=function(){var e=this.$cursorLayer.$pixelPos,t=this.layerConfig.lineHeight;if(this.session.getUseWrapMode()){var i=this.session.selection.getCursor();i.column=0,e=this.$cursorLayer.getPixelPosition(i,!0),t*=this.session.getRowLength(i.row)}this.$gutterLineHighlight.style.top=e.top-this.layerConfig.offset+"px",this.$gutterLineHighlight.style.height=t+"px"},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var e=n.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=n.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){var e=this.textarea.style;if(!this.$keepTextAreaAtCursor)return void(e.left="-100px");var t=this.layerConfig,i=this.$cursorLayer.$pixelPos.top,n=this.$cursorLayer.$pixelPos.left;i-=t.offset;var s=this.lineHeight;if(i<0||i>t.height-s)return void(e.top=e.left="0");var o=this.characterWidth;if(this.$composition){var r=this.textarea.value.replace(/^\x01+/,"");o*=this.session.$getStringScreenWidth(r)[0]+2,s+=2}n-=this.scrollLeft,n>this.$size.scrollerWidth-o&&(n=this.$size.scrollerWidth-o),n+=this.gutterWidth,e.height=s+"px",e.width=o+"px",e.left=Math.min(n,this.$size.scrollerWidth-o)+"px",e.top=Math.min(i,this.$size.height-s)+"px"},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()}, -this.setScrollMargin=function(e,t,i,n){var s=this.scrollMargin;s.top=0|e,s.bottom=0|t,s.right=0|n,s.left=0|i,s.v=s.top+s.bottom,s.h=s.left+s.right,s.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-s.top),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!e&&!t)return void(this.$changes|=e);if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender"),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var i=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){if(e|=this.$computeLayerConfig(),i.firstRow!=this.layerConfig.firstRow&&i.firstRowScreen==this.layerConfig.firstRowScreen){var n=this.scrollTop+(i.firstRow-this.layerConfig.firstRow)*this.lineHeight;n>0&&(this.scrollTop=n,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig())}i=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),this.$gutterLayer.element.style.marginTop=-i.offset+"px",this.content.style.marginTop=-i.offset+"px",this.content.style.width=i.width+2*this.$padding+"px",this.content.style.height=i.minHeight+"px"}return e&this.CHANGE_H_SCROLL&&(this.content.style.marginLeft=-this.scrollLeft+"px",this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),e&this.CHANGE_FULL?(this.$textLayer.update(i),this.$showGutter&&this.$gutterLayer.update(i),this.$markerBack.update(i),this.$markerFront.update(i),this.$cursorLayer.update(i),this.$moveTextAreaToCursor(),this.$highlightGutterLine&&this.$updateGutterLineHighlight(),this._signal("afterRender"),void 0):e&this.CHANGE_SCROLL?(e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(i):this.$textLayer.scrollLines(i),this.$showGutter&&this.$gutterLayer.update(i),this.$markerBack.update(i),this.$markerFront.update(i),this.$cursorLayer.update(i),this.$highlightGutterLine&&this.$updateGutterLineHighlight(),this.$moveTextAreaToCursor(),this._signal("afterRender"),void 0):(e&this.CHANGE_TEXT?(this.$textLayer.update(i),this.$showGutter&&this.$gutterLayer.update(i)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(i):(e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER)&&this.$showGutter&&this.$gutterLayer.update(i),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(i),this.$moveTextAreaToCursor(),this.$highlightGutterLine&&this.$updateGutterLineHighlight()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(i),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(i),this._signal("afterRender"),void 0)},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,i=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(i+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&i>this.$maxPixelHeight&&(i=this.$maxPixelHeight);var n=i<=2*this.lineHeight,s=!n&&e>t;if(i!=this.desiredHeight||this.$size.height!=this.desiredHeight||s!=this.$vScroll){s!=this.$vScroll&&(this.$vScroll=s,this.scrollBarV.setVisible(s));var o=this.container.clientWidth;this.container.style.height=i+"px",this.$updateCachedSize(!0,this.$gutterWidth,o,i),this.desiredHeight=i,this._signal("autosize")}},this.$computeLayerConfig=function(){var e=this.session,t=this.$size,i=t.height<=2*this.lineHeight,n=this.session.getScreenLength(),s=n*this.lineHeight,o=this.$getLongestLine(),r=!i&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-o-2*this.$padding<0),a=this.$horizScroll!==r;a&&(this.$horizScroll=r,this.scrollBarH.setVisible(r));var l=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var h=this.scrollTop%this.lineHeight,c=t.scrollerHeight+this.lineHeight,u=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;s+=u;var d=this.scrollMargin;this.session.setScrollTop(Math.max(-d.top,Math.min(this.scrollTop,s-t.scrollerHeight+d.bottom))),this.session.setScrollLeft(Math.max(-d.left,Math.min(this.scrollLeft,o+2*this.$padding-t.scrollerWidth+d.right)));var g=!i&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-s+u<0||this.scrollTop>d.top),f=l!==g;f&&(this.$vScroll=g,this.scrollBarV.setVisible(g));var m,p,v=Math.ceil(c/this.lineHeight)-1,w=Math.max(0,Math.round((this.scrollTop-h)/this.lineHeight)),b=w+v,$=this.lineHeight;w=e.screenToDocumentRow(w,0);var y=e.getFoldLine(w);y&&(w=y.start.row),m=e.documentToScreenRow(w,0),p=e.getRowLength(w)*$,b=Math.min(e.screenToDocumentRow(b,0),e.getLength()-1),c=t.scrollerHeight+e.getRowLength(b)*$+p,h=this.scrollTop-m*$;var C=0;return(this.layerConfig.width!=o||a)&&(C=this.CHANGE_H_SCROLL),(a||f)&&(C=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),f&&(o=this.$getLongestLine())),this.layerConfig={width:o,padding:this.$padding,firstRow:w,firstRowScreen:m,lastRow:b,lineHeight:$,characterWidth:this.characterWidth,minHeight:c,maxHeight:s,offset:h,gutterOffset:$?Math.max(0,Math.ceil((h+t.height-t.scrollerHeight)/$)):0,height:this.$size.scrollerHeight},C},this.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var i=this.layerConfig;if(!(e>i.lastRow+1||tthis.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},this.updateBreakpoints=function(){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(e,t,i){this.scrollCursorIntoView(e,i),this.scrollCursorIntoView(t,i)},this.scrollCursorIntoView=function(e,t,i){if(0!==this.$size.scrollerHeight){var n=this.$cursorLayer.getPixelPosition(e),s=n.left,o=n.top,r=i&&i.top||0,a=i&&i.bottom||0,l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+r>o?(t&&l+r>o+this.lineHeight&&(o-=t*this.$size.scrollerHeight),0===o&&(o=-this.scrollMargin.top),this.session.setScrollTop(o)):l+this.$size.scrollerHeight-as?(s=1-this.scrollMargin.top||(t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||(e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||(e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0)))},this.pixelToScreenCoordinates=function(e,t){var i;if(this.$hasCssTransforms){i={top:0,left:0};var n=this.$fontMetrics.transformCoordinates([e,t]);e=n[1]-this.gutterWidth,t=n[0]}else i=this.scroller.getBoundingClientRect();var s=e+this.scrollLeft-i.left-this.$padding,o=s/this.characterWidth,r=Math.floor((t+this.scrollTop-i.top)/this.lineHeight),a=this.$blockCursor?Math.floor(o):Math.round(o);return{row:r,column:a,side:o-a>0?1:-1,offsetX:s}},this.screenToTextCoordinates=function(e,t){var i;if(this.$hasCssTransforms){i={top:0,left:0};var n=this.$fontMetrics.transformCoordinates([e,t]);e=n[1]-this.gutterWidth,t=n[0]}else i=this.scroller.getBoundingClientRect();var s=e+this.scrollLeft-i.left-this.$padding,o=s/this.characterWidth,r=this.$blockCursor?Math.floor(o):Math.round(o),a=(t+this.scrollTop-i.top)/this.lineHeight;return this.session.screenToDocumentPosition(a,Math.max(r,0),s)},this.textToScreenCoordinates=function(e,t){var i=this.scroller.getBoundingClientRect(),n=this.session.documentToScreenPosition(e,t),s=this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e)?this.session.$bidiHandler.getPosLeft(n.column):Math.round(n.column*this.characterWidth)),o=n.row*this.lineHeight;return{pageX:i.left+s-this.scrollLeft,pageY:i.top+o-this.scrollTop}},this.visualizeFocus=function(){n.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){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||!i.cssClass)throw new Error("couldn't load module "+e+" or it didn't call define");i.$id&&(o.$themeId=i.$id),n.importCssString(i.cssText,i.cssClass,o.container),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.attachToShadowRoot=function(){n.importCssString(f,"ace_editor.css",this.container)},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",this.$gutter.appendChild(this.$gutterLineHighlight),void 0;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()}},maxPixelHeight:{set:function(){this.updateFull()},initialValue:0},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},hasCssTransforms:{}}),t.VirtualRenderer=m}),ace.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";function i(e){var t="importScripts('"+o.qualifyURL(e)+"');";try{return new Blob([t],{type:"application/javascript"})}catch(e){var i=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,n=new i;return n.append(t),n.getBlob("application/javascript")}}function n(e){if("undefined"==typeof Worker)return{postMessage:function(){},terminate:function(){}};var t=i(e),n=window.URL||window.webkitURL,s=n.createObjectURL(t);return new Worker(s)}var s=e("../lib/oop"),o=e("../lib/net"),r=e("../lib/event_emitter").EventEmitter,a=e("../config"),l=function(t,i,s,o,r){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),a.get("packaged")||!e.toUrl)o=o||a.moduleUrl(i,"worker");else{var l=this.$normalizePath;o=o||l(e.toUrl("ace/worker/worker.js",null,"_"));var h={};t.forEach(function(t){h[t]=l(e.toUrl(t,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}this.$worker=n(o),r&&this.send("importScripts",r),this.$worker.postMessage({init:!0,tlns:h,module:i,classname:s}),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){s.implement(this,r),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 o.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=[],setTimeout(this.$sendDeltaQueue,0)),"insert"==e.action?this.deltaQueue.push(e.start,e.lines):this.deltaQueue.push(e.start,e.end)},this.$sendDeltaQueue=function(){var e=this.deltaQueue;e&&(this.deltaQueue=null,e.length>50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(l.prototype);var h=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,s=!1,o=Object.create(r),l=this;this.$worker={},this.$worker.terminate=function(){},this.$worker.postMessage=function(e){l.messageBuffer.push(e),n&&(s?setTimeout(h):h())},this.setEmitSync=function(e){s=e};var h=function(){var e=l.messageBuffer.shift();e.command?n[e.command].apply(n,e.args):e.event&&o._signal(e.event,e.data)};o.postMessage=function(e){l.onMessage({data:e})},o.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},o.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},a.loadModule(["worker",t],function(e){for(n=new e[i](o);l.messageBuffer.length;)h()})};h.prototype=l.prototype,t.UIWorkerClient=h,t.WorkerClient=l,t.createWorker=n}),ace.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;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var s=this.pos;s.$insertRight=!0,s.detach(),s.markerId=n.addMarker(new i(s.row,s.column,s.row,s.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(i){var n=t.createAnchor(i.row,i.column);n.$insertRight=!0,n.detach(),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)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e=this.pos.column&&t.start.column<=this.pos.column+this.length+1,o=t.start.column-this.pos.column;if(this.updateAnchors(e),s&&(this.length+=n),s&&!this.session.$fromUndo)if("insert"===e.action)for(var r=this.others.length-1;r>=0;r--){var a=this.others[r],l={row:a.row,column:a.column+o};this.doc.insertMergedLines(l,e.lines)}else if("remove"===e.action)for(var r=this.others.length-1;r>=0;r--){var a=this.others[r],l={row:a.row,column:a.column+o};this.doc.remove(new i(l.row,l.column,l.row,l.column-n))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,n=function(n,s){t.removeMarker(n.markerId),n.markerId=t.addMarker(new i(n.row,n.column,n.row,n.column+e.length),s,null,!1)};n(this.pos,this.mainClass);for(var s=this.others.length;s--;)n(this.others[s],this.othersClass)}},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.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,i=0;i1&&!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;u1){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.cursor),s=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(n,s).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,i){var s=[],o=e.column0;)v--;if(v>0)for(var w=0;s[w].isEmpty();)w++;for(var b=v;b>=w;b--)s[b].isEmpty()&&s.splice(b,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;no&&(o=i.column),sh?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)&&++d0);c<0&&(c=0),d>=m&&(d=m-1)}var p=this.session.removeFullLines(c,d);p=this.$reAlignText(p,g),this.session.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),at[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},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),ace.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;++th){var d=e.getLine(c).length;return new i(h,a,c,d)}}},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)}),ace.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;}.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;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.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("changeFold",this.updateOnFold),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&&!t.hidden&&(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.updateOnFold=function(e,t){var i=t.lineWidgets;if(i&&e.action){for(var n=e.data,s=n.start.row,o=n.end.row,r="add"==e.action,a=s+1;a0&&!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)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{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.fullWidth&&a.screenWidth&&(a.el.style.minWidth=i.width+2*i.padding+"px"),a.fixedWidth?a.el.style.right=t.scrollBar.getWidth()+"px":a.el.style.right=""}}}}}).call(i.prototype),t.LineWidgets=i}),ace.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?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.widgetManager.getWidgetsAtRow(a).filter(function(e){return"errorMarker"==e.type})[0];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"),type:"errorMarker"},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("
"),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; }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","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("./range").Range,o=e("./editor").Editor,r=e("./edit_session").EditSession,a=e("./undomanager").UndoManager,l=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,"function"==typeof define&&(t.define=define),t.edit=function(e,s){if("string"==typeof e){var r=e;if(!(e=document.getElementById(r)))throw new Error("ace.edit can't find div #"+r)}if(e&&e.env&&e.env.editor instanceof o)return e.env.editor;var a="";if(e&&/input|textarea/i.test(e.tagName)){var h=e;a=h.value,e=i.createElement("pre"),h.parentNode.replaceChild(e,h)}else e&&(a=e.textContent,e.innerHTML="");var c=t.createEditSession(a),u=new o(new l(e),c,s),d={document:c,editor:u,onResize:u.resize.bind(u,null)};return h&&(d.textarea=h),n.addListener(window,"resize",d.onResize),u.on("destroy",function(){n.removeListener(window,"resize",d.onResize),d.editor.container.env=null}),u.container.env=u.env=d,u},t.createEditSession=function(e,t){var i=new r(e,t);return i.setUndoManager(new a),i},t.Range=s,t.EditSession=r,t.UndoManager=a,t.VirtualRenderer=l,t.version="1.3.3"}),function(){ace.require(["ace/ace"],function(e){e&&(e.config.init(!0),e.define=ace.define),window.ace||(window.ace=e);for(var t in e)e.hasOwnProperty(t)&&(window.ace[t]=e[t]);window.ace["default"]=window.ace,"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=window.ace)})}(); //script: jquery helper /*! jQuery UI - v1.12.1 - 2018-05-16 * http://jqueryui.com * Includes: widget.js, position.js, data.js, disable-selection.js, focusable.js, form-reset-mixin.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/draggable.js, widgets/droppable.js, widgets/resizable.js, widgets/selectable.js, widgets/sortable.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/dialog.js, widgets/menu.js, widgets/mouse.js * Copyright jQuery Foundation and other contributors; Licensed MIT */ -!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(t){function e(t){for(var e=t.css("visibility");"inherit"===e;)t=t.parent(),e=t.css("visibility");return"hidden"!==e}t.ui=t.ui||{},t.ui.version="1.12.1";var i=0,s=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{(s=t._data(n,"events"))&&s.remove&&t(n).triggerHandler("remove")}catch(t){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,r,a={},l=e.split(".")[0];e=e.split(".")[1];var h=l+"-"+e;return s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr[":"][h.toLowerCase()]=function(e){return!!t.data(e,h)},t[l]=t[l]||{},n=t[l][e],o=t[l][e]=function(t,e){return this._createWidget?void(arguments.length&&this._createWidget(t,e)):new o(t,e)},t.extend(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),r=new i,r.options=t.widget.extend({},r.options),t.each(s,function(e,s){return t.isFunction(s)?void(a[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}()):void(a[e]=s)}),o.prototype=t.widget.extend(r,{widgetEventPrefix:n?r.widgetEventPrefix||e:e},a,{constructor:o,namespace:l,widgetName:e,widgetFullName:h}),n?(t.each(n._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete n._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var i,n,o=s.call(arguments,1),r=0,a=o.length;a>r;r++)for(i in o[r])n=o[r][i],o[r].hasOwnProperty(i)&&void 0!==n&&(e[i]=t.isPlainObject(n)?t.isPlainObject(e[i])?t.widget.extend({},e[i],n):t.widget.extend({},n):n);return e},t.widget.bridge=function(e,i){var n=i.prototype.widgetFullName||e;t.fn[e]=function(o){var r="string"==typeof o,a=s.call(arguments,1),l=this;return r?this.length||"instance"!==o?this.each(function(){var i,s=t.data(this,n);return"instance"===o?(l=s,!1):s?t.isFunction(s[o])&&"_"!==o.charAt(0)?(i=s[o].apply(s,a),i!==s&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; attempted to call method '"+o+"'")}):l=void 0:(a.length&&(o=t.widget.extend.apply(null,[o].concat(a))),this.each(function(){var e=t.data(this,n);e?(e.option(o||{}),e._init&&e._init()):t.data(this,n,new i(o,this))})),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,r=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(r={},s=e.split("."),e=s.shift(),s.length){for(n=r[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];r[e]=i}return this._setOptions(r),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var r,a;for(a=0;i.length>a;a++)r=n.classesElementLookup[i[a]]||t(),r=t(e.add?t.unique(r.get().concat(e.element.get())):r.not(e.element).get()),n.classesElementLookup[i[a]]=r,s.push(i[a]),o&&e.classes[i[a]]&&s.push(e.classes[i[a]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,r){function a(){return e||!0!==o.options.disabled&&!t(this).hasClass("ui-state-disabled")?("string"==typeof r?o[r]:r).apply(o,arguments):void 0}"string"!=typeof r&&(a.guid=r.guid=r.guid||a.guid||t.guid++);var l=s.match(/^([\w:-]*)\s*(.*)$/),h=l[1]+o.eventNamespace,c=l[2];c?n.on(h,c,a):i.on(h,a)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,r=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(r)&&!1===r.apply(this.element[0],[i].concat(s))||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var r,a=n?!0===n||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),r=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),r&&t.effects&&t.effects.effect[a]?s[e](n):a!==e&&s[a]?s[a](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,r=Math.abs,a=/left|center|right/,l=/top|center|bottom/,h=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,p=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("
"),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.widthi?"left":e>0?"right":"center",vertical:0>a?"top":s>0?"bottom":"middle"};h>d&&d>r(e+i)&&(u.horizontal="center"),c>f&&f>r(s+a)&&(u.vertical="middle"),u.important=o(r(e),r(i))>o(r(s),r(a))?"horizontal":"vertical",n.using.call(this,t,u)}),l.offset(t.extend(z,{using:a}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,r=s.width,a=t.left-e.collisionPosition.marginLeft,l=n-a,h=a+e.collisionWidth-r-n;e.collisionWidth>r?l>0&&0>=h?(i=t.left+l+e.collisionWidth-r-n,t.left+=l-i):t.left=h>0&&0>=l?n:l>h?n+r-e.collisionWidth:n:l>0?t.left+=l:h>0?t.left-=h:t.left=o(t.left-a,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,r=e.within.height,a=t.top-e.collisionPosition.marginTop,l=n-a,h=a+e.collisionHeight-r-n;e.collisionHeight>r?l>0&&0>=h?(i=t.top+l+e.collisionHeight-r-n,t.top+=l-i):t.top=h>0&&0>=l?n:l>h?n+r-e.collisionHeight:n:l>0?t.top+=l:h>0?t.top-=h:t.top=o(t.top-a,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,a=n.width,l=n.isWindow?n.scrollLeft:n.offset.left,h=t.left-e.collisionPosition.marginLeft,c=h-l,u=h+e.collisionWidth-a-l,p="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,d="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(0>(i=t.left+p+d+f+e.collisionWidth-a-o)||r(c)>i)&&(t.left+=p+d+f):u>0&&((s=t.left-e.collisionPosition.marginLeft+p+d+f-l)>0||u>r(s))&&(t.left+=p+d+f)},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,a=n.height,l=n.isWindow?n.scrollTop:n.offset.top,h=t.top-e.collisionPosition.marginTop,c=h-l,u=h+e.collisionHeight-a-l,p="top"===e.my[1],d=p?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,m=-2*e.offset[1];0>c?(0>(s=t.top+d+f+m+e.collisionHeight-a-o)||r(c)>s)&&(t.top+=d+f+m):u>0&&((i=t.top-e.collisionPosition.marginTop+d+f+m-l)>0||u>r(i))&&(t.top+=d+f+m)}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}}),t.ui.focusable=function(i,s){var n,o,r,a,l,h=i.nodeName.toLowerCase();return"area"===h?(n=i.parentNode,o=n.name,!(!i.href||!o||"map"!==n.nodeName.toLowerCase())&&(r=t("img[usemap='#"+o+"']"),r.length>0&&r.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(h)?(a=!i.disabled)&&(l=t(i).closest("fieldset")[0])&&(a=!l.disabled):a="a"===h?i.href||s:s,a&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)},t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}(),t.fn.labels=function(){var e,i,s,n,o;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(n=this.eq(0).parents("label"),s=this.attr("id"),s&&(e=this.eq(0).parents().last(),o=e.add(e.length?e.siblings():this.siblings()),i="label[for='"+t.ui.escapeSelector(s)+"']",n=n.add(o.find(i).addBack(i))),this.pushStack(n))},t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return(!s||"static"!==e.css("position"))&&n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.extend(t.expr[":"],{tabbable:function(e){var i=t.attr(e,"tabindex"),s=null!=i;return(!s||i>=0)&&t.ui.focusable(e,s)}}),t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var n=!1;t(document).on("mouseup",function(){n=!1}),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!n){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,s=1===e.which,o=!("string"!=typeof this.options.cancel||!e.target.nodeName)&&t(e.target).closest(this.options.cancel).length;return!(s&&!o&&this._mouseCapture(e))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(e),!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),n=!0,!0))}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,e),this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,n=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.ui.plugin={add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;o.length>n;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(i){e=t.body}return e||(e=t.body),e.nodeName||(e=t.body),e},t.ui.safeBlur=function(e){e&&"body"!==e.nodeName.toLowerCase()&&t(e).trigger("blur")},t.widget("ui.draggable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?void(this.destroyOnClear=!0):(this._removeHandleClassName(),void this._mouseDestroy())},_mouseCapture:function(e){var i=this.options;return!(this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0)&&(this.handle=this._getHandle(e),!!this.handle&&(this._blurActiveElement(e),this._blockFrames(!0===i.iframeFix?"iframe":i.iframeFix),!0))},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var e=t(this);return t("
").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(e){var i=t.ui.safeActiveElement(this.document[0]);t(e.target).closest(i).length||t.ui.safeBlur(i)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===t(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(e),this.originalPosition=this.position=this._generatePosition(e,!1),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),!1===this._trigger("start",e)?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(!1===this._trigger("drag",e,s))return this._mouseUp(new t.Event("mouseup",e)),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||!0===this.options.revert||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==i._trigger("stop",e)&&i._clear()}):!1!==this._trigger("stop",e)&&this._clear(),!1},_mouseUp:function(e){return this._unblockFrames(),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),this.handleElement.is(e.target)&&this.element.trigger("focus"),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new t.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(e){return!this.options.handle||!!t(e.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper),n=s?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options,o=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?void(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):"document"===n.containment?void(this.containment=[0,0,t(o).width()-this.helperProportions.width-this.margins.left,(t(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):n.containment.constructor===Array?void(this.containment=n.containment):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),void((s=i[0])&&(e=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i))):void(this.containment=null)},_convertPositionTo:function(t,e){e||(e=this.position);var i="absolute"===t?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s,n,o,r=this.options,a=this._isRootNode(this.scrollParent[0]),l=t.pageX,h=t.pageY;return a&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,t.pageX-this.offset.click.lefti[2]&&(l=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(h=i[3]+this.offset.click.top)),r.grid&&(n=r.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/r.grid[1])*r.grid[1]:this.originalPageY,h=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-r.grid[1]:n+r.grid[1]:n,o=r.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/r.grid[0])*r.grid[0]:this.originalPageX,l=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-r.grid[0]:o+r.grid[0]:o),"y"===r.axis&&(l=this.originalPageX),"x"===r.axis&&(h=this.originalPageY)),{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:a?0:this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:a?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s,this],!0),/^(drag|start|stop)/.test(e)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i,s){var n=t.extend({},i,{item:s.element});s.sortables=[],t(s.options.connectToSortable).each(function(){var i=t(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",e,n))})},stop:function(e,i,s){var n=t.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,t.each(s.sortables,function(){var t=this;t.isOver?(t.isOver=0,s.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,n))})},drag:function(e,i,s){t.each(s.sortables,function(){var n=!1,o=this;o.positionAbs=s.positionAbs,o.helperProportions=s.helperProportions,o.offset.click=s.offset.click,o._intersectsWith(o.containerCache)&&(n=!0, +!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(t){function e(t){for(var e=t.css("visibility");"inherit"===e;)t=t.parent(),e=t.css("visibility");return"hidden"!==e}t.ui=t.ui||{},t.ui.version="1.12.1";var i=0,s=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{(s=t._data(n,"events"))&&s.remove&&t(n).triggerHandler("remove")}catch(t){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,r,a={},l=e.split(".")[0];e=e.split(".")[1];var h=l+"-"+e;return s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr[":"][h.toLowerCase()]=function(e){return!!t.data(e,h)},t[l]=t[l]||{},n=t[l][e],o=t[l][e]=function(t,e){return this._createWidget?void(arguments.length&&this._createWidget(t,e)):new o(t,e)},t.extend(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),r=new i,r.options=t.widget.extend({},r.options),t.each(s,function(e,s){return t.isFunction(s)?void(a[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}()):void(a[e]=s)}),o.prototype=t.widget.extend(r,{widgetEventPrefix:n?r.widgetEventPrefix||e:e},a,{constructor:o,namespace:l,widgetName:e,widgetFullName:h}),n?(t.each(n._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete n._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var i,n,o=s.call(arguments,1),r=0,a=o.length;a>r;r++)for(i in o[r])n=o[r][i],o[r].hasOwnProperty(i)&&void 0!==n&&(e[i]=t.isPlainObject(n)?t.isPlainObject(e[i])?t.widget.extend({},e[i],n):t.widget.extend({},n):n);return e},t.widget.bridge=function(e,i){var n=i.prototype.widgetFullName||e;t.fn[e]=function(o){var r="string"==typeof o,a=s.call(arguments,1),l=this;return r?this.length||"instance"!==o?this.each(function(){var i,s=t.data(this,n);return"instance"===o?(l=s,!1):s?t.isFunction(s[o])&&"_"!==o.charAt(0)?(i=s[o].apply(s,a),i!==s&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; attempted to call method '"+o+"'")}):l=void 0:(a.length&&(o=t.widget.extend.apply(null,[o].concat(a))),this.each(function(){var e=t.data(this,n);e?(e.option(o||{}),e._init&&e._init()):t.data(this,n,new i(o,this))})),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,r=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(r={},s=e.split("."),e=s.shift(),s.length){for(n=r[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];r[e]=i}return this._setOptions(r),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var r,a;for(a=0;i.length>a;a++)r=n.classesElementLookup[i[a]]||t(),r=t(e.add?t.unique(r.get().concat(e.element.get())):r.not(e.element).get()),n.classesElementLookup[i[a]]=r,s.push(i[a]),o&&e.classes[i[a]]&&s.push(e.classes[i[a]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,r){function a(){return e||!0!==o.options.disabled&&!t(this).hasClass("ui-state-disabled")?("string"==typeof r?o[r]:r).apply(o,arguments):void 0}"string"!=typeof r&&(a.guid=r.guid=r.guid||a.guid||t.guid++);var l=s.match(/^([\w:-]*)\s*(.*)$/),h=l[1]+o.eventNamespace,c=l[2];c?n.on(h,c,a):i.on(h,a)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,r=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(r)&&!1===r.apply(this.element[0],[i].concat(s))||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var r,a=n?!0===n||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),r=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),r&&t.effects&&t.effects.effect[a]?s[e](n):a!==e&&s[a]?s[a](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,r=Math.abs,a=/left|center|right/,l=/top|center|bottom/,h=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,p=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("
"),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.widthi?"left":e>0?"right":"center",vertical:0>a?"top":s>0?"bottom":"middle"};h>d&&d>r(e+i)&&(u.horizontal="center"),c>f&&f>r(s+a)&&(u.vertical="middle"),u.important=o(r(e),r(i))>o(r(s),r(a))?"horizontal":"vertical",n.using.call(this,t,u)}),l.offset(t.extend(z,{using:a}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,r=s.width,a=t.left-e.collisionPosition.marginLeft,l=n-a,h=a+e.collisionWidth-r-n;e.collisionWidth>r?l>0&&0>=h?(i=t.left+l+e.collisionWidth-r-n,t.left+=l-i):t.left=h>0&&0>=l?n:l>h?n+r-e.collisionWidth:n:l>0?t.left+=l:h>0?t.left-=h:t.left=o(t.left-a,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,r=e.within.height,a=t.top-e.collisionPosition.marginTop,l=n-a,h=a+e.collisionHeight-r-n;e.collisionHeight>r?l>0&&0>=h?(i=t.top+l+e.collisionHeight-r-n,t.top+=l-i):t.top=h>0&&0>=l?n:l>h?n+r-e.collisionHeight:n:l>0?t.top+=l:h>0?t.top-=h:t.top=o(t.top-a,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,a=n.width,l=n.isWindow?n.scrollLeft:n.offset.left,h=t.left-e.collisionPosition.marginLeft,c=h-l,u=h+e.collisionWidth-a-l,p="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,d="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(0>(i=t.left+p+d+f+e.collisionWidth-a-o)||r(c)>i)&&(t.left+=p+d+f):u>0&&((s=t.left-e.collisionPosition.marginLeft+p+d+f-l)>0||u>r(s))&&(t.left+=p+d+f)},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,a=n.height,l=n.isWindow?n.scrollTop:n.offset.top,h=t.top-e.collisionPosition.marginTop,c=h-l,u=h+e.collisionHeight-a-l,p="top"===e.my[1],d=p?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,m=-2*e.offset[1];0>c?(0>(s=t.top+d+f+m+e.collisionHeight-a-o)||r(c)>s)&&(t.top+=d+f+m):u>0&&((i=t.top-e.collisionPosition.marginTop+d+f+m-l)>0||u>r(i))&&(t.top+=d+f+m)}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}}),t.ui.focusable=function(i,s){var n,o,r,a,l,h=i.nodeName.toLowerCase();return"area"===h?(n=i.parentNode,o=n.name,!(!i.href||!o||"map"!==n.nodeName.toLowerCase())&&(r=t("img[usemap='#"+o+"']"),r.length>0&&r.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(h)?(a=!i.disabled)&&(l=t(i).closest("fieldset")[0])&&(a=!l.disabled):a="a"===h?i.href||s:s,a&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)},t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,.\/:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}(),t.fn.labels=function(){var e,i,s,n,o;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(n=this.eq(0).parents("label"),s=this.attr("id"),s&&(e=this.eq(0).parents().last(),o=e.add(e.length?e.siblings():this.siblings()),i="label[for='"+t.ui.escapeSelector(s)+"']",n=n.add(o.find(i).addBack(i))),this.pushStack(n))},t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return(!s||"static"!==e.css("position"))&&n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.extend(t.expr[":"],{tabbable:function(e){var i=t.attr(e,"tabindex"),s=null!=i;return(!s||i>=0)&&t.ui.focusable(e,s)}}),t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var n=!1;t(document).on("mouseup",function(){n=!1}),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!n){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,s=1===e.which,o=!("string"!=typeof this.options.cancel||!e.target.nodeName)&&t(e.target).closest(this.options.cancel).length;return!(s&&!o&&this._mouseCapture(e))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(e),!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),n=!0,!0))}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,e),this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,n=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.ui.plugin={add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;o.length>n;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(i){e=t.body}return e||(e=t.body),e.nodeName||(e=t.body),e},t.ui.safeBlur=function(e){e&&"body"!==e.nodeName.toLowerCase()&&t(e).trigger("blur")},t.widget("ui.draggable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?void(this.destroyOnClear=!0):(this._removeHandleClassName(),void this._mouseDestroy())},_mouseCapture:function(e){var i=this.options;return!(this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0)&&(this.handle=this._getHandle(e),!!this.handle&&(this._blurActiveElement(e),this._blockFrames(!0===i.iframeFix?"iframe":i.iframeFix),!0))},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var e=t(this);return t("
").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(e){var i=t.ui.safeActiveElement(this.document[0]);t(e.target).closest(i).length||t.ui.safeBlur(i)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===t(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(e),this.originalPosition=this.position=this._generatePosition(e,!1),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),!1===this._trigger("start",e)?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(!1===this._trigger("drag",e,s))return this._mouseUp(new t.Event("mouseup",e)),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||!0===this.options.revert||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==i._trigger("stop",e)&&i._clear()}):!1!==this._trigger("stop",e)&&this._clear(),!1},_mouseUp:function(e){return this._unblockFrames(),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),this.handleElement.is(e.target)&&this.element.trigger("focus"),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new t.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(e){return!this.options.handle||!!t(e.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper),n=s?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options,o=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?void(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):"document"===n.containment?void(this.containment=[0,0,t(o).width()-this.helperProportions.width-this.margins.left,(t(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):n.containment.constructor===Array?void(this.containment=n.containment):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),void((s=i[0])&&(e=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i))):void(this.containment=null)},_convertPositionTo:function(t,e){e||(e=this.position);var i="absolute"===t?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s,n,o,r=this.options,a=this._isRootNode(this.scrollParent[0]),l=t.pageX,h=t.pageY;return a&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,t.pageX-this.offset.click.lefti[2]&&(l=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(h=i[3]+this.offset.click.top)),r.grid&&(n=r.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/r.grid[1])*r.grid[1]:this.originalPageY,h=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-r.grid[1]:n+r.grid[1]:n,o=r.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/r.grid[0])*r.grid[0]:this.originalPageX,l=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-r.grid[0]:o+r.grid[0]:o),"y"===r.axis&&(l=this.originalPageX),"x"===r.axis&&(h=this.originalPageY)),{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:a?0:this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:a?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s,this],!0),/^(drag|start|stop)/.test(e)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i,s){var n=t.extend({},i,{item:s.element});s.sortables=[],t(s.options.connectToSortable).each(function(){var i=t(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",e,n))})},stop:function(e,i,s){var n=t.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,t.each(s.sortables,function(){var t=this;t.isOver?(t.isOver=0,s.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,n))})},drag:function(e,i,s){t.each(s.sortables,function(){var n=!1,o=this;o.positionAbs=s.positionAbs,o.helperProportions=s.helperProportions,o.offset.click=s.offset.click,o._intersectsWith(o.containerCache)&&(n=!0, t.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==o&&this._intersectsWith(this.containerCache)&&t.contains(o.element[0],this.element[0])&&(n=!1),n})),n?(o.isOver||(o.isOver=1,s._parent=i.helper.parent(),o.currentItem=i.helper.appendTo(o.element).data("ui-sortable-item",!0),o.options._helper=o.options.helper,o.options.helper=function(){return i.helper[0]},e.target=o.currentItem[0],o._mouseCapture(e,!0),o._mouseStart(e,!0,!0),o.offset.click.top=s.offset.click.top,o.offset.click.left=s.offset.click.left,o.offset.parent.left-=s.offset.parent.left-o.offset.parent.left,o.offset.parent.top-=s.offset.parent.top-o.offset.parent.top,s._trigger("toSortable",e),s.dropped=o.element,t.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,o.fromOutside=s),o.currentItem&&(o._mouseDrag(e),i.position=o.position)):o.isOver&&(o.isOver=0,o.cancelHelperRemoval=!0,o.options._revert=o.options.revert,o.options.revert=!1,o._trigger("out",e,o._uiHash(o)),o._mouseStop(e,!0),o.options.revert=o.options._revert,o.options.helper=o.options._helper,o.placeholder&&o.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(e),i.position=s._generatePosition(e,!0),s._trigger("fromSortable",e),s.dropped=!1,t.each(s.sortables,function(){this.refreshPositions()}))})}}),t.ui.plugin.add("draggable","cursor",{start:function(e,i,s){var n=t("body"),o=s.options;n.css("cursor")&&(o._cursor=n.css("cursor")),n.css("cursor",o.cursor)},stop:function(e,i,s){var n=s.options;n._cursor&&t("body").css("cursor",n._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i,s){var n=t(i.helper),o=s.options;n.css("opacity")&&(o._opacity=n.css("opacity")),n.css("opacity",o.opacity)},stop:function(e,i,s){var n=s.options;n._opacity&&t(i.helper).css("opacity",n._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(e,i,s){var n=s.options,o=!1,r=s.scrollParentNotHidden[0],a=s.document[0];r!==a&&"HTML"!==r.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+r.offsetHeight-e.pageY=0;p--)l=s.snapElements[p].left-s.margins.left,h=l+s.snapElements[p].width,c=s.snapElements[p].top-s.margins.top,u=c+s.snapElements[p].height,l-m>_||g>h+m||c-m>b||v>u+m||!t.contains(s.snapElements[p].item.ownerDocument,s.snapElements[p].item)?(s.snapElements[p].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[p].item})),s.snapElements[p].snapping=!1):("inner"!==f.snapMode&&(n=m>=Math.abs(c-b),o=m>=Math.abs(u-v),r=m>=Math.abs(l-_),a=m>=Math.abs(h-g),n&&(i.position.top=s._convertPositionTo("relative",{top:c-s.helperProportions.height,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left)),d=n||o||r||a,"outer"!==f.snapMode&&(n=m>=Math.abs(c-v),o=m>=Math.abs(u-b),r=m>=Math.abs(l-g),a=m>=Math.abs(h-_),n&&(i.position.top=s._convertPositionTo("relative",{top:c,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left)),!s.snapElements[p].snapping&&(n||o||r||a||d)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[p].item})),s.snapElements[p].snapping=n||o||r||a||d)}}),t.ui.plugin.add("draggable","stack",{start:function(e,i,s){var n,o=s.options,r=t.makeArray(t(o.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});r.length&&(n=parseInt(t(r[0]).css("zIndex"),10)||0,t(r).each(function(e){t(this).css("zIndex",n+e)}),this.css("zIndex",n+r.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i,s){var n=t(i.helper),o=s.options;n.css("zIndex")&&(o._zIndex=n.css("zIndex")),n.css("zIndex",o.zIndex)},stop:function(e,i,s){var n=s.options;n._zIndex&&t(i.helper).css("zIndex",n._zIndex)}}),t.ui.draggable,t.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=t.isFunction(s)?s:function(t){return t.is(s)},this.proportions=function(){return arguments.length?void(e=arguments[0]):e||(e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight})},this._addToManager(i.scope),i.addClasses&&this._addClass("ui-droppable")},_addToManager:function(e){t.ui.ddmanager.droppables[e]=t.ui.ddmanager.droppables[e]||[],t.ui.ddmanager.droppables[e].push(this)},_splice:function(t){for(var e=0;t.length>e;e++)t[e]===this&&t.splice(e,1)},_destroy:function(){var e=t.ui.ddmanager.droppables[this.options.scope];this._splice(e)},_setOption:function(e,i){if("accept"===e)this.accept=t.isFunction(i)?i:function(t){return t.is(i)};else if("scope"===e){var s=t.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(e,i)},_activate:function(e){var i=t.ui.ddmanager.current;this._addActiveClass(),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this._removeActiveClass(),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._addHoverClass(),this._trigger("over",e,this.ui(i)))},_out:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeHoverClass(),this._trigger("out",e,this.ui(i)))},_drop:function(e,i){var s=i||t.ui.ddmanager.current,n=!1;return!(!s||(s.currentItem||s.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=t(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&o(s,t.extend(i,{offset:i.element.offset()}),i.options.tolerance,e)?(n=!0,!1):void 0}),!n&&(!!this.accept.call(this.element[0],s.currentItem||s.element)&&(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",e,this.ui(s)),this.element)))},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var o=t.ui.intersect=function(){function t(t,e,i){return t>=e&&e+i>t}return function(e,i,s,n){if(!i.offset)return!1;var o=(e.positionAbs||e.position.absolute).left+e.margins.left,r=(e.positionAbs||e.position.absolute).top+e.margins.top,a=o+e.helperProportions.width,l=r+e.helperProportions.height,h=i.offset.left,c=i.offset.top,u=h+i.proportions().width,p=c+i.proportions().height;switch(s){case"fit":return o>=h&&u>=a&&r>=c&&p>=l;case"intersect":return o+e.helperProportions.width/2>h&&u>a-e.helperProportions.width/2&&r+e.helperProportions.height/2>c&&p>l-e.helperProportions.height/2;case"pointer":return t(n.pageY,c,i.proportions().height)&&t(n.pageX,h,i.proportions().width);case"touch":return(r>=c&&p>=r||l>=c&&p>=l||c>r&&l>p)&&(o>=h&&u>=o||a>=h&&u>=a||h>o&&a>u);default:return!1}}}();t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,i){var s,n,o=t.ui.ddmanager.droppables[e.options.scope]||[],r=i?i.type:null,a=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(s=0;o.length>s;s++)if(!(o[s].options.disabled||e&&!o[s].accept.call(o[s].element[0],e.currentItem||e.element))){for(n=0;a.length>n;n++)if(a[n]===o[s].element[0]){o[s].proportions().height=0;continue t}o[s].visible="none"!==o[s].element.css("display"),o[s].visible&&("mousedown"===r&&o[s]._activate.call(o[s],i),o[s].offset=o[s].element.offset(),o[s].proportions({width:o[s].element[0].offsetWidth,height:o[s].element[0].offsetHeight}))}},drop:function(e,i){var s=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&o(e,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(e,i){e.element.parentsUntil("body").on("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,r,a=o(e,this,this.options.tolerance,i),l=!a&&this.isover?"isout":a&&!this.isover?"isover":null;l&&(this.options.greedy&&(n=this.options.scope,r=this.element.parents(":data(ui-droppable)").filter(function(){return t(this).droppable("instance").options.scope===n}),r.length&&(s=t(r[0]).droppable("instance"),s.greedyChild="isover"===l)),s&&"isover"===l&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[l]=!0,this["isout"===l?"isover":"isout"]=!1,this["isover"===l?"_over":"_out"].call(this,i),s&&"isout"===l&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(e,i){e.element.parentsUntil("body").off("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}},!1!==t.uiBackCompat&&t.widget("ui.droppable",t.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}}),t.ui.droppable,t.widget("ui.resizable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return e[s]>0||(e[s]=1,n=e[s]>0,e[s]=0,n)},_create:function(){var e,i=this.options,s=this;this._addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(t("
").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,e={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(e),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(e),this._proportionallyResize()),this._setupHandles(),i.autoHide&&t(this.element).on("mouseenter",function(){i.disabled||(s._removeClass("ui-resizable-autohide"),s._handles.show())}).on("mouseleave",function(){i.disabled||s.resizing||(s._addClass("ui-resizable-autohide"),s._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles()}},_setupHandles:function(){var e,i,s,n,o,r=this.options,a=this;if(this.handles=r.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=t(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),s=this.handles.split(","),this.handles={},i=0;s.length>i;i++)e=t.trim(s[i]),n="ui-resizable-"+e,o=t("
"),this._addClass(o,"ui-resizable-handle "+n),o.css({zIndex:r.zIndex}),this.handles[e]=".ui-resizable-"+e,this.element.append(o);this._renderAxis=function(e){var i,s,n,o;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=t(this.handles[i]),this._on(this.handles[i],{mousedown:a._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){a.resizing||(this.className&&(o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),a.axis=o&&o[1]?o[1]:"se")}),r.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)((s=t(this.handles[i])[0])===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(e){var i,s,n,o=this.options,r=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),o.containment&&(i+=t(o.containment).scrollLeft()||0,s+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:r.width(),height:r.height()},this.originalSize=this._helper?{width:r.outerWidth(),height:r.outerHeight()}:{width:r.width(),height:r.height()},this.sizeDiff={width:r.outerWidth()-r.width(),height:r.outerHeight()-r.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===n?this.axis+"-resize":n),this._addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var i,s,n=this.originalMousePosition,o=this.axis,r=e.pageX-n.left||0,a=e.pageY-n.top||0,l=this._change[o];return this._updatePrevProperties(),!!l&&(i=l.apply(this,[e,r,a]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges()),!1)},_mouseStop:function(e){this.resizing=!1;var i,s,n,o,r,a,l,h=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:c.sizeDiff.height,o=s?0:c.sizeDiff.width,r={width:c.helper.width()-o,height:c.helper.height()-n},a=parseFloat(c.element.css("left"))+(c.position.left-c.originalPosition.left)||null,l=parseFloat(c.element.css("top"))+(c.position.top-c.originalPosition.top)||null,h.animate||this.element.css(t.extend(r,{top:l,left:a})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!h.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s,n,o,r=this.options;o={minWidth:this._isNumber(r.minWidth)?r.minWidth:0,maxWidth:this._isNumber(r.maxWidth)?r.maxWidth:1/0,minHeight:this._isNumber(r.minHeight)?r.minHeight:0,maxHeight:this._isNumber(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,s=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,n=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),s>o.minHeight&&(o.minHeight=s),o.maxWidth>i&&(o.maxWidth=i),o.maxHeight>n&&(o.maxHeight=n)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidtht.width,r=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,a=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,h=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),r&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&h&&(t.left=a-e.minWidth),s&&h&&(t.left=a-e.maxWidth),r&&c&&(t.top=l-e.minHeight),n&&c&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];4>e;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;this._proportionallyResizeElements.length>e;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("
"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),r=o&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,a=o?0:i.sizeDiff.width,l={width:i.size.width-a,height:i.size.height-r},h=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,c=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(l,c&&h?{top:c,left:h}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var e,i,s,n,o,r,a,l=t(this).resizable("instance"),h=l.options,c=l.element,u=h.containment,p=u instanceof t?u.get(0):/parent/.test(u)?c.parent().get(0):u;p&&(l.containerElement=t(p),/document/.test(u)||u===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(e=t(p),i=[],t(["Top","Right","Left","Bottom"]).each(function(t,s){i[t]=l._num(e.css("padding"+s))}),l.containerOffset=e.offset(),l.containerPosition=e.position(),l.containerSize={height:e.innerHeight()-i[3],width:e.innerWidth()-i[1]},s=l.containerOffset,n=l.containerSize.height,o=l.containerSize.width,r=l._hasScroll(p,"left")?p.scrollWidth:o,a=l._hasScroll(p)?p.scrollHeight:n,l.parentData={element:p,left:s.left,top:s.top,width:r,height:a}))},resize:function(e){var i,s,n,o,r=t(this).resizable("instance"),a=r.options,l=r.containerOffset,h=r.position,c=r._aspectRatio||e.shiftKey,u={top:0,left:0},p=r.containerElement,d=!0;p[0]!==document&&/static/.test(p.css("position"))&&(u=l),h.left<(r._helper?l.left:0)&&(r.size.width=r.size.width+(r._helper?r.position.left-l.left:r.position.left-u.left),c&&(r.size.height=r.size.width/r.aspectRatio,d=!1),r.position.left=a.helper?l.left:0),h.top<(r._helper?l.top:0)&&(r.size.height=r.size.height+(r._helper?r.position.top-l.top:r.position.top),c&&(r.size.width=r.size.height*r.aspectRatio,d=!1),r.position.top=r._helper?l.top:0),n=r.containerElement.get(0)===r.element.parent().get(0),o=/relative|absolute/.test(r.containerElement.css("position")),n&&o?(r.offset.left=r.parentData.left+r.position.left,r.offset.top=r.parentData.top+r.position.top):(r.offset.left=r.element.offset().left,r.offset.top=r.element.offset().top),i=Math.abs(r.sizeDiff.width+(r._helper?r.offset.left-u.left:r.offset.left-l.left)),s=Math.abs(r.sizeDiff.height+(r._helper?r.offset.top-u.top:r.offset.top-l.top)),i+r.size.width>=r.parentData.width&&(r.size.width=r.parentData.width-i,c&&(r.size.height=r.size.width/r.aspectRatio,d=!1)),s+r.size.height>=r.parentData.height&&(r.size.height=r.parentData.height-s,c&&(r.size.width=r.size.height*r.aspectRatio,d=!1)),d||(r.position.left=r.prevPosition.left,r.position.top=r.prevPosition.top,r.size.width=r.prevSize.width,r.size.height=r.prevSize.height)},stop:function(){var e=t(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.containerPosition,o=e.containerElement,r=t(e.helper),a=r.offset(),l=r.outerWidth()-e.sizeDiff.width,h=r.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:a.left-n.left-s.left,width:l,height:h}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:a.left-n.left-s.left,width:l,height:h})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance"),i=e.options;t(i.alsoResize).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseFloat(e.width()),height:parseFloat(e.height()),left:parseFloat(e.css("left")),top:parseFloat(e.css("top"))})})},resize:function(e,i){var s=t(this).resizable("instance"),n=s.options,o=s.originalSize,r=s.originalPosition,a={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-r.top||0,left:s.position.left-r.left||0};t(n.alsoResize).each(function(){var e=t(this),s=t(this).data("ui-resizable-alsoresize"),n={},o=e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(s[e]||0)+(a[e]||0);i&&i>=0&&(n[e]=i||null)}),e.css(n)})},stop:function(){t(this).removeData("ui-resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),i=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),e._addClass(e.ghost,"ui-resizable-ghost"),!1!==t.uiBackCompat&&"string"==typeof e.options.ghost&&e.ghost.addClass(this.options.ghost),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e,i=t(this).resizable("instance"),s=i.options,n=i.size,o=i.originalSize,r=i.originalPosition,a=i.axis,l="number"==typeof s.grid?[s.grid,s.grid]:s.grid,h=l[0]||1,c=l[1]||1,u=Math.round((n.width-o.width)/h)*h,p=Math.round((n.height-o.height)/c)*c,d=o.width+u,f=o.height+p,m=s.maxWidth&&d>s.maxWidth,g=s.maxHeight&&f>s.maxHeight,_=s.minWidth&&s.minWidth>d,v=s.minHeight&&s.minHeight>f;s.grid=l,_&&(d+=h),v&&(f+=c),m&&(d-=h),g&&(f-=c),/^(se|s|e)$/.test(a)?(i.size.width=d,i.size.height=f):/^(ne)$/.test(a)?(i.size.width=d,i.size.height=f,i.position.top=r.top-p):/^(sw)$/.test(a)?(i.size.width=d,i.size.height=f,i.position.left=r.left-u):((0>=f-c||0>=d-h)&&(e=i._getPaddingPlusBorderDimensions(this)),f-c>0?(i.size.height=f,i.position.top=r.top-p):(f=c-e.height,i.size.height=f,i.position.top=r.top+o.height-f),d-h>0?(i.size.width=d,i.position.left=r.left-u):(d=h-e.width,i.size.width=d,i.position.left=r.left+o.width-d))}}),t.ui.resizable,t.widget("ui.selectable",t.ui.mouse,{version:"1.12.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e.elementPos=t(e.element[0]).offset(),e.selectees=t(e.options.filter,e.element[0]),e._addClass(e.selectees,"ui-selectee"),e.selectees.each(function(){var i=t(this),s=i.offset(),n={left:s.left-e.elementPos.left,top:s.top-e.elementPos.top};t.data(this,"selectable-item",{element:this,$element:i,left:n.left,top:n.top,right:n.left+i.outerWidth(),bottom:n.top+i.outerHeight(),startselected:!1,selected:i.hasClass("ui-selected"),selecting:i.hasClass("ui-selecting"),unselecting:i.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=t("
"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(e){var i=this,s=this.options;this.opos=[e.pageX,e.pageY],this.elementPos=t(this.element[0]).offset(),this.options.disabled||(this.selectees=t(s.filter,this.element[0]),this._trigger("start",e),t(s.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=t.data(this,"selectable-item");s.startselected=!0,e.metaKey||e.ctrlKey||(i._removeClass(s.$element,"ui-selected"),s.selected=!1,i._addClass(s.$element,"ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",e,{unselecting:s.element}))}),t(e.target).parents().addBack().each(function(){var s,n=t.data(this,"selectable-item");return n?(s=!e.metaKey&&!e.ctrlKey||!n.$element.hasClass("ui-selected"),i._removeClass(n.$element,s?"ui-unselecting":"ui-selected")._addClass(n.$element,s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",e,{selecting:n.element}):i._trigger("unselecting",e,{unselecting:n.element}),!1):void 0}))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,o=this.opos[0],r=this.opos[1],a=e.pageX,l=e.pageY;return o>a&&(i=a,a=o,o=i),r>l&&(i=l,l=r,r=i), this.helper.css({left:o,top:r,width:a-o,height:l-r}),this.selectees.each(function(){var i=t.data(this,"selectable-item"),h=!1,c={};i&&i.element!==s.element[0]&&(c.left=i.left+s.elementPos.left,c.right=i.right+s.elementPos.left,c.top=i.top+s.elementPos.top,c.bottom=i.bottom+s.elementPos.top,"touch"===n.tolerance?h=!(c.left>a||o>c.right||c.top>l||r>c.bottom):"fit"===n.tolerance&&(h=c.left>o&&a>c.right&&c.top>r&&l>c.bottom),h?(i.selected&&(s._removeClass(i.$element,"ui-selected"),i.selected=!1),i.unselecting&&(s._removeClass(i.$element,"ui-unselecting"),i.unselecting=!1),i.selecting||(s._addClass(i.$element,"ui-selecting"),i.selecting=!0,s._trigger("selecting",e,{selecting:i.element}))):(i.selecting&&((e.metaKey||e.ctrlKey)&&i.startselected?(s._removeClass(i.$element,"ui-selecting"),i.selecting=!1,s._addClass(i.$element,"ui-selected"),i.selected=!0):(s._removeClass(i.$element,"ui-selecting"),i.selecting=!1,i.startselected&&(s._addClass(i.$element,"ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",e,{unselecting:i.element}))),i.selected&&(e.metaKey||e.ctrlKey||i.startselected||(s._removeClass(i.$element,"ui-selected"),i.selected=!1,s._addClass(i.$element,"ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",e,{unselecting:i.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,t(".ui-unselecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");i._removeClass(s.$element,"ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",e,{unselected:s.element})}),t(".ui-selecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");i._removeClass(s.$element,"ui-selecting")._addClass(s.$element,"ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",e,{selected:s.element})}),this._trigger("stop",e),this.helper.remove(),!1}}),t.widget("ui.sortable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return t>=e&&e+i>t},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var e=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),t.each(this.items,function(){e._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):void 0}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),!!s&&(!(this.options.handle&&!i&&(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),!n))&&(this.currentItem=s,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(e,i,s){var n,o,r=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,r.cursorAt&&this._adjustOffsetFromHelper(r.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),r.containment&&this._setContainment(),r.cursor&&"auto"!==r.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",r.cursor),this.storedStylesheet=t("").appendTo(o)),r.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",r.opacity)),r.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",r.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!r.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,r=this.options,a=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY=0;i--)if(s=this.items[i],n=s.item[0],(o=this._intersectsWithPointer(s))&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"!==this.options.type||!t.contains(this.element[0],n))){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,r={};o&&"x"!==o||(r.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(r.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(r,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new t.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,r=o+t.width,a=t.top,l=a+t.height,h=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+h>a&&l>s+h,p="y"===this.options.axis||e+c>o&&r>e+c,d=u&&p;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?d:e+this.helperProportions.width/2>o&&r>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>a&&l>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var e,i,s="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),n="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width);return!(!s||!n)&&(e=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection(),this.floating?"right"===i||"down"===e?2:1:e&&("down"===e?2:1))},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&e||"up"===s&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){a.push(this)}var s,n,o,r,a=[],l=[],h=this._connectWith();if(h&&e)for(s=h.length-1;s>=0;s--)for(o=t(h[s],this.document[0]),n=o.length-1;n>=0;n--)(r=t.data(o[n],this.widgetFullName))&&r!==this&&!r.options.disabled&&l.push([t.isFunction(r.options.items)?r.options.items.call(r.element):t(r.options.items,r.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),r]);for(l.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=l.length-1;s>=0;s--)l[s][0].each(i);return t(a)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,r,a,l,h,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],p=this._connectWith();if(p&&this.ready)for(i=p.length-1;i>=0;i--)for(n=t(p[i],this.document[0]),s=n.length-1;s>=0;s--)(o=t.data(n[s],this.widgetFullName))&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(r=u[i][1],a=u[i][0],s=0,h=a.length;h>s;s++)l=t(a[s]),l.data(this.widgetName+"-item",r),c.push({item:l,instance:r,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]);return e._addClass(n,"ui-sortable-placeholder",i||e.currentItem[0].className)._removeClass(n,"ui-sortable-helper"),"tbody"===s?e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("",e.document[0]).appendTo(n)):"tr"===s?e._createTrPlaceholder(e.currentItem,n):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,i){var s=this;e.children().each(function(){t(" ",s.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(e){var i,s,n,o,r,a,l,h,c,u,p=null,d=null;for(i=this.containers.length-1;i>=0;i--)if(!t.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(p&&t.contains(this.containers[i].element[0],p.element[0]))continue;p=this.containers[i],d=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",e,this._uiHash(this)),this.containers[i].containerCache.over=0);if(p)if(1===this.containers.length)this.containers[d].containerCache.over||(this.containers[d]._trigger("over",e,this._uiHash(this)),this.containers[d].containerCache.over=1);else{for(n=1e4,o=null,c=p.floating||this._isFloating(this.currentItem),r=c?"left":"top",a=c?"width":"height",u=c?"pageX":"pageY",s=this.items.length-1;s>=0;s--)t.contains(this.containers[d].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(l=this.items[s].item.offset()[r],h=!1,e[u]-l>this.items[s][a]/2&&(h=!0),n>Math.abs(e[u]-l)&&(n=Math.abs(e[u]-l),o=this.items[s],this.direction=h?"up":"down"));if(!o&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[d])return void(this.currentContainer.containerCache.over||(this.containers[d]._trigger("over",e,this._uiHash()),this.currentContainer.containerCache.over=1));o?this._rearrange(e,o,null,!0):this._rearrange(e,null,this.containers[d].element,!0),this._trigger("change",e,this._uiHash()),this.containers[d]._trigger("change",e,this._uiHash(this)),this.currentContainer=this.containers[d],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",e,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,r=e.pageY,a="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=/(html|body)/i.test(a[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.leftthis.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(r=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((r-this.originalPageY)/n.grid[1])*n.grid[1],r=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:r-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():l?0:a.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():l?0:a.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){!1===t.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}}),t.widget("ui.menu",{version:"1.12.1",defaultElement:"